Home
last modified time | relevance | path

Searched full:fdp (Results 1 – 25 of 109) sorted by relevance

12345

/freebsd/sys/kern/
H A Dkern_descrip.c101 static int closefp(struct filedesc *fdp, int fd, struct file *fp,
105 struct filedesc *fdp, int flags);
106 static int fd_first_free(struct filedesc *fdp, int low, int size);
107 static void fdgrowtable(struct filedesc *fdp, int nfd);
108 static void fdgrowtable_exp(struct filedesc *fdp, int nfd);
109 static void fdunused(struct filedesc *fdp, int fd);
110 static void fdused(struct filedesc *fdp, int fd);
152 #define FILEDESC_FOREACH_FDE(fdp, _iterator, _fde) \ argument
153 struct filedesc *_fdp = (fdp); \
158 #define FILEDESC_FOREACH_FP(fdp, _iterator, _fp) \ argument
[all …]
H A Dsys_capability.c223 cap_rights(struct filedesc *fdp, int fd) in cap_rights() argument
226 return (cap_rights_fde(&fdp->fd_ofiles[fd])); in cap_rights()
232 struct filedesc *fdp; in kern_cap_rights_limit() local
237 fdp = td->td_proc->p_fd; in kern_cap_rights_limit()
238 FILEDESC_XLOCK(fdp); in kern_cap_rights_limit()
239 fdep = fdeget_noref(fdp, fd); in kern_cap_rights_limit()
241 FILEDESC_XUNLOCK(fdp); in kern_cap_rights_limit()
245 error = _cap_check(cap_rights(fdp, fd), rights, CAPFAIL_INCREASE); in kern_cap_rights_limit()
258 FILEDESC_XUNLOCK(fdp); in kern_cap_rights_limit()
312 struct filedesc *fdp; in sys___cap_rights_get() local
[all …]
H A Dsys_generic.c731 struct filedesc *fdp; in kern_ioctl() local
737 fdp = td->td_proc->p_fd; in kern_ioctl()
742 FILEDESC_XLOCK(fdp); in kern_ioctl()
747 FILEDESC_SLOCK(fdp); in kern_ioctl()
756 if ((fp = fget_noref(fdp, fd)) == NULL) { in kern_ioctl()
760 if ((error = cap_ioctl_check(fdp, fd, com)) != 0) { in kern_ioctl()
770 FILEDESC_SUNLOCK(fdp); in kern_ioctl()
787 fdp->fd_ofiles[fd].fde_flags &= ~UF_EXCLOSE; in kern_ioctl()
790 fdp->fd_ofiles[fd].fde_flags |= UF_EXCLOSE; in kern_ioctl()
812 FILEDESC_XUNLOCK(fdp); in kern_ioctl()
[all …]
/freebsd/sys/sys/
H A Dfiledesc.h178 #define FILEDESC_LOCK_INIT(fdp) sx_init(&(fdp)->fd_sx, "filedesc structure") argument
179 #define FILEDESC_LOCK_DESTROY(fdp) sx_destroy(&(fdp)->fd_sx) argument
180 #define FILEDESC_LOCK(fdp) (&(fdp)->fd_sx) argument
181 #define FILEDESC_XLOCK(fdp) sx_xlock(&(fdp)->fd_sx) argument
182 #define FILEDESC_XUNLOCK(fdp) sx_xunlock(&(fdp)->fd_sx) argument
183 #define FILEDESC_SLOCK(fdp) sx_slock(&(fdp)->fd_sx) argument
184 #define FILEDESC_SUNLOCK(fdp) sx_sunlock(&(fdp)->fd_sx) argument
186 #define FILEDESC_LOCK_ASSERT(fdp) sx_assert(&(fdp)->fd_sx, SX_LOCKED | \ argument
188 #define FILEDESC_XLOCK_ASSERT(fdp) sx_assert(&(fdp)->fd_sx, SX_XLOCKED | \ argument
190 #define FILEDESC_UNLOCK_ASSERT(fdp) sx_assert(&(fdp)->fd_sx, SX_UNLOCKED) argument
[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.c75 setup_udp(const char *test, int *fdp, int port1, int port2) in setup_udp() argument
108 fdp[0] = sock1; in setup_udp()
109 fdp[1] = sock2; in setup_udp()
113 setup_tcp(const char *test, int *fdp, int port) in setup_tcp() argument
179 fdp[0] = sock2; in setup_tcp()
180 fdp[1] = sock3; in setup_tcp()
184 setup_udsstream(const char *test, int *fdp) in setup_udsstream() argument
187 if (socketpair(PF_LOCAL, SOCK_STREAM, 0, fdp) < 0) in setup_udsstream()
192 setup_udsdgram(const char *test, int *fdp) in setup_udsdgram() argument
195 if (socketpair(PF_LOCAL, SOCK_DGRAM, 0, fdp) < 0) in setup_udsdgram()
[all …]
/freebsd/contrib/llvm-project/compiler-rt/lib/scudo/standalone/fuzz/
H A Dget_error_info_fuzzer.cpp21 FuzzedDataProvider FDP(Data, Size); in LLVMFuzzerTestOneInput() local
23 uintptr_t FaultAddr = FDP.ConsumeIntegral<uintptr_t>(); in LLVMFuzzerTestOneInput()
24 uintptr_t MemoryAddr = FDP.ConsumeIntegral<uintptr_t>(); in LLVMFuzzerTestOneInput()
27 FDP.ConsumeRandomLengthString(FDP.remaining_bytes()); in LLVMFuzzerTestOneInput()
34 FDP.ConsumeRandomLengthString(FDP.remaining_bytes()); in LLVMFuzzerTestOneInput()
37 FDP.ConsumeRandomLengthString(FDP.remaining_bytes()); in LLVMFuzzerTestOneInput()
44 std::string RingBufferBytes = FDP.ConsumeRemainingBytesAsString(); in LLVMFuzzerTestOneInput()
/freebsd/contrib/file/src/
H A Dcompress.c970 handledesc(void *v, int fd, int fdp[3][2]) in handledesc()
976 movedesc(v, STDIN_FILENO, fdp[STDIN_FILENO][0]); in handledesc()
977 if (fdp[STDIN_FILENO][1] > 2) in handledesc()
978 closedesc(v, fdp[STDIN_FILENO][1]); in handledesc()
983 ///FIXME: if one of the fdp[i][j] is 0 or 1, this can bomb spectacularly in handledesc()
984 movedesc(v, STDOUT_FILENO, fdp[STDOUT_FILENO][1]); in handledesc()
985 if (fdp[STDOUT_FILENO][0] > 2) in handledesc()
986 closedesc(v, fdp[STDOUT_FILENO][0]); in handledesc()
990 movedesc(v, STDERR_FILENO, fdp[STDERR_FILENO][1]); in handledesc()
991 if (fdp[STDERR_FILENO][0] > 2) in handledesc()
[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/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/tools/regression/capsicum/syscalls/
H A Dmisc.c82 descriptor_recv(int sock, int *fdp)
84 unsigned char ctrl[CMSG_SPACE(sizeof(*fdp))]; in descriptor_recv()
91 assert(fdp != NULL); in descriptor_recv()
121 bcopy(CMSG_DATA(cmsg), fdp, sizeof(*fdp)); in descriptor_recv()
83 descriptor_recv(int sock,int * fdp) descriptor_recv() argument
/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()
H A Dfclose.348 .Fn fdclose "FILE *stream" "int *fdp"
68 .Fa fdp
73 .Fa fdp
/freebsd/crypto/krb5/src/lib/krb5/os/
H A Dwrite_msg.c39 k5_write_messages(krb5_context context, krb5_pointer fdp, krb5_data *outbuf, in k5_write_messages() argument
42 int fd = *( (int *) fdp); in k5_write_messages()
73 krb5_write_message(krb5_context context, krb5_pointer fdp, krb5_data *outbuf) in krb5_write_message() argument
75 return k5_write_messages(context, fdp, outbuf, 1); in krb5_write_message()
/freebsd/lib/libthr/thread/
H A Dthr_fork.c145 void *fdp; member
164 return (__sys_pdfork(a->fdp, a->flags)); in thr_fork_impl()
215 ret = syscall(SYS_pdfork, a->fdp, a->flags); in thr_fork_impl()
323 __thr_pdfork(int *fdp, int flags) in __thr_pdfork() argument
328 a.fdp = fdp; in __thr_pdfork()
/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/sys/contrib/xen/hvm/
H A Dparams.h284 * Size of the x87 FPU FIP/FDP registers that the hypervisor needs to
286 * does not allow the full FIP/FDP and FCS/FDS to be restored.
290 * 8: save/restore 64-bit FIP/FDP and clear FCS/FDS (default if CPU
293 * 4: save/restore 32-bit FIP/FDP, FCS/FDS, and clear upper 32-bits of
294 * FIP/FDP.
296 * 0: allow hypervisor to choose based on the value of FIP/FDP
/freebsd/contrib/capsicum-test/
H A Dprocdesc.cc372 struct pollfd fdp; in TEST_F() local
373 fdp.fd = pd_; in TEST_F()
374 fdp.events = POLLIN | POLLERR | POLLHUP; 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()
382 EXPECT_TRUE(fdp.revents & POLLHUP); in TEST_F()
385 fdp.revents = 0; in TEST_F()
386 EXPECT_EQ(1, poll(&fdp, 1, 0)); in TEST_F()
387 EXPECT_TRUE(fdp.revents & POLLHUP); in TEST_F()
[all …]
/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/crypto/openssh/
H A Dauthfd.c86 * descriptor in fdp. Returns 0 on success and an error on failure.
89 ssh_get_authentication_socket_path(const char *authsocket, int *fdp) in ssh_get_authentication_socket_path() argument
110 if (fdp != NULL) in ssh_get_authentication_socket_path()
111 *fdp = sock; in ssh_get_authentication_socket_path()
119 * fdp. Returns 0 on success and an error on failure.
122 ssh_get_authentication_socket(int *fdp) in ssh_get_authentication_socket() argument
126 if (fdp != NULL) in ssh_get_authentication_socket()
127 *fdp = -1; in ssh_get_authentication_socket()
133 return ssh_get_authentication_socket_path(authsocket, fdp); in ssh_get_authentication_socket()
/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()

12345