MACRO fucntion
Linux defines 7 macros for
_syscall0
… _syscall6
Encapsulate the low-level details of a system call invocation and parameter passing. making it easier to maintain and write portable code for different architecture (portability because it is architecture dependent)
0~6 means the number of parameters used by the system call
write()
int means interrupt with Interrupt Vector 128
syscall3 parameter count is 6 includes
- return type
- system call type
- return value
Parameter passing
The system call number is by
Parameters via CPU registers and memory for complex struct
Parameter checking
- input address checking (check not more than 3GB) and dynamic check because full address check is heavy