I recently wanted to see how is open() system call implemented in Linux kernel. Looking at the syscall table suggested that the name of the function I’m looking for is sys_open(), so I grepped for it. I couldn’t find any declaration though, the closest I could get was do_sys_open in fs/open.c. Is it somehow translated into this function? What may I have missed?
I recently wanted to see how is open() system call implemented in Linux kernel.
Share
No,
do_sys_openis not the implementation ofsys_open, it’s just a common code ofopenandopenatfactored out.Syscall function names, which are always
sys_something, are generated by funny preprocessor macros (SYSCALL_DEFINEnwherenis the number of arguments).As you can see (very close to
do_sys_open):This is the code of
opensyscall.