Lines Matching refs:fdp
226 cap_rights(struct filedesc *fdp, int fd) in cap_rights() argument
229 return (cap_rights_fde(&fdp->fd_ofiles[fd])); in cap_rights()
235 struct filedesc *fdp; in kern_cap_rights_limit() local
240 fdp = td->td_proc->p_fd; in kern_cap_rights_limit()
241 FILEDESC_XLOCK(fdp); in kern_cap_rights_limit()
242 fdep = fdeget_locked(fdp, fd); in kern_cap_rights_limit()
244 FILEDESC_XUNLOCK(fdp); in kern_cap_rights_limit()
248 error = _cap_check(cap_rights(fdp, fd), rights, CAPFAIL_INCREASE); in kern_cap_rights_limit()
261 FILEDESC_XUNLOCK(fdp); in kern_cap_rights_limit()
315 struct filedesc *fdp; in sys___cap_rights_get() local
326 fdp = td->td_proc->p_fd; in sys___cap_rights_get()
327 FILEDESC_SLOCK(fdp); in sys___cap_rights_get()
328 if (fget_locked(fdp, fd) == NULL) { in sys___cap_rights_get()
329 FILEDESC_SUNLOCK(fdp); in sys___cap_rights_get()
332 rights = *cap_rights(fdp, fd); in sys___cap_rights_get()
333 FILEDESC_SUNLOCK(fdp); in sys___cap_rights_get()
360 cap_ioctl_check(struct filedesc *fdp, int fd, u_long cmd) in cap_ioctl_check() argument
367 KASSERT(fd >= 0 && fd < fdp->fd_nfiles, in cap_ioctl_check()
370 fdep = fdeget_locked(fdp, fd); in cap_ioctl_check()
421 struct filedesc *fdp; in kern_cap_ioctls_limit() local
433 fdp = td->td_proc->p_fd; in kern_cap_ioctls_limit()
434 FILEDESC_XLOCK(fdp); in kern_cap_ioctls_limit()
436 fdep = fdeget_locked(fdp, fd); in kern_cap_ioctls_limit()
455 FILEDESC_XUNLOCK(fdp); in kern_cap_ioctls_limit()
490 struct filedesc *fdp; in sys_cap_ioctls_get() local
503 fdp = td->td_proc->p_fd; in sys_cap_ioctls_get()
511 FILEDESC_SLOCK(fdp); in sys_cap_ioctls_get()
512 fdep = fdeget_locked(fdp, fd); in sys_cap_ioctls_get()
515 FILEDESC_SUNLOCK(fdp); in sys_cap_ioctls_get()
523 FILEDESC_SUNLOCK(fdp); in sys_cap_ioctls_get()
567 cap_fcntl_check(struct filedesc *fdp, int fd, int cmd) in cap_fcntl_check() argument
570 KASSERT(fd >= 0 && fd < fdp->fd_nfiles, in cap_fcntl_check()
573 return (cap_fcntl_check_fde(&fdp->fd_ofiles[fd], cmd)); in cap_fcntl_check()
579 struct filedesc *fdp; in sys_cap_fcntls_limit() local
593 fdp = td->td_proc->p_fd; in sys_cap_fcntls_limit()
594 FILEDESC_XLOCK(fdp); in sys_cap_fcntls_limit()
596 fdep = fdeget_locked(fdp, fd); in sys_cap_fcntls_limit()
598 FILEDESC_XUNLOCK(fdp); in sys_cap_fcntls_limit()
603 FILEDESC_XUNLOCK(fdp); in sys_cap_fcntls_limit()
610 FILEDESC_XUNLOCK(fdp); in sys_cap_fcntls_limit()
618 struct filedesc *fdp; in sys_cap_fcntls_get() local
627 fdp = td->td_proc->p_fd; in sys_cap_fcntls_get()
628 FILEDESC_SLOCK(fdp); in sys_cap_fcntls_get()
629 fdep = fdeget_locked(fdp, fd); in sys_cap_fcntls_get()
631 FILEDESC_SUNLOCK(fdp); in sys_cap_fcntls_get()
635 FILEDESC_SUNLOCK(fdp); in sys_cap_fcntls_get()