Where is int $0 × 80 called?

Source: Internet
Author: User

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 );
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.