Re testing GNUC,

I'm not sure the macro means "targeting Linux", and it seems totally legitimate that a C compiler which doesn't implement any GNU extensions would not define that macro. Musl is quite a likely choice for a non-gnu compiler that wants to compile code to run against the Linux kernel.

only one of these is sys/fanotify.h, which is
> very much a Linuxism feature and it doesn't seem that bad for it to
> fail on weird compilers.