diff --git a/kernel/src/sys/stat.cpp b/kernel/src/sys/stat.cpp index 49a5ad10..8233e715 100644 --- a/kernel/src/sys/stat.cpp +++ b/kernel/src/sys/stat.cpp @@ -16,6 +16,9 @@ struct stat // FIXME: This struct is quite stubbed out. int st_dev; // FIXME: Implement this. uid_t st_uid; gid_t st_gid; + time_t st_atime; // Not implemented. + time_t st_mtime; // Not implemented. + time_t st_ctime; // Not implemented. }; void do_stat(Context* context, VFS::Node* node, struct stat* buf) diff --git a/libs/libc/include/errno.h b/libs/libc/include/errno.h index 239b0c42..3d3029c5 100644 --- a/libs/libc/include/errno.h +++ b/libs/libc/include/errno.h @@ -8,6 +8,7 @@ extern int errno; #define ENOENT 2 // No such file or directory #define ESRCH 3 // No such process #define EINTR 4 // Interrupted system call. Not implemented. +#define EIO 5 // Input/output error. Not implemented. #define E2BIG 7 // Argument list too long #define ENOEXEC 8 // Exec format error #define EBADF 9 // Bad file descriptor @@ -21,8 +22,10 @@ extern int errno; #define EINVAL 22 // Invalid argument #define EMFILE 24 // Too many open files #define ENOTTY 25 // Inappropriate ioctl for device +#define EFBIG 27 // File too large. Not implemented. #define ENOSPC 28 // No space left on device #define EPIPE 32 // Broken pipe. Not implemented. +#define EDOM 33 // Numerical argument out of domain. Not implemented. #define ERANGE 34 // Numerical result out of range #define ENOSYS 38 // Function not implemented #define ENOTSUP 95 // Operation not supported diff --git a/libs/libc/include/stdio.h b/libs/libc/include/stdio.h index 0ceec611..6157c1b3 100644 --- a/libs/libc/include/stdio.h +++ b/libs/libc/include/stdio.h @@ -142,6 +142,7 @@ extern "C" int vsnprintf(char* str, size_t max, const char* format, va_list ap); int sscanf(const char*, const char*, ...); // Not implemented. + int fscanf(FILE*, const char*, ...); // Not implemented. /* Writes the string str followed by a trailing newline to stdout. */ int puts(const char* str); diff --git a/libs/libc/include/stdlib.h b/libs/libc/include/stdlib.h index 261c2106..ab7dd870 100644 --- a/libs/libc/include/stdlib.h +++ b/libs/libc/include/stdlib.h @@ -109,6 +109,11 @@ extern "C" void qsort(void*, size_t, size_t, int (*)(const void*, const void*)); // Not implemented. + size_t mbstowcs(wchar_t* dest, const char* src, + size_t n); // Not implemented. + + char* mktemp(char* base); // Not implemented. + #ifdef __cplusplus } #endif diff --git a/libs/libc/include/sys/param.h b/libs/libc/include/sys/param.h new file mode 100644 index 00000000..e69de29b diff --git a/libs/libc/include/sys/stat.h b/libs/libc/include/sys/stat.h index e96c766f..f45710d1 100644 --- a/libs/libc/include/sys/stat.h +++ b/libs/libc/include/sys/stat.h @@ -12,6 +12,9 @@ struct stat // FIXME: This struct is quite stubbed out. int st_dev; // Not implemented. uid_t st_uid; gid_t st_gid; + time_t st_atime; // Not implemented. + time_t st_mtime; // Not implemented. + time_t st_ctime; // Not implemented. }; /* Type of file. */ @@ -61,6 +64,9 @@ extern "C" /* Returns information about the file pointed at path in buf. */ int stat(const char* pathname, struct stat* buf); + mode_t umask(mode_t cmask); // Not implemented. + int chmod(const char* pathname, mode_t mode); // Not implemented. + #ifdef __cplusplus } #endif diff --git a/libs/libc/include/time.h b/libs/libc/include/time.h index bd544ad1..cb66f7b3 100644 --- a/libs/libc/include/time.h +++ b/libs/libc/include/time.h @@ -45,6 +45,7 @@ extern "C" struct tm* localtime(const time_t* timep); // Not implemented. struct tm* gmtime(const time_t* timep); // Not implemented. size_t strftime(char* str, size_t max, const char* format, const struct tm* time); // Not implemented. + char* ctime(const time_t* timep); // Not implemented. #ifdef __cplusplus } diff --git a/libs/libc/include/unistd.h b/libs/libc/include/unistd.h index 26bb30ce..835b989f 100644 --- a/libs/libc/include/unistd.h +++ b/libs/libc/include/unistd.h @@ -98,6 +98,8 @@ extern "C" /* Writes the current process's current working directory to buf. */ char* getcwd(char* buf, size_t size); + int unlink(const char* path); // Not implemented. + #ifdef __cplusplus } #endif diff --git a/libs/libc/include/wchar.h b/libs/libc/include/wchar.h new file mode 100644 index 00000000..e69de29b diff --git a/libs/libc/src/stdio.cpp b/libs/libc/src/stdio.cpp index 447689e8..737d0cca 100644 --- a/libs/libc/src/stdio.cpp +++ b/libs/libc/src/stdio.cpp @@ -59,6 +59,11 @@ extern "C" NOT_IMPLEMENTED("sscanf"); } + int fscanf(FILE*, const char*, ...) + { + NOT_IMPLEMENTED("fscanf"); + } + FILE* tmpfile() { errno = ENOTSUP; diff --git a/libs/libc/src/stdlib.cpp b/libs/libc/src/stdlib.cpp index f6e99102..fbe7a3ba 100644 --- a/libs/libc/src/stdlib.cpp +++ b/libs/libc/src/stdlib.cpp @@ -121,4 +121,14 @@ extern "C" { NOT_IMPLEMENTED("qsort"); } + + size_t mbstowcs(wchar_t*, const char*, size_t) + { + NOT_IMPLEMENTED("mbstowcs"); + } + + char* mktemp(char*) + { + NOT_IMPLEMENTED("mktemp"); + } } \ No newline at end of file diff --git a/libs/libc/src/string.cpp b/libs/libc/src/string.cpp index 3e896f85..0695dbc6 100644 --- a/libs/libc/src/string.cpp +++ b/libs/libc/src/string.cpp @@ -261,6 +261,7 @@ extern "C" case ENOENT: return "No such file or directory"; case ESRCH: return "No such process"; case EINTR: return "Interrupted system call"; + case EIO: return "Input/output error"; case E2BIG: return "Argument list too long"; case ENOEXEC: return "Exec format error"; case EBADF: return "Bad file descriptor"; @@ -274,8 +275,10 @@ extern "C" case EINVAL: return "Invalid argument"; case EMFILE: return "Too many open files"; case ENOTTY: return "Inappropriate ioctl for device"; + case EFBIG: return "File too large"; case ENOSPC: return "No space left on device"; case EPIPE: return "Broken pipe"; + case EDOM: return "Numerical argument out of domain"; case ERANGE: return "Numerical result out of range"; case ENOSYS: return "Function not implemented"; case ENOTSUP: return "Operation not supported"; diff --git a/libs/libc/src/sys/stat.cpp b/libs/libc/src/sys/stat.cpp index 769cfb94..936a72f9 100644 --- a/libs/libc/src/sys/stat.cpp +++ b/libs/libc/src/sys/stat.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -18,4 +19,14 @@ extern "C" { return (int)__lc_fast_syscall2(SYS_stat, path, buf); } + + mode_t umask(mode_t) + { + NOT_IMPLEMENTED("umask"); + } + + int chmod(const char*, mode_t) + { + NOT_IMPLEMENTED("chmod"); + } } \ No newline at end of file diff --git a/libs/libc/src/time.cpp b/libs/libc/src/time.cpp index 319507f0..add766b1 100644 --- a/libs/libc/src/time.cpp +++ b/libs/libc/src/time.cpp @@ -34,4 +34,9 @@ extern "C" { NOT_IMPLEMENTED("strftime"); } + + char* ctime(const time_t*) + { + NOT_IMPLEMENTED("ctime"); + } } \ No newline at end of file diff --git a/libs/libc/src/unistd.cpp b/libs/libc/src/unistd.cpp index a781339f..efaadabb 100644 --- a/libs/libc/src/unistd.cpp +++ b/libs/libc/src/unistd.cpp @@ -143,4 +143,9 @@ extern "C" strlcpy(buf, dummy_cwd, 2); return buf; } + + int unlink(const char*) + { + NOT_IMPLEMENTED("unlink"); + } } \ No newline at end of file