On 08/01/10 16:18, Eric Blake wrote:
According to Voelker, Bernhard on 1/8/2010 7:40 AM:

FAIL: touch/no-dereference (exit: 1)
====================================

+ grep '^#define HAVE_UTIMENSAT' /home/berny/depot/coreutils-8.3/lib/config.h
+ touch -h dangling
touch: setting times of `dangling': Function not implemented

The test is assuming that because glibc declared utimensat, that it will
work.  But obviously it doesn't, because your kernel is too old.  I don't
know of any better way to filter out this test, other than to add logic
that skips (rather than fails) if touch dies with ENOSYS.

Yes we should skip in this case, and there are probably
lots of other tests that would need skipping on unsupported
operations also. Detecting "unsupported" generally though may
be tricky as I'm not sure can we depend on particular error numbers.
Perhaps we could map the names using something like:

not_supported() {
  errnos=$(
    echo "#include <errno.h>" |
    cpp -dD |
    grep -E "#define E(NOSYS|OPNOTSUPP|NOTSUP|NOTTY)" |
    tr -cd '[:digit:]\n' |
    tr '\n' '|' | sed 's/|*$//'
  )
  eval "case $1 in $errnos) return 0 ;; esac"
  return 1
}

Though that depends on cpp and errno.h being present,
and is too hacky/slow. Probably a perl snippet using
Errno is more appropriate.

cheers,
Pádraig.


Reply via email to