c - 函数参数中的宏

标签 c macros

你能解释一下这段代码吗?这里的 __user 是什么意思?

int create(struct mystruct __user *arg) {
  void __user *user_config;
}

(我只贴出部分功能) 任何回复都非常感激。谢谢。

最佳答案

它告诉内核开发人员该指针是用户提供的,因此不应信任它,并且需要在操作之前进行验证。

Linux内核中有很多这样的定义。

https://en.wikipedia.org/wiki/Sparse#Linux_kernel_definitions

关于c - 函数参数中的宏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35877773/

相关文章:

c - C 中结构体的指针数组

C 计算器,有很多函数 in 函数 in 函数

clojure - 在 clojurescript 中使用 clojure 代码的规范方法

csv - ImageJ宏: saving csv file

c++ - 通过define从纯文本中获取字符串

在 GNU 汇编中使用重复 block 或宏调用函数表

c++ - openmp collapse with inner loop reduction

c - vf_codecview.c 仅打印 'future' 中的运动 vector

c - 在二维数组的主对角线上交换值 - C

c++ - 自动化 C++ 类的 pimpl'ing——有简单的方法吗?