USERRET(9)
π NAME π
Okay so bestie, this is the USERRET(9) page from the Kernel Developer's Manual, and it's literally about userret β the return path to user-mode execution. Periodt. π
π¦ SYNOPSIS π¦
#include <sys/lwp.h>
#include <sys/sched.h>
void
userret(struct lwp *l);
π DESCRIPTION π
So userret() runs after a trap has been processed (think: a system call or an interrupt) and right before the kernel goes back to user-mode execution. It's giving "last stop before userspace" energy. β¨
Heads up, bestie: the implementation is machine dependent, and it is never invoked from machine-independent code. The prototype for each architecture may be different from the one above, but the functionality provided by userret() on each architecture is essentially the same. No cap.
Specifically, userret() performs this whole procedure:
- Detect a change in the signal disposition of the current process and invoke
postsig(9)to post the signal to the process. This may happen when the outcome of the trap or syscall posted a signal to the process (e.g., an invalid instruction trap). π - Check the
want_reschedflag to see if the scheduler requires the current process to be preempted by invokingpreempt(9)(seecpu_need_resched(9)). This may happen if the clock interrupt causes the scheduler to determine that the current process has completed its time slice. β° - Update the scheduler state. Slay. π
π SEE ALSO π
Go read these next, bestie β they're the friend group:
And the cute little footer sign-off says: Debian, December 20, 2005, with the manual name USERRET(9) β iconic, honestly. π«Άπ
π¦ where this page comes from
- nixpkgs unstable: netbsd-source 11.0
- Copyright (c) 2002 The NetBSD Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms