Perform an operation on a synchronization object
#include <sys/neutrino.h>
int SyncCtl( int cmd,
sync_t * sync,
void * data );
int SyncCtl_r( int cmd,
sync_t * sync,
void * data );
libc
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:
- set or get a ceiling priority for a mutex
or
- attach an event to a mutex so you'll be notified when the mutex changes to the DEAD state.
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.
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.
- 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.
QNX 6
Safety: | |
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
Yes |
Thread |
Yes |
SyncCondvarSignal(),
SyncCondvarWait(),
SyncDestroy(),
SyncMutexLock(),
SyncMutexRevive(),
SyncMutexUnlock(),
SyncTypeCreate()