xref: /titanic_50/usr/src/uts/common/sys/ipc.h (revision 8b464eb836173b92f2b7a65623cd06c8c3c59289)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 1996-2003 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
28 /*	  All Rights Reserved  	*/
29 
30 
31 
32 #ifndef _SYS_IPC_H
33 #define	_SYS_IPC_H
34 
35 #pragma ident	"%Z%%M%	%I%	%E% SMI"
36 
37 #include <sys/isa_defs.h>
38 #include <sys/feature_tests.h>
39 #include <sys/types.h>
40 
41 #ifdef	__cplusplus
42 extern "C" {
43 #endif
44 
45 /* Common IPC access structure */
46 
47 struct ipc_perm {
48 	uid_t		uid;	/* owner's user id */
49 	gid_t		gid;	/* owner's group id */
50 	uid_t		cuid;	/* creator's user id */
51 	gid_t		cgid;	/* creator's group id */
52 	mode_t		mode;	/* access modes */
53 	uint_t		seq;	/* slot usage sequence number */
54 	key_t		key;	/* key */
55 #if !defined(_LP64)
56 	int		pad[4]; /* reserve area */
57 #endif
58 };
59 
60 
61 /* Common IPC definitions */
62 
63 /* Mode bits */
64 #define	IPC_ALLOC	0100000		/* entry currently allocated */
65 #define	IPC_CREAT	0001000		/* create entry if key doesn't exist */
66 #define	IPC_EXCL	0002000		/* fail if key exists */
67 #define	IPC_NOWAIT	0004000		/* error if request must wait */
68 
69 /* Keys */
70 #define	IPC_PRIVATE	(key_t)0	/* private key */
71 
72 
73 /* Common IPC control commands */
74 #define	IPC_RMID	10	/* remove identifier */
75 #define	IPC_SET		11	/* set options */
76 #define	IPC_STAT	12	/* get options */
77 
78 
79 #if (!defined(_KERNEL) && !defined(_XOPEN_SOURCE)) || defined(_XPG4_2) || \
80 	defined(__EXTENSIONS__)
81 #if defined(__STDC__)
82 key_t ftok(const char *, int);
83 #else
84 key_t ftok();
85 #endif /* defined(__STDC__) */
86 #endif /* (!defined(_KERNEL) && !defined(_XOPEN_SOURCE))... */
87 
88 #ifdef	__cplusplus
89 }
90 #endif
91 
92 #endif	/* _SYS_IPC_H */
93