down(9)
π down(9) β like, the semaphore acquisition page, bestie
okay so real talk, this is down from the Kernel API Manual, and it's one of those pages you need to know about even if you're not gonna use it (spoiler: you're not, it's deprecated, we'll get there π«Ά).
β¨ NAME β¨
down β acquire the semaphore. that's it. that's the whole vibe. π
πΈ SYNOPSIS πΈ
void down (struct semaphore *sem );
literally one function, one argument, zero drama. slay.
π ARGUMENTS π
semβ the semaphore to be acquired. the main character of this whole operation, fr fr π
π¦ DESCRIPTION π¦
So. down acquires the semaphore. Simple enough, right? But here's the tea: if no more tasks are allowed to acquire the semaphore, calling this function will put the task to sleep π΄ until the semaphore is released. like it just goes night-night. no cap.
π¨ BESTIE, READ THIS PART π¨ β use of this function is deprecated. please usedown_interruptibleordown_killableinstead. this is not a drill, it's giving "legacy code energy" and we don't stan π
I know, I know. iconic function, but it's time to move on. the newer ones ate, ngl. β¨
π₯ SEE ALSO π₯
- Kernel file
./kernel/locking/semaphore.c down_interruptible(9)down_killable(9)down_trylock(9)down_timeout(9)up(9)
go read those, they're literally the upgrade path and they're serving π§
π a little sign-off π
this page lives under ./kernel/locking, and it's dated October 2026 β so if you're reading this in the future, hiiiii, hope the kernel is thriving π
now go forth and use down_interruptible instead, bestie. your future self will thank you. periodt. π
π
π¦ 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