• Tobias Klauser's avatar
    unix: add ErrnoName and SignalName · 6f686a35
    Tobias Klauser authored
    Add ErrnoName and SignalName to get errno and signal name strings from
    syscall.Errno and syscall.Signal values, respectively.
    
    This repurposes the errors and signals vars (because they are not used
    within x/sys/unix currently) and turns them into slices of struct,
    containing errno/signal number, name and description. ErrnoName and
    SignalName can then be trivially implemented using sort.Search.
    
    Renaming errors to errorList additionaly allows to avoid package aliases
    for the errors package.
    
    Fixes golang/go#25134
    
    Change-Id: Ie195872793f44c437f0f175ccfaa13a2546338c5
    Reviewed-on: https://go-review.googlesource.com/110875
    Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    6f686a35
syscall_unix.go 9.65 KB