set_mm_exe_file(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 β€” the mm that'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 new mm is 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:

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