patches/glibc/2.9/260-fadvise64_64.patch
author Esben Haabendal <eha@dev.doredevelopment.dk>
Wed Apr 06 20:15:23 2011 +0200 (2011-04-06)
changeset 2379 372245834071
parent 1201 c9967a6e3b25
permissions -rw-r--r--
libc/glibc: workaround for autoconf'ed define of caddr_t

When building canadian cross compiler, I have some trouble with
configure defining caddr_t as a macro, like:
#define caddr_t char *

When combined with the types.h where caddr_t is protected together
with daddr_t, the typedef of caddr_t breaks.

This patch works around it by protecting the caddr_t typedef
specifically.

I am uncertain as to the real cause and solution to this :-(

Signed-off-by: Esben Haabendal <eha@dev.doredevelopment.dk>
     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  }