This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

MIPS bits/siginfo.h update


This patch brings <bits/siginfo.h> in line with reality and other
platforms.  It contains several different ABI changes, which I have
deemed acceptable, since we previously mismatched the kernel anyway.

Changes:
  - The _timer1 and _timer2 fields in siginfo are gone.  We now have
  si_tid, si_overrun, and si_sigval like other targets.  This is only
  a source compatibility issue; it fixes portable programs and breaks
  programs which already worked around the glibc bug.  I don't know of
  any such programs and they are easy to fix.

  - si_band is now a long, not an int.  This affects programs using the
  _sigpoll fields on MIPS N64.  The values were previously incorrect,
  though, since this is how the kernel lays them out.

  - struct sigevent was previously, incorrectly, 68 bytes on N64.  Now
  it is 64 again as was intended.  Nothing uses the tail and glibc
  does not go around copying sigevents so this should have no impact.

  - The missed _tid field in sigevent has been added.  As this is a
  new member of a union it does not break anything which previously
  compiled.

Checked in on HEAD.

-- 
Daniel Jacobowitz
CodeSourcery

2008-03-04  Daniel Jacobowitz  <dan@codesourcery.com>

	* sysdeps/unix/sysv/linux/mips/bits/siginfo.h (struct siginfo):
	Reorganize to match other architectures.  Replace _timer._timer1
	and _timer._timer2 with _timer.si_tid, _timer.si_overrun, and
	_timer.si_sigval.  Correct the type of _sigpoll.si_band.
	(si_timerid, si_overrun): Define.
	(__SIGEV_PAD_SIZE): Correct for __WORDSIZE == 64.
	(__pthread_attr_s): Remove declaration.
	(struct sigevent): Remove XXX.  Add _tid.

Index: sysdeps/unix/sysv/linux/mips/bits/siginfo.h
===================================================================
RCS file: /cvs/glibc/ports/sysdeps/unix/sysv/linux/mips/bits/siginfo.h,v
retrieving revision 1.12
diff -u -p -r1.12 siginfo.h
--- sysdeps/unix/sysv/linux/mips/bits/siginfo.h	28 Mar 2005 09:17:43 -0000	1.12
+++ sysdeps/unix/sysv/linux/mips/bits/siginfo.h	4 Mar 2008 18:39:59 -0000
@@ -1,5 +1,5 @@
 /* siginfo_t, sigevent and constants.  Linux/MIPS version.
-   Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005
+   Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
 	Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -70,6 +70,22 @@ typedef struct siginfo
 	    __uid_t si_uid;	/* Real user ID of sending process.  */
 	  } _kill;
 
+	/* POSIX.1b timers.  */
+	struct
+	  {
+	    int si_tid;		/* Timer ID.  */
+	    int si_overrun;	/* Overrun count.  */
+	    sigval_t si_sigval;	/* Signal value.  */
+	  } _timer;
+
+	/* POSIX.1b signals.  */
+	struct
+	  {
+	    __pid_t si_pid;	/* Sending process ID.  */
+	    __uid_t si_uid;	/* Real user ID of sending process.  */
+	    sigval_t si_sigval;	/* Signal value.  */
+	  } _rt;
+
 	/* SIGCHLD.  */
 	struct
 	  {
@@ -89,24 +105,9 @@ typedef struct siginfo
 	/* SIGPOLL.  */
 	struct
 	  {
-	    int si_band;	/* Band event for SIGPOLL.  */
+	    long int si_band;	/* Band event for SIGPOLL.  */
 	    int si_fd;
 	  } _sigpoll;
-
-	/* POSIX.1b timers.  */
-	struct
-	  {
-	    unsigned int _timer1;
-	    unsigned int _timer2;
-	  } _timer;
-
-	/* POSIX.1b signals.  */
-	struct
-	  {
-	    __pid_t si_pid;	/* Sending process ID.  */
-	    __uid_t si_uid;	/* Real user ID of sending process.  */
-	    sigval_t si_sigval;	/* Signal value.  */
-	  } _rt;
       } _sifields;
   } siginfo_t;
 
@@ -114,6 +115,8 @@ typedef struct siginfo
 /* X/Open requires some more fields with fixed names.  */
 # define si_pid		_sifields._kill.si_pid
 # define si_uid		_sifields._kill.si_uid
+# define si_timerid	_sifields._timer.si_tid
+# define si_overrun	_sifields._timer.si_overrun
 # define si_status	_sifields._sigchld.si_status
 # define si_utime	_sifields._sigchld.si_utime
 # define si_stime	_sifields._sigchld.si_stime
@@ -265,12 +268,12 @@ enum
 
 /* Structure to transport application-defined values with signals.  */
 # define __SIGEV_MAX_SIZE	64
-# define __SIGEV_PAD_SIZE	((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
-
-/* Forward declaration of the `pthread_attr_t' type.  */
-struct __pthread_attr_s;
+# if __WORDSIZE == 64
+#  define __SIGEV_PAD_SIZE	((__SIGEV_MAX_SIZE / sizeof (int)) - 4)
+# else
+#  define __SIGEV_PAD_SIZE	((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
+# endif
 
-/* XXX This one might need to change!!!  */
 typedef struct sigevent
   {
     sigval_t sigev_value;
@@ -281,6 +284,10 @@ typedef struct sigevent
       {
 	int _pad[__SIGEV_PAD_SIZE];
 
+	/* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the
+	   thread to receive the signal.  */
+	__pid_t _tid;
+
 	struct
 	  {
 	    void (*_function) (sigval_t);	/* Function to start.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]