diff options
Diffstat (limited to 'src/libc/unistd.c')
-rw-r--r-- | src/libc/unistd.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/libc/unistd.c b/src/libc/unistd.c index 578cadc..549da89 100644 --- a/src/libc/unistd.c +++ b/src/libc/unistd.c @@ -51,6 +51,11 @@ int unlink(const char *path) { return 0; } +int rmdir(const char *path) { + (void)path; + __libc_panic("unimplemented"); +} + int symlink(const char *path1, const char *path2) { (void)path1; (void)path2; errno = ENOSYS; @@ -67,6 +72,11 @@ int execv(const char *path, char *const argv[]) { return execve(path, argv, NULL); } +int execvp(const char *path, char *const argv[]) { + // TODO execvp + return execve(path, argv, NULL); +} + int execve(const char *path, char *const argv[], char *const envp[]) { FILE *file = fopen(path, "e"); char hdr[4] = {0}; @@ -160,6 +170,12 @@ uid_t geteuid(void) { return 0; } gid_t getgid(void) { return 0; } gid_t getegid(void) { return 0; } +int access(const char *path, int mode) { + // TODO impl access() + (void)path; (void)mode; + return 0; +} + int chown(const char *path, uid_t owner, gid_t group) { (void)path; (void)owner; (void)group; errno = ENOSYS; @@ -213,11 +229,21 @@ int pipe(int pipefd[2]) { __libc_panic("unimplemented"); } +int dup(int oldfd) { + (void)oldfd; + __libc_panic("unimplemented"); +} + int dup2(int oldfd, int newfd) { (void)oldfd; (void)newfd; __libc_panic("unimplemented"); } +unsigned int sleep(unsigned int seconds) { + _sys_sleep(seconds * 1000); + return 0; +} + size_t absolutepath(char *out, const char *in, size_t size) { const char *realcwd = getrealcwd(); size_t len, pos = 0; |