RFR: 8229872: (fs) Increase buffer size used with getmntent
Vladimir Kempik
vkempik at azul.com
Thu Sep 12 14:47:24 UTC 2019
Thanks Alan
Updated webrev with changed getmntent: http://cr.openjdk.java.net/~vkempik/8229872/webrev.10 <http://cr.openjdk.java.net/~vkempik/8229872/webrev.10>
Regards, Vladimir.
> 11 сент. 2019 г., в 22:42, Alan Bateman <Alan.Bateman at oracle.com> написал(а):
>
>
> On 11/09/2019 12:27, Vladimir Kempik wrote:
>> Hello
>>
>> Please take a look at v9 of webrev http://cr.openjdk.java.net/~vkempik/8229872/webrev.09/
>>
>> changes:
>> - getlinelen returns int and all linelens in java are ints now
>> - integer overflow check at the end of getlinelen
>> - getmntent_r now uses nativebuffer instead of malloc/free
>>
> The getmnent method doesn't look right, this is what you want:
>
> static int getmntent(long fp, UnixMountEntry entry, buflen) throws UnixException {
> NativeBuffer buffer = NativeBuffers.getNativeBuffer(buflen);
> try {
> return getmntent0(fp, UnixMountEntry, buffer.address(), buflen);
> } finally {
> buffer.release();
> }
> }
>
> This will simplify getMountEntries as you will call it with getmntent(fp, entry, maxLineSize+1).
>
> -Alan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20190912/91d43799/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20190912/91d43799/signature.asc>
More information about the nio-dev
mailing list