I'm creating a fault injection framework, and would like to do something like:
volatile bool doFaultWriteError;
In my code, I can then check the global variable to decide whether to do the fault.
In BSD, I hear you can teach sysctl to set variable in user space processes. Is this possible in Linux? How do I do it?
My current plan is to have a SIGHUP handler that read a "fault configuration" file and then sets globals as appropriate. But if there's already something in Linux that can do this, that would be simpler.