Apache Portable Runtime
|
00001 /* Licensed to the Apache Software Foundation (ASF) under one or more 00002 * contributor license agreements. See the NOTICE file distributed with 00003 * this work for additional information regarding copyright ownership. 00004 * The ASF licenses this file to You under the Apache License, Version 2.0 00005 * (the "License"); you may not use this file except in compliance with 00006 * the License. You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 #ifndef APR_ERRNO_H 00018 #define APR_ERRNO_H 00019 00020 /** 00021 * @file apr_errno.h 00022 * @brief APR Error Codes 00023 */ 00024 00025 #include "apr.h" 00026 00027 #if APR_HAVE_ERRNO_H 00028 #include <errno.h> 00029 #endif 00030 00031 #ifdef __cplusplus 00032 extern "C" { 00033 #endif /* __cplusplus */ 00034 00035 /** 00036 * @defgroup apr_errno Error Codes 00037 * @ingroup APR 00038 * @{ 00039 */ 00040 00041 /** 00042 * Type for specifying an error or status code. 00043 */ 00044 typedef int apr_status_t; 00045 00046 /** 00047 * Return a human readable string describing the specified error. 00048 * @param statcode The error code to get a string for. 00049 * @param buf A buffer to hold the error string. 00050 * @param bufsize Size of the buffer to hold the string. 00051 */ 00052 APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, 00053 apr_size_t bufsize); 00054 00055 #if defined(DOXYGEN) 00056 /** 00057 * @def APR_FROM_OS_ERROR(os_err_type syserr) 00058 * Fold a platform specific error into an apr_status_t code. 00059 * @return apr_status_t 00060 * @param e The platform os error code. 00061 * @warning macro implementation; the syserr argument may be evaluated 00062 * multiple times. 00063 */ 00064 #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR) 00065 00066 /** 00067 * @def APR_TO_OS_ERROR(apr_status_t statcode) 00068 * @return os_err_type 00069 * Fold an apr_status_t code back to the native platform defined error. 00070 * @param e The apr_status_t folded platform os error code. 00071 * @warning macro implementation; the statcode argument may be evaluated 00072 * multiple times. If the statcode was not created by apr_get_os_error 00073 * or APR_FROM_OS_ERROR, the results are undefined. 00074 */ 00075 #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR) 00076 00077 /** @def apr_get_os_error() 00078 * @return apr_status_t the last platform error, folded into apr_status_t, on most platforms 00079 * @remark This retrieves errno, or calls a GetLastError() style function, and 00080 * folds it with APR_FROM_OS_ERROR. Some platforms (such as OS2) have no 00081 * such mechanism, so this call may be unsupported. Do NOT use this 00082 * call for socket errors from socket, send, recv etc! 00083 */ 00084 00085 /** @def apr_set_os_error(e) 00086 * Reset the last platform error, unfolded from an apr_status_t, on some platforms 00087 * @param e The OS error folded in a prior call to APR_FROM_OS_ERROR() 00088 * @warning This is a macro implementation; the statcode argument may be evaluated 00089 * multiple times. If the statcode was not created by apr_get_os_error 00090 * or APR_FROM_OS_ERROR, the results are undefined. This macro sets 00091 * errno, or calls a SetLastError() style function, unfolding statcode 00092 * with APR_TO_OS_ERROR. Some platforms (such as OS2) have no such 00093 * mechanism, so this call may be unsupported. 00094 */ 00095 00096 /** @def apr_get_netos_error() 00097 * Return the last socket error, folded into apr_status_t, on all platforms 00098 * @remark This retrieves errno or calls a GetLastSocketError() style function, 00099 * and folds it with APR_FROM_OS_ERROR. 00100 */ 00101 00102 /** @def apr_set_netos_error(e) 00103 * Reset the last socket error, unfolded from an apr_status_t 00104 * @param e The socket error folded in a prior call to APR_FROM_OS_ERROR() 00105 * @warning This is a macro implementation; the statcode argument may be evaluated 00106 * multiple times. If the statcode was not created by apr_get_os_error 00107 * or APR_FROM_OS_ERROR, the results are undefined. This macro sets 00108 * errno, or calls a WSASetLastError() style function, unfolding 00109 * socketcode with APR_TO_OS_ERROR. 00110 */ 00111 00112 #endif /* defined(DOXYGEN) */ 00113 00114 /** 00115 * APR_OS_START_ERROR is where the APR specific error values start. 00116 */ 00117 #define APR_OS_START_ERROR 20000 00118 /** 00119 * APR_OS_ERRSPACE_SIZE is the maximum number of errors you can fit 00120 * into one of the error/status ranges below -- except for 00121 * APR_OS_START_USERERR, which see. 00122 */ 00123 #define APR_OS_ERRSPACE_SIZE 50000 00124 /** 00125 * APR_UTIL_ERRSPACE_SIZE is the size of the space that is reserved for 00126 * use within apr-util. This space is reserved above that used by APR 00127 * internally. 00128 * @note This number MUST be smaller than APR_OS_ERRSPACE_SIZE by a 00129 * large enough amount that APR has sufficient room for its 00130 * codes. 00131 */ 00132 #define APR_UTIL_ERRSPACE_SIZE 20000 00133 /** 00134 * APR_OS_START_STATUS is where the APR specific status codes start. 00135 */ 00136 #define APR_OS_START_STATUS (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE) 00137 /** 00138 * APR_UTIL_START_STATUS is where APR-Util starts defining its 00139 * status codes. 00140 */ 00141 #define APR_UTIL_START_STATUS (APR_OS_START_STATUS + \ 00142 (APR_OS_ERRSPACE_SIZE - APR_UTIL_ERRSPACE_SIZE)) 00143 /** 00144 * APR_OS_START_USERERR are reserved for applications that use APR that 00145 * layer their own error codes along with APR's. Note that the 00146 * error immediately following this one is set ten times farther 00147 * away than usual, so that users of apr have a lot of room in 00148 * which to declare custom error codes. 00149 * 00150 * In general applications should try and create unique error codes. To try 00151 * and assist in finding suitable ranges of numbers to use, the following 00152 * ranges are known to be used by the listed applications. If your 00153 * application defines error codes please advise the range of numbers it 00154 * uses to dev@apr.apache.org for inclusion in this list. 00155 * 00156 * Ranges shown are in relation to APR_OS_START_USERERR 00157 * 00158 * Subversion - Defined ranges, of less than 100, at intervals of 5000 00159 * starting at an offset of 5000, e.g. 00160 * +5000 to 5100, +10000 to 10100 00161 * 00162 * Apache HTTPD - +2000 to 2999 00163 */ 00164 #define APR_OS_START_USERERR (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE) 00165 /** 00166 * APR_OS_START_USEERR is obsolete, defined for compatibility only. 00167 * Use APR_OS_START_USERERR instead. 00168 */ 00169 #define APR_OS_START_USEERR APR_OS_START_USERERR 00170 /** 00171 * APR_OS_START_CANONERR is where APR versions of errno values are defined 00172 * on systems which don't have the corresponding errno. 00173 */ 00174 #define APR_OS_START_CANONERR (APR_OS_START_USERERR \ 00175 + (APR_OS_ERRSPACE_SIZE * 10)) 00176 /** 00177 * APR_OS_START_EAIERR folds EAI_ error codes from getaddrinfo() into 00178 * apr_status_t values. 00179 */ 00180 #define APR_OS_START_EAIERR (APR_OS_START_CANONERR + APR_OS_ERRSPACE_SIZE) 00181 /** 00182 * APR_OS_START_SYSERR folds platform-specific system error values into 00183 * apr_status_t values. 00184 */ 00185 #define APR_OS_START_SYSERR (APR_OS_START_EAIERR + APR_OS_ERRSPACE_SIZE) 00186 00187 /** 00188 * @defgroup APR_ERROR_map APR Error Space 00189 * <PRE> 00190 * The following attempts to show the relation of the various constants 00191 * used for mapping APR Status codes. 00192 * 00193 * 0 00194 * 00195 * 20,000 APR_OS_START_ERROR 00196 * 00197 * + APR_OS_ERRSPACE_SIZE (50,000) 00198 * 00199 * 70,000 APR_OS_START_STATUS 00200 * 00201 * + APR_OS_ERRSPACE_SIZE - APR_UTIL_ERRSPACE_SIZE (30,000) 00202 * 00203 * 100,000 APR_UTIL_START_STATUS 00204 * 00205 * + APR_UTIL_ERRSPACE_SIZE (20,000) 00206 * 00207 * 120,000 APR_OS_START_USERERR 00208 * 00209 * + 10 x APR_OS_ERRSPACE_SIZE (50,000 * 10) 00210 * 00211 * 620,000 APR_OS_START_CANONERR 00212 * 00213 * + APR_OS_ERRSPACE_SIZE (50,000) 00214 * 00215 * 670,000 APR_OS_START_EAIERR 00216 * 00217 * + APR_OS_ERRSPACE_SIZE (50,000) 00218 * 00219 * 720,000 APR_OS_START_SYSERR 00220 * 00221 * </PRE> 00222 */ 00223 00224 /** no error. */ 00225 #define APR_SUCCESS 0 00226 00227 /** 00228 * @defgroup APR_Error APR Error Values 00229 * <PRE> 00230 * <b>APR ERROR VALUES</b> 00231 * APR_ENOSTAT APR was unable to perform a stat on the file 00232 * APR_ENOPOOL APR was not provided a pool with which to allocate memory 00233 * APR_EBADDATE APR was given an invalid date 00234 * APR_EINVALSOCK APR was given an invalid socket 00235 * APR_ENOPROC APR was not given a process structure 00236 * APR_ENOTIME APR was not given a time structure 00237 * APR_ENODIR APR was not given a directory structure 00238 * APR_ENOLOCK APR was not given a lock structure 00239 * APR_ENOPOLL APR was not given a poll structure 00240 * APR_ENOSOCKET APR was not given a socket 00241 * APR_ENOTHREAD APR was not given a thread structure 00242 * APR_ENOTHDKEY APR was not given a thread key structure 00243 * APR_ENOSHMAVAIL There is no more shared memory available 00244 * APR_EDSOOPEN APR was unable to open the dso object. For more 00245 * information call apr_dso_error(). 00246 * APR_EGENERAL General failure (specific information not available) 00247 * APR_EBADIP The specified IP address is invalid 00248 * APR_EBADMASK The specified netmask is invalid 00249 * APR_ESYMNOTFOUND Could not find the requested symbol 00250 * APR_ENOTENOUGHENTROPY Not enough entropy to continue 00251 * </PRE> 00252 * 00253 * <PRE> 00254 * <b>APR STATUS VALUES</b> 00255 * APR_INCHILD Program is currently executing in the child 00256 * APR_INPARENT Program is currently executing in the parent 00257 * APR_DETACH The thread is detached 00258 * APR_NOTDETACH The thread is not detached 00259 * APR_CHILD_DONE The child has finished executing 00260 * APR_CHILD_NOTDONE The child has not finished executing 00261 * APR_TIMEUP The operation did not finish before the timeout 00262 * APR_INCOMPLETE The operation was incomplete although some processing 00263 * was performed and the results are partially valid 00264 * APR_BADCH Getopt found an option not in the option string 00265 * APR_BADARG Getopt found an option that is missing an argument 00266 * and an argument was specified in the option string 00267 * APR_EOF APR has encountered the end of the file 00268 * APR_NOTFOUND APR was unable to find the socket in the poll structure 00269 * APR_ANONYMOUS APR is using anonymous shared memory 00270 * APR_FILEBASED APR is using a file name as the key to the shared memory 00271 * APR_KEYBASED APR is using a shared key as the key to the shared memory 00272 * APR_EINIT Ininitalizer value. If no option has been found, but 00273 * the status variable requires a value, this should be used 00274 * APR_ENOTIMPL The APR function has not been implemented on this 00275 * platform, either because nobody has gotten to it yet, 00276 * or the function is impossible on this platform. 00277 * APR_EMISMATCH Two passwords do not match. 00278 * APR_EABSOLUTE The given path was absolute. 00279 * APR_ERELATIVE The given path was relative. 00280 * APR_EINCOMPLETE The given path was neither relative nor absolute. 00281 * APR_EABOVEROOT The given path was above the root path. 00282 * APR_EBUSY The given lock was busy. 00283 * APR_EPROC_UNKNOWN The given process wasn't recognized by APR 00284 * </PRE> 00285 * @{ 00286 */ 00287 /** @see APR_STATUS_IS_ENOSTAT */ 00288 #define APR_ENOSTAT (APR_OS_START_ERROR + 1) 00289 /** @see APR_STATUS_IS_ENOPOOL */ 00290 #define APR_ENOPOOL (APR_OS_START_ERROR + 2) 00291 /* empty slot: +3 */ 00292 /** @see APR_STATUS_IS_EBADDATE */ 00293 #define APR_EBADDATE (APR_OS_START_ERROR + 4) 00294 /** @see APR_STATUS_IS_EINVALSOCK */ 00295 #define APR_EINVALSOCK (APR_OS_START_ERROR + 5) 00296 /** @see APR_STATUS_IS_ENOPROC */ 00297 #define APR_ENOPROC (APR_OS_START_ERROR + 6) 00298 /** @see APR_STATUS_IS_ENOTIME */ 00299 #define APR_ENOTIME (APR_OS_START_ERROR + 7) 00300 /** @see APR_STATUS_IS_ENODIR */ 00301 #define APR_ENODIR (APR_OS_START_ERROR + 8) 00302 /** @see APR_STATUS_IS_ENOLOCK */ 00303 #define APR_ENOLOCK (APR_OS_START_ERROR + 9) 00304 /** @see APR_STATUS_IS_ENOPOLL */ 00305 #define APR_ENOPOLL (APR_OS_START_ERROR + 10) 00306 /** @see APR_STATUS_IS_ENOSOCKET */ 00307 #define APR_ENOSOCKET (APR_OS_START_ERROR + 11) 00308 /** @see APR_STATUS_IS_ENOTHREAD */ 00309 #define APR_ENOTHREAD (APR_OS_START_ERROR + 12) 00310 /** @see APR_STATUS_IS_ENOTHDKEY */ 00311 #define APR_ENOTHDKEY (APR_OS_START_ERROR + 13) 00312 /** @see APR_STATUS_IS_EGENERAL */ 00313 #define APR_EGENERAL (APR_OS_START_ERROR + 14) 00314 /** @see APR_STATUS_IS_ENOSHMAVAIL */ 00315 #define APR_ENOSHMAVAIL (APR_OS_START_ERROR + 15) 00316 /** @see APR_STATUS_IS_EBADIP */ 00317 #define APR_EBADIP (APR_OS_START_ERROR + 16) 00318 /** @see APR_STATUS_IS_EBADMASK */ 00319 #define APR_EBADMASK (APR_OS_START_ERROR + 17) 00320 /* empty slot: +18 */ 00321 /** @see APR_STATUS_IS_EDSOPEN */ 00322 #define APR_EDSOOPEN (APR_OS_START_ERROR + 19) 00323 /** @see APR_STATUS_IS_EABSOLUTE */ 00324 #define APR_EABSOLUTE (APR_OS_START_ERROR + 20) 00325 /** @see APR_STATUS_IS_ERELATIVE */ 00326 #define APR_ERELATIVE (APR_OS_START_ERROR + 21) 00327 /** @see APR_STATUS_IS_EINCOMPLETE */ 00328 #define APR_EINCOMPLETE (APR_OS_START_ERROR + 22) 00329 /** @see APR_STATUS_IS_EABOVEROOT */ 00330 #define APR_EABOVEROOT (APR_OS_START_ERROR + 23) 00331 /** @see APR_STATUS_IS_EBADPATH */ 00332 #define APR_EBADPATH (APR_OS_START_ERROR + 24) 00333 /** @see APR_STATUS_IS_EPATHWILD */ 00334 #define APR_EPATHWILD (APR_OS_START_ERROR + 25) 00335 /** @see APR_STATUS_IS_ESYMNOTFOUND */ 00336 #define APR_ESYMNOTFOUND (APR_OS_START_ERROR + 26) 00337 /** @see APR_STATUS_IS_EPROC_UNKNOWN */ 00338 #define APR_EPROC_UNKNOWN (APR_OS_START_ERROR + 27) 00339 /** @see APR_STATUS_IS_ENOTENOUGHENTROPY */ 00340 #define APR_ENOTENOUGHENTROPY (APR_OS_START_ERROR + 28) 00341 /** @} */ 00342 00343 /** 00344 * @defgroup APR_STATUS_IS Status Value Tests 00345 * @warning For any particular error condition, more than one of these tests 00346 * may match. This is because platform-specific error codes may not 00347 * always match the semantics of the POSIX codes these tests (and the 00348 * corresponding APR error codes) are named after. A notable example 00349 * are the APR_STATUS_IS_ENOENT and APR_STATUS_IS_ENOTDIR tests on 00350 * Win32 platforms. The programmer should always be aware of this and 00351 * adjust the order of the tests accordingly. 00352 * @{ 00353 */ 00354 /** 00355 * APR was unable to perform a stat on the file 00356 * @warning always use this test, as platform-specific variances may meet this 00357 * more than one error code 00358 */ 00359 #define APR_STATUS_IS_ENOSTAT(s) ((s) == APR_ENOSTAT) 00360 /** 00361 * APR was not provided a pool with which to allocate memory 00362 * @warning always use this test, as platform-specific variances may meet this 00363 * more than one error code 00364 */ 00365 #define APR_STATUS_IS_ENOPOOL(s) ((s) == APR_ENOPOOL) 00366 /** APR was given an invalid date */ 00367 #define APR_STATUS_IS_EBADDATE(s) ((s) == APR_EBADDATE) 00368 /** APR was given an invalid socket */ 00369 #define APR_STATUS_IS_EINVALSOCK(s) ((s) == APR_EINVALSOCK) 00370 /** APR was not given a process structure */ 00371 #define APR_STATUS_IS_ENOPROC(s) ((s) == APR_ENOPROC) 00372 /** APR was not given a time structure */ 00373 #define APR_STATUS_IS_ENOTIME(s) ((s) == APR_ENOTIME) 00374 /** APR was not given a directory structure */ 00375 #define APR_STATUS_IS_ENODIR(s) ((s) == APR_ENODIR) 00376 /** APR was not given a lock structure */ 00377 #define APR_STATUS_IS_ENOLOCK(s) ((s) == APR_ENOLOCK) 00378 /** APR was not given a poll structure */ 00379 #define APR_STATUS_IS_ENOPOLL(s) ((s) == APR_ENOPOLL) 00380 /** APR was not given a socket */ 00381 #define APR_STATUS_IS_ENOSOCKET(s) ((s) == APR_ENOSOCKET) 00382 /** APR was not given a thread structure */ 00383 #define APR_STATUS_IS_ENOTHREAD(s) ((s) == APR_ENOTHREAD) 00384 /** APR was not given a thread key structure */ 00385 #define APR_STATUS_IS_ENOTHDKEY(s) ((s) == APR_ENOTHDKEY) 00386 /** Generic Error which can not be put into another spot */ 00387 #define APR_STATUS_IS_EGENERAL(s) ((s) == APR_EGENERAL) 00388 /** There is no more shared memory available */ 00389 #define APR_STATUS_IS_ENOSHMAVAIL(s) ((s) == APR_ENOSHMAVAIL) 00390 /** The specified IP address is invalid */ 00391 #define APR_STATUS_IS_EBADIP(s) ((s) == APR_EBADIP) 00392 /** The specified netmask is invalid */ 00393 #define APR_STATUS_IS_EBADMASK(s) ((s) == APR_EBADMASK) 00394 /* empty slot: +18 */ 00395 /** 00396 * APR was unable to open the dso object. 00397 * For more information call apr_dso_error(). 00398 */ 00399 #if defined(WIN32) 00400 #define APR_STATUS_IS_EDSOOPEN(s) ((s) == APR_EDSOOPEN \ 00401 || APR_TO_OS_ERROR(s) == ERROR_MOD_NOT_FOUND) 00402 #else 00403 #define APR_STATUS_IS_EDSOOPEN(s) ((s) == APR_EDSOOPEN) 00404 #endif 00405 /** The given path was absolute. */ 00406 #define APR_STATUS_IS_EABSOLUTE(s) ((s) == APR_EABSOLUTE) 00407 /** The given path was relative. */ 00408 #define APR_STATUS_IS_ERELATIVE(s) ((s) == APR_ERELATIVE) 00409 /** The given path was neither relative nor absolute. */ 00410 #define APR_STATUS_IS_EINCOMPLETE(s) ((s) == APR_EINCOMPLETE) 00411 /** The given path was above the root path. */ 00412 #define APR_STATUS_IS_EABOVEROOT(s) ((s) == APR_EABOVEROOT) 00413 /** The given path was bad. */ 00414 #define APR_STATUS_IS_EBADPATH(s) ((s) == APR_EBADPATH) 00415 /** The given path contained wildcards. */ 00416 #define APR_STATUS_IS_EPATHWILD(s) ((s) == APR_EPATHWILD) 00417 /** Could not find the requested symbol. 00418 * For more information call apr_dso_error(). 00419 */ 00420 #if defined(WIN32) 00421 #define APR_STATUS_IS_ESYMNOTFOUND(s) ((s) == APR_ESYMNOTFOUND \ 00422 || APR_TO_OS_ERROR(s) == ERROR_PROC_NOT_FOUND) 00423 #else 00424 #define APR_STATUS_IS_ESYMNOTFOUND(s) ((s) == APR_ESYMNOTFOUND) 00425 #endif 00426 /** The given process was not recognized by APR. */ 00427 #define APR_STATUS_IS_EPROC_UNKNOWN(s) ((s) == APR_EPROC_UNKNOWN) 00428 /** APR could not gather enough entropy to continue. */ 00429 #define APR_STATUS_IS_ENOTENOUGHENTROPY(s) ((s) == APR_ENOTENOUGHENTROPY) 00430 00431 /** @} */ 00432 00433 /** 00434 * @addtogroup APR_Error 00435 * @{ 00436 */ 00437 /** @see APR_STATUS_IS_INCHILD */ 00438 #define APR_INCHILD (APR_OS_START_STATUS + 1) 00439 /** @see APR_STATUS_IS_INPARENT */ 00440 #define APR_INPARENT (APR_OS_START_STATUS + 2) 00441 /** @see APR_STATUS_IS_DETACH */ 00442 #define APR_DETACH (APR_OS_START_STATUS + 3) 00443 /** @see APR_STATUS_IS_NOTDETACH */ 00444 #define APR_NOTDETACH (APR_OS_START_STATUS + 4) 00445 /** @see APR_STATUS_IS_CHILD_DONE */ 00446 #define APR_CHILD_DONE (APR_OS_START_STATUS + 5) 00447 /** @see APR_STATUS_IS_CHILD_NOTDONE */ 00448 #define APR_CHILD_NOTDONE (APR_OS_START_STATUS + 6) 00449 /** @see APR_STATUS_IS_TIMEUP */ 00450 #define APR_TIMEUP (APR_OS_START_STATUS + 7) 00451 /** @see APR_STATUS_IS_INCOMPLETE */ 00452 #define APR_INCOMPLETE (APR_OS_START_STATUS + 8) 00453 /* empty slot: +9 */ 00454 /* empty slot: +10 */ 00455 /* empty slot: +11 */ 00456 /** @see APR_STATUS_IS_BADCH */ 00457 #define APR_BADCH (APR_OS_START_STATUS + 12) 00458 /** @see APR_STATUS_IS_BADARG */ 00459 #define APR_BADARG (APR_OS_START_STATUS + 13) 00460 /** @see APR_STATUS_IS_EOF */ 00461 #define APR_EOF (APR_OS_START_STATUS + 14) 00462 /** @see APR_STATUS_IS_NOTFOUND */ 00463 #define APR_NOTFOUND (APR_OS_START_STATUS + 15) 00464 /* empty slot: +16 */ 00465 /* empty slot: +17 */ 00466 /* empty slot: +18 */ 00467 /** @see APR_STATUS_IS_ANONYMOUS */ 00468 #define APR_ANONYMOUS (APR_OS_START_STATUS + 19) 00469 /** @see APR_STATUS_IS_FILEBASED */ 00470 #define APR_FILEBASED (APR_OS_START_STATUS + 20) 00471 /** @see APR_STATUS_IS_KEYBASED */ 00472 #define APR_KEYBASED (APR_OS_START_STATUS + 21) 00473 /** @see APR_STATUS_IS_EINIT */ 00474 #define APR_EINIT (APR_OS_START_STATUS + 22) 00475 /** @see APR_STATUS_IS_ENOTIMPL */ 00476 #define APR_ENOTIMPL (APR_OS_START_STATUS + 23) 00477 /** @see APR_STATUS_IS_EMISMATCH */ 00478 #define APR_EMISMATCH (APR_OS_START_STATUS + 24) 00479 /** @see APR_STATUS_IS_EBUSY */ 00480 #define APR_EBUSY (APR_OS_START_STATUS + 25) 00481 /** @} */ 00482 00483 /** 00484 * @addtogroup APR_STATUS_IS 00485 * @{ 00486 */ 00487 /** 00488 * Program is currently executing in the child 00489 * @warning 00490 * always use this test, as platform-specific variances may meet this 00491 * more than one error code */ 00492 #define APR_STATUS_IS_INCHILD(s) ((s) == APR_INCHILD) 00493 /** 00494 * Program is currently executing in the parent 00495 * @warning 00496 * always use this test, as platform-specific variances may meet this 00497 * more than one error code 00498 */ 00499 #define APR_STATUS_IS_INPARENT(s) ((s) == APR_INPARENT) 00500 /** 00501 * The thread is detached 00502 * @warning 00503 * always use this test, as platform-specific variances may meet this 00504 * more than one error code 00505 */ 00506 #define APR_STATUS_IS_DETACH(s) ((s) == APR_DETACH) 00507 /** 00508 * The thread is not detached 00509 * @warning 00510 * always use this test, as platform-specific variances may meet this 00511 * more than one error code 00512 */ 00513 #define APR_STATUS_IS_NOTDETACH(s) ((s) == APR_NOTDETACH) 00514 /** 00515 * The child has finished executing 00516 * @warning 00517 * always use this test, as platform-specific variances may meet this 00518 * more than one error code 00519 */ 00520 #define APR_STATUS_IS_CHILD_DONE(s) ((s) == APR_CHILD_DONE) 00521 /** 00522 * The child has not finished executing 00523 * @warning 00524 * always use this test, as platform-specific variances may meet this 00525 * more than one error code 00526 */ 00527 #define APR_STATUS_IS_CHILD_NOTDONE(s) ((s) == APR_CHILD_NOTDONE) 00528 /** 00529 * The operation did not finish before the timeout 00530 * @warning 00531 * always use this test, as platform-specific variances may meet this 00532 * more than one error code 00533 */ 00534 #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP) 00535 /** 00536 * The operation was incomplete although some processing was performed 00537 * and the results are partially valid. 00538 * @warning 00539 * always use this test, as platform-specific variances may meet this 00540 * more than one error code 00541 */ 00542 #define APR_STATUS_IS_INCOMPLETE(s) ((s) == APR_INCOMPLETE) 00543 /* empty slot: +9 */ 00544 /* empty slot: +10 */ 00545 /* empty slot: +11 */ 00546 /** 00547 * Getopt found an option not in the option string 00548 * @warning 00549 * always use this test, as platform-specific variances may meet this 00550 * more than one error code 00551 */ 00552 #define APR_STATUS_IS_BADCH(s) ((s) == APR_BADCH) 00553 /** 00554 * Getopt found an option not in the option string and an argument was 00555 * specified in the option string 00556 * @warning 00557 * always use this test, as platform-specific variances may meet this 00558 * more than one error code 00559 */ 00560 #define APR_STATUS_IS_BADARG(s) ((s) == APR_BADARG) 00561 /** 00562 * APR has encountered the end of the file 00563 * @warning 00564 * always use this test, as platform-specific variances may meet this 00565 * more than one error code 00566 */ 00567 #define APR_STATUS_IS_EOF(s) ((s) == APR_EOF) 00568 /** 00569 * APR was unable to find the socket in the poll structure 00570 * @warning 00571 * always use this test, as platform-specific variances may meet this 00572 * more than one error code 00573 */ 00574 #define APR_STATUS_IS_NOTFOUND(s) ((s) == APR_NOTFOUND) 00575 /* empty slot: +16 */ 00576 /* empty slot: +17 */ 00577 /* empty slot: +18 */ 00578 /** 00579 * APR is using anonymous shared memory 00580 * @warning 00581 * always use this test, as platform-specific variances may meet this 00582 * more than one error code 00583 */ 00584 #define APR_STATUS_IS_ANONYMOUS(s) ((s) == APR_ANONYMOUS) 00585 /** 00586 * APR is using a file name as the key to the shared memory 00587 * @warning 00588 * always use this test, as platform-specific variances may meet this 00589 * more than one error code 00590 */ 00591 #define APR_STATUS_IS_FILEBASED(s) ((s) == APR_FILEBASED) 00592 /** 00593 * APR is using a shared key as the key to the shared memory 00594 * @warning 00595 * always use this test, as platform-specific variances may meet this 00596 * more than one error code 00597 */ 00598 #define APR_STATUS_IS_KEYBASED(s) ((s) == APR_KEYBASED) 00599 /** 00600 * Ininitalizer value. If no option has been found, but 00601 * the status variable requires a value, this should be used 00602 * @warning 00603 * always use this test, as platform-specific variances may meet this 00604 * more than one error code 00605 */ 00606 #define APR_STATUS_IS_EINIT(s) ((s) == APR_EINIT) 00607 /** 00608 * The APR function has not been implemented on this 00609 * platform, either because nobody has gotten to it yet, 00610 * or the function is impossible on this platform. 00611 * @warning 00612 * always use this test, as platform-specific variances may meet this 00613 * more than one error code 00614 */ 00615 #define APR_STATUS_IS_ENOTIMPL(s) ((s) == APR_ENOTIMPL) 00616 /** 00617 * Two passwords do not match. 00618 * @warning 00619 * always use this test, as platform-specific variances may meet this 00620 * more than one error code 00621 */ 00622 #define APR_STATUS_IS_EMISMATCH(s) ((s) == APR_EMISMATCH) 00623 /** 00624 * The given lock was busy 00625 * @warning always use this test, as platform-specific variances may meet this 00626 * more than one error code 00627 */ 00628 #define APR_STATUS_IS_EBUSY(s) ((s) == APR_EBUSY) 00629 00630 /** @} */ 00631 00632 /** 00633 * @addtogroup APR_Error APR Error Values 00634 * @{ 00635 */ 00636 /* APR CANONICAL ERROR VALUES */ 00637 /** @see APR_STATUS_IS_EACCES */ 00638 #ifdef EACCES 00639 #define APR_EACCES EACCES 00640 #else 00641 #define APR_EACCES (APR_OS_START_CANONERR + 1) 00642 #endif 00643 00644 /** @see APR_STATUS_IS_EEXIST */ 00645 #ifdef EEXIST 00646 #define APR_EEXIST EEXIST 00647 #else 00648 #define APR_EEXIST (APR_OS_START_CANONERR + 2) 00649 #endif 00650 00651 /** @see APR_STATUS_IS_ENAMETOOLONG */ 00652 #ifdef ENAMETOOLONG 00653 #define APR_ENAMETOOLONG ENAMETOOLONG 00654 #else 00655 #define APR_ENAMETOOLONG (APR_OS_START_CANONERR + 3) 00656 #endif 00657 00658 /** @see APR_STATUS_IS_ENOENT */ 00659 #ifdef ENOENT 00660 #define APR_ENOENT ENOENT 00661 #else 00662 #define APR_ENOENT (APR_OS_START_CANONERR + 4) 00663 #endif 00664 00665 /** @see APR_STATUS_IS_ENOTDIR */ 00666 #ifdef ENOTDIR 00667 #define APR_ENOTDIR ENOTDIR 00668 #else 00669 #define APR_ENOTDIR (APR_OS_START_CANONERR + 5) 00670 #endif 00671 00672 /** @see APR_STATUS_IS_ENOSPC */ 00673 #ifdef ENOSPC 00674 #define APR_ENOSPC ENOSPC 00675 #else 00676 #define APR_ENOSPC (APR_OS_START_CANONERR + 6) 00677 #endif 00678 00679 /** @see APR_STATUS_IS_ENOMEM */ 00680 #ifdef ENOMEM 00681 #define APR_ENOMEM ENOMEM 00682 #else 00683 #define APR_ENOMEM (APR_OS_START_CANONERR + 7) 00684 #endif 00685 00686 /** @see APR_STATUS_IS_EMFILE */ 00687 #ifdef EMFILE 00688 #define APR_EMFILE EMFILE 00689 #else 00690 #define APR_EMFILE (APR_OS_START_CANONERR + 8) 00691 #endif 00692 00693 /** @see APR_STATUS_IS_ENFILE */ 00694 #ifdef ENFILE 00695 #define APR_ENFILE ENFILE 00696 #else 00697 #define APR_ENFILE (APR_OS_START_CANONERR + 9) 00698 #endif 00699 00700 /** @see APR_STATUS_IS_EBADF */ 00701 #ifdef EBADF 00702 #define APR_EBADF EBADF 00703 #else 00704 #define APR_EBADF (APR_OS_START_CANONERR + 10) 00705 #endif 00706 00707 /** @see APR_STATUS_IS_EINVAL */ 00708 #ifdef EINVAL 00709 #define APR_EINVAL EINVAL 00710 #else 00711 #define APR_EINVAL (APR_OS_START_CANONERR + 11) 00712 #endif 00713 00714 /** @see APR_STATUS_IS_ESPIPE */ 00715 #ifdef ESPIPE 00716 #define APR_ESPIPE ESPIPE 00717 #else 00718 #define APR_ESPIPE (APR_OS_START_CANONERR + 12) 00719 #endif 00720 00721 /** 00722 * @see APR_STATUS_IS_EAGAIN 00723 * @warning use APR_STATUS_IS_EAGAIN instead of just testing this value 00724 */ 00725 #ifdef EAGAIN 00726 #define APR_EAGAIN EAGAIN 00727 #elif defined(EWOULDBLOCK) 00728 #define APR_EAGAIN EWOULDBLOCK 00729 #else 00730 #define APR_EAGAIN (APR_OS_START_CANONERR + 13) 00731 #endif 00732 00733 /** @see APR_STATUS_IS_EINTR */ 00734 #ifdef EINTR 00735 #define APR_EINTR EINTR 00736 #else 00737 #define APR_EINTR (APR_OS_START_CANONERR + 14) 00738 #endif 00739 00740 /** @see APR_STATUS_IS_ENOTSOCK */ 00741 #ifdef ENOTSOCK 00742 #define APR_ENOTSOCK ENOTSOCK 00743 #else 00744 #define APR_ENOTSOCK (APR_OS_START_CANONERR + 15) 00745 #endif 00746 00747 /** @see APR_STATUS_IS_ECONNREFUSED */ 00748 #ifdef ECONNREFUSED 00749 #define APR_ECONNREFUSED ECONNREFUSED 00750 #else 00751 #define APR_ECONNREFUSED (APR_OS_START_CANONERR + 16) 00752 #endif 00753 00754 /** @see APR_STATUS_IS_EINPROGRESS */ 00755 #ifdef EINPROGRESS 00756 #define APR_EINPROGRESS EINPROGRESS 00757 #else 00758 #define APR_EINPROGRESS (APR_OS_START_CANONERR + 17) 00759 #endif 00760 00761 /** 00762 * @see APR_STATUS_IS_ECONNABORTED 00763 * @warning use APR_STATUS_IS_ECONNABORTED instead of just testing this value 00764 */ 00765 00766 #ifdef ECONNABORTED 00767 #define APR_ECONNABORTED ECONNABORTED 00768 #else 00769 #define APR_ECONNABORTED (APR_OS_START_CANONERR + 18) 00770 #endif 00771 00772 /** @see APR_STATUS_IS_ECONNRESET */ 00773 #ifdef ECONNRESET 00774 #define APR_ECONNRESET ECONNRESET 00775 #else 00776 #define APR_ECONNRESET (APR_OS_START_CANONERR + 19) 00777 #endif 00778 00779 /** @see APR_STATUS_IS_ETIMEDOUT 00780 * @deprecated */ 00781 #ifdef ETIMEDOUT 00782 #define APR_ETIMEDOUT ETIMEDOUT 00783 #else 00784 #define APR_ETIMEDOUT (APR_OS_START_CANONERR + 20) 00785 #endif 00786 00787 /** @see APR_STATUS_IS_EHOSTUNREACH */ 00788 #ifdef EHOSTUNREACH 00789 #define APR_EHOSTUNREACH EHOSTUNREACH 00790 #else 00791 #define APR_EHOSTUNREACH (APR_OS_START_CANONERR + 21) 00792 #endif 00793 00794 /** @see APR_STATUS_IS_ENETUNREACH */ 00795 #ifdef ENETUNREACH 00796 #define APR_ENETUNREACH ENETUNREACH 00797 #else 00798 #define APR_ENETUNREACH (APR_OS_START_CANONERR + 22) 00799 #endif 00800 00801 /** @see APR_STATUS_IS_EFTYPE */ 00802 #ifdef EFTYPE 00803 #define APR_EFTYPE EFTYPE 00804 #else 00805 #define APR_EFTYPE (APR_OS_START_CANONERR + 23) 00806 #endif 00807 00808 /** @see APR_STATUS_IS_EPIPE */ 00809 #ifdef EPIPE 00810 #define APR_EPIPE EPIPE 00811 #else 00812 #define APR_EPIPE (APR_OS_START_CANONERR + 24) 00813 #endif 00814 00815 /** @see APR_STATUS_IS_EXDEV */ 00816 #ifdef EXDEV 00817 #define APR_EXDEV EXDEV 00818 #else 00819 #define APR_EXDEV (APR_OS_START_CANONERR + 25) 00820 #endif 00821 00822 /** @see APR_STATUS_IS_ENOTEMPTY */ 00823 #ifdef ENOTEMPTY 00824 #define APR_ENOTEMPTY ENOTEMPTY 00825 #else 00826 #define APR_ENOTEMPTY (APR_OS_START_CANONERR + 26) 00827 #endif 00828 00829 /** @see APR_STATUS_IS_EAFNOSUPPORT */ 00830 #ifdef EAFNOSUPPORT 00831 #define APR_EAFNOSUPPORT EAFNOSUPPORT 00832 #else 00833 #define APR_EAFNOSUPPORT (APR_OS_START_CANONERR + 27) 00834 #endif 00835 00836 /** @see APR_STATUS_IS_EOPNOTSUPP */ 00837 #ifdef EOPNOTSUPP 00838 #define APR_EOPNOTSUPP EOPNOTSUPP 00839 #else 00840 #define APR_EOPNOTSUPP (APR_OS_START_CANONERR + 28) 00841 #endif 00842 00843 /** @see APR_STATUS_IS_ERANGE */ 00844 #ifdef ERANGE 00845 #define APR_ERANGE ERANGE 00846 #else 00847 #define APR_ERANGE (APR_OS_START_CANONERR + 29) 00848 #endif 00849 00850 /** @} */ 00851 00852 #if defined(OS2) && !defined(DOXYGEN) 00853 00854 #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR) 00855 #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR) 00856 00857 #define INCL_DOSERRORS 00858 #define INCL_DOS 00859 00860 /* Leave these undefined. 00861 * OS2 doesn't rely on the errno concept. 00862 * The API calls always return a result codes which 00863 * should be filtered through APR_FROM_OS_ERROR(). 00864 * 00865 * #define apr_get_os_error() (APR_FROM_OS_ERROR(GetLastError())) 00866 * #define apr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e))) 00867 */ 00868 00869 /* A special case, only socket calls require this; 00870 */ 00871 #define apr_get_netos_error() (APR_FROM_OS_ERROR(errno)) 00872 #define apr_set_netos_error(e) (errno = APR_TO_OS_ERROR(e)) 00873 00874 /* And this needs to be greped away for good: 00875 */ 00876 #define APR_OS2_STATUS(e) (APR_FROM_OS_ERROR(e)) 00877 00878 /* These can't sit in a private header, so in spite of the extra size, 00879 * they need to be made available here. 00880 */ 00881 #define SOCBASEERR 10000 00882 #define SOCEPERM (SOCBASEERR+1) /* Not owner */ 00883 #define SOCESRCH (SOCBASEERR+3) /* No such process */ 00884 #define SOCEINTR (SOCBASEERR+4) /* Interrupted system call */ 00885 #define SOCENXIO (SOCBASEERR+6) /* No such device or address */ 00886 #define SOCEBADF (SOCBASEERR+9) /* Bad file number */ 00887 #define SOCEACCES (SOCBASEERR+13) /* Permission denied */ 00888 #define SOCEFAULT (SOCBASEERR+14) /* Bad address */ 00889 #define SOCEINVAL (SOCBASEERR+22) /* Invalid argument */ 00890 #define SOCEMFILE (SOCBASEERR+24) /* Too many open files */ 00891 #define SOCEPIPE (SOCBASEERR+32) /* Broken pipe */ 00892 #define SOCEOS2ERR (SOCBASEERR+100) /* OS/2 Error */ 00893 #define SOCEWOULDBLOCK (SOCBASEERR+35) /* Operation would block */ 00894 #define SOCEINPROGRESS (SOCBASEERR+36) /* Operation now in progress */ 00895 #define SOCEALREADY (SOCBASEERR+37) /* Operation already in progress */ 00896 #define SOCENOTSOCK (SOCBASEERR+38) /* Socket operation on non-socket */ 00897 #define SOCEDESTADDRREQ (SOCBASEERR+39) /* Destination address required */ 00898 #define SOCEMSGSIZE (SOCBASEERR+40) /* Message too long */ 00899 #define SOCEPROTOTYPE (SOCBASEERR+41) /* Protocol wrong type for socket */ 00900 #define SOCENOPROTOOPT (SOCBASEERR+42) /* Protocol not available */ 00901 #define SOCEPROTONOSUPPORT (SOCBASEERR+43) /* Protocol not supported */ 00902 #define SOCESOCKTNOSUPPORT (SOCBASEERR+44) /* Socket type not supported */ 00903 #define SOCEOPNOTSUPP (SOCBASEERR+45) /* Operation not supported on socket */ 00904 #define SOCEPFNOSUPPORT (SOCBASEERR+46) /* Protocol family not supported */ 00905 #define SOCEAFNOSUPPORT (SOCBASEERR+47) /* Address family not supported by protocol family */ 00906 #define SOCEADDRINUSE (SOCBASEERR+48) /* Address already in use */ 00907 #define SOCEADDRNOTAVAIL (SOCBASEERR+49) /* Can't assign requested address */ 00908 #define SOCENETDOWN (SOCBASEERR+50) /* Network is down */ 00909 #define SOCENETUNREACH (SOCBASEERR+51) /* Network is unreachable */ 00910 #define SOCENETRESET (SOCBASEERR+52) /* Network dropped connection on reset */ 00911 #define SOCECONNABORTED (SOCBASEERR+53) /* Software caused connection abort */ 00912 #define SOCECONNRESET (SOCBASEERR+54) /* Connection reset by peer */ 00913 #define SOCENOBUFS (SOCBASEERR+55) /* No buffer space available */ 00914 #define SOCEISCONN (SOCBASEERR+56) /* Socket is already connected */ 00915 #define SOCENOTCONN (SOCBASEERR+57) /* Socket is not connected */ 00916 #define SOCESHUTDOWN (SOCBASEERR+58) /* Can't send after socket shutdown */ 00917 #define SOCETOOMANYREFS (SOCBASEERR+59) /* Too many references: can't splice */ 00918 #define SOCETIMEDOUT (SOCBASEERR+60) /* Connection timed out */ 00919 #define SOCECONNREFUSED (SOCBASEERR+61) /* Connection refused */ 00920 #define SOCELOOP (SOCBASEERR+62) /* Too many levels of symbolic links */ 00921 #define SOCENAMETOOLONG (SOCBASEERR+63) /* File name too long */ 00922 #define SOCEHOSTDOWN (SOCBASEERR+64) /* Host is down */ 00923 #define SOCEHOSTUNREACH (SOCBASEERR+65) /* No route to host */ 00924 #define SOCENOTEMPTY (SOCBASEERR+66) /* Directory not empty */ 00925 00926 /* APR CANONICAL ERROR TESTS */ 00927 #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \ 00928 || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED \ 00929 || (s) == APR_OS_START_SYSERR + ERROR_SHARING_VIOLATION) 00930 #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST \ 00931 || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED \ 00932 || (s) == APR_OS_START_SYSERR + ERROR_FILE_EXISTS \ 00933 || (s) == APR_OS_START_SYSERR + ERROR_ALREADY_EXISTS \ 00934 || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED) 00935 #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG \ 00936 || (s) == APR_OS_START_SYSERR + ERROR_FILENAME_EXCED_RANGE \ 00937 || (s) == APR_OS_START_SYSERR + SOCENAMETOOLONG) 00938 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \ 00939 || (s) == APR_OS_START_SYSERR + ERROR_FILE_NOT_FOUND \ 00940 || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \ 00941 || (s) == APR_OS_START_SYSERR + ERROR_NO_MORE_FILES \ 00942 || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED) 00943 #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR) 00944 #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \ 00945 || (s) == APR_OS_START_SYSERR + ERROR_DISK_FULL) 00946 #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM) 00947 #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE \ 00948 || (s) == APR_OS_START_SYSERR + ERROR_TOO_MANY_OPEN_FILES) 00949 #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE) 00950 #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF \ 00951 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE) 00952 #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL \ 00953 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_PARAMETER \ 00954 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_FUNCTION) 00955 #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE \ 00956 || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK) 00957 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \ 00958 || (s) == APR_OS_START_SYSERR + ERROR_NO_DATA \ 00959 || (s) == APR_OS_START_SYSERR + SOCEWOULDBLOCK \ 00960 || (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION) 00961 #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \ 00962 || (s) == APR_OS_START_SYSERR + SOCEINTR) 00963 #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \ 00964 || (s) == APR_OS_START_SYSERR + SOCENOTSOCK) 00965 #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \ 00966 || (s) == APR_OS_START_SYSERR + SOCECONNREFUSED) 00967 #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \ 00968 || (s) == APR_OS_START_SYSERR + SOCEINPROGRESS) 00969 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \ 00970 || (s) == APR_OS_START_SYSERR + SOCECONNABORTED) 00971 #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \ 00972 || (s) == APR_OS_START_SYSERR + SOCECONNRESET) 00973 /* XXX deprecated */ 00974 #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ 00975 || (s) == APR_OS_START_SYSERR + SOCETIMEDOUT) 00976 #undef APR_STATUS_IS_TIMEUP 00977 #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP \ 00978 || (s) == APR_OS_START_SYSERR + SOCETIMEDOUT) 00979 #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \ 00980 || (s) == APR_OS_START_SYSERR + SOCEHOSTUNREACH) 00981 #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \ 00982 || (s) == APR_OS_START_SYSERR + SOCENETUNREACH) 00983 #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE) 00984 #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE \ 00985 || (s) == APR_OS_START_SYSERR + ERROR_BROKEN_PIPE \ 00986 || (s) == APR_OS_START_SYSERR + SOCEPIPE) 00987 #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV \ 00988 || (s) == APR_OS_START_SYSERR + ERROR_NOT_SAME_DEVICE) 00989 #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY \ 00990 || (s) == APR_OS_START_SYSERR + ERROR_DIR_NOT_EMPTY \ 00991 || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED) 00992 #define APR_STATUS_IS_EAFNOSUPPORT(s) ((s) == APR_AFNOSUPPORT \ 00993 || (s) == APR_OS_START_SYSERR + SOCEAFNOSUPPORT) 00994 #define APR_STATUS_IS_EOPNOTSUPP(s) ((s) == APR_EOPNOTSUPP \ 00995 || (s) == APR_OS_START_SYSERR + SOCEOPNOTSUPP) 00996 #define APR_STATUS_IS_ERANGE(s) ((s) == APR_ERANGE) 00997 00998 /* 00999 Sorry, too tired to wrap this up for OS2... feel free to 01000 fit the following into their best matches. 01001 01002 { ERROR_NO_SIGNAL_SENT, ESRCH }, 01003 { SOCEALREADY, EALREADY }, 01004 { SOCEDESTADDRREQ, EDESTADDRREQ }, 01005 { SOCEMSGSIZE, EMSGSIZE }, 01006 { SOCEPROTOTYPE, EPROTOTYPE }, 01007 { SOCENOPROTOOPT, ENOPROTOOPT }, 01008 { SOCEPROTONOSUPPORT, EPROTONOSUPPORT }, 01009 { SOCESOCKTNOSUPPORT, ESOCKTNOSUPPORT }, 01010 { SOCEPFNOSUPPORT, EPFNOSUPPORT }, 01011 { SOCEADDRINUSE, EADDRINUSE }, 01012 { SOCEADDRNOTAVAIL, EADDRNOTAVAIL }, 01013 { SOCENETDOWN, ENETDOWN }, 01014 { SOCENETRESET, ENETRESET }, 01015 { SOCENOBUFS, ENOBUFS }, 01016 { SOCEISCONN, EISCONN }, 01017 { SOCENOTCONN, ENOTCONN }, 01018 { SOCESHUTDOWN, ESHUTDOWN }, 01019 { SOCETOOMANYREFS, ETOOMANYREFS }, 01020 { SOCELOOP, ELOOP }, 01021 { SOCEHOSTDOWN, EHOSTDOWN }, 01022 { SOCENOTEMPTY, ENOTEMPTY }, 01023 { SOCEPIPE, EPIPE } 01024 */ 01025 01026 #elif defined(WIN32) && !defined(DOXYGEN) /* !defined(OS2) */ 01027 01028 #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR) 01029 #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR) 01030 01031 #define apr_get_os_error() (APR_FROM_OS_ERROR(GetLastError())) 01032 #define apr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e))) 01033 01034 /* A special case, only socket calls require this: 01035 */ 01036 #define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError())) 01037 #define apr_set_netos_error(e) (WSASetLastError(APR_TO_OS_ERROR(e))) 01038 01039 /* APR CANONICAL ERROR TESTS */ 01040 #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \ 01041 || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED \ 01042 || (s) == APR_OS_START_SYSERR + ERROR_CANNOT_MAKE \ 01043 || (s) == APR_OS_START_SYSERR + ERROR_CURRENT_DIRECTORY \ 01044 || (s) == APR_OS_START_SYSERR + ERROR_DRIVE_LOCKED \ 01045 || (s) == APR_OS_START_SYSERR + ERROR_FAIL_I24 \ 01046 || (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION \ 01047 || (s) == APR_OS_START_SYSERR + ERROR_LOCK_FAILED \ 01048 || (s) == APR_OS_START_SYSERR + ERROR_NOT_LOCKED \ 01049 || (s) == APR_OS_START_SYSERR + ERROR_NETWORK_ACCESS_DENIED \ 01050 || (s) == APR_OS_START_SYSERR + ERROR_SHARING_VIOLATION) 01051 #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST \ 01052 || (s) == APR_OS_START_SYSERR + ERROR_FILE_EXISTS \ 01053 || (s) == APR_OS_START_SYSERR + ERROR_ALREADY_EXISTS) 01054 #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG \ 01055 || (s) == APR_OS_START_SYSERR + ERROR_FILENAME_EXCED_RANGE \ 01056 || (s) == APR_OS_START_SYSERR + WSAENAMETOOLONG) 01057 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \ 01058 || (s) == APR_OS_START_SYSERR + ERROR_FILE_NOT_FOUND \ 01059 || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \ 01060 || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED \ 01061 || (s) == APR_OS_START_SYSERR + ERROR_NO_MORE_FILES) 01062 #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR \ 01063 || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \ 01064 || (s) == APR_OS_START_SYSERR + ERROR_BAD_NETPATH \ 01065 || (s) == APR_OS_START_SYSERR + ERROR_BAD_NET_NAME \ 01066 || (s) == APR_OS_START_SYSERR + ERROR_BAD_PATHNAME \ 01067 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DRIVE \ 01068 || (s) == APR_OS_START_SYSERR + ERROR_DIRECTORY) 01069 #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \ 01070 || (s) == APR_OS_START_SYSERR + ERROR_DISK_FULL) 01071 #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM \ 01072 || (s) == APR_OS_START_SYSERR + ERROR_ARENA_TRASHED \ 01073 || (s) == APR_OS_START_SYSERR + ERROR_NOT_ENOUGH_MEMORY \ 01074 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_BLOCK \ 01075 || (s) == APR_OS_START_SYSERR + ERROR_NOT_ENOUGH_QUOTA \ 01076 || (s) == APR_OS_START_SYSERR + ERROR_OUTOFMEMORY) 01077 #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE \ 01078 || (s) == APR_OS_START_SYSERR + ERROR_TOO_MANY_OPEN_FILES) 01079 #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE) 01080 #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF \ 01081 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE \ 01082 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_TARGET_HANDLE) 01083 #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL \ 01084 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_ACCESS \ 01085 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DATA \ 01086 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_FUNCTION \ 01087 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE \ 01088 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_PARAMETER \ 01089 || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK) 01090 #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE \ 01091 || (s) == APR_OS_START_SYSERR + ERROR_SEEK_ON_DEVICE \ 01092 || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK) 01093 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \ 01094 || (s) == APR_OS_START_SYSERR + ERROR_NO_DATA \ 01095 || (s) == APR_OS_START_SYSERR + ERROR_NO_PROC_SLOTS \ 01096 || (s) == APR_OS_START_SYSERR + ERROR_NESTING_NOT_ALLOWED \ 01097 || (s) == APR_OS_START_SYSERR + ERROR_MAX_THRDS_REACHED \ 01098 || (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION \ 01099 || (s) == APR_OS_START_SYSERR + WSAEWOULDBLOCK) 01100 #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \ 01101 || (s) == APR_OS_START_SYSERR + WSAEINTR) 01102 #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \ 01103 || (s) == APR_OS_START_SYSERR + WSAENOTSOCK) 01104 #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \ 01105 || (s) == APR_OS_START_SYSERR + WSAECONNREFUSED) 01106 #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \ 01107 || (s) == APR_OS_START_SYSERR + WSAEINPROGRESS) 01108 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \ 01109 || (s) == APR_OS_START_SYSERR + WSAECONNABORTED) 01110 #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \ 01111 || (s) == APR_OS_START_SYSERR + ERROR_NETNAME_DELETED \ 01112 || (s) == APR_OS_START_SYSERR + WSAECONNRESET) 01113 /* XXX deprecated */ 01114 #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ 01115 || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \ 01116 || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) 01117 #undef APR_STATUS_IS_TIMEUP 01118 #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP \ 01119 || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \ 01120 || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) 01121 #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \ 01122 || (s) == APR_OS_START_SYSERR + WSAEHOSTUNREACH) 01123 #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \ 01124 || (s) == APR_OS_START_SYSERR + WSAENETUNREACH) 01125 #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE \ 01126 || (s) == APR_OS_START_SYSERR + ERROR_EXE_MACHINE_TYPE_MISMATCH \ 01127 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DLL \ 01128 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_MODULETYPE \ 01129 || (s) == APR_OS_START_SYSERR + ERROR_BAD_EXE_FORMAT \ 01130 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_EXE_SIGNATURE \ 01131 || (s) == APR_OS_START_SYSERR + ERROR_FILE_CORRUPT \ 01132 || (s) == APR_OS_START_SYSERR + ERROR_BAD_FORMAT) 01133 #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE \ 01134 || (s) == APR_OS_START_SYSERR + ERROR_BROKEN_PIPE) 01135 #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV \ 01136 || (s) == APR_OS_START_SYSERR + ERROR_NOT_SAME_DEVICE) 01137 #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY \ 01138 || (s) == APR_OS_START_SYSERR + ERROR_DIR_NOT_EMPTY) 01139 #define APR_STATUS_IS_EAFNOSUPPORT(s) ((s) == APR_EAFNOSUPPORT \ 01140 || (s) == APR_OS_START_SYSERR + WSAEAFNOSUPPORT) 01141 #define APR_STATUS_IS_EOPNOTSUPP(s) ((s) == APR_EOPNOTSUPP \ 01142 || (s) == APR_OS_START_SYSERR + WSAEOPNOTSUPP) 01143 #define APR_STATUS_IS_ERANGE(s) ((s) == APR_ERANGE) 01144 01145 #elif defined(NETWARE) && defined(USE_WINSOCK) && !defined(DOXYGEN) /* !defined(OS2) && !defined(WIN32) */ 01146 01147 #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR) 01148 #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR) 01149 01150 #define apr_get_os_error() (errno) 01151 #define apr_set_os_error(e) (errno = (e)) 01152 01153 /* A special case, only socket calls require this: */ 01154 #define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError())) 01155 #define apr_set_netos_error(e) (WSASetLastError(APR_TO_OS_ERROR(e))) 01156 01157 /* APR CANONICAL ERROR TESTS */ 01158 #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES) 01159 #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST) 01160 #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG) 01161 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT) 01162 #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR) 01163 #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC) 01164 #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM) 01165 #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE) 01166 #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE) 01167 #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF) 01168 #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL) 01169 #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE) 01170 01171 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \ 01172 || (s) == EWOULDBLOCK \ 01173 || (s) == APR_OS_START_SYSERR + WSAEWOULDBLOCK) 01174 #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \ 01175 || (s) == APR_OS_START_SYSERR + WSAEINTR) 01176 #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \ 01177 || (s) == APR_OS_START_SYSERR + WSAENOTSOCK) 01178 #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \ 01179 || (s) == APR_OS_START_SYSERR + WSAECONNREFUSED) 01180 #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \ 01181 || (s) == APR_OS_START_SYSERR + WSAEINPROGRESS) 01182 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \ 01183 || (s) == APR_OS_START_SYSERR + WSAECONNABORTED) 01184 #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \ 01185 || (s) == APR_OS_START_SYSERR + WSAECONNRESET) 01186 /* XXX deprecated */ 01187 #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ 01188 || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \ 01189 || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) 01190 #undef APR_STATUS_IS_TIMEUP 01191 #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP \ 01192 || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \ 01193 || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) 01194 #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \ 01195 || (s) == APR_OS_START_SYSERR + WSAEHOSTUNREACH) 01196 #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \ 01197 || (s) == APR_OS_START_SYSERR + WSAENETUNREACH) 01198 #define APR_STATUS_IS_ENETDOWN(s) ((s) == APR_OS_START_SYSERR + WSAENETDOWN) 01199 #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE) 01200 #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE) 01201 #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV) 01202 #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY) 01203 #define APR_STATUS_IS_EAFNOSUPPORT(s) ((s) == APR_EAFNOSUPPORT \ 01204 || (s) == APR_OS_START_SYSERR + WSAEAFNOSUPPORT) 01205 #define APR_STATUS_IS_EOPNOTSUPP(s) ((s) == APR_EOPNOTSUPP \ 01206 || (s) == APR_OS_START_SYSERR + WSAEOPNOTSUPP) 01207 #define APR_STATUS_IS_ERANGE(s) ((s) == APR_ERANGE) 01208 01209 #else /* !defined(NETWARE) && !defined(OS2) && !defined(WIN32) */ 01210 01211 /* 01212 * os error codes are clib error codes 01213 */ 01214 #define APR_FROM_OS_ERROR(e) (e) 01215 #define APR_TO_OS_ERROR(e) (e) 01216 01217 #define apr_get_os_error() (errno) 01218 #define apr_set_os_error(e) (errno = (e)) 01219 01220 /* A special case, only socket calls require this: 01221 */ 01222 #define apr_get_netos_error() (errno) 01223 #define apr_set_netos_error(e) (errno = (e)) 01224 01225 /** 01226 * @addtogroup APR_STATUS_IS 01227 * @{ 01228 */ 01229 01230 /** permission denied */ 01231 #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES) 01232 /** file exists */ 01233 #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST) 01234 /** path name is too long */ 01235 #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG) 01236 /** 01237 * no such file or directory 01238 * @remark 01239 * EMVSCATLG can be returned by the automounter on z/OS for 01240 * paths which do not exist. 01241 */ 01242 #ifdef EMVSCATLG 01243 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \ 01244 || (s) == EMVSCATLG) 01245 #else 01246 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT) 01247 #endif 01248 /** not a directory */ 01249 #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR) 01250 /** no space left on device */ 01251 #ifdef EDQUOT 01252 #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \ 01253 || (s) == EDQUOT) 01254 #else 01255 #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC) 01256 #endif 01257 /** not enough memory */ 01258 #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM) 01259 /** too many open files */ 01260 #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE) 01261 /** file table overflow */ 01262 #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE) 01263 /** bad file # */ 01264 #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF) 01265 /** invalid argument */ 01266 #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL) 01267 /** illegal seek */ 01268 #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE) 01269 01270 /** operation would block */ 01271 #if !defined(EWOULDBLOCK) || !defined(EAGAIN) 01272 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN) 01273 #elif (EWOULDBLOCK == EAGAIN) 01274 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN) 01275 #else 01276 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \ 01277 || (s) == EWOULDBLOCK) 01278 #endif 01279 01280 /** interrupted system call */ 01281 #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR) 01282 /** socket operation on a non-socket */ 01283 #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK) 01284 /** Connection Refused */ 01285 #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED) 01286 /** operation now in progress */ 01287 #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS) 01288 01289 /** 01290 * Software caused connection abort 01291 * @remark 01292 * EPROTO on certain older kernels really means ECONNABORTED, so we need to 01293 * ignore it for them. See discussion in new-httpd archives nh.9701 & nh.9603 01294 * 01295 * There is potentially a bug in Solaris 2.x x<6, and other boxes that 01296 * implement tcp sockets in userland (i.e. on top of STREAMS). On these 01297 * systems, EPROTO can actually result in a fatal loop. See PR#981 for 01298 * example. It's hard to handle both uses of EPROTO. 01299 */ 01300 #ifdef EPROTO 01301 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \ 01302 || (s) == EPROTO) 01303 #else 01304 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED) 01305 #endif 01306 01307 /** Connection Reset by peer */ 01308 #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET) 01309 /** Operation timed out 01310 * @deprecated */ 01311 #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT) 01312 /** no route to host */ 01313 #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH) 01314 /** network is unreachable */ 01315 #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH) 01316 /** inappropriate file type or format */ 01317 #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE) 01318 /** broken pipe */ 01319 #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE) 01320 /** cross device link */ 01321 #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV) 01322 /** Directory Not Empty */ 01323 #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY || \ 01324 (s) == APR_EEXIST) 01325 /** Address Family not supported */ 01326 #define APR_STATUS_IS_EAFNOSUPPORT(s) ((s) == APR_EAFNOSUPPORT) 01327 /** Socket operation not supported */ 01328 #define APR_STATUS_IS_EOPNOTSUPP(s) ((s) == APR_EOPNOTSUPP) 01329 01330 /** Numeric value not representable */ 01331 #define APR_STATUS_IS_ERANGE(s) ((s) == APR_ERANGE) 01332 /** @} */ 01333 01334 #endif /* !defined(NETWARE) && !defined(OS2) && !defined(WIN32) */ 01335 01336 /** @} */ 01337 01338 #ifdef __cplusplus 01339 } 01340 #endif 01341 01342 #endif /* ! APR_ERRNO_H */