tcllux::signal - TclLux signal
The TclLux signal Tcl extension provides signal information. A signal argument can be a number or a signal name. A signal name is case-insensitive and may be prefixed with "sig".
Returns a list of 3-element lists. Columns: name, number description.
Returns signal info if only signal supplied. If action is default then the system default action will be taken upon receipt of the signal. If action is ignore then the signal will be ignored. If action is a Tcl channel then data will be written to the channel upon receipt of the signal. If send is signal then the signal number will be written to the channel as one byte. If send is timestamp then a timestamp (seconds and nanoseconds) of when the signal was received will be written to the channel as two uint64_t (128 bytes). The default for send is signal. Attempting to set signal 0 does nothing. Returns an empty string.
Send signal signal to process pid. Signal 0 can be used for pid checks. Returns an empty string.
proc sigreceiver {chan send} { if {$send eq "timestamp"} { binary scan [read $chan 16] mm s ns puts $s.$ns } elseif {$send eq "signal"} { binary scan [read $chan 1] c s puts $s } } proc sigsetup {sig} { set send signal #set send timestamp lassign [chan pipe] r w chan configure $r -translation binary -blocking 0 chan configure $w -translation binary -blocking 0 fileevent $r readable [list sigreceiver $r $send] lux signal set $sig $w $send } sigsetup hup lux signal send hup [pid]
signal(3)
signal, unix
UNIX
Copyright © 2019 Stuart Cassoff <stwo@users.sourceforge.net>