This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
PATCH: Add __syscall_slong_t and __syscall_ulong_t
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 11 Apr 2012 18:20:17 -0700
- Subject: PATCH: Add __syscall_slong_t and __syscall_ulong_t
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
This patch adds __syscall_slong_t and __syscall_ulong_t, similar to
__kernel_long_t and __kernel_ulong_t in Linux kernel 3.4. They are
used in types for system calls where kernel expects long is 64bit when
long is 32bit in user space. OK to install?
Thanks.
H.J.
---
2012-04-11 H.J. Lu <hongjiu.lu@intel.com>
* bits/types.h (__syscall_slong_t): New type.
(__syscall_ulong_t): Likewise.
* bits/typesizes.h (__SYSCALL_SLONG_TYPE): New macro.
(__SYSCALL_ULONG_TYPE): Likewise.
* sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h
(__SYSCALL_SLONG_TYPE): Likewise.
(__SYSCALL_ULONG_TYPE): Likewise.
* sysdeps/unix/sysv/linux/s390/bits/typesizes.h
(__SYSCALL_SLONG_TYPE): Likewise.
(__SYSCALL_ULONG_TYPE): Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
(__SYSCALL_SLONG_TYPE): Likewise.
(__SYSCALL_ULONG_TYPE): Likewise.
diff --git a/bits/types.h b/bits/types.h
index ae79a6f..34880a9 100644
--- a/bits/types.h
+++ b/bits/types.h
@@ -179,6 +179,11 @@ __STD_TYPE __FSFILCNT64_T_TYPE __fsfilcnt64_t;
__STD_TYPE __SSIZE_T_TYPE __ssize_t; /* Type of a byte count, or error. */
+/* Signed long type used in system calls. */
+__STD_TYPE __SYSCALL_SLONG_TYPE __syscall_slong_t;
+/* Unsigned long type used in system calls. */
+__STD_TYPE __SYSCALL_ULONG_TYPE __syscall_ulong_t;
+
/* These few don't really vary by system, they always correspond
to one of the other defined types. */
typedef __off64_t __loff_t; /* Type of file sizes and offsets (LFS). */
diff --git a/bits/typesizes.h b/bits/typesizes.h
index 179fe5f..4a5fed0 100644
--- a/bits/typesizes.h
+++ b/bits/typesizes.h
@@ -58,6 +59,8 @@
#define __FSID_T_TYPE struct { int __val[2]; }
#define __SSIZE_T_TYPE __SWORD_TYPE
#define __SNSECONDS_T_TYPE __SLONGWORD_TYPE
+#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE
+#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE
/* Number of descriptors that can fit in an `fd_set'. */
#define __FD_SETSIZE 1024
diff --git a/sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h b/sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h
index 1c763c2..f860e34 100644
--- a/sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h
+++ b/sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h
@@ -58,6 +58,8 @@
#define __FSID_T_TYPE struct { int __val[2]; }
#define __SSIZE_T_TYPE __SWORD_TYPE
#define __SNSECONDS_T_TYPE __SLONGWORD_TYPE
+#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE
+#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE
/* Number of descriptors that can fit in an `fd_set'. */
#define __FD_SETSIZE 1024
diff --git a/sysdeps/unix/sysv/linux/s390/bits/typesizes.h b/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
index af7021f..4b9bfca 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
@@ -64,6 +64,8 @@
#define __SSIZE_T_TYPE __SLONGWORD_TYPE
#endif
#define __SNSECONDS_T_TYPE __SLONGWORD_TYPE
+#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE
+#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE
/* Number of descriptors that can fit in an `fd_set'. */
#define __FD_SETSIZE 1024
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h b/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
index bba82b3..254b304 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
@@ -58,6 +58,8 @@
#define __FSID_T_TYPE struct { int __val[2]; }
#define __SSIZE_T_TYPE __SWORD_TYPE
#define __SNSECONDS_T_TYPE __SLONGWORD_TYPE
+#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE
+#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE
/* Number of descriptors that can fit in an `fd_set'. */
#define __FD_SETSIZE 1024