diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-03-26 13:35:09 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-03-26 13:35:09 +0000 |
commit | 53091ecd20c294f0e0757a5f4e0d5c8c7b23b555 (patch) | |
tree | f4ae0be26d5debff091d2c976e77fa8050c6758c /include | |
parent | ec1a4b5a521b5adf295bc757c25231910f8c854b (diff) | |
download | busybox-w32-53091ecd20c294f0e0757a5f4e0d5c8c7b23b555.tar.gz busybox-w32-53091ecd20c294f0e0757a5f4e0d5c8c7b23b555.tar.bz2 busybox-w32-53091ecd20c294f0e0757a5f4e0d5c8c7b23b555.zip |
Attempt to get more applets compile for NOMMU.
TODO_config_nommu documents what I managed to compile so far
(yay! msh works! cool). inetd, telnetd, httpd still do not compile. TODO
Also make fork(), daemon() produce warnings on compile stage
(in addition to erros on link stage).
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/include/libbb.h b/include/libbb.h index ff7d3bf1a..32e099b54 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -471,7 +471,9 @@ int bb_execvp(const char *file, char *const argv[]); | |||
471 | pid_t spawn(char **argv); | 471 | pid_t spawn(char **argv); |
472 | pid_t xspawn(char **argv); | 472 | pid_t xspawn(char **argv); |
473 | /* Helpers for daemonization. | 473 | /* Helpers for daemonization. |
474 | * | ||
474 | * bb_daemonize(flags) = daemonize, does not compile on NOMMU | 475 | * bb_daemonize(flags) = daemonize, does not compile on NOMMU |
476 | * | ||
475 | * bb_daemonize_or_rexec(flags, argv) = daemonizes on MMU (and ignores argv), | 477 | * bb_daemonize_or_rexec(flags, argv) = daemonizes on MMU (and ignores argv), |
476 | * rexec's itself on NOMMU with argv passed as command line. | 478 | * rexec's itself on NOMMU with argv passed as command line. |
477 | * Thus bb_daemonize_or_rexec may cause your <applet>_main() to be re-executed | 479 | * Thus bb_daemonize_or_rexec may cause your <applet>_main() to be re-executed |
@@ -482,7 +484,12 @@ pid_t xspawn(char **argv); | |||
482 | * Both of the above will redirect fd 0,1,2 to /dev/null and drop ctty | 484 | * Both of the above will redirect fd 0,1,2 to /dev/null and drop ctty |
483 | * (will do setsid()). | 485 | * (will do setsid()). |
484 | * | 486 | * |
487 | * forkexit_or_rexec(argv) = bare-bones "fork + parent exits" on MMU, | ||
488 | * "vfork + re-exec ourself" on NOMMU. No fd redirection, no setsid(). | ||
489 | * Currently used for openvt. On MMU ignores argv. | ||
490 | * | ||
485 | * Helper for network daemons in foreground mode: | 491 | * Helper for network daemons in foreground mode: |
492 | * | ||
486 | * bb_sanitize_stdio() = make sure that fd 0,1,2 are opened by opening them | 493 | * bb_sanitize_stdio() = make sure that fd 0,1,2 are opened by opening them |
487 | * to /dev/null if they are not. | 494 | * to /dev/null if they are not. |
488 | */ | 495 | */ |
@@ -493,16 +500,16 @@ enum { | |||
493 | DAEMON_ONLY_SANITIZE = 8, /* internal use */ | 500 | DAEMON_ONLY_SANITIZE = 8, /* internal use */ |
494 | }; | 501 | }; |
495 | #ifndef BB_NOMMU | 502 | #ifndef BB_NOMMU |
496 | #define bb_daemonize_or_rexec(flags, argv) bb_daemonize_or_rexec(flags) | 503 | void forkexit_or_rexec(void); |
497 | #define bb_daemonize(flags) bb_daemonize_or_rexec(flags, bogus) | 504 | # define forkexit_or_rexec(argv) forkexit_or_rexec() |
505 | # define bb_daemonize_or_rexec(flags, argv) bb_daemonize_or_rexec(flags) | ||
506 | # define bb_daemonize(flags) bb_daemonize_or_rexec(flags, bogus) | ||
498 | #else | 507 | #else |
499 | extern smallint re_execed; | 508 | void forkexit_or_rexec(char **argv); |
500 | pid_t BUG_fork_is_unavailable_on_nommu(void); | 509 | extern smallint re_execed; |
501 | pid_t BUG_daemon_is_unavailable_on_nommu(void); | 510 | # define fork() BUG_fork_is_unavailable_on_nommu() |
502 | pid_t BUG_bb_daemonize_is_unavailable_on_nommu(void); | 511 | # define daemon(a,b) BUG_daemon_is_unavailable_on_nommu() |
503 | #define fork() BUG_fork_is_unavailable_on_nommu() | 512 | # define bb_daemonize(a) BUG_bb_daemonize_is_unavailable_on_nommu() |
504 | #define daemon(a,b) BUG_daemon_is_unavailable_on_nommu() | ||
505 | #define bb_daemonize(a) BUG_bb_daemonize_is_unavailable_on_nommu() | ||
506 | #endif | 513 | #endif |
507 | void bb_daemonize_or_rexec(int flags, char **argv); | 514 | void bb_daemonize_or_rexec(int flags, char **argv); |
508 | void bb_sanitize_stdio(void); | 515 | void bb_sanitize_stdio(void); |