From ede58f88397ad32f4d573d17811279735e2e386a Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sat, 10 Jun 2023 17:20:13 +0200 Subject: libc: basic signal stubs, non-spec-compliant write() stub --- src/user/lib/unistd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/user/lib/unistd.c') 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 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]) { -- cgit v1.2.3