Added example wirekit README

This commit is contained in:
York Jasper Niebuhr 2025-08-17 13:11:30 +02:00
parent 8dcddf0e82
commit 3f2f0966f1

View File

@ -0,0 +1,2 @@
# Example Wire Kit
The wire kit implemented in ``main.cpp`` hooks into all entries to ``open`` and ``openat`` system calls and logs the filenames given to them. In ``wirekit_command_exit``, it prints the compiled list of all opened files. An important note is the reason to **not print** in the system call entry hooks themselves: the hosted commands use the same shell as the wire kit, by default. If you run e.g. ``vim`` but have a wire kit print in the middle of it, the output messes with ``vim``'s own control of the console. To prevent this, either accumulate all output until the command has finished executing or spawn a separate shell from within the wire kit, either when it is prepared or a command is started.