zephyr/lib/libc
Chris Friedt ba8025fcd4 newlib: correct signature of _open() for xtensa
Previously, in libc-hooks.c, the signature of `_open()` was as
shown below.

```cpp
int _open(const char *name, int mode);
```

This conflicted with the signature of `_open()` from newlib,
which is

```cpp
int _open(const char *name, int flags, ...);
```

Moreover, the mode and flags field were reversed, but only for
the Xtensa architecture due to the `_open_r()` hook that is
present in `libc-hooks.c`.

This manifested itself via a call to `fopen(file, "w+")`, where
the expected flags should include `O_CREAT | O_TRUNC`, or
`0x200 | 0x400`. Instead, the unexpected flags passed to the
underlying `zvfs_open()` call were `0x1b6`.

This change corrects the function signature and order of the
arguments.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-01-05 09:56:54 +01:00
..
arcmwdt libc: arcmwdt: increase the number of preallocated locks 2024-12-03 02:37:16 +01:00
armstdc arch: deprecate _current 2024-11-23 20:12:24 -05:00
common lib: libc: common: time: Add toolchain include 2024-09-26 13:31:03 -05:00
minimal lib: libc: select POSIX_C_LANG_SUPPORT_R 2024-12-10 08:06:25 +01:00
newlib newlib: correct signature of _open() for xtensa 2025-01-05 09:56:54 +01:00
picolibc picolibc: Disable LTO while building picolibc bits 2024-12-20 00:49:56 +01:00
CMakeLists.txt lib: syscalls: use zephyr_syscall_header 2023-06-17 07:57:45 -04:00
Kconfig lib: libc: newlib: Don't replace newlib libc time _r functions 2024-12-10 08:06:25 +01:00