This repository has been archived by the owner on Apr 13, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
linux-uxer/riscv - fix stat on riscv32 linux-user
riscv32 linux ABI is unique in that it has a 64-bit stat structure on 32-bit vs seperate stat and stat64 syscalls. Test program: #include <stdlib.h> int main (void) { int fd = open ("tmp.file", O_CREAT|O_RDWR, S_IRWXU); if (fd == -1) { perror ("open failed"); exit (1); } struct stat buf; int result = fstat (fd, &buf); if (result == -1) { perror ("fstat failed"); exit (1); } printf ("S_ISREG (buf.st_mode) = %d\n", S_ISREG (buf.st_mode)); return 0; } Expected results: $ riscv32-unknown-linux-gnu-gcc -O2 stat.c -o stat $ qemu-riscv32 stat S_ISREG (buf.st_mode) = 1 Signed-off-by: Michael Clark <mjc@sifive.com>
- Loading branch information