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

Function kern_pwritev

freebsd/kern/sys_generic.c:522–540  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

520}
521
522int
523kern_pwritev(struct thread *td, int fd, struct uio *auio, off_t offset)
524{
525 struct file *fp;
526 int error;
527
528 error = fget_write(td, fd, &cap_pwrite_rights, &fp);
529 if (error)
530 return (error);
531 if (!(fp->f_ops->fo_flags & DFLAG_SEEKABLE))
532 error = ESPIPE;
533 else if (offset < 0 &&
534 (fp->f_vnode == NULL || fp->f_vnode->v_type != VCHR))
535 error = EINVAL;
536 else
537 error = dofilewrite(td, fd, fp, auio, offset, FOF_OFFSET);
538 fdrop(fp, td);
539 return (error);
540}
541
542/*
543 * Common code for writev and pwritev that writes data to

Callers 2

kern_pwriteFunction · 0.85
sys_pwritevFunction · 0.85

Calls 2

fget_writeFunction · 0.85
dofilewriteFunction · 0.85

Tested by

no test coverage detected