summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-10-21 06:28:41 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-10-21 06:28:41 -0700
commit869c570ea8231596b374fd8fa62b6646d61f234e (patch)
treeccee0827aff58a37b8a3b0ce735646f135d699a2 /configure
parent5ba49381b9cb3fe28771958e5d84c9fc1de1e6cf (diff)
downloadtxr-869c570ea8231596b374fd8fa62b6646d61f234e.tar.gz
txr-869c570ea8231596b374fd8fa62b6646d61f234e.tar.bz2
txr-869c570ea8231596b374fd8fa62b6646d61f234e.zip
Implementing truncate-stream.
* configure: Test for ftruncate and chsize. * stream.c (unimpl_truncate): New static function. (fill_stream_ops): Default the truncate operation to unimpl_truncate. (null_ops): Initialize truncate to unimpl_truncate. (stdio_truncate): New static function. (stdio_ops, tail_ops): Initialize truncate to stdio_truncate. (pipe_ops, dir_ops, string_ops, byte_in_ops, string_out_ops, strlist_out_ops, cat_stream_ops): Initialize truncate to null, so it gets defaulted by fill_stream_ops. (truncate_stream): New function. (stream_init): Register truncate-stream intrinsic. * stream.h (struct strm_ops): New member, truncate. (strm_ops_init): New truncate argument added to macro. (truncate_stream): Declared. *syslog.c (syslog_strm_ops): Initialize truncate to null. * txr.1: Documented.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure34
1 files changed, 34 insertions, 0 deletions
diff --git a/configure b/configure
index 09054bdf..0760afe7 100755
--- a/configure
+++ b/configure
@@ -1953,6 +1953,22 @@ else
printf "no\n"
fi
+printf "Checking for ftruncate ... "
+cat > conftest.c <<!
+#include <unistd.h>
+
+int main(void)
+{
+ int e = ftruncate(0, 42);
+ return 0;
+}
+!
+if conftest ; then
+ printf "yes\n"
+ printf "#define HAVE_FTRUNCATE 1\n" >> $config_h
+else
+ printf "no\n"
+fi
printf "Checking for _wspawnlp ... "
@@ -1975,6 +1991,24 @@ else
printf "no\n"
fi
+printf "Checking for chsize ... "
+cat > conftest.c <<!
+#include <unistd.h>
+
+int main(void)
+{
+ int e = chsize(0, 42);
+ return 0;
+}
+!
+if conftest ; then
+ printf "yes\n"
+ printf "#define HAVE_CHSIZE 1\n" >> $config_h
+else
+ printf "no\n"
+fi
+
+
printf "Checking for log2 ... "
cat > conftest.c <<!