I’ve used this for years:
errno () {
grep \\\<$*\\\> /usr/include/sys/errno.h
}
There will be a false positive now & then but this is good enough.