1 #pragma once 2 3 #ifdef __cplusplus 4 extern "C" { 5 #endif 6 7 #include <features.h> 8 9 #define __NEED_sem_t 10 #define __NEED_time_t 11 #define __NEED_struct_timespec 12 #include <bits/alltypes.h> 13 14 #include <fcntl.h> 15 16 #define SEM_FAILED ((sem_t*)0) 17 18 int sem_close(sem_t*); 19 int sem_destroy(sem_t*); 20 int sem_getvalue(sem_t* __restrict, int* __restrict); 21 int sem_init(sem_t*, int, unsigned); 22 sem_t* sem_open(const char*, int, ...); 23 int sem_post(sem_t*); 24 int sem_timedwait(sem_t* __restrict, const struct timespec* __restrict); 25 int sem_trywait(sem_t*); 26 int sem_unlink(const char*); 27 int sem_wait(sem_t*); 28 29 #ifdef __cplusplus 30 } 31 #endif 32