Linux kernel design and implementation (English Version · 3rd)-Chapter 73rd:
Int $0x80, which is an error in calling x86 128th, that is, a system call handler. after the CPU executes this command, it enters the kernel mode and can use various kernel codes.
Q: Where does it call it?
I guess there is a place in C wrapper (p74) that will call methods like syscall.
Like http://www.win.tue.nl /~ The uid_t getuid (void) function given by AEB/Linux/lk/lk-4.html is the same,
Int getuid32_available = unknown; uid_t getuid (void ){
If (getuid32_available = true)
Return inline_syscall (getuid32, 0); // call, which is the call interruptedCodeNow!
If (getuid32_available = unknown ){
Uid_t res = inline_syscall (getuid32, 0 );
If (RES = 0 | errno! = Enosys ){
Getuid32_available = true;
Return res;
}
Getuid32_available = false;
}
Return inline_syscall (getuid, 0 );
}