NAME
atm_bind - bind an ASAP to an ATM end-point
SYNOPSIS
#include <fore_atm/fore_atm_user.h>
int atm_bind(fd, asap, asap_assigned, qlen)
int fd;
Atm_sap asap;
Atm_sap *asap_assigned;
int qlen;
DESCRIPTION
atm_bind() associates an Application Service Access Point
(ASAP) with an open file descriptor specified by fd.
The asap argument specifies which ASAP to bind to the file
descriptor. A value of zero can be specified in which case
the ATM device driver will allocate an ASAP and bind it to
the file descriptor. ASAP values in the range 0 to
SAPS_RESERVED are reserved by the ATM device driver for ker-
nel use.
The asap_assigned argument is returned to the caller and
specifies the ASAP that was bound to the file descriptor.
The qlen argument specifies whether the caller will be a
server or a client. A value of zero indicates a client. A
non-zero value indicates server; in this case the file
descriptor is activated for incoming connection requests
with the maximum number of outstanding connection requests
limited by the value of qlen.
See atm_client(4N) and atm_server(4N) for usage of
atm_bind().
RETURN VALUES
atm_bind() returns 0 on success. On failure, it returns -1
and sets atm_errno to indicate the error. atm_error(4N) can
be used to print a text description of errors returned by
atm_bind().
ERRORS
DL_OUTSTATE File descriptor in a state other than
DL_UNBOUND.
DL_BOUND The specified asap is already in use.
DL_BADSAP The specified asap is a reserved ASAP.
ENOBUFS Memory allocation failed.
atm_bind() can also fail with errors returned from the
getmsg(2) and putmsg(2) system calls on the SunOS and IRIX
platforms.
On ULTRIX platforms, atm_bind() on a closed connection may
cause a SIGPIPE signal to be sent to the calling process.
Unless caught or ignored, this terminates the process.
SEE ALSO
atm_intro(4N)