4 * $Header: /cvsroot/pgpool/pgpool-II/pool_signal.h,v 1.4 2008/01/29 01:56:36 y-asaba Exp $
6 * pgpool: a language independent connection pool server for PostgreSQL
7 * written by Tatsuo Ishii
9 * Portions Copyright (c) 2003-2008, PgPool Global Development Group
10 * Portions Copyright (c) 2004, PostgreSQL Global Development Group
12 * Permission to use, copy, modify, and distribute this software and
13 * its documentation for any purpose and without fee is hereby
14 * granted, provided that the above copyright notice appear in all
15 * copies and that both that copyright notice and this permission
16 * notice appear in supporting documentation, and that the name of the
17 * author not be used in advertising or publicity pertaining to
18 * distribution of the software without specific, written prior
19 * permission. The author makes no representations about the
20 * suitability of this software for any purpose. It is provided "as
21 * is" without express or implied warranty.
23 * pool.h.: master definition header file
31 * Signal stuff. Stolen from PostgreSQL source code.
35 #ifdef HAVE_SIGPROCMASK
36 extern sigset_t UnBlockSig,
40 #define POOL_SETMASK(mask) sigprocmask(SIG_SETMASK, mask, NULL)
41 #define POOL_SETMASK2(mask, oldmask) sigprocmask(SIG_SETMASK, mask, oldmask)
43 extern int UnBlockSig,
48 #define POOL_SETMASK(mask) sigsetmask(*((int*)(mask)))
49 #define POOL_SETMASK2(mask, oldmask) do {oldmask = POOL_SETMASK(mask)} while (0)
51 #define POOL_SETMASK(mask) pqsigsetmask(*((int*)(mask)))
52 #define POOL_SETMASK2(mask, oldmask) do {oldmask = POOL_SETMASK(mask)} while (0)
53 int pqsigsetmask(int mask);
57 typedef void (*pool_sighandler_t) (int);
58 extern pool_sighandler_t pool_signal(int signo, pool_sighandler_t func);
59 extern void poolinitmask(void);
61 #endif /* POOL_SIGNAL_H */