]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/sigaction.c
ncurses 5.7 - patch 20090117
[ncurses.git] / ncurses / base / sigaction.c
index ab1e569fae6a8cb5053388306ba3c69c6def47c0..36442e090a410f6e28e4a90868e79aa3b3988efb 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc.                        *
+ * Copyright (c) 1998-2002,2003 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Thomas E. Dickey                        1996-2003               *
  ****************************************************************************/
 
-#include <curses.priv.h>
-
-#include <signal.h>
-#include <SigAction.h>
-
 /* This file provides sigaction() emulation using sigvec() */
 /* Use only if this is non POSIX system */
 
-#if !HAVE_SIGACTION && HAVE_SIGVEC
+MODULE_ID("$Id: sigaction.c,v 1.14 2003/12/07 01:06:52 tom Exp $")
 
-MODULE_ID("$Id: sigaction.c,v 1.9 1999/06/19 23:05:16 tom Exp $")
-
-int
-sigaction (int sig, sigaction_t * sigact, sigaction_t * osigact)
+static int
+_nc_sigaction(int sig, sigaction_t * sigact, sigaction_t * osigact)
 {
-  return sigvec(sig, sigact, osigact);
+    return sigvec(sig, sigact, osigact);
 }
 
-int
-sigemptyset (sigset_t * mask)
+static int
+_nc_sigemptyset(sigset_t * mask)
 {
-  *mask = 0;
-  return 0;
+    *mask = 0;
+    return 0;
 }
 
-int
-sigprocmask (int mode, sigset_t * mask, sigset_t * omask)
+static int
+_nc_sigprocmask(int mode, sigset_t * mask, sigset_t * omask)
 {
-   sigset_t current = sigsetmask(0);
+    sigset_t current = sigsetmask(0);
 
-   if (omask) *omask = current;
+    if (omask)
+       *omask = current;
 
-   if (mode==SIG_BLOCK)
-      current |= *mask;
-   else if (mode==SIG_UNBLOCK)
-      current &= ~*mask;
-   else if (mode==SIG_SETMASK)
-      current = *mask;
+    if (mode == SIG_BLOCK)
+       current |= *mask;
+    else if (mode == SIG_UNBLOCK)
+       current &= ~*mask;
+    else if (mode == SIG_SETMASK)
+       current = *mask;
 
-   sigsetmask(current);
-   return 0;
+    sigsetmask(current);
+    return 0;
 }
 
-int
-sigsuspend (sigset_t * mask)
+static int
+_nc_sigaddset(sigset_t * mask, int sig)
 {
-  return sigpause (*mask);
+    *mask |= sigmask(sig);
+    return 0;
 }
 
-int
-sigdelset (sigset_t * mask, int sig)
+/* not used in lib_tstp.c */
+#if 0
+static int
+_nc_sigsuspend(sigset_t * mask)
 {
-  *mask &= ~sigmask (sig);
-  return 0;
+    return sigpause(*mask);
 }
 
-int
-sigaddset (sigset_t * mask, int sig)
+static int
+_nc_sigdelset(sigset_t * mask, int sig)
 {
-  *mask |= sigmask (sig);
-  return 0;
+    *mask &= ~sigmask(sig);
+    return 0;
 }
 
-int
-sigismember (sigset_t * mask, int sig)
+static int
+_nc_sigismember(sigset_t * mask, int sig)
 {
-  return (*mask & sigmask (sig)) != 0;
+    return (*mask & sigmask(sig)) != 0;
 }
-
-#else
-extern void _nc_sigaction(void);       /* quiet's gcc warning */
-void _nc_sigaction(void) { } /* nonempty for strict ANSI compilers */
 #endif