Java Code Examples for com.sun.jna.Platform#isOpenBSD()

The following examples show how to use com.sun.jna.Platform#isOpenBSD() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PtyUtil.java    From WebIDE-Backend with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
private static String getPlatformFolder() {
    String result;

    if (Platform.isMac()) {
        result = "macosx";
    } else if (Platform.isWindows()) {
        result = "win";
    } else if (Platform.isLinux()) {
        result = "linux";
    } else if (Platform.isFreeBSD()) {
        result = "freebsd";
    } else if (Platform.isOpenBSD()) {
        result = "openbsd";
    } else {
        throw new IllegalStateException("Platform " + Platform.getOSType() + " is not supported");
    }

    return result;
}
 
Example 2
Source File: PtyUtil.java    From WebIDE-Backend with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private static String getNativeLibraryName() {
    String result;

    if (Platform.isMac()) {
        result = "libpty.dylib";
    } else if (Platform.isWindows()) {
        result = "winpty.dll";
    } else if (Platform.isLinux() || Platform.isFreeBSD() || Platform.isOpenBSD()) {
        result = "libpty.so";
    } else {
        throw new IllegalStateException("Platform " + Platform.getOSType() + " is not supported");
    }

    return result;
}
 
Example 3
Source File: UnixDomainSocketLibrary.java    From buck with Apache License 2.0 5 votes vote down vote up
private static boolean isBsdish() {
  return Platform.isMac()
      || Platform.isFreeBSD()
      || Platform.isNetBSD()
      || Platform.isOpenBSD()
      || Platform.iskFreeBSD();
}
 
Example 4
Source File: CLibrary.java    From keycloak with Apache License 2.0 5 votes vote down vote up
private static CLibrary init() {
    if (Platform.isMac() || Platform.isOpenBSD()) {
        return (CLibrary) Native.loadLibrary("c", BSDCLibrary.class);
    } else if (Platform.isFreeBSD()) {
        return (CLibrary) Native.loadLibrary("c", FreeBSDCLibrary.class);
    } else if (Platform.isSolaris()) {
        return (CLibrary) Native.loadLibrary("c", SolarisCLibrary.class);
    } else if (Platform.isLinux()) {
        return (CLibrary) Native.loadLibrary("c", LinuxCLibrary.class);
    } else {
        return (CLibrary) Native.loadLibrary("c", CLibrary.class);
    }
}