* Update configure script to remove the search for a linking tcl
[alpine.git] / pith / osdep / err_desc.c
blob14318fe0a3cb7b0d17ae48475878adf97003bca9
1 #if !defined(lint) && !defined(DOS)
2 static char rcsid[] = "$Id: err_desc.c 761 2007-10-23 22:35:18Z hubert@u.washington.edu $";
3 #endif
5 /*
6 * ========================================================================
7 * Copyright 2013-2018 Eduardo Chappa
8 * Copyright 2006 University of Washington
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * ========================================================================
19 #include <system.h>
20 #include "err_desc.h"
23 /*----------------------------------------------------------------------
24 Return string describing the error
26 Args: errnumber -- The system error number (errno)
28 Result: long string describing the error is returned
29 ----*/
30 char *
31 error_description(int errnumber)
33 static char buffer[50+1];
35 buffer[0] = '\0';
37 if(errnumber >= 0)
38 snprintf(buffer, sizeof(buffer), "%s", strerror(errnumber));
39 else
40 snprintf(buffer, sizeof(buffer), "Unknown error #%d", errnumber);
42 return ( (char *) buffer);