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
F162772407: D50539.diff
Thu, Jul 16, 5:50 PM
Unknown Object (File)
Mon, Jul 6, 3:43 AM
Unknown Object (File)
Fri, Jul 3, 8:49 AM
Unknown Object (File)
Mon, Jun 29, 3:36 PM
Unknown Object (File)
Mon, Jun 29, 12:35 PM
Unknown Object (File)
Mon, Jun 29, 10:47 AM
Unknown Object (File)
Wed, Jun 17, 12:47 AM
Unknown Object (File)
Jun 16 2026, 9:16 PM
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