Hi, When I executed below source in qemu-arm user binary, It was failed with Invalid Argument.
gcc lseek_test.c -o lseek_test -D_FILE_OFFSET_BITS=64 ./lseek_test error: Invalid argument It seems the qemu-arm user does not support the D_FILE_OFFSET_BITS flag. Is it a known issue or I had wrong test procedure on qemu-arm user environment? #include <stdio.h> #include <sys/types.h> #include <unistd.h> #include <stdlib.h> #include <errno.h> #include <string.h> #include <sys/stat.h> #include <fcntl.h> int main() { int fd, ret; off_t pos = 2*1024*1024*1024 + 10; // over 2G fd = open("large_file", O_CREAT | O_WRONLY | O_TRUNC, 0666); if (fd < 0){ fprintf(stderr, "%s\n", strerror(errno)); exit(1); } if (lseek(fd, pos, SEEK_SET) < 0) { //fprintf(stderr, "Failed seeking to %zu, %d\n", pos, errno); perror("error"); exit(1); } write(fd, "TEST", 4); close(fd); close(fd); return 0; } -- Best Regards, Chanho Park