9 #define SEMMNS (SEMMSL*SEMMNI)
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. */
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. */
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
, ...));
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
));
79 #endif /* __USE_MISC */
81 #endif /* _SYS_SEM_H */