get_desc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… get_desc(9) β€” like, the segment descriptor grabber

ok so this is get_desc, and it lives in the kernel API manual (section 9 ofc, we love a manual page moment) β€” welcome to the group chat bestie 🫢


✨ NAME ✨

get_desc β€” literally just, obtain contents of a segment descriptor. that's the whole vibe. πŸŽ€


✨ SYNOPSIS ✨

bool get_desc (struct desc_struct *out , unsigned short sel );

no cap, that's the signature. struct desc_struct *out and unsigned short sel, in that order, periodt. πŸ’…


✨ ARGUMENTS ✨

  • out β€” the segment descriptor contents, but only on success bestie. if it worked, this is where the goods land. ✨
  • sel β€” the segment selector. yeah. the selector. the little number that points at the thing. 🎯

✨ DESCRIPTION ✨

okay so picture this 🌸 β€” you hand over a segment selector, and this function gets you a pointer to the segment descriptor it corresponds to. both the global and local descriptor tables are supported, so whichever table your selector is living in, get_desc has you covered. iykyk πŸ’–

then the returns, and honestly the way these are laid out is iconic in a chaotic way:

  • True on success, false on failure. yes. a bool. the synopsis literally says bool. we love consistency. 🀑
  • NULL on error.
⚠️ heads up: that's exactly what the page says β€” True/false for success/failure, and NULL on error. i'm not gonna gaslight you into thinking there's more detail than there is. that's the whole description fr fr πŸ’€

✨ SEE ALSO ✨

bestie the SEE ALSO section is long, like it is giving main character energy with how many friends it has πŸ‘‘ and they all live in the kernel file ./arch/x86/lib/insn-eval.c β€” go drink from that firehose, i believe in you πŸ¦‹

that's all 29 of them, counted twice, no skips, no crumbs left behind. ate. πŸ”₯


🌈 the sign-off 🌈

okay that's the page!! this little icon comes from the source path ./arch/x86/lib, dated October 2026, and it's filed under get_desc(9) β€” so if you forget where you found it, that's your receipt bestie πŸ§šπŸ’œ

mwah, go read a descriptor table, you're doing amazing πŸ“β­

πŸ“¦ where this page comes from