summaryrefslogtreecommitdiff
path: root/lib/libc/src/stdio/fopen.c
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-08-10 04:40:40 -0400
committerIan Moffett <ian@osmora.org>2025-08-10 04:40:40 -0400
commit8724ef15da2988efdbd3051bdcf2cd1fd33ee454 (patch)
tree170f4da8e38ecc99d8ec3bc975e611ea0f177b7c /lib/libc/src/stdio/fopen.c
parent56e7673cc083b52e0d68354b28f360fe4d1791f3 (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.c2
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;
}