--- a/src/java.base/unix/classes/sun/nio/fs/UnixChannelFactory.java Thu May 28 00:44:10 2020 +++ b/src/java.base/unix/classes/sun/nio/fs/UnixChannelFactory.java Wed May 20 19:29:11 2020 @@ -103,7 +103,17 @@ } } + /** + * Constructs a file channel from an existing (open) file descriptor + */ + static FileChannel newFileChannel(int fd, String path, boolean reading, boolean writing) { + FileDescriptor fdObj = new FileDescriptor(); + fdAccess.set(fdObj, fd); + return FileChannelImpl.open(fdObj, path, reading, writing, false, null); + } + + /** * Constructs a file channel by opening a file using a dfd/path pair */ static FileChannel newFileChannel(int dfd,