我在哪里可以获得`struct file* file_open(const char* path, int flags, int rights)` 的手册页

where can I get man page for `struct file* file_open(const char* path, int flags, int rights)`

我正在尝试编写 module 来读取文件(在内核模式下)。 但是,问题是内核版本 2.6.30 及之后,不导出 sys_read()

我已将代码更改为

读取文件。

here 我对 file_open() 中参数 int rights 的使用感到困惑(与 'open()' 中的 mode 相同)。

请给我一个示例或帮助我获取 file_open() 的手册页。

是的,它们是一样的。

来自 rz2 man pages for FILP_OPEN,

struct file * filp_open(const char * filename, int flags, int mode);

ARGUMENTS

  • filename: path to open .
  • flags: open flags as per the open(2) second argument.
  • mode: mode for the new file if O_CREAT is set, else ignored.

file_open 将其第三个参数 int rights 作为第三个参数传递给 filp_open,即 int mode.

file_open 由您定义为基础 VFS 级别函数 filp_open 的包装函数。因此,您不能指望在 file_open.

上找到联机帮助页