Linux MIPS Architecture development
 help / color / mirror / Atom feed
* LTP testing: msgctl/IPC_STAT
@ 2002-07-19 14:30 Johannes Stezenbach
  2002-07-19 15:00 ` H. J. Lu
  2002-07-22  6:31 ` Carsten Langgaard
  0 siblings, 2 replies; 4+ messages in thread
From: Johannes Stezenbach @ 2002-07-19 14:30 UTC (permalink / raw)
  To: linux-mips

I was investigating LTP test suite failures of the msgctl01,
msgctl02, msgsnd01 and msgsnd02 tests. It seems that they
are caused by a mismatch between /usr/include/bits/msq.h
and linux/include/asm-mips/msgbuf.h.

I suggest the following patch which makes mips' msgbuf.h
a copy of the one in include/asm-i386.

Johannes


Index: linux/include/asm-mips/msgbuf.h
===================================================================
RCS file: /cvs/linux/include/asm-mips/msgbuf.h,v
retrieving revision 1.1
diff -u -r1.1 msgbuf.h
--- linux/include/asm-mips/msgbuf.h	2000/02/16 01:07:48	1.1
+++ linux/include/asm-mips/msgbuf.h	2002/07/19 14:20:29
@@ -2,26 +2,30 @@
 #define _ASM_MSGBUF_H
 
 /* 
- * The msqid64_ds structure for alpha architecture.
+ * The msqid64_ds structure for mips architecture.
  * Note extra padding because this structure is passed back and forth
  * between kernel and user space.
  *
  * Pad space is left for:
- * - 2 miscellaneous 64-bit values
+ * - 64-bit time_t to solve y2038 problem
+ * - 2 miscellaneous 32-bit values
  */
 
 struct msqid64_ds {
 	struct ipc64_perm msg_perm;
 	__kernel_time_t msg_stime;	/* last msgsnd time */
+	unsigned long	__unused1;
 	__kernel_time_t msg_rtime;	/* last msgrcv time */
+	unsigned long	__unused2;
 	__kernel_time_t msg_ctime;	/* last change time */
+	unsigned long	__unused3;
 	unsigned long  msg_cbytes;	/* current number of bytes on queue */
 	unsigned long  msg_qnum;	/* number of messages in queue */
 	unsigned long  msg_qbytes;	/* max number of bytes on queue */
 	__kernel_pid_t msg_lspid;	/* pid of last msgsnd */
 	__kernel_pid_t msg_lrpid;	/* last receive pid */
-	unsigned long  __unused1;
-	unsigned long  __unused2;
+	unsigned long  __unused4;
+	unsigned long  __unused5;
 };
 
 #endif /* _ASM_MSGBUF_H */

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: LTP testing: msgctl/IPC_STAT
  2002-07-19 14:30 LTP testing: msgctl/IPC_STAT Johannes Stezenbach
@ 2002-07-19 15:00 ` H. J. Lu
  2002-07-22  6:41   ` Carsten Langgaard
  2002-07-22  6:31 ` Carsten Langgaard
  1 sibling, 1 reply; 4+ messages in thread
From: H. J. Lu @ 2002-07-19 15:00 UTC (permalink / raw)
  To: Johannes Stezenbach; +Cc: linux-mips, GNU C Library

[-- Attachment #1: Type: text/plain, Size: 444 bytes --]

On Fri, Jul 19, 2002 at 04:30:34PM +0200, Johannes Stezenbach wrote:
> I was investigating LTP test suite failures of the msgctl01,
> msgctl02, msgsnd01 and msgsnd02 tests. It seems that they
> are caused by a mismatch between /usr/include/bits/msq.h
> and linux/include/asm-mips/msgbuf.h.
> 
> I suggest the following patch which makes mips' msgbuf.h
> a copy of the one in include/asm-i386.
> 

I prefer we fix glibc. Here is a patch.


H.J.

[-- Attachment #2: glibc-mips-msg.patch --]
[-- Type: text/plain, Size: 2716 bytes --]

2002-07-19  H.J. Lu  <hjl@gnu.org>

	* sysdeps/unix/sysv/linux/mips/bits/msq.h: New.

--- sysdeps/unix/sysv/linux/mips/bits/msq.h.mips	Fri Jul 19 07:57:55 2002
+++ sysdeps/unix/sysv/linux/mips/bits/msq.h	Fri Jul 19 07:57:15 2002
@@ -0,0 +1,74 @@
+/* Copyright (C) 2002 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
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_MSG_H
+# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Define options for message queue functions.  */
+#define MSG_NOERROR	010000	/* no error if message is too big */
+#ifdef __USE_GNU
+# define MSG_EXCEPT	020000	/* recv any msg except of specified type */
+#endif
+
+/* Types used in the structure definition.  */
+typedef unsigned long int msgqnum_t;
+typedef unsigned long int msglen_t;
+
+
+/* Structure of record for one message inside the kernel.
+   The type `struct msg' is opaque.  */
+struct msqid_ds
+{
+  struct ipc_perm msg_perm;	/* structure describing operation permission */
+  __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 long int __msg_cbytes; /* current number of bytes 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() */
+  unsigned long int __unused1;
+  unsigned long int __unused2;
+};
+
+#ifdef __USE_MISC
+
+# define msg_cbytes	__msg_cbytes
+
+/* ipcs ctl commands */
+# define MSG_STAT 11
+# define MSG_INFO 12
+
+/* buffer for msgctl calls IPC_INFO, MSG_INFO */
+struct msginfo
+  {
+    int msgpool;
+    int msgmap;
+    int msgmax;
+    int msgmnb;
+    int msgmni;
+    int msgssz;
+    int msgtql;
+    unsigned short int msgseg;
+  };
+
+#endif /* __USE_MISC */

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: LTP testing: msgctl/IPC_STAT
  2002-07-19 14:30 LTP testing: msgctl/IPC_STAT Johannes Stezenbach
  2002-07-19 15:00 ` H. J. Lu
@ 2002-07-22  6:31 ` Carsten Langgaard
  1 sibling, 0 replies; 4+ messages in thread
From: Carsten Langgaard @ 2002-07-22  6:31 UTC (permalink / raw)
  To: Johannes Stezenbach; +Cc: linux-mips, Ralf Baechle

I also send this patch a week ago. Ralf could you please applied it.
If there is any objection against changing this structure in the kernel, then we
need a glibc fix instead.

/Carsten


Johannes Stezenbach wrote:

> I was investigating LTP test suite failures of the msgctl01,
> msgctl02, msgsnd01 and msgsnd02 tests. It seems that they
> are caused by a mismatch between /usr/include/bits/msq.h
> and linux/include/asm-mips/msgbuf.h.
>
> I suggest the following patch which makes mips' msgbuf.h
> a copy of the one in include/asm-i386.
>
> Johannes
>
> Index: linux/include/asm-mips/msgbuf.h
> ===================================================================
> RCS file: /cvs/linux/include/asm-mips/msgbuf.h,v
> retrieving revision 1.1
> diff -u -r1.1 msgbuf.h
> --- linux/include/asm-mips/msgbuf.h     2000/02/16 01:07:48     1.1
> +++ linux/include/asm-mips/msgbuf.h     2002/07/19 14:20:29
> @@ -2,26 +2,30 @@
>  #define _ASM_MSGBUF_H
>
>  /*
> - * The msqid64_ds structure for alpha architecture.
> + * The msqid64_ds structure for mips architecture.
>   * Note extra padding because this structure is passed back and forth
>   * between kernel and user space.
>   *
>   * Pad space is left for:
> - * - 2 miscellaneous 64-bit values
> + * - 64-bit time_t to solve y2038 problem
> + * - 2 miscellaneous 32-bit values
>   */
>
>  struct msqid64_ds {
>         struct ipc64_perm msg_perm;
>         __kernel_time_t msg_stime;      /* last msgsnd time */
> +       unsigned long   __unused1;
>         __kernel_time_t msg_rtime;      /* last msgrcv time */
> +       unsigned long   __unused2;
>         __kernel_time_t msg_ctime;      /* last change time */
> +       unsigned long   __unused3;
>         unsigned long  msg_cbytes;      /* current number of bytes on queue */
>         unsigned long  msg_qnum;        /* number of messages in queue */
>         unsigned long  msg_qbytes;      /* max number of bytes on queue */
>         __kernel_pid_t msg_lspid;       /* pid of last msgsnd */
>         __kernel_pid_t msg_lrpid;       /* last receive pid */
> -       unsigned long  __unused1;
> -       unsigned long  __unused2;
> +       unsigned long  __unused4;
> +       unsigned long  __unused5;
>  };
>
>  #endif /* _ASM_MSGBUF_H */

--
_    _ ____  ___   Carsten Langgaard   Mailto:carstenl@mips.com
|\  /|||___)(___   MIPS Denmark        Direct: +45 4486 5527
| \/ |||    ____)  Lautrupvang 4B      Switch: +45 4486 5555
  TECHNOLOGIES     2750 Ballerup       Fax...: +45 4486 5556
                   Denmark             http://www.mips.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: LTP testing: msgctl/IPC_STAT
  2002-07-19 15:00 ` H. J. Lu
@ 2002-07-22  6:41   ` Carsten Langgaard
  0 siblings, 0 replies; 4+ messages in thread
From: Carsten Langgaard @ 2002-07-22  6:41 UTC (permalink / raw)
  To: H. J. Lu; +Cc: Johannes Stezenbach, linux-mips, Ralf Baechle

"H. J. Lu" wrote:

> On Fri, Jul 19, 2002 at 04:30:34PM +0200, Johannes Stezenbach wrote:
> > I was investigating LTP test suite failures of the msgctl01,
> > msgctl02, msgsnd01 and msgsnd02 tests. It seems that they
> > are caused by a mismatch between /usr/include/bits/msq.h
> > and linux/include/asm-mips/msgbuf.h.
> >
> > I suggest the following patch which makes mips' msgbuf.h
> > a copy of the one in include/asm-i386.
> >
>
> I prefer we fix glibc. Here is a patch.
>

Ok, so it's being fixed in glibc. Ralf please ignore my previous mail.


>
> H.J.
>
>   ------------------------------------------------------------------------
>
>    glibc-mips-msg.patchName: glibc-mips-msg.patch
>                        Type: Plain Text (text/plain)

--
_    _ ____  ___   Carsten Langgaard   Mailto:carstenl@mips.com
|\  /|||___)(___   MIPS Denmark        Direct: +45 4486 5527
| \/ |||    ____)  Lautrupvang 4B      Switch: +45 4486 5555
  TECHNOLOGIES     2750 Ballerup       Fax...: +45 4486 5556
                   Denmark             http://www.mips.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-07-22  6:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-19 14:30 LTP testing: msgctl/IPC_STAT Johannes Stezenbach
2002-07-19 15:00 ` H. J. Lu
2002-07-22  6:41   ` Carsten Langgaard
2002-07-22  6:31 ` Carsten Langgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox