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

Function kern_preadv

freebsd/kern/sys_generic.c:320–338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318}
319
320int
321kern_preadv(struct thread *td, int fd, struct uio *auio, off_t offset)
322{
323 struct file *fp;
324 int error;
325
326 error = fget_read(td, fd, &cap_pread_rights, &fp);
327 if (error)
328 return (error);
329 if (!(fp->f_ops->fo_flags & DFLAG_SEEKABLE))
330 error = ESPIPE;
331 else if (offset < 0 &&
332 (fp->f_vnode == NULL || fp->f_vnode->v_type != VCHR))
333 error = EINVAL;
334 else
335 error = dofileread(td, fd, fp, auio, offset, FOF_OFFSET);
336 fdrop(fp, td);
337 return (error);
338}
339
340/*
341 * Common code for readv and preadv that reads data in

Callers 2

kern_preadFunction · 0.85
sys_preadvFunction · 0.85

Calls 2

fget_readFunction · 0.85
dofilereadFunction · 0.85

Tested by

no test coverage detected