I am working on x86_64 machine. My linux kernel is also 64 bit kernel. As there are different ways to implement a system call (int 80, syscall, sysenter), i wanted to know what type of system call my machine is using. I am newbie to linux. I have written a demo program.
#include <stdio.h>
int main()
{
getpid();
return 0;
}
getpid() does one system call. Can anybody give me a method to find which type of system call will be used by my machine for this program.. Thank you….
Looks like our call to getpid() is actually a library call. Let’s set a breakpoint there and continue.
Buried in the getpid() library is the syscall assembler instruction. This is an AMD64 instruction that supports a fast context switch to ring0 for the purpose of system calls.