Accessing UNIX FileDescriptor id without reflection
Remi Forax
forax at univ-mlv.fr
Mon May 8 14:14:36 UTC 2017
I agree that a method getFd should be great, we will need this kind of value if we want to use Panama.
Did you try to serializing the FileDescriptor in memory and extract the int corresponding to the file descriptor ?
cheers,
Rémi
----- Mail original -----
> De: "Enrico Olivelli" <eolivelli at gmail.com>
> À: core-libs-dev at openjdk.java.net
> Envoyé: Lundi 8 Mai 2017 15:16:24
> Objet: Accessing UNIX FileDescriptor id without reflection
> Hi,
> I am trying to port a project (Apache BookKeeper) to Java9, actually
> this code uses reflection in order to access the 'fd' field of the
> FileDescriptor class.
>
> We have to access that ID in order to call low level native functions
>
> See
> https://github.com/apache/bookkeeper/blob/master/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/NativeIO.java
> # getSysFileDescriptor
>
> Is there any way to access the FD handle without using reflecttion ?
> If not, is it possibile to enhance the FileDescriptor API in order to
> given access to the internal "fd" field ?
>
> Thank you
>
> Enrico Olivelli
More information about the core-libs-dev
mailing list