[Previous] [Contents] [Index] [Next]

PhChannelAttach()

Create or use a channel (Neutrino only)

Synopsis:

int PhChannelAttach( int channel, 
                     int connection,
                     struct sigevent_t const *event );

Description:

Use this function if you want the library to create a channel or use a channel that you've created.


Neutrino: This function is for Neutrino only.

The event argument describes how Photon is to notify your application. If your application is using the widget library, pass NULL for event. For more information, see sigevent_t and ionotify() in the Neutrino Library Reference.

To create a channel and a connection:

PhChannelAttach( 0, -1, NULL )

To attach a channel chid and create a connection:

PhChannelAttach( chid, -1, NULL )

To attach channel chid and connection coid:

PhChannelAttach( chid, coid, NULL )

Returns:

A channel ID, or -1 on error (errno is set).

Errors:

EBUSY
A channel is already attached and chid is nonzero and differs from the current channel ID, or connection isn't -1 and differs from the currently used connection
EINVAL
channel is 0, but connection isn't -1
other values
ChannelCreate() or ConnectAttach() failed

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

[Previous] [Contents] [Index] [Next]