ZCOM C I/F Library Routines

GETDEVICE (3X)

GETDEVICE (3X)

NAME

getdevice – Read ZCOM device definitions

SYNOPSIS

#include

<zcom/zcomsys.h>

 

#include

<zcom/zcomcall.h> /* if compiled with ANSI C

 

(recommended) */

 

 

int getdevice (dfile, dpp)

 

char

 

*dfile;

 

zdev_type

 

**dpp;

DESCRIPTION

Routine getdevice reads the ZCOM device file specified by the dfile

 

parameter and loads the device definition entries into a memory table.

 

The pointer to the device definition table is returned (see zdev type

 

definition below).

 

 

If dfile is NULL, it uses the default /opt/acc/cfg/zcomdevice. The

 

ZCOM device file is a binary file created by the ZDGEN program, from a

 

user-customizable ASCII file (usually /opt/acc/cfg/zcomdevice.txt).

 

Refer to the section on zdgen in the Multiprotocol ACC Utilities Reference

 

Guide for more details.

 

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

This routine may be called from a multi-threaded application using the

Considerations

POSIX (1003.1c) kernel threads API package. This routine has the

 

following characteristics when called by a multi-threaded application:

 

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).

142

Chapter 4