]> git.ozlabs.org Git - petitboot/commit - lib/process/process.c
lib/process: Allow process output to be retrieved on each event
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>
Fri, 21 Oct 2016 04:54:52 +0000 (15:54 +1100)
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>
Tue, 20 Dec 2016 05:40:21 +0000 (16:40 +1100)
commit0ba871a497f156dd474a333889cd92eaab9b08dc
tree996a2ea1828f6a1f72b652e8f2d37df452668e12
parent454f924bbcda7904c4348ef45c3d0d293768a48c
lib/process: Allow process output to be retrieved on each event

Allow a custom callback function to be set when registering the IO
waiter for asynchronous processes.

To allow output from processes to be parsed as it is received, add
process_stdout_custom() which passes a new "line" parameter to
process_read_stdout_once() in order to consume output as it appears.

Users of a custom IO callback will only have access to the process_info
struct which is internal to lib/process; the function
procinfo_get_process() is added to allow these callers to access process
information.

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
lib/process/process.c
lib/process/process.h