On Mon, Jan 27, 2014 at 03:09:03PM +0100, Pino Toscano wrote:
Reading this and other similar implementations, for example:
- fish/events.c, do_event_handler
- fish/fish.c, execute_and_inline and issue_command (which has a comment
regarding pipe commands)
- src/command.c, run_command
- src/launch-direct.c, launch_direct
- src/launch-uml.c, launch_uml
- daemon/guestfsd.c, commandrf (maybe, since it is in the appliance);
other popen usages in daemon/*
Certainly we could improve things ...
what about using libpipeline [1] to handle them? While it adds the
overhead of a new shared library (although using just libc, and ~55kb in
my f19/x86_64 installation), should help a bit in spawning commands and
handling piping of them if needed.
Given you are starting a new tool in C [2], what about making use of it
to check how it works?
[1]
http://libpipeline.nongnu.org/
[2] as in, was not in C before
Unfortunately libpipeline has an incompatible license (GPLv3+ in
COPYING, or GPLv2+ if you believe the file headers). Certainly
incompatible with the library, and probably incompatible even with our
tools.
Shame really, because it looks sensible apart from the license.
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines. Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top