sl@0: /*- sl@0: *© Portions copyright (c) 2006 Nokia Corporation. All rights reserved. sl@0: * Copyright (c) 1988 University of Utah. sl@0: * Copyright (c) 1990, 1993 sl@0: * The Regents of the University of California. All rights reserved. sl@0: * (c) UNIX System Laboratories, Inc. sl@0: * All or some portions of this file are derived from material licensed sl@0: * to the University of California by American Telephone and Telegraph sl@0: * Co. or Unix System Laboratories, Inc. and are reproduced herein with sl@0: * the permission of UNIX System Laboratories, Inc. sl@0: * sl@0: * This code is derived from software contributed to Berkeley by sl@0: * the Systems Programming Group of the University of Utah Computer sl@0: * Science Department. sl@0: * sl@0: * Redistribution and use in source and binary forms, with or without sl@0: * modification, are permitted provided that the following conditions sl@0: * are met: sl@0: * 1. Redistributions of source code must retain the above copyright sl@0: * notice, this list of conditions and the following disclaimer. sl@0: * 2. Redistributions in binary form must reproduce the above copyright sl@0: * notice, this list of conditions and the following disclaimer in the sl@0: * documentation and/or other materials provided with the distribution. sl@0: * 4. Neither the name of the University nor the names of its contributors sl@0: * may be used to endorse or promote products derived from this software sl@0: * without specific prior written permission. sl@0: * sl@0: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND sl@0: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE sl@0: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE sl@0: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE sl@0: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL sl@0: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS sl@0: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) sl@0: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT sl@0: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY sl@0: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF sl@0: * SUCH DAMAGE. sl@0: * sl@0: * @(#)ipc.h 8.4 (Berkeley) 2/19/95 sl@0: * $FreeBSD: src/sys/sys/ipc.h,v 1.25 2005/01/07 02:29:23 imp Exp $ sl@0: */ sl@0: sl@0: /* sl@0: * SVID compatible ipc.h file sl@0: */ sl@0: #ifndef _SYS_IPC_H_ sl@0: #define _SYS_IPC_H_ sl@0: sl@0: #include sl@0: #include sl@0: sl@0: #ifndef _GID_T_DECLARED sl@0: typedef __gid_t gid_t; sl@0: #define _GID_T_DECLARED sl@0: #endif sl@0: sl@0: #ifndef _KEY_T_DECLARED sl@0: typedef __key_t key_t; sl@0: #define _KEY_T_DECLARED sl@0: #endif sl@0: sl@0: #ifndef _MODE_T_DECLARED sl@0: typedef __mode_t mode_t; sl@0: #define _MODE_T_DECLARED sl@0: #endif sl@0: sl@0: #ifndef _UID_T_DECLARED sl@0: typedef __uid_t uid_t; sl@0: #define _UID_T_DECLARED sl@0: #endif sl@0: sl@0: /* sl@0: * XXX almost all members have wrong types. sl@0: */ sl@0: struct ipc_perm { sl@0: unsigned short cuid; /* creator user id */ sl@0: unsigned short cgid; /* creator group id */ sl@0: unsigned short uid; /* user id */ sl@0: unsigned short gid; /* group id */ sl@0: unsigned short mode; /* r/w permission */ sl@0: unsigned short seq; /* sequence # (to generate unique ipcid) */ sl@0: key_t key; /* user specified msg/sem/shm key */ sl@0: }; sl@0: sl@0: #if __BSD_VISIBLE sl@0: /* common mode bits */ sl@0: #define IPC_R 000400 /* read permission */ sl@0: #define IPC_W 000200 /* write/alter permission */ sl@0: #define IPC_M 010000 /* permission to change control info */ sl@0: #endif sl@0: sl@0: /* SVID required constants (same values as system 5) */ sl@0: #define IPC_CREAT 001000 /* create entry if key does not exist */ sl@0: #define IPC_EXCL 002000 /* fail if key exists */ sl@0: #define IPC_NOWAIT 004000 /* error if request must wait */ sl@0: sl@0: #define IPC_PRIVATE (key_t)0 /* private key */ sl@0: sl@0: #define IPC_RMID 0 /* remove identifier */ sl@0: #define IPC_SET 1 /* set options */ sl@0: #define IPC_STAT 2 /* get options */ sl@0: #if __BSD_VISIBLE sl@0: #define IPC_INFO 3 /* get info */ sl@0: #endif sl@0: sl@0: #ifdef _KERNEL sl@0: /* Macros to convert between ipc ids and array indices or sequence ids */ sl@0: #define IPCID_TO_IX(id) ((id) & 0xffff) sl@0: #define IPCID_TO_SEQ(id) (((id) >> 16) & 0xffff) sl@0: #define IXSEQ_TO_IPCID(ix,perm) (((perm.seq) << 16) | (ix & 0xffff)) sl@0: sl@0: struct thread; sl@0: struct proc; sl@0: struct vmspace; sl@0: sl@0: extern void (*shmfork_hook)(struct proc *, struct proc *); sl@0: extern void (*shmexit_hook)(struct vmspace *); sl@0: sl@0: #else /* ! _KERNEL */ sl@0: sl@0: __BEGIN_DECLS sl@0: /* sl@0: * Convert a pathname and project identifier to an IPC key. sl@0: */ sl@0: IMPORT_C key_t ftok(const char *pathname, int proj_id); sl@0: sl@0: __END_DECLS sl@0: sl@0: #endif /* _KERNEL */ sl@0: sl@0: #endif /* !_SYS_IPC_H_ */ sl@0: sl@0: sl@0: sl@0: // End of File