diff options
author | Ian Moffett <ian@osmora.org> | 2025-08-10 04:40:40 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-08-10 04:40:40 -0400 |
commit | 8724ef15da2988efdbd3051bdcf2cd1fd33ee454 (patch) | |
tree | 170f4da8e38ecc99d8ec3bc975e611ea0f177b7c /lib/libc/src/stdio/fopen.c | |
parent | 56e7673cc083b52e0d68354b28f360fe4d1791f3 (diff) |
lib: libc: Add "rb" mode for fopen()expt
This commit adds the "rb" mode for compatibility purposes. It is mapped
to the same file seal as "r".
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'lib/libc/src/stdio/fopen.c')
-rw-r--r-- | lib/libc/src/stdio/fopen.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libc/src/stdio/fopen.c b/lib/libc/src/stdio/fopen.c index c15dace..efeb577 100644 --- a/lib/libc/src/stdio/fopen.c +++ b/lib/libc/src/stdio/fopen.c @@ -51,6 +51,8 @@ fopen(const char *__restrict path, const char *__restrict mode) seal |= (O_WRONLY | O_CREAT); } else if (strcmp(mode, "r+") == 0) { seal |= O_RDWR; + } else if (strcmp(mode, "rb") == 0) { + seal |= O_RDONLY; } else { return NULL; } |