开发者

SYSCALL_DEFINE6(...)

开发者 https://www.devze.com 2023-04-05 12:50 出处:网络
I am now studying about the implementation of page table of Linux 2.6.38.8. In linux/include/linux/syscall.c, I found that

I am now studying about the implementation of page table of Linux 2.6.38.8. In linux/include/linux/syscall.c, I found that

#define SYSCALL_DEFINE6(name, ...) SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)

but I don't fully understand what this piece of code is doing. There are some branches for

SYSCALL_DEFINEx(6, _##name, __VA_ARGS__) 

and their definition, but开发者_StackOverflow社区 the code is quite complicated to understand for me. If anyone know about this implementation, teach me please.


Basically SYSCALL_DEFINE is defined by another define which is called SYSCALL_DEFINEx. In addition it used string concatenation to build the second parameter, which is the same name preceded by the "_" character. In addition it uses VA_ARGS (this is a c99 feature) which passes all the specified parameters to the SYSCALL_DEFINEx macro.

0

精彩评论

暂无评论...
验证码 换一张
取 消