static void closeFd(int fd) throws IOException { if (close(fd) == -1) { throw lastErrorToException(); } }
static long lseekFd(int fd, long fileOffset, int whence) throws IOException { long result = lseek(fd, fileOffset, whence); if (result == -1) { throw lastErrorToException(); } return result; }
static void msyncAddr(long addr, long length) throws IOException { if (msync(addr, length, 4) == -1) { // flags = MS_SYNC throw lastErrorToException(); } }
static void ftruncateFd(int fd, long length) throws IOException { if (ftruncate(fd, length) == -1) { throw lastErrorToException(); } }
static void closeFd(int fd) throws IOException { if (close(fd) == -1) { throw lastErrorToException(); } }
static void munmapAddr(long addr, long length) throws IOException { if (munmap(addr, length) == -1) { throw lastErrorToException(); } }
static long lseekFd(int fd, long fileOffset, int whence) throws IOException { long result = lseek(fd, fileOffset, whence); if (result == -1) { throw lastErrorToException(); } return result; }
static void ftruncateFd(int fd, long length) throws IOException { if (ftruncate(fd, length) == -1) { throw lastErrorToException(); } }
static void closeFd(int fd) throws IOException { if (close(fd) == -1) { throw lastErrorToException(); } }
static long mmapFd(long length, int prot, int flags, int fd, long offset) throws IOException { long ptr = mmap(0, length, prot, flags, fd, offset); if (ptr == -1) { throw lastErrorToException(); } return ptr; }
static void msyncAddr(long addr, long length) throws IOException { if (msync(addr, length, 4) == -1) { // flags = MS_SYNC throw lastErrorToException(); } }
static void munmapAddr(long addr, long length) throws IOException { if (munmap(addr, length) == -1) { throw lastErrorToException(); } }
static long lseekFd(int fd, long fileOffset, int whence) throws IOException { long result = lseek(fd, fileOffset, whence); if (result == -1) { throw lastErrorToException(); } return result; }
static void ftruncateFd(int fd, long length) throws IOException { if (ftruncate(fd, length) == -1) { throw lastErrorToException(); } }
static long mmapFd(long length, int prot, int flags, int fd, long offset) throws IOException { long ptr = mmap(0, length, prot, flags, fd, offset); if (ptr == -1) { throw lastErrorToException(); } return ptr; }
static void fdatasyncFd(int fd) throws IOException { int result; if (Platform.isMac()) { result = fcntl(fd, 51); // F_FULLFSYNC } else { result = fdatasync(fd); } if (result == -1) { throw lastErrorToException(); } }
static void fsyncFd(int fd) throws IOException { int result; if (Platform.isMac()) { result = fcntl(fd, 51); // F_FULLFSYNC } else { result = fsync(fd); } if (result == -1) { throw lastErrorToException(); } }
static void fsyncFd(int fd) throws IOException { int result; if (Platform.isMac()) { result = fcntl(fd, 51); // F_FULLFSYNC } else { result = fsync(fd); } if (result == -1) { throw lastErrorToException(); } }
static void fdatasyncFd(int fd) throws IOException { int result; if (Platform.isMac()) { result = fcntl(fd, 51); // F_FULLFSYNC } else { result = fdatasync(fd); } if (result == -1) { throw lastErrorToException(); } }
static void fsyncFd(int fd) throws IOException { int result; if (Platform.isMac()) { result = fcntl(fd, 51); // F_FULLFSYNC } else { result = fsync(fd); } if (result == -1) { throw lastErrorToException(); } }