Ubuntu10.04版本的内核头文件
时间:2010-08-12
来源:互联网
这是Ubuntu10.04版本的内核头文件 include/asm-generic/unistd.h 的部分源码,其中的
#ifndef __SYSCALL
#define __SYSCALL(x, y)
#endif
以及
#define __NR_io_setup 0
__SYSCALL(__NR_io_setup, sys_io_setup)
的宏定义看不懂,请教以上的两个宏是什么意思,有什么意义?不胜感激!
=============================
#if !defined(_ASM_GENERIC_UNISTD_H) || defined(__SYSCALL)
#define _ASM_GENERIC_UNISTD_H
#include <asm/bitsperlong.h>
/*
* This file contains the system call numbers, based on the
* layout of the x86-64 architecture, which embeds the
* pointer to the syscall in the table.
*
* As a basic principle, no duplication of functionality
* should be added, e.g. we don't use lseek when llseek
* is present. New architectures should use this file
* and implement the less feature-full calls in user space.
*/
#ifndef __SYSCALL
#define __SYSCALL(x, y)
#endif
#if __BITS_PER_LONG == 32
#define __SC_3264(_nr, _32, _64) __SYSCALL(_nr, _32)
#else
#define __SC_3264(_nr, _32, _64) __SYSCALL(_nr, _64)
#endif
#define __NR_io_setup 0
__SYSCALL(__NR_io_setup, sys_io_setup)
#define __NR_io_destroy 1
__SYSCALL(__NR_io_destroy, sys_io_destroy)
#define __NR_io_submit 2
__SYSCALL(__NR_io_submit, sys_io_submit)
#define __NR_io_cancel 3
__SYSCALL(__NR_io_cancel, sys_io_cancel)
#ifndef __SYSCALL
#define __SYSCALL(x, y)
#endif
以及
#define __NR_io_setup 0
__SYSCALL(__NR_io_setup, sys_io_setup)
的宏定义看不懂,请教以上的两个宏是什么意思,有什么意义?不胜感激!
=============================
#if !defined(_ASM_GENERIC_UNISTD_H) || defined(__SYSCALL)
#define _ASM_GENERIC_UNISTD_H
#include <asm/bitsperlong.h>
/*
* This file contains the system call numbers, based on the
* layout of the x86-64 architecture, which embeds the
* pointer to the syscall in the table.
*
* As a basic principle, no duplication of functionality
* should be added, e.g. we don't use lseek when llseek
* is present. New architectures should use this file
* and implement the less feature-full calls in user space.
*/
#ifndef __SYSCALL
#define __SYSCALL(x, y)
#endif
#if __BITS_PER_LONG == 32
#define __SC_3264(_nr, _32, _64) __SYSCALL(_nr, _32)
#else
#define __SC_3264(_nr, _32, _64) __SYSCALL(_nr, _64)
#endif
#define __NR_io_setup 0
__SYSCALL(__NR_io_setup, sys_io_setup)
#define __NR_io_destroy 1
__SYSCALL(__NR_io_destroy, sys_io_destroy)
#define __NR_io_submit 2
__SYSCALL(__NR_io_submit, sys_io_submit)
#define __NR_io_cancel 3
__SYSCALL(__NR_io_cancel, sys_io_cancel)
作者: zsmwqebs 发布时间: 2010-08-12
#ifndef __SYSCALL
#define __SYSCALL(x, y)
#endif
这个应该防止是某些情况下编译不过吧,让他什么也不做。这个宏肯定是有的。
以及
#define __NR_io_setup 0
__SYSCALL(__NR_io_setup, sys_io_setup)
这个宏就是系统调用的宏,你自己去看看资料
#define __SYSCALL(x, y)
#endif
这个应该防止是某些情况下编译不过吧,让他什么也不做。这个宏肯定是有的。
以及
#define __NR_io_setup 0
__SYSCALL(__NR_io_setup, sys_io_setup)
这个宏就是系统调用的宏,你自己去看看资料
作者: etoux 发布时间: 2010-08-13
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28