2 * Copyright 2008-2015 Haiku, Inc.
3 * Distributed under the terms of the MIT License.
11 #include <sys/cdefs.h>
15 typedef struct _sem_t
{
24 #define SEM_FAILED ((sem_t*)(long)-1)
28 sem_t
* sem_open(const char* name
, int openFlags
,...);
29 int sem_close(sem_t
* semaphore
);
30 int sem_unlink(const char* name
);
32 int sem_init(sem_t
* semaphore
, int shared
, unsigned value
);
33 int sem_destroy(sem_t
* semaphore
);
35 int sem_post(sem_t
* semaphore
);
36 int sem_timedwait(sem_t
* semaphore
, const struct timespec
* timeout
);
37 int sem_trywait(sem_t
* semaphore
);
38 int sem_wait(sem_t
* semaphore
);
39 int sem_getvalue(sem_t
* semaphore
, int* value
);
44 #endif /* _SEMAPHORE_H_ */