Changeset 1982
- Timestamp:
- May 8, 2005, 4:11:49 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/emx/include/sys/ipc.h ¶
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r1981 r1982 1 /* sys/ipc.h (emx+gcc) */ 1 /* 2 * Copyright (c) 1988 University of Utah. 3 * Copyright (c) 1990, 1993 4 * The Regents of the University of California. All rights reserved. 5 * (c) UNIX System Laboratories, Inc. 6 * All or some portions of this file are derived from material licensed 7 * to the University of California by American Telephone and Telegraph 8 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 9 * the permission of UNIX System Laboratories, Inc. 10 * 11 * This code is derived from software contributed to Berkeley by 12 * the Systems Programming Group of the University of Utah Computer 13 * Science Department. 14 * 15 * Redistribution and use in source and binary forms, with or without 16 * modification, are permitted provided that the following conditions 17 * are met: 18 * 1. Redistributions of source code must retain the above copyright 19 * notice, this list of conditions and the following disclaimer. 20 * 2. Redistributions in binary form must reproduce the above copyright 21 * notice, this list of conditions and the following disclaimer in the 22 * documentation and/or other materials provided with the distribution. 23 * 4. Neither the name of the University nor the names of its contributors 24 * may be used to endorse or promote products derived from this software 25 * without specific prior written permission. 26 * 27 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 28 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 30 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 31 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * 39 * @(#)ipc.h 8.4 (Berkeley) 2/19/95 40 * $FreeBSD: src/sys/sys/ipc.h,v 1.24 2004/04/07 04:19:49 imp Exp $ 41 */ 2 42 3 #ifndef _SYS_IPC_H 4 #define _SYS_IPC_H 43 /** @file 44 * FreeBSD 5.3 45 * @changed bird: Since we don't have any legacy, use correct types. 46 * @todo emx: #define IPC_ALLOC 0x8000 47 */ 5 48 6 #if !defined (_KEY_T) 7 #define _KEY_T 8 typedef long key_t; 49 /* 50 * SVID compatible ipc.h file 51 */ 52 #ifndef _SYS_IPC_H_ 53 #define _SYS_IPC_H_ 54 55 #include <sys/cdefs.h> 56 #include <sys/_types.h> 57 58 #ifndef _GID_T_DECLARED 59 typedef __gid_t gid_t; 60 #define _GID_T_DECLARED 9 61 #endif 10 62 11 #if !defined (_IPC_PERM) 12 #define _IPC_PERM 13 struct ipc_perm 14 { 15 unsigned short uid; 16 unsigned short gid; 17 unsigned short cuid; 18 unsigned short cgid; 19 unsigned short mode; 20 unsigned short seq; 21 key_t key; 22 }; 63 #ifndef _KEY_T_DECLARED 64 typedef __key_t key_t; 65 #define _KEY_T_DECLARED 23 66 #endif 24 67 25 #if !defined (IPC_CREAT) 26 #define IPC_CREAT 0x0200 27 #define IPC_EXCL 0x0400 28 #define IPC_NOWAIT 0x0800 29 #define IPC_ALLOC 0x8000 30 31 #define IPC_PRIVATE (key_t)0 32 33 #define IPC_RMID 0 34 #define IPC_SET 1 35 #define IPC_STAT 2 68 #ifndef _MODE_T_DECLARED 69 typedef __mode_t mode_t; 70 #define _MODE_T_DECLARED 36 71 #endif 37 72 38 #endif /* not SYS_IPC_H */ 73 #ifndef _UID_T_DECLARED 74 typedef __uid_t uid_t; 75 #define _UID_T_DECLARED 76 #endif 77 78 #ifndef __EMX__ 79 /* 80 * XXX almost all members have wrong types. 81 */ 82 #endif 83 struct ipc_perm { 84 #ifdef __EMX__ 85 uid_t cuid; /* creator user id */ 86 gid_t cgid; /* creator group id */ 87 uid_t uid; /* user id */ 88 gid_t gid; /* group id */ 89 mode_t mode; /* r/w permission */ 90 #else 91 unsigned short cuid; /* creator user id */ 92 unsigned short cgid; /* creator group id */ 93 unsigned short uid; /* user id */ 94 unsigned short gid; /* group id */ 95 unsigned short mode; /* r/w permission */ 96 #endif 97 unsigned short seq; /* sequence # (to generate unique ipcid) */ 98 key_t key; /* user specified msg/sem/shm key */ 99 }; 100 101 #if __BSD_VISIBLE 102 /* common mode bits */ 103 #define IPC_R 000400 /* read permission */ 104 #define IPC_W 000200 /* write/alter permission */ 105 #define IPC_M 010000 /* permission to change control info */ 106 #endif 107 108 /* SVID required constants (same values as system 5) */ 109 #define IPC_CREAT 001000 /* create entry if key does not exist */ 110 #define IPC_EXCL 002000 /* fail if key exists */ 111 #define IPC_NOWAIT 004000 /* error if request must wait */ 112 113 #define IPC_PRIVATE (key_t)0 /* private key */ 114 115 #define IPC_RMID 0 /* remove identifier */ 116 #define IPC_SET 1 /* set options */ 117 #define IPC_STAT 2 /* get options */ 118 #if __BSD_VISIBLE 119 #define IPC_INFO 3 /* get info */ 120 #endif 121 122 #ifdef _KERNEL 123 /* Macros to convert between ipc ids and array indices or sequence ids */ 124 #define IPCID_TO_IX(id) ((id) & 0xffff) 125 #define IPCID_TO_SEQ(id) (((id) >> 16) & 0xffff) 126 #define IXSEQ_TO_IPCID(ix,perm) (((perm.seq) << 16) | (ix & 0xffff)) 127 128 struct thread; 129 struct proc; 130 struct vmspace; 131 132 int ipcperm(struct thread *, struct ipc_perm *, int); 133 extern void (*shmfork_hook)(struct proc *, struct proc *); 134 extern void (*shmexit_hook)(struct vmspace *); 135 136 #else /* ! _KERNEL */ 137 138 __BEGIN_DECLS 139 key_t ftok(const char *, int); 140 __END_DECLS 141 142 #endif /* _KERNEL */ 143 144 #endif /* !_SYS_IPC_H_ */ -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.