[Previous] [Contents] [Next]

SyncCtl(), SyncCtl_r()

Perform an operation on a synchronization object

Synopsis:

#include <sys/neutrino.h>

int SyncCtl( int cmd,
             sync_t * sync,
             void * data );

int SyncCtl_r( int cmd,
               sync_t * sync,
               void * data );

Library:

libc

Description:

The SyncCtl() and SyncCtl_r() functions are identical except in the way they indicate errors. See the Returns section for details.

These kernel calls enable you to:

The cmd argument specifies the operation type. Valid types are:

_NTO_SCTL_GETPRIOCEILING
Get the ceiling priority of the mutex pointed to by sync and put it in the variable pointed to by data.
_NTO_SCTL_SETPRIOCEILING
Return the original ceiling priority. Set the ceiling priority of the mutex pointed to by sync to the value pointed to by data.
_NTO_SCTL_SETEVENT
Attach an event, pointed to by data, to the mutex pointed to by sync.
Note: We recommend that you use the SyncMutexEvent() call.

Returns:

The only difference between these functions is the way they indicate errors:

SyncCtl()
If an error occurs, -1 is returned and errno is set. Any other value returned indicates success.
SyncCtl_r()
EOK is returned on success. This function does NOT set errno. If an error occurs, any value in the Errors section may be returned.

Errors:

EAGAIN
All kernel synchronization event objects are in use.
EFAULT
A fault occurred when the kernel tried to access sync or data.
EINVAL
The synchronization object pointed to by sync doesn't exist, or the ceiling priority value pointed to by data is out of range.
ENOSYS
The SyncCtl() and SyncCtl_r() functions aren't currently supported.

Classification:

QNX 6

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

SyncCondvarSignal(), SyncCondvarWait(), SyncDestroy(), SyncMutexLock(), SyncMutexRevive(), SyncMutexUnlock(), SyncTypeCreate()


[Previous] [Contents] [Next]