NAME
zcomstatus - Return a formatted ZCOM status or error
message
SYNOPSIS
#include <zcom/zcomsys.h>
#include <zcom/zcomcall.h> /* if compiled with ANSI C (recommended) */
char *zcomstatus (req, stat)
int32 req;
int32 stat;
DESCRIPTION
Routine zcomstatus returns
a ZCOM status message string corresponding to a specific status
code. The return character string has a length of 31 bytes maximum,
plus a terminating zero. See Multiprotocol ACC Programmers
Reference Guide under 'ZCOM Status Message Routine' in
Appendix B, ZCOM Status Codes.
The libraries libzcom_c.a and libpthread.a must be linked
into the calling program by giving the options "-lzcom_c
-lpthread" 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. This routine
has the following characteristics when called by a multi-threaded
application:
not a cancellation
point | Thread cancellation will not occur when
a thread is calling 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). |
PARAMETERS
req | Request code (from the zread header, zmhd ) |
stat | Status (ZCOM error code if < 0) |
NOTES
This routine reads a message file for the status message text.
It uses the file zstatmsg.msg in
/opt/acc/msg (ZCOM_MESSAGE_PATH). If not found, it uses the default
message file default.msg.
RETURN VALUE
Routine zcomstatus returns
a message string, corresponding to either the ZCOM status if stat is non-negative, or the ZCOM
error if stat is negative.
EXAMPLE
#include <zcom/zcomsys.h>
#include <zcom/zcomcall.h>
char *statmsg; /* Returned message string */
int32 req;
int32 stat;
statmsg = zcomstatus (req, stat);
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/zcomcall.h | ZCOM routine function prototypes (requires ANSI
C compilation). |
/opt/acc/msg/zstatmsg.msg | ZCOM status messages. |
/opt/acc/msg/default.msg | Master message text file. |