Home
last modified time | relevance | path

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

123456

/freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/
Dtst.fds.d.out1 fds[0] fi_name = mm@0:null
2 fds[0] fi_dirname = /devices/pseudo
3 fds[0] fi_pathname = /devices/pseudo/mm@0:null
4 fds[0] fi_fs = specfs
5 fds[0] fi_mount = /devices
6 fds[0] fi_offset = 0
7 fds[0] fi_oflags = 0x0
8 fds[1] fi_name = mm@0:null
9 fds[1] fi_dirname = /devices/pseudo
10 fds[1] fi_pathname = /devices/pseudo/mm@0:null
[all …]
Dtst.fds.c51 int i, n, fds[10]; in main() local
81 fds[n++] = open(file, O_RDONLY); in main()
82 fds[n++] = open(file, O_WRONLY); in main()
83 fds[n++] = open(file, O_RDWR); in main()
85 fds[n++] = open(file, O_RDWR | O_APPEND | O_CREAT | in main()
88 fds[n++] = open(file, O_RDWR); in main()
89 (void) lseek(fds[n - 1], 123, SEEK_SET); in main()
97 (void) ioctl(fds[i], 0, NULL); in main()
99 assert(n <= sizeof (fds) / sizeof (fds[0])); in main()
Dtst.fds.d41 printf("fds[%d] fi_name = %s\n", arg0, fds[arg0].fi_name);
42 printf("fds[%d] fi_dirname = %s\n", arg0, fds[arg0].fi_dirname);
43 printf("fds[%d] fi_pathname = %s\n", arg0, fds[arg0].fi_pathname);
44 printf("fds[%d] fi_fs = %s\n", arg0, fds[arg0].fi_fs);
45 printf("fds[%d] fi_mount = %s\n", arg0, fds[arg0].fi_mount);
46 printf("fds[%d] fi_offset = %d\n", arg0, fds[arg0].fi_offset);
47 printf("fds[%d] fi_oflags = 0x%x\n", arg0, fds[arg0].fi_oflags);
/freebsd-10-stable/contrib/netbsd-tests/kernel/
Dmsg.h45 msg_open(struct msg_fds *fds) in msg_open() argument
47 if (pipe(fds->pfd) == -1) in msg_open()
49 if (pipe(fds->cfd) == -1) { in msg_open()
50 close(fds->pfd[0]); in msg_open()
51 close(fds->pfd[1]); in msg_open()
58 msg_close(struct msg_fds *fds) in msg_close() argument
60 CLOSEFD(fds->pfd[0]); in msg_close()
61 CLOSEFD(fds->pfd[1]); in msg_close()
62 CLOSEFD(fds->cfd[0]); in msg_close()
63 CLOSEFD(fds->cfd[1]); in msg_close()
[all …]
/freebsd-10-stable/crypto/heimdal/lib/roken/
Dmini_inetd.c94 rk_socket_t *fds; in mini_inetd_addrinfo() local
101 fds = malloc (nalloc * sizeof(*fds)); in mini_inetd_addrinfo()
102 if (fds == NULL) { in mini_inetd_addrinfo()
110 fds[i] = socket (a->ai_family, a->ai_socktype, a->ai_protocol); in mini_inetd_addrinfo()
111 if (rk_IS_BAD_SOCKET(fds[i])) in mini_inetd_addrinfo()
113 socket_set_reuseaddr (fds[i], 1); in mini_inetd_addrinfo()
114 socket_set_ipv6only(fds[i], 1); in mini_inetd_addrinfo()
115 if (rk_IS_SOCKET_ERROR(bind (fds[i], a->ai_addr, a->ai_addrlen))) { in mini_inetd_addrinfo()
117 rk_closesocket(fds[i]); in mini_inetd_addrinfo()
118 fds[i] = rk_INVALID_SOCKET; in mini_inetd_addrinfo()
[all …]
/freebsd-10-stable/contrib/netbsd-tests/kernel/kqueue/write/
Dt_pipe.c59 int fds[2]; in ATF_TC_BODY() local
62 RL(pipe(fds)); in ATF_TC_BODY()
64 RL(close(fds[0])); in ATF_TC_BODY()
66 EV_SET(&event[0], fds[1], EVFILT_WRITE, EV_ADD|EV_ENABLE, 0, 0, 0); in ATF_TC_BODY()
83 int fds[2]; in ATF_TC_BODY() local
88 RL(pipe(fds)); in ATF_TC_BODY()
91 EV_SET(&event[0], fds[1], EVFILT_WRITE, EV_ADD|EV_ENABLE, 0, 0, 0); in ATF_TC_BODY()
97 int sz = read(fds[0], buffer, 128); in ATF_TC_BODY()
108 RL(n = write(fds[1], "foo", 3)); in ATF_TC_BODY()
109 RL(close(fds[1])); in ATF_TC_BODY()
[all …]
/freebsd-10-stable/crypto/openssh/openbsd-compat/
Dbsd-poll.c43 poll(struct pollfd *fds, nfds_t nfds, int timeout) in poll() argument
52 fd = fds[i].fd; in poll()
71 fd = fds[i].fd; in poll()
74 if (fds[i].events & POLLIN) { in poll()
78 if (fds[i].events & POLLOUT) { in poll()
96 fd = fds[i].fd; in poll()
97 fds[i].revents = 0; in poll()
101 fds[i].revents |= POLLIN; in poll()
104 fds[i].revents |= POLLOUT; in poll()
107 fds[i].revents |= POLLERR; in poll()
/freebsd-10-stable/usr.bin/whois/
Dwhois.c289 struct pollfd *fds; in whois() local
296 fds = calloc(count, sizeof(*fds)); in whois()
297 if (fds == NULL) in whois()
313 fds[i].fd = s; in whois()
314 fds[i].events = POLLERR | POLLHUP | in whois()
349 n = poll(fds, i, timeout); in whois()
373 if (fds[j].fd == -1 || fds[j].events == 0 || in whois()
374 fds[j].revents == 0) in whois()
376 if (fds[j].revents & ~(POLLIN | POLLOUT)) { in whois()
378 fds[j].fd = -1; in whois()
[all …]
/freebsd-10-stable/lib/libnv/
Dmsgio.c108 fd_set fds; in fd_wait() local
112 FD_ZERO(&fds); in fd_wait()
113 FD_SET(fd, &fds); in fd_wait()
114 (void)select(fd + 1, doread ? &fds : NULL, doread ? NULL : &fds, in fd_wait()
240 fd_package_send(int sock, const int *fds, size_t nfds) in fd_package_send() argument
250 PJDLOG_ASSERT(fds != NULL); in fd_package_send()
273 if (msghdr_add_fd(cmsg, fds[i]) == -1) in fd_package_send()
289 fd_package_recv(int sock, int *fds, size_t nfds) in fd_package_recv() argument
300 PJDLOG_ASSERT(fds != NULL); in fd_package_recv()
326 fds[i] = msghdr_get_fd(cmsg); in fd_package_recv()
[all …]
/freebsd-10-stable/crypto/openssh/openbsd-compat/regress/
Dclosefromtest.c39 int i, max, fds[NUM_OPENS]; in main() local
43 if ((fds[i] = open("/dev/null", O_RDONLY)) == -1) in main()
48 closefrom(fds[max]); in main()
49 if (close(fds[max]) != -1) in main()
54 if (read(fds[i], buf, sizeof(buf)) == -1) in main()
58 closefrom(fds[0]); in main()
60 if (close(fds[i]) != -1) in main()
/freebsd-10-stable/contrib/netbsd-tests/lib/libc/sys/
Dt_poll.c158 int fds[2]; in ATF_TC_BODY() local
162 ATF_REQUIRE_EQ(pipe(fds), 0); in ATF_TC_BODY()
164 pfds[0].fd = fds[0]; in ATF_TC_BODY()
166 pfds[1].fd = fds[1]; in ATF_TC_BODY()
199 ATF_REQUIRE_EQ(write(fds[1], "", 1), 1); in ATF_TC_BODY()
211 ATF_REQUIRE_EQ(close(fds[0]), 0); in ATF_TC_BODY()
212 ATF_REQUIRE_EQ(close(fds[1]), 0); in ATF_TC_BODY()
247 int fds[2]; in ATF_TC_BODY() local
252 ATF_REQUIRE_EQ(pipe(fds), 0); in ATF_TC_BODY()
254 pfds[0].fd = fds[0]; in ATF_TC_BODY()
[all …]
Dt_write.c111 int fds[2]; in ATF_TC_BODY() local
113 ATF_REQUIRE(pipe(fds) == 0); in ATF_TC_BODY()
116 ATF_REQUIRE(write(fds[1], "x", 1) != -1); in ATF_TC_BODY()
117 ATF_REQUIRE(close(fds[0]) == 0); in ATF_TC_BODY()
122 if (write(fds[1], "x", 1) != -1 || errno != EPIPE) in ATF_TC_BODY()
125 ATF_REQUIRE(close(fds[1]) == 0); in ATF_TC_BODY()
/freebsd-10-stable/contrib/ncurses/ncurses/tty/
Dlib_twait.c165 struct pollfd *fds = fd_list; in _nc_timed_wait() local
205 fds = typeMalloc(struct pollfd, MIN_FDS + evl->count); in _nc_timed_wait()
209 fds[count].fd = sp->_ifd; in _nc_timed_wait()
210 fds[count].events = POLLIN; in _nc_timed_wait()
215 fds[count].fd = fd; in _nc_timed_wait()
216 fds[count].events = POLLIN; in _nc_timed_wait()
226 fds[count].fd = ev->data.fev.fd; in _nc_timed_wait()
227 fds[count].events = POLLIN; in _nc_timed_wait()
234 result = poll(fds, (unsigned) count, milliseconds); in _nc_timed_wait()
250 if (fds[c].fd == ev->data.fev.fd in _nc_timed_wait()
[all …]
/freebsd-10-stable/contrib/netbsd-tests/kernel/kqueue/read/
Dt_pipe.c55 int fds[2]; in ATF_TC_BODY() local
58 RL(pipe(fds)); in ATF_TC_BODY()
61 EV_SET(&event[0], fds[0], EVFILT_READ, EV_ADD|EV_ENABLE, 0, 0, 0); in ATF_TC_BODY()
65 RL(write(fds[1], "foo", 3)); in ATF_TC_BODY()
76 RL(n = read(fds[0], buffer, event[0].data)); in ATF_TC_BODY()
/freebsd-10-stable/contrib/unbound/util/
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()
266 if(base->fds) in event_base_free()
267 free(base->fds); in event_base_free()
302 ev->ev_base->fds[ev->ev_fd] = ev; in event_add()
[all …]
/freebsd-10-stable/tests/sys/file/
Dftruncate_test.c62 int error, fd, fds[2], i, read_only_fd; in main() local
154 if (pipe(fds) < 0) in main()
156 if (ftruncate(fds[0], 0) == 0) in main()
160 close(fds[0]); in main()
161 close(fds[1]); in main()
169 if (ftruncate(fds[0], 0) == 0) in main()
/freebsd-10-stable/contrib/libreadline/examples/
Dexcallback.c100 fd_set fds; in main() local
124 FD_ZERO(&fds); in main()
125 FD_SET(fileno(stdin), &fds); in main()
127 if( select(FD_SETSIZE, &fds, NULL, NULL, NULL) < 0) { in main()
132 if( FD_ISSET(fileno(stdin), &fds) ) { in main()
/freebsd-10-stable/tools/tools/netrate/juggle/
Djuggle.c170 int fds[2]; in pipe_create() local
172 if (pipe(fds) < 0) in pipe_create()
175 *fd1p = fds[0]; in pipe_create()
176 *fd2p = fds[1]; in pipe_create()
184 int fds[2]; in socketpairdgram_create() local
186 if (socketpair(PF_LOCAL, SOCK_DGRAM, 0, fds) < 0) in socketpairdgram_create()
189 *fd1p = fds[0]; in socketpairdgram_create()
190 *fd2p = fds[1]; in socketpairdgram_create()
198 int fds[2]; in socketpairstream_create() local
200 if (socketpair(PF_LOCAL, SOCK_STREAM, 0, fds) < 0) in socketpairstream_create()
[all …]
/freebsd-10-stable/contrib/netbsd-tests/lib/librumphijack/
Dh_client.c74 fd_set fds; in main() local
81 FD_ZERO(&fds); in main()
83 rv = select(100, &fds, &fds, &fds, &tv); in main()
/freebsd-10-stable/contrib/netbsd-tests/lib/libcurses/director/
Dtestlang_parse.y725 struct pollfd fds[2]; in compare_streams() local
754 fds[0].fd = check_fd; in compare_streams()
755 fds[0].events = POLLIN; in compare_streams()
756 fds[1].fd = master; in compare_streams()
757 fds[1].events = POLLIN; in compare_streams()
768 while (poll(fds, nfd, 500) == nfd) { in compare_streams()
769 if (fds[0].revents & POLLIN) { in compare_streams()
788 if (fds[0].revents & POLLIN) { in compare_streams()
825 if ((result = poll(&fds[0], 2, 0)) != 0) { in compare_streams()
829 if ((fds[1].revents & POLLIN) == POLLIN) { in compare_streams()
[all …]
/freebsd-10-stable/contrib/libarchive/libarchive/
Dfilter_fork_posix.c204 struct pollfd fds[2]; in __archive_check_child() local
209 fds[idx].fd = in; in __archive_check_child()
210 fds[idx].events = POLLOUT; in __archive_check_child()
214 fds[idx].fd = out; in __archive_check_child()
215 fds[idx].events = POLLIN; in __archive_check_child()
219 poll(fds, idx, -1); /* -1 == INFTIM, wait forever */ in __archive_check_child()
/freebsd-10-stable/cddl/usr.sbin/dtrace/tests/common/io/
DMakefile8 tst.fds.d \
9 tst.fds.d.out \
15 tst.fds.c \
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/
Dtst.fds.ksh26 tmpin=/tmp/tst.fds.$$.d
27 tmpout1=/tmp/tst.fds.$$.out1
28 tmpout2=/tmp/tst.fds.$$.out2
33 printf("%d: field =fmt\n", fd, fds[fd].field);
/freebsd-10-stable/lib/libkse/thread/
Dthr_poll.c47 int __poll(struct pollfd *fds, unsigned int nfds, int timeout);
52 __poll(struct pollfd *fds, unsigned int nfds, int timeout) in __poll() argument
58 ret = __sys_poll(fds, nfds, timeout); in __poll()
/freebsd-10-stable/contrib/tnftp/src/
Dutil.c1464 ftp_poll(struct pollfd *fds, int nfds, int timeout) in ftp_poll() argument
1467 return poll(fds, nfds, timeout); in ftp_poll()
1483 if (fds[i].fd > FD_SETSIZE) { in ftp_poll()
1484 warnx("can't select fd %d", fds[i].fd); in ftp_poll()
1487 } else if (fds[i].fd > max) in ftp_poll()
1488 max = fds[i].fd; in ftp_poll()
1489 if (fds[i].events & rsetflags) in ftp_poll()
1490 FD_SET(fds[i].fd, &rset); in ftp_poll()
1491 if (fds[i].events & wsetflags) in ftp_poll()
1492 FD_SET(fds[i].fd, &wset); in ftp_poll()
[all …]

123456