fstat seems broken on sparc64

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,


I noticed 64-bit tar incorrectly creating symlinks, and isolated this to 
this testcase:

---
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>

int main(void)
{
	struct stat sb;
	int fd = open("foo", O_RDWR | O_CREAT, 0666);

	if (fd < 0)
		abort();
	if (fstat(fd, &sb) < 0)
		abort();
	printf("%lu.%lu\n", sb.st_mtim.tv_sec, sb.st_mtim.tv_nsec);
	if (stat("foo", &sb) < 0)
		abort();
	printf("%lu.%lu\n", sb.st_mtim.tv_sec, sb.st_mtim.tv_nsec);
	if (fstatat(AT_FDCWD, "foo", &sb, 0) < 0)
		abort();
	printf("%lu.%lu\n", sb.st_mtim.tv_sec, sb.st_mtim.tv_nsec);
	return 0;
}
---

Compile with -m64. The problem does not show up with -m32.

Linux ares 2.6.32 #16 SMP Sat Dec 5 21:02:04 CET 2009 sparc64 sparc64 
sparc64 GNU/Linux [sun4v]

This testcase will print, for example:

1260745109.0
1260745109.876573675
1260745109.876573675

So on a quick glance, fstat64 looks broken.
I am trying to look at it further, but I hope you can beat me to it ;-)


Jan
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux