diff options
author | Bruce Momjian <bruce@momjian.us> | 2004-01-09 02:02:43 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2004-01-09 02:02:43 +0000 |
commit | 0150dbdce54f24596547048d4d6617d62a2570a4 (patch) | |
tree | b2093a0e2efb39f29ce45bc3464b25dd6b298fba /src/interfaces/libpq/libpq-int.h | |
parent | acc57543debdd2de93c2c5df31702ef8ecd461b5 (diff) |
Allow libpq to do thread-safe SIGPIPE handling. This allows it to
ignore SIGPIPE from send() in libpq, but terminate on any other SIGPIPE,
unless the user installs their own signal handler.
This is a minor fix because the only time you get SIGPIPE from libpq's
send() is when the backend dies.
Diffstat (limited to 'src/interfaces/libpq/libpq-int.h')
-rw-r--r-- | src/interfaces/libpq/libpq-int.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/interfaces/libpq/libpq-int.h b/src/interfaces/libpq/libpq-int.h index fff2bf5d674..97cd55eaa8a 100644 --- a/src/interfaces/libpq/libpq-int.h +++ b/src/interfaces/libpq/libpq-int.h @@ -12,7 +12,7 @@ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/interfaces/libpq/libpq-int.h,v 1.83 2003/11/29 22:41:28 pgsql Exp $ + * $PostgreSQL: pgsql/src/interfaces/libpq/libpq-int.h,v 1.84 2004/01/09 02:02:43 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -29,6 +29,9 @@ #include <sys/time.h> #endif +#ifdef ENABLE_THREAD_SAFETY +#include <pthread.h> +#endif #if defined(WIN32) && (!defined(ssize_t)) typedef int ssize_t; /* ssize_t doesn't exist in VC (at least @@ -442,6 +445,10 @@ extern PostgresPollingStatusType pqsecure_open_client(PGconn *); extern void pqsecure_close(PGconn *); extern ssize_t pqsecure_read(PGconn *, void *ptr, size_t len); extern ssize_t pqsecure_write(PGconn *, const void *ptr, size_t len); +#ifdef ENABLE_THREAD_SAFETY +extern void check_sigpipe_handler(void); +extern pthread_key_t thread_in_send; +#endif /* * this is so that we can check if a connection is non-blocking internally |