funct(3rtapi)

πŸ“¦
version 2.9.4 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– funct(3rtapi) πŸ’–

okay bestie, welcome to funct(3rtapi) β€” this is an RTAPI manual page, and yes the name is literally funct(3rtapi) which is giving mysterious-but-make-it-functional. it lives in the <pink>rtapi_slab.h</pink> era of the LinuxCNC docs and honestly? iconic. πŸŽ€


✨ NAME ✨

rtapi_slab.h β€” RTAPI wrappers for linux kernel functionality. that's the whole vibe. it's a lil bridge file, she's a translator, she's the middle girl between RTAPI and the kernel 🫢


✨ SYNTAX ✨

bestie, here's the cast of characters. copy these exactly, they are ✨sacred✨:

#include <rtapi_slab.h>

void *rtapi_kmalloc(size_t size, gfp_t g);

void *rtapi_kzalloc(size_t size, gfp_t g);

void *rtapi_krealloc(size_t size, gfp_t g);

void rtapi_kfree(void *);

✨ DESCRIPTION ✨

okay so here's the tea πŸ“

when you're in kernel space, every single rtapi_xxx or RTAPI_XXX identifier gets mapped straight to the underlying kernel functionality β€” if available. no cap, that's the whole deal.

when you're in userspace, OR in kernels where the underlying functionality isn't provided by a kernel, generally another implementation gets provided instead β€” and sometimes that implementation has reduced functionality πŸ‘€. for example: the userspace implementation for rtapi_device_register always succeeds. always. she doesn't miss. slay.


✨ REALTIME CONSIDERATIONS ✨

🚨 bestie this is the important part, do NOT skip it 🚨
  • Call only from within init/cleanup code, not from realtime tasks. that means no realtime tasks. not even a little one. i'm serious 😭
  • This function is not available from non-realtime code.

so like… it's giving very specific-crowd energy. init/cleanup only, periodt. πŸ’…


✨ RETURN VALUE ✨

As in Linux. literally. that's it. match the kernel's energy, she said πŸ’€


✨ SEE ALSO ✨

  • LinuxCNC Documentation πŸ“š

okay that's the whole page bestie, you ate that πŸ’–βœ¨

this little beauty is brought to you by the fine folks at LinuxCNC Documentation, dated 2014-06-28 β€” yes she's an elder but she's still serving looks. mwah. πŸŽ€πŸ¦‹πŸ’…

πŸ“¦ where this page comes from