NAME
zcomlname - Set up originator name for log messages
SYNOPSIS
#include <zcom/zcomsys.h>
#include <zcom/zcomcall.h> /* if compiled with ANSI C (recommended) */
void zcomlname (name)
char *name;
DESCRIPTION
Routine zcomlname sets
up the originator (program) name to be used by the ZCOM message
log system. Subsequent calls to zcomlog will
log messages with this specified program name. Refer to zcomlog(3x) for more information
on log messages.
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
safe | The calling thread's cancelability
type may be deferred or asynchronous when calling this routine. |
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 below for more information on using
this routine in a multi-threaded application.
PARAMETERS
name | Name for the log message (string, 6 bytes) |
RETURN VALUE
Routine zcomlname has
no return value.
NOTES
In a multi-threaded application, zcomlname is
to be called only once by any one of the threads. It sets up the
logging program name for the subsequent calls to zcomlog for all threads. If it is
called again, the new program name is effective for the subsequent
log messages.
EXAMPLE
#include <zcom/zcomsys.h>
#include <zcom/zcomcall.h>
char name[6];
zcomlname (name);
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). |
SEE ALSO
zcomlog(3x).