RFR: 8229872: (fs) Increase buffer size used with getmntent
Alan Bateman
Alan.Bateman at oracle.com
Tue Sep 3 17:10:03 UTC 2019
On 03/09/2019 17:00, Vladimir Kempik wrote:
> Hello
>
> Please review v4 of the patch
>
> http://cr.openjdk.java.net/~vkempik/8229872/webrev.04/
>
> diffs vs v3:
> - rewind and getline moved to UnixNativeDispatcher
> - some error handling in rewind, but according to manpage&internet,
> ferror doesn’t set errno, so I can’t get details of error, only the
> fact if it happened or not.
> - bigger comment on getlinelen
>
I think the approach in this version is good, just need to agree a few
details.
I think it would be better if LinuxNativeDispatcher getmntent were
called with buf and buflen rather than maxLineLen. That is, use
NativeBuffers.getNativeBuffer to get a uffer to pass to the native
method. That keeps the native method simple, consistent with existing
code, and avoids the discussion about what happens when malloc fails.
In UnixNativeDispatcher then it would be nicer if rewind and getlinelen
were after the fopen/fclose functions so that all the FILE* functions
are together.
The return from getlinelen needs to be a jlong rather than a long.
Can you reformat the comments in both native functions to be consistent
with the existing code?
-Alan
More information about the nio-dev
mailing list