Lets say I have a user-defined syscall: foo (with code number 500).
To call it, I simply write in a C file:
syscall(SYS_code, args);
How can I call it using just foo(args)
?
Lets say I have a user-defined syscall: foo (with code number 500).
To call it, I simply write in a C file:
syscall(SYS_code, args);
How can I call it using just foo(args)
?
You cannot. Not unless you first convince the kernel developers that your syscall is worth being added, then it gets added, and then userspace libraries such as the standard C library (glibc on most Linux distributions) decide to implement a wrapper for it like they do for most of the syscalls.
In other words: since the above is impossible, all you can do is define the wrapper function yourself in your own program.
#define SYS_foo 500
long foo(int a, char *b) {
return syscall(SYS_foo, a, b);
}