The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
semaphore.h File Reference

unnamed POSIX semaphores, for the threads of one process. More...

#include <time.h>

Go to the source code of this file.

Data Structures

struct  sem_t

Macros

#define SEM_VALUE_MAX   0x7FFFFFFF

Functions

int sem_init (sem_t *sem, int pshared, unsigned value)
int sem_destroy (sem_t *sem)
int sem_wait (sem_t *sem)
int sem_trywait (sem_t *sem)
int sem_timedwait (sem_t *sem, const struct timespec *abstime)
int sem_post (sem_t *sem)
int sem_getvalue (sem_t *sem, int *value)

Detailed Description

unnamed POSIX semaphores, for the threads of one process.

sem_init with pshared set fails with ENOSYS.

Macro Definition Documentation

◆ SEM_VALUE_MAX

#define SEM_VALUE_MAX   0x7FFFFFFF

Function Documentation

◆ sem_init()

int sem_init ( sem_t * sem,
int pshared,
unsigned value )

◆ sem_destroy()

int sem_destroy ( sem_t * sem)

◆ sem_wait()

int sem_wait ( sem_t * sem)

◆ sem_trywait()

int sem_trywait ( sem_t * sem)

◆ sem_timedwait()

int sem_timedwait ( sem_t * sem,
const struct timespec * abstime )

◆ sem_post()

int sem_post ( sem_t * sem)

◆ sem_getvalue()

int sem_getvalue ( sem_t * sem,
int * value )