]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - man2/getpeername.2
user_namespaces.7: Minor rewordings of recently added text
[thirdparty/man-pages.git] / man2 / getpeername.2
index 718748eb7cbf9e7339f6e4213ad7bc800dd85dcc..3b71b3c7a21e2a00a01b909f18ceeead285666a2 100644 (file)
 .\" Modified 17 Jul 2002, Michael Kerrisk <mtk.manpages@gmail.com>
 .\"    Added 'socket' to NAME, so that "man -k socket" will show this page.
 .\"
-.TH GETPEERNAME 2 2015-08-08 "Linux" "Linux Programmer's Manual"
+.TH GETPEERNAME 2 2017-09-15 "Linux" "Linux Programmer's Manual"
 .SH NAME
 getpeername \- get name of connected peer socket
 .SH SYNOPSIS
 .B #include <sys/socket.h>
-.sp
+.PP
 .BI "int getpeername(int " sockfd ", struct sockaddr *" addr \
 ", socklen_t *" addrlen );
 .SH DESCRIPTION
@@ -60,7 +60,7 @@ by
 .IR addr .
 On return it contains the actual size of the name returned (in bytes).
 The name is truncated if the buffer provided is too small.
-
+.PP
 The returned address is truncated if the buffer provided is too small;
 in this case,
 .I addrlen
@@ -75,7 +75,7 @@ is set appropriately.
 .B EBADF
 The argument
 .I sockfd
-is not a valid descriptor.
+is not a valid file descriptor.
 .TP
 .B EFAULT
 The
@@ -95,25 +95,19 @@ to perform the operation.
 The socket is not connected.
 .TP
 .B ENOTSOCK
-The argument
+The file descriptor
 .I sockfd
-is a file, not a socket.
+does not refer to a socket.
 .SH CONFORMING TO
 POSIX.1-2001, POSIX.1-2008, SVr4, 4.4BSD
 .RB ( getpeername ()
 first appeared in 4.2BSD).
 .SH NOTES
-The third argument of
-.BR getpeername ()
-is in reality an
-.I "int\ *"
-(and this is what 4.x BSD and libc4 and libc5 have).
-Some POSIX confusion resulted in the present
-.IR socklen_t ,
-also used by glibc.
-See also
+For background on the
+.I socklen_t
+type, see
 .BR accept (2).
-
+.PP
 For stream sockets, once a
 .BR connect (2)
 has been performed, either socket can call