Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ getsockname(2) — HP-UX 5.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

bind(2)

socket(2)

getpeername(2)

inet(4F)

     GETSOCKNAME(2)           Series 300 Only           GETSOCKNAME(2)

     NAME
          getsockname - get socket address

     SYNOPSIS
          getsockname(s, addr, addrlen)
          int s;
          struct sockaddr *addr;
          int *addrlen;

     HP-UX COMPATIBILITY
          Level:    HP-UX/NON-STANDARD

          Origin:   UCB

          Remarks:  Implemented on the Series 300 only.

     DESCRIPTION
          S is a socket descriptor.  Getsockname returns  the  address
          of  the  socket  indicated  by  s.   Addr points to a socket
          address structure in which this address  is  returned.   The
          addrlen   parameter   points  to  an  int  which  should  be
          initialized to indicate the size of the  address  structure.
          On  return  it  contains  the  actual  size  of  the address
          returned (in bytes).  If addr does not point to enough space
          to  contain  the whole address of the socket, only the first
          addrlen bytes of the address will be returned.

          The getsockname call fails if:

          [EBADF]        The argument s is not a valid descriptor.

          [ENOTSOCK]     The argument s is a file, not a socket.

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

          [EFAULT]       The addr or addrlen parameters are not  valid
                         pointers.

          [EINVAL]       The socket has been shut down.

          [ENET]         A hardware error is detected on the interface
                         card.

     RETURN VALUE
          A 0 is returned if the call succeeds, -1 if it fails.

     SEE ALSO
          bind(2), socket(2), getpeername(2), inet(4F).

     Hewlett-Packard               - 1 -             (printed 7/16/86)

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