]> sourceware.org Git - newlib-cygwin.git/commitdiff
* cygwin.din: Export sigignore and sigset.
authorCorinna Vinschen <corinna@vinschen.de>
Thu, 16 Feb 2006 18:21:49 +0000 (18:21 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Thu, 16 Feb 2006 18:21:49 +0000 (18:21 +0000)
* 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.

winsup/cygwin/ChangeLog
winsup/cygwin/cygwin.din
winsup/cygwin/exceptions.cc
winsup/cygwin/include/cygwin/signal.h
winsup/cygwin/include/cygwin/version.h

index 3d618cabdd58e7b585ed85aebd01af28ba480a0d..23855f2b30f1f9051af4b729ac963811db43b9b7 100644 (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>
 
        * include/mntent.h: Add missing #include.
index 8880c7b0b2105a976fb282dca0ab58f9296ab5e2..7bbe7b1ee77eebae43791d9fd759e338df94466f 100644 (file)
@@ -1284,6 +1284,7 @@ sigdelset SIGFE
 sigemptyset NOSIGFE
 sigfillset NOSIGFE
 sighold SIGFE
+sigignore SIGFE
 sigqueue SIGFE
 siginterrupt SIGFE
 sigismember SIGFE
@@ -1294,6 +1295,7 @@ sigpause SIGFE
 sigpending SIGFE
 sigprocmask SIGFE
 sigrelse SIGFE
+sigset SIGFE
 sigsuspend SIGFE
 sigwait SIGFE
 sigwaitinfo SIGFE
index 4162ebd6b1cf2d0cc2c117914c525f7c4a18a195..3f2c13c88a080ea224cc21f51948ef6e6c61e0e1 100644 (file)
@@ -1021,6 +1021,50 @@ sigrelse (int sig)
   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
index fd61109692792ee10c03d07b7b14a58eb03be2bf..0e0aab7d3c7b6a4bdcfd3b0652440c7317a97aa7 100644 (file)
@@ -254,10 +254,15 @@ struct sigaction
 #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
index f6c58448659ddc10abfb99246d3e7121675fb057..0385f3cf8ea6be607c077024b9b351cd967e87db 100644 (file)
@@ -286,12 +286,13 @@ details. */
       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
This page took 0.040238 seconds and 5 git commands to generate.