| 2765 | }; |
| 2766 | #endif |
| 2767 | int |
| 2768 | sys_fchflags(struct thread *td, struct fchflags_args *uap) |
| 2769 | { |
| 2770 | struct file *fp; |
| 2771 | int error; |
| 2772 | |
| 2773 | AUDIT_ARG_FD(uap->fd); |
| 2774 | AUDIT_ARG_FFLAGS(uap->flags); |
| 2775 | error = getvnode(td, uap->fd, &cap_fchflags_rights, |
| 2776 | &fp); |
| 2777 | if (error != 0) |
| 2778 | return (error); |
| 2779 | #ifdef AUDIT |
| 2780 | vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); |
| 2781 | AUDIT_ARG_VNODE1(fp->f_vnode); |
| 2782 | VOP_UNLOCK(fp->f_vnode); |
| 2783 | #endif |
| 2784 | error = setfflags(td, fp->f_vnode, uap->flags); |
| 2785 | fdrop(fp, td); |
| 2786 | return (error); |
| 2787 | } |
| 2788 | |
| 2789 | /* |
| 2790 | * Common implementation code for chmod(), lchmod() and fchmod(). |