X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/9bccf70c0258c7cac2dcb80011b2a964d884c552..935ed37a5c468c8a1c07408573c08b8b7ef80e8b:/bsd/man/man2/getsockname.2 diff --git a/bsd/man/man2/getsockname.2 b/bsd/man/man2/getsockname.2 index 4582a3ea5..45241e307 100644 --- a/bsd/man/man2/getsockname.2 +++ b/bsd/man/man2/getsockname.2 @@ -42,49 +42,68 @@ .Sh SYNOPSIS .Fd #include .Ft int -.Fn getsockname "int s" "struct sockaddr *name" "int *namelen" +.Fo getsockname +.Fa "int socket" +.Fa "struct sockaddr *restrict address" +.Fa "socklen_t *restrict address_len" +.Fc .Sh DESCRIPTION .Fn Getsockname returns the current -.Fa name +.Fa address for the specified socket. The -.Fa namelen +.Fa address_len parameter should be initialized to indicate the amount of space pointed to by -.Fa name . +.Fa address . On return it contains the actual size of the name returned (in bytes). -.Sh DIAGNOSTICS -A 0 is returned if the call succeeds, -1 if it fails. +.Sh RETURN VALUES +.Rv -std getsockname .Sh ERRORS -The call succeeds unless: +The +.Fn getsockname +system call will succeed unless: .Bl -tag -width Er +.\" ========== .It Bq Er EBADF The argument -.Fa s -is not a valid descriptor. -.It Bq Er ENOTSOCK -The argument -.Fa s -is a file, not a socket. -.It Bq Er ENOBUFS -Insufficient resources were available in the system -to perform the operation. +.Fa socket +is not a valid file descriptor. +.\" ========== .It Bq Er EFAULT The -.Fa name +.Fa address parameter points to memory not in a valid part of the process address space. +.\" ========== +.It Bq Er EINVAL +.Fa socket +has been shut down. +.\" ========== +.It Bq Er ENOBUFS +Insufficient resources were available in the system +to perform the operation. +.\" ========== +.It Bq Er ENOTSOCK +The argument +.Fa socket +is not a socket (e.g., a plain file). +.\" ========== +.It Bq Er EOPNOTSUPP +.Fn getsockname +is not supported for the protocol in use by +.Fa socket . .El .Sh SEE ALSO .Xr bind 2 , .Xr socket 2 .Sh BUGS Names bound to sockets in the UNIX domain are inaccessible; -.Xr getsockname -returns a zero length name. +.Fn getsockname +returns a zero-length name. .Sh HISTORY The .Fn getsockname -function call appeared in +call appeared in .Bx 4.2 .