kthread_data(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’œ kthread_data(9) β€” a Kernel API Manual moment, section 9, bestie

Okay so real talk: this is the kthread_data page from the Kernel API Manual, and it's honestly one of the shortest glow-ups in the whole kthread cinematic universe. Tiny function, huge "I know my data" energy. Let's get into it 🫢


✨ NAME ✨

kthread_data β€” returns the data value that was specified when the kthread got created. That's it. That's the whole personality. πŸŽ€


🌸 SYNOPSIS 🌸

void * kthread_data (struct task_struct *task );

Literally just hand it a task and it hands you back a void *. No cap, that's the entire vibe check. ✨


πŸ¦‹ ARGUMENTS πŸ¦‹

  • task β€” the kthread task we're asking about 🧚. Like, this specific one, bestie, not some random other thread.

πŸ’… DESCRIPTION πŸ’…

So here's the deal: kthread_data returns the data value that was specified back when kthread task was created 🌈. It's giving "remember when you were born? what were you holding?" energy and honestly I respect it.

⚠️ But listen β€” the caller is responsible for ensuring the validity of task when calling this function. That's on you, bestie. Not the kernel, not the compiler, not the universe. You. Validity check first, cute pointer deref second. Do not come crying to me when task is garbage πŸ˜­πŸ’€

⭐ SEE ALSO ⭐

The whole squad, fr fr β€” everything lives in the kernel file ./kernel/kthread.c πŸ‘‘


That's the whole page, bestie β€” short, sweet, and dangerously easy to misuse. Go forth and validate your pointers πŸ’–

Mwah πŸ’‹ β€” this lil' beauty ships out of ./kernel, dated October 2026, and it's kthread_data(9) till the end of time. Periodt. πŸ‘‘

πŸ“¦ where this page comes from