use restrict everywhere it's required by c99 and/or posix 2008
[musl] / include / semaphore.h
1 #ifndef _SEMAPHORE_H
2 #define _SEMAPHORE_H
3 #ifdef __cplusplus
4 extern "C" {
5 #endif
6
7 #if __STDC_VERSION__ >= 199901L
8 #define __restrict restrict
9 #elif !defined(__GNUC__)
10 #define __restrict
11 #endif
12
13 #define __NEED_time_t
14 #define __NEED_struct_timespec
15 #include <bits/alltypes.h>
16
17 #include <fcntl.h>
18
19 #define SEM_FAILED ((sem_t *)0)
20
21 typedef struct {
22         int __val[4*sizeof(long)/sizeof(int)];
23 } sem_t;
24
25 int    sem_close(sem_t *);
26 int    sem_destroy(sem_t *);
27 int    sem_getvalue(sem_t *__restrict, int *__restrict);
28 int    sem_init(sem_t *, int, unsigned);
29 sem_t *sem_open(const char *, int, ...);
30 int    sem_post(sem_t *);
31 int    sem_timedwait(sem_t *__restrict, const struct timespec *__restrict);
32 int    sem_trywait(sem_t *);
33 int    sem_unlink(const char *);
34 int    sem_wait(sem_t *);
35
36 #ifdef __cplusplus
37 }
38 #endif
39 #endif