Home
last modified time | relevance | path

Searched refs:sock_fd (Results 1 – 25 of 39) sorted by relevance

12

/external/linux-kselftest/tools/testing/selftests/bpf/prog_tests/
Dsockopt_multi.c58 int cg_child, int sock_fd) in run_getsockopt_test() argument
67 err = setsockopt(sock_fd, SOL_IP, IP_TOS, &buf, 1); in run_getsockopt_test()
75 err = getsockopt(sock_fd, SOL_IP, IP_TOS, &buf, &optlen); in run_getsockopt_test()
98 err = getsockopt(sock_fd, SOL_IP, IP_TOS, &buf, &optlen); in run_getsockopt_test()
122 err = getsockopt(sock_fd, SOL_IP, IP_TOS, &buf, &optlen); in run_getsockopt_test()
141 if (setsockopt(sock_fd, SOL_IP, IP_TOS, &buf, 1) < 0) { in run_getsockopt_test()
148 err = getsockopt(sock_fd, SOL_IP, IP_TOS, &buf, &optlen); in run_getsockopt_test()
167 err = getsockopt(sock_fd, SOL_IP, IP_TOS, &buf, &optlen); in run_getsockopt_test()
179 err = setsockopt(sock_fd, SOL_IP, IP_TOS, &buf, 1); in run_getsockopt_test()
187 err = getsockopt(sock_fd, SOL_IP, IP_TOS, &buf, &optlen); in run_getsockopt_test()
[all …]
Dprobe_user.c10 int err, results_map_fd, sock_fd, duration = 0; in test_probe_user() local
50 sock_fd = socket(AF_INET, SOCK_STREAM, 0); in test_probe_user()
51 if (CHECK(sock_fd < 0, "create_sock_fd", "err %d\n", sock_fd)) in test_probe_user()
54 connect(sock_fd, &curr, sizeof(curr)); in test_probe_user()
55 close(sock_fd); in test_probe_user()
Dsockopt.c879 int sock_fd, err, prog_fd; in run_test() local
902 sock_fd = socket(AF_INET, SOCK_STREAM, 0); in run_test()
903 if (sock_fd < 0) { in run_test()
910 err = setsockopt(sock_fd, test->set_level, test->set_optname, in run_test()
930 err = getsockopt(sock_fd, test->get_level, test->get_optname, in run_test()
963 close(sock_fd); in run_test()
/external/mesa3d/src/gallium/winsys/virgl/vtest/
Dvirgl_vtest_socket.c140 virgl_block_write(vws->sock_fd, &buf, sizeof(buf)); in virgl_vtest_send_init()
141 virgl_block_write(vws->sock_fd, (void *)cmdline, strlen(cmdline) + 1); in virgl_vtest_send_init()
155 virgl_block_write(vws->sock_fd, &vtest_hdr, sizeof(vtest_hdr)); in virgl_vtest_negotiate_version()
161 virgl_block_write(vws->sock_fd, &vtest_hdr, sizeof(vtest_hdr)); in virgl_vtest_negotiate_version()
162 virgl_block_write(vws->sock_fd, &busy_wait_buf, sizeof(busy_wait_buf)); in virgl_vtest_negotiate_version()
164 ret = virgl_block_read(vws->sock_fd, vtest_hdr, sizeof(vtest_hdr)); in virgl_vtest_negotiate_version()
169 ret = virgl_block_read(vws->sock_fd, vtest_hdr, sizeof(vtest_hdr)); in virgl_vtest_negotiate_version()
171 ret = virgl_block_read(vws->sock_fd, busy_wait_result, sizeof(busy_wait_result)); in virgl_vtest_negotiate_version()
177 virgl_block_write(vws->sock_fd, &vtest_hdr, sizeof(vtest_hdr)); in virgl_vtest_negotiate_version()
178 virgl_block_write(vws->sock_fd, &version_buf, sizeof(version_buf)); in virgl_vtest_negotiate_version()
[all …]
/external/ltp/testcases/network/stress/ns-tools/
Dns-udpserver.c141 void respond_to_client(int sock_fd) in respond_to_client() argument
151 if (getsockopt(sock_fd, SOL_SOCKET, SO_RCVBUF, in respond_to_client()
154 close(sock_fd); in respond_to_client()
162 close(sock_fd); in respond_to_client()
168 if ((msglen = recvfrom(sock_fd, msgbuf, msgbuf_size, 0, in respond_to_client()
178 if (sendto(sock_fd, msgbuf, msglen, 0, in respond_to_client()
196 int sock_fd; /* socket binded open ports */ in main() local
296 sock_fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol); in main()
297 if (sock_fd < 0) in main()
305 (sock_fd, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(int))) in main()
[all …]
Dns-tcpclient.c135 int sock_fd; /* socket descriptor for a connection */ in main() local
270 sock_fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol); in main()
271 if (sock_fd < 0) in main()
276 if (setsockopt(sock_fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(int))) in main()
281 maximize_sockbuf(sock_fd); in main()
284 if (connect(sock_fd, res->ai_addr, res->ai_addrlen) < 0) in main()
298 (sock_fd, SOL_SOCKET, SO_RCVBUF, &recvbuf_size, &sock_optlen) < 0) in main()
301 fprintf(stderr, "recvbuf size of socket(%d) is %d\n", sock_fd, in main()
319 recvbyte_size = recv(sock_fd, recvbuf, recvbuf_size, 0); in main()
337 if (close(sock_fd) < 0) in main()
Dns-icmpv4_sender.c315 int sock_fd; /* Socket for ioctl() */ in complete_eth_addrs() local
318 if ((sock_fd = socket(AF_PACKET, SOCK_DGRAM, 0)) < 0) in complete_eth_addrs()
329 get_ifinfo(&ifinfo, sock_fd, fake_p->src_ifname, SIOCGIFHWADDR); in complete_eth_addrs()
333 get_ifinfo(&ifinfo, sock_fd, fake_p->src_ifname, SIOCGIFINDEX); in complete_eth_addrs()
337 close(sock_fd); in complete_eth_addrs()
546 int sock_fd; in send_packets() local
552 sock_fd = socket(AF_PACKET, SOCK_DGRAM, htons(ETH_P_IP)); in send_packets()
553 if (sock_fd < 0) in send_packets()
557 retval = bind(sock_fd, (struct sockaddr *)&(fake_p->saddr_ll), in send_packets()
582 retval = sendto(sock_fd, &pkt, fake_p->pkt_size, 0, in send_packets()
[all …]
Dns-udpclient.c148 int sock_fd; /* socket descriptor to access */ in main() local
274 sock_fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol); in main()
275 if (sock_fd < 0) in main()
280 if (setsockopt(sock_fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(int))) in main()
309 if (sendto(sock_fd, message, MESSAGE_LEN, 0, in main()
320 if ((recvlen = recvfrom(sock_fd, recvbuf, MESSAGE_LEN, 0, in main()
Dns-icmpv6_sender.c176 int sock_fd; /* Socket for ioctl() */ in specify_hw_addr() local
179 if ((sock_fd = socket(AF_PACKET, SOCK_DGRAM, 0)) < 0) in specify_hw_addr()
189 get_ifinfo(&ifinfo, sock_fd, ifname, SIOCGIFHWADDR); in specify_hw_addr()
194 close(sock_fd); in specify_hw_addr()
716 int sock_fd; in send_packets() local
722 sock_fd = socket(AF_PACKET, SOCK_DGRAM, htons(ETH_P_IPV6)); in send_packets()
723 if (sock_fd < 0) in send_packets()
727 retval = bind(sock_fd, (struct sockaddr *)&(info_p->saddr_ll), in send_packets()
752 retval = sendto(sock_fd, &pkt, info_p->pkt_size, 0, in send_packets()
772 close(sock_fd); in send_packets()
Dns-tcpserver.c291 int communicate_client(struct server_info *info_p, int sock_fd) in communicate_client() argument
304 (sock_fd, SOL_SOCKET, SO_SNDBUF, &sndbuf_size, in communicate_client()
307 if (close(sock_fd)) in communicate_client()
319 if (close(sock_fd)) in communicate_client()
333 sntbyte_size = send(sock_fd, sendmsg, sndbuf_size, 0); in communicate_client()
362 if (close(sock_fd)) in communicate_client()
/external/ltp/testcases/kernel/containers/share/
Dns_ifmove.c52 int sock_fd; in get_intf_index_from_name() local
58 sock_fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); in get_intf_index_from_name()
59 if (sock_fd == -1) { in get_intf_index_from_name()
65 if (ioctl(sock_fd, SIOCGIFINDEX, &ifr) == -1) { in get_intf_index_from_name()
67 close(sock_fd); in get_intf_index_from_name()
71 close(sock_fd); in get_intf_index_from_name()
/external/ltp/testcases/kernel/syscalls/ftruncate/
Dftruncate03.c31 static int sock_fd, read_fd, fd; variable
39 {&sock_fd, 4, EINVAL},
67 sock_fd = SAFE_SOCKET(PF_INET, SOCK_STREAM, 0); in setup()
76 if (sock_fd > 0) in cleanup()
77 SAFE_CLOSE(sock_fd); in cleanup()
/external/llvm-project/lldb/tools/debugserver/source/
DRNBSocket.cpp94 int sock_fd = ::socket(address.GetFamily(), SOCK_STREAM, IPPROTO_TCP); in Listen() local
95 if (sock_fd == -1) in Listen()
98 SetSocketOption(sock_fd, SOL_SOCKET, SO_REUSEADDR, 1); in Listen()
108 ::bind(sock_fd, &bind_address.sockaddr(), bind_address.GetLength()); in Listen()
110 ClosePort(sock_fd, false); in Listen()
114 error = ::listen(sock_fd, 5); in Listen()
116 ClosePort(sock_fd, false); in Listen()
126 if (getsockname(sock_fd, &address.sockaddr(), &sa_len) == 0) in Listen()
130 sockets[sock_fd] = address; in Listen()
164 auto sock_fd = event_list[i].ident; in Listen() local
[all …]
/external/ltp/testcases/kernel/syscalls/fsync/
Dfsync03.c25 static int sock_fd, bad_fd = -1; variable
34 {&sock_fd, EINVAL},
52 sock_fd = SAFE_SOCKET(AF_UNIX, SOCK_STREAM, 0); in setup()
80 SAFE_CLOSE(sock_fd); in cleanup()
/external/perfetto/src/profiling/perf/
Dtraced_perf.cc30 const char* sock_fd = getenv(kTracedPerfSocketEnvVar); in GetRawInheritedListeningSocket() local
31 if (sock_fd == nullptr) in GetRawInheritedListeningSocket()
34 int raw_fd = static_cast<int>(strtol(sock_fd, &end, 10)); in GetRawInheritedListeningSocket()
/external/python/cpython2/Modules/
Dsocketmodule.c495 #define IS_SELECTABLE(s) (_PyIsSelectable_fd((s)->sock_fd) || (s)->sock_timeout <= 0.0)
629 sendsegmented(int sock_fd, char *buf, int len, int flags) in sendsegmented() argument
638 n = send(sock_fd, buf, segment, flags); in sendsegmented()
664 setsockopt(s->sock_fd, SOL_SOCKET, SO_NONBLOCK, in internal_setblocking()
671 ioctl(s->sock_fd, FIONBIO, (caddr_t)&block, sizeof(block)); in internal_setblocking()
674 ioctl(s->sock_fd, FIONBIO, (unsigned int *)&block); in internal_setblocking()
676 delay_flag = fcntl(s->sock_fd, F_GETFL, 0); in internal_setblocking()
681 fcntl(s->sock_fd, F_SETFL, delay_flag); in internal_setblocking()
685 ioctlsocket(s->sock_fd, FIONBIO, (u_long*)&block); in internal_setblocking()
689 socketioctl(s->sock_fd, FIONBIO, (u_long*)&block); in internal_setblocking()
[all …]
Dsocketmodule.h126 SOCKET_T sock_fd; /* Socket file descriptor */ member
/external/libpcap/
Dpcap-linux.c306 static int enter_rfmon_mode(pcap_t *handle, int sock_fd,
521 del_mon_if(pcap_t *handle, int sock_fd, struct nl80211_state *state,
525 add_mon_if(pcap_t *handle, int sock_fd, struct nl80211_state *state, in add_mon_if() argument
533 ifindex = iface_get_id(sock_fd, device, handle->errbuf); in add_mon_if()
616 del_mon_if(handle, sock_fd, state, device, mondevice); in add_mon_if()
630 del_mon_if(pcap_t *handle, int sock_fd, struct nl80211_state *state, in del_mon_if() argument
637 ifindex = iface_get_id(sock_fd, mondevice, handle->errbuf); in del_mon_if()
2223 set_dlt_list_cooked(pcap_t *handle, int sock_fd) in set_dlt_list_cooked() argument
2233 if (getsockopt(sock_fd, SOL_PACKET, PACKET_RESERVE, &tp_reserve, in set_dlt_list_cooked()
2255 set_dlt_list_cooked(pcap_t *handle _U_, int sock_fd _U_) in set_dlt_list_cooked()
[all …]
/external/ppp/pppd/
Dsys-linux.c179 static int sock_fd = -1; /* socket for doing interface ioctls */ variable
317 sock_fd = socket(AF_INET, SOCK_DGRAM, 0); in sys_init()
318 if (sock_fd < 0) in sys_init()
369 if (sock_fd >= 0) in sys_close()
370 close(sock_fd); in sys_close()
1200 if (ifunit >= 0 && ioctl(sock_fd, SIOCSIFMTU, (caddr_t) &ifr) < 0) in netif_set_mtu()
1215 if (ifunit >= 0 && ioctl(sock_fd, SIOCGIFMTU, (caddr_t) &ifr) < 0) { in netif_get_mtu()
1383 if (ioctl(sock_fd, SIOCGPPPSTATS, &req) < 0) {
1649 if (ioctl(sock_fd, SIOCADDRT, &rt) < 0) { in sifdefaultroute()
1682 if (ioctl(sock_fd, SIOCDELRT, &rt) < 0 && errno != ESRCH) { in cifdefaultroute()
[all …]
/external/ltp/testcases/kernel/syscalls/setsockopt/
Dsetsockopt03.c91 int ret, sock_fd; in run() local
94 sock_fd = SAFE_SOCKET(AF_INET, SOCK_DGRAM, 0); in run()
107 ret = setsockopt(sock_fd, SOL_IP, IPT_SO_SET_REPLACE, in run()
/external/perfetto/src/profiling/memory/
Dmain.cc47 const char* sock_fd = getenv(kHeapprofdSocketEnvVar); in GetListeningSocket() local
48 if (sock_fd == nullptr) in GetListeningSocket()
51 int raw_fd = static_cast<int>(strtol(sock_fd, &end, 10)); in GetListeningSocket()
/external/python/cpython3/Modules/
Dsocketmodule.c586 #define IS_SELECTABLE(s) (_PyIsSelectable_fd((s)->sock_fd) || (s)->sock_timeout <= 0)
710 if (ioctl(s->sock_fd, FIONBIO, (unsigned int *)&block) == -1) in internal_setblocking()
713 delay_flag = fcntl(s->sock_fd, F_GETFL, 0); in internal_setblocking()
721 if (fcntl(s->sock_fd, F_SETFL, new_delay_flag) == -1) in internal_setblocking()
726 if (ioctlsocket(s->sock_fd, FIONBIO, &arg) != 0) in internal_setblocking()
766 if (s->sock_fd == INVALID_SOCKET) in internal_select()
772 pollfd.fd = s->sock_fd; in internal_select()
809 FD_SET(s->sock_fd, &fds); in internal_select()
816 FD_SET(s->sock_fd, &efds); in internal_select()
822 n = select(Py_SAFE_DOWNCAST(s->sock_fd+1, SOCKET_T, int), in internal_select()
[all …]
/external/perfetto/include/perfetto/ext/ipc/
Dclient.h55 explicit ConnArgs(base::ScopedSocketHandle sock_fd) in ConnArgs()
56 : socket_fd(std::move(sock_fd)) {} in ConnArgs()
/external/libwebsockets/lib/event-libs/libevent/
Dlibevent.c93 lws_event_cb(evutil_socket_t sock_fd, short revents, void *ctx) in lws_event_cb() argument
114 eventfd.fd = sock_fd; in lws_event_cb()
126 wsi = wsi_from_fd(context, sock_fd); in lws_event_cb()
149 lws_event_sigint_cb(evutil_socket_t sock_fd, short revents, void *ctx) in lws_event_sigint_cb() argument
155 pt->context->eventlib_signal_cb((void *)(lws_intptr_t)sock_fd, in lws_event_sigint_cb()
/external/bcc/tools/
Dsofdsnoop.py334 sock = "%d:%s" % (event.sock_fd, get_file(tid, event.sock_fd))

12