Browse Source

Mark stub functions as such.

Giovanni Mascellani 5 years ago
parent
commit
2d40f01775

+ 1 - 0
diskfs/stdlib/fcntl.h

@@ -9,6 +9,7 @@
 #define O_CREAT (1 << 2)
 #define O_TRUNC (1 << 3)
 
+// STUB
 int open(const char *path, int oflag, ...) {
     return -1;
 }

+ 4 - 0
diskfs/stdlib/stdio.h

@@ -36,6 +36,7 @@ char *itoa(unsigned int x) {
   return __handles->itoa(x);
 }
 
+// STUB
 int sscanf(const char *buffer, const char *format, ...) {
     abort();
 }
@@ -45,14 +46,17 @@ int fflush(FILE *stream) {
     return 0;
 }
 
+// STUB
 size_t fwrite(const void *buffer, size_t size, size_t count, FILE *stream) {
     abort();
 }
 
+// STUB
 FILE *fdopen(int fildes, const char *mode) {
     abort();
 }
 
+// STUB
 int fclose(FILE *stream) {
     abort();
 }

+ 2 - 0
diskfs/stdlib/stdlib.h

@@ -35,10 +35,12 @@ void abort() {
     longjmp(__return_jump_buf, 1);
 }
 
+// STUB
 char *getenv(const char *name) {
     return 0;
 }
 
+// STUB
 int setenv(const char *envname, const char *envval, int overwrite) {
     errno = ENOTIMPL;
     return -1;

+ 1 - 0
diskfs/stdlib/sys/stat.h

@@ -20,6 +20,7 @@
 #define S_ISGID 02000
 #define S_ISVTX 01000
 
+// STUB
 int chmod(const char *path, mode_t mode) {
     errno = ENOTIMPL;
     return -1;

+ 2 - 0
diskfs/stdlib/time.h

@@ -15,10 +15,12 @@ struct tm {
     int tm_isdst;
 };
 
+// STUB
 struct tm *localtime(const time_t *time) {
     abort();
 }
 
+// STUB
 time_t time(time_t *arg) {
     abort();
 }

+ 7 - 0
diskfs/stdlib/unistd.h

@@ -4,36 +4,43 @@
 #include "sys/stat.h"
 #include "errno.h"
 
+// STUB
 int access(const char *path, int amode) {
     errno = ENOTIMPL;
     return -1;
 }
 
+// STUB
 int isatty(int fildes) {
     errno = ENOTIMPL;
     return 0;
 }
 
+// STUB
 ssize_t read(int fildes, void *buf, size_t nbyte) {
     errno = ENOTIMPL;
     return -1;
 }
 
+// STUB
 char *getcwd(char *buf, size_t size) {
     errno = ENOTIMPL;
     return -1;
 }
 
+// STUB
 int unlink(const char *path) {
     errno = ENOTIMPL;
     return -1;
 }
 
+// STUB
 off_t lseek(int fildes, off_t offset, int whence) {
     errno = ENOTIMPL;
     return -1;
 }
 
+// STUB
 int close(int fildes) {
     errno = ENOTIMPL;
     return -1;