Paste: This replaces the old signal-error. definition

Author: ehird
Mode: factor
Date: Mon, 20 Apr 2009 00:00:38
Plain Text |
CONSTANT: signal-names
{
    "SIGHUP" "SIGINT" "SIGQUIT" "SIGILL" "SIGTRAP" "SIGABRT"
    "SIGEMT" "SIGFPE" "SIGKILL" "SIGBUS" "SIGSEGV" "SIGSYS"
    "SIGPIPE" "SIGALRM" "SIGTERM" "SIGURG" "SIGSTOP" "SIGTSIP"
    "SIGCONT" "SIGCHLD" "SIGTTIN" "SIGTTOU" "SIGIO" "SIGXCPU"
    "SIGXFSZ" "SIGVTALRM" "SIGPROF" "SIGWINCH" "SIGINFO"
    "SIGUSR1" "SIGUSR2"
}

: signal-name. ( sig -- )
    dup signal-names length <=
    os unix? and
    [ " (" write 1- signal-names nth write ")" write ] [ drop ] if ;

: signal-error. ( obj -- )
    "Operating system signal " write
    third [ pprint ] [ signal-name. ] bi nl ;

New Annotation

Summary:
Author:
Mode:
Body: