00001 /* 00002 * 00003 * Copyright (c) International Business Machines Corp., 2001 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 2 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 00013 * the GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 */ 00019 00020 /* 00021 * ipcmsg.h - common definitions for the IPC message tests. 00022 */ 00023 00024 #ifndef __IPCMSG_H 00025 #define __IPCMSG_H 1 00026 00027 #include <errno.h> 00028 #include <sys/ipc.h> 00029 #include <sys/msg.h> 00030 00031 #include "test.h" 00032 #include "usctest.h" 00033 00034 void cleanup(void); 00035 void setup(void); 00036 00037 #define MSG_RD 0400 /* read permission for the queue */ 00038 #define MSG_WR 0200 /* write permission for the queue */ 00039 #define MSG_RW MSG_RD | MSG_WR 00040 00041 #define MSGSIZE 1024 /* a resonable size for a message */ 00042 #define MSGTYPE 1 /* a type ID for a message */ 00043 00044 typedef struct mbuf { /* a generic message structure */ 00045 long mtype; 00046 char mtext[MSGSIZE + 1]; /* add 1 here so the message can be 1024 */ 00047 } MSGBUF; /* characters long with a '\0' termination */ 00048 00049 #if (!defined CONFIG_COLDFIRE || defined LIBIPC) 00050 key_t msgkey; /* the ftok() generated message key */ 00051 #else 00052 extern key_t msgkey; /* the ftok() generated message key */ 00053 #endif 00054 00055 void check_root(); 00056 void init_buf(MSGBUF *, int, int); 00057 void rm_queue(int); 00058 00059 int getipckey(); 00060 int getuserid(char *); 00061 00062 #endif /* ipcmsg.h */
1.5.8