8324539: Do not use LFS64 symbols in JDK libs

Reviewed-by: jwaters, erikj, mbaesken, alanb
This commit is contained in:
Magnus Ihse Bursie 2024-02-12 08:04:39 +00:00
parent efa071dd06
commit e5cb78cc88
29 changed files with 166 additions and 287 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -138,13 +138,13 @@ void os_getCmdlineAndUserInfo(JNIEnv *env, jobject jinfo, pid_t pid) {
char *args = NULL;
jstring cmdexe = NULL;
char fn[32];
struct stat64 stat_buf;
struct stat stat_buf;
/*
* Stat /proc/<pid> to get the user id
*/
snprintf(fn, sizeof fn, "/proc/%d", pid);
if (stat64(fn, &stat_buf) == 0) {
if (stat(fn, &stat_buf) == 0) {
unix_getUserInfo(env, jinfo, stat_buf.st_uid);
JNU_CHECK_EXCEPTION(env);
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -57,7 +57,7 @@ Java_sun_nio_ch_FileDispatcherImpl_transferFrom0(JNIEnv *env, jobject this,
jint srcFD = fdval(env, srcFDO);
jint dstFD = fdval(env, dstFDO);
off64_t offset = (off64_t)position;
loff_t offset = (loff_t)position;
size_t len = (size_t)count;
jlong n = my_copy_file_range_func(srcFD, NULL, dstFD, &offset, len, 0);
if (n < 0) {
@ -91,7 +91,7 @@ Java_sun_nio_ch_FileDispatcherImpl_transferTo0(JNIEnv *env, jobject this,
if (append == JNI_TRUE)
return IOS_UNSUPPORTED_CASE;
off64_t offset = (off64_t)position;
loff_t offset = (loff_t)position;
jlong n;
if (my_copy_file_range_func != NULL) {
size_t len = (size_t)count;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -165,7 +165,7 @@ JNIEXPORT jint JNICALL
Java_sun_nio_fs_LinuxNativeDispatcher_posix_1fadvise(JNIEnv* env, jclass this,
jint fd, jlong offset, jlong len, jint advice)
{
return posix_fadvise64((int)fd, (off64_t)offset, (off64_t)len, (int)advice);
return posix_fadvise((int)fd, (off_t)offset, (off_t)len, (int)advice);
}
// Copy all bytes from src to dst, within the kernel if possible,