# HG changeset patch # User Andrew John Hughes # Date 1279700570 -3600 # Node ID 77b720a556d38276639692232bfcda9fe2c24416 # Parent f5cff4063cf393069c0c8e14324f86278adfdd1a Fix use of fstatat in NIO2 on architectures other than x86 and x86_64. 2010-07-20 Andrew John Hughes * overlays/nio2/openjdk/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c: Define _ATFILE_SOURCE to obtain fstatat64, regardless of architecture. diff -r f5cff4063cf3 -r 77b720a556d3 ChangeLog --- a/ChangeLog Fri Jul 16 16:56:44 2010 -0400 +++ b/ChangeLog Wed Jul 21 09:22:50 2010 +0100 @@ -1,7 +1,12 @@ +2010-07-20 Andrew John Hughes + + * overlays/nio2/openjdk/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c: + Define _ATFILE_SOURCE to obtain fstatat64, regardless of architecture. + 2010-07-15 Deepak Bhole * patches/openjdk/6678385.patch: Revert behaviour of isOverrideRedirect to - always return false, since XToolKit does not support isOverrideRedirect (as + always return false, since XToolKit does not support isOverrideRedirect (as upstream patch assumes). 2010-07-16 Deepak Bhole diff -r f5cff4063cf3 -r 77b720a556d3 overlays/nio2/openjdk/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c --- a/overlays/nio2/openjdk/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c Fri Jul 16 16:56:44 2010 -0400 +++ b/overlays/nio2/openjdk/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c Wed Jul 21 09:22:50 2010 +0100 @@ -23,6 +23,13 @@ * have any questions. */ +/** + * fstatat in glibc requires _ATFILE_SOURCE to be defined. + */ +#if defined(__linux__) +#define _ATFILE_SOURCE +#endif + #include #include #include @@ -102,32 +109,6 @@ static fdopendir_func* my_fdopendir_func = NULL; /** - * fstatat missing from glibc on Linux. Temporary workaround - * for x86/x64, will fail to compile on other architectures. - */ -#if defined(__linux__) && defined(__i386) -static int fstatat64_wrapper(int dfd, const char *path, - struct stat64 *statbuf, int flag) -{ - #ifndef __NR_fstatat64 - #define __NR_fstatat64 300 - #endif - return syscall(__NR_fstatat64, dfd, path, statbuf, flag); -} -#endif - -#if defined(__linux__) && defined(__x86_64__) -static int fstatat64_wrapper(int dfd, const char *path, - struct stat64 *statbuf, int flag) -{ - #ifndef __NR_newfstatat - #define __NR_newfstatat 262 - #endif - return syscall(__NR_newfstatat, dfd, path, statbuf, flag); -} -#endif - -/** * Call this to throw an internal UnixException when a system/library * call fails */ @@ -198,9 +179,9 @@ my_fdopendir_func = (fdopendir_func*) dlsym(RTLD_DEFAULT, "fdopendir"); #if defined(__linux__) - /* fstatat64 missing from glibc */ + /* fstatat64 from glibc requires a define */ if (my_fstatat64_func == NULL) - my_fstatat64_func = (fstatat64_func*)&fstatat64_wrapper; + my_fstatat64_func = (fstatat64_func*)&fstatat64; #endif }