patches/glibc/2.9/260-fadvise64_64.patch
author Remy Bohmer <linux@bohmer.net>
Sun Jul 11 22:23:34 2010 +0200 (2010-07-11)
changeset 2021 3e52a1510f87
parent 1201 c9967a6e3b25
permissions -rw-r--r--
debug/gdb: Fix compilation for Mingw hosts

GDB requires PDcurses instead of ncurses while running on Windows.
So, do not always compile ncurses in case GDB needs to build.

PDcurses is provided by an earlier build step and is not described in
this file.

Signed-off-by: Remy Bohmer <linux@bohmer.net>
[yann.morin.1998@anciense.nib.fr: we already have a way to detect ncurses usage]
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  }