X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/9bccf70c0258c7cac2dcb80011b2a964d884c552..bb59bff194111743b33cc36712410b5656329d3c:/bsd/man/man2/sigaltstack.2 diff --git a/bsd/man/man2/sigaltstack.2 b/bsd/man/man2/sigaltstack.2 index dba3f28db..3ca8c96f3 100644 --- a/bsd/man/man2/sigaltstack.2 +++ b/bsd/man/man2/sigaltstack.2 @@ -40,17 +40,12 @@ .Nm sigaltstack .Nd set and/or get signal stack context .Sh SYNOPSIS -.Fd #include .Fd #include -.Bd -literal -struct sigaltstack { - char *ss_sp; - int ss_size; - int ss_flags; -}; -.Ed .Ft int -.Fn sigaltstack "const struct sigaltstack *ss" "struct sigaltstack *oss" +.Fo sigaltstack +.Fa "const stack_t *restrict ss" +.Fa "stack_t *restrict oss" +.Fc .Sh DESCRIPTION .Fn Sigaltstack allows users to define an alternate stack on which signals @@ -73,7 +68,7 @@ the system arranges a switch to the signal stack for the duration of the signal handler's execution. .Pp If -.Dv SA_DISABLE +.Dv SS_DISABLE is set in .Fa ss_flags , .Fa ss_sp @@ -99,7 +94,7 @@ The field will contain the value .Dv SA_ONSTACK if the process is currently on a signal stack and -.Dv SA_DISABLE +.Dv SS_DISABLE if the signal stack is currently disabled. .Sh NOTES The value @@ -138,10 +133,11 @@ Otherwise, a value of -1 is returned and .Va errno is set to indicate the error. .Sh ERRORS -.Fn Sigstack +.Fn Sigaltstack will fail and the signal stack context will remain unchanged if one of the following occurs. .Bl -tag -width [ENOMEM] +.\" =========== .It Bq Er EFAULT Either .Fa ss @@ -149,15 +145,64 @@ or .Fa oss points to memory that is not a valid part of the process address space. +.\" =========== .It Bq Er EINVAL -An attempt was made to disable an active stack. +An attempt is made to disable an active stack. +.\" =========== +.It Bq Er EINVAL +The +.Fa ss +argument is not a null pointer, and the ss_flags member +pointed to by +.Fa ss +contains flags other than SS_DISABLE. +.\" =========== .It Bq Er ENOMEM -Size of alternate stack area is less than or equal to +The size of the alternate stack area is less than or equal to .Dv MINSIGSTKSZ . +.\" =========== +.It Bq Er EPERM +An attempt was made to modify an active stack. .El +.Sh LEGACY SYNOPSIS +.Fd #include +.Fd #include +.Pp +The include file +.In sys/types.h +is necessary. +.Pp +.Bd -literal +struct sigaltstack { + char *ss_sp; + int ss_size; + int ss_flags; +}; +.Ed +.Pp +.Ft int +.br +.Fo sigaltstack +.Fa "const struct sigaltstack *ss" +.Fa "struct sigaltstack *oss" +.Fc ; +.Pp +The variable types have changed. +Specifically, the +.Vt sigaltstack +struct is no longer used. +.Sh COMPATIBILITY +Use of the (obsolete) +.Vt sigaltstack +struct will cause compiler diagnostics. +Use +.Vt stack_t , +defined in +.In signal.h . .Sh SEE ALSO .Xr sigaction 2 , -.Xr setjmp 3 +.Xr setjmp 3 , +.Xr compat 5 .Sh HISTORY The predecessor to .Nm sigaltstack ,