Home
last modified time | relevance | path

Searched refs:fd (Results 1 – 25 of 173) sorted by relevance

1234567

/xnu-11215/tests/
H A Dbpflib.c59 bpf_set_blen(int fd, int blen) in bpf_set_blen() argument
111 int fd = -1; in bpf_new() local
116 if (fd >= 0) { in bpf_new()
123 return fd; in bpf_new()
176 #pragma unused(fd, value) in bpf_set_write_size_max()
187 #pragma unused(fd, value) in bpf_get_write_size_max()
198 #pragma unused(fd, value) in bpf_set_batch_write()
209 #pragma unused(fd, value) in bpf_get_batch_write()
227 n = read(fd, rxbuf, blen); in bpf_read_continuously()
242 int fd = bpf_new(); in main() local
[all …]
H A Dfile_leases.c61 int fd; in create_test_file() local
116 int err, fd; variable
136 int err, fd; variable
153 int err, fd; variable
415 int fd; variable
428 int fd; variable
455 int err, fd; variable
491 int err, fd; variable
655 int err, fd; variable
702 int fd; variable
[all …]
H A Dmonotonic_uncore.c65 int fd; in open_uncore_error() local
88 return fd; in open_uncore_error()
113 int fd; variable
170 int fd; variable
196 int fd; variable
202 uncore_enable(fd);
209 int fd; variable
266 int fd; variable
352 int fd; variable
366 int fd; variable
[all …]
H A Dbpf_direction.c65 test_set_direction(int fd, u_int direction) in test_set_direction() argument
67 T_ASSERT_POSIX_SUCCESS(bpf_set_direction(fd, direction), in test_set_direction()
78 int fd = bpf_new(); variable
79 T_ASSERT_POSIX_SUCCESS(fd, "bpf open fd %d", fd);
82 T_ASSERT_POSIX_SUCCESS(bpf_get_direction(fd, &direction),
86 test_set_direction(fd, BPF_D_INOUT);
87 test_set_direction(fd, BPF_D_IN);
88 test_set_direction(fd, BPF_D_OUT);
89 test_set_direction(fd, BPF_D_NONE);
107 int fd = bpf_new(); variable
[all …]
H A Dbpflib.h30 int bpf_get_blen(int fd, int * blen);
31 int bpf_set_blen(int fd, int blen);
33 int bpf_dispose(int fd);
34 int bpf_setif(int fd, const char * en_name);
35 int bpf_set_immediate(int fd, u_int value);
36 int bpf_filter_receive_none(int fd);
38 int bpf_set_timeout(int fd, struct timeval * tv_p);
40 int bpf_set_see_sent(int fd, u_int see_send);
41 int bpf_set_traffic_class(int fd, int tc);
42 int bpf_set_direction(int fd, u_int direction);
[all …]
H A Dfd_send.c18 send_fd(int sock, int fd) in send_fd() argument
39 memcpy(CMSG_DATA(cmsghdrp), &fd, sizeof(fd)); in send_fd()
93 int pair[2], fd, status; variable
101 fd = open("/dev/null", O_RDWR);
102 T_ASSERT_POSIX_SUCCESS(fd, "open(/dev/null)");
118 int pair[2], fd, status; variable
125 fd = open("/dev/null", O_RDWR);
144 int pair[2], fd, status; variable
170 int fd; variable
172 fd = open("/dev/null", O_RDWR);
[all …]
H A Dipv6_bind_race.c55 static int fd = -1; variable
155 setnonblocking(fd); in bind6_leader()
159 close(fd); in bind6_leader()
180 close(fd); in bind4_leader()
234 close(fd); in send6_leader()
259 close(fd); in connectx6_leader()
284 close(fd); in connectx4_leader()
315 close(fd); in connectx6_binding_leader()
346 close(fd); in connectx4_binding_leader()
406 close(fd); in listen6_leader()
[all …]
H A Dpwrite.c56 int fd = mkstemp(scratchfile_path); variable
61 test_file_equals(fd, "\0a", 2);
64 test_file_equals(fd, "bcd", 3);
77 pwrite_result = pwrite(fd, &input_buffer, 1, 1); in test_pwrite_should_fail()
83 pwrite_result = pwrite(fd, &input_buffer, 0, 0); in test_pwrite_should_fail()
89 pwrite_result = pwrite(fd, &input_buffer, 0, 1); in test_pwrite_should_fail()
145 int fd = open("/dev/null", O_RDONLY); variable
146 T_ASSERT_POSIX_SUCCESS(fd, "Opened /dev/null");
156 pwrite_result = pwrite(fd, &buffer, 1, 1);
163 pwrite_result = pwrite(fd, &buffer, 0, 0);
[all …]
H A Duds-to-self.c31 int fd; variable
41 T_ASSERT_POSIX_SUCCESS(fd = socket(AF_UNIX, SOCK_DGRAM, 0), NULL);
63 T_ASSERT_POSIX_SUCCESS(nrcvd = recv(fd, buffer, sizeof(buffer), 0), NULL);
69 (void)getsockopt(fd, SOL_LOCAL, LOCAL_PEERCRED, &xucred, &solen);
72 (void)getsockopt(fd, SOL_LOCAL, LOCAL_PEERPID, &pid, &solen);
75 (void)getsockopt(fd, SOL_LOCAL, LOCAL_PEEREPID, &pid, &solen);
78 (void)getsockopt(fd, SOL_LOCAL, LOCAL_PEERUUID, &uuid, &solen);
81 (void)getsockopt(fd, SOL_LOCAL, LOCAL_PEEREUUID, &uuid, &solen);
84 (void)getsockopt(fd, SOL_LOCAL, LOCAL_PEERTOKEN, &token, &solen);
86 T_ASSERT_POSIX_SUCCESS(shutdown(fd, SHUT_RDWR), NULL);
[all …]
H A Dpread.c44 int fd = mkstemp(scratchfile_path); variable
64 result = pread(fd, pread_output_buffer, 3, 0);
73 result = pread(fd, pread_output_buffer, 4, 0);
82 result = pread(fd, pread_output_buffer, 1, 2);
91 result = pread(fd, pread_output_buffer, 4, 2);
109 pread_result = pread(fd, &output_buffer, 1, 1); in test_pread_should_fail()
115 pread_result = pread(fd, &output_buffer, 0, 0); in test_pread_should_fail()
121 pread_result = pread(fd, &output_buffer, 0, 1); in test_pread_should_fail()
177 int fd = open("/dev/null", O_RDONLY); variable
178 T_ASSERT_POSIX_SUCCESS(fd, "Opened /dev/null");
[all …]
H A Diopolicy.c53 int err, fd, kq; variable
65 fd = open(g_testfile, O_CREAT | O_RDWR, 0666);
66 T_ASSERT_NE(fd, -1, "Create test file: %s", g_testfile);
69 err = (int)write(fd, g_testfile, sizeof(g_testfile));
104 fd = open(g_testfile, O_RDWR | O_EVTONLY, 0666);
108 err = (int)write(fd, g_testdata, sizeof(g_testdata));
113 err = (int)read(fd, g_testdata, sizeof(g_testdata));
119 fd, 0);
126 fd = open(g_testfile, O_EVTONLY, 0666);
130 err = (int)read(fd, g_testdata, sizeof(g_testdata));
[all …]
H A Dso_bindtodevice.c57 int fd; in test_so_bindtodevice()
68 T_ASSERT_POSIX_SUCCESS(fd = socket(domain, type, proto), NULL); in test_so_bindtodevice()
75 T_ASSERT_POSIX_SUCCESS(getsockopt(fd, boundif_level, boundif_name, &intval, &len), in test_so_bindtodevice()
81 T_ASSERT_POSIX_SUCCESS(getsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, ifname, &len), in test_so_bindtodevice()
90 T_ASSERT_POSIX_SUCCESS(setsockopt(fd, boundif_level, boundif_name, &intval, len), in test_so_bindtodevice()
94 T_ASSERT_POSIX_SUCCESS(getsockopt(fd, boundif_level, boundif_name, &intval, &len), in test_so_bindtodevice()
100 T_ASSERT_POSIX_SUCCESS(getsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, ifname, &len), in test_so_bindtodevice()
123 T_ASSERT_POSIX_SUCCESS(setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, ifname, len), in test_so_bindtodevice()
127 T_ASSERT_POSIX_SUCCESS(getsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, ifname, &len), in test_so_bindtodevice()
140 T_ASSERT_POSIX_SUCCESS(setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, NULL, 0), in test_so_bindtodevice()
[all …]
H A Drip_v4v6_input.c82 int fd; in open_raw_ipv4_socket() local
85 "fd %d = socket(AF_INET, SOCK_RAW)", fd); in open_raw_ipv4_socket()
87 return fd; in open_raw_ipv4_socket()
93 int fd; in open_raw_ipv6_socket() local
96 "fd %d = socket(AF_INET6, SOCK_RAW)", fd); in open_raw_ipv6_socket()
100 "setsockopt(%d, IPPROTO_IPV6, IPV6_V6ONLY)", fd); in open_raw_ipv6_socket()
102 return fd; in open_raw_ipv6_socket()
106 close_raw_socket(int fd) in close_raw_socket() argument
112 "getsockopt(%d, SOL_SOCKET, SO_NUMRCVPKT)", fd); in close_raw_socket()
114 T_LOG("fd %d SO_NUMRCVPKT %d", fd, optval); in close_raw_socket()
[all …]
H A Dsocket_0byte_udp_poll_58140856.c18 int fd; member
27 server.fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); in server_listen()
28 T_ASSERT_POSIX_SUCCESS(server.fd, "socket"); in server_listen()
36 r = bind(server.fd, (struct sockaddr*) &server.addr, sizeof(server.addr)); in server_listen()
43 int fd; in send_message() local
47 fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); in send_message()
48 T_ASSERT_POSIX_SUCCESS(fd, "socket"); in send_message()
60 ssize_t r = sendmsg(fd, &msg, 0); in send_message()
63 close(fd); in send_message()
73 .ident = (unsigned long)server.fd, in server_poll()
[all …]
H A Dselect_stress.c23 int fd[4]; member
88 (uintptr_t)pthread_self(), ep->fd[0], ep->fd[1], (void *)ep); in setup_stress_event()
105 close(ep->fd[0]); in recycle_fds()
106 close(ep->fd[1]); in recycle_fds()
108 close(ep->fd[1]); in recycle_fds()
109 close(ep->fd[0]); in recycle_fds()
114 usleep(((random() % ep->fd[1]) + 1) * ep->fd[1]); in recycle_fds()
152 usleep(((random() % ep->fd[1]) + 1) * ep->fd[1]); in do_stress_events()
222 (void)read(ep->fd[0], &c, 1); in do_select()
304 if (ep->fd[0] > sarg.max_fd) { in test_select_stress()
[all …]
H A Dpoll.c69 pfd[0].fd = dir;
75 pfd[0].fd = file; pfd[0].revents = 0;
76 pfd[1].fd = dir; pfd[1].revents = 0;
84 pfd[0].fd = dir; pfd[0].revents = 0;
85 pfd[1].fd = file; pfd[1].revents = 0;
93 pfd[0].fd = file; pfd[0].revents = 0;
102 pfd[0].fd = file; pfd[0].revents = 0;
103 pfd[1].fd = dir; pfd[1].revents = 0;
114 pfd[0].fd = dir; pfd[0].revents = 0;
168 fds[0].fd = STDERR_FILENO;
[all …]
H A Dbpf_timestamp.c46 int fd = bpf_new(); variable
47 T_ASSERT_POSIX_SUCCESS(fd, "bpf open fd %d", fd);
51 T_ASSERT_POSIX_SUCCESS(ioctl(fd, BIOCGNOTSTAMP, &get_no_timestamp), "BIOCGNOTSTAMP");;
56 T_ASSERT_POSIX_SUCCESS(ioctl(fd, BIOCSNOTSTAMP, &set_no_timestamp), "BIOCSNOTSTAMP");;
59 T_ASSERT_POSIX_SUCCESS(ioctl(fd, BIOCGNOTSTAMP, &get_no_timestamp), "BIOCGNOTSTAMP");;
66 T_ASSERT_POSIX_SUCCESS(ioctl(fd, BIOCSNOTSTAMP, &set_no_timestamp), "BIOCSNOTSTAMP");;
69 T_ASSERT_POSIX_SUCCESS(ioctl(fd, BIOCGNOTSTAMP, &get_no_timestamp), "BIOCGNOTSTAMP");;
H A Dkqueue_fifo_18776047.c29 int write_some_data(int fd);
30 int read_data(int fd);
32 void kevent_one_shot(int kq, int fd, int filter);
35 write_some_data(int fd) in write_some_data() argument
43 retval = (int)write(fd, data, (size_t)len); in write_some_data()
52 T_ASSERT_FAIL("write to fd %d of %s of len %d failed.", fd, data, len); in write_some_data()
62 read_data(int fd) in read_data() argument
68 retval = (int)read(fd, databuffer, READ_BUFFER_LEN); in read_data()
73 T_ASSERT_FAIL("read from fd %d failed.", fd); in read_data()
100 kevent_one_shot(int kq, int fd, int filter) in kevent_one_shot() argument
[all …]
/xnu-11215/san/tools/
H A Dksancov.c81 ret = ksancov_mode_trace(fd, max_entries); in ksancov_set_mode()
84 ret = ksancov_mode_stksize(fd, max_entries); in ksancov_set_mode()
87 ret = ksancov_mode_counters(fd); in ksancov_set_mode()
109 ret = ksancov_map_edgemap(fd, &addr, NULL); in ksancov_init_state()
118 ret = ksancov_set_mode(fd, mode, max_entries); in ksancov_init_state()
125 ret = ksancov_map(fd, &addr, &sz); in ksancov_init_state()
238 int fd = ksancov_open(); in main() local
239 if (fd < 0) { in main()
258 ret = ksancov_thread_self(fd); in main()
279 ret = ksancov_thread_self(fd); in main()
[all …]
H A Dksancov.h180 ksancov_map(int fd, uintptr_t *buf, size_t *sz) in ksancov_map() argument
185 ret = ioctl(fd, KSANCOV_IOC_MAP, &mc); in ksancov_map()
226 ksancov_nedges(int fd) in ksancov_nedges() argument
237 ksancov_mode_trace(int fd, size_t entries) in ksancov_mode_trace() argument
240 ret = ioctl(fd, KSANCOV_IOC_TRACE, &entries); in ksancov_mode_trace()
248 ksancov_mode_stksize(int fd, size_t entries) in ksancov_mode_stksize() argument
259 ksancov_mode_counters(int fd) in ksancov_mode_counters() argument
262 ret = ioctl(fd, KSANCOV_IOC_COUNTERS); in ksancov_mode_counters()
270 ksancov_thread_self(int fd) in ksancov_thread_self() argument
274 ret = ioctl(fd, KSANCOV_IOC_START, &th); in ksancov_thread_self()
[all …]
/xnu-11215/tools/tests/perf_index/
H A Dtest_file_helper.c33 int fd; in test_file_create() local
40 VERIFY(fd >= 0, "open failed"); in test_file_create()
42 close(fd); in test_file_create()
57 int fd; in test_file_read_setup() local
71 printf("%d\n", fd); in test_file_read_setup()
72 VERIFY(fd >= 0, "open failed"); in test_file_read_setup()
92 int fd; in test_file_read() local
104 fd = open(filepath, O_RDONLY); in test_file_read()
105 VERIFY(fd >= 0, "open failed"); in test_file_read()
110 retval = lseek(fd, 0, SEEK_SET); in test_file_read()
[all …]
/xnu-11215/tests/vfs/
H A Do_search.c48 int fd = -1; variable
64 T_ASSERT_POSIX_SUCCESS(close(fd), "Close test file: %s", g_testfile);
83 fd = openat(tmpdir_fd, TEST_FILE, O_EXEC);
84 T_ASSERT_TRUE((fd == -1) && (errno == EACCES),
90 fd = openat(tmpdir_fd, TEST_FILE, O_SEARCH);
91 T_ASSERT_TRUE((fd == -1) && (errno == ENOTDIR),
97 retval = (int)read(fd, &attrbuf, 2);
102 retval = (int)write(fd, &attrbuf, 2);
108 fd, 0);
114 fd, 0);
[all …]
/xnu-11215/bsd/miscfs/devfs/
H A Ddevfs_fdesc_support.c216 for (fd = fc->lh_first; fd != 0; fd = fd->fd_hash.le_next) { in fdesc_allocvp()
217 if (fd->fd_ix == ix && vnode_mount(fd->fd_vnode) == mp) { in fdesc_allocvp()
273 fd->fd_fd = fdno; in fdesc_allocvp()
274 fd->fd_link = NULL; in fdesc_allocvp()
275 fd->fd_ix = ix; in fdesc_allocvp()
309 int fd; in devfs_devfd_lookup() local
322 fd = 0; in devfs_devfd_lookup()
324 if (os_mul_and_add_overflow(fd, 10, *pname++ - '0', &fd)) { in devfs_devfd_lookup()
334 if (fd < 0 || fd >= numfiles || in devfs_devfd_lookup()
483 unsigned fd; in fdesc_getattr() local
[all …]
/xnu-11215/tests/vm/
H A Dvm_direct_write_cow.c47 int fd; variable
60 fd = open(tmpf, O_RDWR | O_CREAT | O_TRUNC, 0644);
61 T_QUIET; T_ASSERT_POSIX_SUCCESS(fd, "open()");
64 ret = ftruncate(fd, (off_t) file_size);
65 T_QUIET; T_ASSERT_POSIX_SUCCESS(fd, "ftruncate()");
67 ret = fcntl(fd, F_NOCACHE, true);
74 num_bytes = pwrite(fd, buf, file_size, 0);
78 map_shared_addr = mmap(NULL, file_size, PROT_READ, MAP_FILE | MAP_SHARED, fd, 0);
82 map_private_addr = mmap(NULL, file_size, PROT_READ, MAP_FILE | MAP_PRIVATE, fd, 0);
89 num_bytes = pwrite(fd, buf, file_size, 0);
H A Dperf_mlock.c62 int fd, ret; variable
80 fd = open(tmpf, (O_RDWR | O_CREAT));
81 T_QUIET; T_ASSERT_POSIX_SUCCESS(fd, "open()");
84 write(fd, buf, vmsize);
85 fsync(fd);
86 close(fd);
93 fd = open(tmpf, O_RDWR);
94 T_QUIET; T_ASSERT_POSIX_SUCCESS(fd, "open()");
96 (MAP_FILE | MAP_SHARED), fd, 0);
121 ret = close(fd);

1234567