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

Function os_forktype

os/bs2000/os.c:48–68  ·  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

46 * set both the POSIX and BS2000 user id's to the unprivileged user.
47 */
48static bs2_ForkType os_forktype(int one_process)
49{
50 /* have we checked the OS version before? If yes return the previous
51 * result - the OS release isn't going to change suddenly!
52 */
53 if (forktype == bs2_unknown) {
54 /* not initialized yet */
55
56 /* No fork if the one_process option was set */
57 if (one_process) {
58 forktype = bs2_noFORK;
59 }
60 /* If the user is unprivileged, use the normal fork() only. */
61 else if (getuid() != 0) {
62 forktype = bs2_FORK;
63 }
64 else
65 forktype = bs2_UFORK;
66 }
67 return forktype;
68}
69
70
71

Callers 2

os_init_job_environmentFunction · 0.70
os_forkFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected