All kernels do not use the same libc. In fact, Linux is different in the fact that it doesn't ship a libc with the kernel. Illumos, the OS I investigated, goes by the philosophy that you _have_ to ship libc with your kernel, and thus they have their own libc.
My diagnosis for Illumos may not hold up on other OSs, they may invert priority for other reasons. In any case the spec is fairly clear that a signal is considered delivered when the "appropriate action" is taken. In this case the appropriate action is to invoke the user's handler, which is above libc on the stack.
Finally, in case you missed it, I witnessed 4 unique orderings across the systems I tested. They were not the same across the board.
My diagnosis for Illumos may not hold up on other OSs, they may invert priority for other reasons. In any case the spec is fairly clear that a signal is considered delivered when the "appropriate action" is taken. In this case the appropriate action is to invoke the user's handler, which is above libc on the stack.
Finally, in case you missed it, I witnessed 4 unique orderings across the systems I tested. They were not the same across the board.