3 Copyright 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
6 This file is part of Cygwin.
8 This software is a copyrighted work licensed under the terms of the
9 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
19 __SIGFLUSH = -(NSIG + 1),
20 __SIGSTRACE = -(NSIG + 2),
21 __SIGCOMMUNE = -(NSIG + 3),
22 __SIGPENDING = -(NSIG + 4),
23 __SIGDELETE = -(NSIG + 5),
24 __SIGFLUSHFAST = -(NSIG + 6),
25 __SIGHOLD = -(NSIG + 7),
26 __SIGNOHOLD = -(NSIG + 8),
27 __SIGEXIT = -(NSIG + 9),
28 __SIGSETPGRP = -(NSIG + 10)
32 #define SIG_BAD_MASK (1 << (SIGKILL - 1))
36 PROC_ADDCHILD = 1, // add a new subprocess to list
37 PROC_REATTACH_CHILD = 2, // reattach after exec
38 PROC_EXEC_CLEANUP = 3, // cleanup waiting children after exec
39 PROC_DETACHED_CHILD = 4, // set up a detached child
40 PROC_CLEARWAIT = 5, // clear all waits - signal arrived
41 PROC_WAIT = 6, // setup for wait() for subproc
42 PROC_EXECING = 7, // used to get a lock when execing
43 PROC_NOTHING = 8 // nothing, really
56 struct sigpacket *next;
58 int __stdcall process () __attribute__ ((regparm (1)));
61 extern HANDLE signal_arrived;
62 extern HANDLE sigCONT;
64 void __stdcall sig_dispatch_pending (bool fast = false);
66 extern "C" void __stdcall set_signal_mask (sigset_t newmask, sigset_t&);
68 int __stdcall handle_sigprocmask (int sig, const sigset_t *set,
69 sigset_t *oldset, sigset_t& opmask)
70 __attribute__ ((regparm (3)));
72 void __stdcall sig_clear (int) __attribute__ ((regparm (1)));
73 void __stdcall sig_set_pending (int) __attribute__ ((regparm (1)));
74 int __stdcall handle_sigsuspend (sigset_t);
76 int __stdcall proc_subproc (DWORD, DWORD) __attribute__ ((regparm (2)));
79 void __stdcall proc_terminate ();
80 void __stdcall sigproc_init ();
81 #ifdef __INSIDE_CYGWIN__
82 void __stdcall sigproc_terminate (enum exit_states);
85 cygwait (DWORD n, DWORD howlong, ...)
88 va_start (ap, howlong);
90 va_start (ap, howlong);
91 for (unsigned i = 0; i < n; i++)
92 w4[i] = va_arg (ap, HANDLE);
93 w4[n++] = signal_arrived;
94 w4[n++] = pthread::get_cancel_event ();
97 return WaitForMultipleObjects (n, w4, FALSE, howlong);
101 cygwait (HANDLE h, DWORD wait = INFINITE)
103 return cygwait (1, wait, h);
109 return cygwait ((DWORD) 0, wait);
112 bool __stdcall pid_exists (pid_t) __attribute__ ((regparm(1)));
113 int __stdcall sig_send (_pinfo *, siginfo_t&, class _cygtls *tls = NULL) __attribute__ ((regparm (3)));
114 int __stdcall sig_send (_pinfo *, int) __attribute__ ((regparm (2)));
115 void __stdcall signal_fixup_after_exec ();
116 void __stdcall sigalloc ();
117 void __stdcall create_signal_arrived ();
119 int kill_pgrp (pid_t, siginfo_t&);
120 int killsys (pid_t, int);
122 extern char myself_nowait_dummy[];
124 extern struct sigaction *global_sigs;
126 #define myself_nowait ((_pinfo *) myself_nowait_dummy)
127 #endif /*_SIGPROC_H*/