I think syscall is a *calling convention* macro that can be used to tell the compiler HOW to call a c++ or C function. It has to do with how it handles the stack and registers in assembly language and you use different ones when trying to expose your code to other lanugages so they can call it correctly.
System calls are not normal function calls. They are initiated by an interrupt and transfer control to the operating system. The operation you want is passed as a code number. So that's what all the macros are. The C functions are wrappers that set up the given system call.
I am told that unistd.h contains the declaration of all system calls on a linux system
tpb wrote:
They are initiated by an interrupt
Make sure you guys aren't not looking at outdated materials, the "interrupt" business is legacy even for for 32-bit days, and only barely kinda sometimes works in 64-bit.