@@ -2743,6 +2743,8 @@ int os::vm_allocation_granularity() {
2743
2743
void linux_wrap_code (char * base, size_t size) {
2744
2744
static volatile jint cnt = 0 ;
2745
2745
2746
+ static_assert (sizeof (off_t ) == 8 , " Expected Large File Support in this file" );
2747
+
2746
2748
if (!UseOprofile) {
2747
2749
return ;
2748
2750
}
@@ -4990,14 +4992,14 @@ int os::open(const char *path, int oflag, int mode) {
4990
4992
oflag |= O_CLOEXEC;
4991
4993
#endif
4992
4994
4993
- int fd = ::open64 (path, oflag, mode);
4995
+ int fd = ::open (path, oflag, mode);
4994
4996
if (fd == -1 ) return -1 ;
4995
4997
4996
4998
// If the open succeeded, the file might still be a directory
4997
4999
{
4998
- struct stat64 buf64 ;
4999
- int ret = ::fstat64 (fd, &buf64 );
5000
- int st_mode = buf64 .st_mode ;
5000
+ struct stat buf ;
5001
+ int ret = ::fstat (fd, &buf );
5002
+ int st_mode = buf .st_mode ;
5001
5003
5002
5004
if (ret != -1 ) {
5003
5005
if ((st_mode & S_IFMT) == S_IFDIR) {
@@ -5034,17 +5036,17 @@ int os::open(const char *path, int oflag, int mode) {
5034
5036
int os::create_binary_file (const char * path, bool rewrite_existing) {
5035
5037
int oflags = O_WRONLY | O_CREAT;
5036
5038
oflags |= rewrite_existing ? O_TRUNC : O_EXCL;
5037
- return ::open64 (path, oflags, S_IREAD | S_IWRITE);
5039
+ return ::open (path, oflags, S_IREAD | S_IWRITE);
5038
5040
}
5039
5041
5040
5042
// return current position of file pointer
5041
5043
jlong os::current_file_offset (int fd) {
5042
- return (jlong)::lseek64 (fd, (off64_t )0 , SEEK_CUR);
5044
+ return (jlong)::lseek (fd, (off_t )0 , SEEK_CUR);
5043
5045
}
5044
5046
5045
5047
// move file pointer to the specified offset
5046
5048
jlong os::seek_to_file_offset (int fd, jlong offset) {
5047
- return (jlong)::lseek64 (fd, (off64_t )offset, SEEK_SET);
5049
+ return (jlong)::lseek (fd, (off_t )offset, SEEK_SET);
5048
5050
}
5049
5051
5050
5052
// This code originates from JDK's sysAvailable
@@ -5053,10 +5055,10 @@ jlong os::seek_to_file_offset(int fd, jlong offset) {
5053
5055
int os::available (int fd, jlong *bytes) {
5054
5056
jlong cur, end;
5055
5057
int mode;
5056
- struct stat64 buf64 ;
5058
+ struct stat buf ;
5057
5059
5058
- if (::fstat64 (fd, &buf64 ) >= 0 ) {
5059
- mode = buf64 .st_mode ;
5060
+ if (::fstat (fd, &buf ) >= 0 ) {
5061
+ mode = buf .st_mode ;
5060
5062
if (S_ISCHR (mode) || S_ISFIFO (mode) || S_ISSOCK (mode)) {
5061
5063
int n;
5062
5064
if (::ioctl (fd, FIONREAD, &n) >= 0 ) {
@@ -5065,11 +5067,11 @@ int os::available(int fd, jlong *bytes) {
5065
5067
}
5066
5068
}
5067
5069
}
5068
- if ((cur = ::lseek64 (fd, 0L , SEEK_CUR)) == -1 ) {
5070
+ if ((cur = ::lseek (fd, 0L , SEEK_CUR)) == -1 ) {
5069
5071
return 0 ;
5070
- } else if ((end = ::lseek64 (fd, 0L , SEEK_END)) == -1 ) {
5072
+ } else if ((end = ::lseek (fd, 0L , SEEK_END)) == -1 ) {
5071
5073
return 0 ;
5072
- } else if (::lseek64 (fd, cur, SEEK_SET) == -1 ) {
5074
+ } else if (::lseek (fd, cur, SEEK_SET) == -1 ) {
5073
5075
return 0 ;
5074
5076
}
5075
5077
*bytes = end - cur;
1 commit comments
openjdk-notifier[bot] commentedon Jul 29, 2024
Review
Issues