summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-01-21 22:24:39 -0800
committerKaz Kyheku <kaz@kylheku.com>2020-01-21 22:24:39 -0800
commit2f9a61fab155d577b8618a64fef8a755cc15f2f8 (patch)
tree940fccab0345f22181c35f0ef73f7ffc5b277a1d /configure
parent72eff372aefb86ca8ae5ad2e95f01d4cc9e0ec78 (diff)
downloadtxr-2f9a61fab155d577b8618a64fef8a755cc15f2f8.tar.gz
txr-2f9a61fab155d577b8618a64fef8a755cc15f2f8.tar.bz2
txr-2f9a61fab155d577b8618a64fef8a755cc15f2f8.zip
New functions utimes, lutimes.
* configure: Detect various functions for setting file timestamps. * sysif.c (get_fd): Define this function for use by utimes also. (timens, do_utimes): New static functions. (wrap_utimes, wrap_lutimes): New static functions. (sysif_init): Register utimes and lutimes intrinsics. * txr.1: Documented.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure108
1 files changed, 108 insertions, 0 deletions
diff --git a/configure b/configure
index 85336937..c3b84a64 100755
--- a/configure
+++ b/configure
@@ -1708,6 +1708,114 @@ int main(void)
fi
#
+# utime, utimes, utimensat and futimens
+#
+
+printf "Checking for utime ... "
+
+cat > conftest.c <<!
+#include <utime.h>
+
+int main(void)
+{
+ struct utimbuf utb;
+ int res = utime("path", &utb);
+ return 0;
+}
+!
+
+if conftest ; then
+ printf "yes\n"
+ printf "#define HAVE_UTIME 1\n" >> config.h
+else
+ printf "no\n"
+fi
+
+printf "Checking for utimes ... "
+
+cat > conftest.c <<!
+#include <sys/time.h>
+
+int main(void)
+{
+ struct timeval tv[2];
+ int res = utimes("path", tv);
+ return 0;
+}
+!
+
+if conftest ; then
+ printf "yes\n"
+ printf "#define HAVE_UTIMES 1\n" >> config.h
+else
+ printf "no\n"
+fi
+
+printf "Checking for futimes ... "
+
+cat > conftest.c <<!
+#include <sys/time.h>
+
+int main(void)
+{
+ struct timeval tv[2];
+ int res = futimes(42, tv);
+ return 0;
+}
+!
+
+if conftest ; then
+ printf "yes\n"
+ printf "#define HAVE_FUTIMES 1\n" >> config.h
+else
+ printf "no\n"
+fi
+
+printf "Checking for lutimes ... "
+
+cat > conftest.c <<!
+#include <sys/time.h>
+
+int main(void)
+{
+ struct timeval tv[2];
+ int res = lutimes("path", tv);
+ return 0;
+}
+!
+
+if conftest ; then
+ printf "yes\n"
+ printf "#define HAVE_LUTIMES 1\n" >> config.h
+else
+ printf "no\n"
+fi
+
+printf "Checking for utimensat and futimens ... "
+
+cat > conftest.c <<!
+#include <sys/stat.h>
+#include <fcntl.h>
+
+int main(void)
+{
+ struct timespec ts[2];
+ int resu = utimensat(AT_FDCWD, "path", ts, AT_SYMLINK_NOFOLLOW);
+ int resf = futimens(0, ts);
+ return 0;
+}
+!
+
+if conftest ; then
+ printf "yes\n"
+ printf "#define HAVE_FUTIMENS 1\n" >> config.h
+else
+ printf "no\n"
+fi
+
+printf "#define HAVE_FILE_STAMP_CHANGE " >> config.h
+printf "(HAVE_UTIMES || HAVE_FUTIMES || HAVE_FUTIMENS)\n" >> config.h
+#
# environ
#