共 1 篇文章

标签:Linux 系统调用

Linux之系统调用问题-国外主机测评 - 国外VPS,国外服务器,国外云服务器,测评及优惠码

Linux之系统调用问题

Linux之系统调用问题  更新时间:2024年01月11日 10:24:56   作者:嵌入式Linux系统开发   这篇文章主要介绍了Linux之系统调用问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教 目录 Linux系统调用 asmlinkage限定词 函数返回long 总结 Linux系统调用 asmlinkage限定词 这是一个编译指令,通知编译器仅从栈中提取该函数的参数。 函数返回long 为了保证 32 位和 64 位系统的兼容,系统调用在用户空间和内核空间有不同的返回值类型,在用户空间为 int,在内核空间为 long。 note:假设系统调用在内核空间定义为 sys_ioctl,那么该系统调用的用户空间接口为 ioctl Linux kernel-5.18.8 有 440 个系统调用。 /include/linux/syscalls.h /* * These syscall function prototypes are kept in the same order as * include/uapi/asm-generic/unistd.h. Architecture specific entries go below, * followed by deprecated or obsolete system calls. * * Please note that these prototypes here are only provided for information * purposes, for static analysis, and for linking from the syscall table. * These functions should not be called elsewhere from kernel code. * * As the syscall calling convention may be different from the default * for architectures overriding the syscall calling convention, do not *...

技术分享