diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-09-23 00:15:46 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-09-23 00:15:46 -0700 |
commit | 2df419cdb5295b405a98d24f0226cb42bfbf37d2 (patch) | |
tree | 8573aac3d9beecd34b10387df4147e1cc518bcc0 /configure | |
parent | 9e197d1ef054cd389a3ed89cfe66f80ac1a979f2 (diff) | |
download | txr-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-x | configure | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -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 <<! |