aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
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;