Topic
1 reply Latest Post - ‏2012-10-09T18:27:34Z by dmcbride
haubi
haubi
37 Posts
ACCEPTED ANSWER

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

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

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 (

void) 
{ struct stat a; 

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

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!
/haubi/
Updated on 2012-10-09T18:27:34Z at 2012-10-09T18:27:34Z by dmcbride
  • dmcbride
    dmcbride
    1 Post
    ACCEPTED ANSWER

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

    ‏2012-10-09T18:27:34Z  in response to haubi
    I think you're looking for this:

    http://www-01.ibm.com/support/docview.wss?uid=isg1IV23716

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