in newlib _default_fcntl.h, it defines O_NONBLOCK as follows:
\#define _FNONBLOCK 0x4000 /* non blocking I/O (POSIX style) */
But it is different from linux definition(04000=0x800):
\#define O_NONBLOCK
00004000
This difference confused virtio-9p open() syscall. If you open a
file with O_NONBLOCK(is 0x4000 in newlib) and sys_open will regard
it as O_DIRECTORY. At last it returns a ENOTDIR error.
Signed-off-by: Jia He <justin.he@arm.com>
Reviewed-by: Razvan Deaconescu <razvan.deaconescu@cs.pub.ro>
#define O_DIRECT 040000
#define O_NOATIME 01000000
#elif ((defined CONFIG_ARCH_ARM_64) || (defined CONFIG_ARCH_ARM_32))
+#undef O_NONBLOCK
+#define O_NONBLOCK 04000
#define O_NOFOLLOW 0100000
#define O_DIRECTORY 040000
#define O_CLOEXEC 02000000