os/libc/unistd.c
2019-09-01 13:49:01 -05:00

11 lines
143 B
C

#include <sys/types.h>
pid_t getpid() {
pid_t pid;
asm volatile(" \
mov $20, %%eax; \
int $80; \
":"=b"(pid));
return pid;
}