Skip to content

Commit 166ea12

Browse files
MBaeskenJoachim Kern
andcommitted
8365543: UnixNativeDispatcher.init should lookup open64at and stat64at on AIX
Co-authored-by: Joachim Kern <[email protected]> Reviewed-by: jkern, stuefe, goetz, alanb
1 parent e7ca8c7 commit 166ea12

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -343,22 +343,21 @@ Java_sun_nio_fs_UnixNativeDispatcher_init(JNIEnv* env, jclass this)
343343

344344
/* system calls that might not be available at run time */
345345

346-
#if defined(_ALLBSD_SOURCE)
347-
my_openat_func = (openat_func*) openat;
348-
my_fstatat_func = (fstatat_func*) fstatat;
349-
#else
350-
// Make sure we link to the 64-bit version of the functions
351-
my_openat_func = (openat_func*) dlsym(RTLD_DEFAULT, "openat64");
352-
my_fstatat_func = (fstatat_func*) dlsym(RTLD_DEFAULT, "fstatat64");
353-
#endif
354346
my_unlinkat_func = (unlinkat_func*) dlsym(RTLD_DEFAULT, "unlinkat");
355347
my_renameat_func = (renameat_func*) dlsym(RTLD_DEFAULT, "renameat");
356348
#if defined(_AIX)
357349
// Make sure we link to the 64-bit version of the function
350+
my_openat_func = (openat_func*) dlsym(RTLD_DEFAULT, "open64at");
351+
my_fstatat_func = (fstatat_func*) dlsym(RTLD_DEFAULT, "stat64at");
358352
my_fdopendir_func = (fdopendir_func*) dlsym(RTLD_DEFAULT, "fdopendir64");
359353
#elif defined(_ALLBSD_SOURCE)
354+
my_openat_func = (openat_func*) openat;
355+
my_fstatat_func = (fstatat_func*) fstatat;
360356
my_fdopendir_func = (fdopendir_func*) fdopendir;
361357
#else
358+
// Make sure we link to the 64-bit version of the functions
359+
my_openat_func = (openat_func*) dlsym(RTLD_DEFAULT, "openat64");
360+
my_fstatat_func = (fstatat_func*) dlsym(RTLD_DEFAULT, "fstatat64");
362361
my_fdopendir_func = (fdopendir_func*) dlsym(RTLD_DEFAULT, "fdopendir");
363362
#endif
364363

test/jdk/java/nio/file/DirectoryStream/SecureDS.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
/* @test
2525
* @bug 4313887 6838333 8343020 8357425
2626
* @summary Unit test for java.nio.file.SecureDirectoryStream
27-
* @requires (os.family == "linux" | os.family == "mac")
27+
* @requires (os.family == "linux" | os.family == "mac" | os.family == "aix")
2828
* @library .. /test/lib
2929
* @build jdk.test.lib.Platform
3030
* @run main SecureDS

0 commit comments

Comments
 (0)