+2006-02-16 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygwin.din: Export sigignore and sigset.
+ * exceptions.cc (sigset): New function.
+ (sigignore): New function.
+ * include/cygwin/signal.h (SIG_HOLD): Define.
+ (sigignore): Declare.
+ (sigset): Declare.
+ * include/cygwin/version.h: Bump API minor number to 154.
+
2006-02-13 Igor Peshansky <pechtcha@cs.nyu.edu>
* include/mntent.h: Add missing #include.
return 0;
}
+extern "C" _sig_func_ptr
+sigset (int sig, _sig_func_ptr func)
+{
+ sig_dispatch_pending ();
+ _sig_func_ptr prev;
+
+ /* check that sig is in right range */
+ if (sig < 0 || sig >= NSIG || sig == SIGKILL || sig == SIGSTOP)
+ {
+ set_errno (EINVAL);
+ syscall_printf ("SIG_ERR = sigset (%d, %p)", sig, func);
+ return (_sig_func_ptr) SIG_ERR;
+ }
+
+ mask_sync.acquire (INFINITE);
+ sigset_t mask = myself->getsigmask ();
+ /* If sig was in the signal mask return SIG_HOLD, otherwise return the
+ previous disposition. */
+ if (sigismember (&mask, sig))
+ prev = SIG_HOLD;
+ else
+ prev = global_sigs[sig].sa_handler;
+ /* If func is SIG_HOLD, add sig to the signal mask, otherwise set the
+ disposition to func and remove sig from the signal mask. */
+ if (func == SIG_HOLD)
+ sigaddset (&mask, sig);
+ else
+ {
+ /* No error checking. The test which could return SIG_ERR has already
+ been made above. */
+ signal (sig, func);
+ sigdelset (&mask, sig);
+ }
+ set_signal_mask (mask, myself->getsigmask ());
+ mask_sync.release ();
+ return prev;
+}
+
+extern "C" int
+sigignore (int sig)
+{
+ return sigset (sig, SIG_IGN) == SIG_ERR ? -1 : 0;
+}
+
/* Update the signal mask for this process and return the old mask.
Called from sigdelayed */
extern "C" sigset_t
#define SIGRTMAX ((SIGRTMIN) + 0)
#define NSIG 33 /* signal 0 implied */
+#define SIG_HOLD ((_sig_func_ptr)2) /* Signal in signal mask */
+
int sigwait (const sigset_t *, int *);
int sigwaitinfo (const sigset_t *, siginfo_t *);
int sighold (int);
+int sigignore (int);
int sigrelse (int);
+_sig_func_ptr sigset (int, _sig_func_ptr);
+
int sigqueue(pid_t, int, const union sigval);
int siginterrupt (int, int);
#ifdef __cplusplus
151: Export __opendir_with_d_ino
152: Revert to having d_ino in dirent unconditionally.
153: Export updwtmpx, Implement CW_SETUP_WINENV.
+ 154: Export sigset, sigignore.
*/
/* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
#define CYGWIN_VERSION_API_MAJOR 0
-#define CYGWIN_VERSION_API_MINOR 153
+#define CYGWIN_VERSION_API_MINOR 154
/* There is also a compatibity version number associated with the
shared memory regions. It is incremented when incompatible