syscall调用接口从2.6.19开始移到应用层
来源:互联网 发布:淘宝上的货到付款 编辑:程序博客网 时间:2024/05/13 14:16
转自:http://crquan.blogbus.com/logs/5618102.html
syscall调用接口从2.6.19开始移到应用层,原来内核中使用_syscallN宏的方式来声明函数原型的方法不再有效:
如声明:
_syscall1(int, sysinfo, struct sysinfo *, info);
不再需要,而是在程序中需要的时候直接调用:
int syscall(int number, ...);
- 第一个number是后面要接的参数个数,不是该系统调用的参数个数;(注:关于这个number,man手册上说的是: syscall() performs the system call whose assembly language interface has the specified number with the specified arguments. Symbolic constants for system
calls can be found in the header file <sys/syscall.h>.
) - number后面顺序接上该系统调用的所有参数即可
相应头文件包含也改变为
于是调用sysinfo就变为:
struct sysinfo s_info;
syscall(2, __NR_sysinfo, &s_info);
可见新的调用方式变得更为简洁了。
References:
- http://lxr.linux.no/source/include/asm-i386/unistd.h
- http://lxr.linux.no/source/include/asm-i386/unistd.h?v=2.6.18
- http://www.kernel.org/pub/linux/kernel/v2.6/snapshots/patch-2.6.19-git13.log
- commit f5738ceed46782aea7663d62cb6398eb05fc4ce0 of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
- syscall调用接口从2.6.19开始移到应用层
- syscall调用接口从2.6.19开始移到应用层
- 应用层对i2c通用驱动接口与eeprom的i2c驱动接口从应用层到内核层调用区别和联系
- android从应用层到HRL层调用流程
- syscall - 间接系统调用
- 系统调用 syscall
- syscall 系统调用
- Syscall系统调用分析
- Golang 系统调用Syscall
- 应用层调用接口修改输出显示方式 ExtEscape
- cocos2dx:C++层通过JniHelper调用JAVA层代码进而调用Android手机应用接口
- 通过syscall 调用系统调用
- 应用调用驱动层
- linux中syscall系统调用
- 间接系统调用syscall(SYS_gettid)
- Linux系统调用(syscall)原理
- Linux系统调用(syscall)原理
- Linux系统调用(syscall)原理
- SQL 收藏
- vc try catch捕捉所有异常的问题
- 面试: 不使用中间变量, 怎样交换a和b?
- windows mobile上操作马达实现振动
- C#中创建、打开、读取、写入、保存Excel的一般性代码
- syscall调用接口从2.6.19开始移到应用层
- Vxworks获取日历时间代码
- 一个日本人挨打的笑话(转载)
- Linux大文件使用
- VMware6.5+redhat5下安装oracle10gR2全过程
- Visual Studio 2008 Team Suite Edition 评估版的注册
- linux线程中的问题-----数据冲突
- Oracle数据库中Instance和数据库的区别
- 将保存在数据库中的图片信息生成缩略图的问题,请大家指导!