mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 09:04:13 +00:00
(strerror) [!HAS_STRERROR]: New function from Richard Frith-Macdonald
<richard@brainstorm.co.uk>. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1877 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2bc73929c9
commit
c2166652ea
1 changed files with 15 additions and 0 deletions
|
@ -28,6 +28,21 @@
|
|||
#include <stdarg.h>
|
||||
#include <errno.h>
|
||||
|
||||
#if !HAS_STRERROR
|
||||
static const char*
|
||||
strerror(int eno)
|
||||
{
|
||||
extern char* sys_errlist[];
|
||||
extern int sys_nerr;
|
||||
|
||||
if (eno < 0 || eno >= sys_nerr) {
|
||||
return("unknown error number");
|
||||
}
|
||||
return(sys_errlist[eno]);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
enum {
|
||||
STREAM_READONLY = 0,
|
||||
STREAM_READWRITE,
|
||||
|
|
Loading…
Reference in a new issue