summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-03-18 22:44:00 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-03-18 22:44:00 +0100
commit8531d76a15890c2c535908ce888b2e2aed35b172 (patch)
tree2035bb9eb9feec14d80487a313729192bb0e875c /include
parentc5c006c10c060e7f1a97250d039051b93ed390b2 (diff)
downloadbusybox-w32-8531d76a15890c2c535908ce888b2e2aed35b172.tar.gz
busybox-w32-8531d76a15890c2c535908ce888b2e2aed35b172.tar.bz2
busybox-w32-8531d76a15890c2c535908ce888b2e2aed35b172.zip
*: code shrink and better "died from signal" reporting from wait4pid
function old new delta parse 964 967 +3 udhcp_run_script 670 665 -5 singlemount 911 906 -5 mount_it_now 360 355 -5 inotifyd_main 521 516 -5 xspawn 21 - -21 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/4 up/down: 3/-41) Total: -38 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 044d09047..72d6c7dc8 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -812,21 +812,22 @@ int bb_execvp(const char *file, char *const argv[]) FAST_FUNC;
812#define BB_EXECLP(prog,cmd,...) execlp(prog,cmd, __VA_ARGS__) 812#define BB_EXECLP(prog,cmd,...) execlp(prog,cmd, __VA_ARGS__)
813#endif 813#endif
814 814
815/* NOMMU friendy fork+exec */ 815/* NOMMU friendy fork+exec: */
816pid_t spawn(char **argv) FAST_FUNC; 816pid_t spawn(char **argv) FAST_FUNC;
817pid_t xspawn(char **argv) FAST_FUNC; 817pid_t xspawn(char **argv) FAST_FUNC;
818 818
819pid_t safe_waitpid(pid_t pid, int *wstat, int options) FAST_FUNC; 819pid_t safe_waitpid(pid_t pid, int *wstat, int options) FAST_FUNC;
820/* Unlike waitpid, waits ONLY for one process. 820pid_t wait_any_nohang(int *wstat) FAST_FUNC;
821/* wait4pid: unlike waitpid, waits ONLY for one process.
822 * Returns sig + 0x180 if child is killed by signal.
821 * It's safe to pass negative 'pids' from failed [v]fork - 823 * It's safe to pass negative 'pids' from failed [v]fork -
822 * wait4pid will return -1 (and will not clobber [v]fork's errno). 824 * wait4pid will return -1 (and will not clobber [v]fork's errno).
823 * IOW: rc = wait4pid(spawn(argv)); 825 * IOW: rc = wait4pid(spawn(argv));
824 * if (rc < 0) bb_perror_msg("%s", argv[0]); 826 * if (rc < 0) bb_perror_msg("%s", argv[0]);
825 * if (rc > 0) bb_error_msg("exit code: %d", rc); 827 * if (rc > 0) bb_error_msg("exit code: %d", rc & 0xff);
826 */ 828 */
827int wait4pid(pid_t pid) FAST_FUNC; 829int wait4pid(pid_t pid) FAST_FUNC;
828pid_t wait_any_nohang(int *wstat) FAST_FUNC; 830/* Same as wait4pid(spawn(argv)), but with NOFORK/NOEXEC if configured: */
829/* wait4pid(spawn(argv)) + NOFORK/NOEXEC (if configured) */
830int spawn_and_wait(char **argv) FAST_FUNC; 831int spawn_and_wait(char **argv) FAST_FUNC;
831struct nofork_save_area { 832struct nofork_save_area {
832 jmp_buf die_jmp; 833 jmp_buf die_jmp;