mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8229872: (fs) Increase buffer size used with getmntent
Dynamically allocate memory for getmntent Reviewed-by: alanb
This commit is contained in:
parent
628283fe53
commit
67ad501e5b
5 changed files with 89 additions and 9 deletions
|
@ -51,7 +51,17 @@ class LinuxNativeDispatcher extends UnixNativeDispatcher {
|
|||
/**
|
||||
* int getmntent(FILE *fp, struct mnttab *mp, int len);
|
||||
*/
|
||||
static native int getmntent(long fp, UnixMountEntry entry)
|
||||
|
||||
static int getmntent(long fp, UnixMountEntry entry, int buflen) throws UnixException {
|
||||
NativeBuffer buffer = NativeBuffers.getNativeBuffer(buflen);
|
||||
try {
|
||||
return getmntent0(fp, entry, buffer.address(), buflen);
|
||||
} finally {
|
||||
buffer.release();
|
||||
}
|
||||
}
|
||||
|
||||
static native int getmntent0(long fp, UnixMountEntry entry, long buffer, int bufLen)
|
||||
throws UnixException;
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue