public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* Re: [PATCH] pread/pwrite fix for s390-64.
@ 2003-03-07 13:55 Martin Schwidefsky
  2003-03-07 17:53 ` Martin Schwidefsky
  2003-03-07 22:23 ` Ulrich Drepper
  0 siblings, 2 replies; 15+ messages in thread
From: Martin Schwidefsky @ 2003-03-07 13:55 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Roland McGrath, libc-hacker


> That's what C is for in syscalls.list argument string for the syscalls.

Ok, that explains the compile time error. To enable asynchronous cancel for
pread/pwrite/pread64/pwrite64 we still need the small C files to do the
LIBC_CANCEL_ASYNC/LIBC_CANCEL_RESET calls, don't we? I think the original
patch is valid.

blue skies,
   Martin


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] pread/pwrite fix for s390-64.
  2003-03-07 13:55 [PATCH] pread/pwrite fix for s390-64 Martin Schwidefsky
@ 2003-03-07 17:53 ` Martin Schwidefsky
  2003-03-07 22:23 ` Ulrich Drepper
  1 sibling, 0 replies; 15+ messages in thread
From: Martin Schwidefsky @ 2003-03-07 17:53 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Roland McGrath, libc-hacker


> That's what C is for in syscalls.list argument string for the syscalls.

Ok, that explains the compile time error. To enable asynchronous cancel for
pread/pwrite/pread64/pwrite64 we still need the small C files to do the
LIBC_CANCEL_ASYNC/LIBC_CANCEL_RESET calls, don't we? I think the original
patch is valid.

blue skies,
   Martin


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] pread/pwrite fix for s390-64.
  2003-03-07 13:55 [PATCH] pread/pwrite fix for s390-64 Martin Schwidefsky
  2003-03-07 17:53 ` Martin Schwidefsky
@ 2003-03-07 22:23 ` Ulrich Drepper
  1 sibling, 0 replies; 15+ messages in thread
From: Ulrich Drepper @ 2003-03-07 22:23 UTC (permalink / raw)
  To: Martin Schwidefsky; +Cc: Jakub Jelinek, Roland McGrath, libc-hacker

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Schwidefsky wrote:

> Ok, that explains the compile time error. To enable asynchronous cancel for
> pread/pwrite/pread64/pwrite64 we still need the small C files to do the
> LIBC_CANCEL_ASYNC/LIBC_CANCEL_RESET calls, don't we? I think the original
> patch is valid.

No, the cancelable syscalls are generated using <sysdep-cancel.h>
instead of <sysdep.h> which takes care of the rest.

- -- 
- --------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+aNy12ijCOnn/RHQRAqvgAKCtlEqN3iQgjuBrM7IdIbYXf3zx5ACaAnK6
X+UWL0Q5/Qi7ZsKl/aXwM5A=
=xzO5
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] pread/pwrite fix for s390-64.
  2003-03-11 19:38 Martin Schwidefsky
@ 2003-03-12  1:10 ` Ulrich Drepper
  0 siblings, 0 replies; 15+ messages in thread
From: Ulrich Drepper @ 2003-03-12  1:10 UTC (permalink / raw)
  To: Martin Schwidefsky; +Cc: libc-hacker

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Schwidefsky wrote:

> 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.

That's what I meant.  I've applied the patch.  Thanks,

- -- 
- --------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+bjtG2ijCOnn/RHQRAuYlAJ9gGXWcxrxxZmdPvkxHAvJ/Mn0s1gCeNvgz
uCe+JhpibzokIkwu/lOBQrg=
=v0Wc
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] pread/pwrite fix for s390-64.
@ 2003-03-11 19:38 Martin Schwidefsky
  2003-03-12  1:10 ` Ulrich Drepper
  0 siblings, 1 reply; 15+ messages in thread
From: Martin Schwidefsky @ 2003-03-11 19:38 UTC (permalink / raw)
  To: drepper; +Cc: jakub, roland, libc-hacker

> > 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
 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] pread/pwrite fix for s390-64.
@ 2003-03-11  9:30 Martin Schwidefsky
  0 siblings, 0 replies; 15+ messages in thread
From: Martin Schwidefsky @ 2003-03-11  9:30 UTC (permalink / raw)
  To: drepper; +Cc: jakub, roland, libc-hacker

> Actually, unless old kernels are completely out, sysdep.h should
> probably map the old and new syscall names.

Like this?

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
 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] pread/pwrite fix for s390-64.
  2003-03-10 19:25 ` Roland McGrath
@ 2003-03-11  7:42   ` Ulrich Drepper
  0 siblings, 0 replies; 15+ messages in thread
From: Ulrich Drepper @ 2003-03-11  7:42 UTC (permalink / raw)
  To: Roland McGrath; +Cc: Martin Schwidefsky, jakub, libc-hacker

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Roland McGrath wrote:
>>2003-03-10  Martin Schwidefsky  <schwidefsky@de.ibm.com>
>>
>>	* sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list: Correct system
>>	call names for pread and pwrite.
> 
> 
> Thanks, I've put in this change.

Actually, unless old kernels are completely out, sysdep.h should
probably map the old and new syscall names.

- -- 
- --------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+bOaX2ijCOnn/RHQRAsr4AJ9v1y4EzfSWC56C/o9SfQrjpNOFgACfXsNi
8P/YJ7K5cjuZrx7fI2S3TfA=
=bVNj
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] pread/pwrite fix for s390-64.
  2003-03-10 19:21 Martin Schwidefsky
@ 2003-03-10 19:25 ` Roland McGrath
  2003-03-11  7:42   ` Ulrich Drepper
  0 siblings, 1 reply; 15+ messages in thread
From: Roland McGrath @ 2003-03-10 19:25 UTC (permalink / raw)
  To: Martin Schwidefsky; +Cc: drepper, jakub, libc-hacker

> 2003-03-10  Martin Schwidefsky  <schwidefsky@de.ibm.com>
> 
> 	* sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list: Correct system
> 	call names for pread and pwrite.

Thanks, I've put in this change.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] pread/pwrite fix for s390-64.
@ 2003-03-10 19:21 Martin Schwidefsky
  2003-03-10 19:25 ` Roland McGrath
  0 siblings, 1 reply; 15+ messages in thread
From: Martin Schwidefsky @ 2003-03-10 19:21 UTC (permalink / raw)
  To: drepper; +Cc: jakub, roland, libc-hacker

> > Ok, that explains the compile time error. To enable asynchronous cancel for
> > pread/pwrite/pread64/pwrite64 we still need the small C files to do the
> > LIBC_CANCEL_ASYNC/LIBC_CANCEL_RESET calls, don't we? I think the original
> > patch is valid.
> 
> No, the cancelable syscalls are generated using <sysdep-cancel.h>
> instead of <sysdep.h> which takes care of the rest.

Makes sense. I went back to the drawing board and found the real cause for the
pread/pwrite problems on s390-64. It's one of these "how could this ever work" bugs.
The system call numbers of pread and pwrite are defined in linux/include/unistd.h
as __NR_pread64 and __NR_pwrite64. make-syscalls.sh could not find the system
call numbers for pread and pwrite and didn't emit the echos for the PSEUDO
implementation to sysd-syscalls. That's why the generic linux implemenations for
pread and pwrite gets used (and these are wrong for s390-64). The fix is really
simple: correct the system call names for pread/pwrite in syscalls.list.

blue skies,
   Martin

2003-03-10  Martin Schwidefsky  <schwidefsky@de.ibm.com>

	* sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list: Correct system
	call names for pread and pwrite.

diff -urN libc/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list libc-s390/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
--- libc/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list	Mon Mar 10 18:09:02 2003
+++ libc-s390/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list	Mon Mar 10 18:09:37 2003
@@ -2,8 +2,8 @@
 
 llseek		EXTRA	lseek		C:3	__libc_lseek	__lseek lseek __libc_lseek64 __llseek llseek __lseek64 lseek64
 lseek		llseek	-
-pread		-	pread		C:4	__libc_pread	__libc_pread64 __pread pread __pread64 pread64
-pwrite		-	pwrite		C:4	__libc_pwrite	__libc_pwrite64 __pwrite pwrite __pwrite64 pwrite64
+pread		-	pread64		C:4	__libc_pread	__libc_pread64 __pread pread __pread64 pread64
+pwrite		-	pwrite64	C:4	__libc_pwrite	__libc_pwrite64 __pwrite pwrite __pwrite64 pwrite64
 fstatfs		-	fstatfs		i:ip	__fstatfs	fstatfs fstatfs64 __fstatfs64
 statfs		-	statfs		i:sp	__statfs	statfs statfs64
 getpeername	-	getpeername	i:ipp	__getpeername	getpeername

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] pread/pwrite fix for s390-64.
  2003-03-03 10:20 Martin Schwidefsky
@ 2003-03-03 10:23 ` Jakub Jelinek
  0 siblings, 0 replies; 15+ messages in thread
From: Jakub Jelinek @ 2003-03-03 10:23 UTC (permalink / raw)
  To: Martin Schwidefsky; +Cc: Roland McGrath, libc-hacker

On Mon, Mar 03, 2003 at 11:18:29AM +0100, Martin Schwidefsky wrote:
> 
> > > Without the special version for pwrite64 I get an undefined reference
> > > to '__GI___pwrite64'. The alias for pwrite64 in syscalls.list doesn't
> > > seem to create an alias for __GI__pwrite64. This is the immediate
> > > problem I am facing.
> >
> > That should not be happening.  It should produce a weak_alias and
> > libc_hidden_weak for each of those names.
> 
> It does happen for s390-64. But this is a problem for itself. The pread/pwrite
> problem for s390-64 will not be solved by it. The pread/pwrite functions can't
> stay as direct system calls because the cancellation would be missing. The

That's what C is for in syscalls.list argument string for the syscalls.

	Jakub

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] pread/pwrite fix for s390-64.
@ 2003-03-03 10:20 Martin Schwidefsky
  2003-03-03 10:23 ` Jakub Jelinek
  0 siblings, 1 reply; 15+ messages in thread
From: Martin Schwidefsky @ 2003-03-03 10:20 UTC (permalink / raw)
  To: Roland McGrath; +Cc: libc-hacker


> > Without the special version for pwrite64 I get an undefined reference
> > to '__GI___pwrite64'. The alias for pwrite64 in syscalls.list doesn't
> > seem to create an alias for __GI__pwrite64. This is the immediate
> > problem I am facing.
>
> That should not be happening.  It should produce a weak_alias and
> libc_hidden_weak for each of those names.

It does happen for s390-64. But this is a problem for itself. The pread/pwrite
problem for s390-64 will not be solved by it. The pread/pwrite functions can't
stay as direct system calls because the cancellation would be missing. The
patch for s390-64 is still valid.

blue skies,
   Martin


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] pread/pwrite fix for s390-64.
  2003-02-28  8:53 Martin Schwidefsky
@ 2003-02-28 21:10 ` Roland McGrath
  0 siblings, 0 replies; 15+ messages in thread
From: Roland McGrath @ 2003-02-28 21:10 UTC (permalink / raw)
  To: Martin Schwidefsky; +Cc: libc-hacker

> Without the special version for pwrite64 I get an undefined reference
> to '__GI___pwrite64'. The alias for pwrite64 in syscalls.list doesn't
> seem to create an alias for __GI__pwrite64. This is the immediate
> problem I am facing. 

That should not be happening.  It should produce a weak_alias and
libc_hidden_weak for each of those names.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] pread/pwrite fix for s390-64.
@ 2003-02-28  8:53 Martin Schwidefsky
  2003-02-28 21:10 ` Roland McGrath
  0 siblings, 1 reply; 15+ messages in thread
From: Martin Schwidefsky @ 2003-02-28  8:53 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: libc-hacker


> What exactly is the problem?  Why can't you use the regular Linux
> version in sysdeps/unix/sysv/linux/pread.c etc?

Without the special version for pwrite64 I get an undefined reference
to '__GI___pwrite64'. The alias for pwrite64 in syscalls.list doesn't
seem to create an alias for __GI__pwrite64. This is the immediate
problem I am facing. The second problem is that a direct system call
doesn't do the asynchronous cancel. I can't use the regular Linux
version because they split the offset into two 32 bit arguments
which is wrong for s390-64.

blue skies,
   Martin


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] pread/pwrite fix for s390-64.
  2003-02-27 18:28 Martin Schwidefsky
@ 2003-02-27 19:05 ` Ulrich Drepper
  0 siblings, 0 replies; 15+ messages in thread
From: Ulrich Drepper @ 2003-02-27 19:05 UTC (permalink / raw)
  To: Martin Schwidefsky; +Cc: libc-hacker

Martin Schwidefsky wrote:
> Hi,
> the current cvs head does not compile on s390-64. I had to
> add files for pread, pread64, pwrite and pwrite64 in the
> s390-64 sysdeps folder to get the alias/hidden definitions
> right. I don't know if there is a better solution, this at least
> works.

What exactly is the problem?  Why can't you use the regular Linux
version in sysdeps/unix/sysv/linux/pread.c etc?

-- 
--------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] pread/pwrite fix for s390-64.
@ 2003-02-27 18:28 Martin Schwidefsky
  2003-02-27 19:05 ` Ulrich Drepper
  0 siblings, 1 reply; 15+ messages in thread
From: Martin Schwidefsky @ 2003-02-27 18:28 UTC (permalink / raw)
  To: libc-hacker

Hi,
the current cvs head does not compile on s390-64. I had to
add files for pread, pread64, pwrite and pwrite64 in the
s390-64 sysdeps folder to get the alias/hidden definitions
right. I don't know if there is a better solution, this at least
works.

blue skies,
  Martin.

2003-02-27  Martin Schwidefsky  <schwidefsky@de.ibm.com>

	* sysdeps/unix/sysv/linux/s390/s390-64/pread.c: New file.
	* sysdeps/unix/sysv/linux/s390/s390-64/pwrite.c: New file.
	* sysdeps/unix/sysv/linux/s390/s390-64/pread64.c: Replace empty file
	with real implementation.
	* sysdeps/unix/sysv/linux/s390/s390-64/pwrite64.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list: Remove pread
	and pwrite entries.
 
diff -urN libc/sysdeps/unix/sysv/linux/s390/s390-64/pread.c libc-s390/sysdeps/unix/sysv/linux/s390/s390-64/pread.c
--- libc/sysdeps/unix/sysv/linux/s390/s390-64/pread.c	Thu Jan  1 01:00:00 1970
+++ libc-s390/sysdeps/unix/sysv/linux/s390/s390-64/pread.c	Wed Feb 26 12:54:23 2003
@@ -0,0 +1,57 @@
+/* Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <unistd.h>
+
+#include <sysdep-cancel.h>
+#include <sys/syscall.h>
+#include <bp-checks.h>
+
+#include "kernel-features.h"
+
+ssize_t
+__libc_pread (fd, buf, count, offset)
+     int fd;
+     void *buf;
+     size_t count;
+     off_t offset;
+{
+  ssize_t result;
+
+  if (SINGLE_THREAD_P)
+    {
+      result = INLINE_SYSCALL (pread64, 4, fd, CHECK_N (buf, count), count,
+                                offset);
+      return result;
+    }
+
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  result = INLINE_SYSCALL (pread64, 4, fd, CHECK_N (buf, count), count,
+                           offset);
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
+}
+
+strong_alias (__libc_pread, __pread)
+weak_alias (__libc_pread, pread)
diff -urN libc/sysdeps/unix/sysv/linux/s390/s390-64/pread64.c libc-s390/sysdeps/unix/sysv/linux/s390/s390-64/pread64.c
--- libc/sysdeps/unix/sysv/linux/s390/s390-64/pread64.c	Fri Mar 16 10:48:35 2001
+++ libc-s390/sysdeps/unix/sysv/linux/s390/s390-64/pread64.c	Wed Feb 26 13:03:20 2003
@@ -1 +1,57 @@
-/* Empty since the pread syscall is equivalent.  */
+/* Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <unistd.h>
+
+#include <sysdep-cancel.h>
+#include <sys/syscall.h>
+#include <bp-checks.h>
+
+#include "kernel-features.h"
+
+ssize_t
+__libc_pread64 (fd, buf, count, offset)
+     int fd;
+     void *buf;
+     size_t count;
+     off64_t offset;
+{
+  ssize_t result;
+
+  if (SINGLE_THREAD_P)
+    {
+      result = INLINE_SYSCALL (pread64, 4, fd, CHECK_N (buf, count), count,
+                                offset);
+      return result;
+    }
+
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  result = INLINE_SYSCALL (pread64, 4, fd, CHECK_N (buf, count), count,
+                           offset);
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
+}
+
+weak_alias (__libc_pread64, __pread64)
+weak_alias (__libc_pread64, pread64)
diff -urN libc/sysdeps/unix/sysv/linux/s390/s390-64/pwrite.c libc-s390/sysdeps/unix/sysv/linux/s390/s390-64/pwrite.c
--- libc/sysdeps/unix/sysv/linux/s390/s390-64/pwrite.c	Thu Jan  1 01:00:00 1970
+++ libc-s390/sysdeps/unix/sysv/linux/s390/s390-64/pwrite.c	Wed Feb 26 12:54:23 2003
@@ -0,0 +1,58 @@
+/* Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <unistd.h>
+
+#include <sysdep-cancel.h>
+#include <sys/syscall.h>
+#include <bp-checks.h>
+
+#include "kernel-features.h"
+
+ssize_t
+__libc_pwrite (fd, buf, count, offset)
+     int fd;
+     const void *buf;
+     size_t count;
+     off_t offset;
+{
+  ssize_t result;
+
+  if (SINGLE_THREAD_P)
+    {
+      result = INLINE_SYSCALL (pwrite64, 4, fd, CHECK_N (buf, count), count,
+                                offset);
+      return result;
+    }
+
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  result = INLINE_SYSCALL (pwrite64, 4, fd, CHECK_N (buf, count), count,
+                            offset);
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
+}
+
+strong_alias (__libc_pwrite, __pwrite)
+weak_alias (__libc_pwrite, pwrite)
+
diff -urN libc/sysdeps/unix/sysv/linux/s390/s390-64/pwrite64.c libc-s390/sysdeps/unix/sysv/linux/s390/s390-64/pwrite64.c
--- libc/sysdeps/unix/sysv/linux/s390/s390-64/pwrite64.c	Fri Mar 16 10:48:47 2001
+++ libc-s390/sysdeps/unix/sysv/linux/s390/s390-64/pwrite64.c	Wed Feb 26 13:03:35 2003
@@ -1 +1,58 @@
-/* Empty since the pwrite syscall is equivalent.  */
+/* Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <unistd.h>
+
+#include <sysdep-cancel.h>
+#include <sys/syscall.h>
+#include <bp-checks.h>
+
+#include "kernel-features.h"
+
+ssize_t
+__libc_pwrite64 (fd, buf, count, offset)
+     int fd;
+     const void *buf;
+     size_t count;
+     off64_t offset;
+{
+  ssize_t result;
+
+  if (SINGLE_THREAD_P)
+    {
+      result = INLINE_SYSCALL (pwrite64, 4, fd, CHECK_N (buf, count), count,
+                                offset);
+      return result;
+    }
+
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  result = INLINE_SYSCALL (pwrite64, 4, fd, CHECK_N (buf, count), count,
+                            offset);
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
+}
+
+weak_alias (__libc_pwrite64, __pwrite64)
+weak_alias (__libc_pwrite64, pwrite64)
+
diff -urN libc/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list libc-s390/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
--- libc/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list	Fri Feb  7 09:09:14 2003
+++ libc-s390/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list	Wed Feb 26 12:54:46 2003
@@ -2,8 +2,6 @@
 
 llseek		EXTRA	lseek		C:3	__libc_lseek	__lseek lseek __libc_lseek64 __llseek llseek __lseek64 lseek64
 lseek		llseek	-
-pread		-	pread		C:4	__libc_pread	__libc_pread64 __pread pread __pread64 pread64
-pwrite		-	pwrite		C:4	__libc_pwrite	__libc_pwrite64 __pwrite pwrite __pwrite64 pwrite64
 fstatfs		-	fstatfs		i:ip	__fstatfs	fstatfs fstatfs64 __fstatfs64
 statfs		-	statfs		i:sp	__statfs	statfs statfs64
 getpeername	-	getpeername	i:ipp	__getpeername	getpeername

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2003-03-11 19:38 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-07 13:55 [PATCH] pread/pwrite fix for s390-64 Martin Schwidefsky
2003-03-07 17:53 ` Martin Schwidefsky
2003-03-07 22:23 ` Ulrich Drepper
  -- strict thread matches above, loose matches on Subject: below --
2003-03-11 19:38 Martin Schwidefsky
2003-03-12  1:10 ` Ulrich Drepper
2003-03-11  9:30 Martin Schwidefsky
2003-03-10 19:21 Martin Schwidefsky
2003-03-10 19:25 ` Roland McGrath
2003-03-11  7:42   ` Ulrich Drepper
2003-03-03 10:20 Martin Schwidefsky
2003-03-03 10:23 ` Jakub Jelinek
2003-02-28  8:53 Martin Schwidefsky
2003-02-28 21:10 ` Roland McGrath
2003-02-27 18:28 Martin Schwidefsky
2003-02-27 19:05 ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).