Searched refs:fds (Results 1 - 25 of 89) sorted by relevance

1234

/linux-master/tools/testing/selftests/net/
H A Dpsock_lib.h77 static __maybe_unused void pair_udp_open(int fds[], uint16_t port) argument
81 fds[0] = socket(PF_INET, SOCK_DGRAM, 0);
82 fds[1] = socket(PF_INET, SOCK_DGRAM, 0);
83 if (fds[0] == -1 || fds[1] == -1) {
99 if (bind(fds[1], (void *) &daddr, sizeof(daddr))) {
103 if (bind(fds[0], (void *) &saddr, sizeof(saddr))) {
107 if (connect(fds[0], (void *) &daddr, sizeof(daddr))) {
113 static __maybe_unused void pair_udp_send_char(int fds[], int num, char payload) argument
120 if (write(fds[
135 pair_udp_send(int fds[], int num) argument
140 pair_udp_close(int fds[]) argument
[all...]
H A Dpsock_fanout.c235 static int sock_fanout_read(int fds[], char *rings[], const int expect[]) argument
239 ret[0] = sock_fanout_read_ring(fds[0], rings[0]);
240 ret[1] = sock_fanout_read_ring(fds[1], rings[1]);
269 int fds[2]; local
273 fds[0] = sock_fanout_open(PACKET_FANOUT_HASH, 0);
274 if (fds[0] == -1) {
292 fds[1] = sock_fanout_open(PACKET_FANOUT_HASH, 0);
293 if (fds[1] == -1) {
297 if (close(fds[1]) || close(fds[
306 int fds[3]; local
356 int fds[3]; local
414 int fds[2], fds_udp[2][2], ret; local
[all...]
/linux-master/arch/um/drivers/
H A Dubd_user.c30 int pid, fds[2], err; local
32 err = os_pipe(fds, 1, 1);
38 kernel_fd = fds[0];
41 *fd_out = fds[1];
60 os_close_file(fds[0]);
61 os_close_file(fds[1]);
H A Dslirp_user.c52 int fds[2], pid, err; local
54 err = os_pipe(fds, 1, 1);
58 err = slirp_tramp(pri->argw.argv, fds[1]);
65 pri->slave = fds[1];
70 return fds[0];
72 close(fds[0]);
73 close(fds[1]);
H A Dslip_user.c78 int pid, fds[2], err, output_len; local
80 err = os_pipe(fds, 1, 0);
89 pe_data.stdout_fd = fds[1];
90 pe_data.close_me = fds[0];
106 close(fds[1]);
107 read_output(fds[0], output, output_len);
111 close(fds[0]);
117 close(fds[0]);
118 close(fds[1]);
/linux-master/tools/testing/selftests/pidfd/
H A Dpidfd_poll_test.c28 struct pollfd fds; local
32 fds.events = POLLIN;
85 fds.fd = pidfd;
86 nevents = poll(&fds, 1, -1);
97 if (!(fds.revents & POLLIN))
100 fds.revents);
/linux-master/tools/testing/selftests/bpf/prog_tests/
H A Dsock_iter_batch.c18 int *fds[2] = {}; local
25 for (i = 0; i < ARRAY_SIZE(fds); i++) {
28 fds[i] = start_reuseport_server(AF_INET6, sock_type, "::1", 0, 0,
30 if (!ASSERT_OK_PTR(fds[i], "start_reuseport_server"))
32 local_port = get_socket_local_port(*fds[i]);
53 /* Test reading a bucket (either from fds[0] or fds[1]).
75 free_fds(fds[first_idx], nr_soreuse);
76 fds[first_idx] = NULL;
103 for (i = 0; i < ARRAY_SIZE(fds);
[all...]
H A Dlwt_helpers.h103 fd_set fds; local
105 FD_ZERO(&fds);
111 FD_SET(fd, &fds);
113 ret = select(1 + fd, &fds, NULL, NULL, &copied_timeout);
/linux-master/tools/testing/selftests/cgroup/
H A Dwait_inotify.c33 struct pollfd fds = { .events = POLLIN, }; local
59 fds.fd = fd;
65 int ret = poll(&fds, 1, 10000);
73 if ((ret > 0) && (fds.revents & POLLIN))
/linux-master/arch/um/os-Linux/
H A Dhelper.c47 int pid, fds[2], ret, n; local
53 ret = socketpair(AF_UNIX, SOCK_STREAM, 0, fds);
61 ret = os_set_exec_close(fds[1]);
72 data.fd = fds[1];
83 close(fds[1]);
84 fds[1] = -1;
90 n = read(fds[0], &ret, sizeof(ret));
110 if (fds[1] != -1)
111 close(fds[1]);
112 close(fds[
[all...]
/linux-master/scripts/
H A Djobserver-exec21 # Note that GNU Make has used --jobserver-fds and --jobserver-auth
28 fds = opts[-1].split("=", 1)[1]
32 _, _, path = fds.partition('fifo:')
38 reader, writer = [int(x) for x in fds.split(",", 1)]
61 # Any missing environment strings or bad fds should result in just
/linux-master/fs/
H A Dselect.c15 * of fds to overcome nfds < 16390 descriptors limit (Tigran Aivazian).
414 #define FDS_IN(fds, n) (fds->in + n)
415 #define FDS_OUT(fds, n) (fds->out + n)
416 #define FDS_EX(fds, n) (fds->ex + n)
418 #define BITS(fds, n) (*FDS_IN(fds, n)|*FDS_OUT(fds,
420 max_select_fd(unsigned long n, fd_set_bits *fds) argument
479 do_select(int n, fd_set_bits *fds, struct timespec64 *end_time) argument
628 fd_set_bits fds; local
1023 struct pollfd *fds = walk->entries; local
1199 fd_set_bits fds; local
[all...]
/linux-master/tools/testing/selftests/bpf/benchs/
H A Dbench_local_storage_create.c13 int *fds; member in struct:thread
120 t->fds = malloc(batch_sz * sizeof(*t->fds));
121 if (!t->fds) {
122 fprintf(stderr, "cannot alloc t->fds\n");
149 int *fds = t->fds; local
154 fds[i] = socket(AF_INET6, SOCK_DGRAM, 0);
155 if (fds[i] == -1)
160 if (fds[
[all...]
/linux-master/samples/nitro_enclaves/
H A Dne_ioctl_sample.c199 struct pollfd fds[1] = {}; local
205 fds[0].fd = enclave_fd;
206 fds[0].events = POLLIN | POLLERR | POLLHUP;
212 rc = poll(fds, 1, NE_POLL_WAIT_TIME_MS);
228 printf("Poll received value 0x%x\n", fds[0].revents);
230 if (fds[0].revents & POLLHUP) {
236 if (fds[0].revents & POLLNVAL) {
656 struct pollfd fds[1] = {}; local
696 fds[0].fd = server_vsock_fd;
697 fds[
[all...]
/linux-master/tools/bpf/bpftool/
H A Dcommon.c734 static int prog_fd_by_nametag(void *nametag, int **fds, bool tag) argument
784 tmp = realloc(*fds, (nb_fds + 1) * sizeof(int));
789 *fds = tmp;
791 (*fds)[nb_fds++] = fd;
798 close((*fds)[nb_fds]);
802 int prog_parse_fds(int *argc, char ***argv, int **fds) argument
817 (*fds)[0] = bpf_prog_get_fd_by_id(id);
818 if ((*fds)[0] < 0) {
836 return prog_fd_by_nametag(tag, fds, true);
849 return prog_fd_by_nametag(name, fds, fals
870 int *fds = NULL; local
895 map_fd_by_name(char *name, int **fds) argument
953 map_parse_fds(int *argc, char ***argv, int **fds) argument
1007 int *fds = NULL; local
[all...]
/linux-master/tools/testing/vsock/
H A Dvsock_perf.c204 struct pollfd fds = { 0 }; local
206 fds.fd = client_fd;
207 fds.events = POLLIN | POLLERR |
210 if (poll(&fds, 1, -1) < 0)
213 if (fds.revents & POLLERR) {
218 if (fds.revents & POLLIN) {
223 bytes_read = read(fds.fd, data, buf_size_bytes);
238 if (fds.revents & (POLLHUP | POLLRDHUP))
319 struct pollfd fds = { 0 }; local
321 fds
[all...]
/linux-master/tools/testing/selftests/powerpc/pmu/
H A Dlib.h20 int fds[2]; member in union:pipe
/linux-master/tools/testing/selftests/bpf/
H A Dnetwork_helpers.c153 int *fds; local
161 fds = malloc(sizeof(*fds) * nr_listens);
162 if (!fds)
165 fds[0] = __start_server(type, 0, (struct sockaddr *)&addr, addrlen,
167 if (fds[0] == -1)
171 if (getsockname(fds[0], (struct sockaddr *)&addr, &addrlen))
175 fds[nr_fds] = __start_server(type, 0, (struct sockaddr *)&addr,
177 if (fds[nr_fds] == -1)
181 return fds;
188 free_fds(int *fds, unsigned int nr_close_fds) argument
[all...]
/linux-master/tools/testing/selftests/powerpc/pmu/ebb/
H A Dtask_event_pinned_vs_ebb_test.c47 FAIL_IF(pipe(read_pipe.fds) == -1);
48 FAIL_IF(pipe(write_pipe.fds) == -1);
H A Dtask_event_vs_ebb_test.c45 FAIL_IF(pipe(read_pipe.fds) == -1);
46 FAIL_IF(pipe(write_pipe.fds) == -1);
H A Debb_on_child_test.c52 FAIL_IF(pipe(read_pipe.fds) == -1);
53 FAIL_IF(pipe(write_pipe.fds) == -1);
H A Debb_on_willing_child_test.c57 FAIL_IF(pipe(read_pipe.fds) == -1);
58 FAIL_IF(pipe(write_pipe.fds) == -1);
H A Debb_vs_cpu_event_test.c49 FAIL_IF(pipe(read_pipe.fds) == -1);
50 FAIL_IF(pipe(write_pipe.fds) == -1);
H A Dcpu_event_vs_ebb_test.c49 FAIL_IF(pipe(read_pipe.fds) == -1);
50 FAIL_IF(pipe(write_pipe.fds) == -1);
H A Dcpu_event_pinned_vs_ebb_test.c51 FAIL_IF(pipe(read_pipe.fds) == -1);
52 FAIL_IF(pipe(write_pipe.fds) == -1);

Completed in 446 milliseconds

1234