Apache HTTPD
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
24static int errormap[][2] = {
40 { SOCEINTR, EINTR },
68 { SOCELOOP, ELOOP },
73 { SOCEPIPE, EPIPE }
74};
75
76#define MAPSIZE (sizeof(errormap)/sizeof(errormap[0]))
77
79{
80 int rv = -1, index;
81
83 return err;
84
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 Error Codes.
APR File I/O Handling.
#define APR_EAGAIN
Definition apr_errno.h:730
#define APR_ENOSPC
Definition apr_errno.h:676
#define APR_EBADF
Definition apr_errno.h:704
#define APR_ESPIPE
Definition apr_errno.h:718
#define APR_ENAMETOOLONG
Definition apr_errno.h:655
#define APR_EACCES
Definition apr_errno.h:641
#define APR_ENOENT
Definition apr_errno.h:662
#define APR_EINVAL
Definition apr_errno.h:711
#define APR_EMFILE
Definition apr_errno.h:690
#define ERROR_INVALID_PARAMETER
Definition mod_isapi.h:231
apr_size_t size
#define APR_SUCCESS
Definition apr_errno.h:225
#define APR_OS_START_SYSERR
Definition apr_errno.h:185
int apr_status_t
Definition apr_errno.h:44
apr_int32_t apr_int32_t apr_int32_t err
#define MAPSIZE
int apr_canonical_error(apr_status_t err)
static int errormap[][2]
#define SOCEINTR
#define SOCEPIPE