aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--extension/ChangeLog6
-rw-r--r--extension/configh.in3
-rwxr-xr-xextension/configure2
-rw-r--r--extension/configure.ac2
-rw-r--r--extension/select.c5
5 files changed, 16 insertions, 2 deletions
diff --git a/extension/ChangeLog b/extension/ChangeLog
index 244940ec..76427971 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,5 +1,11 @@
2013-07-07 Andrew J. Schorr <aschorr@telemetry-investments.com>
+ * configure.ac (AC_CHECK_FUNCS): Check for fcntl.
+ * select.c (set_non_blocking): Check that fcntl and O_NONBLOCK are
+ available.
+
+2013-07-07 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
* select.c (signal_handler): On platforms lacking sigaction, reset
the signal handler each time a signal is trapped to protect in case
the system resets it to default.
diff --git a/extension/configh.in b/extension/configh.in
index aa5c71e1..847a5193 100644
--- a/extension/configh.in
+++ b/extension/configh.in
@@ -39,6 +39,9 @@
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
+/* Define to 1 if you have the `fcntl' function. */
+#undef HAVE_FCNTL
+
/* Define to 1 if you have the `fdopendir' function. */
#undef HAVE_FDOPENDIR
diff --git a/extension/configure b/extension/configure
index c9cb9a28..efae5568 100755
--- a/extension/configure
+++ b/extension/configure
@@ -14017,7 +14017,7 @@ fi
done
-for ac_func in fdopendir fnmatch gettimeofday \
+for ac_func in fcntl fdopendir fnmatch gettimeofday \
getdtablesize kill nanosleep select sigaction sigprocmask \
GetSystemTimeAsFileTime
do :
diff --git a/extension/configure.ac b/extension/configure.ac
index aca856a0..9571f8db 100644
--- a/extension/configure.ac
+++ b/extension/configure.ac
@@ -70,7 +70,7 @@ AC_HEADER_MAJOR
AC_CHECK_HEADERS(dirent.h fnmatch.h limits.h time.h sys/time.h sys/select.h \
sys/param.h signal.h)
-AC_CHECK_FUNCS(fdopendir fnmatch gettimeofday \
+AC_CHECK_FUNCS(fcntl fdopendir fnmatch gettimeofday \
getdtablesize kill nanosleep select sigaction sigprocmask \
GetSystemTimeAsFileTime)
diff --git a/extension/select.c b/extension/select.c
index 072a562f..9aefaeac 100644
--- a/extension/select.c
+++ b/extension/select.c
@@ -481,6 +481,7 @@ do_select(int nargs, awk_value_t *result)
static int
set_non_blocking(int fd)
{
+#if defined(HAVE_FCNTL) && defined(O_NONBLOCK)
int flags;
if (((flags = fcntl(fd, F_GETFL)) == -1) ||
@@ -489,6 +490,10 @@ set_non_blocking(int fd)
return -1;
}
return 0;
+#else
+ update_ERRNO_string(_("set_non_blocking: not supported on this platform"));
+ return -1;
+#endif
}
/* do_set_non_blocking --- Set a file to be non-blocking */