Page MenuHomeFreeBSD

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

Authored by kevans on May 27 2025, 12:03 AM.
Tags
None
Referenced Files
F174948962: D50539.id156068.diff
Wed, Oct 7, 3:41 AM
Unknown Object (File)
Tue, Oct 6, 2:06 PM
Unknown Object (File)
Mon, Oct 5, 12:43 AM
Unknown Object (File)
Sat, Oct 3, 10:10 PM
Unknown Object (File)
Fri, Sep 25, 1:35 PM
Unknown Object (File)
Fri, Sep 11, 2:17 PM
Unknown Object (File)
Tue, Sep 8, 11:02 PM
Unknown Object (File)
Sep 6 2026, 6:01 AM
Subscribers

Details

Summary

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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable