diff --git a/make/linux/makefiles/vm.make b/make/linux/makefiles/vm.make index d9db77744a44fb931a3b8864315945e0193ee472..3c3bd2e2d169f9406cd822995951e685bc88b7d3 100644 --- a/make/linux/makefiles/vm.make +++ b/make/linux/makefiles/vm.make @@ -107,6 +107,10 @@ CXXFLAGS/BYFILE = $(CXXFLAGS/$@) # File specific flags CXXFLAGS += $(CXXFLAGS/BYFILE) +# Large File Support +ifneq ($(LP64), 1) +CXXFLAGS/ostream.o += -D_FILE_OFFSET_BITS=64 +endif # ifneq ($(LP64), 1) # CFLAGS_WARN holds compiler options to suppress/enable warnings. CFLAGS += $(CFLAGS_WARN/BYFILE) diff --git a/make/solaris/makefiles/vm.make b/make/solaris/makefiles/vm.make index d57716c7aab822fae07b60451d91ee48e375d5f6..b3939fbe144fb3b0fd17f217d9502abe444a0af9 100644 --- a/make/solaris/makefiles/vm.make +++ b/make/solaris/makefiles/vm.make @@ -95,6 +95,10 @@ CXXFLAGS/BYFILE = $(CXXFLAGS/$@) # File specific flags CXXFLAGS += $(CXXFLAGS/BYFILE) +# Large File Support +ifneq ($(LP64), 1) +CXXFLAGS/ostream.o += -D_FILE_OFFSET_BITS=64 +endif # ifneq ($(LP64), 1) # CFLAGS_WARN holds compiler options to suppress/enable warnings. CFLAGS += $(CFLAGS_WARN) diff --git a/src/os/solaris/vm/os_solaris.inline.hpp b/src/os/solaris/vm/os_solaris.inline.hpp index 64515d93b91e0065b697e0ba76502fef29043ee1..4155c0f5b1c23badc0c6c6274574756ef77faa2b 100644 --- a/src/os/solaris/vm/os_solaris.inline.hpp +++ b/src/os/solaris/vm/os_solaris.inline.hpp @@ -89,7 +89,7 @@ inline int os::readdir_buf_size(const char *path) { inline struct dirent* os::readdir(DIR* dirp, dirent* dbuf) { assert(dirp != NULL, "just checking"); -#if defined(_LP64) || defined(_GNU_SOURCE) +#if defined(_LP64) || defined(_GNU_SOURCE) || _FILE_OFFSET_BITS==64 dirent* p; int status; @@ -98,9 +98,9 @@ inline struct dirent* os::readdir(DIR* dirp, dirent* dbuf) { return NULL; } else return p; -#else // defined(_LP64) || defined(_GNU_SOURCE) +#else // defined(_LP64) || defined(_GNU_SOURCE) || _FILE_OFFSET_BITS==64 return ::readdir_r(dirp, dbuf); -#endif // defined(_LP64) || defined(_GNU_SOURCE) +#endif // defined(_LP64) || defined(_GNU_SOURCE) || _FILE_OFFSET_BITS==64 } inline int os::closedir(DIR *dirp) {