make includes fix from trunk
[minix.git] / include / sys / sem.h
bloba2d09afbdf968ae5e225ea4b607bac22b482c3aa
1 #ifndef _SYS_SEM_H
2 #define _SYS_SEM_H
4 #include <sys/types.h>
5 #include <sys/ipc.h>
7 #define SEMMNI 128
8 #define SEMMSL 250
9 #define SEMMNS (SEMMSL*SEMMNI)
11 #define SEMOPM 32
12 #define SEMVMX 32767
14 /* Flags for `semop'. */
15 #define SEM_UNDO 0x1000 /* undo the operation on exit */
17 /* Commands for `semctl'. */
18 #define GETPID 11 /* get sempid */
19 #define GETVAL 12 /* get semval */
20 #define GETALL 13 /* get all semval's */
21 #define GETNCNT 14 /* get semncnt */
22 #define GETZCNT 15 /* get semzcnt */
23 #define SETVAL 16 /* set semval */
24 #define SETALL 17 /* set all semval's */
27 /* Data structure describing a set of semaphores. */
28 struct semid_ds
30 struct ipc_perm sem_perm; /* operation permission struct */
31 time_t sem_otime; /* last semop() time */
32 unsigned long int __unused1;
33 time_t sem_ctime; /* last time changed by semctl() */
34 unsigned long int __unused2;
35 unsigned long int sem_nsems; /* number of semaphores in set */
36 unsigned long int __unused3;
37 unsigned long int __unused4;
40 /* Structure used for argument to `semop' to describe operations. */
41 struct sembuf
43 unsigned short int sem_num; /* semaphore number */
44 short int sem_op; /* semaphore operation */
45 short int sem_flg; /* operation flag */
49 /* Semaphore control operation. */
50 _PROTOTYPE( int semctl, (int __semid, int __semnum, int __cmd, ...));
52 /* Get semaphore. */
53 _PROTOTYPE( int semget, (key_t __key, int __nsems, int __semflg));
55 /* Operate on semaphore. */
56 _PROTOTYPE( int semop, (int __semid, struct sembuf *__sops, size_t __nsops));
59 #ifdef __USE_MISC
61 /* ipcs ctl cmds */
62 # define SEM_STAT 18
63 # define SEM_INFO 19
65 struct seminfo
67 int semmap;
68 int semmni;
69 int semmns;
70 int semmnu;
71 int semmsl;
72 int semopm;
73 int semume;
74 int semusz;
75 int semvmx;
76 int semaem;
79 #endif /* __USE_MISC */
81 #endif /* _SYS_SEM_H */