Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ getpeername(2) — AIX PS/2 1.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

bind

getsockname

socket



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



-------------------------------------------------------------------------------
getpeername



PURPOSE

Gets the name of the connected peer.

SYNTAX

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

DESCRIPTION

The getpeername system call returns the name of the peer, or connected socket,
that is connected to the socket specified by the s parameter.  You should
initialize the namelen to indicate the amount of space pointed to by name.  On
return, it contains the actual size of the name returned (in bytes).

RETURN VALUE

Upon successful completion, a value of 0 is returned.  If the getpeername
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.

ENOTCONN  The socket is not connected.

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.

RELATED INFORMATION

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







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



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