Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
bind(2) OSS System Calls Reference Manual
NAME
bind - Binds a name to a socket
LIBRARY
G-series native OSS processes: system library
H-series and J-series OSS processes: implicit libraries
SYNOPSIS
#define _XOPEN_SOURCE_EXTENDED 1
#include <sys/socket.h>
int bind(
int socket,
const struct sockaddr *address,
socklen_t address_len);
PARAMETERS
socket Specifies the file descriptor of the socket to be bound.
address Points to a sockaddr structure that contains the address to be bound to the
socket. The length and format of the address depend on the address family of the
socket.
For AF_INET sockets, a pointer to the address structure sockaddr_in must be
cast as a struct sockaddr.ForAF_INET6 sockets, a pointer to the address
structure sockaddr_in6 must be cast as a struct sockaddr.ForAF_UNIX sock-
ets, a pointer to the address structure sockaddr_un must be cast as a struct
sockaddr.
address_len Specifies the length of the sockaddr structure pointed to by the address parame-
ter.
DESCRIPTION
The bind( ) function assigns a name, which consists of an address stored in a sockaddr structure,
to an unnamed socket. Sockets created with the socket() function are initially unnamed; they are
identified only by their address family.
An application program can retrieve the assigned socket name with the getsockname() function.
Access Control Lists (ACLs)
If the parent directory has an ACL that contains default ACL entries, bind() creates an ACL for
the socket that inherits the default ACL entries of the parent directory as actual ACL entries for
the socket. For more information about ACL inheritance, see the acl(5) reference page.
Accessing Files in Restricted-Access Filesets
When accessing a file in a restricted-access fileset, the super ID (255,255 in the Guardian
environment, 65535 in the OSS environment) is restricted by the same file permissions and
owner privileges as any other user ID: It has no special privileges unless the executable file
started by the super ID has the PRIVSETID file privilege. In this case, the process started by the
super ID can switch to another ID and then access files in restricted-access filesets as that ID.
In a restricted-access fileset, applications that have the PRIVSOARFOPEN privilege and are
started by a member of the Safeguard SECURITY-OSS-ADMINISTRATOR (SOA) group have
the appropriate privilege to use this function on any file in the fileset. However, Network File
System (NFS) clients are not granted SOA group privileges, even if these clients are accessing
the system with a user ID that is a member of the SOA security group.
For more information about restricted-access filesets and file privileges, see the Open System Ser-
vices Management and Operations Guide.
1−14 Hewlett-Packard Company 527186-023