相关疑难解决方法(0)

linux内核源代码中的"当前"是什么

我正在研究Linux内核,我遇到了问题

我看到很多linux内核源文件都有current-> files.那么"当前"是什么?

struct file *fget(unsigned int fd)
{
     struct file *file;
     struct files_struct *files = current->files;

     rcu_read_lock();
     file = fcheck_files(files, fd);
     if (file) {
             /* File object ref couldn't be taken */
             if (file->f_mode & FMODE_PATH ||
                 !atomic_long_inc_not_zero(&file->f_count))
                     file = NULL;
     }
     rcu_read_unlock();

     return file;
 }
Run Code Online (Sandbox Code Playgroud)

linux kernel linux-kernel

23
推荐指数
1
解决办法
3万
查看次数

标签 统计

kernel ×1

linux ×1

linux-kernel ×1