gittup/tup — comment on commit 25646fa8bc10a6efca784c659f002003b980b990
File: src/tup/server/fuse_fs.c line 847
By bnoordhuis:

That will fail if someone compiles against glibc headers that are newer than glibc itself (like when the user installs the binary onto another system).

What I'd do is to try the syscall directly and fall back to `futimesat()` if it returns ENOSYS.

```c
#include
#include

static int utimensat(int dfd, const char *path, const struct timespec times[2], int flags)
{
#if __NR_utimensat
if (!syscall(__NR_utimensat, dfd, path, times, flags)) return 0;
if (errno != ENOSYS) return -1;
#endif
return fallback_futimesat(dfd, path, times);
}
```

It's not particularly pretty but it works. The ENOSYS case clobbers errno, you may or may not want to fix that.