本文整理了Java中jnr.posix.POSIX.kill()
方法的一些代码示例,展示了POSIX.kill()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。POSIX.kill()
方法的具体详情如下:
包路径:jnr.posix.POSIX
类名称:POSIX
方法名:kill
暂无
代码示例来源:origin: apache/incubator-pinot
private void sendSignalToProcess(Process process, Signal signal) {
int processPid = getProcessPid(process);
if (processPid != -1) {
LOGGER.info("Sending signal {} to process {}", signal.intValue(), processPid);
POSIXFactory.getNativePOSIX().kill(processPid, signal.intValue());
}
}
代码示例来源:origin: proofpoint/platform
public static boolean exists(int pid)
{
if (System.getProperty("os.name").startsWith("Windows")) {
return false;
}
else {
return getPosix().kill(pid, 0) == 0;
}
}
代码示例来源:origin: com.github.jnr/jnr-process
public int killProcessGroup(Signal sig) {
return posix.kill(-pid, sig.intValue());
}
代码示例来源:origin: io.prestosql.cassandra/cassandra-driver
public int kill(int pid, int signal) {
return posix().kill(pid, signal);
}
代码示例来源:origin: com.github.jnr/jnr-posix
public int kill(long pid, int signal) {
return posix().kill(pid, signal);
}
代码示例来源:origin: com.github.jnr/jnr-process
public int kill(Signal sig) {
return posix.kill(pid, sig.intValue());
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-driver
public int kill(int pid, int signal) {
try { return posix.kill(pid, signal); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
}
代码示例来源:origin: com.cloudbees.util/jnr-unixsocket-nodep
public int kill(int pid, int signal) {
return posix().kill(pid, signal);
}
代码示例来源:origin: com.github.jnr/jnr-posix
public int kill(long pid, int signal) {
try { return posix.kill(pid, signal); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
}
代码示例来源:origin: io.prestosql.cassandra/cassandra-driver
public int kill(int pid, int signal) {
try { return posix.kill(pid, signal); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
}
代码示例来源:origin: com.cloudbees.util/jnr-unixsocket-nodep
public int kill(int pid, int signal) {
try { return posix.kill(pid, signal); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-driver
public int kill(int pid, int signal) {
return posix().kill(pid, signal);
}
代码示例来源:origin: org.python/jython
@Hide(value=OS.NT, posixImpl = PosixImpl.JAVA)
public static void kill(int pid, int sig) {
if (posix.kill(pid, sig) < 0) {
throw errorFromErrno();
}
}
代码示例来源:origin: org.jruby/jruby-core
@Override
public void destroy() {
runtime.getPosix().kill((int)finalPid, Signal.SIGTERM.intValue());
}
代码示例来源:origin: org.jruby/jruby-complete
@Override
public void destroy() {
runtime.getPosix().kill((int)finalPid, Signal.SIGTERM.intValue());
}
代码示例来源:origin: proofpoint/platform
static void kill(int pid, boolean graceful)
{
if (System.getProperty("os.name").startsWith("Windows")) {
List<String> args = ImmutableList.of("taskkill", "/f", "/pid", Integer.toString(pid));
try {
new ProcessBuilder(args)
.redirectInput(Redirect.from(NULL_FILE))
.redirectOutput(Redirect.INHERIT)
.redirectError(Redirect.INHERIT)
.start()
.waitFor();
}
catch (IOException | InterruptedException ignored) {
}
}
else {
int signal = new Signal(graceful ? "TERM" : "KILL").getNumber();
getPosix().kill(pid, signal);
}
}
代码示例来源:origin: org.jruby/jruby-core
checkErrno(runtime, posix.kill(processGroupKill ? -pid : pid, signal));
代码示例来源:origin: org.jruby/jruby-complete
checkErrno(runtime, posix.kill(processGroupKill ? -pid : pid, signal));
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
checkErrno(runtime, posix.kill(processGroupKill ? -pid : pid, signal));
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
checkErrno(runtime, posix.kill(processGroupKill ? -pid : pid, signal));
内容来源于网络,如有侵权,请联系作者删除!