Subversion Repositories Kolibri OS

Rev

Rev 6433 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6433 siemargl 1
#include 
8540 superturbo 2
#include 
6433 siemargl 3
 
145 halyavin 4
char* strerror(int err)
5
{
6433 siemargl 6
    char *msg;
7
    switch(err)
8
    {
8540 superturbo 9
    case E_SUCCESS:
10
        msg = "Success";
6433 siemargl 11
        break;
12
    case -1:
8540 superturbo 13
        msg = "End of file";
6433 siemargl 14
        break;
8540 superturbo 15
    case E_UNSUPPORTED:
16
        msg = "Function is not supported for the given file system";
6433 siemargl 17
        break;
8540 superturbo 18
    case E_UNKNOWNFS:
19
        msg = "Unknown file system";
6433 siemargl 20
        break;
8540 superturbo 21
    case E_NOTFOUND:
22
        msg = "File not found";
6433 siemargl 23
        break;
8540 superturbo 24
    case E_EOF:
25
        msg = "End of file, EOF";
6433 siemargl 26
        break;
8540 superturbo 27
    case E_INVALIDPTR:
28
        msg = "Pointer lies outside of application memory";
6433 siemargl 29
        break;
8540 superturbo 30
    case E_DISKFULL:
31
        msg = "Disk is full";
6433 siemargl 32
        break;
8540 superturbo 33
    case E_FSYSERROR:
34
        msg = "Dile system error";
6433 siemargl 35
        break;
8540 superturbo 36
    case E_ACCESS:
37
        msg = "Access denied";
6433 siemargl 38
        break;
8540 superturbo 39
    case E_HARDWARE:
40
        msg = "Device error";
6433 siemargl 41
        break;
8540 superturbo 42
    case E_NOMEM:
43
        msg = "File system requires more memory";
6433 siemargl 44
        break;
8540 superturbo 45
    case E_NOMEM2:
46
        msg = "Not enough memory";
6433 siemargl 47
        break;
8540 superturbo 48
    case E_FILEFMT:
49
        msg = "File is not executable";
6433 siemargl 50
        break;
8540 superturbo 51
    case E_TOOMANY:
52
        msg = "Too many processes";
6433 siemargl 53
        break;
8540 superturbo 54
    /* Socket errors */
55
    case ENOBUFS:
56
        msg = "Broken buffer";
57
        break;
58
    case EINPROGRESS:
59
        msg = "Operation now in progress";
60
        break;
61
    case EOPNOTSUPP:
62
        msg = "Operation not supported on transport endpoint";
63
        break;
64
    case EWOULDBLOCK:
65
        msg = "Operation would block";
66
        break;
67
    case ENOTCONN:
68
        msg = "Transport endpoint is not connected";
69
        break;
70
    case EALREADY:
71
        msg = "Operation already in progress";
72
        break;
73
    case EINVALUE:
74
        msg = "Invalid argument";
75
        break;
76
    case EMSGSIZE:
77
        msg = "Message too long";
78
        break;
79
    case ENOMEM:
80
        msg = "Out of memory";
81
        break;
82
    case EADDRINUSE:
83
        msg = "Address already in use";
84
        break;
85
    case ECONNREFUSED:
86
        msg = "Connection refused";
87
        break;
88
    case ECONNRESET:
89
        msg = "Connection reset by peer";
90
        break;
91
    case EISCONN:
92
        msg = "Transport endpoint is already connected";
93
        break;
94
    case ETIMEDOUT:
95
        msg = "Connection timed out";
96
        break;
97
    case ECONNABORTED:
98
        msg = "Software caused connection abort";
99
        break;
6433 siemargl 100
    default:
8540 superturbo 101
        msg = "Unknown error";
6433 siemargl 102
        break;
103
    }
104
    return msg;
145 halyavin 105
}