package sigframe
import "gvisor.dev/gvisor/pkg/sigframe"
Package sigframe implements a mechanism to create a signal frame on the stack and execute a user-defined callback function within that context. The callback function can use the `sigreturn` system call to resuming the current thread with the state from the signal frame. This functionality can be helpful in scenarios where you need to simulate a signal handler-like behavior without triggering a signal.
Index ¶
- func CallWithSignalFrame(signalStack *linux.SignalStack, handlerAddr uintptr, sigmask *linux.SignalSet, rax uint64) error
- func Sigreturn(sigframeAddr *arch.UContext64)
Functions ¶
func CallWithSignalFrame ¶
func CallWithSignalFrame(signalStack *linux.SignalStack, handlerAddr uintptr, sigmask *linux.SignalSet, rax uint64) error
CallWithSignalFrame sets up a signal frame on the stack and executes a user-defined callback function within that context.
Caller-save registers can be used for passing arguments to the handler. These registers must be pre-set within the signal frame.
func Sigreturn ¶
func Sigreturn(sigframeAddr *arch.UContext64)
Sigreturn restores the thread state from the signal frame.
Source Files ¶
sigframe.go sigframe_amd64_unsafe.go
- Version
- v0.0.0-20250605235530-a6711d1e1dc6 (latest)
- Published
- Jun 5, 2025
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- 4 hours ago –
Tools for package owners.