--- old/src/java.base/unix/native/libjava/TimeZone_md.c 2018-11-23 16:28:59.085714767 +0800 +++ new/src/java.base/unix/native/libjava/TimeZone_md.c 2018-11-23 16:28:58.509716216 +0800 @@ -56,6 +56,14 @@ #define fileclose fclose #endif +#if defined(_ALLBSD_SOURCE) + #ifndef MACOSX + #define stat64 stat + #define lstat64 lstat + #define fstat64 fstat + #endif +#endif + #if defined(__linux__) || defined(_ALLBSD_SOURCE) static const char *ETC_TIMEZONE_FILE = "/etc/timezone"; static const char *ZONEINFO_DIR = "/usr/share/zoneinfo"; @@ -115,7 +123,7 @@ findZoneinfoFile(char *buf, size_t size, const char *dir) { DIR *dirp = NULL; - struct stat statbuf; + struct stat64 statbuf; struct dirent *dp = NULL; char *pathname = NULL; int fd = -1; @@ -156,7 +164,7 @@ if (pathname == NULL) { break; } - RESTARTABLE(stat(pathname, &statbuf), res); + RESTARTABLE(stat64(pathname, &statbuf), res); if (res == -1) { break; } @@ -219,7 +227,7 @@ static char * getPlatformTimeZoneID() { - struct stat statbuf; + struct stat64 statbuf; char *tz = NULL; FILE *fp; int fd; @@ -256,7 +264,7 @@ /* * Next, try /etc/localtime to find the zone ID. */ - RESTARTABLE(lstat(DEFAULT_ZONEINFO_FILE, &statbuf), res); + RESTARTABLE(lstat64(DEFAULT_ZONEINFO_FILE, &statbuf), res); if (res == -1) { return NULL; } @@ -296,7 +304,7 @@ return NULL; } - RESTARTABLE(fstat(fd, &statbuf), res); + RESTARTABLE(fstat64(fd, &statbuf), res); if (res == -1) { (void) close(fd); return NULL; @@ -557,7 +565,7 @@ static char * getSolarisDefaultZoneID() { char *tz = NULL; - struct stat statbuf; + struct stat64 statbuf; size_t size; char *buf; int fd; @@ -597,7 +605,7 @@ } cleanupScf(h, snap, inst, pg, prop, val, tz); - RESTARTABLE(stat(DEFAULT_ZONEINFO_FILE, &statbuf), res); + RESTARTABLE(stat64(DEFAULT_ZONEINFO_FILE, &statbuf), res); if (res == -1) { return NULL; }