HomeFreeBSD

flua: fbsd: allow stdout to be captured for exec() processes

Description

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

(cherry picked from commit 3f0e1092097ed63b83a02518395e370c3cac01be)

Details

Provenance
kevansAuthored on Jul 9 2025, 5:12 AM
emasteCommitted on Sep 11 2025, 3:09 PM
Reviewer
bapt
Differential Revision
D50539: flua: fbsd: allow stdout to be captured for exec() processes
Parents
rGd9412b5fff91: flua: fbsd: return a process handle to operate on when we exec()
Branches
Unknown
Tags
Unknown