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

Function sys_cap_fcntls_get

freebsd/kern/sys_capability.c:615–638  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

613}
614
615int
616sys_cap_fcntls_get(struct thread *td, struct cap_fcntls_get_args *uap)
617{
618 struct filedesc *fdp;
619 struct filedescent *fdep;
620 uint32_t rights;
621 int fd;
622
623 fd = uap->fd;
624
625 AUDIT_ARG_FD(fd);
626
627 fdp = td->td_proc->p_fd;
628 FILEDESC_SLOCK(fdp);
629 fdep = fdeget_locked(fdp, fd);
630 if (fdep == NULL) {
631 FILEDESC_SUNLOCK(fdp);
632 return (EBADF);
633 }
634 rights = fdep->fde_fcntls;
635 FILEDESC_SUNLOCK(fdp);
636
637 return (copyout(&rights, uap->fcntlrightsp, sizeof(rights)));
638}
639
640#else /* !CAPABILITIES */
641

Callers

nothing calls this directly

Calls 2

fdeget_lockedFunction · 0.85
copyoutFunction · 0.50

Tested by

no test coverage detected