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