public long posix_spawnp(String path, Collection<? extends SpawnFileAction> fileActions, Collection<? extends SpawnAttribute> spawnAttributes, Collection<? extends CharSequence> argv, Collection<? extends CharSequence> envp) { try { return posix.posix_spawnp(path, fileActions, spawnAttributes, argv, envp); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); } }
@Override public String strerror(int code) { try {return posix.strerror(code); } catch (UnsatisfiedLinkError ule) { return unimplementedString(); } }
public int waitpid(int pid, int[] status, int flags) { return waitpid((long)pid, status, flags); }
@Override public Timeval allocateTimeval() { try {return posix.allocateTimeval(); } catch (UnsatisfiedLinkError ule) { return unimplementedNull(); } }
public boolean isatty(FileDescriptor descriptor) { try { return posix.isatty(descriptor); } catch (UnsatisfiedLinkError ule) { return unimplementedBool(); } }
static POSIX loadPOSIX(POSIXHandler handler, boolean useNativePOSIX) { POSIX posix = null; if (useNativePOSIX) { try { posix = loadNativePOSIX(handler); posix = posix != null ? new CheckedPOSIX(posix, handler) : null; // ENEBO: Should printing be done through a handler+log method? if (handler.isVerbose()) { if (posix != null) { System.err.println("Successfully loaded native POSIX impl."); } else { System.err.println("Failed to load native POSIX impl; falling back on Java impl. Unsupported OS."); } } } catch (Throwable t) { if (handler.isVerbose()) { System.err.println("Failed to load native POSIX impl; falling back on Java impl. Stacktrace follows."); t.printStackTrace(); } } } if (posix == null) { posix = getJavaPOSIX(handler); } return posix; }
public int kill(int pid, int signal) { return kill((long) pid, signal); }
public FileStat allocateStat() { try { return posix.allocateStat(); } catch (UnsatisfiedLinkError ule) { return unimplementedNull(); } }
public boolean isatty(FileDescriptor descriptor) { try { return posix.isatty(descriptor); } catch (UnsatisfiedLinkError ule) { return unimplementedBool(); } }
static POSIX loadPOSIX(POSIXHandler handler, boolean useNativePOSIX) { POSIX posix = null; if (useNativePOSIX) { try { posix = loadNativePOSIX(handler); posix = posix != null ? new CheckedPOSIX(posix, handler) : null; // ENEBO: Should printing be done through a handler+log method? if (handler.isVerbose()) { if (posix != null) { System.err.println("Successfully loaded native POSIX impl."); } else { System.err.println("Failed to load native POSIX impl; falling back on Java impl. Unsupported OS."); } } } catch (Throwable t) { if (handler.isVerbose()) { System.err.println("Failed to load native POSIX impl; falling back on Java impl. Stacktrace follows."); t.printStackTrace(); } } } if (posix == null) { posix = getJavaPOSIX(handler); } return posix; }
@Override public int gettimeofday(Timeval tv) { try {return posix.gettimeofday(tv); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); } } }
public String getlogin() { try { return posix.getlogin(); } catch (UnsatisfiedLinkError ule) { return unimplementedNull(); } }
public boolean isatty(FileDescriptor descriptor) { try { return posix.isatty(descriptor); } catch (UnsatisfiedLinkError ule) { return unimplementedBool(); } }
static POSIX loadPOSIX(POSIXHandler handler, boolean useNativePOSIX) { POSIX posix = null; if (useNativePOSIX) { try { posix = loadNativePOSIX(handler); posix = posix != null ? new CheckedPOSIX(posix, handler) : null; // ENEBO: Should printing be done through a handler+log method? if (handler.isVerbose()) { if (posix != null) { System.err.println("Successfully loaded native POSIX impl."); } else { System.err.println("Failed to load native POSIX impl; falling back on Java impl. Unsupported OS."); } } } catch (Throwable t) { if (handler.isVerbose()) { System.err.println("Failed to load native POSIX impl; falling back on Java impl. Stacktrace follows."); t.printStackTrace(); } } } if (posix == null) { posix = getJavaPOSIX(handler); } return posix; }
public String setlocale(int category, String locale) { try {return posix.setlocale(category, locale); } catch (UnsatisfiedLinkError ule) { return unimplementedString(); } }
public int waitpid(int pid, int[] status, int flags) { return waitpid((long)pid, status, flags); }
public long posix_spawnp(String path, Collection<? extends SpawnFileAction> fileActions, Collection<? extends SpawnAttribute> spawnAttributes, Collection<? extends CharSequence> argv, Collection<? extends CharSequence> envp) { try { return posix.posix_spawnp(path, fileActions, spawnAttributes, argv, envp); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); } }
public Pointer environ() { try { return posix.environ(); } catch (UnsatisfiedLinkError ule) { return unimplementedNull(); } }
public boolean isatty(FileDescriptor descriptor) { try { return posix.isatty(descriptor); } catch (UnsatisfiedLinkError ule) { return unimplementedBool(); } }
static POSIX loadPOSIX(POSIXHandler handler, boolean useNativePOSIX) { POSIX posix = null; if (useNativePOSIX) { try { posix = loadNativePOSIX(handler); posix = posix != null ? new CheckedPOSIX(posix, handler) : null; // ENEBO: Should printing be done through a handler+log method? if (handler.isVerbose()) { if (posix != null) { System.err.println("Successfully loaded native POSIX impl."); } else { System.err.println("Failed to load native POSIX impl; falling back on Java impl. Unsupported OS."); } } } catch (Throwable t) { if (handler.isVerbose()) { System.err.println("Failed to load native POSIX impl; falling back on Java impl. Stacktrace follows."); t.printStackTrace(); } } } if (posix == null) { posix = getJavaPOSIX(handler); } return posix; }