]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/basic/exec-util.h
basic/exec-util: add support for synchronous (ordered) execution
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 22 Jan 2017 20:22:37 +0000 (15:22 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 20 Feb 2017 23:49:13 +0000 (18:49 -0500)
commitc6e47247a745f9245eb3dbfb29fc066ef72d3886
tree4bc9451abde3c562a24ae18c2bfcb2dee4f618c2
parent504afd7c34e00eb84589e94e59cd14f2fffa2807
basic/exec-util: add support for synchronous (ordered) execution

The output of processes can be gathered, and passed back to the callee.
(This commit just implements the basic functionality and tests.)

After the preparation in previous commits, the change in functionality is
relatively simple. For coding convenience, alarm is prepared *before* any
children are executed, and not before. This shouldn't matter usually, since
just forking of the children should be pretty quick. One could also argue that
this is more correct, because we will also catch the case when (for whatever
reason), forking itself is slow.

Three callback functions and three levels of serialization are used:
- from individual generator processes to the generator forker
- from the forker back to the main process
- deserialization in the main process

v2:
- replace an structure with an indexed array of callbacks
src/basic/exec-util.c
src/basic/exec-util.h
src/core/manager.c
src/core/shutdown.c
src/sleep/sleep.c
src/test/test-exec-util.c