Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ getsockname(2dn) — Ultrix DECnet 3.0 VAX

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

bind(2dn)

getsockname(2dn)

NAME

getsockname − return the current name for a socket

SYNTAX

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

ARGUMENTS

Input Arguments

s Specifies a descriptor for a socket that has been returned by the socket or the accept call.

name Specifies the address of a structure of the type sockaddr_dn. This address is the name that was bound to the socket.

namelen Specifies the length of the address of the structure sockaddr_dn.

Return Arguments

name Specifies the address of a structure of the type sockaddr_dn. The following data fields are filled in by this call:

sdn_family Specifies the communications domain as AF_DECnet.

sdn_objnum Specifies the DECnet object number for the socket.  If the object number is 0, the DECnet object name, sdn_objname, is used. 

sdn_objnamel Size of the object name.  This argument is used only when the object number, sdn_objnum, is 0. 

sdn_objname Specifies the DECnet object name, which can be up to a 16-element array of characters.  This argument is used only when the object number, sdn_objnum, is 0. 

sdn_nodeaddrl Size of the local node address. 

sdn_nodeaddr Specifies the local node address. 

namelen Returns the length of the address of the structure sockaddr_dn.

DESCRIPTION

The getsockname call returns the current name of a specified socket.

RETURN VALUE

If the call succeeds, a value of 0 is returned.  If an error occurs, a value of −1 is returned.  When an error condition exists, the external variable errno contains error detail.

DIAGNOSTICS

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

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

[EFAULT] The name argument points to memory located in an invalid part of the process address space. 

SEE ALSO

bind(2dn)

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