From 8724ef15da2988efdbd3051bdcf2cd1fd33ee454 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sun, 10 Aug 2025 04:40:40 -0400 Subject: lib: libc: Add "rb" mode for fopen() This commit adds the "rb" mode for compatibility purposes. It is mapped to the same file seal as "r". Signed-off-by: Ian Moffett --- lib/libc/src/stdio/fopen.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/libc/src/stdio/fopen.c') 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; } -- cgit v1.2.3