8202116: (fc) FileChannel.map should ensure mapped region is backed by disk space
Thomas Stüfe
thomas.stuefe at gmail.com
Tue Apr 24 10:56:18 UTC 2018
Hi Alan,
On Tue, Apr 24, 2018 at 8:32 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> On 24/04/2018 06:50, Thomas Stüfe wrote:
>>
>> Hi Alan,
>>
>> not a full review.
>>
>> About defining SEEK_HOLE:
>>
>> +#ifndef SEEK_HOLE
>> +#define SEEK_HOLE 4
>> +#endif
>>
>> I always flinch a bit when I see defines like this. Are you sure this
>> won't clash on libc variants which do not define SEEK_HOLE and where 4
>> is relegated to something else? I know this is Linux only, but there
>> are other libc variants than glibc, for instance musl.
>>
>> How about this instead:
>>
>> #ifdef SEEK_HOLE
>> #define HAVE_SEEK_HOLE 1
>> #endif
>
> The issue is that SEEK_HOLE is only defined when compiling with _USE_GNU. We
> could #include <linux/fs.h> but I've tried to avoid that.
>
Okay. I was concerned about situations where we may run with a version
of glibc - or another libc - which uses the numerical value 4 for some
valid but different thing. E.g. as scetched in this patch proposal:
https://lwn.net/Articles/439719/
I did not do any further research though, so if you think there is no
risk, I am removing my objection.
Best Regards, Thomas
> Yes, we could compile the JNI method that uses this on other platforms, we
> just won't have a need for it just now.
>
> -Alan
More information about the nio-dev
mailing list