3 This file is part of Cygwin.
5 This software is a copyrighted work licensed under the terms of the
6 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
9 #ifndef __CYGSERVER_IPC_H__
10 #define __CYGSERVER_IPC_H__
13 * Datastructure which is part of any IPC input parameter block.
16 void *vm_map
; /* UNUSED */
17 struct shmmap_state
*vm_shm
;
28 struct vmspace
*p_vmspace
;
29 HANDLE signal_arrived
;
32 #ifdef __INSIDE_CYGWIN__
35 ipc_set_proc_info (proc
&blk
, bool in_fork
= false)
37 blk
.cygpid
= getpid ();
38 blk
.winpid
= GetCurrentProcessId ();
44 blk
.signal_arrived
= in_fork
? NULL
: _my_tls
.get_signal_arrived (true);
46 #endif /* __INSIDE_CYGWIN__ */
48 #ifndef __INSIDE_CYGWIN__
60 ipc_retval () { ssz
= 0; }
61 ipc_retval (ssize_t nssz
) { ssz
= nssz
; }
63 operator int () const { return i
; }
64 int operator = (int ni
) { return i
= ni
; }
66 /* size_t == vm_offset_t == unsigned long. Ssize_t needs overloading */
67 operator ssize_t () const { return ssz
; }
68 ssize_t
operator = (ssize_t nssz
) { return ssz
= nssz
; }
70 operator vm_offset_t () const { return off
; }
71 vm_offset_t
operator = (vm_offset_t noff
) { return off
= noff
; }
73 operator vm_object_t () const { return obj
; }
74 vm_object_t
operator = (vm_object_t nobj
) { return obj
= nobj
; }
79 /* Implemented in cgyserver/process.cc */
80 void dup_signal_arrived ();
81 void close_signal_arrived ();
83 class process
*client
;
85 ipc_retval td_retval
[2];
87 thread (class process
*_client
, proc
*_proc
, bool _init_m1
)
88 : client (_client
), ipcblk (_proc
)
90 td_retval
[0] = td_retval
[1] = _init_m1
? -1 : 0;
91 dup_signal_arrived ();
93 ~thread () { close_signal_arrived (); }
95 #define td_proc ipcblk
99 #endif /* __CYGSERVER_IPC_H__ */