summaryrefslogtreecommitdiff
path: root/include/unistd.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/unistd.h')
-rw-r--r--include/unistd.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/unistd.h b/include/unistd.h
index 47e1621..0b3c666 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -8,6 +8,10 @@
typedef int32_t ssize_t;
#endif
+#define STDIN_FILENO 0
+#define STDOUT_FILENO 1
+#define STDERR_FILENO 2
+
typedef int16_t pid_t;
#define __SYS_alarm 0
@@ -55,6 +59,17 @@ typedef int16_t pid_t;
return __res; \
}
+#define _syscall3(type, name, atype, a, btype, b, ctype, c) \
+ type name(atype a, btype b, ctype c) { \
+ type __res; \
+ __asm__ volatile ( \
+ "int $0x80" \
+ : "=a" (__res) \
+ : "a" (__SYS_##name), "b" (a), "c" (b), "d" (c) \
+ ); \
+ return __res; \
+ }
+
pid_t getpid(void);
void *getpdir(void);