RFR: 8229872: (fs) Increase buffer size used with getmntent

Vladimir Kempik vkempik at azul.com
Sun Sep 8 08:38:22 UTC 2019


Hello Alan.
Its not getmntent, its getline who can realloc
Regards, Vladimir

Alan Bateman <Alan.Bateman at oracle.com> 8 сентября 2019 г. 10:50:12 написал:

> On 06/09/2019 14:59, Vladimir Kempik wrote:
>> Hello
>>
>> Thanks for comments
>>
>> updated webrev including all mentioned things.
>>
>> http://cr.openjdk.java.net/~vkempik/8229872/webrev.08/
>>
> I think this is getting better. One thing that would help is a pointer
> to documentation that confirms that getmntent_r may realloc buf as I
> don't see this in the man page.
>
> Some specific comments on webrev.08
>
> LinuxFileSystem.java L98 - this sets buflen to maxLineSize before
> incrementing maxLineSize, should be "buflen = maxLineSize + 1". I'm also
> wondering if maxLineSize should be an int rather than a long as the
> native code has to cast it to a size_t or native int.
>
> LinuxNativeDispatcher.c - I would prefer not to have both buflen and
> bufLen. No one type will work for all cases so I think you have to case
> to size_t for malloc and int for getmntent_r.
>
> -Alan





More information about the nio-dev mailing list