Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ getsockname(2) — AIX PS/2 1.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

bind

socket



GETSOCKNAME(2,L)            AIX Technical Reference            GETSOCKNAME(2,L)



-------------------------------------------------------------------------------
getsockname



PURPOSE

Gets the socket name.

LIBRARY

Internet Library (libc.a)

SYNTAX

#include <sys/types.h>
#include <sys/socket.h>

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

DESCRIPTION

The getsockname system call stores the current name for the socket specified by
the s parameter in the structure pointed to by the name parameter.  Initialize
the value pointed to by the namelen parameter to indicate the amount of space
pointed to by name.  On return, the namelen parameter points to the actual size
(in bytes) of the name returned (in bytes).

RETURN VALUE

Upon successful completion, a value of 0 is returned.  If the getsockname
system call fails, a value of -1 is returned, and errno is set to indicate the
error.

ERROR CONDITIONS

The system call fails if one or more of the following are true:

EBADF     The s parameter is not valid.

ENOTSOCK  The s parameter refers to a file, not a socket.

ENOBUFS   Insufficient resources were available in the system to complete the
          call.

EFAULT    The addr parameter is not in a writable part of the user address
          space.





Processed November 7, 1990     GETSOCKNAME(2,L)                               1





GETSOCKNAME(2,L)            AIX Technical Reference            GETSOCKNAME(2,L)



RELATED INFORMATION

In this book:  "bind" and "socket."




















































Processed November 7, 1990     GETSOCKNAME(2,L)                               2



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