Home
last modified time | relevance | path

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

123456

/illumos-gate/usr/src/lib/libsocket/socket/
H A Dweaks.c84 return (_so_bind(sock, addr, addrlen, SOV_SOCKBSD)); in _bind()
88 _listen(int sock, int backlog) in _listen() argument
90 return (_so_listen(sock, backlog, SOV_DEFAULT)); in _listen()
112 _shutdown(int sock, int how) in _shutdown() argument
114 return (_so_shutdown(sock, how, SOV_DEFAULT)); in _shutdown()
118 _recv(int sock, void *buf, size_t len, int flags) in _recv() argument
132 _recvmsg(int sock, struct msghdr *msg, int flags) in _recvmsg() argument
201 if (ioctl(sock, SIOCSCTPGOPT, &sopt) == -1) { in _getsockopt()
223 return (_so_bind(sock, addr, addrlen, SOV_XPG4_2)); in __xnet_bind()
228 __xnet_listen(int sock, int backlog) in __xnet_listen() argument
[all …]
/illumos-gate/usr/src/cmd/fs.d/nfs/lib/
H A Dselfcheck.c117 int sock; in getmyaddrs() local
131 if (ioctl(sock, SIOCGLIFNUM, (char *)&lifn) < 0) { in getmyaddrs()
143 (void) close(sock); in getmyaddrs()
150 (void) close(sock); in getmyaddrs()
162 (void) close(sock); in getmyaddrs()
168 (void) close(sock); in getmyaddrs()
176 int sock; in Is_ipv6present() local
179 sock = socket(AF_INET6, SOCK_DGRAM, 0); in Is_ipv6present()
180 if (sock < 0) in Is_ipv6present()
186 close(sock); in Is_ipv6present()
[all …]
/illumos-gate/usr/src/cmd/bhyve/
H A Dpci_virtio_console.c313 if (sock == NULL) { in pci_vtcon_sock_add()
381 sock->vss_port = pci_vtcon_port_add(sc, port, name, pci_vtcon_sock_tx, sock); in pci_vtcon_sock_add()
387 sock->vss_open = false; in pci_vtcon_sock_add()
388 sock->vss_conn_fd = -1; in pci_vtcon_sock_add()
391 sock); in pci_vtcon_sock_add()
405 free(sock); in pci_vtcon_sock_add()
421 if (sock->vss_open) { in pci_vtcon_sock_accept()
426 sock->vss_open = true; in pci_vtcon_sock_accept()
427 sock->vss_conn_fd = s; in pci_vtcon_sock_accept()
428 sock->vss_conn_evp = mevent_add(s, EVF_READ, pci_vtcon_sock_rx, sock); in pci_vtcon_sock_accept()
[all …]
/illumos-gate/usr/src/test/os-tests/tests/sockfs/
H A Ddrop_priv.c70 int sock; in server() local
85 sock = socket(AF_UNIX, SOCK_DGRAM, 0); in server()
86 if (sock == -1) { in server()
113 ret = recvmsg(sock, &msg, 0); in server()
131 int sock; in non_priv_send() local
165 if (sock == -1) { in non_priv_send()
178 ret = sendmsg(sock, &msg, 0); in non_priv_send()
202 int sock; in main() local
253 if (sock == -1) { in main()
316 ret = sendmsg(sock, &msg, 0); in main()
[all …]
H A Ddgram.c41 int sock; in server() local
45 sock = socket(AF_UNIX, SOCK_DGRAM, 0); in server()
46 if (sock == -1) { in server()
51 ret = bind(sock, (struct sockaddr *)addr, sizeof (*addr)); in server()
73 ret = recvmsg(sock, &msg, 0); in server()
99 int sock; in main() local
137 sock = socket(AF_UNIX, SOCK_DGRAM, 0); in main()
138 if (sock == -1) { in main()
168 ret = sendmsg(sock, &msg, 0); in main()
180 close(sock); in main()
H A Dsockpair.c43 int sock = sfds[0]; in server() local
61 ret = recvmsg(sock, &msg, 0); in server()
76 close(sock); in server()
84 int sock; in runtest() local
107 sock = sfds[1]; in runtest()
130 ret = sendmsg(sock, &msg, 0); in runtest()
147 close(sock); in runtest()
150 send(sock, "", 0, 0); in runtest()
H A Dconn.c46 int sock = (int)varg; in server() local
64 ret = recvmsg(sock, &msg, 0); in server()
135 int sock; in main() local
173 sock = socket(AF_UNIX, SOCK_STREAM, 0); in main()
174 if (sock == -1) { in main()
180 ret = connect(sock, (struct sockaddr *)&addr, sizeof (addr)); in main()
208 ret = sendmsg(sock, &msg, 0); in main()
220 close(sock); in main()
/illumos-gate/usr/src/contrib/mDNSResponder/mDNSPosix/
H A DmDNSPosix.c231 sock->callback(sock, sock->context, mDNSfalse, sock->err); in TCPReadCallback()
278 sock->callback(sock, sock->context, c, sock->err); in tcpConnectCallback()
403 memset(sock, 0, sizeof *sock); in mDNSPlatformTCPSocket()
407 sock->hostname = (domainname *)(sock + 1); in mDNSPlatformTCPSocket()
415 if (sock->events.fd != -1) close(sock->events.fd); in mDNSPlatformTCPSocket()
416 free(sock); in mDNSPlatformTCPSocket()
425 return sock; in mDNSPlatformTCPSocket()
446 if (!sock) in mDNSPlatformTCPAccept()
454 return sock; in mDNSPlatformTCPAccept()
633 if (sock) in mDNSPlatformTCPCloseConnection()
[all …]
/illumos-gate/usr/src/uts/common/fs/smbsrv/
H A Dsmb_opipe.c49 ksocket_t sock; in smb_opipe_alloc() local
345 ksocket_t sock; in smb_opipe_close() local
375 ksocket_t sock; in smb_opipe_write() local
386 if (sock != NULL) in smb_opipe_write()
389 if (sock == NULL) in smb_opipe_write()
425 ksocket_t sock; in smb_opipe_read() local
436 if (sock != NULL) in smb_opipe_read()
439 if (sock == NULL) in smb_opipe_read()
502 ksocket_t sock; in smb_opipe_ioctl() local
512 if (sock != NULL) in smb_opipe_ioctl()
[all …]
/illumos-gate/usr/src/lib/libbsm/common/
H A Daudit_settid.c45 struct sockaddr_in6 sock; in audit_settid() local
47 int socklen = sizeof (sock); in audit_settid()
61 if (getsockname(fd, (struct sockaddr *)&sock, (socklen_t *)&socklen) in audit_settid()
67 rv = do_ipv6_address(&peer, &sock); in audit_settid()
70 (struct sockaddr_in *)&sock); in audit_settid()
76 do_ipv6_address(struct sockaddr_in6 *peer, struct sockaddr_in6 *sock) in do_ipv6_address() argument
96 ai.ai_termid.at_port = ((peer->sin6_port<<16) | (sock->sin6_port)); in do_ipv6_address()
108 do_ipv4_address(struct sockaddr_in *peer, struct sockaddr_in *sock) in do_ipv4_address() argument
124 ai.ai_termid.port = (peer->sin_port<<16 | sock->sin_port); in do_ipv4_address()
/illumos-gate/usr/src/ucblib/librpcsoc/
H A Dsvc_tcp.c109 register int sock; in svctcp_create()
119 if (sock == RPC_ANYSOCK) {
129 if (bindresvport(sock, &addr)) {
134 (_listen(sock, 2) != 0)) {
138 (void) close(sock);
145 (void) close(sock);
155 (void) close(sock);
164 xprt->xp_sock = sock;
228 int sock; local
296 register int sock = xprt->xp_sock; local
[all …]
/illumos-gate/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_diff/
H A Dsocket.c32 struct sockaddr_un sock; in main() local
41 size = sizeof (sock.sun_path); in main()
42 (void) strncpy(sock.sun_path, (char *)path, size - 1); in main()
43 sock.sun_path[size - 1] = '\0'; in main()
45 sock.sun_family = AF_UNIX; in main()
50 if (bind(fd, (struct sockaddr *)&sock, sizeof (struct sockaddr_un))) { in main()
/illumos-gate/usr/src/lib/libproc/common/
H A Dpr_getsockname.c41 int syscall, int sock, struct sockaddr *name, socklen_t *namelen) in get_sock_peer_name() argument
49 adp->arg_value = sock; in get_sock_peer_name()
95 int sock, struct sockaddr *name, socklen_t *namelen) in pr_getsockname() argument
98 return (_so_getsockname(sock, name, namelen, SOV_DEFAULT)); in pr_getsockname()
100 return (get_sock_peer_name(Pr, SYS_getsockname, sock, name, namelen)); in pr_getsockname()
108 int sock, struct sockaddr *name, socklen_t *namelen) in pr_getpeername() argument
111 return (_so_getpeername(sock, name, namelen, SOV_DEFAULT)); in pr_getpeername()
113 return (get_sock_peer_name(Pr, SYS_getpeername, sock, name, namelen)); in pr_getpeername()
118 int sock, int level, int optname, void *optval, int *optlen) in pr_getsockopt() argument
126 return (_so_getsockopt(sock, level, optname, optval, optlen)); in pr_getsockopt()
[all …]
/illumos-gate/usr/src/uts/intel/io/imc/
H A Dimc.c769 if (sock == NULL) { in imc_map_stubs()
791 sock->isock_nimc++; in imc_map_stubs()
803 sock->isock_ntad++; in imc_map_stubs()
810 sock->isock_nimc++; in imc_map_stubs()
822 sock->isock_ntad++; in imc_map_stubs()
887 sock->isock_ntad++; in imc_map_stubs()
891 sock->isock_ntad++; in imc_map_stubs()
946 for (uint_t sock = 0; sock < imc->imc_nsockets; sock++) { in imc_validate_stubs() local
1418 sock->isock_gen++; in imc_nvl_pack()
2687 imc_socket_t *sock; in imc_ioctl() local
[all …]
/illumos-gate/usr/src/lib/libsendfile/common/
H A Dsendfile.c45 _sendfilev(int sock, const struct sendfilevec *vec, int sfvcnt, size_t *xferred) in _sendfilev() argument
50 error = __systemcall(&rval, SYS_sendfilev, SENDFILEV, sock, vec, in _sendfilev()
63 _sendfile(int sock, int fd, off_t *off, size_t len) in _sendfile() argument
74 error = __systemcall(&rval, SYS_sendfilev, SENDFILEV, sock, &sfv, in _sendfile()
93 _sendfilev64(int sock, const struct sendfilevec64 *vec, int sfvcnt, in _sendfilev64() argument
99 error = __systemcall(&rval, SYS_sendfilev, SENDFILEV64, sock, vec, in _sendfilev64()
112 _sendfile64(int sock, int fd, off64_t *off, size_t len) in _sendfile64() argument
123 error = __systemcall(&rval, SYS_sendfilev, SENDFILEV64, sock, &sfv, in _sendfile64()
/illumos-gate/usr/src/lib/libkmf/libkmf/common/
H A Dclient.c167 if ((n = write(sock, buf, bytes)) < 0) { in send_ocsp_request()
251 if (fcntl(sock, F_SETFL, sock_flag) == -1) { in get_encoded_response()
256 pfd.fd = sock; in get_encoded_response()
487 int sock, respfd; in kmf_get_encoded_ocsp_response() local
510 if (sock == -1) { in kmf_get_encoded_ocsp_response()
541 (void) close(sock); in kmf_get_encoded_ocsp_response()
580 int sock; in download_file() local
631 sock = connect_to_server(hostname, port); in download_file()
633 if (sock == -1) { in download_file()
655 if (sock != -1) in download_file()
[all …]
/illumos-gate/usr/src/contrib/mDNSResponder/mDNSShared/
H A DPlatformCommon.c174 if (sock == -1) return; in mDNSPlatformSourceAddrForDest()
213 close(sock); in mDNSPlatformSourceAddrForDest()
341 int sock; in mDNSPosixTCPSocketSetup() local
345 if (sock < 3) in mDNSPosixTCPSocketSetup()
353 *fd = sock; in mDNSPosixTCPSocketSetup()
431 TCPSocket *sock = mDNSNULL; in mDNSPosixDoTCPListenCallback() local
538 if (sock == NULL) in mDNSPosixDoTCPListenCallback()
547 return sock; in mDNSPosixDoTCPListenCallback()
562 int sock; in mDNSPosixTCPListen() local
611 if (sock < 0) in mDNSPosixTCPListen()
[all …]
/illumos-gate/usr/src/lib/print/libpapi-lpd/common/
H A Dlpd-port.c179 return (sock); in sock_connect()
441 if (send_lpd_message(sock, "") < 0) in send_data_file()
483 if (write(sock, data, len) != len) in send_control_file()
488 if (send_lpd_message(sock, "") < 0) in send_control_file()
511 sock, printer, job_id, path); in submit_job()
518 sock, printer, job_id, path); in submit_job()
526 sock, printer, job_id, path); in submit_job()
534 sock, printer, job_id, path); in submit_job()
561 write(sock, "\001\n", 2); /* abort */ in submit_job()
583 write(sock, "\001\n", 2); /* abort */ in submit_job()
[all …]
/illumos-gate/usr/src/cmd/krb5/krb5kdc/
H A Dnetwork.c349 setnbio(int sock) in setnbio() argument
366 int sock; in setup_a_tcp_listener() local
369 if (sock == -1) { in setup_a_tcp_listener()
382 close(sock); in setup_a_tcp_listener()
388 close(sock); in setup_a_tcp_listener()
395 close(sock); in setup_a_tcp_listener()
402 close(sock); in setup_a_tcp_listener()
409 close(sock); in setup_a_tcp_listener()
412 return sock; in setup_a_tcp_listener()
505 int sock = -1, i; in setup_udp_port() local
[all …]
/illumos-gate/usr/src/cmd/cmd-inet/usr.lib/in.ripngd/
H A Dstartup.c388 int sock; in setup_listen_sock() local
396 sock = socket(AF_INET6, SOCK_DGRAM, 0); in setup_listen_sock()
397 if (sock == -1) in setup_listen_sock()
431 if (setsockopt(sock, IPPROTO_IPV6, IPV6_JOIN_GROUP, in setup_listen_sock()
448 if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *)&on, in setup_listen_sock()
456 if (setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char *)&recvsize, in setup_listen_sock()
465 if (bind(sock, (struct sockaddr *)&sin6, sizeof (sin6)) < 0) { in setup_listen_sock()
484 poll_ifs[poll_ifs_num - 1].fd = sock; in setup_listen_sock()
486 return (sock); in setup_listen_sock()
489 if (sock > 0) in setup_listen_sock()
[all …]
/illumos-gate/usr/src/lib/libsctp/common/
H A Dsctp.c66 sctp_bindx(int sock, void *addrs, int addrcnt, int flags) in sctp_bindx() argument
90 return (setsockopt(sock, IPPROTO_SCTP, SCTP_ADD_ADDR, addrs, in sctp_bindx()
105 sctp_getpaddrs(int sock, sctp_assoc_t id, void **addrs) in sctp_getpaddrs() argument
123 if (ioctl(sock, SIOCSCTPGOPT, &opt) == -1) { in sctp_getpaddrs()
141 if (ioctl(sock, SIOCSCTPGOPT, &opt) == -1) { in sctp_getpaddrs()
166 sctp_getladdrs(int sock, sctp_assoc_t id, void **addrs) in sctp_getladdrs() argument
184 if (ioctl(sock, SIOCSCTPGOPT, &opt) == -1) { in sctp_getladdrs()
202 if (ioctl(sock, SIOCSCTPGOPT, &opt) == -1) { in sctp_getladdrs()
236 if (ioctl(sock, SIOCSCTPGOPT, &sopt) == -1) { in sctp_opt_info()
248 sctp_peeloff(int sock, sctp_assoc_t id) in sctp_peeloff() argument
[all …]
/illumos-gate/usr/src/uts/common/fs/sockfs/
H A Dsocksyscalls.c178 releasef(sock); in getsonode()
193 releasef(sock); in getsonode()
588 releasef(sock); in bind()
612 releasef(sock); in listen()
676 releasef(sock); in accept()
682 releasef(sock); in accept()
761 releasef(sock); in accept()
791 releasef(sock); in connect()
814 releasef(sock); in shutdown()
857 releasef(sock); in recvit()
[all …]
/illumos-gate/usr/src/lib/gss_mechs/mech_krb5/krb5/os/
H A Dforeachaddr.c197 int sock; in foreach_localaddr() member
214 P.sock = -1; in foreach_localaddr()
221 P.sock = socket (P.af, USE_TYPE, USE_PROTO); in foreach_localaddr()
222 if (P.sock < 0) { in foreach_localaddr()
231 code = ioctl (P.sock, SIOCGLIFNUM, &P.lifnum); in foreach_localaddr()
247 code = get_lifconf (P.af, P.sock, &P.buf_size, P.buf); in foreach_localaddr()
262 if (ioctl (P.sock, SIOCGLIFFLAGS, (char *)&lifreq) < 0) { in foreach_localaddr()
312 if (P.sock != -1) in foreach_localaddr()
323 if (P.sock >= 0) { in foreach_localaddr()
341 closesocket(P.sock); in foreach_localaddr()
/illumos-gate/usr/src/lib/libresolv2/common/isc/
H A Dctl_srvr.c82 int sock; member
106 int sock; member
205 ctx->sock = -1; in ctl_server()
208 if (ctx->sock < 0) { in ctl_server()
217 close(ctx->sock); in ctl_server()
239 close(ctx->sock); in ctl_server()
253 close(ctx->sock); in ctl_server()
280 if (ctx->sock != -1) { in ctl_endserver()
281 (void) close(ctx->sock); in ctl_endserver()
282 ctx->sock = -1; in ctl_endserver()
[all …]
/illumos-gate/usr/src/common/mc/imc/
H A Dimc_dump.c219 imc_dump_socket(imc_socket_t *sock) in imc_dump_socket() argument
228 sad = imc_dump_sad(&sock->isock_sad); in imc_dump_socket()
232 for (i = 0; i < sock->isock_ntad; i++) { in imc_dump_socket()
236 for (i = 0; i < sock->isock_ntad; i++) { in imc_dump_socket()
242 for (i = 0; i < sock->isock_nimc; i++) { in imc_dump_socket()
246 for (i = 0; i < sock->isock_nimc; i++) { in imc_dump_socket()
509 &sock->isock_ntad) != 0 || in imc_restore_socket()
511 &sock->isock_nodeid) != 0 || in imc_restore_socket()
513 &sock->isock_nimc) != 0 || in imc_restore_socket()
514 sock->isock_ntad > IMC_MAX_TAD || in imc_restore_socket()
[all …]

123456