I am using the Linux framebuffer in my application, and setting ioctl(tty0_fd, KDSETMODE, KD_GRAPHICS)
to prevent any cursor or text from being displayed by the underlying terminal, and then cleaning up upon normal program termination.
But remaining in KD_GRAPHICS
mode upon abnormal termination is a Bad Thing since it leaves the system unresponsive, and I'm wondering how to address that condition.
Functions registered with atexit()
are only invoked upon normal termination, so that won't help. I could register my own handlers for any signals that can kill the application, but SIGKILL
cannot be trapped.
How do windowing environments and other programs handle this situation?