Content deleted Content added
No edit summary |
Add section for listing error codes |
||
Line 35:
In such situations, the source code must be modified to replace all <code>extern int errno</code> lines with a single include: <source lang="c">#include <errno.h></source>
<!-- Wasn't sure where to place this section. Maybe this should go into wikibooks. -->
The following shell commands can be used to determine error codes and messages on a particular system.
<source lang="bash">
# Win32:
perl -MErrno -e "my %e= map { Errno->$_()=>$_ } keys(%!); print grep !
+/unknown error/i, map sprintf('%4d %-12s %s'.$/,$_,$e{$_},$!=$_), 0..
+127"
# Other:
perl -MErrno -e 'my %e= map { Errno->$_()=>$_ } keys(%!); print grep !
+/unknown error/i, map sprintf("%4d %-12s %s".$/,$_,$e{$_},$!=$_), 0..
+127'
</source>
==See also==
▲*[[Alphanumerical List of Unix Error Codes and Messages]]
*[[Abort (computing)]]
*[[Aspect-oriented programming]]
Line 51 ⟶ 66:
*[http://msdn2.microsoft.com/en-us/library/ms679321.aspx Win32 Error Handling Functions]
*[http://www.pc-library.com/errors/ Error Code Library]
*[http://www.perlmonks.org/?node_id=274896 List Standard Error Codes using Perl]
[[Category:Debugging]]
|