Home
last modified time | relevance | path

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

1234

/freebsd/sys/sys/
H A Dfiledesc.h177 #define FILEDESC_LOCK_INIT(fdp) sx_init(&(fdp)->fd_sx, "filedesc structure") argument
178 #define FILEDESC_LOCK_DESTROY(fdp) sx_destroy(&(fdp)->fd_sx) argument
179 #define FILEDESC_LOCK(fdp) (&(fdp)->fd_sx) argument
180 #define FILEDESC_XLOCK(fdp) sx_xlock(&(fdp)->fd_sx) argument
181 #define FILEDESC_XUNLOCK(fdp) sx_xunlock(&(fdp)->fd_sx) argument
182 #define FILEDESC_SLOCK(fdp) sx_slock(&(fdp)->fd_sx) argument
183 #define FILEDESC_SUNLOCK(fdp) sx_sunlock(&(fdp)->fd_sx) argument
185 #define FILEDESC_LOCK_ASSERT(fdp) sx_assert(&(fdp)->fd_sx, SX_LOCKED | \ argument
187 #define FILEDESC_XLOCK_ASSERT(fdp) sx_assert(&(fdp)->fd_sx, SX_XLOCKED | \ argument
189 #define FILEDESC_UNLOCK_ASSERT(fdp) sx_assert(&(fdp)->fd_sx, SX_UNLOCKED) argument
[all …]
/freebsd/sys/kern/
H A Dkern_descrip.c501 fdp = p->p_fd; in kern_fcntl()
941 fdp = p->p_fd; in kern_dup()
1967 if (curproc->p_fd != fdp || FILEDESC_IS_ONLY_USER(fdp)) { in fdgrowtable()
2009 fd = fd_first_free(fdp, minfd, fdp->fd_nfiles); in fdalloc()
2293 return (fdp); in fdhold()
2351 return (fdp); in fdshare()
2576 fddrop(fdp); in fdescfree_fds()
2993 fddrop(fdp); in fget_remote()
4442 fddrop(fdp); in sysctl_kern_file()
4670 efbuf->fdp = fdp; in kern_proc_filedesc_out()
[all …]
H A Dsys_capability.c231 struct filedesc *fdp; in kern_cap_rights_limit() local
237 FILEDESC_XLOCK(fdp); in kern_cap_rights_limit()
257 FILEDESC_XUNLOCK(fdp); in kern_cap_rights_limit()
311 struct filedesc *fdp; in sys___cap_rights_get() local
323 FILEDESC_SLOCK(fdp); in sys___cap_rights_get()
417 struct filedesc *fdp; in kern_cap_ioctls_limit() local
430 FILEDESC_XLOCK(fdp); in kern_cap_ioctls_limit()
486 struct filedesc *fdp; in sys_cap_ioctls_get() local
507 FILEDESC_SLOCK(fdp); in sys_cap_ioctls_get()
590 FILEDESC_XLOCK(fdp); in sys_cap_fcntls_limit()
[all …]
H A Dsys_generic.c728 struct filedesc *fdp; in kern_ioctl() local
739 FILEDESC_XLOCK(fdp); in kern_ioctl()
744 FILEDESC_SLOCK(fdp); in kern_ioctl()
767 FILEDESC_SUNLOCK(fdp); in kern_ioctl()
809 FILEDESC_XUNLOCK(fdp); in kern_ioctl()
1140 struct filedesc *fdp; in kern_select() local
1158 lf = fdp->fd_nfiles; in kern_select()
1384 struct filedesc *fdp; in selrescan() local
1434 struct filedesc *fdp; in selscan() local
1643 struct filedesc *fdp; in pollrescan() local
[all …]
/freebsd/sbin/ipf/libipf/
H A Dprint_toif.c14 print_toif(int family, char *tag, char *base, frdest_t *fdp) in print_toif() argument
16 switch (fdp->fd_type) in print_toif()
19 PRINTF("%s %s%s", tag, base + fdp->fd_name, in print_toif()
20 (fdp->fd_ptr || (long)fdp->fd_ptr == -1) ? "" : "(!)"); in print_toif()
23 if (IP6_NOTZERO(&fdp->fd_ip6)) { in print_toif()
26 inet_ntop(AF_INET6, &fdp->fd_ip6, ipv6addr, in print_toif()
27 sizeof(fdp->fd_ip6)); in print_toif()
32 if (fdp->fd_ip.s_addr) in print_toif()
33 PRINTF(":%s", inet_ntoa(fdp->fd_ip)); in print_toif()
38 PRINTF("%s dstlist/%s ", tag, base + fdp->fd_name); in print_toif()
[all …]
/freebsd/tools/regression/sockets/zerosend/
H A Dzerosend.c108 fdp[0] = sock1; in setup_udp()
109 fdp[1] = sock2; in setup_udp()
179 fdp[0] = sock2; in setup_tcp()
180 fdp[1] = sock3; in setup_tcp()
203 if (pipe(fdp) < 0) in setup_pipe()
228 fdp[0] = fd2; in setup_fifo()
229 fdp[1] = fd1; in setup_fifo()
236 close(fdp[0]); in close_both()
237 fdp[0] = -1; in close_both()
238 close(fdp[1]); in close_both()
[all …]
/freebsd/lib/libcasper/libcasper/
H A Dlibcasper_impl.c49 fd_fix_environment(int *fdp) in fd_fix_environment() argument
53 if (*fdp > STDERR_FILENO) in fd_fix_environment()
60 while (*fdp <= STDERR_FILENO) { in fd_fix_environment()
61 nfd = dup(*fdp); in fd_fix_environment()
64 if (dup2(nullfd, *fdp) == -1) in fd_fix_environment()
66 *fdp = nfd; in fd_fix_environment()
/freebsd/sys/fs/fdescfs/
H A Dfdesc_vfsops.c185 struct filedesc *fdp; in fdesc_statfs() local
201 fdp = td->td_proc->p_fd; in fdesc_statfs()
202 FILEDESC_SLOCK(fdp); in fdesc_statfs()
206 last = min(fdp->fd_nfiles, lim); in fdesc_statfs()
208 for (i = fdp->fd_freefile; i < last; i++) in fdesc_statfs()
209 if (fdp->fd_ofiles[i].fde_file == NULL) in fdesc_statfs()
216 if (fdp->fd_nfiles < lim) in fdesc_statfs()
217 freefd += (lim - fdp->fd_nfiles); in fdesc_statfs()
218 FILEDESC_SUNLOCK(fdp); in fdesc_statfs()
H A Dfdesc_vnops.c539 struct filedesc *fdp; in fdesc_readdir() local
556 fdp = uio->uio_td->td_proc->p_fd; in fdesc_readdir()
561 FILEDESC_SLOCK(fdp); in fdesc_readdir()
562 while (i < fdp->fd_nfiles + 2 && uio->uio_resid >= UIO_MX) { in fdesc_readdir()
575 if (fdp->fd_ofiles[fcnt].fde_file == NULL) in fdesc_readdir()
591 FILEDESC_SUNLOCK(fdp); in fdesc_readdir()
595 FILEDESC_SLOCK(fdp); in fdesc_readdir()
600 FILEDESC_SUNLOCK(fdp); in fdesc_readdir()
/freebsd/contrib/file/src/
H A Dcompress.c910 if (fdp[STDIN_FILENO][1] > 2) in handledesc()
918 if (fdp[STDOUT_FILENO][0] > 2) in handledesc()
924 if (fdp[STDERR_FILENO][0] > 2) in handledesc()
1052 int fdp[3][2]; in uncompressbuf() local
1081 fdp[i][0] = fdp[i][1] = -1; in uncompressbuf()
1100 closep(fdp[STDIN_FILENO]); in uncompressbuf()
1101 closep(fdp[STDOUT_FILENO]); in uncompressbuf()
1110 handledesc(&fa, fd, fdp); in uncompressbuf()
1137 handledesc(NULL, fd, fdp); in uncompressbuf()
1149 closefd(fdp[i], 1); in uncompressbuf()
[all …]
/freebsd/contrib/openbsm/bin/auditdistd/
H A Dproto_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()
/freebsd/sbin/hastd/
H A Dproto_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()
/freebsd/sys/compat/freebsd32/
H A Dfreebsd32_capability.c88 struct filedesc *fdp; in freebsd32_cap_ioctls_get() local
102 fdp = td->td_proc->p_fd; in freebsd32_cap_ioctls_get()
103 FILEDESC_SLOCK(fdp); in freebsd32_cap_ioctls_get()
105 if (fget_noref(fdp, fd) == NULL) { in freebsd32_cap_ioctls_get()
116 fdep = &fdp->fd_ofiles[fd]; in freebsd32_cap_ioctls_get()
133 FILEDESC_SUNLOCK(fdp); in freebsd32_cap_ioctls_get()
/freebsd/lib/libc/stdio/
H A Dfclose.c84 fdclose(FILE *fp, int *fdp) in fdclose() argument
88 if (fdp != NULL) in fdclose()
89 *fdp = -1; in fdclose()
110 if (fdp != NULL) in fdclose()
111 *fdp = fp->_file; in fdclose()
/freebsd/tools/regression/capsicum/syscalls/
H A Dmisc.c83 descriptor_recv(int sock, int *fdp) in descriptor_recv() argument
85 unsigned char ctrl[CMSG_SPACE(sizeof(*fdp))]; in descriptor_recv()
92 assert(fdp != NULL); in descriptor_recv()
122 bcopy(CMSG_DATA(cmsg), fdp, sizeof(*fdp)); in descriptor_recv()
/freebsd/lib/libthr/thread/
H A Dthr_fork.c141 void *fdp; member
160 return (__sys_pdfork(a->fdp, a->flags)); in thr_fork_impl()
211 ret = syscall(SYS_pdfork, a->fdp, a->flags); in thr_fork_impl()
319 __thr_pdfork(int *fdp, int flags) in __thr_pdfork() argument
324 a.fdp = fdp; in __thr_pdfork()
/freebsd/lib/libgeom/
H A Dgeom_util.c273 g_device_path_open(const char *devpath, int *fdp, int dowrite) in g_device_path_open() argument
279 if (fdp != NULL) in g_device_path_open()
280 *fdp = -1; in g_device_path_open()
315 if (fdp != NULL) in g_device_path_open()
316 *fdp = fd; in g_device_path_open()
/freebsd/tools/test/stress2/misc/
H A Dsendmsg2.sh119 int *fdp, *end;
121 fdp = (int *)CMSG_DATA(c);
123 for (i = 0; fdp+i < end; i++) {
124 printf("fd[%d]=%d\n", i, fdp[i]);
/freebsd/contrib/capsicum-test/
H A Dprocdesc.cc372 struct pollfd fdp; in TEST_F() local
373 fdp.fd = pd_; in TEST_F()
375 fdp.revents = 0; in TEST_F()
376 EXPECT_EQ(0, poll(&fdp, 1, 0)); in TEST_F()
381 EXPECT_EQ(1, poll(&fdp, 1, 2000)); in TEST_F()
385 fdp.revents = 0; in TEST_F()
386 EXPECT_EQ(1, poll(&fdp, 1, 0)); in TEST_F()
424 struct pollfd fdp; in TEST_F() local
425 fdp.fd = pd_; in TEST_F()
427 fdp.revents = 0; in TEST_F()
[all …]
/freebsd/lib/libc/sys/
H A Dpdfork.c38 pdfork(int *fdp, int flags) in pdfork() argument
40 return (INTERPOS_SYS(pdfork, fdp, flags)); in pdfork()
/freebsd/tools/test/upsdl/
H A Dupsdl.c37 int prepareFile(const char* filename,int* fdp);
47 int prepareFile(const char* filename,int* fdp) in prepareFile() argument
91 *fdp = fd; in prepareFile()
/freebsd/tests/sys/kern/
H A Dfdgrowtable_test.c215 struct filedesc fdp; in filedesc_refcnt() local
217 ATF_REQUIRE(kvm_read(kd, (unsigned long) kp->ki_fd, &fdp, sizeof(fdp)) > 0); in filedesc_refcnt()
219 return (fdp.fd_refcnt); in filedesc_refcnt()
H A Dunix_passfd_test.c61 domainsocketpair(int *fdp) in domainsocketpair() argument
69 closesocketpair(int *fdp) in closesocketpair() argument
72 close(fdp[0]); in closesocketpair()
73 close(fdp[1]); in closesocketpair()
77 devnull(int *fdp) in devnull() argument
83 *fdp = fd; in devnull()
87 tempfile(int *fdp) in tempfile() argument
97 *fdp = fd; in tempfile()
140 int *fdp, i; in putfds() local
146 for (fdp = (int *)CMSG_DATA(cm), i = 0; i < nfds; i++) in putfds()
[all …]
/freebsd/tests/sys/cddl/zfs/bin/
H A Dmmapwrite.c46 mapper(void *fdp) in mapper() argument
49 int fd = *(int *)fdp; in mapper()
/freebsd/sbin/ipf/ipftest/
H A Dip_fil.c369 ipf_fastroute(m, mpp, fin, fdp) in ipf_fastroute() argument
372 frdest_t *fdp;
387 if (!(fr->fr_flags & FR_KEEPSTATE) && (fdp != NULL) &&
388 (fdp->fd_type == FRD_DSTLIST)) {
390 ipf_dstlist_select_node(fin, fdp->fd_ptr, NULL, &node);
391 fdp = &node;
393 ifp = fdp->fd_ptr;

1234