patches/glibc/2.9/260-fadvise64_64.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jul 17 18:29:35 2011 +0200 (2011-07-17)
changeset 2926 d304c8a7bfa8
parent 1201 c9967a6e3b25
permissions -rw-r--r--
binutils: split binutils to backend/frontend, a-la cc_core

Move the actual binutils code to a backend function that builds the
required combo of build/host/target as requested by a frontend.

This split is currently a no-op, but is required for the upcoming
canadian-cross rework, where we'll be needing to build two binutils,
one for build/build/target, and one for build/host/target.

This applies to the three binutils:
- GNU binutils
- elf2flt
- sstrip

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
     1 Original patch from: gentoo/src/patchsets/glibc/2.9/1070_all_glibc-fadvise64_64.patch
     2 
     3 -= BEGIN original header =-
     4 ripped from Debian
     5 
     6 -= END original header =-
     7 
     8 diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/posix_fadvise.c glibc-2_9/sysdeps/unix/sysv/linux/posix_fadvise.c
     9 --- glibc-2_9.orig/sysdeps/unix/sysv/linux/posix_fadvise.c	2003-08-17 02:36:22.000000000 +0200
    10 +++ glibc-2_9/sysdeps/unix/sysv/linux/posix_fadvise.c	2009-02-02 22:00:58.000000000 +0100
    11 @@ -35,6 +35,19 @@
    12      return INTERNAL_SYSCALL_ERRNO (ret, err);
    13    return 0;
    14  #else
    15 +# ifdef __NR_fadvise64_64
    16 +  INTERNAL_SYSCALL_DECL (err);  
    17 +  int ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd,
    18 +			      __LONG_LONG_PAIR ((long) (offset >> 31),
    19 +						(long) offset),
    20 +			      __LONG_LONG_PAIR ((long) (len >> 31),
    21 +						(long) len),
    22 +			      advise);
    23 +  if (INTERNAL_SYSCALL_ERROR_P (ret, err))
    24 +    return INTERNAL_SYSCALL_ERRNO (ret, err);
    25 +  return 0;
    26 +# else
    27    return ENOSYS;
    28 +# endif
    29  #endif
    30  }