#ifndef _SVSEM_UTIL_H
|
#define _SVSEM_UTIL_H
|
|
#include "usg_common.h"
|
|
int svsem_get(key_t key, unsigned int value) ;
|
/* Reserve semaphore (blocking), return 0 on success, or -1 with 'errno'
|
set to EINTR if operation was interrupted by a signal handler */
|
|
/* Reserve semaphore - decrement it by 1 */
|
int svsem_wait(int semid) ;
|
|
int svsem_trywait(int semid) ;
|
|
int svsem_timedwait(const int semid, const struct timespec *timeout) ;
|
|
/* Release semaphore - increment it by 1 */
|
int svsem_post(int semid) ;
|
|
|
|
int svsem_cond_wait(int semid ) ;
|
int svsem_cond_signal(int semid ) ;
|
|
/**
|
* If sem_op equals 0, the value of the semaphore is checked to see whether it
|
* currently equals 0. If it does, the operation completes immediately; otherwise,
|
* semop() blocks until the semaphore value becomes 0.
|
*/
|
int svsem_zero(int semid) ;
|
|
|
int svsem_zero_nowait(int semid) ;
|
|
int svsem_zero_timeout(const int semid, const struct timespec *timeout) ;
|
|
|
|
|
|
int svsem_set(int semid, int val) ;
|
|
|
|
|
void svsem_remove(int semid) ;
|
#endif
|