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

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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

Re: [PATCH] pread/pwrite fix for s390-64.


> > 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 at de dot ibm dot 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
 


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