1 /* $Id: sem.h,v 1.5 2002/10/29 04:45:21 rex Exp $
6 * semaphore facility. Conforming to the Single UNIX(r) Specification
7 * Version 2, System Interface & Headers Issue 5
9 * This file is part of the ReactOS Operating System.
12 * Created by KJK::Hyperion <noog@libero.it>
14 * THIS SOFTWARE IS NOT COPYRIGHTED
16 * This source code is offered for use in the public domain. You may
17 * use, modify or distribute it freely.
19 * This code is distributed in the hope that it will be useful but
20 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
21 * DISCLAMED. This includes but is not limited to warranties of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
25 #ifndef __SYS_SEM_H_INCLUDED__
26 #define __SYS_SEM_H_INCLUDED__
36 struct ipc_perm sem_perm
; /* operation permission structure */
37 unsigned short int sem_nsems
; /* number of semaphores in set */
38 time_t sem_otime
; /* last semop time */
39 time_t sem_ctime
; /* last time changed by semctl() */
44 unsigned short int sem_num
; /* semaphore number */
45 short int sem_op
; /* semaphore operation */
46 short int sem_flg
; /* operation flags */
50 /* Semaphore operation flags */
51 #define SEM_UNDO (0x00001000) /* Set up adjust on exit entry */
53 /* Command definitions for the function semctl() */
54 #define GETNCNT (1) /* Get semncnt */
55 #define GETPID (2) /* Get sempid */
56 #define GETVAL (3) /* Get semval */
57 #define GETALL (4) /* Get all cases of semval */
58 #define GETZCNT (5) /* Get semzcnt */
59 #define SETVAL (6) /* Set semval */
60 #define SETALL (7) /* Set all cases of semval */
63 int semctl(int, int, int, ...);
64 int semget(key_t
, int, int);
65 int semop(int, struct sembuf
*, size_t);
69 #endif /* __SYS_SEM_H_INCLUDED__ */