


listen(3)                                               listen(3)


NNAAMMEE
       listen - listen for connections on a socket

SSYYNNOOPPSSIISS
       ##iinncclluuddee <<ssyyss//ssoocckkeett..hh>>

       iinntt lliisstteenn((iinntt ss,, iinntt bbaacckklloogg));;

DDEESSCCRRIIPPTTIIOONN
       To  accept  connections,  a  socket  is first created with
       _s_o_c_k_e_t(3), a queue for incoming connections  is  specified
       with  _l_i_s_t_e_n(3)  and  then  connections  are accepted with
       _a_c_c_e_p_t(3).  _l_i_s_t_e_n applies only to unconnected sockets  of
       type  SOCK_STREAM.   For  sockets  in  the  address family
       AF_UNIX the socket  _m_u_s_t  be  bound  to  an  address  with
       _b_i_n_d(3) before connection establishment can continue, oth-
       erwise an EDESTADDRREQ error is returned.

       The listen queue is established for the  socket  specified
       by the _s parameter, which is a socket descriptor.

       _b_a_c_k_l_o_g  defines the maximum allowable length of the queue
       for pending connections.  If a connection request  arrives
       when  the  queue is full, the client receives an ETIMEDOUT
       error.

RREETTUURRNN VVAALLUUEE
       If the call is successful, 0 is  returned.   If  the  call
       fails,  -1  is  returned  and  an  error code is stored in
       eerrrrnnoo.

DDIIAAGGNNOOSSTTIICCSS
       _l_i_s_t_e_n fails if:

       [EBADF]             The argument _s is not a valid descrip-
                           tor.

       [EDESTADDRREQ]      No bind address was established.

       [EOPNOTSUPP]        The  socket is not of a type that sup-
                           ports the _l_i_s_t_e_n operation.

       [EINVAL]            The socket has been shut  down  or  is
                           already  connected.  The argument _s is
                           not a socket.

SSEEEE AALLSSOO
       accept(3), connect(3), socket(3).









                             MiNT-Net                           1


