diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-01-21 22:24:39 -0800 |
---|---|---|
committer | Kaz Kyheku <kaz@kylheku.com> | 2020-01-21 22:24:39 -0800 |
commit | 2f9a61fab155d577b8618a64fef8a755cc15f2f8 (patch) | |
tree | 940fccab0345f22181c35f0ef73f7ffc5b277a1d /configure | |
parent | 72eff372aefb86ca8ae5ad2e95f01d4cc9e0ec78 (diff) | |
download | txr-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-x | configure | 108 |
1 files changed, 108 insertions, 0 deletions
@@ -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 # |