Module lunatik
Manages Lunatik runtimes — isolated Lua states running in the kernel.
lunatik
| _ENV | Shared global environment; scripts exchange objects (e.g. |
| runtime (script[, context="process"]) | Creates a new Lunatik runtime executing the given script. |
Class runtime
| runtime:resume (...) | Resumes a yielded runtime, analogous to coroutine.resume. |
| runtime:stop () | Stops the runtime and releases all associated kernel resources. |
lunatik
- _ENV
-
Shared global environment; scripts exchange objects (e.g. RCU tables) through it.
- _ENV
- runtime (script[, context="process"])
-
Creates a new Lunatik runtime executing the given script.
Parameters:
- script
string
script name (e.g.,
"mymod"loads/lib/modules/lua/mymod.lua) - context
string
execution context:
"process"(sleepable, GFP_KERNEL, mutex) or"softirq"(atomic, GFP_ATOMIC, spinlock). Use"softirq"for hooks that fire in interrupt context (netfilter, XDP). (default "process")
Returns:
Raises:
if allocation fails or the script errors on load - script
string
script name (e.g.,
Class runtime
Isolated Lua state running within the Linux kernel.
- runtime:resume (...)
-
Resumes a yielded runtime, analogous to coroutine.resume.
Parameters:
- ...
values delivered to the script as return values of
coroutine.yield()
Returns:
-
vararg
values passed to the next
coroutine.yield(), or returned by the scriptRaises:
if the runtime errors on resumption - ...
values delivered to the script as return values of
- runtime:stop ()
- Stops the runtime and releases all associated kernel resources.