Home
last modified time | relevance | path

Searched refs:sfd (Results 1 – 25 of 47) sorted by relevance

12

/external/ltp/testcases/kernel/syscalls/signalfd/
Dsignalfd01.c100 int sfd; in do_test1() local
116 if ((sfd = TEST_RETURN) == -1) { in do_test1()
125 sfd_for_next = sfd; in do_test1()
129 if (fcntl(sfd, F_SETFL, O_NONBLOCK) == -1) { in do_test1()
130 close(sfd); in do_test1()
138 close(sfd); in do_test1()
144 s = read(sfd, &fdsi, sizeof(struct signalfd_siginfo)); in do_test1()
151 close(sfd); in do_test1()
158 close(sfd); in do_test1()
161 close(sfd); in do_test1()
[all …]
/external/ltp/testcases/kernel/syscalls/epoll2/examples/
Depoll-test.c78 int sfd; member
100 int sfd = socket(domain, type, protocol), flags = 1; in eph_socket() local
102 if (sfd == -1) in eph_socket()
104 if (ioctl(sfd, FIONBIO, &flags) && in eph_socket()
105 ((flags = fcntl(sfd, F_GETFL, 0)) < 0 || in eph_socket()
106 fcntl(sfd, F_SETFL, flags | O_NONBLOCK) < 0)) { in eph_socket()
107 close(sfd); in eph_socket()
110 return sfd; in eph_socket()
113 int eph_close(int sfd) in eph_close() argument
115 close(sfd); in eph_close()
[all …]
/external/ltp/testcases/kernel/syscalls/recv/
Drecv01.c64 static int sfd; /* shared between do_child and start_server */ variable
119 maybe_run_child(&do_child, "d", &sfd); in main()
228 sfd = socket(PF_INET, SOCK_STREAM, 0); in start_server()
229 if (sfd < 0) { in start_server()
233 if (bind(sfd, (struct sockaddr *)sin0, sizeof(*sin0)) < 0) { in start_server()
237 if (listen(sfd, 10) < 0) { in start_server()
241 SAFE_GETSOCKNAME(cleanup, sfd, (struct sockaddr *)sin0, &slen); in start_server()
246 if (self_exec(argv0, "d", sfd) < 0) in start_server()
257 (void)close(sfd); in start_server()
271 FD_SET(sfd, &afds); in do_child()
[all …]
/external/ltp/testcases/kernel/syscalls/connect/
Dconnect01.c63 static int sfd; /* shared between start_server and do_child */ variable
144 maybe_run_child(&do_child, "d", &sfd); in main()
249 sfd = socket(PF_INET, SOCK_STREAM, 0); in start_server()
250 if (sfd < 0) { in start_server()
254 if (bind(sfd, (struct sockaddr *)sin0, sizeof(*sin0)) < 0) { in start_server()
258 if (listen(sfd, 10) < 0) { in start_server()
262 SAFE_GETSOCKNAME(cleanup, sfd, (struct sockaddr *)sin0, &slen); in start_server()
267 self_exec(argv0, "d", sfd); in start_server()
276 (void)close(sfd); in start_server()
291 FD_SET(sfd, &afds); in do_child()
[all …]
/external/ltp/testcases/kernel/syscalls/recvfrom/
Drecvfrom01.c64 static int sfd; /* shared between do_child and start_server */ variable
141 maybe_run_child(&do_child, "d", &sfd); in main()
257 sfd = socket(PF_INET, SOCK_STREAM, 0); in start_server()
258 if (sfd < 0) { in start_server()
262 if (bind(sfd, (struct sockaddr *)sin0, sizeof(*sin0)) < 0) { in start_server()
266 if (listen(sfd, 10) < 0) { in start_server()
270 SAFE_GETSOCKNAME(cleanup, sfd, (struct sockaddr *)sin0, &slen); in start_server()
275 if (self_exec(argv0, "d", sfd) < 0) { in start_server()
286 (void)close(sfd); in start_server()
300 FD_SET(sfd, &afds); in do_child()
[all …]
/external/ltp/testcases/kernel/syscalls/send/
Dsend01.c53 static int sfd; /* shared between do_child and start_server */ variable
173 sfd = socket(PF_INET, SOCK_STREAM, 0); in start_server()
174 if (sfd < 0) { in start_server()
178 if (bind(sfd, (struct sockaddr *)sin0, sizeof(*sin0)) < 0) { in start_server()
182 if (listen(sfd, 10) < 0) { in start_server()
186 SAFE_GETSOCKNAME(cleanup, sfd, (struct sockaddr *)sin0, &slen); in start_server()
191 if (self_exec(argv0, "d", sfd) < 0) in start_server()
201 close(sfd); in start_server()
215 FD_SET(sfd, &afds); in do_child()
217 nfds = sfd + 1; in do_child()
[all …]
/external/grpc-grpc/test/core/end2end/fixtures/
Dh2_sockpair.cc47 grpc_endpoint_pair* sfd = static_cast<grpc_endpoint_pair*>(f->fixture_data); in server_setup_transport() local
48 grpc_endpoint_add_to_pollset(sfd->server, grpc_cq_pollset(f->cq)); in server_setup_transport()
73 grpc_endpoint_pair* sfd = in chttp2_create_fixture_socketpair() local
78 f.fixture_data = sfd; in chttp2_create_fixture_socketpair()
82 *sfd = grpc_iomgr_create_endpoint_pair("fixture", nullptr); in chttp2_create_fixture_socketpair()
90 grpc_endpoint_pair* sfd = static_cast<grpc_endpoint_pair*>(f->fixture_data); in chttp2_init_client_socketpair() local
95 transport = grpc_create_chttp2_transport(client_args, sfd->client, true); in chttp2_init_client_socketpair()
104 grpc_endpoint_pair* sfd = static_cast<grpc_endpoint_pair*>(f->fixture_data); in chttp2_init_server_socketpair() local
110 transport = grpc_create_chttp2_transport(server_args, sfd->server, false); in chttp2_init_server_socketpair()
Dh2_sockpair+trace.cc53 grpc_endpoint_pair* sfd = static_cast<grpc_endpoint_pair*>(f->fixture_data); in server_setup_transport() local
54 grpc_endpoint_add_to_pollset(sfd->server, grpc_cq_pollset(f->cq)); in server_setup_transport()
78 grpc_endpoint_pair* sfd = in chttp2_create_fixture_socketpair() local
83 f.fixture_data = sfd; in chttp2_create_fixture_socketpair()
87 *sfd = grpc_iomgr_create_endpoint_pair("fixture", nullptr); in chttp2_create_fixture_socketpair()
95 grpc_endpoint_pair* sfd = static_cast<grpc_endpoint_pair*>(f->fixture_data); in chttp2_init_client_socketpair() local
100 transport = grpc_create_chttp2_transport(client_args, sfd->client, true); in chttp2_init_client_socketpair()
109 grpc_endpoint_pair* sfd = static_cast<grpc_endpoint_pair*>(f->fixture_data); in chttp2_init_server_socketpair() local
115 transport = grpc_create_chttp2_transport(server_args, sfd->server, false); in chttp2_init_server_socketpair()
Dh2_sockpair_1byte.cc47 grpc_endpoint_pair* sfd = static_cast<grpc_endpoint_pair*>(f->fixture_data); in server_setup_transport() local
48 grpc_endpoint_add_to_pollset(sfd->server, grpc_cq_pollset(f->cq)); in server_setup_transport()
73 grpc_endpoint_pair* sfd = in chttp2_create_fixture_socketpair() local
78 f.fixture_data = sfd; in chttp2_create_fixture_socketpair()
93 *sfd = grpc_iomgr_create_endpoint_pair("fixture", &args); in chttp2_create_fixture_socketpair()
101 grpc_endpoint_pair* sfd = static_cast<grpc_endpoint_pair*>(f->fixture_data); in chttp2_init_client_socketpair() local
106 transport = grpc_create_chttp2_transport(client_args, sfd->client, true); in chttp2_init_client_socketpair()
115 grpc_endpoint_pair* sfd = static_cast<grpc_endpoint_pair*>(f->fixture_data); in chttp2_init_server_socketpair() local
121 transport = grpc_create_chttp2_transport(server_args, sfd->server, false); in chttp2_init_server_socketpair()
Dh2_fd.cc72 sp_fixture_data* sfd = static_cast<sp_fixture_data*>(f->fixture_data); in chttp2_init_client_socketpair() local
76 "fixture_client", sfd->fd_pair[0], client_args); in chttp2_init_client_socketpair()
83 sp_fixture_data* sfd = static_cast<sp_fixture_data*>(f->fixture_data); in chttp2_init_server_socketpair() local
90 grpc_server_add_insecure_channel_from_fd(f->server, nullptr, sfd->fd_pair[1]); in chttp2_init_server_socketpair()
/external/ltp/testcases/kernel/syscalls/sendto/
Dsendto01.c52 static int sfd; variable
243 sfd = socket(PF_INET, SOCK_STREAM, 0); in start_server()
244 if (sfd < 0) { in start_server()
248 if (bind(sfd, (struct sockaddr *)sin0, sizeof(*sin0)) < 0) { in start_server()
252 if (listen(sfd, 10) < 0) { in start_server()
256 SAFE_GETSOCKNAME(cleanup, sfd, (struct sockaddr *)sin0, &slen); in start_server()
261 if (self_exec(argv0, "d", sfd) < 0) in start_server()
271 (void)close(sfd); in start_server()
285 FD_SET(sfd, &afds); in do_child()
287 nfds = sfd + 1; in do_child()
[all …]
/external/grpc-grpc/test/core/bad_client/
Dbad_client.cc91 grpc_endpoint_pair* sfd, in grpc_run_client_side_validator() argument
118 grpc_endpoint_write(sfd->client, &outgoing, &done_write_closure, nullptr); in grpc_run_client_side_validator()
129 shutdown_client(&sfd->client); in grpc_run_client_side_validator()
132 if (sfd->client != nullptr) { in grpc_run_client_side_validator()
146 grpc_endpoint_read(sfd->client, &incoming, &read_done_closure); in grpc_run_client_side_validator()
170 shutdown_client(&sfd->client); in grpc_run_client_side_validator()
188 grpc_endpoint_pair sfd; in grpc_run_bad_client_test() local
199 sfd = grpc_iomgr_create_endpoint_pair("fixture", nullptr); in grpc_run_bad_client_test()
212 transport = grpc_create_chttp2_transport(nullptr, sfd.server, false); in grpc_run_bad_client_test()
217 grpc_endpoint_add_to_pollset(sfd.client, grpc_cq_pollset(client_cq)); in grpc_run_bad_client_test()
[all …]
/external/linux-kselftest/tools/testing/selftests/bpf/
Dtest_maps.c604 int err, i, fd, udp, sfd[6] = {0xdeadbeef}; in test_sockmap() local
617 sfd[i] = socket(AF_INET, SOCK_STREAM, 0); in test_sockmap()
618 if (sfd[i] < 0) in test_sockmap()
620 err = setsockopt(sfd[i], SOL_SOCKET, SO_REUSEADDR, in test_sockmap()
626 err = ioctl(sfd[i], FIONBIO, (char *)&one); in test_sockmap()
635 err = bind(sfd[i], (struct sockaddr *)&addr, sizeof(addr)); in test_sockmap()
638 err, i, sfd[i]); in test_sockmap()
641 err = listen(sfd[i], 32); in test_sockmap()
649 sfd[i] = socket(AF_INET, SOCK_STREAM, 0); in test_sockmap()
650 if (sfd[i] < 0) in test_sockmap()
[all …]
/external/ltp/testcases/kernel/syscalls/recvmsg/
Drecvmsg01.c73 static int sfd; /* shared between do_child and start_server */ variable
196 maybe_run_child(&do_child, "dd", &sfd, &ufd); in main()
345 close(sfd); in cleanup1()
352 close(sfd); in cleanup2()
373 sfd = socket(PF_INET, SOCK_STREAM, 0); in start_server()
374 if (sfd < 0) { in start_server()
378 if (bind(sfd, (struct sockaddr *)ssin, sizeof(*ssin)) < 0) { in start_server()
382 if (listen(sfd, 10) < 0) { in start_server()
386 SAFE_GETSOCKNAME(cleanup, sfd, (struct sockaddr *)ssin, &slen); in start_server()
406 if (self_exec(argv0, "dd", sfd, ufd) < 0) in start_server()
[all …]
/external/toybox/toys/pending/
Dtftpd.c30 long sfd;
83 if (sendto(TT.sfd, g_errpkt, strlen(errmsg)+5, 0, dstaddr, socklen) < 0) in send_errpkt()
100 pollfds[0].fd = TT.sfd; in do_action()
160 if (sendto(TT.sfd, spkt, (ptr - spkt), 0, dstaddr, socklen) <0) in do_action()
167 pollfds[0].fd = TT.sfd; in do_action()
252 TT.sfd = xsocket(dstaddr.ss_family, SOCK_DGRAM, 0); in tftpd_main()
253 if (setsockopt(TT.sfd, SOL_SOCKET, SO_REUSEADDR, (const void *)&set, in tftpd_main()
255 if (bind(TT.sfd, (void *)&srcaddr, socklen)) perror_exit("bind"); in tftpd_main()
256 if (connect(TT.sfd, (void *)&dstaddr, socklen) < 0) in tftpd_main()
Dtelnet.c28 int sfd;
73 int wlen = write(TT.sfd, TT.iac, TT.piac); in flush_iac()
284 if(i) xwrite(TT.sfd, toybuf, i); in write_server()
309 TT.sfd = xconnect(xgetaddrinfo(*toys.optargs, port, 0, SOCK_STREAM, in telnet_main()
311 setsockopt(TT.sfd, SOL_SOCKET, SO_REUSEADDR, &set, sizeof(set)); in telnet_main()
312 setsockopt(TT.sfd, SOL_SOCKET, SO_KEEPALIVE, &set, sizeof(set)); in telnet_main()
316 pfds[1].fd = TT.sfd; in telnet_main()
334 len = read(TT.sfd, TT.buff, DATABUFSIZE); in telnet_main()
/external/u-boot/tools/gdb/
Dgdbcont.c22 int c, sfd; in main() local
56 if ((sfd = serialopen(serialdev, speed)) < 0) in main()
59 remote_desc = sfd; in main()
63 if (serialclose(sfd) < 0) in main()
Dgdbsend.c26 int c, sfd, ifd; in main() local
100 if ((sfd = serialopen(serialdev, speed)) < 0) in main()
103 remote_desc = sfd; in main()
113 if (serialclose(sfd) < 0) in main()
/external/ltp/testcases/kernel/syscalls/sendmsg/
Dsendmsg01.c65 static int sfd; /* shared between do_child and start_server */ variable
373 maybe_run_child(&do_child, "dd", &sfd, &ufd); in main()
429 sfd = socket(PF_INET, SOCK_STREAM, 0); in start_server()
430 if (sfd < 0) { in start_server()
435 if (bind(sfd, (struct sockaddr *)sin0, sizeof(*sin0)) < 0) { in start_server()
440 if (listen(sfd, 10) < 0) { in start_server()
445 SAFE_GETSOCKNAME(cleanup, sfd, (struct sockaddr *)sin0, &slen); in start_server()
463 if (self_exec(argv0, "dd", sfd, ufd) < 0) in start_server()
473 close(sfd); in start_server()
489 FD_SET(sfd, &afds); in do_child()
[all …]
/external/dnsmasq/src/
Dnetwork.c637 struct serverfd* sfd; in allocate_sfd() local
658 for (sfd = daemon->sfds; sfd; sfd = sfd->next) in allocate_sfd()
659 if (sockaddr_isequal(&sfd->source_addr, addr) && mark == sfd->mark && in allocate_sfd()
660 strcmp(intname, sfd->interface) == 0) in allocate_sfd()
661 return sfd; in allocate_sfd()
665 if (!(sfd = whine_malloc(sizeof(struct serverfd)))) return NULL; in allocate_sfd()
667 if ((sfd->fd = socket(addr->sa.sa_family, SOCK_DGRAM, 0)) == -1) { in allocate_sfd()
668 free(sfd); in allocate_sfd()
672 if (!local_bind(sfd->fd, addr, intname, mark, 0) || !fix_fd(sfd->fd)) { in allocate_sfd()
674 close(sfd->fd); in allocate_sfd()
[all …]
/external/ltp/testcases/network/sctp/
Dsctp_big_chunk.c27 static int sfd, cfd; variable
40 sfd = SAFE_SOCKET(AF_INET6, SOCK_STREAM, IPPROTO_SCTP); in setup_server()
41 SAFE_BIND(sfd, (struct sockaddr *)&loc, sizeof(loc)); in setup_server()
43 port = TST_GETSOCKPORT(sfd); in setup_server()
46 SAFE_LISTEN(sfd, 1); in setup_server()
161 if (accept(sfd, (struct sockaddr *)&addr6, &addr_size) < 0) in run()
/external/ltp/testcases/network/netstress/
Dnetstress.c111 static int sfd; variable
675 sfd = SAFE_SOCKET(family, sock_type, protocol); in server_init()
676 SAFE_SETSOCKOPT_INT(sfd, SOL_SOCKET, SO_REUSEADDR, 1); in server_init()
679 SAFE_BIND(sfd, local_addrinfo->ai_addr, local_addrinfo->ai_addrlen); in server_init()
683 int port = TST_GETSOCKPORT(sfd); in server_init()
694 init_socket_opts(sfd); in server_init()
697 SAFE_SETSOCKOPT_INT(sfd, IPPROTO_TCP, TCP_FASTOPEN, in server_init()
702 SAFE_SETSOCKOPT_INT(sfd, SOL_SOCKET, SO_ZEROCOPY, 1); in server_init()
704 SAFE_LISTEN(sfd, max_queue_len); in server_init()
706 tst_res(TINFO, "Listen on the socket '%d'", sfd); in server_init()
[all …]
/external/ltp/testcases/kernel/syscalls/sync_file_range/
Dsync_file_range01.c108 int filed, sfd; /* normal and special fds */ variable
120 &sfd, 0, 1, SYNC_FILE_RANGE_WAIT_AFTER, ESPIPE}, {
190 sfd = open(spl_file, O_RDWR | O_CREAT, 0700); in setup()
/external/curl/lib/
Deasy.c1051 curl_socket_t *sfd, in easy_connection() argument
1063 *sfd = Curl_getconnectinfo(data, connp); in easy_connection()
1065 if(*sfd == CURL_SOCKET_BAD) { in easy_connection()
1081 curl_socket_t sfd; in curl_easy_recv() local
1089 result = easy_connection(data, &sfd, &c); in curl_easy_recv()
1094 result = Curl_read(c, sfd, buffer, buflen, &n1); in curl_easy_recv()
1111 curl_socket_t sfd; in curl_easy_send() local
1119 result = easy_connection(data, &sfd, &c); in curl_easy_send()
1124 result = Curl_write(c, sfd, buffer, buflen, &n1); in curl_easy_send()
/external/python/cpython3/Lib/test/
Dtest_ioctl.py71 mfd, sfd = pty.openpty()
87 os.close(sfd)

12