/* * Allocate two contiguous pages. The first one is for read-write, * another is for read-only.
*/
addr_rw = mmap(NULL, 2 * PAGE_SIZE, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); if (addr_rw == MAP_FAILED) {
err("mmap() failed: %m\n"); return 1;
}
/* A part of the buffer is read-only */
ret = sys_ptrace(PTRACE_PEEKSIGINFO, child, &arg,
addr_ro - sizeof(siginfo_t) * 2); if (ret != 2) {
err("sys_ptrace() returns %d (expected 2): %m\n", ret); goto out;
}
if (sys_ptrace(PTRACE_ATTACH, child, NULL, NULL) == -1) return 1;
waitpid(child, NULL, 0);
/* Dump signals one by one*/ if (check_direct_path(child, 0, 1)) goto out; /* Dump all signals for one call */ if (check_direct_path(child, 0, SIGNR)) goto out;
/* * Dump signal from the process-wide queue. * The number of signals is not multiple to the buffer size
*/ if (check_direct_path(child, 1, 3)) goto out;
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.