writing a file inside a signal handler is uhhhh questionable. works on linux, not necessarily actually _portable_. i need to research that more