Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools/nolibc: fix the O_* fcntl/open macro definitions for riscv

When RISCV port was imported in 5.2, the O_* macros were taken with
their octal value and written as-is in hex, resulting in the getdents64()
to fail in nolibc-test.

Fixes: 582e84f7b779 ("tool headers nolibc: add RISCV support") #5.2
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>

authored by

Willy Tarreau and committed by
Paul E. McKenney
00b18da4 1bfbe1f3

+7 -7
+7 -7
tools/include/nolibc/arch-riscv.h
··· 11 11 #define O_RDONLY 0 12 12 #define O_WRONLY 1 13 13 #define O_RDWR 2 14 - #define O_CREAT 0x100 15 - #define O_EXCL 0x200 16 - #define O_NOCTTY 0x400 17 - #define O_TRUNC 0x1000 18 - #define O_APPEND 0x2000 19 - #define O_NONBLOCK 0x4000 20 - #define O_DIRECTORY 0x200000 14 + #define O_CREAT 0x40 15 + #define O_EXCL 0x80 16 + #define O_NOCTTY 0x100 17 + #define O_TRUNC 0x200 18 + #define O_APPEND 0x400 19 + #define O_NONBLOCK 0x800 20 + #define O_DIRECTORY 0x10000 21 21 22 22 struct sys_stat_struct { 23 23 unsigned long st_dev; /* Device. */