用户空间实现系统调用的两种方式

一种是间接的系统调用:syscall(SYS_xxx); 其中 SYS_xxx 是系统调用号; 另一种是通过API函数,API函数一般会自动调用内核空间中同名的系统调用函数。 举例如下: #include <syscall.h> #include <unistd.h> #include <stdio.h> #include <sys/types.h> int main(void) {  long
相关文章
相关标签/搜索