tid::errno would be handy in mdb
Upstream of Joyent OS-7525:
If one wishes to see the current value of
errno of a thread (for example because the value tripped an assert and
VERIFY3S wasn't used to capture the value in the panic message), it's a bit tedious:
For historical reasons, TID 1's errno value is stored in a libc global variable errno. For TID > 1, their errno value is stored in
curthread->ul_errno. In addition, for every TID,
curthread->ul_errnop points to the address storing the threads errno value (abstracting away this difference). One must remember all of this to get meaningful values, and the mdb syntax that would be needed to consistently get the value would be rather complicated. It would be simpler to have an mdb dcmd that takes care of all of this for us.