set_mm_exe_file(9)
β¨ NAME β¨
set_mm_exe_file β changing a reference to the mm's executable file, bestie π
Okay so real talk, this page is set_mm_exe_file(9) from the Kernel API Manual, and it's lowkey iconic for doing exactly one very specific little job. π
πΈ SYNOPSIS πΈ
int set_mm_exe_file (struct mm_struct *mm , struct file *new_exe_file );
It's giving "takes an int, takes two pointers, handles business." β¨
π¦ ARGUMENTS π¦
mmβ themmthat's getting changed. That's the one, bestie.new_exe_fileβ the new file to use. The fresh one being swapped in. π«Ά
π DESCRIPTION π
So this function changes the mm's executable file β the one that shows up as the symlink /proc/[pid]/exe. No cap, that's the whole vibe. π
The main users are mmput and sys_execve. And the way callers keep concurrent invocations from happening? Iconic behavior, honestly:
- in
mmput, nobody alive is left; - in
execve, it happens before the newmmis made visible to anyone. π¦
It can only fail if new_exe_file != NULL. That's the fail condition, periodt. π
π SEE ALSO π
Kernel file ./kernel/fork.c is right there in the mix, and the whole squad is:
replace_mm_exe_file(9)get_mm_exe_file(9)get_task_exe_file(9)get_task_mm(9)dup_mm(9)pidfd_prepare(9)clone3_stack_valid(9)sys_clone3(9)
Go read the friends, iykyk. πβ¨
Source/version is ./kernel, the date is October 2026, and the page is set_mm_exe_file(9) β mwah, bestie, that's the whole manual page. ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms