• 1 reply
  • Latest Post - ‏2012-10-09T18:27:34Z by dmcbride
37 Posts

Pinned topic AIX 7.1: fstatat() returns EINVAL on valid arguments

‏2012-03-13T10:58:32Z |

fstatat() is new in AIX 7.1, but does not work as expected (and specified).

Here is an example that shows the problem:

$ cat test.c   #include <fcntl.h> #include <sys/stat.h> #include <errno.h> #include <stdio.h>   

int main (

{ struct stat a; 

if (fstatat (AT_FDCWD, 
".", &a, 0) != 0) 
{ perror(

return errno; 

return 0; 
}   $ xlc -o test test.c $ ./test fstatat: Invalid argument $ echo $? 22

The workaround used (by developers) is to not use fstatat at all, still leaving applications open to race conditions fstatat ought to fix.

As this does not block production use here, I'll be unable to file an APAR - maybe someone else can do?

Thank you!
Updated on 2012-10-09T18:27:34Z at 2012-10-09T18:27:34Z by dmcbride
  • dmcbride
    1 Post

    Re: AIX 7.1: fstatat() returns EINVAL on valid arguments

    I think you're looking for this:

    (Posting here because your post ranked higher in google, so anyone else searching for fstatat on AIX will see the link to the APAR.)