Home
last modified time | relevance | path

Searched refs:fds (Results 1 – 25 of 123) sorted by relevance

12345

/openbsd/regress/sys/kern/signal/sigio/
H A Dsigio_pipe.c29 int fds[2]; in test_pipe_badpgid() local
31 assert(pipe(fds) == 0); in test_pipe_badpgid()
38 int fds[2]; in test_pipe_badsession() local
40 assert(pipe(fds) == 0); in test_pipe_badsession()
47 int fds[2]; in test_pipe_cansigio() local
49 assert(pipe(fds) == 0); in test_pipe_cansigio()
56 int fds[2]; in test_pipe_getown() local
58 assert(pipe(fds) == 0); in test_pipe_getown()
65 int fds[2]; in test_pipe_read() local
67 assert(pipe(fds) == 0); in test_pipe_read()
[all …]
H A Dsigio_socket.c33 int fds[2]; in test_socket_badpgid() local
36 return test_common_badpgid(fds[0]); in test_socket_badpgid()
42 int fds[2]; in test_socket_badsession() local
51 int fds[2]; in test_socket_cansigio() local
54 return test_common_cansigio(fds); in test_socket_cansigio()
60 int fds[2]; in test_socket_getown() local
63 return test_common_getown(fds[0]); in test_socket_getown()
131 int fds[2]; in test_socket_read() local
134 return test_common_read(fds); in test_socket_read()
140 int fds[2]; in test_socket_write() local
[all …]
H A Dsigio_common.c95 test_common_cansigio(int *fds) in test_common_cansigio() argument
104 flags = fcntl(fds[0], F_GETFL); in test_common_cansigio()
114 assert(read(fds[0], buf, 1) == 1); in test_common_cansigio()
124 assert(read(fds[0], buf, 1) == 1); in test_common_cansigio()
130 assert(write(fds[1], buf, 1) == 1); in test_common_cansigio()
193 test_common_read(int *fds) in test_common_read() argument
198 flags = fcntl(fds[0], F_GETFL); in test_common_read()
208 assert(read(fds[0], buf, 1) == 1); in test_common_read()
222 test_common_write(int *fds) in test_common_write() argument
228 flags = fcntl(fds[0], F_GETFL); in test_common_write()
[all …]
H A Dutil.c107 int fds[2]; in test_fork() local
109 assert(socketpair(AF_UNIX, SOCK_STREAM, 0, fds) == 0); in test_fork()
115 close(fds[0]); in test_fork()
116 *psfd = fds[1]; in test_fork()
119 close(fds[1]); in test_fork()
120 *psfd = fds[0]; in test_fork()
/openbsd/gnu/usr.bin/gcc/gcc/testsuite/gcc.dg/cpp/
H A Dtr-warn6.c7 #define foo1(h) sdf "h3" fds "h" /* { dg-warning "macro argument \"h\" would be stringified" "tradi…
8 #define foo2(h2) sdf "h2" fds "h3" /* { dg-warning "macro argument \"h2\" would be stringified" "tr…
9 #define foo3(h3) sdf "h2" fds "h3" /* { dg-warning "macro argument \"h3\" would be stringified" "tr…
10 #define foo4(h) sdf 'h3' fds 'h' /* { dg-warning "macro argument \"h\" would be stringified" "tradi…
21 #define bar1(h) sdf "h3" fds "h"
22 #define bar2(h2) sdf "h2" fds "h3"
23 #define bar3(h3) sdf "h2" fds "h3"
24 #define bar4(h) sdf 'h3' fds 'h'
25 #define bar5(h2) sdf 'h2' fds 'h3'
26 #define bar6(h3) sdf 'h2' fds 'h3'
[all …]
/openbsd/usr.sbin/radiusd/
H A Dimsg_subr.c38 struct pollfd fds[1]; in imsg_sync_read() local
41 fds[0].fd = ibuf->fd; in imsg_sync_read()
42 fds[0].events = POLLIN; in imsg_sync_read()
43 retval = poll(fds, 1, millisec); in imsg_sync_read()
48 if (retval > 0 && (fds[0].revents & POLLIN) != 0) in imsg_sync_read()
61 struct pollfd fds[1]; in imsg_sync_flush() local
67 fds[0].fd = ibuf->fd; in imsg_sync_flush()
68 fds[0].events = POLLOUT; in imsg_sync_flush()
69 retval = poll(fds, 1, millisec); in imsg_sync_flush()
74 if (retval > 0 && (fds[0].revents & POLLOUT) != 0) in imsg_sync_flush()
/openbsd/sbin/dhclient/
H A Ddispatch.c87 struct pollfd fds[3]; in dispatch() local
128 fds[0].fd = ifi->bpffd; in dispatch()
129 fds[1].fd = routefd; in dispatch()
130 fds[2].fd = unpriv_ibuf->fd; in dispatch()
131 fds[0].events = fds[1].events = fds[2].events = POLLIN; in dispatch()
134 fds[2].events |= POLLOUT; in dispatch()
136 nfds = ppoll(fds, 3, ts, NULL); in dispatch()
161 if ((fds[0].revents & POLLIN) != 0) in dispatch()
163 if ((fds[1].revents & POLLIN) != 0) in dispatch()
165 if ((fds[2].revents & POLLOUT) != 0) in dispatch()
[all …]
/openbsd/usr.bin/talk/
H A Dio.c57 struct pollfd fds[2]; in talk() local
75 fds[0].fd = fileno(stdin); in talk()
76 fds[0].events = POLLIN; in talk()
77 fds[1].fd = sockt; in talk()
78 fds[1].events = POLLIN; in talk()
81 nb = poll(fds, 2, A_LONG_TIME * 1000); in talk()
92 if (fds[1].revents & POLLIN) { in talk()
99 if (fds[0].revents & POLLIN) { in talk()
/openbsd/usr.bin/make/
H A Dcmd_exec.c126 int fds[2]; /* Pipe streams */ in Cmd_Exec() local
139 if (pipe(fds) == -1) { in Cmd_Exec()
149 (void)close(fds[0]); in Cmd_Exec()
156 if (fds[1] != 1) { in Cmd_Exec()
157 (void)dup2(fds[1], 1); in Cmd_Exec()
158 (void)close(fds[1]); in Cmd_Exec()
170 (void)close(fds[1]); in Cmd_Exec()
177 cc = read(fds[0], grab, sizeof(grab)); in Cmd_Exec()
183 (void)close(fds[0]); in Cmd_Exec()
/openbsd/gnu/usr.bin/perl/dist/IO/
H A Dpoll.c44 poll(struct pollfd *fds, unsigned long nfds, int timeout) in poll() argument
64 int events = fds[i].events; in poll()
65 int fd = fds[i].fd; in poll()
67 fds[i].revents = 0; in poll()
98 if((fstat(fds[i].fd,&buf) < 0) && (errno == EBADF)) { in poll()
99 FD_SET(fds[i].fd, &ifd); in poll()
111 int revents = (fds[i].events & POLL_EVENTS_MASK); in poll()
112 int fd = fds[i].fd; in poll()
130 if((fds[i].revents = revents) != 0) in poll()
/openbsd/regress/sys/net/pf_print/
H A Dpf_print_test.c78 int fds[2]; in main() local
90 if (pipe(fds) == -1) in main()
95 close(fds[0]); in main()
96 if (dup2(fds[1], 1) == -1) in main()
98 close(fds[1]); in main()
103 close(fds[1]); in main()
104 if ((fpipe = fdopen(fds[0], "r")) == NULL) in main()
/openbsd/regress/sys/kern/poll/
H A Dpollnval.c27 struct pollfd fds[1]; in main() local
32 fds[0].fd = 0; in main()
33 fds[0].events = POLLIN | POLLHUP; in main()
36 assert(poll(fds, 1, -1) == 1); in main()
37 assert(fds[0].revents & POLLNVAL); in main()
/openbsd/lib/libcurses/tty/
H A Dlib_twait.c194 struct pollfd *fds = fd_list; in _nc_timed_wait() local
245 if (fds == fd_list) in _nc_timed_wait()
247 if (fds == 0) in _nc_timed_wait()
253 fds[count].fd = sp->_ifd; in _nc_timed_wait()
254 fds[count].events = POLLIN; in _nc_timed_wait()
259 fds[count].fd = fd; in _nc_timed_wait()
260 fds[count].events = POLLIN; in _nc_timed_wait()
271 fds[count].events = POLLIN; in _nc_timed_wait()
295 && fds[c].revents & POLLIN) { in _nc_timed_wait()
519 if (fds != fd_list) in _nc_timed_wait()
[all …]
/openbsd/usr.sbin/nsd/
H A Dnetio.c111 static struct pollfd fds[MAX_NETIO_FDS]; in netio_dispatch() local
147 fds[numfd].fd = handler->fd; in netio_dispatch()
148 fds[numfd].events = 0; in netio_dispatch()
149 fds[numfd].revents = 0; in netio_dispatch()
152 fds[numfd].events |= POLLIN; in netio_dispatch()
155 fds[numfd].events |= POLLOUT; in netio_dispatch()
193 rc = ppoll(fds, numfd, (have_timeout?&minimum_timeout:NULL), sigmask); in netio_dispatch()
196 rc = poll(fds, numfd, (have_timeout?minimum_timeout.tv_sec*1000+ in netio_dispatch()
238 if ((fds[handler->pfd].revents & POLLIN)) { in netio_dispatch()
241 if ((fds[handler->pfd].revents & POLLOUT)) { in netio_dispatch()
[all …]
H A Dpopen3.c13 static void close_pipe(int fds[2]) in close_pipe()
15 if(fds[0] != -1) { in close_pipe()
16 close(fds[0]); in close_pipe()
17 fds[0] = -1; in close_pipe()
19 if(fds[1] != -1) { in close_pipe()
20 close(fds[1]); in close_pipe()
21 fds[1] = -1; in close_pipe()
/openbsd/regress/sys/kern/fchdir/
H A Dfchdir.c20 int fds[2]; in main() local
31 if (pipe(fds)) in main()
33 if (fchdir(fds[0]) == 0) in main()
37 close(fds[0]); in main()
38 close(fds[1]); in main()
/openbsd/regress/lib/libc/sys/
H A Dt_pollts.c60 int fds[2]; in ATF_TC_BODY() local
65 ATF_REQUIRE_EQ(pipe(fds), 0); in ATF_TC_BODY()
67 pfds[0].fd = fds[0]; in ATF_TC_BODY()
69 pfds[1].fd = fds[1]; in ATF_TC_BODY()
106 ATF_REQUIRE_EQ(write(fds[1], "", 1), 1); in ATF_TC_BODY()
118 ATF_REQUIRE_EQ(close(fds[0]), 0); in ATF_TC_BODY()
119 ATF_REQUIRE_EQ(close(fds[1]), 0); in ATF_TC_BODY()
H A Dt_poll.c161 int fds[2]; in ATF_TC_BODY() local
165 ATF_REQUIRE_EQ(pipe(fds), 0); in ATF_TC_BODY()
167 pfds[0].fd = fds[0]; in ATF_TC_BODY()
169 pfds[1].fd = fds[1]; in ATF_TC_BODY()
202 ATF_REQUIRE_EQ(write(fds[1], "", 1), 1); in ATF_TC_BODY()
214 ATF_REQUIRE_EQ(close(fds[0]), 0); in ATF_TC_BODY()
215 ATF_REQUIRE_EQ(close(fds[1]), 0); in ATF_TC_BODY()
/openbsd/gnu/llvm/lldb/examples/interposing/darwin/fd_interposing/
H A DFDInterposing.cpp559 fds[0] = -1; in socketpair$__interposed__()
560 fds[1] = -1; in socketpair$__interposed__()
566 pid, domain, type, protocol, fds[0], fds[1], err)); in socketpair$__interposed__()
569 if (fds[0] >= 0) in socketpair$__interposed__()
571 if (fds[1] >= 0) in socketpair$__interposed__()
862 fds[0] = -1; in pipe$__interposed__()
863 fds[1] = -1; in pipe$__interposed__()
867 "pid=%i: pipe ({fd=%i, fd=%i}) -> err=%i", pid, fds[0], fds[1], err)); in pipe$__interposed__()
870 if (fds[0] >= 0) in pipe$__interposed__()
872 if (fds[1] >= 0) in pipe$__interposed__()
[all …]
/openbsd/gnu/lib/libreadline/examples/
H A Dexcallback.c97 fd_set fds; in main() local
121 FD_ZERO(&fds); in main()
122 FD_SET(fileno(stdin), &fds); in main()
124 if( select(fileno(stdin) + 1, &fds, NULL, NULL, NULL) < 0) { in main()
129 if( FD_ISSET(fileno(stdin), &fds) ) { in main()
/openbsd/sbin/isakmpd/
H A Dtransport.c179 transport_fd_set(fd_set * fds) in transport_fd_set() argument
187 n = t->vtbl->fd_set(t, fds, 1); in transport_fd_set()
205 transport_pending_wfd_set(fd_set * fds) in transport_pending_wfd_set() argument
214 n = t->vtbl->fd_set(t, fds, 1); in transport_pending_wfd_set()
231 transport_handle_messages(fd_set *fds) in transport_handle_messages() argument
237 (*t->vtbl->fd_isset)(t, fds)) { in transport_handle_messages()
239 (*t->vtbl->fd_set)(t, fds, 0); in transport_handle_messages()
254 transport_send_messages(fd_set * fds) in transport_send_messages() argument
274 t->vtbl->fd_isset(t, fds)) { in transport_send_messages()
276 t->vtbl->fd_set(t, fds, 0); in transport_send_messages()
/openbsd/regress/lib/libpthread/dlopen/
H A Ddlopen.c297 int fds[2]; in fcntl_init() local
302 if (pipe(fds)) in fcntl_init()
308 close(fds[0]); in fcntl_init()
309 close(fds[1]); in fcntl_init()
313 close(fds[1]); in fcntl_init()
315 close(fds[0]); in fcntl_init()
350 int fds[2]; in flock_init() local
355 if (pipe(fds)) in flock_init()
361 close(fds[0]); in flock_init()
366 close(fds[1]); in flock_init()
[all …]
/openbsd/sbin/unwind/libunbound/util/
H A Dmini_event.c111 base->fds = (struct event**)calloc((size_t)base->capfd, in event_init()
113 if(!base->fds) { in event_init()
205 if(!base->fds[i] || !(FD_ISSET(i, &base->ready))) { in handle_select()
216 bits &= base->fds[i]->ev_events; in handle_select()
219 base->fds[i]->ev_callback)); in handle_select()
220 (*base->fds[i]->ev_callback)(base->fds[i]->ev_fd, in handle_select()
221 bits, base->fds[i]->ev_arg); in handle_select()
265 free(base->fds); in event_base_free()
299 ev->ev_base->fds[ev->ev_fd] = ev; in event_add()
335 ev->ev_base->fds[ev->ev_fd] = NULL; in event_del()
[all …]
/openbsd/usr.sbin/unbound/util/
H A Dmini_event.c111 base->fds = (struct event**)calloc((size_t)base->capfd, in event_init()
113 if(!base->fds) { in event_init()
205 if(!base->fds[i] || !(FD_ISSET(i, &base->ready))) { in handle_select()
216 bits &= base->fds[i]->ev_events; in handle_select()
219 base->fds[i]->ev_callback)); in handle_select()
220 (*base->fds[i]->ev_callback)(base->fds[i]->ev_fd, in handle_select()
221 bits, base->fds[i]->ev_arg); in handle_select()
265 free(base->fds); in event_base_free()
299 ev->ev_base->fds[ev->ev_fd] = ev; in event_add()
335 ev->ev_base->fds[ev->ev_fd] = NULL; in event_del()
[all …]
/openbsd/regress/lib/libc/explicit_bzero/
H A Dexplicit_bzero.c128 int i, fds[2]; in populate_secret() local
129 ASSERT_EQ(0, pipe(fds)); in populate_secret()
132 ASSERT_EQ(sizeof(secret), write(fds[1], secret, sizeof(secret))); in populate_secret()
133 ASSERT_EQ(0, close(fds[1])); in populate_secret()
135 ASSERT_EQ(len, read(fds[0], buf, len)); in populate_secret()
136 ASSERT_EQ(0, close(fds[0])); in populate_secret()

12345