3f0e1092 | 09-Jul-2025 |
Kyle Evans <kevans@FreeBSD.org> |
flua: fbsd: allow stdout to be captured for exec() processes
This allows us to do things like:
``` local fp = assert(fbsd.exec({"ls", "-l"}, true)) local fpout = assert(fp:stdout())
while true do
flua: fbsd: allow stdout to be captured for exec() processes
This allows us to do things like:
``` local fp = assert(fbsd.exec({"ls", "-l"}, true)) local fpout = assert(fp:stdout())
while true do local line = fpout:read("l") if not line then break end print("Read: " .. line) end
fp:close() ```
The makeman lua rewrite will use it to capture `make showconfig` output for processing.
Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D50539
show more ...
|
6a2c624b | 09-Jul-2025 |
Kyle Evans <kevans@FreeBSD.org> |
flua: fbsd: return a process handle to operate on when we exec()
This gives us some way to be able to write to stdin if we want to, or as a future improvement, will allow us to extract stdout from t
flua: fbsd: return a process handle to operate on when we exec()
This gives us some way to be able to write to stdin if we want to, or as a future improvement, will allow us to extract stdout from the process. The handle is setup to close and waitpid() on close/gc so that existing users wouldn't necessarily leak for the lifetime of the script if they weren't adopted to the new model.
Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D50538
show more ...
|
aad50785 | 30-Sep-2024 |
Kyle Evans <kevans@FreeBSD.org> |
Fix the cross-build after recent commits
- Provide a sys/md4.h in the cross-build environment to fix bootstrap of libmd. - flua now exposes WTRAPPED which isn't incredibly common- make it co
Fix the cross-build after recent commits
- Provide a sys/md4.h in the cross-build environment to fix bootstrap of libmd. - flua now exposes WTRAPPED which isn't incredibly common- make it conditional, we probably won't be using it in any bootstrap context any time soon.
Fixes: 442e0975ee4b3 ("Consolidate md4 implementations written in C") Fixes: c2caf3b3313fe ("flua: posix: add more useful functions [...]")
show more ...
|
696922fb | 12-Sep-2024 |
Baptiste Daroussin <bapt@FreeBSD.org> |
flua: add freebsd.kenv, kenv(2) bindings
Add bindings for kenv(2) right now only get() has been created it allows do dump into a key/value table the kernel environement if no argument is passed, or
flua: add freebsd.kenv, kenv(2) bindings
Add bindings for kenv(2) right now only get() has been created it allows do dump into a key/value table the kernel environement if no argument is passed, or it returns the value associated to the provided key.
Reviewed by: imp, kevans, markj Accepted by: imp, kevans Differential Revision: https://reviews.freebsd.org/D46654
show more ...
|