summaryrefslogtreecommitdiff
path: root/include/libbb.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libbb.h')
-rw-r--r--include/libbb.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 32e099b..67fd2af 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -263,6 +263,13 @@ char *xrealloc_getcwd_or_warn(char *cwd);
char *xmalloc_readlink_or_warn(const char *path);
char *xmalloc_realpath(const char *path);
extern void xstat(const char *filename, struct stat *buf);
+/* Unlike waitpid, waits ONLY for one process,
+ * It's safe to pass negative 'pids' from failed [v]fork -
+ * wait4pid will return -1 and ECHILD in errno.
+ * IOW: rc = wait4pid(spawn(argv));
+ * if (rc < 0) bb_perror_msg("%s", argv[0]);
+ * if (rc > 0) bb_error_msg("exit code: %d", rc);
+ */
extern int wait4pid(int pid);
extern void xsetgid(gid_t gid);
extern void xsetuid(uid_t uid);