summaryrefslogtreecommitdiff
path: root/Libraries/LibC
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibC')
-rw-r--r--Libraries/LibC/stdio.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Libraries/LibC/stdio.cpp b/Libraries/LibC/stdio.cpp
index 0f5e5ee5dc..e57f9b8245 100644
--- a/Libraries/LibC/stdio.cpp
+++ b/Libraries/LibC/stdio.cpp
@@ -498,6 +498,10 @@ FILE* fopen(const char* pathname, const char* mode)
flags = O_WRONLY | O_CREAT | O_TRUNC;
else if (!strcmp(mode, "w+") || !strcmp(mode, "wb+"))
flags = O_RDWR | O_CREAT | O_TRUNC;
+ else if (!strcmp(mode, "a") || !strcmp(mode, "ab"))
+ flags = O_WRONLY | O_APPEND | O_CREAT;
+ else if (!strcmp(mode, "a+") || !strcmp(mode, "ab+"))
+ flags = O_RDWR | O_APPEND | O_CREAT;
else {
fprintf(stderr, "FIXME(LibC): fopen('%s', '%s')\n", pathname, mode);
ASSERT_NOT_REACHED();