Home
last modified time | relevance | path

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

1234

/illumos-gate/usr/src/cmd/dtrace/test/tst/common/io/
H A Dtst.fds.d.out1 fds[0] fi_name = mm@0:null
4 fds[0] fi_fs = specfs
6 fds[0] fi_offset = 0
7 fds[0] fi_oflags = 0x0
11 fds[1] fi_fs = specfs
13 fds[1] fi_offset = 0
14 fds[1] fi_oflags = 0x1
18 fds[2] fi_fs = specfs
20 fds[2] fi_offset = 0
25 fds[3] fi_fs = specfs
[all …]
H A Dtst.fds.c49 int i, n, fds[10]; in main() local
79 fds[n++] = open(file, O_RDONLY); in main()
80 fds[n++] = open(file, O_WRONLY); in main()
81 fds[n++] = open(file, O_RDWR); in main()
83 fds[n++] = open(file, O_RDWR | O_APPEND | O_CREAT | O_DSYNC | in main()
87 fds[n++] = open(file, O_RDWR); in main()
88 (void) lseek(fds[n - 1], 123, SEEK_SET); in main()
96 (void) ioctl(fds[i], -1, NULL); in main()
98 assert(n <= sizeof (fds) / sizeof (fds[0])); in main()
H A 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);
/illumos-gate/usr/src/lib/libgen/common/
H A Dp2open.c51 int fds[2]; in p2open() local
103 fds[0] = tocmd[1]; in __p2open()
104 fds[1] = fromcmd[0]; in __p2open()
111 int fds[2]; in __p2close() local
117 fds[0] = fdp[0]; in __p2close()
118 fds[1] = fdp[1]; in __p2close()
120 fds[0] = fileno(fpp[0]); in __p2close()
121 fds[1] = fileno(fpp[1]); in __p2close()
126 pid = _delete(fds[0]); in __p2close()
138 (void) close(fds[0]); in __p2close()
[all …]
/illumos-gate/usr/src/cmd/prstat/
H A Dprfile.c186 fds_t *fds; in fds_rm() local
190 for (fds = fds_tbl[hash]; fds && fds->fds_pid != pid; in fds_rm()
191 fds = fds->fds_next) /* finding pid */ in fds_rm()
192 fds_prev = fds; in fds_rm()
194 if (fds) { /* if pid was found */ in fds_rm()
196 fd_close(fds->fds_psinfo); in fds_rm()
197 fd_close(fds->fds_usage); in fds_rm()
198 fd_close(fds->fds_lpsinfo); in fds_rm()
199 fd_close(fds->fds_lusage); in fds_rm()
204 fds_tbl[hash] = fds->fds_next; in fds_rm()
[all …]
/illumos-gate/usr/src/cmd/lp/lib/msgs/
H A Dmcreate.c49 int fds[2]; local
52 if (pipe(fds) != 0)
56 if (ioctl(fds[1], I_PUSH, "connld") != 0)
60 if (fattach(fds[1], path) != 0)
70 md->readfd = fds[0];
75 md->writefd = fds[1];
77 md->writefd = fds[0];
78 close(fds[1]);
H A Dstreamio.c59 struct pollfd fds; in Putmsg() local
61 fds.fd = mdp->writefd; in Putmsg()
62 fds.events = POLLOUT; in Putmsg()
63 fds.revents = 0; in Putmsg()
65 (void) poll(&fds, 1, 1000); in Putmsg()
66 if (fds.revents & (POLLHUP | POLLERR | POLLNVAL)) { in Putmsg()
71 if (!(fds.revents & POLLOUT)) { in Putmsg()
H A Dmconnect.c106 int fds[2]; local
108 if (pipe(fds) != 0)
111 if (ioctl(fd, I_SENDFD, fds[1]) != 0)
116 fd = fds[0];
117 (void)_Close(fds[1]);
/illumos-gate/usr/src/lib/libc/port/gen/
H A Dclosefrom.c62 int *fds; in fdwalk() local
68 fds = alloca(FDS_SZ); in fdwalk()
81 fds = memcpy(alloca(fds_sz * 2), fds, fds_sz); in fdwalk()
84 fds[nfds++] = i; in fdwalk()
99 fds = memcpy(alloca(fds_sz * 2), fds, fds_sz); in fdwalk()
102 fds[nfds++] = i; in fdwalk()
117 if ((rv = func(cd, fds[i])) != 0) in fdwalk()
H A Dpoll.c34 ppoll(struct pollfd *_RESTRICT_KYWD fds, nfds_t nfd, in ppoll() argument
38 return (_pollsys(fds, nfd, tsp, sigmask)); in ppoll()
42 poll(struct pollfd *fds, nfds_t nfd, int timeout) in poll() argument
55 return (_pollsys(fds, nfd, tsp, NULL)); in poll()
/illumos-gate/usr/src/cmd/cmd-inet/sbin/dhcpagent/
H A Dscript_handler.c286 int fds[2]; in script_start() local
308 if (pipe(fds) < 0) { in script_start()
315 (void) close(fds[0]); in script_start()
316 (void) close(fds[1]); in script_start()
325 (void) close(fds[0]); in script_start()
328 run_script(dsmp, event, fds[1]); in script_start()
332 (void) close(fds[1]); in script_start()
335 if (read(fds[0], &dsmp->dsm_script_pid, sizeof (pid_t)) != in script_start()
339 (void) close(fds[0]); in script_start()
346 (void) close(fds[0]); in script_start()
[all …]
/illumos-gate/usr/src/cmd/ttymon/
H A Dtmpeek.c63 struct pollfd fds[1]; in poll_data() local
74 fds[0].fd = 0; in poll_data()
75 fds[0].events = POLLIN; in poll_data()
83 if ((j = poll(fds, 1, -1)) == -1) { in poll_data()
91 if (fds[0].revents & POLLHUP) { in poll_data()
95 if (fds[0].revents & POLLIN) { in poll_data()
96 ptr = do_peek(fds[0].fd, 255); in poll_data()
98 return (process(fds[0].fd, ptr)); in poll_data()
/illumos-gate/usr/src/test/os-tests/tests/poll/
H A Dpoll_test.c168 debug_log("POLL start: (0x%p, %d, %d)\n", fds, nfds, timeout); in poll_wrapper()
170 ret = poll(fds, nfds, timeout); in poll_wrapper()
175 fds, nfds, timeout, ret, (*elapsed)); in poll_wrapper()
187 arg.dp_fds = fds; in dppoll()
198 fds, arg.dp_nfds, arg.dp_timeout, ret, (*elapsed)); in dppoll()
325 pollfd_t fds[5]; in dev_poll_with_fds_test() local
337 fds[0].fd = testfd; in dev_poll_with_fds_test()
338 fds[0].events = POLLIN; in dev_poll_with_fds_test()
339 fds[0].revents = 0; in dev_poll_with_fds_test()
341 ret = write(pollfd, fds, sizeof (pollfd_t)); in dev_poll_with_fds_test()
[all …]
/illumos-gate/usr/src/contrib/ast/src/lib/libast/sfio/
H A Dsfpoll.c106 { struct pollfd* fds; local
120 fds[m].fd = f->file;
121 fds[m].events = fds[m].revents = 0;
124 fds[m].events |= POLLOUT;
130 fds[m].fd = f->proc->file;
131 fds[m].revents = 0;
134 fds[m].events |= POLLIN;
138 while((np = SFPOLL(fds,m,tm)) < 0 )
150 { if(fds[m].revents&POLLOUT)
157 if(fds[m].revents&POLLIN)
[all …]
H A Dsfpkrd.c229 { int fds[2], r; local
236 if(recv_peek_pipe == 1 && pipe(fds) < 0)
238 if(recv_peek_pipe == 1 && write(fds[1], tst, 2) != 2)
243 if(recv_peek_pipe == 1 && (r = recv(fds[0], tst, 1, MSG_PEEK)) != 1)
250 if(recv_peek_pipe == 1 && (r = recv(fds[0], tst, 2, MSG_PEEK)) != 2)
255 close(fds[0]);
256 close(fds[1]);
/illumos-gate/usr/src/cmd/bnu/
H A Dunknown.c96 int fds[2]; local
114 if ( setuid(getuid()) == -1 || pipe(fds) != 0
115 || write(fds[1], ebuf, strlen(ebuf)) != strlen(ebuf)
116 || close(fds[1]) != 0 )
119 if ( fds[0] != 0 ) {
121 if ( dup(fds[0]) != 0 )
/illumos-gate/usr/src/common/fs/
H A Dbootfsops.c59 static bf_fd_t fds[MAX_FDS]; variable
209 if (fds[i].fd_file == NULL) { in bbootfs_open()
210 fds[i].fd_file = fp; in bbootfs_open()
211 fds[i].fd_pos = 0; in bbootfs_open()
222 if (fds[fd].fd_file == NULL) in bbootfs_close()
225 fds[fd].fd_file = NULL; in bbootfs_close()
226 fds[fd].fd_pos = 0; in bbootfs_close()
235 bf_fd_t *fdp = &fds[fd]; in bbootfs_read()
258 bf_fd_t *fdp = &fds[fd]; in bbootfs_lseek()
283 bf_fd_t *fdp = &fds[fd]; in bbootfs_fstat()
/illumos-gate/usr/src/test/zfs-tests/tests/functional/resilver/
H A Dsysevent.c118 int fds[2]; in main() local
140 VERIFY0(pipe(fds)); in main()
146 do_child(fds[1], argv + optind, (size_t)(argc - optind)); in main()
152 (void) close(fds[1]); in main()
154 if (read(fds[0], &ret, sizeof (ret)) < 0) in main()
160 (void) close(fds[0]); in main()
/illumos-gate/usr/src/lib/print/libpapi-lpd/common/
H A Dlpd-misc.c128 int ac, rc = -1, fds[2]; in lpd_open() local
176 pipe(fds); in lpd_open()
178 socketpair(AF_UNIX, SOCK_STREAM, 0, fds); in lpd_open()
185 dup2(fds[1], 1); in lpd_open()
198 rc = recvfd(fds[0]); in lpd_open()
201 close(fds[0]); in lpd_open()
202 close(fds[1]); in lpd_open()
/illumos-gate/usr/src/cmd/hal/addons/network-devices/
H A Dsnmp.c103 int fds = 0, block = 0; in scan_for_devices_using_snmp() local
108 snmp_select_info(&fds, &fdset, &timeout, &block); in scan_for_devices_using_snmp()
109 fds = select(fds, &fdset, NULL, NULL, block ? NULL : &timeout); in scan_for_devices_using_snmp()
110 if (fds < 0) { in scan_for_devices_using_snmp()
113 } if (fds == 0) { in scan_for_devices_using_snmp()
/illumos-gate/usr/src/lib/libslp/clib/
H A Dslp_net.c719 *fds = NULL; in make_mc_target()
762 if (!(*fds = calloc(num_givenifs, sizeof (**fds)))) { in make_mc_target()
778 free_pfds(*fds, *nfds); in make_mc_target()
783 (*fds)[i].fd = fd; in make_mc_target()
784 (*fds)[i].events |= POLLRDNORM; in make_mc_target()
839 if (*fds && !have_valid_if) { in make_mc_target()
841 free(*fds); in make_mc_target()
845 if (!(*fds = calloc(1, sizeof (**fds)))) { in make_mc_target()
855 free(*fds); in make_mc_target()
859 (**fds).fd = fd; in make_mc_target()
[all …]
/illumos-gate/usr/src/lib/libdiskmgt/common/
H A Dinuse_mnt.c363 struct pollfd fds[1]; in watch_mnttab() local
366 if ((fds[0].fd = open("/etc/mnttab", O_RDONLY)) != -1) { in watch_mnttab()
371 (void) read(fds[0].fd, buf, (size_t)(sizeof (buf) - 1)); in watch_mnttab()
372 (void) lseek(fds[0].fd, 0, SEEK_SET); in watch_mnttab()
374 fds[0].events = POLLRDBAND; in watch_mnttab()
375 while (res = poll(fds, (nfds_t)1, -1)) { in watch_mnttab()
381 (void) read(fds[0].fd, buf, (size_t)(sizeof (buf) - 1)); in watch_mnttab()
382 (void) lseek(fds[0].fd, 0, SEEK_SET); in watch_mnttab()
/illumos-gate/usr/src/cmd/consadm/
H A Dconsadm.c656 pollfd_t *fds; in fallbackdaemon() local
729 fds[nfds].fd = fd; in fallbackdaemon()
730 fds[nfds].events = 0; in fallbackdaemon()
758 fds[nfds].fd = fd; in fallbackdaemon()
759 fds[nfds].events = 0; in fallbackdaemon()
779 ret = poll(fds, nfds, INFTIM); in fallbackdaemon()
809 (void) close(fds[index].fd); in fallbackdaemon()
810 fds[index].fd = -1; in fallbackdaemon()
811 fds[index].revents = 0; in fallbackdaemon()
821 fds[index].revents); in fallbackdaemon()
[all …]
/illumos-gate/usr/src/cmd/dtrace/test/tst/common/privs/
H A 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);
/illumos-gate/usr/src/cmd/sf880drd/
H A Dsf880drd.c59 static struct pollfd fds[NUM_FDS]; variable
90 rv = poll(fds, NUM_FDS, -1); in main()
98 if (fds[i].revents == POLLIN) in main()
121 fds[i].events = POLLIN; in init_poll_events()
122 fds[i].fd = open(buf, O_RDWR); in init_poll_events()
123 if (fds[i].fd == -1) { in init_poll_events()
143 rv = ioctl(fds[fdi].fd, HPC3130_GET_EVENT, &e); in process_event()

1234