A mirror of Man pages
Go to file
Michal Sekletar e447e5bad3 signal.7: Clarify that siginfo_t isn't changed on coalescing
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>
2019-07-13 11:44:12 -06:00
man1 intro.1, execve.2, getcontext.3, passwd.5, bpf-helpers.7: wfix 2019-05-06 14:49:18 -05:00
man2 execve.2: tfix 2019-07-13 10:15:48 -06:00
man3 dlopen.3: wfix: consistently use "object" rather than "library" 2019-07-03 13:59:36 +02:00
man4 cpuid.4: SEE ALSO: add cpuid(1) 2019-05-23 13:18:26 +02:00
man5 proc.5: Correct description of /pro/PID/status 'ShdPnd' and 'SigPnd' fields 2019-07-10 14:54:10 +02:00
man6 intro.6: wfix 2017-08-25 21:41:03 +02:00
man7 signal.7: Clarify that siginfo_t isn't changed on coalescing 2019-07-13 11:44:12 -06:00
man8 ld.so.8: wfix: fix a clumsy wording that is hard to parse 2019-07-05 10:16:01 +02:00
scripts scripts: mark them executable 2018-05-31 21:34:32 +02:00
Changes Start of man-pages-5.02: updating Changes and Changes.old 2019-05-09 09:46:26 +02:00
Changes.old Changes.old: tfix 2019-06-08 14:04:14 +02:00
Makefile Makefile: Remove a redundant comment 2017-11-20 10:38:10 +01:00
README README: tfix 2017-05-13 20:14:15 +02:00
man-pages-5.02.Announce Start of man-pages-5.02: updating .Announce and .lsm files 2019-05-09 09:46:26 +02:00
man-pages-5.02.lsm man-pages-5.02.lsm: Update primary site; remove alternate site 2019-06-07 05:51:12 +02:00

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.