Home
last modified time | relevance | path

Searched refs:sock (Results 1 – 25 of 33) sorted by relevance

12

/glibc-2.36/sysdeps/unix/sysv/linux/
Dtst-getcwd-smallbuff.c55 send_fd (const int sock, const int fd) in send_fd() argument
82 while ((n = sendmsg (sock, &msg, 0)) == -1 && errno == EINTR); in send_fd()
88 recv_fd (const int sock) in recv_fd() argument
110 while ((n = recvmsg (sock, &msg, 0)) == -1 && errno == EINTR); in recv_fd()
129 const int sock = sockfd[1]; in child_func() local
132 TEST_VERIFY_EXIT (read (sock, &ch, 1) == 1); in child_func()
140 send_fd (sock, fd); in child_func()
143 TEST_VERIFY_EXIT (read (sock, &ch, 1) == 1); in child_func()
146 xclose (sock); in child_func()
215 const int sock = sockfd[0]; in do_test() local
[all …]
/glibc-2.36/nscd/
Dnscd_helper.c51 wait_on_socket (int sock, long int usectmo) in wait_on_socket() argument
54 fds[0].fd = sock; in wait_on_socket()
169 int sock; in open_socket() local
171 sock = __socket (PF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK, 0); in open_socket()
172 if (sock < 0) in open_socket()
185 if (__connect (sock, (struct sockaddr *) &sun, sizeof (sun)) < 0 in open_socket()
202 ssize_t wres = TEMP_FAILURE_RETRY (__send (sock, reqdata, in open_socket()
207 return sock; in open_socket()
229 fds[0].fd = sock; in open_socket()
239 __close_nocancel_nostatus (sock); in open_socket()
[all …]
Dnscd_netgroup.c81 int sock = -1; in __nscd_setnetgrent() local
84 sock = __nscd_open_socket (group, group_len, GETNETGRENT, in __nscd_setnetgrent()
86 if (sock == -1) in __nscd_setnetgrent()
107 if ((size_t) __readall (sock, respdata, datalen) != datalen) in __nscd_setnetgrent()
140 if (sock != -1) in __nscd_setnetgrent()
141 __close_nocancel_nostatus (sock); in __nscd_setnetgrent()
214 int sock = -1; in __nscd_innetgr() local
236 sock = __nscd_open_socket (key, key_len, INNETGR, in __nscd_innetgr()
238 if (sock == -1) in __nscd_innetgr()
264 if (sock != -1) in __nscd_innetgr()
[all …]
Dnscd.c338 int sock = nscd_open_socket (); in invalidate_db() local
340 if (sock == -1) in invalidate_db()
356 ssize_t nbytes = TEMP_FAILURE_RETRY (send (sock, reqdata, reqlen, in invalidate_db()
362 close (sock); in invalidate_db()
369 nbytes = TEMP_FAILURE_RETRY (read (sock, &resp, sizeof (resp))); in invalidate_db()
373 close (sock); in invalidate_db()
377 close (sock); in invalidate_db()
388 int sock = nscd_open_socket (); in send_shutdown() local
390 if (sock == -1) in send_shutdown()
398 ssize_t nbytes = TEMP_FAILURE_RETRY (send (sock, &req, sizeof req, in send_shutdown()
[all …]
Dnscd_getai.c70 int sock = -1; in __nscd_getai() local
96 sock = __nscd_open_socket (key, keylen, GETAI, &ai_resp, in __nscd_getai()
98 if (sock == -1) in __nscd_getai()
114 assert (sock == -1); in __nscd_getai()
139 if ((size_t) __readall (sock, resultbuf + 1, datalen) == datalen) in __nscd_getai()
190 if (sock != -1) in __nscd_getai()
191 __close_nocancel_nostatus (sock); in __nscd_getai()
Dnscd_initgroups.c50 int sock = -1; in __nscd_getgrouplist() local
81 sock = __nscd_open_socket (user, userlen, INITGROUPS, &initgr_resp, in __nscd_getgrouplist()
83 if (sock == -1) in __nscd_getgrouplist()
118 if ((size_t) __readall (sock, *groupsp, initgr_resp.ngrps in __nscd_getgrouplist()
158 if (sock != -1) in __nscd_getgrouplist()
159 __close_nocancel_nostatus (sock); in __nscd_getgrouplist()
Dnscd_getgr_r.c130 int sock = -1; in nscd_getgr_r() local
133 sock = __nscd_open_socket (key, keylen, type, &gr_resp, in nscd_getgr_r()
135 if (sock == -1) in nscd_getgr_r()
195 if (__builtin_expect (__readall (sock, resultbuf->gr_name, n) in nscd_getgr_r()
214 size_t n = __readvall (sock, vec, 2); in nscd_getgr_r()
264 && __builtin_expect (__readall (sock, resultbuf->gr_mem[0], in nscd_getgr_r()
304 if (sock != -1) in nscd_getgr_r()
305 __close_nocancel_nostatus (sock); in nscd_getgr_r()
Dnscd_getpw_r.c119 int sock = -1; in nscd_getpw_r() local
122 sock = __nscd_open_socket (key, keylen, type, &pw_resp, in nscd_getpw_r()
124 if (sock == -1) in nscd_getpw_r()
177 ssize_t nbytes = __readall (sock, buffer, total); in nscd_getpw_r()
217 if (sock != -1) in nscd_getpw_r()
218 __close_nocancel_nostatus (sock); in nscd_getpw_r()
Dnscd_getserv_r.c113 int sock = -1; in nscd_getserv_r() local
179 sock = __nscd_open_socket (key, keylen, type, &serv_resp, in nscd_getserv_r()
181 if (sock == -1) in nscd_getserv_r()
274 if ((size_t) __readvall (sock, vec, n) != total_len) in nscd_getserv_r()
318 || ((size_t) __readall (sock, resultbuf->s_aliases[0], total_len) in nscd_getserv_r()
357 if (sock != -1) in nscd_getserv_r()
358 __close_nocancel_nostatus (sock); in nscd_getserv_r()
Dnscd_gethst_r.c164 int sock = -1; in nscd_gethst_r() local
217 sock = __nscd_open_socket (key, keylen, type, &hst_resp, in nscd_gethst_r()
219 if (sock == -1) in nscd_gethst_r()
345 if ((size_t) __readvall (sock, vec, n) != total_len) in nscd_gethst_r()
390 || ((size_t) __readall (sock, resultbuf->h_aliases[0], total_len) in nscd_gethst_r()
432 if (sock != -1) in nscd_gethst_r()
433 __close_nocancel_nostatus (sock); in nscd_gethst_r()
/glibc-2.36/sunrpc/
Dsvc_unix.c151 svcunix_create (int sock, u_int sendsize, u_int recvsize, char *path) in svcunix_create() argument
162 if (sock == RPC_ANYSOCK) in svcunix_create()
164 if ((sock = __socket (AF_UNIX, SOCK_STREAM, 0)) < 0) in svcunix_create()
171 __bind (sock, (struct sockaddr *) &addr, len); in svcunix_create()
173 if (__getsockname (sock, (struct sockaddr *) &addr, &len) != 0 in svcunix_create()
174 || __listen (sock, SOMAXCONN) != 0) in svcunix_create()
178 __close (sock); in svcunix_create()
198 xprt->xp_sock = sock; in svcunix_create()
248 int sock; in rendezvous_request() local
257 if ((sock = accept (xprt->xp_sock, (struct sockaddr *) &addr, &len)) < 0) in rendezvous_request()
[all …]
Dsvc.c87 register int sock = xprt->xp_sock; in xprt_register() local
97 if (sock < _rpc_dtablesize ()) in xprt_register()
101 xports[sock] = xprt; in xprt_register()
102 if (sock < FD_SETSIZE) in xprt_register()
103 FD_SET (sock, &svc_fdset); in xprt_register()
109 svc_pollfd[i].fd = sock; in xprt_register()
123 svc_pollfd[svc_max_pollfd - 1].fd = sock; in xprt_register()
134 register int sock = xprt->xp_sock; in libc_hidden_nolink_sunrpc() local
137 if ((sock < _rpc_dtablesize ()) && (xports[sock] == xprt)) in libc_hidden_nolink_sunrpc()
139 xports[sock] = (SVCXPRT *) 0; in libc_hidden_nolink_sunrpc()
[all …]
Dsvc_tcp.c153 svctcp_create (int sock, u_int sendsize, u_int recvsize) in svctcp_create() argument
161 if (sock == RPC_ANYSOCK) in svctcp_create()
163 if ((sock = __socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) in svctcp_create()
172 if (bindresvport (sock, &addr)) in svctcp_create()
175 (void) __bind (sock, (struct sockaddr *) &addr, len); in svctcp_create()
177 if ((__getsockname (sock, (struct sockaddr *) &addr, &len) != 0) || in svctcp_create()
178 (__listen (sock, SOMAXCONN) != 0)) in svctcp_create()
182 (void) __close (sock); in svctcp_create()
201 xprt->xp_sock = sock; in svctcp_create()
255 int sock; in rendezvous_request() local
[all …]
Dclnt_gen.c54 int sock; in clnt_create() local
67 sock = RPC_ANYSOCK; in clnt_create()
68 client = clntunix_create (&sun, prog, vers, &sock, 0, 0); in clnt_create()
103 sock = RPC_ANYSOCK; in clnt_create()
109 client = clntudp_create (&sin, prog, vers, tv, &sock); in clnt_create()
123 client = clnttcp_create (&sin, prog, vers, &sock, 0, 0); in clnt_create()
Dsvc_udp.c122 svcudp_bufcreate (int sock, u_int sendsz, u_int recvsz) in svcudp_bufcreate() argument
132 if (sock == RPC_ANYSOCK) in svcudp_bufcreate()
134 if ((sock = __socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) in svcudp_bufcreate()
143 if (bindresvport (sock, &addr)) in svcudp_bufcreate()
146 (void) __bind (sock, (struct sockaddr *) &addr, len); in svcudp_bufcreate()
148 if (__getsockname (sock, (struct sockaddr *) &addr, &len) != 0) in svcudp_bufcreate()
152 (void) __close (sock); in svcudp_bufcreate()
175 xprt->xp_sock = sock; in svcudp_bufcreate()
187 if (__setsockopt (sock, SOL_IP, IP_PKTINFO, (void *) &pad, in svcudp_bufcreate()
207 svcudp_create (int sock) in libc_hidden_def()
[all …]
Dpmap_rmt.c223 int sock; in clnt_broadcast() local
242 if ((sock = __socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) in clnt_broadcast()
249 if (__setsockopt (sock, SOL_SOCKET, SO_BROADCAST, &on, sizeof (on)) < 0) in clnt_broadcast()
256 fd.fd = sock; in clnt_broadcast()
299 if (__sendto (sock, outbuf, outlen, 0, in clnt_broadcast()
335 inlen = __recvfrom (sock, inbuf, UDPMSGSIZE, 0, in clnt_broadcast()
388 (void) __close (sock); in clnt_broadcast()
/glibc-2.36/manual/examples/
Dinetcli.c51 int sock; in main() local
55 sock = socket (PF_INET, SOCK_STREAM, 0); in main()
56 if (sock < 0) in main()
64 if (0 > connect (sock, in main()
73 write_to_server (sock); in main()
74 close (sock); in main()
Dinetsrv.c58 int sock; in main() local
65 sock = make_socket (PORT); in main()
66 if (listen (sock, 1) < 0) in main()
74 FD_SET (sock, &active_fd_set); in main()
90 if (i == sock) in main()
95 new = accept (sock, in main()
Dmkisock.c26 int sock; in make_socket() local
30 sock = socket (PF_INET, SOCK_STREAM, 0); in make_socket()
31 if (sock < 0) in make_socket()
41 if (bind (sock, (struct sockaddr *) &name, sizeof (name)) < 0) in make_socket()
47 return sock; in make_socket()
Dmkfsock.c30 int sock; in make_named_socket() local
34 sock = socket (PF_LOCAL, SOCK_DGRAM, 0); in make_named_socket()
35 if (sock < 0) in make_named_socket()
55 if (bind (sock, (struct sockaddr *) &name, size) < 0) in make_named_socket()
61 return sock; in make_named_socket()
Dfilecli.c34 int sock; in main() local
41 sock = make_named_socket (CLIENT); in main()
49 nbytes = sendto (sock, MESSAGE, strlen (MESSAGE) + 1, 0, in main()
58 nbytes = recvfrom (sock, message, MAXMSG, 0, NULL, 0); in main()
70 close (sock); in main()
Dfilesrv.c30 int sock; in main() local
40 sock = make_named_socket (SERVER); in main()
45 nbytes = recvfrom (sock, message, MAXMSG, 0, in main()
57 nbytes = sendto (sock, message, nbytes, 0, in main()
/glibc-2.36/sysdeps/mach/hurd/
Dsocket.c33 socket_t sock, server; in __socket() local
45 err = __socket_create (server, type, protocol, &sock); in __socket()
54 err = __socket_create (server, type, protocol, &sock); in __socket()
67 err = __io_set_some_openmodes (sock, O_NONBLOCK); in __socket()
74 return _hurd_intern_fd (sock, O_IGNORE_CTTY | flags, 1); in __socket()
/glibc-2.36/nis/
Dnis_findserv.c80 int sock, dontblock = 1; in __nis_findfastest_with_timeout() local
144 sock = socket (AF_INET, SOCK_DGRAM | SOCK_CLOEXEC, IPPROTO_UDP); in __nis_findfastest_with_timeout()
145 clnt = clntudp_create (&saved_sin, NIS_PROG, NIS_VERSION, *timeout, &sock); in __nis_findfastest_with_timeout()
148 close (sock); in __nis_findfastest_with_timeout()
155 ioctl (sock, FIONBIO, &dontblock); in __nis_findfastest_with_timeout()
193 close (sock); in __nis_findfastest_with_timeout()
Dnis_callback.c265 int sock = RPC_ANYSOCK; in __nis_create_callback() local
319 ? svcudp_bufcreate (sock, 100, 8192) in __nis_create_callback()
320 : svctcp_create (sock, 100, 8192)); in __nis_create_callback()
326 cb->sock = cb->xprt->xp_sock; in __nis_create_callback()
337 if (getsockname (cb->sock, (struct sockaddr *) &sin, &len) == -1) in __nis_create_callback()
374 close (cb->sock); in __nis_destroy_callback()

12