]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Define msgqnum_t and msglen_t and use them in struct msqid_s.
authorUlrich Drepper <drepper@redhat.com>
Fri, 17 Mar 2000 03:30:55 +0000 (03:30 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 17 Mar 2000 03:30:55 +0000 (03:30 +0000)
sysdeps/generic/bits/msq.h
sysdeps/gnu/bits/msq.h

index a263869a0e1a44662ee9644f4660ed03718dc65b..59093700ae46144f01f7032383f276af464481ee 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1997, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _SYS_MSG_H
-#error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
+# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
 #endif
 
-#include <sys/types.h>
+#include <bits/types.h>
 
 /* Define options for message queue functions.  */
 #define MSG_NOERROR    010000  /* no error if message is too big */
 
+/* Types used in the structure definition.  */
+typedef unsigned short int msgqnum_t;
+typedef unsigned short int msglen_t;
+
 
 /* Structure of record for one message inside the kernel.
    The type `struct __msg' is opaque.  */
@@ -34,8 +38,8 @@ struct msqid_ds
   __time_t msg_stime;          /* time of last msgsnd command */
   __time_t msg_rtime;          /* time of last msgrcv command */
   __time_t msg_ctime;          /* time of last change */
-  unsigned short int msg_qnum; /* number of messages currently on queue */
-  unsigned short int msg_qbytes;/* max number of bytes allowed on queue */
+  msgqnum_t msg_qnum;          /* number of messages currently on queue */
+  msglen_t msg_qbytes;         /* max number of bytes allowed on queue */
   __pid_t msg_lspid;           /* pid of last msgsnd() */
   __pid_t msg_lrpid;           /* pid of last msgrcv() */
 };
index d7a8e5ee0f450a53f07d52399adba0f8c903173d..874c369d650ce1334fa76a3ebe555ffe095c78ce 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
 # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
 #endif
 
-#include <sys/types.h>
+#include <bits/types.h>
 
 /* Define options for message queue functions.  */
 #define MSG_NOERROR    010000  /* no error if message is too big */
-#define MSG_EXCEPT     020000  /* recv any msg except of specified type */
+#ifdef __USE_GNU
+# define MSG_EXCEPT    020000  /* recv any msg except of specified type */
+#endif
+
+/* Types used in the structure definition.  */
+typedef unsigned short int msgqnum_t;
+typedef unsigned short int msglen_t;
 
 
 /* Structure of record for one message inside the kernel.
@@ -40,8 +46,8 @@ struct msqid_ds
   struct wait_queue *__wwait;  /* ??? */
   struct wait_queue *__rwait;  /* ??? */
   unsigned short int __msg_cbytes;/* current number of bytes on queue */
-  unsigned short int msg_qnum; /* number of messages currently on queue */
-  unsigned short int msg_qbytes;/* max number of bytes allowed on queue */
+  msgqnum_t msg_qnum;          /* number of messages currently on queue */
+  msglen_t msg_qbytes;         /* max number of bytes allowed on queue */
   __ipc_pid_t msg_lspid;       /* pid of last msgsnd() */
   __ipc_pid_t msg_lrpid;       /* pid of last msgrcv() */
 };