* 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.
This commit is contained in:
Corinna Vinschen 2006-02-16 18:21:49 +00:00
parent df4f13b723
commit c6e48b1cd1
5 changed files with 63 additions and 1 deletions

View File

@ -1,3 +1,13 @@
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> 2006-02-13 Igor Peshansky <pechtcha@cs.nyu.edu>
* include/mntent.h: Add missing #include. * include/mntent.h: Add missing #include.

View File

@ -1284,6 +1284,7 @@ sigdelset SIGFE
sigemptyset NOSIGFE sigemptyset NOSIGFE
sigfillset NOSIGFE sigfillset NOSIGFE
sighold SIGFE sighold SIGFE
sigignore SIGFE
sigqueue SIGFE sigqueue SIGFE
siginterrupt SIGFE siginterrupt SIGFE
sigismember SIGFE sigismember SIGFE
@ -1294,6 +1295,7 @@ sigpause SIGFE
sigpending SIGFE sigpending SIGFE
sigprocmask SIGFE sigprocmask SIGFE
sigrelse SIGFE sigrelse SIGFE
sigset SIGFE
sigsuspend SIGFE sigsuspend SIGFE
sigwait SIGFE sigwait SIGFE
sigwaitinfo SIGFE sigwaitinfo SIGFE

View File

@ -1021,6 +1021,50 @@ sigrelse (int sig)
return 0; 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. /* Update the signal mask for this process and return the old mask.
Called from sigdelayed */ Called from sigdelayed */
extern "C" sigset_t extern "C" sigset_t

View File

@ -254,10 +254,15 @@ struct sigaction
#define SIGRTMAX ((SIGRTMIN) + 0) #define SIGRTMAX ((SIGRTMIN) + 0)
#define NSIG 33 /* signal 0 implied */ #define NSIG 33 /* signal 0 implied */
#define SIG_HOLD ((_sig_func_ptr)2) /* Signal in signal mask */
int sigwait (const sigset_t *, int *); int sigwait (const sigset_t *, int *);
int sigwaitinfo (const sigset_t *, siginfo_t *); int sigwaitinfo (const sigset_t *, siginfo_t *);
int sighold (int); int sighold (int);
int sigignore (int);
int sigrelse (int); int sigrelse (int);
_sig_func_ptr sigset (int, _sig_func_ptr);
int sigqueue(pid_t, int, const union sigval); int sigqueue(pid_t, int, const union sigval);
int siginterrupt (int, int); int siginterrupt (int, int);
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -286,12 +286,13 @@ details. */
151: Export __opendir_with_d_ino 151: Export __opendir_with_d_ino
152: Revert to having d_ino in dirent unconditionally. 152: Revert to having d_ino in dirent unconditionally.
153: Export updwtmpx, Implement CW_SETUP_WINENV. 153: Export updwtmpx, Implement CW_SETUP_WINENV.
154: Export sigset, sigignore.
*/ */
/* Note that we forgot to bump the api for ualarm, strtoll, strtoull */ /* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
#define CYGWIN_VERSION_API_MAJOR 0 #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 /* There is also a compatibity version number associated with the
shared memory regions. It is incremented when incompatible shared memory regions. It is incremented when incompatible