HP UX 11i v1 I/O Cards manual Considerations, Dpp Return param

Models: UX 11i v1 I/O Cards

1 298
Download 298 pages 31.75 Kb
Page 137
Image 137

 

ZCOM C I/F Library Routines

 

GETDEVICE (3X)

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

See the NOTES section below for more information on using this routine in a multi-threaded application.

PARAMETERS

 

dfile

Pointer to the full path name of a binary zdgen device

 

file. That is, the output file from the zdgen program. If

 

a NULL is passed, it defaults to the file specified by

 

the symbol ZCOM_DEVICE_FILE), which is

 

currently defined as /opt/acc7cfg/zcomdevice in the

 

include file /opt/acc/include/zcom/zcomsys.h

dpp (Return param)

Pointer to a data structure containing the full device table. The device table is an array of zdev_type elements.

RETURN VALUE Routine getdevice, when successful, returns a non-negativevalue,

 

indicating the number of device types. That is, it returns the number of

 

zdev_type entries in the device table. Otherwise, it returns a negative

 

value, and the user should check errno to determine why getdevice failed.

NOTES

1. On every call to getdevice, malloc(3C) is called to allocate dynamic

 

memory for the returned device table. In case of error, this function

 

will release the allocated memory internally to avoid memory leak.

 

On successful return, the caller is responsible for freeing the allocated

 

memory when it is no longer needed.

Chapter 4

137

Page 137
Image 137
HP UX 11i v1 I/O Cards manual Considerations, Dpp Return param