Home
last modified time | relevance | path

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

123

/mirbsd/src/sbin/raidctl/
Draidctl.c118 fdidpair *fds; in main() local
257 if ((nfd = open_device(&fds, name)) < 1) { in main()
259 free(fds); in main()
284 add_hot_spare(fds, component); in main()
287 remove_hot_spare(fds, component); in main()
290 rf_configure(fds, config_filename, force); in main()
293 set_autoconfig(fds, autoconf); in main()
298 do_ioctl(fds[i].fd, RAIDFRAME_COPYBACK, NULL, in main()
305 rf_fail_disk(fds, component, do_recon); in main()
308 set_component_label(fds, component); in main()
[all …]
/mirbsd/src/lib/libpthread/uthread/
Duthread_select.c107 if ((curthread->poll_data.fds == NULL) || in select()
109 data.fds = (struct pollfd *) realloc(curthread->poll_data.fds, in select()
111 if (data.fds == NULL) { in select()
121 curthread->poll_data.fds = data.fds; in select()
127 data.fds = curthread->poll_data.fds; in select()
157 data.fds[--j].fd = in select()
159 data.fds[j].events = events; in select()
160 data.fds[j].revents = 0; in select()
164 if (((ret = _thread_sys_poll(data.fds, data.nfds, 0)) == 0) && in select()
191 if (data.fds[i].revents & POLLNVAL) { in select()
[all …]
Duthread_pipe.c42 pipe(int fds[2]) in pipe()
45 if ((ret = _thread_sys_pipe(fds)) >= 0) { in pipe()
46 if (_thread_fd_table_init(fds[0]) != 0 || in pipe()
47 _thread_fd_table_init(fds[1]) != 0) { in pipe()
48 _thread_sys_close(fds[0]); in pipe()
49 _thread_sys_close(fds[1]); in pipe()
Duthread_poll.c48 poll(struct pollfd fds[], nfds_t nfds, int timeout) in poll() argument
80 if (((ret = _thread_sys_poll(fds, numfds, 0)) == 0) && (timeout != 0)) { in poll()
82 data.fds = fds; in poll()
89 fds[n].revents = 0; in poll()
/mirbsd/src/usr.bin/make/
Dcmd_exec.c47 int fds[2]; /* Pipe streams */ in Cmd_Exec() local
67 if (pipe(fds) == -1) { in Cmd_Exec()
76 (void)close(fds[0]); in Cmd_Exec()
83 if (fds[1] != 1) { in Cmd_Exec()
84 (void)dup2(fds[1], 1); in Cmd_Exec()
85 (void)close(fds[1]); in Cmd_Exec()
98 (void)close(fds[1]); in Cmd_Exec()
105 cc = read(fds[0], grab, sizeof(grab)); in Cmd_Exec()
112 (void)close(fds[0]); in Cmd_Exec()
/mirbsd/src/usr.bin/talk/
Dio.c64 struct pollfd fds[2]; in talk() local
82 fds[0].fd = fileno(stdin); in talk()
83 fds[0].events = POLLIN; in talk()
84 fds[1].fd = sockt; in talk()
85 fds[1].events = POLLIN; in talk()
88 nb = poll(fds, 2, A_LONG_TIME * 1000); in talk()
99 if (fds[1].revents & POLLIN) { in talk()
106 if (fds[0].revents & POLLIN) { in talk()
/mirbsd/src/gnu/usr.bin/perl/ext/IO/
Dpoll.c46 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()
DIO.xs239 struct pollfd *fds = (struct pollfd *)SvPVX(tmpsv); local
242 fds[j].fd = SvIV(ST(i));
244 fds[j].events = (short)SvIV(ST(i));
246 fds[j].revents = 0;
248 if((ret = poll(fds,nfd,timeout)) >= 0) {
250 sv_setiv(ST(i), fds[j].fd); i++;
251 sv_setiv(ST(i), fds[j].revents); i++;
/mirbsd/src/usr.sbin/pppoe/
Dcommon.c58 int socks[2], fdm, fds, closeit; in runppp() local
65 fds = socks[1]; in runppp()
69 close(fds); in runppp()
76 close(fds); in runppp()
88 if (fds == STDIN_FILENO) in runppp()
91 dup2(fds, STDIN_FILENO); in runppp()
93 if (fds == STDOUT_FILENO) in runppp()
96 dup2(fds, STDOUT_FILENO); in runppp()
98 if (fds == STDERR_FILENO) in runppp()
101 dup2(fds, STDERR_FILENO); in runppp()
[all …]
/mirbsd/src/lib/libncurses/src/ncurses/tty/
Dlib_twait.c159 struct pollfd *fds = fd_list; in _nc_timed_wait() local
199 fds = typeMalloc(struct pollfd, 2 + evl->count); in _nc_timed_wait()
203 fds[count].fd = SP->_ifd; in _nc_timed_wait()
204 fds[count].events = POLLIN; in _nc_timed_wait()
209 fds[count].fd = fd; in _nc_timed_wait()
210 fds[count].events = POLLIN; in _nc_timed_wait()
221 fds[count].fd = (*ev)->data.fev.fd; in _nc_timed_wait()
222 fds[count].events = POLLIN; in _nc_timed_wait()
229 result = poll(fds, (unsigned) count, milliseconds); in _nc_timed_wait()
244 if (fds[c].fd == (*ev)->data.fev.fd in _nc_timed_wait()
[all …]
/mirbsd/src/sbin/isakmpd/
Dtransport.c189 transport_fd_set(fd_set * fds) in transport_fd_set() argument
197 n = t->vtbl->fd_set(t, fds, 1); in transport_fd_set()
215 transport_pending_wfd_set(fd_set * fds) in transport_pending_wfd_set() argument
224 n = t->vtbl->fd_set(t, fds, 1); in transport_pending_wfd_set()
241 transport_handle_messages(fd_set *fds) in transport_handle_messages() argument
247 (*t->vtbl->fd_isset)(t, fds)) { in transport_handle_messages()
249 (*t->vtbl->fd_set)(t, fds, 0); in transport_handle_messages()
264 transport_send_messages(fd_set * fds) in transport_send_messages() argument
284 t->vtbl->fd_isset(t, fds)) { in transport_send_messages()
286 t->vtbl->fd_set(t, fds, 0); in transport_send_messages()
/mirbsd/src/usr.sbin/dhcrelay/
Ddispatch.c142 struct pollfd *fds; in dispatch() local
149 fds = malloc(nfds * sizeof(struct pollfd)); in dispatch()
150 if (fds == NULL) in dispatch()
190 fds[i].fd = l->fd; in dispatch()
191 fds[i].events = POLLIN; in dispatch()
192 fds[i].revents = 0; in dispatch()
201 count = poll(fds, nfds, to_msec); in dispatch()
220 if ((fds[i].revents & (POLLIN | POLLHUP))) { in dispatch()
221 fds[i].revents = 0; in dispatch()
/mirbsd/src/usr.sbin/httpd/src/main/
Dhttp_log.c454 dup2(pl->fds[0], STDIN_FILENO); in piped_log_spawn()
473 ap_register_other_child(pid, piped_log_maintenance, pl, pl->fds[1]); in piped_log_spawn()
526 close(pl->fds[0]); in piped_log_cleanup()
527 close(pl->fds[1]); in piped_log_cleanup()
535 close(pl->fds[0]); in piped_log_cleanup_for_exec()
536 close(pl->fds[1]); in piped_log_cleanup_for_exec()
544 return ap_close_fd_on_exec(pl->fds[0]) & ap_close_fd_on_exec(pl->fds[1]); in piped_log_magic_cleanup()
556 if (pipe(pl->fds) == -1) { in ap_open_piped_log()
567 close(pl->fds[0]); in ap_open_piped_log()
568 close(pl->fds[1]); in ap_open_piped_log()
/mirbsd/src/sbin/dhclient/
Ddispatch.c127 struct pollfd fds[2]; in dispatch() local
165 fds[0].fd = ifi->rfdesc; in dispatch()
166 fds[1].fd = routefd; /* Could be -1, which will be ignored. */ in dispatch()
167 fds[0].events = fds[1].events = POLLIN; in dispatch()
170 count = poll(fds, 2, to_msec); in dispatch()
183 if ((fds[0].revents & (POLLIN | POLLHUP))) { in dispatch()
187 if ((fds[1].revents & (POLLIN | POLLHUP))) { in dispatch()
/mirbsd/src/usr.sbin/httpd/src/modules/proxy/
Dproxy_connect.c121 fd_set fds; in ap_proxy_connect_handler() local
282 FD_ZERO(&fds); in ap_proxy_connect_handler()
283 FD_SET(sock, &fds); in ap_proxy_connect_handler()
284 FD_SET(ap_bfileno(r->connection->client, B_WR), &fds); in ap_proxy_connect_handler()
290 sock + 1), &fds, NULL, NULL, NULL); in ap_proxy_connect_handler()
295 if (FD_ISSET(sock, &fds)) { in ap_proxy_connect_handler()
310 else if (FD_ISSET(ap_bfileno(r->connection->client, B_WR), &fds)) { in ap_proxy_connect_handler()
/mirbsd/src/usr.sbin/cron/
Dpopen.c59 static int fds; variable
73 if ((fds = sysconf(_SC_OPEN_MAX)) <= 0) in cron_popen()
75 if (!(pids = (PID_T *)malloc((size_t)(fds * sizeof(PID_T))))) in cron_popen()
77 bzero(pids, fds * sizeof(PID_T)); in cron_popen()
/mirbsd/src/libexec/ftpd/
Dpopen.c67 static int fds; variable
85 if ((fds = getdtablesize()) <= 0) in ftpd_popen()
87 if ((pids = (pid_t *)malloc((u_int)(fds * sizeof(pid_t)))) == NULL) in ftpd_popen()
89 memset(pids, 0, fds * sizeof(pid_t)); in ftpd_popen()
/mirbsd/src/usr.sbin/httpd/src/include/
Dhttp_log.h126 int fds[2]; member
131 #define ap_piped_log_read_fd(pl) ((pl)->fds[0])
132 #define ap_piped_log_write_fd(pl) ((pl)->fds[1])
/mirbsd/src/usr.sbin/dhcpd/
Ddispatch.c278 static struct pollfd *fds; in dispatch() local
285 fds = realloc(fds, nfds * sizeof(struct pollfd)); in dispatch()
286 if (fds == NULL) in dispatch()
327 fds[i].fd = l->fd; in dispatch()
328 fds[i].events = POLLIN; in dispatch()
336 switch (poll(fds, nfds, to_msec)) { in dispatch()
348 if ((fds[i].revents & (POLLIN | POLLHUP))) { in dispatch()
/mirbsd/src/gnu/usr.bin/perl/ext/POSIX/t/
Dposix.t49 @fds = POSIX::pipe();
50 ok( $fds[0] > $testfd, 'POSIX::pipe' );
52 CORE::open($reader = \*READER, "<&=".$fds[0]);
53 CORE::open($writer = \*WRITER, ">&=".$fds[1]);
121 skip("_POSIX_OPEN_MAX undefined ($fds[1])", 1) unless &_POSIX_OPEN_MAX;
/mirbsd/src/bin/pax/
Dar_io.c1276 int fds[2]; in ar_start_compress() local
1283 if (pipe(fds) < 0) in ar_start_compress()
1291 dup2(fds[wr ? 1 : 0], fd); in ar_start_compress()
1292 close(fds[0]); in ar_start_compress()
1293 close(fds[1]); in ar_start_compress()
1296 dup2(fds[0], STDIN_FILENO); in ar_start_compress()
1300 dup2(fds[1], STDOUT_FILENO); in ar_start_compress()
1304 close(fds[0]); in ar_start_compress()
1305 close(fds[1]); in ar_start_compress()
/mirbsd/src/usr.bin/vi/ex/
Dex_script.c789 int fds; local
791 if ((fds = open(pts_name, O_RDWR)) < 0) {
796 if (ioctl(fds, I_PUSH, "ptem") < 0) {
797 close(fds);
802 if (ioctl(fds, I_PUSH, "ldterm") < 0) {
803 close(fds);
808 if (ioctl(fds, I_PUSH, "ttcompat") < 0) {
809 close(fds);
814 return (fds);
/mirbsd/src/gnu/usr.bin/perl/lib/IPC/
DOpen3.pm311 my $fds = shift; # Fields: handle, mode, open_as
316 foreach $fd (@$fds) {
320 foreach $fd (@$fds) {
341 foreach $fd (@$fds) {
/mirbsd/src/gnu/usr.bin/binutils/gdb/
Dnto-procfs.c985 int fd, fds[3]; in procfs_create_inferior() local
1005 fds[0] = STDIN_FILENO; in procfs_create_inferior()
1006 fds[1] = STDOUT_FILENO; in procfs_create_inferior()
1007 fds[2] = STDERR_FILENO; in procfs_create_inferior()
1027 fds[0] = fd; in procfs_create_inferior()
1035 fds[1] = fd; in procfs_create_inferior()
1043 fds[2] = fd; in procfs_create_inferior()
1063 pid = spawnp (argv[0], 3, fds, &inherit, argv, in procfs_create_inferior()
1073 if (fds[0] != STDIN_FILENO) in procfs_create_inferior()
1074 close (fds[0]); in procfs_create_inferior()
[all …]
/mirbsd/src/usr.sbin/wsconfig/
Dwsconfig.c83 fd_set fds; in main() local
247 FD_ZERO(&fds); in main()
248 FD_SET(wsfd, &fds); in main()
251 if (select(wsfd + 1, &fds, NULL, NULL, &tv) <= 0) in main()

123