Re: How does one get the description of an errno value
Steve Graegert <[email protected]>
| Newsgroups | org.kernel.vger.linux-c-programming |
|---|---|
| Message-ID | <[email protected]> |
Angel,
The following code snippet should do it. It basically sets errno
manually and outputs the associated error message.
--- BEGIN ---
#define _ALL_SOURCE
#include <stdio.h>
#include <errno.h> /* for _MAX_ERRNO */
int main(void) {
int i;
extern int errno;
for (i = 0; i < MAX_ERRNO; i++) {
fprintf(stderr, "%3d", i);
errno = i;
perror(" ");
}
return (0);
}
--- END ---
\Steve
--
Steve Graegert
www.graegert.com
On Sun, Mar 15, 2009 at 11:46 AM, Angel Tsankov
<[email protected]> wrote:
> Hello,
>
> Is there a function which returns the description of an errno value and, if
> so, which is it?
>
> Regards,
> Angel Tsankov
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html