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