Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ recvfrom(2) — DG/UX 4.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought



                                                              recvfrom(2)



        _________________________________________________________________
        recvfrom                                              System Call
        Receive a message from a socket.
        _________________________________________________________________


        SYNTAX

        #include <socket.h>

        int   recvfrom  (s, buf, len, user_flags, from, fromlen)
        int             s;
        char *          buf;
        int             len;
        int             user_flags;
        struct sockaddr *from;
        int *           fromlen;


        PARAMETERS

        s              File descriptor of socket to receive a message
                       from.


        buf            Buffer for message.


        len            Length of buffer.


        user_flags     Flags for transfer.


        from           Structure to hold sender's name.


        fromlen        On input contains the number of bytes available
                       for the sender's name; updated to indicate the
                       number of bytes returned.


        DESCRIPTION

        This call is identical to the recv call with the addition of
        returning the name of the socket from which the message was sent.
        When using recvfrom on connected sockets the <from> and <fromlen>
        arguments will be undefined.  When reading from datagram sockets,
        messages that are longer than the buffer are truncated. See
        recv(2) for additional information about the socket receive
        mechanism.



        DG/UX 4.00                                                 Page 1
               Licensed material--property of copyright holder(s)





                                                              recvfrom(2)



        ACCESS CONTROL

        None.


        RETURN VALUE

        These calls return the number of bytes received.


        1..<len>       Number of bytes transferred.


        -1             An error occurred.  Errno is set to indicate the
                       error.


        EXCEPTIONS

        Errno may be set to one of the following error codes:


        EBADF          The argument <s> is not an active valid
                       descriptor.


        ENOTSOCK       The argument <s> is not a socket.


        EAGAIN         The socket is marked non-blocking and the receive
                       operation would block.


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


        EFAULT         The data was specified to be received into a non-
                       existent or protected part of the process address
                       space.


        EINVAL         Bad argument.


        SEE ALSO

        The related manual sections:  read(2), recv(2), send(2),
        socket(2).




        DG/UX 4.00                                                 Page 2
               Licensed material--property of copyright holder(s)



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026