OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man2 / listen.2
index 3fe38d1..7226538 100644 (file)
@@ -2,6 +2,7 @@
 .\" and Copyright (C) 2007, Michael Kerrisk <mtk.manpages@gmail.com>
 .\" All rights reserved.
 .\"
+.\" %%%LICENSE_START(BSD_4_CLAUSE_UCB)
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions
 .\" are met:
@@ -29,6 +30,7 @@
 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
+.\" %%%LICENSE_END
 .\"
 .\"     $Id: listen.2,v 1.6 1999/05/18 14:10:32 freitag Exp $
 .\"
@@ -40,7 +42,7 @@
 .\" Modified 11 May 2001 by Sam Varshavchik <mrsam@courier-mta.com>
 .\"
 .\"
-.TH LISTEN 2 2008-11-20 "Linux" "Linux Programmer's Manual"
+.TH LISTEN 2 2014-05-10 "Linux" "Linux Programmer's Manual"
 .SH NAME
 listen \- listen for connections on a socket
 .SH SYNOPSIS
@@ -77,7 +79,7 @@ may receive an error with an indication of
 .B ECONNREFUSED
 or, if the underlying protocol supports retransmission, the request may be
 ignored so that a later reattempt at connection succeeds.
-.SH "RETURN VALUE"
+.SH RETURN VALUE
 On success, zero is returned.
 On error, \-1 is returned, and
 .I errno
@@ -87,6 +89,19 @@ is set appropriately.
 .B EADDRINUSE
 Another socket is already listening on the same port.
 .TP
+.B EADDRINUSE
+(Internet domain sockets)
+The socket referred to by
+.I sockfd
+had not previously been bound to an address and,
+upon attempting to bind it to an ephemeral port,
+it was determined that all port numbers in the ephemeral port range
+are currently in use.
+See the discussion of
+.I /proc/sys/net/ipv4/ip_local_port_range
+in
+.BR ip (7).
+.TP
 .B EBADF
 The argument
 .I sockfd
@@ -101,7 +116,7 @@ is not a socket.
 The socket is not of a type that supports the
 .BR listen ()
 operation.
-.SH "CONFORMING TO"
+.SH CONFORMING TO
 4.4BSD, POSIX.1-2001.
 The
 .BR listen ()
@@ -164,9 +179,18 @@ with the value 128.
 .SH EXAMPLE
 See
 .BR bind (2).
-.SH "SEE ALSO"
+.SH SEE ALSO
 .BR accept (2),
 .BR bind (2),
 .BR connect (2),
 .BR socket (2),
 .BR socket (7)
+.SH COLOPHON
+This page is part of release 3.79 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.