diff options
Diffstat (limited to 'ulib.c')
| -rw-r--r-- | ulib.c | 44 | 
1 files changed, 44 insertions, 0 deletions
| @@ -0,0 +1,44 @@ +int +fork() +{ +  asm("mov $1, %eax"); +  asm("int $48"); +} + +void +cons_putc(int c) +{ +  asm("mov $4, %eax"); +  asm("int $48"); +} + +int +puts(char *s) +{ +  int i; + +  for(i = 0; s[i]; i++) +    cons_putc(s[i]); +  return i; +} + +int +pipe(int fds[]) +{ +  asm("mov $5, %eax"); +  asm("int $48"); +} + +int +read(int fd, char *buf, int n) +{ +  asm("mov $7, %eax"); +  asm("int $48"); +} + +int +write(int fd, char *buf, int n) +{ +  asm("mov $6, %eax"); +  asm("int $48"); +} | 
