/** {@inheritDoc} */ @Override public int getFileSystemBlockSize(int fd) { FileStat stat = posix.fstat(fd); return Math.toIntExact(stat.blockSize()); }
/** {@inheritDoc} */ @Override public long getSparseFileSize(int fd) { FileStat stat = posix.fstat(fd); return stat.blocks() * 512; }
public FileStat fstat(int fd) { try { return posix.fstat(fd); } catch (UnsatisfiedLinkError ule) { return unimplementedNull(); } }
public FileStat fstat(int fd) { try { return posix.fstat(fd); } catch (UnsatisfiedLinkError ule) { return unimplementedNull(); } }
public int fstat(FileDescriptor descriptor, FileStat stat) { try { return posix.fstat(descriptor, stat); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); } }
public int fstat(int fd, FileStat stat) { return posix().fstat(fd, stat); }
public int fstat(int fd, FileStat stat) { return posix().fstat(fd, stat); }
public int fstat(FileDescriptor descriptor, FileStat stat) { try { return posix.fstat(descriptor, stat); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); } }
public FileStat fstat(int fd) { return posix().fstat(fd); }
public int fstat(FileDescriptor descriptor, FileStat stat) { return posix().fstat(descriptor, stat); }
public int fstat(int fd, FileStat stat) { try { return posix.fstat(fd, stat); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); } }
public FileStat fstat(int fd) { return posix().fstat(fd); }
public FileStat fstat(FileDescriptor descriptor) { try { return posix.fstat(descriptor); } catch (UnsatisfiedLinkError ule) { return unimplementedNull(); } }
public int fstat(int fd, FileStat stat) { return posix().fstat(fd, stat); }
public FileStat fstat(FileDescriptor descriptor) { return posix().fstat(descriptor); }
public FileStat fstat(int fd) { return posix().fstat(fd); }
public FileStat fstat(int fd) { try { return posix.fstat(fd); } catch (UnsatisfiedLinkError ule) { return unimplementedNull(); } }
public int fstat(FileDescriptor descriptor, FileStat stat) { try { return posix.fstat(descriptor, stat); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); } }
private void setup(FileDescriptor descriptor) { stat = getRuntime().getPosix().fstat(descriptor); }
public ChannelFD getWrapperFromFileno(int fileno) { ChannelFD fd = filenoMap.get(fileno); // This is a hack to get around stale ChannelFD that are closed when a descriptor is reused. // It appears to happen for openpty, and in theory could happen for any IO call that produces // a new descriptor. if (fd != null && !fd.ch.isOpen() && !isFake(fileno)) { FileStat stat = posix.allocateStat(); if (posix.fstat(fileno, stat) >= 0) { // found ChannelFD is closed, but actual fileno is open; clear it. filenoMap.remove(fileno); fd = null; } } return fd; }