From b9fe5b6eadc913ead80531905aeafa51ed0d4ccd Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 27 Dec 2020 00:58:17 +0100 Subject: Add proc_waitid proc_wait assumes that the caller always wants WEXITED, but waitid() does not. The new proc_waitid RPC requires the caller to specify at least one of WEXITED, WSTOPPED, or WCONTINUED. * hurd/process.defs (proc_waitid): New RPC. * hurd/process_reply.defs (proc_waitid): New RPC. * hurd/process_request.defs (proc_waitid): New RPC. * proc/proc.h (struct proc): Add p_continued field. * proc/wait.c (WCONTINUED, WEXITED): Define if not already defined. (S_proc_wait): Rename implementation to S_proc_waitid, and modify to stop assuming WEXITED. Add support for WCONTINUED. (S_proc_wait): Reimplement by just calling S_proc_waitid with an additional WEXITED. (proc_mark_stop): Clear p_continued. (proc_mark_cont): Set p_continued, clear p_waited, wake any waiting parent. --- proc/proc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'proc/proc.h') diff --git a/proc/proc.h b/proc/proc.h index 64f276d3..cafcfaff 100644 --- a/proc/proc.h +++ b/proc/proc.h @@ -94,6 +94,7 @@ struct proc unsigned int p_loginleader:1; /* leader of login collection */ unsigned int p_dead:1; /* process is dead */ unsigned int p_important:1; /* has called proc_mark_important */ + unsigned int p_continued:1; /* has called proc_mark_cont */ }; typedef struct proc *pstruct_t; -- cgit v1.2.3