2007-03-22 Chris Toshok <toshok@ximian.com>
[mono-project/dkf.git] / support / signal.c
blob6f7305ade0fe8867a3d715f905e9f17fef9d84a5
1 /*
2 * <signal.h> wrapper functions.
4 * Authors:
5 * Jonathan Pryor (jonpryor@vt.edu)
7 * Copyright (C) 2004-2005 Jonathan Pryor
8 */
10 #include <signal.h>
12 #include "map.h"
13 #include "mph.h"
15 G_BEGIN_DECLS
17 typedef void (*mph_sighandler_t)(int);
19 void*
20 Mono_Posix_Stdlib_SIG_DFL (void)
22 return SIG_DFL;
25 void*
26 Mono_Posix_Stdlib_SIG_ERR (void)
28 return SIG_ERR;
31 void*
32 Mono_Posix_Stdlib_SIG_IGN (void)
34 return SIG_IGN;
37 void
38 Mono_Posix_Stdlib_InvokeSignalHandler (int signum, void *handler)
40 mph_sighandler_t _h = (mph_sighandler_t) handler;
41 _h (signum);
44 #ifndef PLATFORM_WIN32
45 int
46 Mono_Posix_Syscall_psignal (int sig, const char* s)
48 errno = 0;
49 psignal (sig, s);
50 return errno == 0 ? 0 : -1;
52 #endif /* ndef PLATFORM_WIN32 */
55 G_END_DECLS
58 * vim: noexpandtab