diff options
author | dzwdz | 2023-06-10 17:20:13 +0200 |
---|---|---|
committer | dzwdz | 2023-06-10 17:20:13 +0200 |
commit | ede58f88397ad32f4d573d17811279735e2e386a (patch) | |
tree | ee9de4d7a249934f0f1b0496a21dba26ad33feee /src/user/lib/unistd.c | |
parent | b09263bd64b3408cbd109dacc4b7618d22b02248 (diff) |
libc: basic signal stubs, non-spec-compliant write() stub
Diffstat (limited to 'src/user/lib/unistd.c')
-rw-r--r-- | src/user/lib/unistd.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/user/lib/unistd.c b/src/user/lib/unistd.c index d6f24f8..4323a41 100644 --- a/src/user/lib/unistd.c +++ b/src/user/lib/unistd.c @@ -10,7 +10,8 @@ #include <elfload.h> int errno = 0; -char **environ = {NULL}; +static char *_environ[] = {NULL}; +char **environ = _environ; int fork(void) { return _sys_fork(0, NULL); @@ -203,8 +204,8 @@ ssize_t read(int fd, void *buf, size_t count) { } ssize_t write(int fd, const void *buf, size_t count) { - (void)fd; (void)buf; (void)count; - __libc_panic("unimplemented"); + // TODO real file descriptor emulation - store offsets + return _sys_write(fd, buf, count, -1, 0); } int pipe(int pipefd[2]) { |