src/w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
src/w32.c (sigemptyset): Empty the set.
(sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
nt/inc/ms-w32.h (struct sigaction): Declare sa_handler __cdecl.
Fixes: debbugs:12327
+2012-09-07 Eli Zaretskii <eliz@gnu.org>
+
+ * inc/ms-w32.h (struct sigaction): Declare sa_handler __cdecl.
+
2012-09-05 Juanma Barranquero <lekktu@gmail.com>
* config.nt: Sync with autogen/config.in.
struct sigaction {
int sa_flags;
- void (*sa_handler)(int);
+ void (_CALLBACK_ *sa_handler)(int);
sigset_t sa_mask;
};
#define SIG_BLOCK 1
2012-09-07 Eli Zaretskii <eliz@gnu.org>
+ * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
+
+ * w32.c (sigemptyset): Empty the set.
+ (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
+
* alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
}
/* Routines that are no-ops on NT but are defined to get Emacs to compile. */
-
-int
-sigsetmask (int signal_mask)
-{
- return 0;
-}
-
-int
-sigmask (int sig)
-{
- return 0;
-}
-
-int
-sigblock (int sig)
-{
- return 0;
-}
-
-int
-sigunblock (int sig)
-{
- return 0;
-}
-
int
sigemptyset (sigset_t *set)
{
+ *set = 0;
return 0;
}
return old;
}
+/* Emulate sigaction. */
+int
+sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
+{
+ signal_handler old;
+
+ if (sig != SIGCHLD)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+ old = sig_handlers[sig];
+ if (act)
+ sig_handlers[sig] = act->sa_handler;
+ if (oact)
+ {
+ oact->sa_handler = old;
+ oact->sa_flags = 0;
+ oact->sa_mask = empty_mask;
+ }
+ return 0;
+}
+
/* Defined in <process.h> which conflicts with the local copy */
#define _P_NOWAIT 1