This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 02/29] Allow sigset be an array of a different type
- From: Andrew Pinski <apinski at cavium dot com>
- To: libc-alpha at sourceware dot org
- Cc: Andrew Pinski <apinski at cavium dot com>
- Date: Mon, 27 Oct 2014 00:59:26 -0700
- Subject: [PATCH 02/29] Allow sigset be an array of a different type
- Authentication-results: sourceware.org; auth=none
- References: <1414396793-9005-1-git-send-email-apinski at cavium dot com>
For AARCH64 ILP32, sigset needs to be an array of unsigned long long as
it needs to be 64bit to match AARCH64 lP64.
* sysdeps/unix/sysv/linux/bits/sigset.h: Include bits/types.h.
(__sigset_inner_t): New typedef.
(_SIGSET_NWORDS): Use __sigset_inner_t instead of unsigned long.
(__sigset_t): Likewise.
(__sigmask): Likewise.
(__sigword): Likewise.
(__SIGSETFN): Likewise.
---
sysdeps/unix/sysv/linux/bits/sigset.h | 20 ++++++++++++++------
1 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/sysdeps/unix/sysv/linux/bits/sigset.h b/sysdeps/unix/sysv/linux/bits/sigset.h
index af4ae83..4648e7b 100644
--- a/sysdeps/unix/sysv/linux/bits/sigset.h
+++ b/sysdeps/unix/sysv/linux/bits/sigset.h
@@ -19,14 +19,22 @@
#ifndef _SIGSET_H_types
# define _SIGSET_H_types 1
+#include <bits/types.h>
+
typedef int __sig_atomic_t;
+#ifndef __SIGSET_INNER_T
+typedef unsigned long __sigset_inner_t;
+#else
+typedef __SIGSET_INNER_T __sigset_inner_t;
+#endif
+
/* A `sigset_t' has a bit for each signal. */
-# define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int)))
+# define _SIGSET_NWORDS (1024 / (8 * sizeof (__sigset_inner_t)))
typedef struct
{
- unsigned long int __val[_SIGSET_NWORDS];
+ __sigset_inner_t __val[_SIGSET_NWORDS];
} __sigset_t;
#endif
@@ -47,10 +55,10 @@ typedef struct
/* Return a mask that includes the bit for SIG only. */
# define __sigmask(sig) \
- (((unsigned long int) 1) << (((sig) - 1) % (8 * sizeof (unsigned long int))))
+ (((__sigset_inner_t) 1) << (((sig) - 1) % (8 * sizeof (__sigset_inner_t))))
/* Return the word index for SIG. */
-# define __sigword(sig) (((sig) - 1) / (8 * sizeof (unsigned long int)))
+# define __sigword(sig) (((sig) - 1) / (8 * sizeof (__sigset_inner_t)))
# if defined __GNUC__ && __GNUC__ >= 2
# define __sigemptyset(set) \
@@ -108,8 +116,8 @@ extern int __sigdelset (__sigset_t *, int);
_EXTERN_INLINE int \
NAME (CONST __sigset_t *__set, int __sig) \
{ \
- unsigned long int __mask = __sigmask (__sig); \
- unsigned long int __word = __sigword (__sig); \
+ __sigset_inner_t __mask = __sigmask (__sig); \
+ __sigset_inner_t __word = __sigword (__sig); \
return BODY; \
}
--
1.7.2.5