diff options
Diffstat (limited to '')
-rw-r--r-- | src/libmdsserver/util.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libmdsserver/util.h b/src/libmdsserver/util.h index 00dfb58..3220adb 100644 --- a/src/libmdsserver/util.h +++ b/src/libmdsserver/util.h @@ -21,6 +21,7 @@ #include <stddef.h> #include <stdint.h> +#include <sys/types.h> /** @@ -113,6 +114,17 @@ char* full_read(int fd); */ int startswith_n(const char* haystack, const char* needle, size_t haystack_n, size_t needle_n) __attribute__((pure)); +/** + * Wrapper around `waitpid` that never returns on an interruption unless + * it is interrupted 100 times within the same second + * + * @param pid See description of `pid` in the documentation for `waitpid` + * @param pid See description of `status` in the documentation for `waitpid` + * @param pid See description of `options` in the documentation for `waitpid` + * @return See the documentation for `waitpid` + */ +pid_t uninterruptable_waitpid(pid_t pid, int* restrict status, int options); + #endif |