Hmm, this makes it appear that fstatat always fails if its flags argument is zero, which makes the AIX bug worse than what we thought. Can you please test this guess by trying the following test program and seeing what its exit status is?
#include <fcntl.h>
#include <sys/stat.h>
int
main (void)
{
struct stat a;
int fd = open (".", O_RDONLY);
if (fd < 0)
return 1;
if (fstatat (fd, ".", &a, 0) != 0)
return 2;
return 0;
}
