yann@1: See http://sources.redhat.com/ml/libc-hacker/2003-12/msg00023.html yann@1: or http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c?cvsroot=glibc yann@1: yann@1: Should fix error yann@1: yann@1: ../sysdeps/unix/sysv/linux/posix_fadvise64.c: In function `__posix_fadvise64_l64': yann@1: ../sysdeps/unix/sysv/linux/posix_fadvise64.c:35: warning: implicit declaration of function `DECLARGS_6' yann@1: ../sysdeps/unix/sysv/linux/posix_fadvise64.c:35: error: parse error before "register" yann@1: ... yann@1: ../sysdeps/unix/sysv/linux/posix_fadvise64.c:35: error: parse error before "ASMFMT_6" yann@1: make[2]: *** [crosstool-0.28-rc34/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-2.3.3/build-glibc/io/posix_fadvise64.o] Error 1 yann@1: yann@1: yann@1: From: Martin Schwidefsky yann@1: Organization: IBM Deutschland GmbH yann@1: To: libc-hacker at sources dot redhat dot com yann@1: Subject: fadvise64_64 for s390-32. yann@1: Date: Fri, 5 Dec 2003 18:46:33 +0100 yann@1: yann@1: Hi, yann@1: on s390* system calls can have up to 5 paramters. The generic linux yann@1: implemenation of fadvise64_64 for 32 bit systems needs 6 parameters, yann@1: so we need to have a s390-32 special version of posix_fadvise64.c. yann@1: For s390-64 we do not have the problem because there fadvise64_64 yann@1: has only 4 parameters. yann@1: yann@1: blue skies, yann@1: Martin. yann@1: yann@1: 2003-12-05 Martin Schwidefsky yann@1: yann@1: * sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c: New file. yann@1: yann@1: 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 yann@1: --- libc/sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c 1970-01-01 01:00:00.000000000 +0100 yann@1: +++ libc-s390/sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c 2003-11-13 15:31:40.000000000 +0100 yann@1: @@ -0,0 +1,90 @@ yann@1: +/* Copyright (C) 2003 Free Software Foundation, Inc. yann@1: + This file is part of the GNU C Library. yann@1: + yann@1: + The GNU C Library is free software; you can redistribute it and/or yann@1: + modify it under the terms of the GNU Lesser General Public yann@1: + License as published by the Free Software Foundation; either yann@1: + version 2.1 of the License, or (at your option) any later version. yann@1: + yann@1: + The GNU C Library is distributed in the hope that it will be useful, yann@1: + but WITHOUT ANY WARRANTY; without even the implied warranty of yann@1: + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU yann@1: + Lesser General Public License for more details. yann@1: + yann@1: + You should have received a copy of the GNU Lesser General Public yann@1: + License along with the GNU C Library; if not, write to the Free yann@1: + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA yann@1: + 02111-1307 USA. */ yann@1: + yann@1: +#include yann@1: +#include yann@1: +#include yann@1: +#include yann@1: + yann@1: +int __posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise); yann@1: +int __posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise); yann@1: + yann@1: +/* Advice the system about the expected behaviour of the application with yann@1: + respect to the file associated with FD. */ yann@1: + yann@1: +struct fadvise64_64_layout yann@1: +{ yann@1: + int fd; yann@1: + off64_t offset; yann@1: + off64_t len; yann@1: + int advise; yann@1: +}; yann@1: + yann@1: +int yann@1: +__posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise) yann@1: +{ yann@1: +#ifdef __NR_fadvise64_64 yann@1: + struct fadvise64_64_layout parameters; yann@1: + INTERNAL_SYSCALL_DECL (err); yann@1: + yann@1: + parameters.fd = fd; yann@1: + parameters.offset = offset; yann@1: + parameters.len = len; yann@1: + parameters.advise = advise; yann@1: + int ret = INTERNAL_SYSCALL (fadvise64_64, err, 1, ¶meters); yann@1: + if (!INTERNAL_SYSCALL_ERROR_P (ret, err)) yann@1: + return 0; yann@1: +# ifndef __ASSUME_FADVISE64_64_SYSCALL yann@1: + if (INTERNAL_SYSCALL_ERRNO (ret, err) != ENOSYS) yann@1: +# endif yann@1: + return INTERNAL_SYSCALL_ERRNO (ret, err); yann@1: +#endif yann@1: +#ifndef __ASSUME_FADVISE64_64_SYSCALL yann@1: +# ifdef __NR_fadvise64 yann@1: + if (len != (off_t) len) yann@1: + return EOVERFLOW; yann@1: + yann@1: + INTERNAL_SYSCALL_DECL (err2); yann@1: + int ret2 = INTERNAL_SYSCALL (fadvise64, err2, 5, fd, yann@1: + __LONG_LONG_PAIR ((long) (offset >> 32), yann@1: + (long) offset), yann@1: + (off_t) len, advise); yann@1: + if (!INTERNAL_SYSCALL_ERROR_P (ret2, err2)) yann@1: + return 0; yann@1: + return INTERNAL_SYSCALL_ERRNO (ret2, err2); yann@1: +# else yann@1: + return ENOSYS; yann@1: +# endif yann@1: +#endif yann@1: +} yann@1: + yann@1: +#include yann@1: + yann@1: +#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3) yann@1: + yann@1: +int yann@1: +__posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise) yann@1: +{ yann@1: + return __posix_fadvise64_l64 (fd, offset, len, advise); yann@1: +} yann@1: + yann@1: +versioned_symbol (libc, __posix_fadvise64_l64, posix_fadvise64, GLIBC_2_3_3); yann@1: +compat_symbol (libc, __posix_fadvise64_l32, posix_fadvise64, GLIBC_2_2); yann@1: +#else yann@1: +strong_alias (__posix_fadvise64_l64, posix_fadvise64); yann@1: +#endif yann@1: