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