xref: /csrg-svn/lib/libc/sys/sigreturn.2 (revision 61185)
1*61185Sbostic.\" Copyright (c) 1985, 1991, 1993
2*61185Sbostic.\"	The Regents of the University of California.  All rights reserved.
320279Smckusick.\"
443568Strent.\" %sccs.include.redist.man%
520279Smckusick.\"
6*61185Sbostic.\"     @(#)sigreturn.2	8.1 (Berkeley) 06/04/93
738053Sbostic.\"
847208Scael.Dd
947208Scael.Dt SIGRETURN 2
1047208Scael.Os BSD 4.3
1147208Scael.Sh NAME
1247208Scael.Nm sigreturn
1347208Scael.Nd return from signal
1447208Scael.Sh SYNOPSIS
1555758Sbostic.Fd #include <signal.h>
1647208Scael.Bd -literal
1747208Scaelstruct sigcontext {
1847208Scael	int sc_onstack;
1947208Scael	int sc_mask;
2047208Scael	int sc_sp;
2147208Scael	int sc_fp;
2247208Scael	int sc_ap;
2347208Scael	int sc_pc;
2447208Scael	int sc_ps;
2547208Scael};
2647208Scael.Ed
2747208Scael.Ft int
2847208Scael.Fn sigreturn "struct sigcontext *scp"
2947208Scael.Sh DESCRIPTION
3047208Scael.Fn Sigreturn
3120279Smckusickallows users to atomically unmask, switch stacks,
3220279Smckusickand return from a signal context.
3320279SmckusickThe processes signal mask and stack status are
3420279Smckusickrestored from the context.
3520279SmckusickThe system call does not return;
3620279Smckusickthe users stack pointer, frame pointer, argument pointer,
3720279Smckusickand processor status longword are restored from the context.
3820279SmckusickExecution resumes at the specified pc.
3947208ScaelThis system call is used by the trampoline code and
4047208Scael.Xr longjmp 3
4120279Smckusickwhen returning from a signal to the previously executing program.
4247208Scael.Sh NOTES
4347208ScaelThis system call is not available in 4.2
4447208Scael.Tn BSD
4520279Smckusickhence it should not be used if backward compatibility is needed.
4647208Scael.Sh RETURN VALUES
4720279SmckusickIf successful, the system call does not return.
4847208ScaelOtherwise, a value of -1 is returned and
4947208Scael.Va errno
5020279Smckusickis set to indicate the error.
5147208Scael.Sh ERRORS
5247208Scael.Fn Sigreturn
5320279Smckusickwill fail and the process context will remain unchanged
5420279Smckusickif one of the following occurs.
5547208Scael.Bl -tag -width [EINVAL]
5647208Scael.It Bq Er EFAULT
5747208Scael.Fa Scp
5823820Ssechrestpoints to memory that is not a valid part of the process
5920279Smckusickaddress space.
6047208Scael.It Bq Er EINVAL
6120279SmckusickThe process status longword is invalid or would improperly
6220279Smckusickraise the privilege level of the process.
6347208Scael.El
6447208Scael.Sh SEE ALSO
6547208Scael.Xr sigvec 2 ,
6647208Scael.Xr setjmp 3
6747208Scael.Sh HISTORY
6847208ScaelThe
6947208Scael.Nm
7047208Scaelfunction call appeared in
7147208Scael.Bx 4.3 .
72