writing a glibc api for a system call [duplicate]

爱⌒轻易说出口 提交于 2019-12-01 09:06:31
Basile Starynkevitch

See e.g. this answer and that answer to similar questions. Read also more about syscalls, the linux kernel, an overview of linux syscalls, and the assembly howto

The write function from glibc is not the true syscall. It is a wrapper (doing the sycall thru e.g. sysenter machine instruction, perhaps with the VDSO, and setting errno). You can use strace to understand the system calls done by some program.

For example, the MUSL libc has this write.c implementation for write. For GNU libc, look at its write.c.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!