MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ff_read

Function ff_read

lib/ff_syscall_wrapper.c:1072–1098  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1070}
1071
1072ssize_t
1073ff_read(int fd, void *buf, size_t nbytes)
1074{
1075 struct uio auio;
1076 struct iovec aiov;
1077 int rc;
1078
1079 if (nbytes > INT_MAX) {
1080 rc = EINVAL;
1081 goto kern_fail;
1082 }
1083
1084 aiov.iov_base = buf;
1085 aiov.iov_len = nbytes;
1086 auio.uio_iov = &aiov;
1087 auio.uio_iovcnt = 1;
1088 auio.uio_resid = nbytes;
1089 auio.uio_segflg = UIO_SYSSPACE;
1090 if ((rc = kern_readv(curthread, fd, &auio)))
1091 goto kern_fail;
1092 rc = curthread->td_retval[0];
1093
1094 return (rc);
1095kern_fail:
1096 ff_os_errno(rc);
1097 return (-1);
1098}
1099
1100ssize_t
1101ff_readv(int fd, const struct iovec *iov, int iovcnt)

Callers 7

loopFunction · 0.85
loopFunction · 0.85
loopFunction · 0.85
readFunction · 0.85
readFunction · 0.85
ff_sys_readFunction · 0.85
ff_hook_readFunction · 0.85

Calls 2

kern_readvFunction · 0.85
ff_os_errnoFunction · 0.85

Tested by

no test coverage detected