pidref: add helpers for waiting for pidref processes
A simple test case is added in a follow-up commit.
This commit is contained in:
+13
-1
@@ -55,7 +55,19 @@ int pidref_new_from_pid(pid_t pid, PidRef **ret);
|
||||
|
||||
int pidref_kill(const PidRef *pidref, int sig);
|
||||
int pidref_kill_and_sigcont(const PidRef *pidref, int sig);
|
||||
int pidref_sigqueue(const PidRef *pidfref, int sig, int value);
|
||||
int pidref_sigqueue(const PidRef *pidref, int sig, int value);
|
||||
|
||||
int pidref_wait(const PidRef *pidref, siginfo_t *siginfo, int options);
|
||||
int pidref_wait_for_terminate(const PidRef *pidref, siginfo_t *ret);
|
||||
|
||||
static inline void pidref_done_sigkill_wait(PidRef *pidref) {
|
||||
if (!pidref_is_set(pidref))
|
||||
return;
|
||||
|
||||
(void) pidref_kill(pidref, SIGKILL);
|
||||
(void) pidref_wait_for_terminate(pidref, NULL);
|
||||
pidref_done(pidref);
|
||||
}
|
||||
|
||||
int pidref_verify(const PidRef *pidref);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user