posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
semaphore.h File Reference

POSIX semaphores API (<semaphore.h>) More...

#include <time.h>
#include <zephyr/kernel.h>
#include <zephyr/toolchain.h>
Include dependency graph for semaphore.h:

Go to the source code of this file.

Macros

#define SEM_FAILED   ((sem_t *) 0)
 Returned by sem_open() on failure.
 
#define _SEM_T_DECLARED
 
#define __sem_t_defined
 

Typedefs

typedef struct k_sem sem_t
 Semaphore object type.
 

Functions

int sem_destroy (sem_t *semaphore)
 Destroy an unnamed semaphore.
 
int sem_getvalue (sem_t *ZRESTRICT semaphore, int *ZRESTRICT value)
 Get the current value of a semaphore.
 
int sem_init (sem_t *semaphore, int pshared, unsigned int value)
 Initialise an unnamed semaphore.
 
int sem_post (sem_t *semaphore)
 Unlock a semaphore (increment its count).
 
int sem_timedwait (sem_t *ZRESTRICT semaphore, struct timespec *ZRESTRICT abstime)
 Lock a semaphore with an absolute timeout.
 
int sem_trywait (sem_t *semaphore)
 Try to lock a semaphore without blocking.
 
int sem_wait (sem_t *semaphore)
 Lock a semaphore, blocking until it becomes available.
 
sem_tsem_open (const char *name, int oflags,...)
 Open or create a named semaphore.
 
int sem_unlink (const char *name)
 Remove a named semaphore.
 
int sem_close (sem_t *sem)
 Close a named semaphore.
 

Detailed Description

POSIX semaphores API (<semaphore.h>)

See also
POSIX.1-2017 <semaphore.h>

Definition in file semaphore.h.

Macro Definition Documentation

◆ __sem_t_defined

#define __sem_t_defined

Definition at line 36 of file semaphore.h.

◆ _SEM_T_DECLARED

#define _SEM_T_DECLARED

Definition at line 35 of file semaphore.h.