1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:58:12 +00:00

LibC: Minor changes to make nasm work

* Added some missing macros to headers
 * Stubbed strftime() time function to not assert
 * Added "rt" mode to fopen(), working just like "r" or "rb"
This commit is contained in:
Paweł Cholewa 2019-11-08 21:39:31 +01:00 committed by Andreas Kling
parent aba6e6de6a
commit c2a8c4cedd
5 changed files with 20 additions and 3 deletions

View file

@ -437,7 +437,9 @@ void perror(const char* s)
FILE* fopen(const char* pathname, const char* mode)
{
int flags = 0;
if (!strcmp(mode, "r") || !strcmp(mode, "rb"))
// NOTE: rt is a non-standard mode which opens a file for read, explicitly
// specifying that it's a text file
if (!strcmp(mode, "r") || !strcmp(mode, "rb") || !strcmp(mode, "rt"))
flags = O_RDONLY;
else if (!strcmp(mode, "r+") || !strcmp(mode, "rb+"))
flags = O_RDWR;