opnsense-src/libexec/flua
Mark Johnston eda96744b4 lposix: Clean up the posix namespace definitions
The posix module is subdivided according to C headers; for instance,
posix.unistd contains routines available from unistd.h, such as
chown(2).

A quirk of our implementation is that each of the modules is a direct
entry in the global table.  That is, there is no "posix" table.
Instead, "posix.foo" and "posix.bar.baz" are both top-level tables.
This is surprising and goes against Lua's shorthand of using "." to
access keys in a table.  lua-posix also doesn't work this way.

Rework things so that "posix" and "posix.sys" are proper tables.
Existing flua code which uses require() to bind posix submodules to a
name will be unaffected.  Code which accesses them directly using
something like _G["posix.sys.utsname"].uname() will be broken, but I
don't think anything like that exists.  In particular, it is now
possible to call posix.sys.utsname.uname() without any require
statements.

Reviewed by:	imp, bapt
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D51158
2025-07-07 15:43:27 +00:00
..
libfreebsd flua: add freebsd.kenv, kenv(2) bindings 2024-09-14 07:43:50 +02:00
libhash flua: move modules source into the main source directory 2024-09-12 09:03:44 +02:00
libjail jail: Add meta and env parameters 2025-03-31 09:17:03 +00:00
liblyaml lyaml: vendor import lua bindings for libyaml 2025-06-26 09:15:08 +02:00
libucl flua: move modules source into the main source directory 2024-09-12 09:03:44 +02:00
modules lposix: Clean up the posix namespace definitions 2025-07-07 15:43:27 +00:00
flua.1 flua.1: Add xref to style.lua(9) 2025-04-28 16:28:26 -04:00
linit_flua.c lposix: Clean up the posix namespace definitions 2025-07-07 15:43:27 +00:00
Makefile lyaml: vendor import lua bindings for libyaml 2025-06-26 09:15:08 +02:00
Makefile.inc flua: move modules source into the main source directory 2024-09-12 09:03:44 +02:00