VirtualBox

Changeset 10308 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Jul 7, 2008 11:24:50 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
32929
Message:

Additions/common: update comments in VbglR3Daemonize

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibDaemonize.cpp

    r8155 r10308  
    131131     * Fork the child process and quit the parent.
    132132     *
    133      * On Linux we'll fork once more at the end of it all just to be sure that
    134      * we're not leaving any zombies behind. The SIGHUP stuff is ignored because
    135      * the parent may throw us one before we get to the setsid stuff one some
    136      * systems (BSD).
     133     * This means:
     134     * - fork once and become session leader (using setsid(2)) in
     135     * order to detach from the controlling tty and make ourselves safe
     136     * from Ctrl-C.  The fork is required because the call to setsid will
     137     * fail if we were already session leader.
     138     * - On Linux, fork again in order to become a non-leader member of the
     139     * session, as the leader will attach to any tty it opens, accidentally
     140     * or otherwise (Sys V sematics).
     141     * - The SIGHUP stuff is ignored because the parent may throw us one
     142     * before we get to the setsid stuff one some systems (BSD).
    137143     */
    138144    struct sigaction OldSigAct;
     
    191197# ifdef RT_OS_LINUX
    192198    /*
    193      * And fork again to avoid zomibies and stuff (non-standard daemon() behaviour).
     199     * And fork again to lose session leader status (non-standard daemon()
     200     * behaviour).
    194201     */
    195202    pid = fork();
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette