Procházet zdrojové kódy

feat(gblibc): add ferror_unlocked

greatbridf před 2 roky
rodič
revize
2298a86ef1
2 změnil soubory, kde provedl 7 přidání a 0 odebrání
  1. 1 0
      gblibc/include/stdio.h
  2. 6 0
      gblibc/src/stdio.c

+ 1 - 0
gblibc/include/stdio.h

@@ -57,6 +57,7 @@ int fgetc(FILE* stream);
 int fputc(int character, FILE* stream);
 
 int ferror(FILE* stream);
+int ferror_unlocked(FILE* stream);
 int feof(FILE* stream);
 void clearerr(FILE* stream);
 

+ 6 - 0
gblibc/src/stdio.c

@@ -792,6 +792,12 @@ int fgetc(FILE* stream)
 }
 
 int ferror(FILE* stream)
+{
+    // TODO: lock the stream
+    return ferror_unlocked(stream);
+}
+
+int ferror_unlocked(FILE* stream)
 {
     return stream->flags & FILE_ERROR;
 }