64 #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR)
75 #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR)
117 #define APR_OS_START_ERROR 20000
123 #define APR_OS_ERRSPACE_SIZE 50000
132 #define APR_UTIL_ERRSPACE_SIZE 20000
136 #define APR_OS_START_STATUS (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)
141 #define APR_UTIL_START_STATUS (APR_OS_START_STATUS + \
142 (APR_OS_ERRSPACE_SIZE - APR_UTIL_ERRSPACE_SIZE))
164 #define APR_OS_START_USERERR (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)
169 #define APR_OS_START_USEERR APR_OS_START_USERERR
174 #define APR_OS_START_CANONERR (APR_OS_START_USERERR \
175 + (APR_OS_ERRSPACE_SIZE * 10))
180 #define APR_OS_START_EAIERR (APR_OS_START_CANONERR + APR_OS_ERRSPACE_SIZE)
185 #define APR_OS_START_SYSERR (APR_OS_START_EAIERR + APR_OS_ERRSPACE_SIZE)
225 #define APR_SUCCESS 0
288 #define APR_ENOSTAT (APR_OS_START_ERROR + 1)
290 #define APR_ENOPOOL (APR_OS_START_ERROR + 2)
293 #define APR_EBADDATE (APR_OS_START_ERROR + 4)
295 #define APR_EINVALSOCK (APR_OS_START_ERROR + 5)
297 #define APR_ENOPROC (APR_OS_START_ERROR + 6)
299 #define APR_ENOTIME (APR_OS_START_ERROR + 7)
301 #define APR_ENODIR (APR_OS_START_ERROR + 8)
303 #define APR_ENOLOCK (APR_OS_START_ERROR + 9)
305 #define APR_ENOPOLL (APR_OS_START_ERROR + 10)
307 #define APR_ENOSOCKET (APR_OS_START_ERROR + 11)
309 #define APR_ENOTHREAD (APR_OS_START_ERROR + 12)
311 #define APR_ENOTHDKEY (APR_OS_START_ERROR + 13)
313 #define APR_EGENERAL (APR_OS_START_ERROR + 14)
315 #define APR_ENOSHMAVAIL (APR_OS_START_ERROR + 15)
317 #define APR_EBADIP (APR_OS_START_ERROR + 16)
319 #define APR_EBADMASK (APR_OS_START_ERROR + 17)
322 #define APR_EDSOOPEN (APR_OS_START_ERROR + 19)
324 #define APR_EABSOLUTE (APR_OS_START_ERROR + 20)
326 #define APR_ERELATIVE (APR_OS_START_ERROR + 21)
328 #define APR_EINCOMPLETE (APR_OS_START_ERROR + 22)
330 #define APR_EABOVEROOT (APR_OS_START_ERROR + 23)
332 #define APR_EBADPATH (APR_OS_START_ERROR + 24)
334 #define APR_EPATHWILD (APR_OS_START_ERROR + 25)
336 #define APR_ESYMNOTFOUND (APR_OS_START_ERROR + 26)
338 #define APR_EPROC_UNKNOWN (APR_OS_START_ERROR + 27)
340 #define APR_ENOTENOUGHENTROPY (APR_OS_START_ERROR + 28)
359 #define APR_STATUS_IS_ENOSTAT(s) ((s) == APR_ENOSTAT)
365 #define APR_STATUS_IS_ENOPOOL(s) ((s) == APR_ENOPOOL)
367 #define APR_STATUS_IS_EBADDATE(s) ((s) == APR_EBADDATE)
369 #define APR_STATUS_IS_EINVALSOCK(s) ((s) == APR_EINVALSOCK)
371 #define APR_STATUS_IS_ENOPROC(s) ((s) == APR_ENOPROC)
373 #define APR_STATUS_IS_ENOTIME(s) ((s) == APR_ENOTIME)
375 #define APR_STATUS_IS_ENODIR(s) ((s) == APR_ENODIR)
377 #define APR_STATUS_IS_ENOLOCK(s) ((s) == APR_ENOLOCK)
379 #define APR_STATUS_IS_ENOPOLL(s) ((s) == APR_ENOPOLL)
381 #define APR_STATUS_IS_ENOSOCKET(s) ((s) == APR_ENOSOCKET)
383 #define APR_STATUS_IS_ENOTHREAD(s) ((s) == APR_ENOTHREAD)
385 #define APR_STATUS_IS_ENOTHDKEY(s) ((s) == APR_ENOTHDKEY)
387 #define APR_STATUS_IS_EGENERAL(s) ((s) == APR_EGENERAL)
389 #define APR_STATUS_IS_ENOSHMAVAIL(s) ((s) == APR_ENOSHMAVAIL)
391 #define APR_STATUS_IS_EBADIP(s) ((s) == APR_EBADIP)
393 #define APR_STATUS_IS_EBADMASK(s) ((s) == APR_EBADMASK)
400 #define APR_STATUS_IS_EDSOOPEN(s) ((s) == APR_EDSOOPEN \
401 || APR_TO_OS_ERROR(s) == ERROR_MOD_NOT_FOUND)
403 #define APR_STATUS_IS_EDSOOPEN(s) ((s) == APR_EDSOOPEN)
406 #define APR_STATUS_IS_EABSOLUTE(s) ((s) == APR_EABSOLUTE)
408 #define APR_STATUS_IS_ERELATIVE(s) ((s) == APR_ERELATIVE)
410 #define APR_STATUS_IS_EINCOMPLETE(s) ((s) == APR_EINCOMPLETE)
412 #define APR_STATUS_IS_EABOVEROOT(s) ((s) == APR_EABOVEROOT)
414 #define APR_STATUS_IS_EBADPATH(s) ((s) == APR_EBADPATH)
416 #define APR_STATUS_IS_EPATHWILD(s) ((s) == APR_EPATHWILD)
421 #define APR_STATUS_IS_ESYMNOTFOUND(s) ((s) == APR_ESYMNOTFOUND \
422 || APR_TO_OS_ERROR(s) == ERROR_PROC_NOT_FOUND)
424 #define APR_STATUS_IS_ESYMNOTFOUND(s) ((s) == APR_ESYMNOTFOUND)
427 #define APR_STATUS_IS_EPROC_UNKNOWN(s) ((s) == APR_EPROC_UNKNOWN)
429 #define APR_STATUS_IS_ENOTENOUGHENTROPY(s) ((s) == APR_ENOTENOUGHENTROPY)
438 #define APR_INCHILD (APR_OS_START_STATUS + 1)
440 #define APR_INPARENT (APR_OS_START_STATUS + 2)
442 #define APR_DETACH (APR_OS_START_STATUS + 3)
444 #define APR_NOTDETACH (APR_OS_START_STATUS + 4)
446 #define APR_CHILD_DONE (APR_OS_START_STATUS + 5)
448 #define APR_CHILD_NOTDONE (APR_OS_START_STATUS + 6)
450 #define APR_TIMEUP (APR_OS_START_STATUS + 7)
452 #define APR_INCOMPLETE (APR_OS_START_STATUS + 8)
457 #define APR_BADCH (APR_OS_START_STATUS + 12)
459 #define APR_BADARG (APR_OS_START_STATUS + 13)
461 #define APR_EOF (APR_OS_START_STATUS + 14)
463 #define APR_NOTFOUND (APR_OS_START_STATUS + 15)
468 #define APR_ANONYMOUS (APR_OS_START_STATUS + 19)
470 #define APR_FILEBASED (APR_OS_START_STATUS + 20)
472 #define APR_KEYBASED (APR_OS_START_STATUS + 21)
474 #define APR_EINIT (APR_OS_START_STATUS + 22)
476 #define APR_ENOTIMPL (APR_OS_START_STATUS + 23)
478 #define APR_EMISMATCH (APR_OS_START_STATUS + 24)
480 #define APR_EBUSY (APR_OS_START_STATUS + 25)
492 #define APR_STATUS_IS_INCHILD(s) ((s) == APR_INCHILD)
499 #define APR_STATUS_IS_INPARENT(s) ((s) == APR_INPARENT)
506 #define APR_STATUS_IS_DETACH(s) ((s) == APR_DETACH)
513 #define APR_STATUS_IS_NOTDETACH(s) ((s) == APR_NOTDETACH)
520 #define APR_STATUS_IS_CHILD_DONE(s) ((s) == APR_CHILD_DONE)
527 #define APR_STATUS_IS_CHILD_NOTDONE(s) ((s) == APR_CHILD_NOTDONE)
534 #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP)
542 #define APR_STATUS_IS_INCOMPLETE(s) ((s) == APR_INCOMPLETE)
552 #define APR_STATUS_IS_BADCH(s) ((s) == APR_BADCH)
560 #define APR_STATUS_IS_BADARG(s) ((s) == APR_BADARG)
567 #define APR_STATUS_IS_EOF(s) ((s) == APR_EOF)
574 #define APR_STATUS_IS_NOTFOUND(s) ((s) == APR_NOTFOUND)
584 #define APR_STATUS_IS_ANONYMOUS(s) ((s) == APR_ANONYMOUS)
591 #define APR_STATUS_IS_FILEBASED(s) ((s) == APR_FILEBASED)
598 #define APR_STATUS_IS_KEYBASED(s) ((s) == APR_KEYBASED)
606 #define APR_STATUS_IS_EINIT(s) ((s) == APR_EINIT)
615 #define APR_STATUS_IS_ENOTIMPL(s) ((s) == APR_ENOTIMPL)
622 #define APR_STATUS_IS_EMISMATCH(s) ((s) == APR_EMISMATCH)
628 #define APR_STATUS_IS_EBUSY(s) ((s) == APR_EBUSY)
639 #define APR_EACCES EACCES
641 #define APR_EACCES (APR_OS_START_CANONERR + 1)
646 #define APR_EEXIST EEXIST
648 #define APR_EEXIST (APR_OS_START_CANONERR + 2)
653 #define APR_ENAMETOOLONG ENAMETOOLONG
655 #define APR_ENAMETOOLONG (APR_OS_START_CANONERR + 3)
660 #define APR_ENOENT ENOENT
662 #define APR_ENOENT (APR_OS_START_CANONERR + 4)
667 #define APR_ENOTDIR ENOTDIR
669 #define APR_ENOTDIR (APR_OS_START_CANONERR + 5)
674 #define APR_ENOSPC ENOSPC
676 #define APR_ENOSPC (APR_OS_START_CANONERR + 6)
681 #define APR_ENOMEM ENOMEM
683 #define APR_ENOMEM (APR_OS_START_CANONERR + 7)
688 #define APR_EMFILE EMFILE
690 #define APR_EMFILE (APR_OS_START_CANONERR + 8)
695 #define APR_ENFILE ENFILE
697 #define APR_ENFILE (APR_OS_START_CANONERR + 9)
702 #define APR_EBADF EBADF
704 #define APR_EBADF (APR_OS_START_CANONERR + 10)
709 #define APR_EINVAL EINVAL
711 #define APR_EINVAL (APR_OS_START_CANONERR + 11)
716 #define APR_ESPIPE ESPIPE
718 #define APR_ESPIPE (APR_OS_START_CANONERR + 12)
726 #define APR_EAGAIN EAGAIN
727 #elif defined(EWOULDBLOCK)
728 #define APR_EAGAIN EWOULDBLOCK
730 #define APR_EAGAIN (APR_OS_START_CANONERR + 13)
735 #define APR_EINTR EINTR
737 #define APR_EINTR (APR_OS_START_CANONERR + 14)
742 #define APR_ENOTSOCK ENOTSOCK
744 #define APR_ENOTSOCK (APR_OS_START_CANONERR + 15)
749 #define APR_ECONNREFUSED ECONNREFUSED
751 #define APR_ECONNREFUSED (APR_OS_START_CANONERR + 16)
756 #define APR_EINPROGRESS EINPROGRESS
758 #define APR_EINPROGRESS (APR_OS_START_CANONERR + 17)
767 #define APR_ECONNABORTED ECONNABORTED
769 #define APR_ECONNABORTED (APR_OS_START_CANONERR + 18)
774 #define APR_ECONNRESET ECONNRESET
776 #define APR_ECONNRESET (APR_OS_START_CANONERR + 19)
782 #define APR_ETIMEDOUT ETIMEDOUT
784 #define APR_ETIMEDOUT (APR_OS_START_CANONERR + 20)
789 #define APR_EHOSTUNREACH EHOSTUNREACH
791 #define APR_EHOSTUNREACH (APR_OS_START_CANONERR + 21)
796 #define APR_ENETUNREACH ENETUNREACH
798 #define APR_ENETUNREACH (APR_OS_START_CANONERR + 22)
803 #define APR_EFTYPE EFTYPE
805 #define APR_EFTYPE (APR_OS_START_CANONERR + 23)
810 #define APR_EPIPE EPIPE
812 #define APR_EPIPE (APR_OS_START_CANONERR + 24)
817 #define APR_EXDEV EXDEV
819 #define APR_EXDEV (APR_OS_START_CANONERR + 25)
824 #define APR_ENOTEMPTY ENOTEMPTY
826 #define APR_ENOTEMPTY (APR_OS_START_CANONERR + 26)
831 #define APR_EAFNOSUPPORT EAFNOSUPPORT
833 #define APR_EAFNOSUPPORT (APR_OS_START_CANONERR + 27)
838 #if defined(OS2) && !defined(DOXYGEN)
840 #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR)
841 #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR)
843 #define INCL_DOSERRORS
857 #define apr_get_netos_error() (APR_FROM_OS_ERROR(errno))
858 #define apr_set_netos_error(e) (errno = APR_TO_OS_ERROR(e))
862 #define APR_OS2_STATUS(e) (APR_FROM_OS_ERROR(e))
867 #define SOCBASEERR 10000
868 #define SOCEPERM (SOCBASEERR+1)
869 #define SOCESRCH (SOCBASEERR+3)
870 #define SOCEINTR (SOCBASEERR+4)
871 #define SOCENXIO (SOCBASEERR+6)
872 #define SOCEBADF (SOCBASEERR+9)
873 #define SOCEACCES (SOCBASEERR+13)
874 #define SOCEFAULT (SOCBASEERR+14)
875 #define SOCEINVAL (SOCBASEERR+22)
876 #define SOCEMFILE (SOCBASEERR+24)
877 #define SOCEPIPE (SOCBASEERR+32)
878 #define SOCEOS2ERR (SOCBASEERR+100)
879 #define SOCEWOULDBLOCK (SOCBASEERR+35)
880 #define SOCEINPROGRESS (SOCBASEERR+36)
881 #define SOCEALREADY (SOCBASEERR+37)
882 #define SOCENOTSOCK (SOCBASEERR+38)
883 #define SOCEDESTADDRREQ (SOCBASEERR+39)
884 #define SOCEMSGSIZE (SOCBASEERR+40)
885 #define SOCEPROTOTYPE (SOCBASEERR+41)
886 #define SOCENOPROTOOPT (SOCBASEERR+42)
887 #define SOCEPROTONOSUPPORT (SOCBASEERR+43)
888 #define SOCESOCKTNOSUPPORT (SOCBASEERR+44)
889 #define SOCEOPNOTSUPP (SOCBASEERR+45)
890 #define SOCEPFNOSUPPORT (SOCBASEERR+46)
891 #define SOCEAFNOSUPPORT (SOCBASEERR+47)
892 #define SOCEADDRINUSE (SOCBASEERR+48)
893 #define SOCEADDRNOTAVAIL (SOCBASEERR+49)
894 #define SOCENETDOWN (SOCBASEERR+50)
895 #define SOCENETUNREACH (SOCBASEERR+51)
896 #define SOCENETRESET (SOCBASEERR+52)
897 #define SOCECONNABORTED (SOCBASEERR+53)
898 #define SOCECONNRESET (SOCBASEERR+54)
899 #define SOCENOBUFS (SOCBASEERR+55)
900 #define SOCEISCONN (SOCBASEERR+56)
901 #define SOCENOTCONN (SOCBASEERR+57)
902 #define SOCESHUTDOWN (SOCBASEERR+58)
903 #define SOCETOOMANYREFS (SOCBASEERR+59)
904 #define SOCETIMEDOUT (SOCBASEERR+60)
905 #define SOCECONNREFUSED (SOCBASEERR+61)
906 #define SOCELOOP (SOCBASEERR+62)
907 #define SOCENAMETOOLONG (SOCBASEERR+63)
908 #define SOCEHOSTDOWN (SOCBASEERR+64)
909 #define SOCEHOSTUNREACH (SOCBASEERR+65)
910 #define SOCENOTEMPTY (SOCBASEERR+66)
913 #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \
914 || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED \
915 || (s) == APR_OS_START_SYSERR + ERROR_SHARING_VIOLATION)
916 #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST \
917 || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED \
918 || (s) == APR_OS_START_SYSERR + ERROR_FILE_EXISTS \
919 || (s) == APR_OS_START_SYSERR + ERROR_ALREADY_EXISTS \
920 || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED)
921 #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG \
922 || (s) == APR_OS_START_SYSERR + ERROR_FILENAME_EXCED_RANGE \
923 || (s) == APR_OS_START_SYSERR + SOCENAMETOOLONG)
924 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \
925 || (s) == APR_OS_START_SYSERR + ERROR_FILE_NOT_FOUND \
926 || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \
927 || (s) == APR_OS_START_SYSERR + ERROR_NO_MORE_FILES \
928 || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED)
929 #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR)
930 #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \
931 || (s) == APR_OS_START_SYSERR + ERROR_DISK_FULL)
932 #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM)
933 #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE \
934 || (s) == APR_OS_START_SYSERR + ERROR_TOO_MANY_OPEN_FILES)
935 #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE)
936 #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF \
937 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE)
938 #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL \
939 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_PARAMETER \
940 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_FUNCTION)
941 #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE \
942 || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK)
943 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \
944 || (s) == APR_OS_START_SYSERR + ERROR_NO_DATA \
945 || (s) == APR_OS_START_SYSERR + SOCEWOULDBLOCK \
946 || (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION)
947 #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \
948 || (s) == APR_OS_START_SYSERR + SOCEINTR)
949 #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \
950 || (s) == APR_OS_START_SYSERR + SOCENOTSOCK)
951 #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \
952 || (s) == APR_OS_START_SYSERR + SOCECONNREFUSED)
953 #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \
954 || (s) == APR_OS_START_SYSERR + SOCEINPROGRESS)
955 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \
956 || (s) == APR_OS_START_SYSERR + SOCECONNABORTED)
957 #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \
958 || (s) == APR_OS_START_SYSERR + SOCECONNRESET)
960 #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \
961 || (s) == APR_OS_START_SYSERR + SOCETIMEDOUT)
962 #undef APR_STATUS_IS_TIMEUP
963 #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP \
964 || (s) == APR_OS_START_SYSERR + SOCETIMEDOUT)
965 #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \
966 || (s) == APR_OS_START_SYSERR + SOCEHOSTUNREACH)
967 #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \
968 || (s) == APR_OS_START_SYSERR + SOCENETUNREACH)
969 #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE)
970 #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE \
971 || (s) == APR_OS_START_SYSERR + ERROR_BROKEN_PIPE \
972 || (s) == APR_OS_START_SYSERR + SOCEPIPE)
973 #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV \
974 || (s) == APR_OS_START_SYSERR + ERROR_NOT_SAME_DEVICE)
975 #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY \
976 || (s) == APR_OS_START_SYSERR + ERROR_DIR_NOT_EMPTY \
977 || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED)
978 #define APR_STATUS_IS_EAFNOSUPPORT(s) ((s) == APR_AFNOSUPPORT \
979 || (s) == APR_OS_START_SYSERR + SOCEAFNOSUPPORT)
1010 #elif defined(WIN32) && !defined(DOXYGEN)
1012 #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR)
1013 #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR)
1015 #define apr_get_os_error() (APR_FROM_OS_ERROR(GetLastError()))
1016 #define apr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e)))
1020 #define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError()))
1021 #define apr_set_netos_error(e) (WSASetLastError(APR_TO_OS_ERROR(e)))
1024 #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \
1025 || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED \
1026 || (s) == APR_OS_START_SYSERR + ERROR_CANNOT_MAKE \
1027 || (s) == APR_OS_START_SYSERR + ERROR_CURRENT_DIRECTORY \
1028 || (s) == APR_OS_START_SYSERR + ERROR_DRIVE_LOCKED \
1029 || (s) == APR_OS_START_SYSERR + ERROR_FAIL_I24 \
1030 || (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION \
1031 || (s) == APR_OS_START_SYSERR + ERROR_LOCK_FAILED \
1032 || (s) == APR_OS_START_SYSERR + ERROR_NOT_LOCKED \
1033 || (s) == APR_OS_START_SYSERR + ERROR_NETWORK_ACCESS_DENIED \
1034 || (s) == APR_OS_START_SYSERR + ERROR_SHARING_VIOLATION)
1035 #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST \
1036 || (s) == APR_OS_START_SYSERR + ERROR_FILE_EXISTS \
1037 || (s) == APR_OS_START_SYSERR + ERROR_ALREADY_EXISTS)
1038 #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG \
1039 || (s) == APR_OS_START_SYSERR + ERROR_FILENAME_EXCED_RANGE \
1040 || (s) == APR_OS_START_SYSERR + WSAENAMETOOLONG)
1041 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \
1042 || (s) == APR_OS_START_SYSERR + ERROR_FILE_NOT_FOUND \
1043 || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \
1044 || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED \
1045 || (s) == APR_OS_START_SYSERR + ERROR_NO_MORE_FILES)
1046 #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR \
1047 || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \
1048 || (s) == APR_OS_START_SYSERR + ERROR_BAD_NETPATH \
1049 || (s) == APR_OS_START_SYSERR + ERROR_BAD_NET_NAME \
1050 || (s) == APR_OS_START_SYSERR + ERROR_BAD_PATHNAME \
1051 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DRIVE \
1052 || (s) == APR_OS_START_SYSERR + ERROR_DIRECTORY)
1053 #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \
1054 || (s) == APR_OS_START_SYSERR + ERROR_DISK_FULL)
1055 #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM \
1056 || (s) == APR_OS_START_SYSERR + ERROR_ARENA_TRASHED \
1057 || (s) == APR_OS_START_SYSERR + ERROR_NOT_ENOUGH_MEMORY \
1058 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_BLOCK \
1059 || (s) == APR_OS_START_SYSERR + ERROR_NOT_ENOUGH_QUOTA \
1060 || (s) == APR_OS_START_SYSERR + ERROR_OUTOFMEMORY)
1061 #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE \
1062 || (s) == APR_OS_START_SYSERR + ERROR_TOO_MANY_OPEN_FILES)
1063 #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE)
1064 #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF \
1065 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE \
1066 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_TARGET_HANDLE)
1067 #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL \
1068 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_ACCESS \
1069 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DATA \
1070 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_FUNCTION \
1071 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE \
1072 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_PARAMETER \
1073 || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK)
1074 #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE \
1075 || (s) == APR_OS_START_SYSERR + ERROR_SEEK_ON_DEVICE \
1076 || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK)
1077 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \
1078 || (s) == APR_OS_START_SYSERR + ERROR_NO_DATA \
1079 || (s) == APR_OS_START_SYSERR + ERROR_NO_PROC_SLOTS \
1080 || (s) == APR_OS_START_SYSERR + ERROR_NESTING_NOT_ALLOWED \
1081 || (s) == APR_OS_START_SYSERR + ERROR_MAX_THRDS_REACHED \
1082 || (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION \
1083 || (s) == APR_OS_START_SYSERR + WSAEWOULDBLOCK)
1084 #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \
1085 || (s) == APR_OS_START_SYSERR + WSAEINTR)
1086 #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \
1087 || (s) == APR_OS_START_SYSERR + WSAENOTSOCK)
1088 #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \
1089 || (s) == APR_OS_START_SYSERR + WSAECONNREFUSED)
1090 #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \
1091 || (s) == APR_OS_START_SYSERR + WSAEINPROGRESS)
1092 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \
1093 || (s) == APR_OS_START_SYSERR + WSAECONNABORTED)
1094 #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \
1095 || (s) == APR_OS_START_SYSERR + ERROR_NETNAME_DELETED \
1096 || (s) == APR_OS_START_SYSERR + WSAECONNRESET)
1098 #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \
1099 || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \
1100 || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT)
1101 #undef APR_STATUS_IS_TIMEUP
1102 #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP \
1103 || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \
1104 || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT)
1105 #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \
1106 || (s) == APR_OS_START_SYSERR + WSAEHOSTUNREACH)
1107 #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \
1108 || (s) == APR_OS_START_SYSERR + WSAENETUNREACH)
1109 #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE \
1110 || (s) == APR_OS_START_SYSERR + ERROR_EXE_MACHINE_TYPE_MISMATCH \
1111 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DLL \
1112 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_MODULETYPE \
1113 || (s) == APR_OS_START_SYSERR + ERROR_BAD_EXE_FORMAT \
1114 || (s) == APR_OS_START_SYSERR + ERROR_INVALID_EXE_SIGNATURE \
1115 || (s) == APR_OS_START_SYSERR + ERROR_FILE_CORRUPT \
1116 || (s) == APR_OS_START_SYSERR + ERROR_BAD_FORMAT)
1117 #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE \
1118 || (s) == APR_OS_START_SYSERR + ERROR_BROKEN_PIPE)
1119 #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV \
1120 || (s) == APR_OS_START_SYSERR + ERROR_NOT_SAME_DEVICE)
1121 #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY \
1122 || (s) == APR_OS_START_SYSERR + ERROR_DIR_NOT_EMPTY)
1123 #define APR_STATUS_IS_EAFNOSUPPORT(s) ((s) == APR_EAFNOSUPPORT \
1124 || (s) == APR_OS_START_SYSERR + WSAEAFNOSUPPORT)
1126 #elif defined(NETWARE) && defined(USE_WINSOCK) && !defined(DOXYGEN)
1128 #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR)
1129 #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR)
1131 #define apr_get_os_error() (errno)
1132 #define apr_set_os_error(e) (errno = (e))
1135 #define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError()))
1136 #define apr_set_netos_error(e) (WSASetLastError(APR_TO_OS_ERROR(e)))
1139 #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES)
1140 #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST)
1141 #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG)
1142 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT)
1143 #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR)
1144 #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC)
1145 #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM)
1146 #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE)
1147 #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE)
1148 #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF)
1149 #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL)
1150 #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE)
1152 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \
1153 || (s) == EWOULDBLOCK \
1154 || (s) == APR_OS_START_SYSERR + WSAEWOULDBLOCK)
1155 #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \
1156 || (s) == APR_OS_START_SYSERR + WSAEINTR)
1157 #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \
1158 || (s) == APR_OS_START_SYSERR + WSAENOTSOCK)
1159 #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \
1160 || (s) == APR_OS_START_SYSERR + WSAECONNREFUSED)
1161 #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \
1162 || (s) == APR_OS_START_SYSERR + WSAEINPROGRESS)
1163 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \
1164 || (s) == APR_OS_START_SYSERR + WSAECONNABORTED)
1165 #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \
1166 || (s) == APR_OS_START_SYSERR + WSAECONNRESET)
1168 #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \
1169 || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \
1170 || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT)
1171 #undef APR_STATUS_IS_TIMEUP
1172 #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP \
1173 || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \
1174 || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT)
1175 #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \
1176 || (s) == APR_OS_START_SYSERR + WSAEHOSTUNREACH)
1177 #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \
1178 || (s) == APR_OS_START_SYSERR + WSAENETUNREACH)
1179 #define APR_STATUS_IS_ENETDOWN(s) ((s) == APR_OS_START_SYSERR + WSAENETDOWN)
1180 #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE)
1181 #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE)
1182 #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV)
1183 #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY)
1184 #define APR_STATUS_IS_EAFNOSUPPORT(s) ((s) == APR_EAFNOSUPPORT \
1185 || (s) == APR_OS_START_SYSERR + WSAEAFNOSUPPORT)
1192 #define APR_FROM_OS_ERROR(e) (e)
1193 #define APR_TO_OS_ERROR(e) (e)
1195 #define apr_get_os_error() (errno)
1196 #define apr_set_os_error(e) (errno = (e))
1200 #define apr_get_netos_error() (errno)
1201 #define apr_set_netos_error(e) (errno = (e))
1209 #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES)
1211 #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST)
1213 #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG)
1221 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \
1222 || (s) == EMVSCATLG)
1224 #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT)
1227 #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR)
1230 #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \
1233 #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC)
1236 #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM)
1238 #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE)
1240 #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE)
1242 #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF)
1244 #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL)
1246 #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE)
1249 #if !defined(EWOULDBLOCK) || !defined(EAGAIN)
1250 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN)
1251 #elif (EWOULDBLOCK == EAGAIN)
1252 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN)
1254 #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \
1255 || (s) == EWOULDBLOCK)
1259 #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR)
1261 #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK)
1263 #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED)
1265 #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS)
1279 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \
1282 #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED)
1286 #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET)
1289 #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT)
1291 #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH)
1293 #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH)
1295 #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE)
1297 #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE)
1299 #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV)
1301 #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY || \
1304 #define APR_STATUS_IS_EAFNOSUPPORT(s) ((s) == APR_EAFNOSUPPORT)
char * apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize)
APR Platform Definitions.
int apr_status_t
Definition: apr_errno.h:44