tee_shm_get_from_id(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– tee_shm_get_from_id(9) πŸ’–

okay so bestie, we're in the Kernel API Manual today and this one is genuinely such a cute little lookup function. no cap, it's short but it matters. let's get into it 🫢


✨ NAME ✨

tee_shm_get_from_id β€” find a shared memory object and bump its reference count πŸ’…

like, you give it an id, it finds your shm, and it also increases the refcount so nobody snatches it out from under you. main character behaviour fr.


🌸 SYNOPSIS 🌸

struct tee_shm * tee_shm_get_from_id (struct tee_context *ctx , int id );

look at that signature. iconic. two args, one pointer back. πŸŽ€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • ctx β€” the context that owns the shared memory, iykyk. it's giving "whose shm is this anyway" energy πŸ‘‘
  • id β€” the id of the shared memory object. the little name tag. the πŸ“ on top.

πŸ’€ RETURN πŸ’€

on success you get a pointer to struct tee_shm β€” slay, you found it πŸ’–

on failure you get an ERR_PTR. not NULL, bestie, ERR_PTR. use your IS_ERR() checks, don't come crying to me 😭


🌈 SEE ALSO 🌈

literally the whole friend group. all of these live in the kernel file ./include/linux/tee_core.h:

psst β€” notice tee_shm_put(9) sitting right there in the list? that's your cleanup bestie. refcount goes up, refcount gotta come down. balance. 🧚

and that's the whole vibe πŸ’œ this page lives in ./include/linux, it's dated October 2026, and it's filed under tee_shm_get_from_id(9). go forth and get your shm, bestie β€” responsibly, with matching tee_shm_put() πŸŽ€βœ¨

πŸ“¦ where this page comes from