extern int pg_mkdir_p(char *path, int omode);
/* port/pqsignal.c */
-/* On Windows, we can emulate pqsignal in the backend, but not frontend */
-#if !defined(WIN32) || !defined(FRONTEND)
typedef void (*pqsigfunc) (int signo);
extern pqsigfunc pqsignal(int signo, pqsigfunc func);
-#endif
/* port/quotes.c */
extern char *escape_single_quotes_ascii(const char *src);
* neither POSIX signals nor BSD signals. The alternative is to do
* signal-handler reinstallation, which doesn't work well at all.
*
- * Windows, of course, is resolutely in a class by itself. This file
- * should not get compiled at all on Windows. We have an emulation of
- * pqsignal() in src/backend/port/win32/signal.c for the backend
- * environment; frontend programs are out of luck.
+ * Windows, of course, is resolutely in a class by itself. In the backend,
+ * we don't use this file at all; src/backend/port/win32/signal.c provides
+ * pqsignal() for the backend environment. Frontend programs can use
+ * this version of pqsignal() if they wish, but beware that Windows
+ * requires signal-handler reinstallation, because indeed it provides
+ * neither POSIX signals nor BSD signals :-(
* ------------------------------------------------------------------------
*/
#include
-#ifndef WIN32
+#if !defined(WIN32) || defined(FRONTEND)
/*
* Set up a signal handler for signal "signo"
*
- * Returns the previous handler. It's expected that the installed handler
- * will persist across multiple deliveries of the signal (unlike the original
- * POSIX definition of signal(2)).
+ * Returns the previous handler.
*/
pqsigfunc
pqsignal(int signo, pqsigfunc func)
#endif /* !HAVE_POSIX_SIGNALS */
}
-#endif /* WIN32 */
+#endif /* !defined(WIN32) || defined(FRONTEND) */
chklocale.c crypt.c fls.c fseeko.c getrusage.c inet_aton.c random.c
srandom.c getaddrinfo.c gettimeofday.c inet_net_ntop.c kill.c open.c
erand48.c snprintf.c strlcat.c strlcpy.c dirmod.c exec.c noblock.c path.c
- pgcheckdir.c pg_crc.c pgmkdirp.c pgsleep.c pgstrcasecmp.c qsort.c qsort_arg.c quotes.c
+ pgcheckdir.c pg_crc.c pgmkdirp.c pgsleep.c pgstrcasecmp.c pqsignal.c
+ qsort.c qsort_arg.c quotes.c
sprompt.c tar.c thread.c wait_error.c getopt.c getopt_long.c dirent.c rint.c win32env.c
win32error.c win32setlocale.c);