19 #ifndef _XENO_POSIX_SEMAPHORE_H
20 #define _XENO_POSIX_SEMAPHORE_H
22 #if defined(__KERNEL__) || defined(__XENO_SIM__)
24 #include <nucleus/xenomai.h>
27 #include <linux/kernel.h>
28 #include <linux/fcntl.h>
32 #include <posix_overrides.h>
35 #define SEM_VALUE_MAX (INT_MAX)
36 #define SEM_FAILED NULL
48 struct _sem_fastlock __sem_lock;
56 #pragma GCC system_header
59 #include_next <semaphore.h>
69 struct pse51_sem *sem;
73 #if defined(__KERNEL__) || defined(__XENO_SIM__)
80 #define sem_init pse51_sem_init
82 int pse51_sem_init(sem_t *sem,
95 const struct timespec *abs_timeout);
100 sem_t *
sem_open(
const char *name,
int oflag, ...);
116 int __real_sem_init(sem_t *sem,
120 int __real_sem_destroy(sem_t *sem);
122 int __real_sem_post(sem_t *sem);
124 int __real_sem_wait(sem_t *sem);
126 int __real_sem_timedwait(sem_t *sem,
const struct timespec *abs_timeout);
128 int __real_sem_trywait(sem_t *sem);
130 int __real_sem_getvalue(sem_t *sem,
int *value);
132 sem_t *__real_sem_open(
const char *name,
int oflags, ...);
134 int __real_sem_close(sem_t *sem);
136 int __real_sem_unlink(
const char *name);
int sem_timedwait(sem_t *sem, const struct timespec *abs_timeout)
Attempt, during a bounded time, to lock a semaphore.
Definition: sem.c:677
int sem_close(sem_t *sem)
Close a named semaphore.
Definition: sem.c:389
int sem_wait(sem_t *sem)
Lock a semaphore.
Definition: sem.c:627
int sem_post(sem_t *sem)
Unlock a semaphore.
Definition: sem.c:723
int sem_trywait(sem_t *sem)
Attempt to lock a semaphore.
Definition: sem.c:537
int sem_unlink(const char *name)
Unlink a named semaphore.
Definition: sem.c:459
sem_t * sem_open(const char *name, int oflag,...)
Open a named semaphore.
Definition: sem.c:289
int sem_destroy(sem_t *sem)
Destroy an unnamed semaphore.
Definition: sem.c:214
int sem_getvalue(sem_t *sem, int *value)
Get the value of a semaphore.
Definition: sem.c:791