1*47208Scael.\" Copyright (c) 1983, 1991 The Regents of the University of California. 238053Sbostic.\" All rights reserved. 320269Smckusick.\" 443568Strent.\" %sccs.include.redist.man% 520269Smckusick.\" 6*47208Scael.\" @(#)sigstack.2 6.5 (Berkeley) 03/10/91 738053Sbostic.\" 8*47208Scael.Dd 9*47208Scael.Dt SIGSTACK 2 10*47208Scael.Os BSD 4.2 11*47208Scael.Sh NAME 12*47208Scael.Nm sigstack 13*47208Scael.Nd set and/or get signal stack context 14*47208Scael.Sh SYNOPSIS 15*47208Scael.Fd #include <sys/signal.h> 16*47208Scael.Bd -literal 17*47208Scaelstruct sigstack { 18*47208Scael caddr_t ss_sp; 19*47208Scael int ss_onstack; 20*47208Scael}; 21*47208Scael.Ed 22*47208Scael.Ft int 23*47208Scael.Fn sigstack "const struct sigstack *ss" "struct sigstack *oss" 24*47208Scael.Sh DESCRIPTION 25*47208Scael.Fn Sigstack 2620269Smckusickallows users to define an alternate stack on which signals 2720269Smckusickare to be processed. If 28*47208Scael.Fa ss 2920269Smckusickis non-zero, 3020269Smckusickit specifies a 31*47208Scael.Em "signal stack" 3220269Smckusickon which to deliver signals 3320269Smckusickand tells the system if the process is currently executing 3420269Smckusickon that stack. When a signal's action indicates its handler 3520269Smckusickshould execute on the signal stack (specified with a 36*47208Scael.Xr sigvec 2 3720269Smckusickcall), the system checks to see 3820269Smckusickif the process is currently executing on that stack. If the 3920269Smckusickprocess is not currently executing on the signal stack, 4020269Smckusickthe system arranges a switch to the signal stack for the 4120269Smckusickduration of the signal handler's execution. 4220269SmckusickIf 43*47208Scael.Fa oss 4420269Smckusickis non-zero, the current signal stack state is returned. 45*47208Scael.Sh NOTES 4620269SmckusickSignal stacks are not ``grown'' automatically, as is 4720269Smckusickdone for the normal stack. If the stack overflows 4820269Smckusickunpredictable results may occur. 49*47208Scael.Sh RETURN VALUES 5020269SmckusickUpon successful completion, a value of 0 is returned. 51*47208ScaelOtherwise, a value of -1 is returned and 52*47208Scael.Va errno 5320269Smckusickis set to indicate the error. 54*47208Scael.Sh ERRORS 55*47208Scael.Fn Sigstack 5620269Smckusickwill fail and the signal stack context will remain unchanged 5720269Smckusickif one of the following occurs. 58*47208Scael.Bl -tag -width [EFAULT] 59*47208Scael.It Bq Er EFAULT 6020269SmckusickEither 61*47208Scael.Fa ss 6220269Smckusickor 63*47208Scael.Fa oss 6423822Ssechrestpoints to memory that is not a valid part of the process 6520269Smckusickaddress space. 66*47208Scael.El 67*47208Scael.Sh SEE ALSO 68*47208Scael.Xr sigvec 2 , 69*47208Scael.Xr setjmp 3 70*47208Scael.Sh HISTORY 71*47208ScaelThe 72*47208Scael.Nm 73*47208Scaelfunction call appeared in 74*47208Scael.Bx 4.2 . 75