Apache HTTPD
framework
httpd-2.4.62
srclib
apr
file_io
os2
maperrorcode.c
Go to the documentation of this file.
1
/* Licensed to the Apache Software Foundation (ASF) under one or more
2
* contributor license agreements. See the NOTICE file distributed with
3
* this work for additional information regarding copyright ownership.
4
* The ASF licenses this file to You under the Apache License, Version 2.0
5
* (the "License"); you may not use this file except in compliance with
6
* the License. You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#define INCL_DOSERRORS
18
#include "apr_arch_file_io.h"
19
#include "
apr_file_io.h
"
20
#include <errno.h>
21
#include <string.h>
22
#include "
apr_errno.h
"
23
24
static
int
errormap
[][2] = {
25
{
NO_ERROR
,
APR_SUCCESS
},
26
{
ERROR_FILE_NOT_FOUND
,
APR_ENOENT
},
27
{
ERROR_PATH_NOT_FOUND
,
APR_ENOENT
},
28
{
ERROR_TOO_MANY_OPEN_FILES
,
APR_EMFILE
},
29
{
ERROR_ACCESS_DENIED
,
APR_EACCES
},
30
{
ERROR_SHARING_VIOLATION
,
APR_EACCES
},
31
{
ERROR_INVALID_PARAMETER
,
APR_EINVAL
},
32
{
ERROR_OPEN_FAILED
,
APR_ENOENT
},
33
{
ERROR_DISK_FULL
,
APR_ENOSPC
},
34
{
ERROR_FILENAME_EXCED_RANGE
,
APR_ENAMETOOLONG
},
35
{
ERROR_INVALID_FUNCTION
,
APR_EINVAL
},
36
{
ERROR_INVALID_HANDLE
,
APR_EBADF
},
37
{
ERROR_NEGATIVE_SEEK
,
APR_ESPIPE
},
38
{
ERROR_NO_SIGNAL_SENT
,
ESRCH
},
39
{
ERROR_NO_DATA
,
APR_EAGAIN
},
40
{
SOCEINTR
,
EINTR
},
41
{
SOCEWOULDBLOCK
,
EWOULDBLOCK
},
42
{
SOCEINPROGRESS
,
EINPROGRESS
},
43
{
SOCEALREADY
,
EALREADY
},
44
{
SOCENOTSOCK
,
ENOTSOCK
},
45
{
SOCEDESTADDRREQ
,
EDESTADDRREQ
},
46
{
SOCEMSGSIZE
,
EMSGSIZE
},
47
{
SOCEPROTOTYPE
,
EPROTOTYPE
},
48
{
SOCENOPROTOOPT
,
ENOPROTOOPT
},
49
{
SOCEPROTONOSUPPORT
,
EPROTONOSUPPORT
},
50
{
SOCESOCKTNOSUPPORT
,
ESOCKTNOSUPPORT
},
51
{
SOCEOPNOTSUPP
,
EOPNOTSUPP
},
52
{
SOCEPFNOSUPPORT
,
EPFNOSUPPORT
},
53
{
SOCEAFNOSUPPORT
,
EAFNOSUPPORT
},
54
{
SOCEADDRINUSE
,
EADDRINUSE
},
55
{
SOCEADDRNOTAVAIL
,
EADDRNOTAVAIL
},
56
{
SOCENETDOWN
,
ENETDOWN
},
57
{
SOCENETUNREACH
,
ENETUNREACH
},
58
{
SOCENETRESET
,
ENETRESET
},
59
{
SOCECONNABORTED
,
ECONNABORTED
},
60
{
SOCECONNRESET
,
ECONNRESET
},
61
{
SOCENOBUFS
,
ENOBUFS
},
62
{
SOCEISCONN
,
EISCONN
},
63
{
SOCENOTCONN
,
ENOTCONN
},
64
{
SOCESHUTDOWN
,
ESHUTDOWN
},
65
{
SOCETOOMANYREFS
,
ETOOMANYREFS
},
66
{
SOCETIMEDOUT
,
ETIMEDOUT
},
67
{
SOCECONNREFUSED
,
ECONNREFUSED
},
68
{
SOCELOOP
,
ELOOP
},
69
{
SOCENAMETOOLONG
,
ENAMETOOLONG
},
70
{
SOCEHOSTDOWN
,
EHOSTDOWN
},
71
{
SOCEHOSTUNREACH
,
EHOSTUNREACH
},
72
{
SOCENOTEMPTY
,
ENOTEMPTY
},
73
{
SOCEPIPE
,
EPIPE
}
74
};
75
76
#define MAPSIZE (sizeof(errormap)/sizeof(errormap[0]))
77
78
int
apr_canonical_error
(
apr_status_t
err
)
79
{
80
int
rv = -1, index;
81
82
if
(
err
<
APR_OS_START_SYSERR
)
83
return
err
;
84
85
err
-=
APR_OS_START_SYSERR
;
86
87
for
(index=0; index<
MAPSIZE
&&
errormap
[index][0] !=
err
; index++);
88
89
if
(index<
MAPSIZE
)
90
rv =
errormap
[index][1];
91
else
92
fprintf
(
stderr
,
"apr_canonical_error: Unknown OS/2 error code %d\n"
,
err
);
93
94
return
rv;
95
}
apr_errno.h
APR Error Codes.
apr_file_io.h
APR File I/O Handling.
APR_EAGAIN
#define APR_EAGAIN
Definition
apr_errno.h:730
APR_ENOSPC
#define APR_ENOSPC
Definition
apr_errno.h:676
APR_EBADF
#define APR_EBADF
Definition
apr_errno.h:704
APR_ESPIPE
#define APR_ESPIPE
Definition
apr_errno.h:718
APR_ENAMETOOLONG
#define APR_ENAMETOOLONG
Definition
apr_errno.h:655
APR_EACCES
#define APR_EACCES
Definition
apr_errno.h:641
APR_ENOENT
#define APR_ENOENT
Definition
apr_errno.h:662
APR_EINVAL
#define APR_EINVAL
Definition
apr_errno.h:711
APR_EMFILE
#define APR_EMFILE
Definition
apr_errno.h:690
ERROR_INVALID_PARAMETER
#define ERROR_INVALID_PARAMETER
Definition
mod_isapi.h:231
size
apr_size_t size
Definition
apr_allocator.h:115
APR_SUCCESS
#define APR_SUCCESS
Definition
apr_errno.h:225
APR_OS_START_SYSERR
#define APR_OS_START_SYSERR
Definition
apr_errno.h:185
apr_status_t
int apr_status_t
Definition
apr_errno.h:44
err
apr_int32_t apr_int32_t apr_int32_t err
Definition
apr_thread_proc.h:418
MAPSIZE
#define MAPSIZE
Definition
maperrorcode.c:76
apr_canonical_error
int apr_canonical_error(apr_status_t err)
Definition
maperrorcode.c:78
errormap
static int errormap[][2]
Definition
maperrorcode.c:24
SOCEINTR
#define SOCEINTR
Definition
apr_arch_networkio.h:61
SOCEPIPE
#define SOCEPIPE
Definition
apr_arch_networkio.h:68
Generated by
1.9.8