NAME
zx25info - Set up ACC X.25 information for subsequent "zx25..." calls
SYNOPSIS
#include <zcom/zcomsys.h>
#include <zcom/zcomx25.h>
int zx25info (zxip, auxname)
zx25info_type *zxip;
char *auxname;
DESCRIPTION
Routine zx25info sets
up the ACC X.25 access data structure which is used in subsequent "zx25..." calls. This routine
may allocate some internal resources. The caller is required to
call zx25close(3X) to clean
up the allocated resources when the "zx25..." calls
are no longer required.
The libraries libzx25.a, libzcom_c.a and libpthread.a must
be linked into the calling program by giving the "-lzx25
-lzcom_c -lpthread" options to cc(1) or ld(1).
Threads Considerations
This routine may be called from a multi-threaded application
using the POSIX (1003.1c) kernel threads API package. It has the
following characteristics when called by multi-threaded applications:
- cancellation point
Thread cancellation can occur when a thread calls
this routine.
- async-cancel unsafe
The calling thread's cancelability type
must be PTHREAD_CANCEL_DEFERRED if cancellation is enabled.
- async-signal unsafe
It cannot be called from a signal handler.
- fork unsafe
It cannot be called by a child process after fork(2) but before exec(2).
See the NOTES section that follows for more information on
using this routine in a multi-threaded application.
PARAMETERS:
- zxip (Return
Param)
Address of the user supplied ZCOM X.25 access data
structure. On successful return, access information will be setup
in this buffer. This data structure is then used in subsequent zx25...(3X) calls.
- auxname
User supplied name to use for opening the response
ZLU. The name must be unique within the local node. It may be a
maximum of 7 characters long, plus a terminating NULL.
RETURN VALUE
Routine zx25info returns
a 0 when successful. If there
was a ZCOM error, it returns a negative value.
See /opt/acc/include/zcom/zcomsys.h for the
list of ZCOM error codes and their meanings.
NOTES
The auxname parameter
is the ZLU name used to open the response ZLU. If multiple copies
of a program will be run, this name should be made unique for each
copy (for example, using the process ID to generate this name, or
using the makezluname routine).
In a multi-threaded application, the threads cannot
share a global ZCOM X.25 access data buffer zxip.
To call zx25info, each thread must
use a separate buffer and a different ZLU name. Normally, zx25info should be called AFTER a
thread is generated, using a per-thread buffer.
EXAMPLE
#include <zcom/zcomsys.h>
#include <zcom/zcomx25.h>
int ierr;
zx25info_type zxi;
char auxname[size]; /* size is user-defined */
if (ierr = zx25info (&zxi, auxname)) {
/* error return code */
}
else {
/* good return code */
}
FILES
- /opt/acc/include/zcom/zcomsys.h
ZCOM subsystem general include file, containing
data types, data structures, constants, error codes, masks, etc.
Note that this must be the first include file before any other ZCOM
include files.
- /opt/acc/include/zcom/zcomx25.h
ZCOM X.25 access data structure declarations.
SEE ALSO
zopen(3x), zx25callacc(3x), zx25callout(3x), zx25callrej(3x), zx25l2stat_rcvr(3x),
zx25reset(3x), zx25reset_conf(3x), zx25dbit_ack(3x), zx25int_conf(3x)