diff options
author | Christopher Faylor <me@cgf.cx> | 2005-09-29 02:56:47 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2005-09-29 02:56:47 +0400 |
commit | 0730fa07632fa954269ed21cbc2f6025dd35f5cf (patch) | |
tree | 3dc70659917cef414b51daaddd83d6093cdf3d2b /winsup/cygwin/pinfo.h | |
parent | 503490bb9fd3b8853342128a7961d9f4b9e15d99 (diff) |
Change name from commune_recv to commune_process throughout. Change name from
commune_send to commune_request throughout.
* pinfo.h (PICOM_EXTRASTR): New flag.
(PICOM_FIFO): Define with new flag.
(_pinfo::hello_pid): Delete.
(_pinfo::tothem): Delete.
(_pinfo::fromthem): Delete.
(_pinfo::commune_process): Rename from commune_recv. Add a siginfo_t argument
to declaration.
(_pinfo::commune_request): Rename from commune_send. Change DWORD to
__uint32_t in declaration.
* pinfo.cc (_pinfo::commune_process): Rename from commune_recv. Add siginfo_t
argument. Use information from argument rather than reading from another pipe.
Synchronize with other process's commune event.
(_pinfo::commune_request): Rename from commune_send. Change DWORD to __uint32
in argument. Fill out information in new siginfo_t element and rely on
extended operation of sig_send rather than trying to deal with synchronization
issues here. Use process handle and read pipe information filled out by
sig_send to gather information from the other process.
* sigproc.cc (sig_send): Take special action if "communing" to ensure
synchronization with the other process and to return information about the
other process to the caller.
(talktome): Accept a siginfo_t and handle arguments. Read additional
information from the signal pipe when _si_commune._si_code has the
PICOM_EXTRASTR flag set.
(wait_sig): Pass the transmitted siginfo_t struct and the pipe handle to
talktome. Close pipe read handle as soon as possible after we detect that
we're exiting.
Diffstat (limited to 'winsup/cygwin/pinfo.h')
-rw-r--r-- | winsup/cygwin/pinfo.h | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/winsup/cygwin/pinfo.h b/winsup/cygwin/pinfo.h index 564f6f798..1462e5f6d 100644 --- a/winsup/cygwin/pinfo.h +++ b/winsup/cygwin/pinfo.h @@ -22,8 +22,9 @@ struct commune_result enum picom { + PICOM_EXTRASTR = 0x80000000, PICOM_CMDLINE = 1, - PICOM_FIFO = 2, + PICOM_FIFO = PICOM_EXTRASTR | 2, PICOM_CWD = 3, PICOM_ROOT = 4, PICOM_FDS = 5, @@ -57,9 +58,8 @@ public: pid_t ppid; /* dwProcessId contains the processid used for sending signals. It - * will be reset in a child process when it is capable of receiving - * signals. - */ + will be reset in a child process when it is capable of receiving + signals. */ DWORD dwProcessId; /* Used to spawn a child for fork(), among other things. */ @@ -87,11 +87,6 @@ public: /* Non-zero if process was stopped by a signal. */ char stopsig; - /* commune */ - pid_t hello_pid; - HANDLE tothem; - HANDLE fromthem; - inline void set_has_pgid_children () { if (pgid == pid) @@ -110,10 +105,10 @@ public: sig_mask = mask; } - void commune_recv (); - commune_result commune_send (DWORD, ...); + void commune_process (siginfo_t&); + commune_result commune_request (__uint32_t, ...); bool alive (); - fhandler_pipe *pipe_fhandler (HANDLE hdl, size_t &); + fhandler_pipe *pipe_fhandler (HANDLE, size_t &); char *fd (int fd, size_t &); char *fds (size_t &); char *root (size_t &); @@ -156,7 +151,6 @@ public: HANDLE hProcess; CRITICAL_SECTION _lock; bool waiter_ready; - /* Handle associated with initial Windows pid which started it all. */ class cygthread *wait_thread; void init (pid_t, DWORD, HANDLE) __attribute__ ((regparm(3))); pinfo () {} |