OSDN Git Service

* public snapshot of sid simulator
[pf3gnuchains/pf3gnuchains3x.git] / sid / component / gloss / newlib.cxx
1 // newlib.cxx - newlib support.  -*- C++ -*-
2
3 // Copyright (C) 1999, 2000 Red Hat.
4 // This file is part of SID and is licensed under the GPL.
5 // See the file COPYING.SID for conditions for redistribution.
6
7 #include "config.h"
8 #include <errno.h>
9 #include "newlib.h"
10
11 int
12 newlib::host_to_target_errno (int host_errno)
13 {
14   switch (host_errno)
15     {
16 #ifdef EPERM
17     case EPERM : return ePerm;
18 #endif
19 #ifdef ENOENT
20     case ENOENT : return eNoEnt;
21 #endif
22 #ifdef EBADF
23     case EBADF : return eBadF;
24 #endif
25 #ifdef EAGAIN
26     case EAGAIN : return eAgain;
27 #endif
28 #ifdef EFAULT
29     case EFAULT : return eFault;
30 #endif
31 #ifdef EINVAL
32     case EINVAL : return eInval;
33 #endif
34 #ifdef EPIPE
35     case EPIPE : return ePipe;
36 #endif
37 #ifdef ENOSYS
38     case ENOSYS : return eNoSys;
39 #endif
40     default : return EINVAL;
41     }
42   /*NOTREACHED*/
43 }