rtapi_task_self(3rtapi)

✨ rtapi_task_self ✨

okay bestie, welcome to the RTAPI section of the manual β€” this one's a lil baby page but it's so useful, i promise 🫢


πŸ’– NAME πŸ’–

rtapi_task_self β€” retrieve ID of current task


πŸŽ€ SYNTAX πŸŽ€

void rtapi_task_self()

πŸ¦‹ DESCRIPTION πŸ¦‹

so like. rtapi_task_self goes and fetches the current task for you. that's it. that's the whole job. main character behaviour tbh πŸ’…

but listen β€” if you're not inside a realtime task, it doesn't vibe with you, and it hands back -EINVAL instead. when does that happen? think startup code, think shutdown code. yeah. those times. 😭


🌸 REALTIME CONSIDERATIONS 🌸

you can call this one from init/cleanup code, and also from inside realtime tasks. so basically she's flexible. she gets around. queen. πŸ‘‘


⭐ RETURN VALUE ⭐

  • the task number that rtapi_task_new gave you earlier, or
  • -EINVAL

that's the whole menu, no cap. πŸ™ˆ


🌈 SEE ALSO 🌈


ngl if you got here by accident, you probably wanted rtapi_task_new(3rtapi) first. go make a task, then come back and ask her who she is. iykyk πŸ”₯

mwah πŸ’‹ that's the whole page, babes β€” this one's from the LinuxCNC Documentation, dated 2015-04-18, and it lives in the rtapi_task_self(3rtapi) manual. go slay ur realtime tasks, fr fr 🧚✨