On 09/02/11 15:39, Kevin Brott wrote:
> $ echo xxxx > file1
> $ TAR_OPTIONS=--numeric-owner truss src/tar chof archive file1
> ...
> fstatat (-2, "file1", 2ff22688, 0) -> -1; errno = 22 (A system call received a parameter that is not valid.)
> ...
> $ src/tar cf archive file1
> fstatat (-2, "file1", 2ff226a8, 1) -> 0; st_size = 5
That's interesting. It appears that fstatat (AT_FDCWD, ...) works
only if the last argument is 1. Can you reproduce the problem with
the following little test program?
#include <fcntl.h>
#include <sys/stat.h>
int
main (void)
{
struct stat a;
if (fstatat (AT_FDCWD, ".", &a, 0) != 0)
return 1;
return 0;
}
If my guess is right, this returns nonzero exit status, which is a bug.
If my guess is wrong, perhaps you can change the test to make it
"right", by replacing "." with the name of some other file in the
working directory, or by compiling with -D_LARGE_FILES, or by doing
both at the same time.