~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to src/include/libpq/pqsignal.h

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*-------------------------------------------------------------------------
 
2
 *
 
3
 * pqsignal.h
 
4
 *        prototypes for the reliable BSD-style signal(2) routine.
 
5
 *
 
6
 *
 
7
 * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
 
8
 * Portions Copyright (c) 1994, Regents of the University of California
 
9
 *
 
10
 * $PostgreSQL: pgsql/src/include/libpq/pqsignal.h,v 1.29 2004-12-31 22:03:32 pgsql Exp $
 
11
 *
 
12
 * NOTES
 
13
 *        This shouldn't be in libpq, but the monitor and some other
 
14
 *        things need it...
 
15
 *
 
16
 *-------------------------------------------------------------------------
 
17
 */
 
18
#ifndef PQSIGNAL_H
 
19
#define PQSIGNAL_H
 
20
 
 
21
#include <signal.h>
 
22
 
 
23
#ifdef HAVE_SIGPROCMASK
 
24
extern sigset_t UnBlockSig,
 
25
                        BlockSig,
 
26
                        AuthBlockSig;
 
27
 
 
28
#define PG_SETMASK(mask)        sigprocmask(SIG_SETMASK, mask, NULL)
 
29
#else
 
30
extern int      UnBlockSig,
 
31
                        BlockSig,
 
32
                        AuthBlockSig;
 
33
 
 
34
#ifndef WIN32
 
35
#define PG_SETMASK(mask)        sigsetmask(*((int*)(mask)))
 
36
#else
 
37
#define PG_SETMASK(mask)                pqsigsetmask(*((int*)(mask)))
 
38
int                     pqsigsetmask(int mask);
 
39
#endif
 
40
#endif
 
41
 
 
42
typedef void (*pqsigfunc) (int);
 
43
 
 
44
extern void pqinitmask(void);
 
45
 
 
46
extern pqsigfunc pqsignal(int signo, pqsigfunc func);
 
47
 
 
48
#endif   /* PQSIGNAL_H */