Eneboo - Documentación para desarrolladores
|
00001 /*------------------------------------------------------------------------- 00002 * 00003 * pqsignal.h 00004 * prototypes for the reliable BSD-style signal(2) routine. 00005 * 00006 * 00007 * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group 00008 * Portions Copyright (c) 1994, Regents of the University of California 00009 * 00010 * $PostgreSQL: pgsql/src/include/libpq/pqsignal.h,v 1.29 2004/12/31 22:03:32 pgsql Exp $ 00011 * 00012 * NOTES 00013 * This shouldn't be in libpq, but the monitor and some other 00014 * things need it... 00015 * 00016 *------------------------------------------------------------------------- 00017 */ 00018 #ifndef PQSIGNAL_H 00019 #define PQSIGNAL_H 00020 00021 #include <signal.h> 00022 00023 #ifdef HAVE_SIGPROCMASK 00024 extern sigset_t UnBlockSig, 00025 BlockSig, 00026 AuthBlockSig; 00027 00028 #define PG_SETMASK(mask) sigprocmask(SIG_SETMASK, mask, NULL) 00029 #else 00030 extern int UnBlockSig, 00031 BlockSig, 00032 AuthBlockSig; 00033 00034 #ifndef WIN32 00035 #define PG_SETMASK(mask) sigsetmask(*((int*)(mask))) 00036 #else 00037 #define PG_SETMASK(mask) pqsigsetmask(*((int*)(mask))) 00038 int pqsigsetmask(int mask); 00039 #endif 00040 #endif 00041 00042 typedef void (*pqsigfunc) (int); 00043 00044 extern void pqinitmask(void); 00045 00046 extern pqsigfunc pqsignal(int signo, pqsigfunc func); 00047 00048 #endif /* PQSIGNAL_H */