Hi Collin,

> The following test fails on GNU/Hurd:
> 
>     test-utimens.h:80: assertion 'func (BASE "file", ts) == -1' failed
>     FAIL test-utimensat (exit status: 134)
> 
> This is because utimensat does not validate the tv_nsec fields of it's
> arguments.
> 
> I have reported this bug to the hurd component of glibc [1]. And pushed
> the attached patch to fix it in Gnulib.

Thanks for working on this. Two small corrections are needed, though:

1) Your new code use __gnu_hurd__ to test for GNU/Hurd, whereas our
   previous code uses __GNU__. Both are valid, according to
   https://github.com/cpredef/predef/blob/master/OperatingSystems.md
   and a 'git annotate' of gcc/gcc/config/gnu.h and
   clang/lib/Basic/Targets/OSTargets.h .

   Please keep this consistent. Either use __GNU__ here too, or switch to
   using __gnu_hurd__ everywhere. (I would vote for the latter, since
   __gnu_hurd__ is less easy to confuse with __GNUC__.)

2) In the configure-time test in m4/utimensat.m4, you added
     result |= 128;
   However, the exit code of a program is limited to the range 0..127.
   How to merge some of the bits? So far, this test fails with exit code
     - 2 on AIX,
     - 64 on macOS, NetBSD, DragonFly BSD,
     - 66 on Haiku.
   I would therefore replace the bit masks as follows:
     - 8, 16, 32 -> 8
     - 64 -> 16
     - 128 -> 32

Bruno




Reply via email to