void os_alarm_process(int pid)
{ if (pid <= 0) return;
kill(pid, SIGALRM);
}
void os_kill_process(int pid, int reap_child)
{ if (pid <= 0) return;
/* Block signals until child is reaped */
block_signals();
kill(pid, SIGKILL); if (reap_child)
CATCH_EINTR(waitpid(pid, NULL, __WALL));
unblock_signals();
}
/* Kill off a ptraced child by all means available. kill it normally first, * then PTRACE_KILL it, then PTRACE_CONT it in case it's in a run state from * which it can't exit directly.
*/
void os_kill_ptraced_process(int pid, int reap_child)
{ if (pid <= 0) return;
/* Block signals until child is reaped */
block_signals();
/* Try to reap a child */ return waitpid(-1, &status, WNOHANG);
}
/* Don't use the glibc version, which caches the result in TLS. It misses some * syscalls, and also breaks with clone(), which does not unshare the TLS.
*/
int os_getpid(void)
{ return syscall(__NR_getpid);
}
int os_map_memory(void *virt, int fd, unsignedlonglong off, unsignedlong len, int r, int w, int x)
{ void *loc; int prot;
void init_new_thread_signals(void)
{
set_handler(SIGSEGV);
set_handler(SIGTRAP);
set_handler(SIGFPE);
set_handler(SIGILL);
set_handler(SIGBUS);
signal(SIGHUP, SIG_IGN);
set_handler(SIGIO); /* We (currently) only use the child reaper IRQ in seccomp mode */ if (using_seccomp)
set_handler(SIGCHLD);
signal(SIGWINCH, SIG_IGN);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.