| 520 | } |
| 521 | |
| 522 | int |
| 523 | kern_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 |
no test coverage detected