Sunflower Full-System Hardware Emulator and Physical System Simulator for Sensor-Driven Systems. Built-in architecture modeling of Hitachi SH (j-core), RISC-V, and more.
Describe the bug
Common file manipulation flags such as O_CREAT have different values in newlib and
native libc implementation (definitely in Linux). There operations such as creation of
a file fail. Related also to issue 164.
Describe the bug Common file manipulation flags such as O_CREAT have different values in newlib and native libc implementation (definitely in Linux). There operations such as creation of a file fail. Related also to issue 164.
Example:
newlib-2.5.0.20170922/newlib/libc/include/sys/_default_fcntl.h:
define _FOPEN (-1) / from sys/file.h, kernel use only /
define _FREAD 0x0001 / read enabled /
define _FWRITE 0x0002 / write enabled /
define _FAPPEND 0x0008 / append (writes guaranteed at the end) /
define _FMARK 0x0010 / internal; mark during gc() /
define _FDEFER 0x0020 / internal; defer for next gc pass /
define _FASYNC 0x0040 / signal pgrp when data ready /
define _FSHLOCK 0x0080 / BSD flock() shared lock present /
define _FEXLOCK 0x0100 / BSD flock() exclusive lock present /
define _FCREAT 0x0200 / open with file create /
define _FTRUNC 0x0400 / open with truncation /
For Ubuntu GLIBC 2.27-3ubuntu1, in /usr/include/bits/fcntl-linux.h:
define O_ACCMODE 0003
define O_RDONLY 00
define O_WRONLY 01
define O_RDWR 02
ifndef O_CREAT
define O_CREAT 0100 / Not fcntl. /
endif
ifndef O_EXCL
define O_EXCL 0200 / Not fcntl. /
endif
ifndef O_NOCTTY
define O_NOCTTY 0400 / Not fcntl. /
endif
ifndef O_TRUNC
define O_TRUNC 01000 / Not fcntl. /
To Reproduce Steps to reproduce the behavior:
Host OS (please complete the following information):