Lines Matching refs:namelen
227 size_t namelen = (size_t)*namelenp; in copyin_name() local
229 ASSERT(namelen != 0); in copyin_name()
230 if (namelen > SO_MAXARGSIZE) { in copyin_name()
236 faddr = (char *)kmem_alloc(namelen, KM_SLEEP); in copyin_name()
237 if (copyin(name, faddr, namelen)) { in copyin_name()
238 kmem_free(faddr, namelen); in copyin_name()
248 if (so->so_family == AF_UNIX && faddr[namelen - 1] != '\0') { in copyin_name()
253 for (i = sizeof (name->sa_family); i < namelen; i++) { in copyin_name()
263 nfaddr = (char *)kmem_alloc(namelen + 1, KM_SLEEP); in copyin_name()
264 bcopy(faddr, nfaddr, namelen); in copyin_name()
265 kmem_free(faddr, namelen); in copyin_name()
268 nfaddr[namelen] = '\0'; in copyin_name()
269 namelen++; in copyin_name()
270 ASSERT((socklen_t)namelen == namelen); in copyin_name()
271 *namelenp = (socklen_t)namelen; in copyin_name()
358 size_t namelen; in so_socketpair() local
409 namelen = sizeof (struct sockaddr_ux); in so_socketpair()
410 name = kmem_alloc(namelen, KM_SLEEP); in so_socketpair()
415 (socklen_t)namelen, in so_socketpair()
418 kmem_free(name, namelen); in so_socketpair()
425 (socklen_t)namelen, in so_socketpair()
427 kmem_free(name, namelen); in so_socketpair()
466 namelen = sizeof (struct sockaddr_ux); in so_socketpair()
467 name = kmem_alloc(namelen, KM_SLEEP); in so_socketpair()
472 (socklen_t)namelen, in so_socketpair()
474 kmem_free(name, namelen); in so_socketpair()
557 bind(int sock, struct sockaddr *name, socklen_t namelen, int version) in bind() argument
563 sock, (void *)name, namelen)); in bind()
573 if (name != NULL && namelen != 0) { in bind()
575 name = copyin_name(so, name, &namelen, &error); in bind()
582 namelen = 0; in bind()
587 error = socket_bind(so, name, namelen, 0, CRED()); in bind()
590 error = socket_bind(so, name, namelen, _SOBIND_XPG4_2, CRED()); in bind()
593 error = socket_bind(so, name, namelen, _SOBIND_SOCKBSD, CRED()); in bind()
599 kmem_free(name, (size_t)namelen); in bind()
635 socklen_t namelen; in accept() local
663 if (copyin(namelenp, &namelen, sizeof (namelen))) { in accept()
667 if (namelen != 0) { in accept()
668 error = useracc(name, (size_t)namelen, B_WRITE); in accept()
676 namelen = 0; in accept()
698 if (namelen != 0) { in accept()
704 error = copyout_name(name, namelen, namelenp, in accept()
775 connect(int sock, struct sockaddr *name, socklen_t namelen, int version) in connect() argument
782 sock, (void *)name, namelen)); in connect()
788 if (namelen != 0) { in connect()
790 name = copyin_name(so, name, &namelen, &error); in connect()
798 error = socket_connect(so, name, namelen, fp->f_flag, in connect()
802 kmem_free(name, (size_t)namelen); in connect()
839 socklen_t namelen; in recvit() local
853 namelen = msg->msg_namelen; in recvit()
868 error = copyout_name(name, namelen, namelenp, in recvit()
1139 socklen_t namelen; in sendit() local
1157 namelen = msg->msg_namelen; in sendit()
1158 if (name != NULL && namelen != 0) { in sendit()
1162 &namelen, &error); in sendit()
1166 msg->msg_namelen = namelen; in sendit()
1170 msg->msg_namelen = namelen = 0; in sendit()
1206 kmem_free(name, namelen); in sendit()
1372 struct sockaddr *name, socklen_t namelen) in sendto() argument
1379 sock, buffer, len, flags, (void *)name, namelen)); in sendto()
1395 lmsg.msg_namelen = namelen; in sendto()
1413 socklen_t namelen; in getpeername() local
1424 if (copyin(namelenp, &namelen, sizeof (namelen)) || in getpeername()
1425 (name == NULL && namelen != 0)) { in getpeername()
1435 error = copyout_name(name, namelen, namelenp, in getpeername()
1450 socklen_t namelen, sock_addrlen; in getsockname() local
1460 if (copyin(namelenp, &namelen, sizeof (namelen)) || in getsockname()
1461 (name == NULL && namelen != 0)) { in getsockname()
1472 error = copyout_name(name, namelen, namelenp, in getsockname()
2979 caddr32_t name, socklen_t namelen) in sendto32() argument
2982 (void *)(uintptr_t)name, namelen)); in sendto32()
2998 sobind(struct sonode *so, struct sockaddr *name, socklen_t namelen, in sobind() argument
3003 error = socket_bind(so, name, namelen, flags, CRED()); in sobind()
3017 soconnect(struct sonode *so, struct sockaddr *name, socklen_t namelen, in soconnect() argument
3020 return (socket_connect(so, name, namelen, fflag, flags, CRED())); in soconnect()