]> git.saurik.com Git - apple/xnu.git/blob - bsd/sys/ipcs.h
d0e0b543ce4be6293fc791001cae5f19ebe72d5a
[apple/xnu.git] / bsd / sys / ipcs.h
1 /*
2 * Copyright (c) 2004-2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
14 * agreement.
15 *
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
18 * file.
19 *
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
27 *
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
29 */
30 /*
31 * NOTE: Internal ipcs.h header; all interfaces are private; if you want this
32 * same information from your own program, popen(3) the ipcs(2) command and
33 * parse its output, or your program may not work on future OS releases.
34 */
35
36 #ifndef _SYS_IPCS_H_
37 #define _SYS_IPCS_H_
38
39 #include <sys/appleapiopts.h>
40 #include <sys/cdefs.h>
41
42 #define IPCS_MAGIC 0x00000001 /* Version */
43
44 /*
45 * IPCS_command
46 *
47 * This is the IPCS command structure used for obtaining status about the
48 * System V IPC mechanisms. All other operations are based on the per
49 * subsystem (shm, msg, ipc) *ctl entry point, which can be called once
50 * this information is known.
51 */
52
53 struct IPCS_command {
54 int ipcs_magic; /* Magic number for struct layout */
55 int ipcs_op; /* Operation to perform */
56 int ipcs_cursor; /* Cursor for iteration functions */
57 int ipcs_datalen; /* Length of ipcs_data area */
58 void *ipcs_data; /* OP specific data */
59 };
60
61 #ifdef KERNEL_PRIVATE
62 #include <machine/types.h>
63
64 #if __DARWIN_ALIGN_NATURAL
65 #pragma options align=natural
66 #endif
67
68 struct user_IPCS_command {
69 int ipcs_magic; /* Magic number for struct layout */
70 int ipcs_op; /* Operation to perform */
71 int ipcs_cursor; /* Cursor for iteration functions */
72 int ipcs_datalen; /* Length of ipcs_data area */
73 user_addr_t ipcs_data; /* OP specific data */
74 };
75
76 #if __DARWIN_ALIGN_NATURAL
77 #pragma options align=reset
78 #endif
79
80 #endif /* KERNEL_PRIVATE */
81
82 /*
83 * OP code values for 'ipcs_op'
84 */
85 #define IPCS_SHM_CONF 0x00000001 /* Obtain shared memory config */
86 #define IPCS_SHM_ITER 0x00000002 /* Iterate shared memory info */
87
88 #define IPCS_SEM_CONF 0x00000010 /* Obtain semaphore config */
89 #define IPCS_SEM_ITER 0x00000020 /* Iterate semaphore info */
90
91 #define IPCS_MSG_CONF 0x00000100 /* Obtain message queue config */
92 #define IPCS_MSG_ITER 0x00000200 /* Iterate message queue info */
93
94 /*
95 * Sysctl oid name values
96 */
97 #define IPCS_SHM_SYSCTL "kern.sysv.ipcs.shm"
98 #define IPCS_SEM_SYSCTL "kern.sysv.ipcs.sem"
99 #define IPCS_MSG_SYSCTL "kern.sysv.ipcs.msg"
100
101
102 #endif /* _SYS_IPCS_H_ */