* Update configure script according to previous change to configure.ac
[alpine.git] / pith / osdep / err_desc.c
blob384e990bba8b3247c3fa415b4792b2812ca667d4
1 /*
2 * ========================================================================
3 * Copyright 2013-2022 Eduardo Chappa
4 * Copyright 2006 University of Washington
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * ========================================================================
15 #include <system.h>
16 #include "err_desc.h"
19 /*----------------------------------------------------------------------
20 Return string describing the error
22 Args: errnumber -- The system error number (errno)
24 Result: long string describing the error is returned
25 ----*/
26 char *
27 error_description(int errnumber)
29 static char buffer[50+1];
31 buffer[0] = '\0';
33 if(errnumber >= 0)
34 snprintf(buffer, sizeof(buffer), "%s", strerror(errnumber));
35 else
36 snprintf(buffer, sizeof(buffer), "Unknown error #%d", errnumber);
38 return ( (char *) buffer);