Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux kernel ubuntu内核(Vmware)在/usr/include/linux/fs.h文件中没有struct file\u操作结构_Linux Kernel_Linux Device Driver_Ubuntu 16.04 - Fatal编程技术网

Linux kernel ubuntu内核(Vmware)在/usr/include/linux/fs.h文件中没有struct file\u操作结构

Linux kernel ubuntu内核(Vmware)在/usr/include/linux/fs.h文件中没有struct file\u操作结构,linux-kernel,linux-device-driver,ubuntu-16.04,Linux Kernel,Linux Device Driver,Ubuntu 16.04,在本教程之后: 在ubuntu中执行后: sudo apt-get update apt-cache search linux-headers-$(uname -r) sudo apt-get install linux-headers-4.8.0-36-generic cd /usr/src/linux-headers-4.8.0-36 为什么ubuntu内核(Vmware)在/usr/include/linux/fs.h文件中没有文件操作结构 struct file_operations

在本教程之后:

在ubuntu中执行后:

sudo apt-get update
apt-cache search linux-headers-$(uname -r)
sudo apt-get install linux-headers-4.8.0-36-generic
cd /usr/src/linux-headers-4.8.0-36
为什么ubuntu内核(Vmware)在/usr/include/linux/fs.h文件中没有文件操作结构

struct file_operations {
       struct module *owner;
       loff_t (*llseek) (struct file *, loff_t, int);
       ssize_t (*read) (struct file *, char *, size_t, loff_t *);
       ssize_t (*write) (struct file *, const char *, size_t, loff_t *);
    .
    .   
    .
    };

这些标题用于用户空间程序。为什么希望内核中的fs.h文件在那里?你首先要做什么

如果您检查内核源代码树,您将看到它在usr/include/linux中包含一组单独的头文件

您正在查找的可能的包名为-devel(或-dev)。apt文件搜索应该能够告诉您,或者最好是手动为您应该在这里做什么

编辑:

本教程的作者指的是在内核源代码树中包含/linux/fs.h文件


本教程质量极差,不可遵循。此外,您自己似乎是一个初学者程序员,在本例中,我强烈反对在现阶段使用内核。

谢谢您,员工,我用我试图遵循的教程链接编辑了这个问题。