[PATCH] pread/pwrite fix for s390-64.
Martin Schwidefsky
schwidefsky@de.ibm.com
Tue Mar 11 19:38:00 GMT 2003
> > Actually, unless old kernels are completely out, sysdep.h should
> > probably map the old and new syscall names.
>
> Like this?
I tested this patch and glibc now compiles with the old 2.4 style naming
of pread/pwrite and the new 2.5 style naming as well.
blue skies,
Martin.
2003-03-11 Martin Schwidefsky <schwidefsky@de.ibm.com>
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (__NR_pread64): Define
to __NR_pread if not defined.
(__NR_pwrite64): Define to __NR_pwrite if not defined.
diff -urN libc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h libc-s390/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
--- libc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h Tue Mar 4 12:58:09 2003
+++ libc-s390/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h Tue Mar 11 09:53:45 2003
@@ -31,6 +31,18 @@
/* In newer 2.1 kernels __NR_syscall is missing so we define it here. */
#define __NR_syscall 0
+/*
+ * Newer kernel versions redefined __NR_pread and __NR_pwrite to
+ * __NR_pread64 and __NR_pwrite64. We use the new names but have
+ * to define them on our own for compiling against older kernels.
+ */
+#ifndef __NR_pread64
+# define __NR_pread64 __NR_pread
+#endif
+#ifndef __NR_pwrite64
+# define __NR_pwrite64 __NR_pwrite
+#endif
+
#undef SYS_ify
#define SYS_ify(syscall_name) __NR_##syscall_name
More information about the Libc-hacker
mailing list