Pass arguments to signal handler in C
问题 How can I pass arguments (e.g. a pointer to a struct) to a signal handler? I'm writing a multithread application, so I cannot use global variables I associate a timer to each thread. When timer expires I have to update a struct (each thread has a different struct). How can I do? 回答1: The way the signal handler is called by the system is fixed -- there's no way to change it and add an additional user pointer. So if you want to get additional data into the signal handler, the only way to do it