What is the “current” in Linux kernel source?

后端 未结 2 556
误落风尘
误落风尘 2020-12-13 19:04

I\'m studying about Linux kernel and I have a problem.

I see many Linux kernel source files have current->files. So what is the current?

2条回答
  •  抹茶落季
    2020-12-13 19:53

    Current is a global variable of type struct task_struct. You can find it's definition at [1].

    Files is a struct files_struct and it contains information of the files used by the current process.

    [1] http://students.mimuw.edu.pl/SO/LabLinux/PROCESY/ZRODLA/sched.h.html

提交回复
热议问题