Signal Handler Launch
The function in the kernel that arranges for the signal handler to be called is sendsig(). Its job is to set up the stack frames for the call to the user function. It also has to make sure that when the routine finishes, it returns to the right place to clean up the signal data structures. It calls a variety of utility routines to do the work it has to do.
The first is sendsig_alloc_sigcontext(), which allocates space on the stack to hold the sigcontext structure. This space be can either on the user's stack or on a separate signal stack depending on the flags for this signal. Data is copied into this sigcontext structure by sendsig_fillin_slm(), sendsig_copyoutsavestate(), and sendsig_fillin_xsi().
The stack frame used ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access