Home
last modified time | relevance | path

Searched refs:fdp (Results 1 – 25 of 80) sorted by relevance

1234

/NextBSD/sys/kern/
HDkern_descrip.c104 static int closefp(struct filedesc *fdp, int fd, struct file *fp,
106 static int fd_first_free(struct filedesc *fdp, int low, int size);
107 static int fd_last_used(struct filedesc *fdp, int size);
108 static void fdgrowtable(struct filedesc *fdp, int nfd);
109 static void fdgrowtable_exp(struct filedesc *fdp, int nfd);
110 static void fdunused(struct filedesc *fdp, int fd);
111 static void fdused(struct filedesc *fdp, int fd);
182 fd_first_free(struct filedesc *fdp, int low, int size) in fd_first_free() argument
184 NDSLOTTYPE *map = fdp->fd_map; in fd_first_free()
209 fd_last_used(struct filedesc *fdp, int size) in fd_last_used() argument
[all …]
HDsys_capability.c210 cap_rights(struct filedesc *fdp, int fd) in cap_rights() argument
213 return (cap_rights_fde(&fdp->fd_ofiles[fd])); in cap_rights()
219 struct filedesc *fdp; in kern_cap_rights_limit() local
222 fdp = td->td_proc->p_fd; in kern_cap_rights_limit()
223 FILEDESC_XLOCK(fdp); in kern_cap_rights_limit()
224 if (fget_locked(fdp, fd) == NULL) { in kern_cap_rights_limit()
225 FILEDESC_XUNLOCK(fdp); in kern_cap_rights_limit()
228 error = _cap_check(cap_rights(fdp, fd), rights, CAPFAIL_INCREASE); in kern_cap_rights_limit()
230 fdp->fd_ofiles[fd].fde_rights = *rights; in kern_cap_rights_limit()
232 free(fdp->fd_ofiles[fd].fde_ioctls, M_FILECAPS); in kern_cap_rights_limit()
[all …]
HDsys_generic.c738 struct filedesc *fdp; in kern_ioctl() local
747 fdp = td->td_proc->p_fd; in kern_ioctl()
752 FILEDESC_XLOCK(fdp); in kern_ioctl()
757 FILEDESC_SLOCK(fdp); in kern_ioctl()
766 if ((fp = fget_locked(fdp, fd)) == NULL) { in kern_ioctl()
770 if ((error = cap_ioctl_check(fdp, fd, com)) != 0) { in kern_ioctl()
776 FILEDESC_SUNLOCK(fdp); in kern_ioctl()
793 fdp->fd_ofiles[fd].fde_flags &= ~UF_EXCLOSE; in kern_ioctl()
796 fdp->fd_ofiles[fd].fde_flags |= UF_EXCLOSE; in kern_ioctl()
818 FILEDESC_XUNLOCK(fdp); in kern_ioctl()
[all …]
/NextBSD/sys/sys/
HDfiledesc.h123 #define FILEDESC_LOCK_INIT(fdp) sx_init(&(fdp)->fd_sx, "filedesc structure") argument
124 #define FILEDESC_LOCK_DESTROY(fdp) sx_destroy(&(fdp)->fd_sx) argument
125 #define FILEDESC_LOCK(fdp) (&(fdp)->fd_sx) argument
126 #define FILEDESC_XLOCK(fdp) sx_xlock(&(fdp)->fd_sx) argument
127 #define FILEDESC_XUNLOCK(fdp) sx_xunlock(&(fdp)->fd_sx) argument
128 #define FILEDESC_SLOCK(fdp) sx_slock(&(fdp)->fd_sx) argument
129 #define FILEDESC_SUNLOCK(fdp) sx_sunlock(&(fdp)->fd_sx) argument
131 #define FILEDESC_LOCK_ASSERT(fdp) sx_assert(&(fdp)->fd_sx, SX_LOCKED | \ argument
133 #define FILEDESC_XLOCK_ASSERT(fdp) sx_assert(&(fdp)->fd_sx, SX_XLOCKED | \ argument
135 #define FILEDESC_UNLOCK_ASSERT(fdp) sx_assert(&(fdp)->fd_sx, SX_UNLOCKED) argument
[all …]
/NextBSD/sys/compat/mach/ipc/
HDipc_entry.c152 static void fdunused(struct filedesc *fdp, int fd);
155 static inline void kern_fdfree(struct filedesc *fdp, int fd);
275 struct filedesc *fdp __unused) in mach_port_fill_kinfo()
587 struct filedesc *fdp; in ipc_entry_close() local
592 fdp = td->td_proc->p_fd; in ipc_entry_close()
596 FILEDESC_XLOCK(fdp); in ipc_entry_close()
597 if ((fp = fget_locked(fdp, fd)) == NULL) { in ipc_entry_close()
598 FILEDESC_XUNLOCK(fdp); in ipc_entry_close()
604 kern_fdfree(fdp, fd); in ipc_entry_close()
605 FILEDESC_XUNLOCK(fdp); in ipc_entry_close()
[all …]
/NextBSD/contrib/gcc/
HDmips-tdump.c426 type_to_string (AUXU *aux_ptr, int index, FDR *fdp) in type_to_string() argument
523 emit_aggregate (p1, aux_ptr[index], aux_ptr[index+1], "struct", fdp); in type_to_string()
536 emit_aggregate (p1, aux_ptr[index], aux_ptr[index+1], "union", fdp); in type_to_string()
549 emit_aggregate (p1, aux_ptr[index], aux_ptr[index+1], "enum", fdp); in type_to_string()
864 int ifd, FDR *fdp) in print_symbol() argument
933 type_to_string (aux_base, index+1, fdp)); in print_symbol()
968 type_to_string (aux_base, index, fdp)); in print_symbol()
1061 emit_aggregate (char *string, AUXU u, AUXU u2, const char *which, FDR *fdp) in emit_aggregate() argument
1079 if (fdp == 0 || sym_hdr.crfd == 0) in emit_aggregate()
1080 fdp = &file_desc[ifd]; in emit_aggregate()
[all …]
/NextBSD/contrib/ipfilter/lib/
HDprint_toif.c15 print_toif(family, tag, base, fdp) in print_toif() argument
19 frdest_t *fdp;
21 switch (fdp->fd_type)
24 PRINTF("%s %s%s", tag, base + fdp->fd_name,
25 (fdp->fd_ptr || (long)fdp->fd_ptr == -1) ? "" : "(!)");
28 if (IP6_NOTZERO(&fdp->fd_ip6)) {
31 inet_ntop(AF_INET6, &fdp->fd_ip6, ipv6addr,
32 sizeof(fdp->fd_ip6));
37 if (fdp->fd_ip.s_addr)
38 PRINTF(":%s", inet_ntoa(fdp->fd_ip));
[all …]
/NextBSD/tools/regression/sockets/zerosend/
HDzerosend.c77 setup_udp(const char *test, int *fdp) in setup_udp() argument
110 fdp[0] = sock1; in setup_udp()
111 fdp[1] = sock2; in setup_udp()
115 setup_tcp(const char *test, int *fdp) in setup_tcp() argument
181 fdp[0] = sock2; in setup_tcp()
182 fdp[1] = sock3; in setup_tcp()
186 setup_udsstream(const char *test, int *fdp) in setup_udsstream() argument
189 if (socketpair(PF_LOCAL, SOCK_STREAM, 0, fdp) < 0) in setup_udsstream()
194 setup_udsdgram(const char *test, int *fdp) in setup_udsdgram() argument
197 if (socketpair(PF_LOCAL, SOCK_DGRAM, 0, fdp) < 0) in setup_udsdgram()
[all …]
/NextBSD/sys/fs/fdescfs/
HDfdesc_vfsops.c187 struct filedesc *fdp; local
203 fdp = td->td_proc->p_fd;
204 FILEDESC_SLOCK(fdp);
208 last = min(fdp->fd_nfiles, lim);
210 for (i = fdp->fd_freefile; i < last; i++)
211 if (fdp->fd_ofiles[i].fde_file == NULL)
218 if (fdp->fd_nfiles < lim)
219 freefd += (lim - fdp->fd_nfiles);
220 FILEDESC_SUNLOCK(fdp);
HDfdesc_vnops.c527 struct filedesc *fdp; local
543 fdp = uio->uio_td->td_proc->p_fd;
548 FILEDESC_SLOCK(fdp);
549 while (i < fdp->fd_nfiles + 2 && uio->uio_resid >= UIO_MX) {
562 if (fdp->fd_ofiles[fcnt].fde_file == NULL)
574 FILEDESC_SUNLOCK(fdp);
578 FILEDESC_SLOCK(fdp);
583 FILEDESC_SUNLOCK(fdp);
/NextBSD/sbin/hastd/
HDproto_common.c163 proto_descriptor_recv(int sock, int *fdp) in proto_descriptor_recv() argument
165 unsigned char ctrl[CMSG_SPACE(sizeof(*fdp))]; in proto_descriptor_recv()
170 PJDLOG_ASSERT(fdp != NULL); in proto_descriptor_recv()
188 bcopy(CMSG_DATA(cmsg), fdp, sizeof(*fdp)); in proto_descriptor_recv()
194 proto_common_recv(int sock, unsigned char *data, size_t size, int *fdp) in proto_common_recv() argument
229 if (fdp == NULL) in proto_common_recv()
231 return (proto_descriptor_recv(sock, fdp)); in proto_common_recv()
/NextBSD/contrib/openbsm/bin/auditdistd/
HDproto_common.c162 proto_descriptor_recv(int sock, int *fdp) in proto_descriptor_recv() argument
164 unsigned char ctrl[CMSG_SPACE(sizeof(*fdp))]; in proto_descriptor_recv()
169 PJDLOG_ASSERT(fdp != NULL); in proto_descriptor_recv()
187 bcopy(CMSG_DATA(cmsg), fdp, sizeof(*fdp)); in proto_descriptor_recv()
193 proto_common_recv(int sock, unsigned char *data, size_t size, int *fdp) in proto_common_recv() argument
228 if (fdp == NULL) in proto_common_recv()
230 return (proto_descriptor_recv(sock, fdp)); in proto_common_recv()
/NextBSD/sys/compat/freebsd32/
HDfreebsd32_capability.c100 struct filedesc *fdp; in freebsd32_cap_ioctls_get() local
114 fdp = td->td_proc->p_fd; in freebsd32_cap_ioctls_get()
115 FILEDESC_SLOCK(fdp); in freebsd32_cap_ioctls_get()
117 if (fget_locked(fdp, fd) == NULL) { in freebsd32_cap_ioctls_get()
128 fdep = &fdp->fd_ofiles[fd]; in freebsd32_cap_ioctls_get()
144 FILEDESC_SUNLOCK(fdp); in freebsd32_cap_ioctls_get()
/NextBSD/lib/libc/stdio/
HDfclose.c88 fdclose(FILE *fp, int *fdp) in fdclose() argument
92 if (fdp != NULL) in fdclose()
93 *fdp = -1; in fdclose()
114 if (fdp != NULL) in fdclose()
115 *fdp = fp->_file; in fdclose()
/NextBSD/lib/libgeom/
HDgeom_util.c276 g_device_path_open(const char *devpath, int *fdp, int dowrite) in g_device_path_open() argument
282 if (fdp != NULL) in g_device_path_open()
283 *fdp = -1; in g_device_path_open()
302 if (fdp != NULL) in g_device_path_open()
303 *fdp = fd; in g_device_path_open()
329 if (fdp != NULL) in g_device_path_open()
330 *fdp = fd; in g_device_path_open()
/NextBSD/sys/security/audit/
HDaudit_bsm_klib.c469 struct filedesc *fdp; in audit_canon_path() local
479 fdp = td->td_proc->p_fd; in audit_canon_path()
480 FILEDESC_SLOCK(fdp); in audit_canon_path()
485 if (fdp->fd_rdir != NULL && fdp->fd_rdir != rootvnode) { in audit_canon_path()
486 rvnp = fdp->fd_rdir; in audit_canon_path()
496 cvnp = fdp->fd_cdir; in audit_canon_path()
502 FILEDESC_SUNLOCK(fdp); in audit_canon_path()
511 needslash = (fdp->fd_rdir != cvnp); in audit_canon_path()
515 FILEDESC_SUNLOCK(fdp); in audit_canon_path()
/NextBSD/tools/regression/capsicum/syscalls/
HDmisc.c86 descriptor_recv(int sock, int *fdp) in descriptor_recv() argument
88 unsigned char ctrl[CMSG_SPACE(sizeof(*fdp))]; in descriptor_recv()
95 assert(fdp != NULL); in descriptor_recv()
125 bcopy(CMSG_DATA(cmsg), fdp, sizeof(*fdp)); in descriptor_recv()
/NextBSD/sys/compat/svr4/
HDsvr4_filio.c201 struct filedesc *fdp = td->td_proc->p_fd; local
209 FILEDESC_XLOCK(fdp);
210 fde = &fdp->fd_ofiles[fd];
212 FILEDESC_XUNLOCK(fdp);
216 FILEDESC_XLOCK(fdp);
217 fde = &fdp->fd_ofiles[fd];
219 FILEDESC_XUNLOCK(fdp);
/NextBSD/tests/sys/kern/
HDunix_passfd_test.c56 domainsocketpair(int *fdp) in domainsocketpair() argument
59 ATF_REQUIRE_MSG(socketpair(PF_UNIX, SOCK_STREAM, 0, fdp) != -1, in domainsocketpair()
64 closesocketpair(int *fdp) in closesocketpair() argument
67 close(fdp[0]); in closesocketpair()
68 close(fdp[1]); in closesocketpair()
72 devnull(int *fdp) in devnull() argument
78 *fdp = fd; in devnull()
82 tempfile(int *fdp) in tempfile() argument
92 *fdp = fd; in tempfile()
/NextBSD/tools/test/upsdl/
HDupsdl.c38 int prepareFile(char* filename,int* fdp);
48 int prepareFile(char* filename,int* fdp) in prepareFile() argument
92 *fdp = fd; in prepareFile()
/NextBSD/sys/contrib/ipfilter/netinet/
HDip_fil_freebsd.c709 ipf_fastroute(m0, mpp, fin, fdp) in ipf_fastroute() argument
712 frdest_t *fdp;
775 if ((fr != NULL) && !(fr->fr_flags & FR_KEEPSTATE) && (fdp != NULL) &&
776 (fdp->fd_type == FRD_DSTLIST)) {
777 if (ipf_dstlist_select_node(fin, fdp->fd_ptr, NULL, &node) == 0)
778 fdp = &node;
781 if (fdp != NULL)
782 ifp = fdp->fd_ptr;
791 if ((fdp != NULL) && (fdp->fd_ip.s_addr != 0))
792 dst.sin_addr = fdp->fd_ip;
[all …]
/NextBSD/sys/compat/cloudabi/
HDcloudabi_fd.c462 struct filedesc *fdp; in cloudabi_sys_fd_stat_get() local
470 fdp = td->td_proc->p_fd; in cloudabi_sys_fd_stat_get()
472 error = fget_unlocked(fdp, uap->fd, cap_rights_init(&rights), in cloudabi_sys_fd_stat_get()
481 rights = *cap_rights(fdp, uap->fd); in cloudabi_sys_fd_stat_get()
485 modified = fd_modified(fdp, uap->fd, seq); in cloudabi_sys_fd_stat_get()
/NextBSD/contrib/ipfilter/
HDip_fil.c427 ipf_fastroute(m, mpp, fin, fdp) in ipf_fastroute() argument
430 frdest_t *fdp;
445 if (!(fr->fr_flags & FR_KEEPSTATE) && (fdp != NULL) &&
446 (fdp->fd_type == FRD_DSTLIST)) {
448 ipf_dstlist_select_node(fin, fdp->fd_ptr, NULL, &node);
449 fdp = &node;
451 ifp = fdp->fd_ptr;
/NextBSD/sys/compat/linprocfs/
HDlinprocfs.c874 struct filedesc *fdp; in linprocfs_doproccwd() local
879 fdp = p->p_fd; in linprocfs_doproccwd()
880 FILEDESC_SLOCK(fdp); in linprocfs_doproccwd()
881 vp = fdp->fd_cdir; in linprocfs_doproccwd()
884 FILEDESC_SUNLOCK(fdp); in linprocfs_doproccwd()
900 struct filedesc *fdp; in linprocfs_doprocroot() local
905 fdp = p->p_fd; in linprocfs_doprocroot()
906 FILEDESC_SLOCK(fdp); in linprocfs_doprocroot()
907 vp = jailed(p->p_ucred) ? fdp->fd_jdir : fdp->fd_rdir; in linprocfs_doprocroot()
910 FILEDESC_SUNLOCK(fdp); in linprocfs_doprocroot()
/NextBSD/contrib/amd/amd/
HDnfs_start.c101 do_select(sigset_t smask, int fds, fd_set *fdp, struct timeval *tvp) in do_select() argument
103 do_select(int smask, int fds, fd_set *fdp, struct timeval *tvp) in do_select()
138 nsel = select(fds, fdp, (fd_set *) 0, (fd_set *) 0, in do_select()

1234