17#ifndef ZEPHYR_INCLUDE_POSIX_SEMAPHORE_H_
18#define ZEPHYR_INCLUDE_POSIX_SEMAPHORE_H_
22#include <zephyr/kernel.h>
23#include <zephyr/toolchain.h>
30#define SEM_FAILED ((sem_t *) 0)
32#if !(defined(_SEM_T_DECLARED) || defined(__sem_t_defined)) || defined(__DOXYGEN__)
35#define _SEM_T_DECLARED
36#define __sem_t_defined
sem_t * sem_open(const char *name, int oflags,...)
Open or create a named semaphore.
int sem_trywait(sem_t *semaphore)
Try to lock a semaphore without blocking.
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_wait(sem_t *semaphore)
Lock a semaphore, blocking until it becomes available.
int sem_destroy(sem_t *semaphore)
Destroy an unnamed semaphore.
int sem_close(sem_t *sem)
Close a named semaphore.
int sem_unlink(const char *name)
Remove a named semaphore.
int sem_timedwait(sem_t *ZRESTRICT semaphore, struct timespec *ZRESTRICT abstime)
Lock a semaphore with an absolute timeout.
int sem_getvalue(sem_t *ZRESTRICT semaphore, int *ZRESTRICT value)
Get the current value of a semaphore.
struct k_sem sem_t
Semaphore object type.
Time value with nanosecond resolution.
POSIX time-of-day types and functions (<sys/time.h>)