summaryrefslogtreecommitdiff
path: root/src/user/lib/unistd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/user/lib/unistd.c')
-rw-r--r--src/user/lib/unistd.c7
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]) {