8202116: (fc) FileChannel.map should ensure mapped region is backed by disk space

Alan Bateman Alan.Bateman at oracle.com
Tue Apr 24 06:32:07 UTC 2018


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.

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