1 | |
2 | /* |
3 | * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. |
4 | * |
5 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ |
6 | * |
7 | * This file contains Original Code and/or Modifications of Original Code |
8 | * as defined in and that are subject to the Apple Public Source License |
9 | * Version 2.0 (the 'License'). You may not use this file except in |
10 | * compliance with the License. The rights granted to you under the License |
11 | * may not be used to create, or enable the creation or redistribution of, |
12 | * unlawful or unlicensed copies of an Apple operating system, or to |
13 | * circumvent, violate, or enable the circumvention or violation of, any |
14 | * terms of an Apple operating system software license agreement. |
15 | * |
16 | * Please obtain a copy of the License at |
17 | * http://www.opensource.apple.com/apsl/ and read it before using this file. |
18 | * |
19 | * The Original Code and all software distributed under the License are |
20 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER |
21 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
22 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, |
23 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. |
24 | * Please see the License for the specific language governing rights and |
25 | * limitations under the License. |
26 | * |
27 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ |
28 | */ |
29 | /* |
30 | * Copyright (c) 1990, 1996-1998 Apple Computer, Inc. |
31 | * All Rights Reserved. |
32 | */ |
33 | /* |
34 | * posix_shm.c : Support for POSIX semaphore APIs |
35 | * |
36 | * File: posix_sem.c |
37 | * Author: Ananthakrishna Ramesh |
38 | * |
39 | * HISTORY |
40 | * 2-Sep-1999 A.Ramesh |
41 | * Created for MacOSX |
42 | * |
43 | */ |
44 | |
45 | #ifndef _SYS_POSIX_SEM_H_ |
46 | #define _SYS_POSIX_SEM_H_ |
47 | |
48 | #include <sys/appleapiopts.h> |
49 | #include <sys/types.h> |
50 | #include <sys/proc.h> |
51 | |
52 | struct label; |
53 | |
54 | #define PSEMNAMLEN 31 /* maximum name segment length we bother with */ |
55 | |
56 | struct pseminfo { |
57 | unsigned int psem_flags; |
58 | unsigned int psem_usecount; |
59 | mode_t psem_mode; |
60 | uid_t psem_uid; |
61 | gid_t psem_gid; |
62 | char psem_name[PSEMNAMLEN + 1]; /* segment name */ |
63 | void * psem_semobject; |
64 | struct label * psem_label; |
65 | pid_t psem_creator_pid; |
66 | uint64_t psem_creator_uniqueid; |
67 | }; |
68 | |
69 | #define PSEMINFO_NULL (struct pseminfo *)0 |
70 | |
71 | #define PSEM_NONE 1 |
72 | #define PSEM_DEFINED 2 |
73 | #define PSEM_ALLOCATED 4 |
74 | #define PSEM_MAPPED 8 |
75 | #define PSEM_INUSE 0x10 |
76 | #define PSEM_REMOVED 0x20 |
77 | #define PSEM_INCREATE 0x40 |
78 | #define PSEM_INDELETE 0x80 |
79 | |
80 | #endif |
81 | |