private WindowsLibC wlibc() { return (WindowsLibC) libc(); }
private WindowsLibC wlibc() { return (WindowsLibC) libc(); }
private WindowsLibC wlibc() { return (WindowsLibC) libc(); }
private WindowsLibC wlibc() { return (WindowsLibC) libc(); }
private int checkFd(int fd) { // There might be a lighter-weight check, but we basically want to // make sure the FD is valid and the effective user can access it, // since we need to simulate fcntl semantics. return libc().fstat(fd, checkFdStat); }
public int pipe(int[] fds) { // TODO (nirvdrum 06-May-15) Maybe not hard-code the psize value. But figure out a sensible way to handle textmode. return ((WindowsLibC) libc())._pipe(fds, 512, 0); }
private int checkFd(int fd) { // There might be a lighter-weight check, but we basically want to // make sure the FD is valid and the effective user can access it, // since we need to simulate fcntl semantics. return libc().fstat(fd, checkFdStat); }
private int checkFd(int fd) { // There might be a lighter-weight check, but we basically want to // make sure the FD is valid and the effective user can access it, // since we need to simulate fcntl semantics. return libc().fstat(fd, checkFdStat); }
public int pipe(int[] fds) { // TODO (nirvdrum 06-May-15) Maybe not hard-code the psize value. But figure out a sensible way to handle textmode. return ((WindowsLibC) libc())._pipe(fds, 512, 0); }
public int pipe(int[] fds) { // TODO (nirvdrum 06-May-15) Maybe not hard-code the psize value. But figure out a sensible way to handle textmode. return ((WindowsLibC) libc())._pipe(fds, 512, 0); }
public int truncate(CharSequence path, long length) { // Windows doesn't have a native truncate() equivalent, but it does have a native ftruncate() equivalent. // In order to call the ftruncate() equivalent, we must convert a path to a FD. We do that by wrapping the // ftruncate() call with open() and close(). // Permissions are ignored since we're not using O_CREAT. int fd = libc().open(path, OpenFlags.O_WRONLY.intValue(), 0); if (fd == -1) { return -1; } if (libc().ftruncate(fd, length) == -1) { return -1; } if (libc().close(fd) == -1) { return -1; } // truncate() returns 0 on success. return 0; }
public int truncate(CharSequence path, long length) { // Windows doesn't have a native truncate() equivalent, but it does have a native ftruncate() equivalent. // In order to call the ftruncate() equivalent, we must convert a path to a FD. We do that by wrapping the // ftruncate() call with open() and close(). // Permissions are ignored since we're not using O_CREAT. int fd = libc().open(path, OpenFlags.O_WRONLY.intValue(), 0); if (fd == -1) { return -1; } if (libc().ftruncate(fd, length) == -1) { return -1; } if (libc().close(fd) == -1) { return -1; } // truncate() returns 0 on success. return 0; }
public int truncate(CharSequence path, long length) { // Windows doesn't have a native truncate() equivalent, but it does have a native ftruncate() equivalent. // In order to call the ftruncate() equivalent, we must convert a path to a FD. We do that by wrapping the // ftruncate() call with open() and close(). // Permissions are ignored since we're not using O_CREAT. int fd = libc().open(path, OpenFlags.O_WRONLY.intValue(), 0); if (fd == -1) { return -1; } if (libc().ftruncate(fd, length) == -1) { return -1; } if (libc().close(fd) == -1) { return -1; } // truncate() returns 0 on success. return 0; }
private int childResult(WindowsChildRecord child, boolean overlay) { if (child == null) return -1; if (overlay) { IntByReference exitCode = new IntByReference(); WindowsLibC libc = (WindowsLibC) libc(); HANDLE handle = child.getProcess(); libc.WaitForSingleObject(handle, WindowsLibC.INFINITE); libc.GetExitCodeProcess(handle, exitCode); libc.CloseHandle(handle); System.exit(exitCode.getValue()); } return child.getPid(); }
private int childResult(WindowsChildRecord child, boolean overlay) { if (child == null) return -1; if (overlay) { IntByReference exitCode = new IntByReference(); WindowsLibC libc = (WindowsLibC) libc(); HANDLE handle = child.getProcess(); libc.WaitForSingleObject(handle, WindowsLibC.INFINITE); libc.GetExitCodeProcess(handle, exitCode); libc.CloseHandle(handle); System.exit(exitCode.getValue()); } return child.getPid(); }
private int childResult(WindowsChildRecord child, boolean overlay) { if (child == null) return -1; if (overlay) { IntByReference exitCode = new IntByReference(); WindowsLibC libc = (WindowsLibC) libc(); HANDLE handle = child.getProcess(); libc.WaitForSingleObject(handle, WindowsLibC.INFINITE); libc.GetExitCodeProcess(handle, exitCode); libc.CloseHandle(handle); System.exit(exitCode.getValue()); } return child.getPid(); }
private int childResult(WindowsChildRecord child, boolean overlay) { if (child == null) return -1; if (overlay) { IntByReference exitCode = new IntByReference(); WindowsLibC libc = (WindowsLibC) libc(); HANDLE handle = child.getProcess(); libc.WaitForSingleObject(handle, WindowsLibC.INFINITE); libc.GetExitCodeProcess(handle, exitCode); libc.CloseHandle(handle); System.exit(exitCode.getValue()); } return child.getPid(); }