Pádraig Brady wrote: > Jim Meyering wrote: >> Eric Blake wrote: >>> According to Pádraig Brady on 10/5/2009 3:53 PM: >>>>>>> This is a new test, but FC5 is soooo old, >>>>>>> that I'm not sure it's worth worrying about. >>>>>> March 2006? >>>>> The failure is probably a function of the kernel. >>>>> Which is it? >>>> In summary this is what fails: >>>> >>>> $ touch a >>>> $ ln -s a symlink >>>> $ ln -L symlink hardlink >>>> ln: creating hard link `hardlink' => `symlink': Invalid argument >>>> >>>> `man linkat` says that AT_SYMLINK_FOLLOW is only supported since 2.6.18 >>>> and my FC5 system is 2.6.17 >>> This should fix it. I don't have access to FC5, but I tested the new code >>> path by priming the cache (gl_cv_func_linkat_follow=runtime ./configure) >>> along with a temporary setting of have_follow_really=-1 in linkat.c. I >>> also verified that the replacement is not picked up on cygwin 1.7, where >>> AT_SYMLINK_FOLLOW was implemented at the same time as linkat. >>> >>> The patch copies from areadlink.c, as well as link_follow earlier in >>> linkat.c, to create two new fd-relative helpers. For now, I didn't see >>> any reason to expose them, but areadlinkat may someday be worth making >>> into a full-blown module. >> >> Wow, that was quick. Thanks. >> I should have read this first. >> >> I was just reviewing the changes in gnulib and >> see a few that should be included in the imminent coreutils >> beta release, so will probably take this one, too. > > Needs a couple of tweaks.. > > This needs to be added to linkat.c > (seems like it should be refactored somewhere?) > > #ifndef SIZE_MAX > # define SIZE_MAX ((size_t) -1) > #endif > #ifndef SSIZE_MAX > # define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2)) > #endif
This should do it: >From 6f6420cc9705dcfa545a28c674fddf5703e72c86 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyer...@redhat.com> Date: Tue, 6 Oct 2009 11:11:39 +0200 Subject: [PATCH] linkat: avoid compilation failure * lib/linkat.c: Include <stdint.h> for use of SIZE_MAX. --- ChangeLog | 5 +++++ lib/linkat.c | 1 + 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0362497..c942631 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-10-06 Jim Meyering <meyer...@redhat.com> + + linkat: avoid compilation failure + * lib/linkat.c: Include <stdint.h> for use of SIZE_MAX. + 2009-10-05 Eric Blake <e...@byu.net> linkat: support Linux 2.6.17 diff --git a/lib/linkat.c b/lib/linkat.c index f785d09..e0dd8f2 100644 --- a/lib/linkat.c +++ b/lib/linkat.c @@ -23,6 +23,7 @@ #include <errno.h> #include <fcntl.h> #include <limits.h> +#include <stdint.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> -- 1.6.5.rc2.204.g8ea19