I need a usage of “void handler(int signo, siginfo_t *info, void *other)” function in sigaction, how to invoke “handler(int signo, siginfo_t *info, void *other)” function using all its parameters. My requirement is to pass “this” pointer as the third parameter. Would it be possible to provide me an example where all parameters are being used, mainly “void *other”.
You misunderstand the usage. handler() is not something that you call. This is a function that you provide, which is called when a signal is raised. You do not pass the void *other parameter, but rather it is passed to your function.
The third parameter “void *other” must seem a little mysterious as it is not mentioned in the documentation. A quote from “Programming For The Real World, POSIX.4” Bill O. Gallmeister, O’Reilly & Associates Inc., might help.
"void handler_for_SIGRTMIN(int signu, siginfo_t *data, void *extra);
The signum is as before, and the extra parameter is undefined by POSIX.4
(it has meaning in several standard UNIX systems, however, generally referring to the
machine context at the time of the signal; POSIX.4 defines it so as not to gratuitously
break the function prototypes used in those implementations)."
I hope this helps.