8171906: Changes for 8148023 break AIX build

Reviewed-by: goetz, bpb
This commit is contained in:
Christoph Langer 2016-12-23 07:54:05 +01:00
parent 80340c2a34
commit 88f43b3b3c
3 changed files with 41 additions and 19 deletions

View File

@ -39,10 +39,6 @@
#include <dlfcn.h>
#include <limits.h>
#if defined(__solaris__) && !defined(NAME_MAX)
#define NAME_MAX MAXNAMLEN
#endif
#include "jni.h"
#include "jni_util.h"
#include "jlong.h"
@ -52,13 +48,26 @@
#include "java_io_FileSystem.h"
#include "java_io_UnixFileSystem.h"
#if defined(_ALLBSD_SOURCE)
#define dirent64 dirent
#define readdir64_r readdir_r
#define stat64 stat
#ifndef MACOSX
#define statvfs64 statvfs
#if defined(_AIX)
#if !defined(NAME_MAX)
#define NAME_MAX MAXNAMLEN
#endif
#define DIR DIR64
#define opendir opendir64
#define closedir closedir64
#endif
#if defined(__solaris__) && !defined(NAME_MAX)
#define NAME_MAX MAXNAMLEN
#endif
#if defined(_ALLBSD_SOURCE)
#define dirent64 dirent
#define readdir64_r readdir_r
#define stat64 stat
#ifndef MACOSX
#define statvfs64 statvfs
#endif
#endif
/* -- Field IDs -- */

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -62,15 +62,18 @@ isAsciiDigit(char c)
return c >= '0' && c <= '9';
}
#ifdef _ALLBSD_SOURCE
#define FD_DIR "/dev/fd"
#define dirent64 dirent
#define readdir64 readdir
#elif defined(_AIX)
/* AIX does not understand '/proc/self' - it requires the real process ID */
#define FD_DIR aix_fd_dir
#if defined(_AIX)
/* AIX does not understand '/proc/self' - it requires the real process ID */
#define FD_DIR aix_fd_dir
#define DIR DIR64
#define opendir opendir64
#define closedir closedir64
#elif defined(_ALLBSD_SOURCE)
#define FD_DIR "/dev/fd"
#define dirent64 dirent
#define readdir64 readdir
#else
#define FD_DIR "/proc/self/fd"
#define FD_DIR "/proc/self/fd"
#endif
int

View File

@ -81,6 +81,12 @@
#include "sun_nio_fs_UnixNativeDispatcher.h"
#if defined(_AIX)
#define DIR DIR64
#define opendir opendir64
#define closedir closedir64
#endif
/**
* Size of password or group entry when not available via sysconf
*/
@ -264,7 +270,11 @@ Java_sun_nio_fs_UnixNativeDispatcher_init(JNIEnv* env, jclass this)
my_unlinkat_func = (unlinkat_func*) dlsym(RTLD_DEFAULT, "unlinkat");
my_renameat_func = (renameat_func*) dlsym(RTLD_DEFAULT, "renameat");
my_futimesat_func = (futimesat_func*) dlsym(RTLD_DEFAULT, "futimesat");
#if defined(_AIX)
my_fdopendir_func = (fdopendir_func*) dlsym(RTLD_DEFAULT, "fdopendir64");
#else
my_fdopendir_func = (fdopendir_func*) dlsym(RTLD_DEFAULT, "fdopendir");
#endif
#if defined(FSTATAT64_SYSCALL_AVAILABLE)
/* fstatat64 missing from glibc */