2 * process-private.h: Private definitions for process handles
5 * Dick Porter (dick@ximian.com)
7 * (C) 2002-2006 Novell, Inc.
10 #ifndef _WAPI_PROCESS_PRIVATE_H_
11 #define _WAPI_PROCESS_PRIVATE_H_
16 /* There doesn't seem to be a defined symbol for this */
17 #define _WAPI_PROCESS_CURRENT (gpointer)0xFFFFFFFF
19 /* This marks a system process that we don't have a handle on */
20 /* FIXME: Cope with PIDs > sizeof guint */
21 #define _WAPI_PROCESS_UNHANDLED (1 << (8*sizeof(pid_t)-1))
22 #define _WAPI_PROCESS_UNHANDLED_PID_MASK (-1 & ~_WAPI_PROCESS_UNHANDLED)
24 extern gpointer
_wapi_process_duplicate (void);
25 extern void wapi_processes_cleanup (void);
27 extern struct _WapiHandleOps _wapi_process_ops
;
29 #define _WAPI_PROC_NAME_MAX_LEN _POSIX_PATH_MAX
32 * MonoProcess describes processes we create.
33 * It contains a semaphore that can be waited on in order to wait
34 * for process termination. It's accessed in our SIGCHLD handler,
35 * when status is updated (and pid cleared, to not clash with
36 * subsequent processes that may get executed).
39 pid_t pid
; /* the pid of the process. This value is only valid until the process has exited. */
40 MonoSemType exit_sem
; /* this semaphore will be released when the process exits */
41 int status
; /* the exit status */
42 gint32 handle_count
; /* the number of handles to this mono_process instance */
43 /* we keep a ref to the creating _WapiHandle_process handle until
44 * the process has exited, so that the information there isn't lost.
45 * If we put the information there in this structure, it won't be
46 * available to other processes when using shared handles. */
48 struct MonoProcess
*next
;
53 * _WapiHandle_process is a structure containing all the required information
54 * for process handling.
55 * The mono_process field is only present if this process has created
56 * the corresponding process.
58 struct _WapiHandle_process
63 WapiFileTime create_time
;
64 WapiFileTime exit_time
;
65 gchar proc_name
[_WAPI_PROC_NAME_MAX_LEN
];
66 size_t min_working_set
;
67 size_t max_working_set
;
69 pid_t self
; /* mono_process is shared among processes, but only usable in the process that created it */
70 struct MonoProcess
*mono_process
;
73 #endif /* _WAPI_PROCESS_PRIVATE_H_ */