Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
apr_errno.h
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 #ifndef APR_ERRNO_H
18 #define APR_ERRNO_H
19 
25 #include "apr.h"
26 
27 #if APR_HAVE_ERRNO_H
28 #include <errno.h>
29 #endif
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif /* __cplusplus */
34 
44 typedef int apr_status_t;
45 
52 APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
53  apr_size_t bufsize);
54 
55 #if defined(DOXYGEN)
56 
64 #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR)
65 
75 #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR)
76 
112 #endif /* defined(DOXYGEN) */
113 
117 #define APR_OS_START_ERROR 20000
118 
123 #define APR_OS_ERRSPACE_SIZE 50000
124 
132 #define APR_UTIL_ERRSPACE_SIZE 20000
133 
136 #define APR_OS_START_STATUS (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
137 
141 #define APR_UTIL_START_STATUS (APR_OS_START_STATUS + \
142  (APR_OS_ERRSPACE_SIZE - APR_UTIL_ERRSPACE_SIZE))
143 
164 #define APR_OS_START_USERERR (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
165 
169 #define APR_OS_START_USEERR APR_OS_START_USERERR
170 
174 #define APR_OS_START_CANONERR (APR_OS_START_USERERR \
175  + (APR_OS_ERRSPACE_SIZE * 10))
176 
180 #define APR_OS_START_EAIERR (APR_OS_START_CANONERR + APR_OS_ERRSPACE_SIZE)
181 
185 #define APR_OS_START_SYSERR (APR_OS_START_EAIERR + APR_OS_ERRSPACE_SIZE)
186 
225 #define APR_SUCCESS 0
226 
288 #define APR_ENOSTAT (APR_OS_START_ERROR + 1)
289 
290 #define APR_ENOPOOL (APR_OS_START_ERROR + 2)
291 /* empty slot: +3 */
293 #define APR_EBADDATE (APR_OS_START_ERROR + 4)
294 
295 #define APR_EINVALSOCK (APR_OS_START_ERROR + 5)
296 
297 #define APR_ENOPROC (APR_OS_START_ERROR + 6)
298 
299 #define APR_ENOTIME (APR_OS_START_ERROR + 7)
300 
301 #define APR_ENODIR (APR_OS_START_ERROR + 8)
302 
303 #define APR_ENOLOCK (APR_OS_START_ERROR + 9)
304 
305 #define APR_ENOPOLL (APR_OS_START_ERROR + 10)
306 
307 #define APR_ENOSOCKET (APR_OS_START_ERROR + 11)
308 
309 #define APR_ENOTHREAD (APR_OS_START_ERROR + 12)
310 
311 #define APR_ENOTHDKEY (APR_OS_START_ERROR + 13)
312 
313 #define APR_EGENERAL (APR_OS_START_ERROR + 14)
314 
315 #define APR_ENOSHMAVAIL (APR_OS_START_ERROR + 15)
316 
317 #define APR_EBADIP (APR_OS_START_ERROR + 16)
318 
319 #define APR_EBADMASK (APR_OS_START_ERROR + 17)
320 /* empty slot: +18 */
322 #define APR_EDSOOPEN (APR_OS_START_ERROR + 19)
323 
324 #define APR_EABSOLUTE (APR_OS_START_ERROR + 20)
325 
326 #define APR_ERELATIVE (APR_OS_START_ERROR + 21)
327 
328 #define APR_EINCOMPLETE (APR_OS_START_ERROR + 22)
329 
330 #define APR_EABOVEROOT (APR_OS_START_ERROR + 23)
331 
332 #define APR_EBADPATH (APR_OS_START_ERROR + 24)
333 
334 #define APR_EPATHWILD (APR_OS_START_ERROR + 25)
335 
336 #define APR_ESYMNOTFOUND (APR_OS_START_ERROR + 26)
337 
338 #define APR_EPROC_UNKNOWN (APR_OS_START_ERROR + 27)
339 
340 #define APR_ENOTENOUGHENTROPY (APR_OS_START_ERROR + 28)
341 
359 #define APR_STATUS_IS_ENOSTAT(s) ((s) == APR_ENOSTAT)
360 
365 #define APR_STATUS_IS_ENOPOOL(s) ((s) == APR_ENOPOOL)
366 
367 #define APR_STATUS_IS_EBADDATE(s) ((s) == APR_EBADDATE)
368 
369 #define APR_STATUS_IS_EINVALSOCK(s) ((s) == APR_EINVALSOCK)
370 
371 #define APR_STATUS_IS_ENOPROC(s) ((s) == APR_ENOPROC)
372 
373 #define APR_STATUS_IS_ENOTIME(s) ((s) == APR_ENOTIME)
374 
375 #define APR_STATUS_IS_ENODIR(s) ((s) == APR_ENODIR)
376 
377 #define APR_STATUS_IS_ENOLOCK(s) ((s) == APR_ENOLOCK)
378 
379 #define APR_STATUS_IS_ENOPOLL(s) ((s) == APR_ENOPOLL)
380 
381 #define APR_STATUS_IS_ENOSOCKET(s) ((s) == APR_ENOSOCKET)
382 
383 #define APR_STATUS_IS_ENOTHREAD(s) ((s) == APR_ENOTHREAD)
384 
385 #define APR_STATUS_IS_ENOTHDKEY(s) ((s) == APR_ENOTHDKEY)
386 
387 #define APR_STATUS_IS_EGENERAL(s) ((s) == APR_EGENERAL)
388 
389 #define APR_STATUS_IS_ENOSHMAVAIL(s) ((s) == APR_ENOSHMAVAIL)
390 
391 #define APR_STATUS_IS_EBADIP(s) ((s) == APR_EBADIP)
392 
393 #define APR_STATUS_IS_EBADMASK(s) ((s) == APR_EBADMASK)
394 /* empty slot: +18 */
399 #if defined(WIN32)
400 #define APR_STATUS_IS_EDSOOPEN(s) ((s) == APR_EDSOOPEN \
401  || APR_TO_OS_ERROR(s) == ERROR_MOD_NOT_FOUND)
402 #elif defined(OS2)
403 #define APR_STATUS_IS_EDSOOPEN(s) ((s) == APR_EDSOOPEN \
404  || APR_TO_OS_ERROR(s) == ERROR_FILE_NOT_FOUND)
405 #else
406 #define APR_STATUS_IS_EDSOOPEN(s) ((s) == APR_EDSOOPEN)
407 #endif
408 
409 #define APR_STATUS_IS_EABSOLUTE(s) ((s) == APR_EABSOLUTE)
410 
411 #define APR_STATUS_IS_ERELATIVE(s) ((s) == APR_ERELATIVE)
412 
413 #define APR_STATUS_IS_EINCOMPLETE(s) ((s) == APR_EINCOMPLETE)
414 
415 #define APR_STATUS_IS_EABOVEROOT(s) ((s) == APR_EABOVEROOT)
416 
417 #define APR_STATUS_IS_EBADPATH(s) ((s) == APR_EBADPATH)
418 
419 #define APR_STATUS_IS_EPATHWILD(s) ((s) == APR_EPATHWILD)
420 
423 #if defined(WIN32)
424 #define APR_STATUS_IS_ESYMNOTFOUND(s) ((s) == APR_ESYMNOTFOUND \
425  || APR_TO_OS_ERROR(s) == ERROR_PROC_NOT_FOUND)
426 #elif defined(OS2)
427 #define APR_STATUS_IS_ESYMNOTFOUND(s) ((s) == APR_ESYMNOTFOUND \
428  || APR_TO_OS_ERROR(s) == ERROR_INVALID_NAME)
429 #else
430 #define APR_STATUS_IS_ESYMNOTFOUND(s) ((s) == APR_ESYMNOTFOUND)
431 #endif
432 
433 #define APR_STATUS_IS_EPROC_UNKNOWN(s) ((s) == APR_EPROC_UNKNOWN)
434 
435 #define APR_STATUS_IS_ENOTENOUGHENTROPY(s) ((s) == APR_ENOTENOUGHENTROPY)
436 
444 #define APR_INCHILD (APR_OS_START_STATUS + 1)
445 
446 #define APR_INPARENT (APR_OS_START_STATUS + 2)
447 
448 #define APR_DETACH (APR_OS_START_STATUS + 3)
449 
450 #define APR_NOTDETACH (APR_OS_START_STATUS + 4)
451 
452 #define APR_CHILD_DONE (APR_OS_START_STATUS + 5)
453 
454 #define APR_CHILD_NOTDONE (APR_OS_START_STATUS + 6)
455 
456 #define APR_TIMEUP (APR_OS_START_STATUS + 7)
457 
458 #define APR_INCOMPLETE (APR_OS_START_STATUS + 8)
459 /* empty slot: +9 */
460 /* empty slot: +10 */
461 /* empty slot: +11 */
463 #define APR_BADCH (APR_OS_START_STATUS + 12)
464 
465 #define APR_BADARG (APR_OS_START_STATUS + 13)
466 
467 #define APR_EOF (APR_OS_START_STATUS + 14)
468 
469 #define APR_NOTFOUND (APR_OS_START_STATUS + 15)
470 /* empty slot: +16 */
471 /* empty slot: +17 */
472 /* empty slot: +18 */
474 #define APR_ANONYMOUS (APR_OS_START_STATUS + 19)
475 
476 #define APR_FILEBASED (APR_OS_START_STATUS + 20)
477 
478 #define APR_KEYBASED (APR_OS_START_STATUS + 21)
479 
480 #define APR_EINIT (APR_OS_START_STATUS + 22)
481 
482 #define APR_ENOTIMPL (APR_OS_START_STATUS + 23)
483 
484 #define APR_EMISMATCH (APR_OS_START_STATUS + 24)
485 
486 #define APR_EBUSY (APR_OS_START_STATUS + 25)
487 
498 #define APR_STATUS_IS_INCHILD(s) ((s) == APR_INCHILD)
499 
505 #define APR_STATUS_IS_INPARENT(s) ((s) == APR_INPARENT)
506 
512 #define APR_STATUS_IS_DETACH(s) ((s) == APR_DETACH)
513 
519 #define APR_STATUS_IS_NOTDETACH(s) ((s) == APR_NOTDETACH)
520 
526 #define APR_STATUS_IS_CHILD_DONE(s) ((s) == APR_CHILD_DONE)
527 
533 #define APR_STATUS_IS_CHILD_NOTDONE(s) ((s) == APR_CHILD_NOTDONE)
534 
540 #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP)
541 
548 #define APR_STATUS_IS_INCOMPLETE(s) ((s) == APR_INCOMPLETE)
549 /* empty slot: +9 */
550 /* empty slot: +10 */
551 /* empty slot: +11 */
558 #define APR_STATUS_IS_BADCH(s) ((s) == APR_BADCH)
559 
566 #define APR_STATUS_IS_BADARG(s) ((s) == APR_BADARG)
567 
573 #define APR_STATUS_IS_EOF(s) ((s) == APR_EOF)
574 
580 #define APR_STATUS_IS_NOTFOUND(s) ((s) == APR_NOTFOUND)
581 /* empty slot: +16 */
582 /* empty slot: +17 */
583 /* empty slot: +18 */
590 #define APR_STATUS_IS_ANONYMOUS(s) ((s) == APR_ANONYMOUS)
591 
597 #define APR_STATUS_IS_FILEBASED(s) ((s) == APR_FILEBASED)
598 
604 #define APR_STATUS_IS_KEYBASED(s) ((s) == APR_KEYBASED)
605 
612 #define APR_STATUS_IS_EINIT(s) ((s) == APR_EINIT)
613 
621 #define APR_STATUS_IS_ENOTIMPL(s) ((s) == APR_ENOTIMPL)
622 
628 #define APR_STATUS_IS_EMISMATCH(s) ((s) == APR_EMISMATCH)
629 
634 #define APR_STATUS_IS_EBUSY(s) ((s) == APR_EBUSY)
635 
642 /* APR CANONICAL ERROR VALUES */
644 #ifdef EACCES
645 #define APR_EACCES EACCES
646 #else
647 #define APR_EACCES (APR_OS_START_CANONERR + 1)
648 #endif
649 
651 #ifdef EEXIST
652 #define APR_EEXIST EEXIST
653 #else
654 #define APR_EEXIST (APR_OS_START_CANONERR + 2)
655 #endif
656 
658 #ifdef ENAMETOOLONG
659 #define APR_ENAMETOOLONG ENAMETOOLONG
660 #else
661 #define APR_ENAMETOOLONG (APR_OS_START_CANONERR + 3)
662 #endif
663 
665 #ifdef ENOENT
666 #define APR_ENOENT ENOENT
667 #else
668 #define APR_ENOENT (APR_OS_START_CANONERR + 4)
669 #endif
670 
672 #ifdef ENOTDIR
673 #define APR_ENOTDIR ENOTDIR
674 #else
675 #define APR_ENOTDIR (APR_OS_START_CANONERR + 5)
676 #endif
677 
679 #ifdef ENOSPC
680 #define APR_ENOSPC ENOSPC
681 #else
682 #define APR_ENOSPC (APR_OS_START_CANONERR + 6)
683 #endif
684 
686 #ifdef ENOMEM
687 #define APR_ENOMEM ENOMEM
688 #else
689 #define APR_ENOMEM (APR_OS_START_CANONERR + 7)
690 #endif
691 
693 #ifdef EMFILE
694 #define APR_EMFILE EMFILE
695 #else
696 #define APR_EMFILE (APR_OS_START_CANONERR + 8)
697 #endif
698 
700 #ifdef ENFILE
701 #define APR_ENFILE ENFILE
702 #else
703 #define APR_ENFILE (APR_OS_START_CANONERR + 9)
704 #endif
705 
707 #ifdef EBADF
708 #define APR_EBADF EBADF
709 #else
710 #define APR_EBADF (APR_OS_START_CANONERR + 10)
711 #endif
712 
714 #ifdef EINVAL
715 #define APR_EINVAL EINVAL
716 #else
717 #define APR_EINVAL (APR_OS_START_CANONERR + 11)
718 #endif
719 
721 #ifdef ESPIPE
722 #define APR_ESPIPE ESPIPE
723 #else
724 #define APR_ESPIPE (APR_OS_START_CANONERR + 12)
725 #endif
726 
731 #ifdef EAGAIN
732 #define APR_EAGAIN EAGAIN
733 #elif defined(EWOULDBLOCK)
734 #define APR_EAGAIN EWOULDBLOCK
735 #else
736 #define APR_EAGAIN (APR_OS_START_CANONERR + 13)
737 #endif
738 
740 #ifdef EINTR
741 #define APR_EINTR EINTR
742 #else
743 #define APR_EINTR (APR_OS_START_CANONERR + 14)
744 #endif
745 
747 #ifdef ENOTSOCK
748 #define APR_ENOTSOCK ENOTSOCK
749 #else
750 #define APR_ENOTSOCK (APR_OS_START_CANONERR + 15)
751 #endif
752 
754 #ifdef ECONNREFUSED
755 #define APR_ECONNREFUSED ECONNREFUSED
756 #else
757 #define APR_ECONNREFUSED (APR_OS_START_CANONERR + 16)
758 #endif
759 
761 #ifdef EINPROGRESS
762 #define APR_EINPROGRESS EINPROGRESS
763 #else
764 #define APR_EINPROGRESS (APR_OS_START_CANONERR + 17)
765 #endif
766 
772 #ifdef ECONNABORTED
773 #define APR_ECONNABORTED ECONNABORTED
774 #else
775 #define APR_ECONNABORTED (APR_OS_START_CANONERR + 18)
776 #endif
777 
779 #ifdef ECONNRESET
780 #define APR_ECONNRESET ECONNRESET
781 #else
782 #define APR_ECONNRESET (APR_OS_START_CANONERR + 19)
783 #endif
784 
787 #ifdef ETIMEDOUT
788 #define APR_ETIMEDOUT ETIMEDOUT
789 #else
790 #define APR_ETIMEDOUT (APR_OS_START_CANONERR + 20)
791 #endif
792 
794 #ifdef EHOSTUNREACH
795 #define APR_EHOSTUNREACH EHOSTUNREACH
796 #else
797 #define APR_EHOSTUNREACH (APR_OS_START_CANONERR + 21)
798 #endif
799 
801 #ifdef ENETUNREACH
802 #define APR_ENETUNREACH ENETUNREACH
803 #else
804 #define APR_ENETUNREACH (APR_OS_START_CANONERR + 22)
805 #endif
806 
808 #ifdef EFTYPE
809 #define APR_EFTYPE EFTYPE
810 #else
811 #define APR_EFTYPE (APR_OS_START_CANONERR + 23)
812 #endif
813 
815 #ifdef EPIPE
816 #define APR_EPIPE EPIPE
817 #else
818 #define APR_EPIPE (APR_OS_START_CANONERR + 24)
819 #endif
820 
822 #ifdef EXDEV
823 #define APR_EXDEV EXDEV
824 #else
825 #define APR_EXDEV (APR_OS_START_CANONERR + 25)
826 #endif
827 
829 #ifdef ENOTEMPTY
830 #define APR_ENOTEMPTY ENOTEMPTY
831 #else
832 #define APR_ENOTEMPTY (APR_OS_START_CANONERR + 26)
833 #endif
834 
836 #ifdef EAFNOSUPPORT
837 #define APR_EAFNOSUPPORT EAFNOSUPPORT
838 #else
839 #define APR_EAFNOSUPPORT (APR_OS_START_CANONERR + 27)
840 #endif
841 
843 #ifdef EOPNOTSUPP
844 #define APR_EOPNOTSUPP EOPNOTSUPP
845 #else
846 #define APR_EOPNOTSUPP (APR_OS_START_CANONERR + 28)
847 #endif
848 
850 #ifdef ERANGE
851 #define APR_ERANGE ERANGE
852 #else
853 #define APR_ERANGE (APR_OS_START_CANONERR + 29)
854 #endif
855 
858 #if defined(OS2) && !defined(DOXYGEN)
859 
860 #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR)
861 #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR)
862 
863 #define INCL_DOSERRORS
864 #define INCL_DOS
865 
866 /* Leave these undefined.
867  * OS2 doesn't rely on the errno concept.
868  * The API calls always return a result codes which
869  * should be filtered through APR_FROM_OS_ERROR().
870  *
871  * #define apr_get_os_error() (APR_FROM_OS_ERROR(GetLastError()))
872  * #define apr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e)))
873  */
874 
875 /* A special case, only socket calls require this;
876  */
877 #define apr_get_netos_error() (APR_FROM_OS_ERROR(errno))
878 #define apr_set_netos_error(e) (errno = APR_TO_OS_ERROR(e))
879 
880 /* These can't sit in a private header, so in spite of the extra size,
881  * they need to be made available here.
882  */
883 #define SOCBASEERR 10000
884 #define SOCEPERM (SOCBASEERR+1) /* Not owner */
885 #define SOCESRCH (SOCBASEERR+3) /* No such process */
886 #define SOCEINTR (SOCBASEERR+4) /* Interrupted system call */
887 #define SOCENXIO (SOCBASEERR+6) /* No such device or address */
888 #define SOCEBADF (SOCBASEERR+9) /* Bad file number */
889 #define SOCEACCES (SOCBASEERR+13) /* Permission denied */
890 #define SOCEFAULT (SOCBASEERR+14) /* Bad address */
891 #define SOCEINVAL (SOCBASEERR+22) /* Invalid argument */
892 #define SOCEMFILE (SOCBASEERR+24) /* Too many open files */
893 #define SOCEPIPE (SOCBASEERR+32) /* Broken pipe */
894 #define SOCEOS2ERR (SOCBASEERR+100) /* OS/2 Error */
895 #define SOCEWOULDBLOCK (SOCBASEERR+35) /* Operation would block */
896 #define SOCEINPROGRESS (SOCBASEERR+36) /* Operation now in progress */
897 #define SOCEALREADY (SOCBASEERR+37) /* Operation already in progress */
898 #define SOCENOTSOCK (SOCBASEERR+38) /* Socket operation on non-socket */
899 #define SOCEDESTADDRREQ (SOCBASEERR+39) /* Destination address required */
900 #define SOCEMSGSIZE (SOCBASEERR+40) /* Message too long */
901 #define SOCEPROTOTYPE (SOCBASEERR+41) /* Protocol wrong type for socket */
902 #define SOCENOPROTOOPT (SOCBASEERR+42) /* Protocol not available */
903 #define SOCEPROTONOSUPPORT (SOCBASEERR+43) /* Protocol not supported */
904 #define SOCESOCKTNOSUPPORT (SOCBASEERR+44) /* Socket type not supported */
905 #define SOCEOPNOTSUPP (SOCBASEERR+45) /* Operation not supported on socket */
906 #define SOCEPFNOSUPPORT (SOCBASEERR+46) /* Protocol family not supported */
907 #define SOCEAFNOSUPPORT (SOCBASEERR+47) /* Address family not supported by protocol family */
908 #define SOCEADDRINUSE (SOCBASEERR+48) /* Address already in use */
909 #define SOCEADDRNOTAVAIL (SOCBASEERR+49) /* Can't assign requested address */
910 #define SOCENETDOWN (SOCBASEERR+50) /* Network is down */
911 #define SOCENETUNREACH (SOCBASEERR+51) /* Network is unreachable */
912 #define SOCENETRESET (SOCBASEERR+52) /* Network dropped connection on reset */
913 #define SOCECONNABORTED (SOCBASEERR+53) /* Software caused connection abort */
914 #define SOCECONNRESET (SOCBASEERR+54) /* Connection reset by peer */
915 #define SOCENOBUFS (SOCBASEERR+55) /* No buffer space available */
916 #define SOCEISCONN (SOCBASEERR+56) /* Socket is already connected */
917 #define SOCENOTCONN (SOCBASEERR+57) /* Socket is not connected */
918 #define SOCESHUTDOWN (SOCBASEERR+58) /* Can't send after socket shutdown */
919 #define SOCETOOMANYREFS (SOCBASEERR+59) /* Too many references: can't splice */
920 #define SOCETIMEDOUT (SOCBASEERR+60) /* Connection timed out */
921 #define SOCECONNREFUSED (SOCBASEERR+61) /* Connection refused */
922 #define SOCELOOP (SOCBASEERR+62) /* Too many levels of symbolic links */
923 #define SOCENAMETOOLONG (SOCBASEERR+63) /* File name too long */
924 #define SOCEHOSTDOWN (SOCBASEERR+64) /* Host is down */
925 #define SOCEHOSTUNREACH (SOCBASEERR+65) /* No route to host */
926 #define SOCENOTEMPTY (SOCBASEERR+66) /* Directory not empty */
927 
928 /* APR CANONICAL ERROR TESTS */
929 #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \
930  || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED \
931  || (s) == APR_OS_START_SYSERR + ERROR_SHARING_VIOLATION)
932 #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST \
933  || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED \
934  || (s) == APR_OS_START_SYSERR + ERROR_FILE_EXISTS \
935  || (s) == APR_OS_START_SYSERR + ERROR_ALREADY_EXISTS \
936  || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED)
937 #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG \
938  || (s) == APR_OS_START_SYSERR + ERROR_FILENAME_EXCED_RANGE \
939  || (s) == APR_OS_START_SYSERR + SOCENAMETOOLONG)
940 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \
941  || (s) == APR_OS_START_SYSERR + ERROR_FILE_NOT_FOUND \
942  || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \
943  || (s) == APR_OS_START_SYSERR + ERROR_NO_MORE_FILES \
944  || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED)
945 #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR)
946 #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \
947  || (s) == APR_OS_START_SYSERR + ERROR_DISK_FULL)
948 #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM)
949 #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE \
950  || (s) == APR_OS_START_SYSERR + ERROR_TOO_MANY_OPEN_FILES)
951 #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE)
952 #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF \
953  || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE)
954 #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL \
955  || (s) == APR_OS_START_SYSERR + ERROR_INVALID_PARAMETER \
956  || (s) == APR_OS_START_SYSERR + ERROR_INVALID_FUNCTION)
957 #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE \
958  || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK)
959 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \
960  || (s) == APR_OS_START_SYSERR + ERROR_NO_DATA \
961  || (s) == APR_OS_START_SYSERR + SOCEWOULDBLOCK \
962  || (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION)
963 #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \
964  || (s) == APR_OS_START_SYSERR + SOCEINTR)
965 #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \
966  || (s) == APR_OS_START_SYSERR + SOCENOTSOCK)
967 #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \
968  || (s) == APR_OS_START_SYSERR + SOCECONNREFUSED)
969 #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \
970  || (s) == APR_OS_START_SYSERR + SOCEINPROGRESS)
971 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \
972  || (s) == APR_OS_START_SYSERR + SOCECONNABORTED)
973 #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \
974  || (s) == APR_OS_START_SYSERR + SOCECONNRESET)
975 /* XXX deprecated */
976 #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \
977  || (s) == APR_OS_START_SYSERR + SOCETIMEDOUT)
978 #undef APR_STATUS_IS_TIMEUP
979 #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP \
980  || (s) == APR_OS_START_SYSERR + SOCETIMEDOUT)
981 #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \
982  || (s) == APR_OS_START_SYSERR + SOCEHOSTUNREACH)
983 #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \
984  || (s) == APR_OS_START_SYSERR + SOCENETUNREACH)
985 #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE)
986 #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE \
987  || (s) == APR_OS_START_SYSERR + ERROR_BROKEN_PIPE \
988  || (s) == APR_OS_START_SYSERR + SOCEPIPE)
989 #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV \
990  || (s) == APR_OS_START_SYSERR + ERROR_NOT_SAME_DEVICE)
991 #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY \
992  || (s) == APR_OS_START_SYSERR + ERROR_DIR_NOT_EMPTY \
993  || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED)
994 #define APR_STATUS_IS_EAFNOSUPPORT(s) ((s) == APR_AFNOSUPPORT \
995  || (s) == APR_OS_START_SYSERR + SOCEAFNOSUPPORT)
996 #define APR_STATUS_IS_EOPNOTSUPP(s) ((s) == APR_EOPNOTSUPP \
997  || (s) == APR_OS_START_SYSERR + SOCEOPNOTSUPP)
998 #define APR_STATUS_IS_ERANGE(s) ((s) == APR_ERANGE)
999 
1000 /*
1001  Sorry, too tired to wrap this up for OS2... feel free to
1002  fit the following into their best matches.
1003 
1004  { ERROR_NO_SIGNAL_SENT, ESRCH },
1005  { SOCEALREADY, EALREADY },
1006  { SOCEDESTADDRREQ, EDESTADDRREQ },
1007  { SOCEMSGSIZE, EMSGSIZE },
1008  { SOCEPROTOTYPE, EPROTOTYPE },
1009  { SOCENOPROTOOPT, ENOPROTOOPT },
1010  { SOCEPROTONOSUPPORT, EPROTONOSUPPORT },
1011  { SOCESOCKTNOSUPPORT, ESOCKTNOSUPPORT },
1012  { SOCEPFNOSUPPORT, EPFNOSUPPORT },
1013  { SOCEADDRINUSE, EADDRINUSE },
1014  { SOCEADDRNOTAVAIL, EADDRNOTAVAIL },
1015  { SOCENETDOWN, ENETDOWN },
1016  { SOCENETRESET, ENETRESET },
1017  { SOCENOBUFS, ENOBUFS },
1018  { SOCEISCONN, EISCONN },
1019  { SOCENOTCONN, ENOTCONN },
1020  { SOCESHUTDOWN, ESHUTDOWN },
1021  { SOCETOOMANYREFS, ETOOMANYREFS },
1022  { SOCELOOP, ELOOP },
1023  { SOCEHOSTDOWN, EHOSTDOWN },
1024  { SOCENOTEMPTY, ENOTEMPTY },
1025  { SOCEPIPE, EPIPE }
1026 */
1027 
1028 #elif defined(WIN32) && !defined(DOXYGEN) /* !defined(OS2) */
1029 
1030 #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR)
1031 #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR)
1032 
1033 #define apr_get_os_error() (APR_FROM_OS_ERROR(GetLastError()))
1034 #define apr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e)))
1035 
1036 /* A special case, only socket calls require this:
1037  */
1038 #define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError()))
1039 #define apr_set_netos_error(e) (WSASetLastError(APR_TO_OS_ERROR(e)))
1040 
1041 /* APR CANONICAL ERROR TESTS */
1042 #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \
1043  || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED \
1044  || (s) == APR_OS_START_SYSERR + ERROR_CANNOT_MAKE \
1045  || (s) == APR_OS_START_SYSERR + ERROR_CURRENT_DIRECTORY \
1046  || (s) == APR_OS_START_SYSERR + ERROR_DRIVE_LOCKED \
1047  || (s) == APR_OS_START_SYSERR + ERROR_FAIL_I24 \
1048  || (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION \
1049  || (s) == APR_OS_START_SYSERR + ERROR_LOCK_FAILED \
1050  || (s) == APR_OS_START_SYSERR + ERROR_NOT_LOCKED \
1051  || (s) == APR_OS_START_SYSERR + ERROR_NETWORK_ACCESS_DENIED \
1052  || (s) == APR_OS_START_SYSERR + ERROR_SHARING_VIOLATION)
1053 #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST \
1054  || (s) == APR_OS_START_SYSERR + ERROR_FILE_EXISTS \
1055  || (s) == APR_OS_START_SYSERR + ERROR_ALREADY_EXISTS)
1056 #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG \
1057  || (s) == APR_OS_START_SYSERR + ERROR_FILENAME_EXCED_RANGE \
1058  || (s) == APR_OS_START_SYSERR + WSAENAMETOOLONG)
1059 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \
1060  || (s) == APR_OS_START_SYSERR + ERROR_FILE_NOT_FOUND \
1061  || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \
1062  || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED \
1063  || (s) == APR_OS_START_SYSERR + ERROR_NO_MORE_FILES)
1064 #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR \
1065  || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \
1066  || (s) == APR_OS_START_SYSERR + ERROR_BAD_NETPATH \
1067  || (s) == APR_OS_START_SYSERR + ERROR_BAD_NET_NAME \
1068  || (s) == APR_OS_START_SYSERR + ERROR_BAD_PATHNAME \
1069  || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DRIVE \
1070  || (s) == APR_OS_START_SYSERR + ERROR_DIRECTORY)
1071 #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \
1072  || (s) == APR_OS_START_SYSERR + ERROR_DISK_FULL)
1073 #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM \
1074  || (s) == APR_OS_START_SYSERR + ERROR_ARENA_TRASHED \
1075  || (s) == APR_OS_START_SYSERR + ERROR_NOT_ENOUGH_MEMORY \
1076  || (s) == APR_OS_START_SYSERR + ERROR_INVALID_BLOCK \
1077  || (s) == APR_OS_START_SYSERR + ERROR_NOT_ENOUGH_QUOTA \
1078  || (s) == APR_OS_START_SYSERR + ERROR_OUTOFMEMORY)
1079 #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE \
1080  || (s) == APR_OS_START_SYSERR + ERROR_TOO_MANY_OPEN_FILES)
1081 #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE)
1082 #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF \
1083  || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE \
1084  || (s) == APR_OS_START_SYSERR + ERROR_INVALID_TARGET_HANDLE)
1085 #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL \
1086  || (s) == APR_OS_START_SYSERR + ERROR_INVALID_ACCESS \
1087  || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DATA \
1088  || (s) == APR_OS_START_SYSERR + ERROR_INVALID_FUNCTION \
1089  || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE \
1090  || (s) == APR_OS_START_SYSERR + ERROR_INVALID_PARAMETER \
1091  || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK)
1092 #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE \
1093  || (s) == APR_OS_START_SYSERR + ERROR_SEEK_ON_DEVICE \
1094  || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK)
1095 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \
1096  || (s) == APR_OS_START_SYSERR + ERROR_NO_DATA \
1097  || (s) == APR_OS_START_SYSERR + ERROR_NO_PROC_SLOTS \
1098  || (s) == APR_OS_START_SYSERR + ERROR_NESTING_NOT_ALLOWED \
1099  || (s) == APR_OS_START_SYSERR + ERROR_MAX_THRDS_REACHED \
1100  || (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION \
1101  || (s) == APR_OS_START_SYSERR + WSAEWOULDBLOCK)
1102 #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \
1103  || (s) == APR_OS_START_SYSERR + WSAEINTR)
1104 #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \
1105  || (s) == APR_OS_START_SYSERR + WSAENOTSOCK)
1106 #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \
1107  || (s) == APR_OS_START_SYSERR + WSAECONNREFUSED)
1108 #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \
1109  || (s) == APR_OS_START_SYSERR + WSAEINPROGRESS)
1110 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \
1111  || (s) == APR_OS_START_SYSERR + WSAECONNABORTED)
1112 #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \
1113  || (s) == APR_OS_START_SYSERR + ERROR_NETNAME_DELETED \
1114  || (s) == APR_OS_START_SYSERR + WSAECONNRESET)
1115 /* XXX deprecated */
1116 #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \
1117  || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \
1118  || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT)
1119 #undef APR_STATUS_IS_TIMEUP
1120 #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP \
1121  || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \
1122  || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT)
1123 #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \
1124  || (s) == APR_OS_START_SYSERR + WSAEHOSTUNREACH)
1125 #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \
1126  || (s) == APR_OS_START_SYSERR + WSAENETUNREACH)
1127 #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE \
1128  || (s) == APR_OS_START_SYSERR + ERROR_EXE_MACHINE_TYPE_MISMATCH \
1129  || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DLL \
1130  || (s) == APR_OS_START_SYSERR + ERROR_INVALID_MODULETYPE \
1131  || (s) == APR_OS_START_SYSERR + ERROR_BAD_EXE_FORMAT \
1132  || (s) == APR_OS_START_SYSERR + ERROR_INVALID_EXE_SIGNATURE \
1133  || (s) == APR_OS_START_SYSERR + ERROR_FILE_CORRUPT \
1134  || (s) == APR_OS_START_SYSERR + ERROR_BAD_FORMAT)
1135 #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE \
1136  || (s) == APR_OS_START_SYSERR + ERROR_BROKEN_PIPE)
1137 #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV \
1138  || (s) == APR_OS_START_SYSERR + ERROR_NOT_SAME_DEVICE)
1139 #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY \
1140  || (s) == APR_OS_START_SYSERR + ERROR_DIR_NOT_EMPTY)
1141 #define APR_STATUS_IS_EAFNOSUPPORT(s) ((s) == APR_EAFNOSUPPORT \
1142  || (s) == APR_OS_START_SYSERR + WSAEAFNOSUPPORT)
1143 #define APR_STATUS_IS_EOPNOTSUPP(s) ((s) == APR_EOPNOTSUPP \
1144  || (s) == APR_OS_START_SYSERR + WSAEOPNOTSUPP)
1145 #define APR_STATUS_IS_ERANGE(s) ((s) == APR_ERANGE)
1146 
1147 #elif defined(NETWARE) && defined(USE_WINSOCK) && !defined(DOXYGEN) /* !defined(OS2) && !defined(WIN32) */
1148 
1149 #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR)
1150 #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR)
1151 
1152 #define apr_get_os_error() (errno)
1153 #define apr_set_os_error(e) (errno = (e))
1154 
1155 /* A special case, only socket calls require this: */
1156 #define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError()))
1157 #define apr_set_netos_error(e) (WSASetLastError(APR_TO_OS_ERROR(e)))
1158 
1159 /* APR CANONICAL ERROR TESTS */
1160 #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES)
1161 #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST)
1162 #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG)
1163 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT)
1164 #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR)
1165 #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC)
1166 #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM)
1167 #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE)
1168 #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE)
1169 #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF)
1170 #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL)
1171 #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE)
1172 
1173 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \
1174  || (s) == EWOULDBLOCK \
1175  || (s) == APR_OS_START_SYSERR + WSAEWOULDBLOCK)
1176 #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \
1177  || (s) == APR_OS_START_SYSERR + WSAEINTR)
1178 #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \
1179  || (s) == APR_OS_START_SYSERR + WSAENOTSOCK)
1180 #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \
1181  || (s) == APR_OS_START_SYSERR + WSAECONNREFUSED)
1182 #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \
1183  || (s) == APR_OS_START_SYSERR + WSAEINPROGRESS)
1184 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \
1185  || (s) == APR_OS_START_SYSERR + WSAECONNABORTED)
1186 #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \
1187  || (s) == APR_OS_START_SYSERR + WSAECONNRESET)
1188 /* XXX deprecated */
1189 #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \
1190  || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \
1191  || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT)
1192 #undef APR_STATUS_IS_TIMEUP
1193 #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP \
1194  || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \
1195  || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT)
1196 #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \
1197  || (s) == APR_OS_START_SYSERR + WSAEHOSTUNREACH)
1198 #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \
1199  || (s) == APR_OS_START_SYSERR + WSAENETUNREACH)
1200 #define APR_STATUS_IS_ENETDOWN(s) ((s) == APR_OS_START_SYSERR + WSAENETDOWN)
1201 #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE)
1202 #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE)
1203 #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV)
1204 #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY)
1205 #define APR_STATUS_IS_EAFNOSUPPORT(s) ((s) == APR_EAFNOSUPPORT \
1206  || (s) == APR_OS_START_SYSERR + WSAEAFNOSUPPORT)
1207 #define APR_STATUS_IS_EOPNOTSUPP(s) ((s) == APR_EOPNOTSUPP \
1208  || (s) == APR_OS_START_SYSERR + WSAEOPNOTSUPP)
1209 #define APR_STATUS_IS_ERANGE(s) ((s) == APR_ERANGE)
1210 
1211 #else /* !defined(NETWARE) && !defined(OS2) && !defined(WIN32) */
1212 
1213 /*
1214  * os error codes are clib error codes
1215  */
1216 #define APR_FROM_OS_ERROR(e) (e)
1217 #define APR_TO_OS_ERROR(e) (e)
1218 
1219 #define apr_get_os_error() (errno)
1220 #define apr_set_os_error(e) (errno = (e))
1221 
1222 /* A special case, only socket calls require this:
1223  */
1224 #define apr_get_netos_error() (errno)
1225 #define apr_set_netos_error(e) (errno = (e))
1226 
1233 #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES)
1234 
1235 #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST)
1236 
1237 #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG)
1238 
1244 #ifdef EMVSCATLG
1245 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \
1246  || (s) == EMVSCATLG)
1247 #else
1248 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT)
1249 #endif
1250 
1251 #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR)
1252 
1253 #ifdef EDQUOT
1254 #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \
1255  || (s) == EDQUOT)
1256 #else
1257 #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC)
1258 #endif
1259 
1260 #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM)
1261 
1262 #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE)
1263 
1264 #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE)
1265 
1266 #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF)
1267 
1268 #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL)
1269 
1270 #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE)
1271 
1273 #if !defined(EWOULDBLOCK) || !defined(EAGAIN)
1274 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN)
1275 #elif (EWOULDBLOCK == EAGAIN)
1276 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN)
1277 #else
1278 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \
1279  || (s) == EWOULDBLOCK)
1280 #endif
1281 
1283 #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR)
1284 
1285 #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK)
1286 
1287 #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED)
1288 
1289 #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS)
1290 
1302 #ifdef EPROTO
1303 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \
1304  || (s) == EPROTO)
1305 #else
1306 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED)
1307 #endif
1308 
1310 #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET)
1311 
1313 #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT)
1314 
1315 #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH)
1316 
1317 #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH)
1318 
1319 #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE)
1320 
1321 #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE)
1322 
1323 #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV)
1324 
1325 #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY || \
1326  (s) == APR_EEXIST)
1327 
1328 #define APR_STATUS_IS_EAFNOSUPPORT(s) ((s) == APR_EAFNOSUPPORT)
1329 
1330 #define APR_STATUS_IS_EOPNOTSUPP(s) ((s) == APR_EOPNOTSUPP)
1331 
1333 #define APR_STATUS_IS_ERANGE(s) ((s) == APR_ERANGE)
1334 
1336 #endif /* !defined(NETWARE) && !defined(OS2) && !defined(WIN32) */
1337 
1340 #ifdef __cplusplus
1341 }
1342 #endif
1343 
1344 #endif /* ! APR_ERRNO_H */
size_t apr_size_t
Definition: apr.h:375
char * apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize)
APR Platform Definitions.
#define APR_DECLARE(x)
Definition: macros.h:6
int apr_status_t
Definition: apr_errno.h:44