.\" 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:
.\" 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 $
.\"
.\" 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
.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
.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
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 ()
.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/.