Alas, that will not do, since my program is a bit more than a shell emulation. Actually I strive to write a simple kernel.
So, it should be possible to swap out any process that is spawned by my progam ( again, 'process' is not a Linux process but my own notion of it ) in a way transparent to it. The code for userspace processes - like my implementations of shell commands 'echo' , 'ls' and so on, shouldn't know when and if it is interrupted.
Thus, it is not possible to just set a global var in my signal handler and then check it in the code, since I'd have to check it in the userspace code too, which is kinda against design of the program...
|