xref: /titanic_50/usr/src/lib/libbc/inc/include/sys/msg.h (revision afd1ac7b1c9a8cdf273c865aa5e9a14620341443)
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 1987 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*      Copyright (c) 1984 AT&T */
28 /*        All Rights Reserved   */
29 
30 #ifndef _sys_msg_h
31 #define	_sys_msg_h
32 
33 #pragma ident	"%Z%%M%	%I%	%E% SMI"
34 
35 /*
36  *	IPC Message Facility.
37  */
38 
39 /*
40  *	Message Operation Flags.
41  */
42 #define	MSG_NOERROR	010000	/* no error if big message */
43 
44 /*
45  *	Structure Definitions.
46  */
47 
48 /*
49  *	There is one msg queue id data structure for each q in the system.
50  */
51 
52 struct msqid_ds {
53 	struct ipc_perm	msg_perm;	/* operation permission struct */
54 	struct msg	*msg_first;	/* ptr to first message on q */
55 	struct msg	*msg_last;	/* ptr to last message on q */
56 	ushort		msg_cbytes;	/* current # bytes on q */
57 	ushort		msg_qnum;	/* # of messages on q */
58 	ushort		msg_qbytes;	/* max # of bytes on q */
59 	ushort		msg_lspid;	/* pid of last msgsnd */
60 	ushort		msg_lrpid;	/* pid of last msgrcv */
61 	time_t		msg_stime;	/* last msgsnd time */
62 	time_t		msg_rtime;	/* last msgrcv time */
63 	time_t		msg_ctime;	/* last change time */
64 };
65 
66 /*
67  *	User message buffer template for msgsnd and msgrcv system calls.
68  */
69 
70 /* HACK :: change the name when compiling the kernel to avoid conflicts */
71 struct msgbuf {
72 	long	mtype;		/* message type */
73 	char	mtext[1];	/* message text */
74 };
75 
76 /*
77  *	There is one msg structure for each message that may be in the system.
78  */
79 
80 struct msg {
81 	struct msg	*msg_next;	/* ptr to next message on q */
82 	long		msg_type;	/* message type */
83 	ushort		msg_ts;		/* message text size */
84 	ushort		msg_spot;	/* message text map address */
85 };
86 
87 #endif /* !_sys_msg_h */
88