in reply to How portable are common $! error codes?
perl.h pulls in errno.h, which is probably what you want. You might also look at Errno.pm and how it's built. You really oughtn't rely on the numbers being portable, however.