What is the “current” in Linux kernel source?
It’s a pointer to the current process (i.e. the process that issued the system call). On x86, it’s defined in arch/x86/include/asm/current.h (similar files for other archs). #ifndef _ASM_X86_CURRENT_H #define _ASM_X86_CURRENT_H #include <linux/compiler.h> #include <asm/percpu.h> #ifndef __ASSEMBLY__ struct task_struct; DECLARE_PER_CPU(struct task_struct *, current_task); static __always_inline struct task_struct *get_current(void) { return percpu_read_stable(current_task); } #define current get_current() #endif … Read more