Home
last modified time | relevance | path

Searched refs:sfd (Results 1 - 25 of 62) sorted by relevance

123

/third_party/musl/Benchmark/musl/
H A Dsocket_test.cpp261 int sfd = -1; in ConnectTo() local
263 sfd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); in ConnectTo()
264 if (sfd == -1) { in ConnectTo()
268 if (connect(sfd, rp->ai_addr, rp->ai_addrlen) != -1) { in ConnectTo()
278 close(sfd); in ConnectTo()
279 sfd = -1; in ConnectTo()
284 if (sfd == -1) { in ConnectTo()
288 return sfd; in ConnectTo()
307 int sfd = -1; in BindAt() local
309 sfd in BindAt()
339 int sfd = ConnectTo("127.0.0.1", "80", SOCK_DGRAM, nullptr); Bm_function_getpeername_client_local() local
357 int sfd = ConnectTo("www.baidu.com", "80", SOCK_DGRAM, nullptr); Bm_function_getpeername_client_external() local
375 int sfd = ConnectTo("127.0.0.1", "1500", SOCK_STREAM, nullptr); ThreadTaskClient() local
386 int sfd = BindAt("1500"); StartServer() local
416 int sfd = StartServer(&connfd); Bm_function_getpeername_server() local
434 int sfd = ConnectTo("127.0.0.1", "80", SOCK_DGRAM, nullptr); Bm_function_getsockname_client_local() local
452 int sfd = ConnectTo("www.baidu.com", "80", SOCK_DGRAM, nullptr); Bm_function_getsockname_client_external() local
471 int sfd = StartServer(&connfd); Bm_function_getsockname_server() local
492 int sfd = ConnectTo("127.0.0.1", "80", SOCK_DGRAM, &addr); Bm_function_connect_local_dgram() local
507 int sfd = BindAt("1500"); Bm_function_connect_accept() local
554 int sfd = socket(AF_INET, SOCK_STREAM, 0); Bm_function_bind() local
[all...]
/third_party/ltp/testcases/kernel/syscalls/signalfd/
H A Dsignalfd01.c91 int sfd; in do_test1() local
107 if ((sfd = TEST_RETURN) == -1) { in do_test1()
116 sfd_for_next = sfd; in do_test1()
120 if (fcntl(sfd, F_SETFL, O_NONBLOCK) == -1) { in do_test1()
121 close(sfd); in do_test1()
129 close(sfd); in do_test1()
135 s = read(sfd, &fdsi, sizeof(struct signalfd_siginfo)); in do_test1()
142 close(sfd); in do_test1()
149 close(sfd); in do_test1()
152 close(sfd); in do_test1()
182 int sfd; do_test2() local
263 int sfd; main() local
[all...]
/third_party/ltp/testcases/kernel/syscalls/epoll_pwait/
H A Depoll_pwait04.c19 static int efd, sfd[2]; variable
33 SAFE_SOCKETPAIR(AF_UNIX, SOCK_STREAM, 0, sfd); in setup()
40 if (epoll_ctl(efd, EPOLL_CTL_ADD, sfd[0], &e)) in setup()
42 SAFE_WRITE(SAFE_WRITE_ALL, sfd[1], "w", 1); in setup()
52 if (sfd[0] > 0) in cleanup()
53 SAFE_CLOSE(sfd[0]); in cleanup()
55 if (sfd[1] > 0) in cleanup()
56 SAFE_CLOSE(sfd[1]); in cleanup()
H A Depoll_pwait05.c20 static int efd, sfd[2]; variable
43 SAFE_SOCKETPAIR(AF_UNIX, SOCK_STREAM, 0, sfd); in setup()
50 if (epoll_ctl(efd, EPOLL_CTL_ADD, sfd[0], &e)) in setup()
52 SAFE_WRITE(SAFE_WRITE_ALL, sfd[1], "w", 1); in setup()
60 if (sfd[0] > 0) in cleanup()
61 SAFE_CLOSE(sfd[0]); in cleanup()
63 if (sfd[1] > 0) in cleanup()
64 SAFE_CLOSE(sfd[1]); in cleanup()
H A Depoll_pwait02.c19 static int efd, sfd[2]; variable
37 SAFE_SOCKETPAIR(AF_UNIX, SOCK_STREAM, 0, sfd); in setup()
44 if (epoll_ctl(efd, EPOLL_CTL_ADD, sfd[0], &e)) in setup()
46 SAFE_WRITE(SAFE_WRITE_ALL, sfd[1], "w", 1); in setup()
54 if (sfd[0] > 0) in cleanup()
55 SAFE_CLOSE(sfd[0]); in cleanup()
57 if (sfd[1] > 0) in cleanup()
58 SAFE_CLOSE(sfd[1]); in cleanup()
H A Depoll_pwait01.c26 static int efd, sfd[2]; variable
66 SAFE_WRITE(SAFE_WRITE_ALL, sfd[1], "w", 1); in run()
72 SAFE_READ(1, sfd[0], &b, 1); in run()
88 SAFE_SOCKETPAIR(AF_UNIX, SOCK_STREAM, 0, sfd); in setup()
95 if (epoll_ctl(efd, EPOLL_CTL_ADD, sfd[0], &e)) in setup()
104 if (sfd[0] > 0) in cleanup()
105 SAFE_CLOSE(sfd[0]); in cleanup()
107 if (sfd[1] > 0) in cleanup()
108 SAFE_CLOSE(sfd[1]); in cleanup()
H A Depoll_pwait03.c20 static int efd, sfd[2]; variable
45 SAFE_SOCKETPAIR(AF_UNIX, SOCK_STREAM, 0, sfd); in setup()
52 if (epoll_ctl(efd, EPOLL_CTL_ADD, sfd[0], &e)) in setup()
61 if (sfd[0] > 0) in cleanup()
62 SAFE_CLOSE(sfd[0]); in cleanup()
64 if (sfd[1] > 0) in cleanup()
65 SAFE_CLOSE(sfd[1]); in cleanup()
/third_party/ltp/testcases/kernel/syscalls/fsmount/
H A Dfsmount01.c42 int sfd, mfd; in run() local
44 TEST(sfd = fsopen(tst_device->fs_type, FSOPEN_CLOEXEC)); in run()
45 if (sfd == -1) { in run()
51 TEST(fsconfig(sfd, FSCONFIG_SET_STRING, "source", tst_device->dev, 0)); in run()
53 SAFE_CLOSE(sfd); in run()
59 TEST(fsconfig(sfd, FSCONFIG_CMD_CREATE, NULL, NULL, 0)); in run()
61 SAFE_CLOSE(sfd); in run()
66 TEST(mfd = fsmount(sfd, tc->flags, tc->attrs)); in run()
67 SAFE_CLOSE(sfd); in run()
/third_party/ltp/testcases/kernel/syscalls/connect/
H A 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, in do_child()
[all...]
/third_party/ltp/testcases/kernel/syscalls/send/
H A 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 in do_child()
[all...]
/third_party/ltp/testcases/kernel/syscalls/recv/
H A 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, in do_child()
[all...]
/third_party/ltp/testcases/kernel/syscalls/sendto/
H A 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 in do_child()
[all...]
/third_party/ltp/testcases/kernel/syscalls/recvfrom/
H A 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, in do_child()
[all...]
/third_party/toybox/toys/pending/
H A Dtftpd.c30 long sfd;
83 if (sendto(TT.sfd, g_errpkt, strlen(errmsg)+5, 0, dstaddr, socklen) < 0) in send_errpkt()
115 pollfds[0].fd = TT.sfd; in do_action()
175 if (sendto(TT.sfd, spkt, (ptr - spkt), 0, dstaddr, socklen) <0) in do_action()
182 pollfds[0].fd = TT.sfd; in do_action()
269 TT.sfd = xsocket(dstaddr.ss_family, SOCK_DGRAM, 0); in tftpd_main()
270 if (setsockopt(TT.sfd, SOL_SOCKET, SO_REUSEADDR, (const void *)&set, in tftpd_main()
272 xbind(TT.sfd, (void *)&srcaddr, socklen); in tftpd_main()
273 xconnect(TT.sfd, (void *)&dstaddr, socklen); in tftpd_main()
H A 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 = xconnectany(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()
/third_party/ltp/testcases/network/sctp/
H A Dsctp_big_chunk.c33 static int sfd, cfd; variable
66 sfd = SAFE_SOCKET(AF_INET6, SOCK_STREAM, IPPROTO_SCTP); in setup_server()
67 SAFE_BIND(sfd, (struct sockaddr *)&loc, sizeof(loc)); in setup_server()
69 port = TST_GETSOCKPORT(sfd); in setup_server()
72 SAFE_LISTEN(sfd, 1); in setup_server()
190 if (accept(sfd, (struct sockaddr *)&addr6, &addr_size) < 0) in run()
/third_party/node/deps/openssl/openssl/engines/
H A De_afalg.c75 static int afalg_fin_cipher_aio(afalg_aio *ptr, int sfd,
264 static int afalg_fin_cipher_aio(afalg_aio *aio, int sfd, unsigned char *buf, in afalg_fin_cipher_aio() argument
287 cb->aio_fildes = sfd; in afalg_fin_cipher_aio()
424 actx->bfd = actx->sfd = -1; in afalg_create_sk()
445 actx->sfd = accept(actx->bfd, NULL, 0); in afalg_create_sk()
446 if (actx->sfd < 0) { in afalg_create_sk()
457 if (actx->sfd >= 0) in afalg_create_sk()
458 close(actx->sfd); in afalg_create_sk()
459 actx->bfd = actx->sfd = -1; in afalg_create_sk()
508 sbytes = sendmsg(actx->sfd, in afalg_start_cipher_sk()
[all...]
/third_party/openssl/engines/
H A De_afalg.c75 static int afalg_fin_cipher_aio(afalg_aio *ptr, int sfd,
264 static int afalg_fin_cipher_aio(afalg_aio *aio, int sfd, unsigned char *buf, in afalg_fin_cipher_aio() argument
287 cb->aio_fildes = sfd; in afalg_fin_cipher_aio()
424 actx->bfd = actx->sfd = -1; in afalg_create_sk()
445 actx->sfd = accept(actx->bfd, NULL, 0); in afalg_create_sk()
446 if (actx->sfd < 0) { in afalg_create_sk()
457 if (actx->sfd >= 0) in afalg_create_sk()
458 close(actx->sfd); in afalg_create_sk()
459 actx->bfd = actx->sfd = -1; in afalg_create_sk()
508 sbytes = sendmsg(actx->sfd, in afalg_start_cipher_sk()
[all...]
/third_party/ltp/testcases/kernel/syscalls/sendmsg/
H A 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, in do_child()
[all...]
/third_party/ltp/testcases/kernel/syscalls/recvmsg/
H A Drecvmsg01.c31 static int sfd; /* shared between do_child and start_server */ variable
368 sfd = SAFE_SOCKET(PF_INET, SOCK_STREAM, 0); in start_server()
369 SAFE_BIND(sfd, (struct sockaddr *)ssin, sizeof(*ssin)); in start_server()
370 SAFE_LISTEN(sfd, 10); in start_server()
371 SAFE_GETSOCKNAME(sfd, (struct sockaddr *)ssin, &slen); in start_server()
384 SAFE_CLOSE(sfd); in start_server()
434 FD_SET(sfd, &afds); in do_child()
437 nfds = MAX(sfd + 1, ufd + 1); in do_child()
453 if (FD_ISSET(sfd, &rfds)) { in do_child()
457 newfd = SAFE_ACCEPT(sfd, (struc in do_child()
[all...]
/third_party/backends/backend/
H A Dsp15c.c769 if (scanner->sfd < 0) in sane_start()
771 if (sanei_scsi_open (scanner->sane.name, &(scanner->sfd), in sane_start()
785 sanei_scsi_close (scanner->sfd); in sane_start()
787 scanner->sfd = -1; in sane_start()
794 sanei_scsi_close (scanner->sfd); in sane_start()
796 scanner->sfd = -1; in sane_start()
804 sanei_scsi_close (scanner->sfd); in sane_start()
806 scanner->sfd = -1; in sane_start()
823 sanei_scsi_close (scanner->sfd); in sane_start()
825 scanner->sfd in sane_start()
999 int sfd; attach_scanner() local
[all...]
H A Dpie.c295 int sfd; /* scanner file desc. */ member
811 pie_do_inquiry (int sfd, unsigned char *buffer) in pie_do_inquiry() argument
822 status = sanei_scsi_cmd (sfd, inquiry.cmd, inquiry.size, buffer, &size); in pie_do_inquiry()
832 status = sanei_scsi_cmd (sfd, inquiry.cmd, inquiry.size, buffer, &size); in pie_do_inquiry()
844 pie_identify_scanner (Pie_Device * dev, int sfd) in pie_identify_scanner() argument
855 pie_do_inquiry (sfd, inquiry_block); /* get inquiry */ in pie_identify_scanner()
948 pie_get_halftones (Pie_Device * dev, int sfd) in pie_get_halftones() argument
973 status = sanei_scsi_cmd (sfd, buffer, swrite.size + size, NULL, NULL); in pie_get_halftones()
989 status = sanei_scsi_cmd (sfd, sread.cmd, sread.size, buffer, &size); in pie_get_halftones()
1014 pie_get_cal_info (Pie_Device * dev, int sfd) in pie_get_cal_info() argument
1092 int sfd; attach_scanner() local
[all...]
/third_party/ltp/testcases/kernel/syscalls/sync_file_range/
H A Dsync_file_range01.c42 static int fd, sfd; variable
53 {&sfd, 0, 1, SYNC_FILE_RANGE_WAIT_AFTER, ESPIPE},
72 sfd = SAFE_OPEN(spl_file, O_RDWR | O_CREAT, 0700); in setup()
/third_party/ltp/testcases/network/netstress/
H A Dnetstress.c107 static int sfd; variable
674 sfd = SAFE_SOCKET(family, sock_type, protocol); in server_init()
675 SAFE_SETSOCKOPT_INT(sfd, SOL_SOCKET, SO_REUSEADDR, 1); in server_init()
677 SAFE_SETSOCKOPT_INT(sfd, SOL_SOCKET, SO_REUSEPORT, 1); in server_init()
680 SAFE_BIND(sfd, local_addrinfo->ai_addr, local_addrinfo->ai_addrlen); in server_init()
684 int port = TST_GETSOCKPORT(sfd); in server_init()
695 init_socket_opts(sfd); in server_init()
698 SAFE_SETSOCKOPT_INT(sfd, IPPROTO_TCP, TCP_FASTOPEN, in server_init()
703 SAFE_SETSOCKOPT_INT(sfd, SOL_SOCKET, SO_ZEROCOPY, 1); in server_init()
705 SAFE_LISTEN(sfd, max_queue_le in server_init()
[all...]
/third_party/libwebsockets/lib/plat/unix/
H A Dunix-fds.c82 lws_sockfd_type sfd) in sanity_assert_no_sockfd_traces()
93 if (sfd == LWS_SOCK_INVALID || !context->lws_lookup) in sanity_assert_no_sockfd_traces()
97 context->lws_lookup[sfd - lws_plat_socket_offset()]) { in sanity_assert_no_sockfd_traces()
107 /* confirm the sfd not already in use */ in sanity_assert_no_sockfd_traces()
109 while (p != done && (!*p || (*p)->desc.sockfd != sfd)) in sanity_assert_no_sockfd_traces()
81 sanity_assert_no_sockfd_traces(const struct lws_context *context, lws_sockfd_type sfd) sanity_assert_no_sockfd_traces() argument

Completed in 16 milliseconds

123