


recvmsg(3)                                             recvmsg(3)


NNAAMMEE
       recvmsg - receive a message on a socket

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

       iinntt rreeccvvmmssgg((iinntt ss,, ssttrruucctt mmssgghhddrr **mmssgg,, iinntt ffllaaggss));;


DDEESSCCRRIIPPTTIIOONN
       _r_e_c_v_m_s_g  is used to receive a message from another socket.
       _s is a socket descriptor  that  specifies  the  socket  on
       which  the  message  will  be  received.  _m_s_g points to an
       object of type ssttrruucctt mmssgghhddrr into which the received  mes-
       sage will be placed.  ssttrruucctt mmssgghhddrr is explained below.

       _r_e_c_v_m_s_g  operates the same way as _r_e_c_v_f_r_o_m, except that it
       is able to scatter the data into  the  mmssgg__iioovv  member  of
       ssttrruucctt mmssgghhddrr.   Note  that  receiving of access rights is
       not implemented.  Do not rely on this behavior, because it
       might change in the future.

       ssttrruucctt mmssgghhddrr  is  defined  in <ssyyss//ssoocckkeett..hh>, and has the
       following form :

              struct msghdr {
                   void *msg_name;     /* optional address */
                   size_t    msg_namelen;   /* size of address  */
                   struct iovec *msg_iov;   /* scatter array for data */
                   size_t    msg_iovlen;    /* # of elements in msg_iov */
                   void    *msg_accrights;  /* access rights */
                   size_t    msg_accrightslen; /* size of msg_accrights */
              }

       _m_s_g___n_a_m_e contains  the  source  address  of  the  message;
       _m_s_g___n_a_m_e  may  be a null pointer if you are not interested
       in this information.  _m_s_g___i_o_v is the location of the scat-
       ter data.  _m_s_g___a_c_c_r_i_g_h_t_s specifies a buffer to receive any
       access rights along with the message.  Transfer of  access
       rights   is   not  implemented,  so  you  should  set  the
       msg_acccrights field to NULL indicating that access rights
       are not being transferred.

       See  _r_e_c_v_f_r_o_m_(_3_)  to  learn  more  about  the  behavior of
       _r_e_c_v_m_s_g.

RREETTUURRNN VVAALLUUEE
       If the _r_e_c_v_m_s_g call is successful, it returns  the  number
       of  bytes received.  If the call fails, -1 is returned and
       an error code is stored in eerrrrnnoo.

DDIIAAGGNNOOSSTTIICCSS
       The call to _r_e_c_v_m_s_g fail if:




                             MiNT-Net                           1





recvmsg(3)                                             recvmsg(3)


              [EBADF]             The argument _s  is  an  invalid
                                  descriptor.

              [EINVAL]            The argument _s is not a socket.
                                  The  _m_s_g   parameter   contains
                                  invalid members.

              [ENOMEM]            There  is  insufficient  buffer
                                  space to send the message.

              [EINTR]             The receive was interrupted  by
                                  delivery of a signal before any
                                  data  was  available  for   the
                                  receive.

              [ENOTCONN]          Receive on a SOCK_STREAM socket
                                  that is not yet connected.

              [EOPNOTSUPP]        The MSG_OOB  or  MSG_PEEK  flag
                                  was set for any AF_UNIX socket.
                                  Neither MSG_PEEK nor MSG_OOB is
                                  supported  for AF_UNIX sockets.

SSEEEE AALLSSOO
       getsockopt(3), select(3), recv(3), recvfrom(3), socket(3).
































                             MiNT-Net                           2


