Home
last modified time | relevance | path

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

/xnu-11215/tests/
H A Dunp_sock_release.c44 int fds[2] = { -1, -1 }; variable
47 T_ASSERT_POSIX_SUCCESS(socketpair(AF_UNIX, SOCK_DGRAM, 0, fds),
49 T_LOG("socketpair() fds: %d, %d\n", fds[0], fds[1]);
51 nfsd_args.sock = fds[0];
53 "nfssvc() sock %d", fds[0]);
55 T_ASSERT_POSIX_SUCCESS(close(fds[0]), "close(%d)\n", fds[0]);
59 T_ASSERT_POSIX_SUCCESS(close(fds[1]), "close(%d)\n", fds[1]);
H A Dpoll.c167 struct pollfd fds[2] = {}; variable
168 fds[0].fd = STDERR_FILENO;
169 fds[0].events = POLLERR | POLLHUP;
170 fds[0].revents = POLLERR;
171 fds[1].fd = STDOUT_FILENO;
172 fds[1].events = POLLERR | POLLHUP;
173 fds[1].revents = POLLERR;
176 poll(fds, 2, 5000);
H A Duipc_uaf.c41 int fds[MAX_FDS]; in send_scm_rights() member
48 msg.msg_controllen = sizeof(ctrl_msg) - ((MAX_FDS / 2) * sizeof(ctrl_msg.fds[0])); in send_scm_rights()
67 (uintptr_t*)(void *)(&overwrite_ctrl_msg.fds[0]); in send_scm_rights()
69 MAX_FDS / (sizeof(overwrite_ctrl_msg_ptrs[0]) / sizeof(overwrite_ctrl_msg.fds[0])); in send_scm_rights()
82 ctrl_msg.fds[i] = pair[1]; in send_scm_rights()
H A Dpoll_select_kevent_paired_fds.c563 struct pollfd fds[] = { { .fd = fd, .events = POLLIN } }; in read_from_fd() local
567 fds[0].revents = 0; in read_from_fd()
568 int pol = poll(fds, 1, READ_TIMEOUT_SECS * 1000); in read_from_fd()
574 T_QUIET; T_ASSERT_FALSE(fds[0].revents & POLLERR, in read_from_fd()
576 T_QUIET; T_ASSERT_FALSE(fds[0].revents & POLLNVAL, in read_from_fd()
821 int fds[2]; in drive_processes() local
822 T_QUIET; T_ASSERT_POSIX_SUCCESS(pipe(fds), NULL); in drive_processes()
823 shared.wr_wait.out_fd = fds[0]; in drive_processes()
824 shared.wr_wait.in_fd = fds[1]; in drive_processes()
H A Dvm_test_mach_map.c2057 int fds[2]; variable
2068 ret = pipe(fds);
2079 ret = close(fds[1]);
2094 nbytes_read = read(fds[0], data, 2);
2104 ret = close(fds[0]);
2140 ret = close(fds[1]);
/xnu-11215/tests/skywalk/
H A Dskt_badring.c51 struct pollfd fds; in skt_badringtx_common() local
103 fds.fd = channelfd; in skt_badringtx_common()
104 fds.events = POLLSTANDARD; in skt_badringtx_common()
105 fds.revents = 0; in skt_badringtx_common()
106 error = poll(&fds, 1, 0); in skt_badringtx_common()
170 struct pollfd fds; in skt_badringrx_common() local
222 fds.fd = channelfd; in skt_badringrx_common()
223 fds.events = POLLSTANDARD; in skt_badringrx_common()
224 fds.revents = 0; in skt_badringrx_common()
225 error = poll(&fds, 1, 0); in skt_badringrx_common()
[all …]
H A Dskt_oneslot.c57 struct pollfd fds; in skt_oneslot_common() local
100 fds.fd = channelfd; in skt_oneslot_common()
101 fds.events = POLLWRNORM; in skt_oneslot_common()
102 fds.revents = 0; in skt_oneslot_common()
103 error = poll(&fds, 1, -1); in skt_oneslot_common()
106 assert(fds.fd == channelfd); in skt_oneslot_common()
163 fds.fd = channelfd; in skt_oneslot_common()
164 fds.events = POLLRDNORM; in skt_oneslot_common()
165 fds.revents = 0; in skt_oneslot_common()
166 error = poll(&fds, 1, -1); in skt_oneslot_common()
[all …]
H A Dskt_shutdown.c59 struct pollfd fds, sock_fds; in skt_shutdown_common() local
100 fds.revents = sock_fds.revents = 0; in skt_shutdown_common()
112 fds.fd = channelfd; in skt_shutdown_common()
113 error = poll(&fds, 1, -1); in skt_shutdown_common()
115 " revents(0x%x)\n", error, fds.events, fds.revents); in skt_shutdown_common()
119 assert(fds.fd == channelfd); in skt_shutdown_common()
267 fds.revents = sock_fds.revents = 0; in skt_shutdown_common()
279 fds.fd = channelfd; in skt_shutdown_common()
280 error = poll(&fds, 1, -1); in skt_shutdown_common()
282 " revents(0x%x)\n", error, fds.events, fds.revents); in skt_shutdown_common()
[all …]
H A Dskt_shutdown2.c67 struct pollfd fds; in skt_shutdown2_common() local
99 fds.fd = channelfd; in skt_shutdown2_common()
100 fds.events = POLLRDNORM; in skt_shutdown2_common()
101 fds.revents = 0; in skt_shutdown2_common()
102 error = poll(&fds, 1, -1); in skt_shutdown2_common()
105 assert(fds.fd == channelfd); in skt_shutdown2_common()
106 assert(fds.events == POLLRDNORM); in skt_shutdown2_common()
107 assert(fds.revents == (POLLRDNORM | POLLHUP)); in skt_shutdown2_common()
H A Dskt_nslots.c60 struct pollfd fds; in skt_nslots_common() local
86 fds.fd = channelfd; in skt_nslots_common()
143 fds.events = POLLWRNORM; in skt_nslots_common()
144 error = poll(&fds, 1, -1); in skt_nslots_common()
147 assert(fds.fd == channelfd); in skt_nslots_common()
148 assert(fds.events == POLLWRNORM); in skt_nslots_common()
213 fds.events = POLLRDNORM; in skt_nslots_common()
214 error = poll(&fds, 1, -1); in skt_nslots_common()
217 assert(fds.fd == channelfd); in skt_nslots_common()
218 assert(fds.events == POLLRDNORM); in skt_nslots_common()
[all …]
H A Dskywalk_mptest_driver.c185 int fds[skt->skt_nchildren]; in skywalk_mptest_driver_run() local
250 fds[j] = pfd[1]; in skywalk_mptest_driver_run()
257 if ((ret = read(fds[j], buf, sizeof(buf))) == -1) { in skywalk_mptest_driver_run()
272 if ((ret = write(fds[j], buf, sizeof(buf))) == -1) { in skywalk_mptest_driver_run()
278 error = close(fds[j]); in skywalk_mptest_driver_run()
H A Dskywalk_test_utils.c994 struct pollfd fds; in sktc_pump_ring_nslots_poll() local
1000 fds.fd = channelfd; in sktc_pump_ring_nslots_poll()
1002 fds.events = POLLWRNORM; in sktc_pump_ring_nslots_poll()
1004 fds.events = POLLRDNORM; in sktc_pump_ring_nslots_poll()
1030 error = poll(&fds, 1, -1); in sktc_pump_ring_nslots_poll()
1033 assert(fds.fd == channelfd); in sktc_pump_ring_nslots_poll()
1035 assert(fds.events == POLLWRNORM); in sktc_pump_ring_nslots_poll()
1036 assert(fds.revents == POLLWRNORM); in sktc_pump_ring_nslots_poll()
1038 assert(fds.events == POLLRDNORM); in sktc_pump_ring_nslots_poll()
1039 assert(fds.revents == POLLRDNORM); in sktc_pump_ring_nslots_poll()
/xnu-11215/tools/tests/perf_index/
H A Dtest_file_helper.c14 static int* fds = NULL; variable
145 if (fds == NULL) { in test_file_write_setup()
146 fds = (int*)malloc(sizeof(int) * num_threads); in test_file_write_setup()
147 VERIFY(fds, "malloc failed"); in test_file_write_setup()
152 fds[i] = open(filepath, O_CREAT | O_EXCL | O_WRONLY, 0644); in test_file_write_setup()
153 if (fds[i] < 0) { in test_file_write_setup()
154 free(fds); in test_file_write_setup()
155 fds = NULL; in test_file_write_setup()
172 int fd = fds[thread_id]; in test_file_write()
/xnu-11215/libsyscall/wrappers/libproc/
H A Dproc_listpidspath.c45 struct proc_fdinfo *fds; member
79 info->fds = NULL; in check_init()
113 if (info->fds != NULL) { in check_free()
114 free(info->fds); in check_free()
297 if (info->fds == NULL) { in check_process_fds()
298 info->fds = malloc(info->fds_size); in check_process_fds()
300 info->fds = reallocf(info->fds, info->fds_size); in check_process_fds()
302 if (info->fds == NULL) { in check_process_fds()
307 buf_used = proc_pidinfo(pid, PROC_PIDLISTFDS, 0, info->fds, (int)info->fds_size); in check_process_fds()
326 fdp = &info->fds[i]; in check_process_fds()
/xnu-11215/tests/ipc/
H A Dmach_exc_port_substitute.c186 int fds[2]; variable
194 ret = pipe(fds);
209 close(fds[0]);
214 ret = write(fds[1], "1", 2); /* ding the child to wake up */
220 close(fds[1]);
221 int ret = read(fds[0], buf, sizeof(buf));
/xnu-11215/bsd/kern/
H A Dsys_generic.c1719 if (NULL == fds) { in poll_nocancel()
1724 error = copyin(uap->fds, fds, nfds * sizeof(struct pollfd)); in poll_nocancel()
1737 if (fds[i].fd < 0) { in poll_nocancel()
1838 error = copyout(fds, uap->fds, nfds * sizeof(struct pollfd)); in poll_nocancel()
1843 kfree_data(fds, ni); in poll_nocancel()
1876 fds->revents |= (fds->events & mask); in poll_callback()
1881 fds->revents |= (fds->events & (POLLOUT | POLLWRNORM | POLLWRBAND)); in poll_callback()
1887 fds->revents |= (fds->events & POLLEXTEND); in poll_callback()
1890 fds->revents |= (fds->events & POLLATTRIB); in poll_callback()
1893 fds->revents |= (fds->events & POLLNLINK); in poll_callback()
[all …]
H A Duipc_usrreq.c2389 int *fds __bidi_indexable; in unp_externalize()
2393 if (fds == NULL) { in unp_externalize()
2407 error = fdalloc(p, 0, &fds[i]); in unp_externalize()
2410 fdrelse(p, fds[i]); in unp_externalize()
2444 procfdtbl_releasefd(p, fds[i], fp); in unp_externalize()
2454 memcpy(fds_out, fds, newfds * sizeof(int)); in unp_externalize()
2469 kfree_data(fds, newfds * sizeof(int)); in unp_externalize()
2494 int *fds; in unp_internalize() local
2510 fds = (int *)(cm + 1); in unp_internalize()
2522 fds[i], tmpfp, kGUARD_EXC_SOCKET_IPC); in unp_internalize()
[all …]
H A Dkern_memorystatus.c5194 entry->fds = p->p_fd.fd_nfiles; in memorystatus_update_jetsam_snapshot_entry_locked()
5423 entry->fds = p->p_fd.fd_nfiles; in memorystatus_init_jetsam_snapshot_entry_locked()
/xnu-11215/bsd/dev/dtrace/scripts/
H A Dio.d242 inline fileinfo_t fds[int fd] = xlate <fileinfo_t> ( variable
247 #pragma D attributes Stable/Stable/Common fds
248 #pragma D binding "1.1" fds
/xnu-11215/bsd/sys/
H A Dkern_memorystatus.h192 uint32_t fds; member