Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Current macro in linux kernel

The purpose of the current macro is to find a pointer to the task structure of the currently running process.

So regarding its usage when developing a kernel module, and according to its definition does this macro return the PID of the current running user-space process or what?

like image 480
IoT Avatar asked Sep 01 '25 18:09

IoT


1 Answers

When a user-space process performs a system call, this macro points to the task_struct associated with this process. It doesn't only contain the PID of the process but a lot of other info.

like image 91
Grapsus Avatar answered Sep 04 '25 07:09

Grapsus