MCPcopy Create free account
hub / github.com/apache/httpd / os_forktype

Function os_forktype

os/unix/unixd.c:648–668  ·  view source on GitHub ↗

Determine the method for forking off a child in such a way as to * set both the POSIX and BS2000 user id's to the unprivileged user. */

Source from the content-addressed store, hash-verified

646 * set both the POSIX and BS2000 user id's to the unprivileged user.
647 */
648static bs2_ForkType os_forktype(int one_process)
649{
650 /* have we checked the OS version before? If yes return the previous
651 * result - the OS release isn't going to change suddenly!
652 */
653 if (forktype == bs2_unknown) {
654 /* not initialized yet */
655
656 /* No fork if the one_process option was set */
657 if (one_process) {
658 forktype = bs2_noFORK;
659 }
660 /* If the user is unprivileged, use the normal fork() only. */
661 else if (getuid() != 0) {
662 forktype = bs2_FORK;
663 }
664 else
665 forktype = bs2_UFORK;
666 }
667 return forktype;
668}
669
670
671

Callers 2

os_init_job_environmentFunction · 0.70
os_forkFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected