Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ getpeername(2) — DG/UX 4.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought



                                                           getpeername(2)



        _________________________________________________________________
        getpeername                                           System Call
        Get name of connected peer.
        _________________________________________________________________


        SYNTAX

        #include <socket.h>

        int   getpeername  (s, name, namelen)
        int             s;
        struct sockaddr * name;
        int *           namelen;


        PARAMETERS

        s              File descriptor of socket whose name is requested.


        name           Structure to receive the name of connected peer.


        namelen        On input contains the number of bytes available
                       for the peer name; updated to indicate the number
                       of bytes returned.


        DESCRIPTION

        Getpeername returns the name of the peer connected to socket <s>.
        The <namelen> parameter should be initialized to indicate the
        amount of space pointed to by <name>.  On return it contains the
        actual size of the name returned (in bytes).


        ACCESS CONTROL

        None.  (See domain information (inet(3N), unix_ipc(6)) for
        domain-specific restrictions.)


        RETURN VALUE

        0              Completed successfully.


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




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





                                                           getpeername(2)



        EXCEPTIONS

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


        EBADF          The argument <s> is not a valid descriptor.


        ENOTSOCK       The argument <s> is not a file of type S_IFSOCK
                       (socket special).


        ENOTCONN       The socket is not connected.


        ENOBUFS        Insufficient resources were available in the
                       system to perform the operation.


        EFAULT         The <name> parameter points to memory not in a
                       valid part of the process address space, or the
                       <namelen> parameter is < 0.


        SEE ALSO

        The related manual sections:  bind(2), socket(2), getsockname(2),
        connect(2),
        unix_ipc(6),
        inet(3N).
























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



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