/src/distrib/utils/sparkcrc/ |
sparkcrc.c | 84 FILE *fds; local in function:main 93 if (!(fds = fopen(argv[1], "r"))) 95 while ((len = fread(buf, 1, sizeof(buf), fds))) 99 fclose(fds);
|
/src/regress/sys/kern/dislodgefd/ |
dislodgefd.c | 40 int fds[2]; variable in typeref:typename:int[2] 49 if (read(fds[0], buf, sizeof(buf)) == -1) 62 if (pipe(fds)) 65 if (socketpair(PF_LOCAL, SOCK_STREAM, 0, fds) < 0) 75 close(fds[0]);
|
/src/games/sail/ |
dr_main.c | 135 int fds[2]; local in function:startdriver 138 if (pipe(fds)) { 146 close(fds[0]); 147 driver_wait_fd = fds[1]; 152 close(fds[0]); 153 close(fds[1]); 158 close(fds[1]); 159 read(fds[0], &c, 1); 160 close(fds[0]);
|
/src/tests/kernel/kqueue/read/ |
t_pipe.c | 55 int fds[2]; local in function:ATF_TC_BODY 58 RL(pipe(fds)); 61 EV_SET(&event[0], fds[0], EVFILT_READ, EV_ADD|EV_ENABLE, 0, 0, 0); 65 RL(write(fds[1], "foo", 3)); 72 RL(n = read(fds[0], buffer, event[0].data));
|
/src/regress/sys/kern/latency1/ |
latency1.c | 54 int fds[2]; variable in typeref:typename:int[2] 75 if (read(fds[0], buf, sizeof(buf)) == -1) { 100 if (pipe(fds)) { 136 if (write(fds[1], buf, sizeof(buf)) == -1) {
|
/src/sys/modules/examples/pollpal/ |
cmd_pollpal.c | 76 struct pollfd fds; local in function:main 87 fds.fd = fd; 88 fds.events = POLLOUT|POLLIN; 92 ret = poll(&fds, 1, TIMEOUT); 105 if (fds.revents & (POLLERR | POLLHUP | POLLNVAL)) 108 if (fds.revents & POLLOUT) { 118 if (fds.revents & POLLIN) {
|
/src/tests/kernel/kqueue/write/ |
t_pipe.c | 59 int fds[2]; local in function:ATF_TC_BODY 62 RL(pipe(fds)); 64 RL(close(fds[0])); 66 EV_SET(&event[0], fds[1], EVFILT_WRITE, EV_ADD|EV_ENABLE, 0, 0, 0); 83 int fds[2]; local in function:ATF_TC_BODY 88 RL(pipe(fds)); 91 EV_SET(&event[0], fds[1], EVFILT_WRITE, EV_ADD|EV_ENABLE, 0, 0, 0); 97 int sz = read(fds[0], buffer, 128); 108 RL(n = write(fds[1], "foo", 3)); 109 RL(close(fds[1])) 124 int fds[2]; local in function:ATF_TC_BODY [all...] |
/src/usr.sbin/mopd/common/ |
loop-linux2.c | 98 fd_set fds, listeners; local in function:Loop 118 FD_ZERO(&fds); 121 FD_SET(ii->fd, &fds); 127 listeners = fds;
|
/src/tests/lib/libc/sys/ |
t_pollts.c | 58 int fds[2]; local in function:ATF_TC_BODY 63 ATF_REQUIRE_EQ(pipe(fds), 0); 65 pfds[0].fd = fds[0]; 67 pfds[1].fd = fds[1]; 104 ATF_REQUIRE_EQ(write(fds[1], "", 1), 1); 116 ATF_REQUIRE_EQ(close(fds[0]), 0); 117 ATF_REQUIRE_EQ(close(fds[1]), 0);
|
t_write.c | 113 int fds[2]; local in function:ATF_TC_BODY 115 ATF_REQUIRE(pipe(fds) == 0); 118 ATF_REQUIRE(write(fds[1], "x", 1) != -1); 119 ATF_REQUIRE(close(fds[0]) == 0); 124 if (write(fds[1], "x", 1) != -1 || errno != EPIPE) 127 ATF_REQUIRE(close(fds[1]) == 0);
|
t_eventfd.c | 273 struct pollfd fds[1]; local in function:ATF_TC_BODY 290 fds[0].fd = efd; 291 fds[0].events = POLLIN | POLLRDNORM | POLLRDBAND | POLLPRI | 293 fds[0].revents = 0; 294 ATF_REQUIRE(poll(fds, 1, 0) == 1); 295 ATF_REQUIRE(fds[0].revents == (POLLOUT | POLLWRNORM)); 331 fds[0].fd = efd; 332 fds[0].events = POLLIN | POLLRDNORM | POLLRDBAND | POLLPRI | 334 fds[0].revents = 0; 335 ATF_REQUIRE(poll(fds, 1, 0) == 1) 372 struct pollfd fds[1]; local in function:eventfd_select_poll_kevent_block_helper [all...] |
t_timerfd.c | 173 "validates rejection of bogus fds by timerfd_{get,set}time()"); 516 struct pollfd fds[1]; local in function:ATF_TC_BODY 535 fds[0].fd = fd; 536 fds[0].events = POLLIN | POLLRDNORM | POLLRDBAND | POLLPRI | 538 fds[0].revents = 0; 539 ATF_REQUIRE(poll(fds, 1, 0) == 0); 572 fds[0].fd = fd; 573 fds[0].events = POLLIN | POLLRDNORM | POLLRDBAND | POLLPRI | 575 fds[0].revents = 0; 576 ATF_REQUIRE(poll(fds, 1, 0) == 1) 628 struct pollfd fds[1]; local in function:ATF_TC_BODY [all...] |
t_mmap.c | 107 int fds[2]; local in function:testloan 115 if (socketpair(AF_LOCAL, SOCK_STREAM, PF_UNSPEC, fds) != 0) 120 if (setsockopt(fds[1], SOL_SOCKET, SO_RCVBUF, &val, sizeof(val)) != 0) 125 if (setsockopt(fds[0], SOL_SOCKET, SO_SNDBUF, &val, sizeof(val)) != 0) 128 if (fcntl(fds[0], F_SETFL, O_NONBLOCK) != 0) 131 nwritten = write(fds[0], (char *)vp + page, BUFSIZE - page); 139 nread = read(fds[1], buf + page, BUFSIZE - page); 150 ATF_REQUIRE(close(fds[0]) == 0); 151 ATF_REQUIRE(close(fds[1]) == 0);
|
/src/tests/lib/libc/ttyio/ |
t_ptm.c | 129 int fdm, fds; local in function:ATF_TC_BODY 152 REQUIRE_ERRNO((fds = open(pty, O_RDWR|O_NOCTTY)), -1); 153 REQUIRE_ERRNO(fstat(fds, &sts), -1);
|
/src/libexec/ftpd/ |
popen.c | 103 static int fds; variable in typeref:typename:int 122 if ((fds = getdtablesize()) <= 0) 124 if ((pids = (int *)malloc((unsigned int)(fds * sizeof(int)))) == NULL) 126 memset(pids, 0, fds * sizeof(int));
|
/src/regress/sys/kern/select/ |
select.c | 53 int fds[NPIPE][2]; variable in typeref:typename:int[][2] 67 fd = fds[i][1]; 96 fd = fds[i][0]; 189 if (pipe(fds[i])) { 193 if (fcntl(fds[i][0], F_SETFL, O_NONBLOCK) == -1) {
|
/src/usr.sbin/altq/altqd/ |
altqd.c | 118 fd_set fds, rfds; local in function:main 216 FD_ZERO(&fds); 226 FD_SET(fd, &fds); 230 FD_SET(qpsock, &fds); 251 FD_COPY(&fds, &rfds); 282 FD_SET(newsock, &fds); 305 FD_CLR(fd1, &fds);
|
/src/sys/external/bsd/libnv/dist/ |
msgio.c | 122 fd_set fds; local in function:fd_wait 126 FD_ZERO(&fds); 127 FD_SET(fd, &fds); 128 (void)select(fd + 1, doread ? &fds : NULL, doread ? NULL : &fds, 256 fd_package_send(int sock, const int *fds, size_t nfds) 266 PJDLOG_ASSERT(fds != NULL); 289 if (msghdr_add_fd(cmsg, fds[i]) == -1) 305 fd_package_recv(int sock, int *fds, size_t nfds) 316 PJDLOG_ASSERT(fds != NULL) [all...] |
/src/libexec/rexecd/ |
rexecd.c | 146 struct pollfd fds[2]; local in function:doit 283 fds[0].fd = s; 284 fds[1].fd = pv[0]; 285 fds[0].events = fds[1].events = POLLIN; 290 if (poll(fds, 2, 0) < 0) { 295 if (fds[0].revents & POLLIN) { 297 fds[0].events = 0; 301 if (fds[1].revents & POLLIN) { 305 fds[1].events = 0 [all...] |
/src/usr.bin/rsh/ |
rsh.c | 339 struct pollfd fds[3], *fdp = &fds[0]; local in function:talk 395 fdp = &fds[1]; 397 fds[0].events = 0; 400 fdp = &fds[0]; 402 fds[0].events = POLLIN|POLLNVAL|POLLERR|POLLHUP; 403 fds[0].fd = 2; 407 fds[1].events = fds[2].events = POLLIN|POLLNVAL|POLLERR|POLLHUP; 408 fds[1].fd = remerr [all...] |
/src/usr.sbin/puffs/mount_psshfs/ |
psshfs.c | 427 int fds[2]; local in function:pssh_connect 442 if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) == -1) 451 if (dup2(fds[0], STDIN_FILENO) == -1) 453 if (dup2(fds[0], STDOUT_FILENO) == -1) 455 close(fds[0]); 456 close(fds[1]); 467 *sshfd = fds[1]; 468 close(fds[0]);
|
/src/usr.sbin/wsmoused/ |
wsmoused.c | 308 struct pollfd fds[2]; local in function:event_loop 311 fds[0].fd = Mouse.m_statfd; 312 fds[0].events = POLLIN; 315 fds[1].fd = Mouse.m_devfd; 316 fds[1].events = POLLIN; 318 res = poll(fds, 1, INFTIM); 320 res = poll(fds, 2, 300); 325 if (fds[0].revents & POLLIN) { 345 } else if (fds[1].revents & POLLIN) {
|
/src/lib/libc/rpc/ |
svc_fdset.c | 92 svc_fdset_print(const char *func, size_t line, struct svc_fdset *fds, 102 fprintf(stderr, "%p[%d] fd_set<", fds->fdset, fds->fdmax); 103 for (int i = 0; i <= fds->fdmax; i++) { 104 if (!FD_ISSET(i, fds->fdset)) 111 for (int i = 0; i < fds->fdused; i++) { 112 int fd = fds->fdp[i].fd; 144 svc_fdset_sanitize(struct svc_fdset *fds) 146 while (fds->fdmax >= 0 && !FD_ISSET(fds->fdmax, fds->fdset) 161 struct svc_fdset *fds = v; local in function:svc_fdset_free 285 struct svc_fdset *fds; local in function:svc_fdset_alloc 336 struct svc_fdset *fds = svc_fdset_alloc(0); local in function:svc_fdset_zero 350 struct svc_fdset *fds = svc_fdset_alloc(fd); local in function:svc_fdset_set 369 struct svc_fdset *fds = svc_fdset_alloc(fd); local in function:svc_fdset_isset 382 struct svc_fdset *fds = svc_fdset_alloc(fd); local in function:svc_fdset_clr 413 struct svc_fdset *fds = svc_fdset_alloc(0); local in function:svc_fdset_get 426 struct svc_fdset *fds = svc_fdset_alloc(0); local in function:svc_fdset_getmax 439 struct svc_fdset *fds = svc_fdset_alloc(fd); local in function:svc_fdset_getsize 465 struct svc_fdset *fds = svc_fdset_alloc(0); local in function:svc_pollfd_get 477 struct svc_fdset *fds = svc_fdset_alloc(0); local in function:svc_pollfd_getmax 487 struct svc_fdset *fds = svc_fdset_alloc(fd); local in function:svc_pollfd_getsize [all...] |
/src/usr.bin/su/ |
su_pam.c | 361 int fds[2]; local in function:main 382 if (pipe(fds) == -1) { 393 (void)close(fds[1]); 394 (void)read(fds[0], &status, 1); 395 (void)close(fds[0]); 404 (void)close(fds[0]); 407 (void)close(fds[1]);
|
/src/usr.sbin/rarpd/ |
rarpd.c | 439 fd_set fds, listeners; local in function:rarp_loop 460 FD_ZERO(&fds); 462 FD_SET(ii->ii_fd, &fds); 467 listeners = fds;
|