819aafe6f4e1c4eff0e8eb404cdb0424f77a88a1
[musl] / src / internal / syscall.h
1 #ifndef _SYSCALL_H
2 #define _SYSCALL_H
3
4 /* This header is mostly useless leftover wrapper cruft */
5
6 #include <sys/syscall.h>
7
8 #define syscall0 syscall
9 #define syscall1 syscall
10 #define syscall2 syscall
11 #define syscall3 syscall
12 #define syscall4 syscall
13 #define syscall5 syscall
14 #define syscall6 syscall
15
16 #define socketcall __socketcall
17
18 /* the following are needed for iso c functions to use */
19 #define __syscall_open(filename, flags, mode) syscall(__NR_open, (filename), (flags)|0100000, (mode))
20 #define __syscall_read(fd, buf, len)          syscall(__NR_read, (fd), (buf), (len))
21 #define __syscall_write(fd, buf, len)         syscall(__NR_write, (fd), (buf), (len))
22 #define __syscall_close(fd)                   syscall(__NR_close, (fd))
23 #define __syscall_fcntl(fd, cmd, arg)         syscall(__NR_fcntl, (fd), (cmd), (arg))
24 #define __syscall_dup2(old, new)              syscall(__NR_dup2, (old), (new))
25 #define __syscall_unlink(path)                syscall(__NR_unlink, (path))
26 #define __syscall_getpid()                    syscall(__NR_getpid)
27 #define __syscall_kill(pid,sig)               syscall(__NR_kill, (pid), (sig))
28 #define __syscall_sigaction(sig,new,old)      syscall(__NR_rt_sigaction, (sig), (new), (old), 8)
29 #define __syscall_ioctl(fd,ioc,arg)           syscall(__NR_ioctl, (fd), (ioc), (arg))
30 #define __syscall_exit(code)                  syscall(__NR_exit, code)
31
32 #endif