]> git.8kb.co.uk Git - pgpool-ii/pgpool-ii_2.2.5/blob - pool_signal.h
Attempt to send a proper failure message to frontend when authentication
[pgpool-ii/pgpool-ii_2.2.5] / pool_signal.h
1 /* -*-pgsql-c-*- */
2 /*
3  *
4  * $Header: /cvsroot/pgpool/pgpool-II/pool_signal.h,v 1.4 2008/01/29 01:56:36 y-asaba Exp $
5  *
6  * pgpool: a language independent connection pool server for PostgreSQL 
7  * written by Tatsuo Ishii
8  *
9  * Portions Copyright (c) 2003-2008,    PgPool Global Development Group
10  * Portions Copyright (c) 2004, PostgreSQL Global Development Group
11  *
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.
22  *
23  * pool.h.: master definition header file
24  *
25  */
26
27 #ifndef POOL_SIGNAL_H
28 #define POOL_SIGNAL_H
29
30 /*
31  * Signal stuff. Stolen from PostgreSQL source code.
32  */
33 #include <signal.h>
34
35 #ifdef HAVE_SIGPROCMASK
36 extern sigset_t UnBlockSig,
37                         BlockSig,
38                         AuthBlockSig;
39
40 #define POOL_SETMASK(mask)      sigprocmask(SIG_SETMASK, mask, NULL)
41 #define POOL_SETMASK2(mask, oldmask)    sigprocmask(SIG_SETMASK, mask, oldmask)
42 #else
43 extern int      UnBlockSig,
44                         BlockSig,
45                         AuthBlockSig;
46
47 #ifndef WIN32
48 #define POOL_SETMASK(mask)      sigsetmask(*((int*)(mask)))
49 #define POOL_SETMASK2(mask, oldmask)    do {oldmask = POOL_SETMASK(mask)} while (0)
50 #else
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);
54 #endif
55 #endif
56
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);
60
61 #endif /* POOL_SIGNAL_H */