summaryrefslogtreecommitdiff
path: root/ulib.c
diff options
context:
space:
mode:
authorrtm <rtm>2006-07-01 21:26:01 +0000
committerrtm <rtm>2006-07-01 21:26:01 +0000
commit8b4e2a08febc8b957b44732dbc7da831479a0005 (patch)
tree46c3b079ec65f0efbd1f3b603f1b11a3ae09e56d /ulib.c
parentf7cea12b38a86e9b37fa5bc635310d3f85e5f8db (diff)
downloadxv6-labs-8b4e2a08febc8b957b44732dbc7da831479a0005.tar.gz
xv6-labs-8b4e2a08febc8b957b44732dbc7da831479a0005.tar.bz2
xv6-labs-8b4e2a08febc8b957b44732dbc7da831479a0005.zip
swtch saves callee-saved registers
swtch idles on per-CPU stack, not on calling process's stack fix pipe bugs usertest.c tests pipes, fork, exit, close
Diffstat (limited to 'ulib.c')
-rw-r--r--ulib.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/ulib.c b/ulib.c
index 694501e..d99acdd 100644
--- a/ulib.c
+++ b/ulib.c
@@ -5,6 +5,13 @@ fork()
asm("int $48");
}
+int
+exit()
+{
+ asm("mov $2, %eax");
+ asm("int $48");
+}
+
void
cons_putc(int c)
{
@@ -42,3 +49,10 @@ write(int fd, char *buf, int n)
asm("mov $6, %eax");
asm("int $48");
}
+
+int
+close(int fd)
+{
+ asm("mov $8, %eax");
+ asm("int $48");
+}