8 #include <sys/syscall.h>
10 struct linux_dirent64 {
13 unsigned short d_reclen;
22 main(int argc, char *argv[])
26 struct linux_dirent64 *d;
29 fd = open(argv[1], O_RDONLY | O_DIRECTORY);
36 nread = syscall(SYS_getdents64, fd, buf, BUF_SIZE);
45 for (bpos = 0; bpos < nread;) {
46 d = (struct linux_dirent64 *) (buf + bpos);
48 * Can't use off_t here xfsqa is compiled with
49 * -D_FILE_OFFSET_BITS=64
51 if (d->d_off != (long)d->d_off) {
52 fprintf(stderr, "detected d_off truncation "
53 "d_name = %s, d_off = %lld\n",
54 d->d_name, (long long)d->d_off);