summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-09-23 00:15:46 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-09-23 00:15:46 -0700
commit2df419cdb5295b405a98d24f0226cb42bfbf37d2 (patch)
tree8573aac3d9beecd34b10387df4147e1cc518bcc0 /configure
parent9e197d1ef054cd389a3ed89cfe66f80ac1a979f2 (diff)
downloadtxr-2df419cdb5295b405a98d24f0226cb42bfbf37d2.tar.gz
txr-2df419cdb5295b405a98d24f0226cb42bfbf37d2.tar.bz2
txr-2df419cdb5295b405a98d24f0226cb42bfbf37d2.zip
New function: rlink.
This uses the linkat function to implement a variant of link which resolves the source object if it is a symlink. * configure: test for linkat. * sysif.c (link_wrap_common): New static function, used by both link_wrap and rlink_wrap. (link_wrap): Now a one-liner which calls link_wrap_common. (rlink_wrap): New static function. (sysif_init): Register rlink intrinsic. * txr.1: Documented.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure20
1 files changed, 20 insertions, 0 deletions
diff --git a/configure b/configure
index 51f7723c..256abb72 100755
--- a/configure
+++ b/configure
@@ -2665,6 +2665,26 @@ else
printf "no\n"
fi
+printf "Checking for linkat ... "
+
+cat > conftest.c <<!
+#include <unistd.h>
+#include <fcntl.h>
+
+int main(void)
+{
+ int e1 = linkat(AT_FDCWD, "foo", AT_FDCWD, "bar", AT_SYMLINK_FOLLOW);
+ return 0;
+}
+!
+if conftest ; then
+ printf "yes\n"
+ printf "#define HAVE_LINKAT 1\n" >> config.h
+ have_unistd=y
+else
+ printf "no\n"
+fi
+
printf "Checking for POSIX mkdir ... "
cat > conftest.c <<!