public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* Re: fadvise64_64 for s390-32.
@ 2003-12-05 18:50 Martin Schwidefsky
  0 siblings, 0 replies; 4+ messages in thread
From: Martin Schwidefsky @ 2003-12-05 18:50 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: libc-hacker


Hi Ulrich,

> > For s390-64 we do not have the problem because there fadvise64_64
> > has only 4 parameters.
>
> s390-64 does not need this syscall.  You're the third 64-bit platform
> maintainer making that mistake.  This is a new syscall which is only
> needed for 32-bit platforms.  If the kernel defines it for s390-64,
> remove it again, it's complete waste.

I wondered about it already. The current vanilla kernel don't have
a fadvise64_64 for s390* at all. I won't add it. The patch is still
valid, it is for s390-32 only.

blue skies,
   Martin


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

* Re: fadvise64_64 for s390-32.
  2003-12-05 17:48 Martin Schwidefsky
  2003-12-05 18:17 ` Ulrich Drepper
@ 2003-12-06  0:12 ` Ulrich Drepper
  1 sibling, 0 replies; 4+ messages in thread
From: Ulrich Drepper @ 2003-12-06  0:12 UTC (permalink / raw)
  To: Martin Schwidefsky; +Cc: libc-hacker

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

Martin Schwidefsky wrote:

> 2003-12-05  Martin Schwidefsky  <schwidefsky@de.ibm.com>
> 
> 	* sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c: New file.

Applied.

- -- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/0R7F2ijCOnn/RHQRAnBPAJ9/gJH7T+LnzTEcQ9cswp0JiPe1JgCgzW3p
HFu8+KOcS9DiwzwohEcJvLM=
=J7BM
-----END PGP SIGNATURE-----

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

* Re: fadvise64_64 for s390-32.
  2003-12-05 17:48 Martin Schwidefsky
@ 2003-12-05 18:17 ` Ulrich Drepper
  2003-12-06  0:12 ` Ulrich Drepper
  1 sibling, 0 replies; 4+ messages in thread
From: Ulrich Drepper @ 2003-12-05 18:17 UTC (permalink / raw)
  To: Martin Schwidefsky; +Cc: libc-hacker

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

Martin Schwidefsky wrote:

> For s390-64 we do not have the problem because there fadvise64_64
> has only 4 parameters.

s390-64 does not need this syscall.  You're the third 64-bit platform
maintainer making that mistake.  This is a new syscall which is only
needed for 32-bit platforms.  If the kernel defines it for s390-64,
remove it again, it's complete waste.

- -- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/0Mts2ijCOnn/RHQRAoo+AJ9SVxy0IkyqBUb/7tejQuSaz7PSxACaA7Vt
z2CSU7ZOL6E7E42+/z86UAc=
=5FiN
-----END PGP SIGNATURE-----

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

* fadvise64_64 for s390-32.
@ 2003-12-05 17:48 Martin Schwidefsky
  2003-12-05 18:17 ` Ulrich Drepper
  2003-12-06  0:12 ` Ulrich Drepper
  0 siblings, 2 replies; 4+ messages in thread
From: Martin Schwidefsky @ 2003-12-05 17:48 UTC (permalink / raw)
  To: libc-hacker

Hi,
on s390* system calls can have up to 5 paramters. The generic linux
implemenation of fadvise64_64 for 32 bit systems needs 6 parameters,
so we need to have a s390-32 special version of posix_fadvise64.c.
For s390-64 we do not have the problem because there fadvise64_64
has only 4 parameters.

blue skies,
  Martin.

2003-12-05  Martin Schwidefsky  <schwidefsky@de.ibm.com>

	* sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c: New file.

diff -urN libc/sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c libc-s390/sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c
--- libc/sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c	1970-01-01 01:00:00.000000000 +0100
+++ libc-s390/sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c	2003-11-13 15:31:40.000000000 +0100
@@ -0,0 +1,90 @@
+/* Copyright (C) 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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 <fcntl.h>
+#include <sysdep.h>
+#include <kernel-features.h>
+
+int __posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise);
+int __posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise);
+
+/* Advice the system about the expected behaviour of the application with
+   respect to the file associated with FD.  */
+
+struct fadvise64_64_layout
+{
+  int fd;
+  off64_t offset;
+  off64_t len;
+  int advise;
+};
+
+int
+__posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise)
+{
+#ifdef __NR_fadvise64_64
+  struct fadvise64_64_layout parameters;
+  INTERNAL_SYSCALL_DECL (err);
+  
+  parameters.fd = fd;
+  parameters.offset = offset;
+  parameters.len = len;
+  parameters.advise = advise;
+  int ret = INTERNAL_SYSCALL (fadvise64_64, err, 1, &parameters);
+  if (!INTERNAL_SYSCALL_ERROR_P (ret, err))
+    return 0;
+# ifndef __ASSUME_FADVISE64_64_SYSCALL
+  if (INTERNAL_SYSCALL_ERRNO (ret, err) != ENOSYS)
+# endif
+   return INTERNAL_SYSCALL_ERRNO (ret, err);
+#endif
+#ifndef __ASSUME_FADVISE64_64_SYSCALL
+# ifdef __NR_fadvise64
+  if (len != (off_t) len)
+    return EOVERFLOW;
+
+  INTERNAL_SYSCALL_DECL (err2);
+  int ret2 = INTERNAL_SYSCALL (fadvise64, err2, 5, fd,
+			       __LONG_LONG_PAIR ((long) (offset >> 32),
+						 (long) offset),
+			       (off_t) len, advise);
+  if (!INTERNAL_SYSCALL_ERROR_P (ret2, err2))
+    return 0;
+  return INTERNAL_SYSCALL_ERRNO (ret2, err2);
+# else
+  return ENOSYS;
+# endif
+#endif
+}
+
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3)
+
+int
+__posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise)
+{
+  return __posix_fadvise64_l64 (fd, offset, len, advise);
+}
+
+versioned_symbol (libc, __posix_fadvise64_l64, posix_fadvise64, GLIBC_2_3_3);
+compat_symbol (libc, __posix_fadvise64_l32, posix_fadvise64, GLIBC_2_2);
+#else
+strong_alias (__posix_fadvise64_l64, posix_fadvise64);
+#endif

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

end of thread, other threads:[~2003-12-06  0:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-05 18:50 fadvise64_64 for s390-32 Martin Schwidefsky
  -- strict thread matches above, loose matches on Subject: below --
2003-12-05 17:48 Martin Schwidefsky
2003-12-05 18:17 ` Ulrich Drepper
2003-12-06  0:12 ` 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).