Skip to content
Snippets Groups Projects
Commit 97ed09e0 authored by Martin Buchholz's avatar Martin Buchholz
Browse files

8165643: SecureDirectoryStream doesn't work on linux non-x86

Reviewed-by: alanb
parent 1e5d8827
No related branches found
No related tags found
No related merge requests found
......@@ -52,6 +52,10 @@
#include <strings.h>
#endif
#ifdef __linux__
#include <sys/syscall.h>
#endif
#if defined(__linux__) || defined(_AIX)
#include <string.h>
#endif
......@@ -157,14 +161,11 @@ static int fstatat64_wrapper(int dfd, const char *path,
}
#endif
#if defined(__linux__) && defined(__x86_64__)
#if defined(__linux__) && defined(_LP64) && defined(__NR_newfstatat)
#define FSTATAT64_SYSCALL_AVAILABLE
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
......
......@@ -45,6 +45,9 @@ public class SecureDS {
DirectoryStream<Path> stream = newDirectoryStream(dir);
stream.close();
if (!(stream instanceof SecureDirectoryStream)) {
if (System.getProperty("os.name").equals("Linux"))
throw new AssertionError(
"SecureDirectoryStream not supported.");
System.out.println("SecureDirectoryStream not supported.");
return;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment