rtapi_is(3rtapi)
β¨ rtapi_is β details of rtapi configuration β¨
ok so this is a page from the RTAPI manual (section 3rtapi, we love a library-call section π) and it's about two little functions that let you vibe-check your rtapi setup before you do anything wild. no cap, they're tiny, but they will save you from a confusing loadrt meltdown later. π«Ά
πΈ SYNTAX πΈ
int rtapi_is_kernelspace()
int rtapi_is_realtime()
like. two functions. both return int. that's the whole mood. π
π¦ DESCRIPTION π¦
rtapi_is_kernelspace() π
bestie, this one tells you where your rtapi modules are living.
- returns nonzero when rtapi modules run in kernel space (e.g., under RTAI)
- returns zero when they run in userspace (e.g., under uspace)
so it's giving "am i in the kernel rn or not" and honestly it's iconic for branching on that. β
rtapi_is_realtime() π₯
this one is the "can we actually do realtime tho" check.
- returns nonzero when capable of running with realtime guarantees
- for rtai: this always returns nonzero β but heads up, actually loading realtime modules will fail if you're not running under the appropriate kernel. so like, it said yes but it lied. π
- for uspace: returns nonzero when the running kernel indicates it is capable of realtime performance
- if
rtapi_appis not setuid root, this returns nonzero even thoughrtapi_appwill not be able to obtain realtime scheduling or hardware access β so, e.g., attempting toloadrta hardware driver will fail. π
not me being nonzero and still useless. π anyway, remember: a nonzero here is not a promise that your hardware driver load is gonna slay. read the caveats. periodt.
π§ REALTIME CONSIDERATIONS π§
- May be called from non-realtime or from realtime setup code.
rtapi_is_realtime()may perform filesystem I/O. π
so yeah, call it in setup, not mid-cycle, iykyk. π
π RETURN VALUE π
Zero for false, nonzero for true. that's it, that's the whole truth table, no cap. β¨
ok that's the whole page, ty for coming to my ted talk π this was written up in the LinuxCNC Documentation, dated 2006-10-12, and yeah, she's been serving accurate answers since way before you were born bestie. mwah. π
π¦ where this page comes from
- debian trixie: linuxcnc-uspace-dev 1:2.9.4-2+deb13u1 Β· GFDL-1.1-or-later
- ubuntu questing: linuxcnc-uspace-dev 1:2.9.4-2ubuntu2
- ubuntu resolute: linuxcnc-uspace-dev 1:2.9.4-2ubuntu4 Β· GFDL-1.1-or-later
- ubuntu stonking: linuxcnc-uspace-dev 1:2.9.4-2ubuntu4 Β· GFDL-1.1-or-later
- Copyright (c) 2014 Jeff Epler
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms