本文整理汇总了Java中com.intellij.openapi.util.SystemInfo.isFreeBSD方法的典型用法代码示例。如果您正苦于以下问题:Java SystemInfo.isFreeBSD方法的具体用法?Java SystemInfo.isFreeBSD怎么用?Java SystemInfo.isFreeBSD使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.util.SystemInfo
的用法示例。
在下文中一共展示了SystemInfo.isFreeBSD方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPSCmd
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
public static String[] getPSCmd(boolean commandLineOnly, boolean isShortenCommand) {
String psCommand = "/bin/ps";
if (!new File(psCommand).isFile()) {
psCommand = "ps";
}
if (SystemInfo.isLinux) {
return new String[]{psCommand, "-e", "--format", commandLineOnly ? "%a" : "%P%p%a"};
}
else if (SystemInfo.isMac || SystemInfo.isFreeBSD) {
final String command = isShortenCommand ? "comm" : "command";
return new String[]{psCommand, "-ax", "-o", commandLineOnly ? command : "ppid,pid," + command};
}
else {
throw new IllegalStateException(System.getProperty("os.name") + " is not supported.");
}
}
示例2: JnaUnixMediatorImpl
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
private JnaUnixMediatorImpl() throws Exception {
if (SystemInfo.isLinux) {
if ("arm".equals(SystemInfo.OS_ARCH)) {
if (SystemInfo.is32Bit) {
myOffsets = LINUX_ARM;
} else {
throw new IllegalStateException("AArch64 architecture is not supported");
}
}
else if ("ppc".equals(SystemInfo.OS_ARCH)) {
myOffsets = SystemInfo.is32Bit ? LNX_PPC32 : LNX_PPC64;
}
else {
myOffsets = SystemInfo.is32Bit ? LINUX_32 : LINUX_64;
}
}
else if (SystemInfo.isMac | SystemInfo.isFreeBSD) {
myOffsets = SystemInfo.is32Bit ? BSD_32 : BSD_64;
}
else if (SystemInfo.isSolaris) {
myOffsets = SystemInfo.is32Bit ? SUN_OS_32 : SUN_OS_64;
}
else {
throw new IllegalStateException("Unsupported OS/arch: " + SystemInfo.OS_NAME + "/" + SystemInfo.OS_ARCH);
}
myLibC = (LibC)Native.loadLibrary("c", LibC.class);
myUid = myLibC.getuid();
myGid = myLibC.getgid();
}