On my Solaris 9 system, the prototype of the pthread_cleanup_push() function is, according to the man page:
void pthread_cleanup_push(void (*handler, void *), void *arg);
However, on my Linux 2.6 system, its prototype is:
void pthread_cleanup_push(void (*routine) (void *), void *arg);
I can understand the Linux prototype: the first parameter is a function which takes a single parameter of void * type and returns void. But I am not able to understand the Solaris prototype. How to parse this "void (*handler, void *)" thing? Is there any difference between the Linux prototype and the Solaris prototype? Which way is "better", e.g. based on ANSI standard?
Also, if my "routine" takes as its parameter a pointer other than void *, do I need to cast it to "void *" before passing it to pthread_cleanup_push()?