Does this mean the runtime always provides si and uc to both the two kinds of calls?
It means that particular implementation does, yes.
Is such a user code well-defined?
No, it means that it relies on undefined behavior that happens to work on one particular platform.
Note that, even on your present platform, this shortcut might not work for you. You could forgive your runtime for itself taking a shortcut with garbage in the siginfo_t
and ucontext_t
parameters. After all, by not omitting SA_SIGINFO, you told the implementation that you wouldn't need that information.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…