mirror of https://github.com/mkerrisk/man-pages
e447e5bad3
Confirmed by experiment by mtk: $ cat siginfo_nonqueuing.c } while (0) static void grimReaper(int sig, siginfo_t *si, void *ucontext) { printf("caught signal %d\n", sig); printf(" si_pid=%ld, si_uid=%ld, si_status=%d\n", (long) si->si_pid, (long) si->si_uid, si->si_status); } static void child(int sleepTime, uid_t uid, int status) { switch (fork()) { case -1: errExit("fork"); case 0: sleep(sleepTime); if (geteuid() == 0) setuid(uid); printf("Child %ld with UID %ld exiting with status %d\n", (long) getpid(),(long) getuid(), status); exit(status); default: return; } } int main(int argc, char *argv[]) { struct sigaction sa; sigset_t blocking; sa.sa_sigaction = grimReaper; sa.sa_flags = SA_SIGINFO; sigemptyset(&sa.sa_mask); if (sigaction(SIGCHLD, &sa, NULL) == -1) errExit("sigaction"); sigemptyset(&blocking); sigaddset(&blocking, SIGCHLD); if (sigprocmask(SIG_BLOCK, &blocking, NULL) == -1) errExit("sigprocmask"); child(2, 20000, 20); child(3, 30000, 30); child(1, 10000, 10); sleep(5); if (sigprocmask(SIG_UNBLOCK, &blocking, NULL) == -1) errExit("sigprocmask"); exit(EXIT_SUCCESS); } $ ./siginfo_nonqueuing Child 4042 with UID 1000 exiting with status 10 Child 4040 with UID 1000 exiting with status 20 Child 4041 with UID 1000 exiting with status 30 caught signal 17 si_pid=4042, si_uid=1000, si_status=10 Cc: Oleg Nesterov <oleg@redhat.com> Cc: Lennart Poettering <lennart@poettering.net> Acked-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Michal Sekletar <msekleta@redhat.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com> |
||
---|---|---|
man1 | ||
man2 | ||
man3 | ||
man4 | ||
man5 | ||
man6 | ||
man7 | ||
man8 | ||
scripts | ||
Changes | ||
Changes.old | ||
Makefile | ||
README | ||
man-pages-5.02.Announce | ||
man-pages-5.02.lsm |
README
This package contains Linux man pages for sections 1 through 8. Some more information is given in the 'man-pages-x.y.Announce' file. Installing and uninstalling =========================== "make install" will copy these man pages to /usr/share/man/man[1-8]. To install to a path different from /usr, use "make install prefix=/install/path". "make remove" or "make uninstall" will remove any man page in this distribution from its destination. Use with caution, and remember to use "prefix" if desired, as with the "install" target. "make" or "make all" will perform "make uninstall" followed by "make install". Man page overlap and duplication ================================ Note that sometimes these pages are duplicates of pages also distributed in other packages. This has been reported about: man page also found in ------------------------------------- resolver.3 bind-utils, bind9utils resolv.conf.5 " passwd.5 shadow, passwd mailaddr.7 ? Copyrights ========== See the 'man-pages-x.y.Announce' file. Homepage ======== For much more about the Linux man-pages project, see http://www.kernel.org/doc/man-pages/index.html.