cerrno revision 227825
1227825Stheraven// -*- C++ -*- 2227825Stheraven//===-------------------------- cerrno ------------------------------------===// 3227825Stheraven// 4227825Stheraven// The LLVM Compiler Infrastructure 5227825Stheraven// 6227825Stheraven// This file is dual licensed under the MIT and the University of Illinois Open 7227825Stheraven// Source Licenses. See LICENSE.TXT for details. 8227825Stheraven// 9227825Stheraven//===----------------------------------------------------------------------===// 10227825Stheraven 11227825Stheraven#ifndef _LIBCPP_CERRNO 12227825Stheraven#define _LIBCPP_CERRNO 13227825Stheraven 14227825Stheraven/* 15227825Stheraven cerrno synopsis 16227825Stheraven 17227825StheravenMacros: 18227825Stheraven 19227825Stheraven EDOM 20227825Stheraven EILSEQ // C99 21227825Stheraven ERANGE 22227825Stheraven errno 23227825Stheraven 24227825Stheraven*/ 25227825Stheraven 26227825Stheraven#include <__config> 27227825Stheraven#include <errno.h> 28227825Stheraven 29227825Stheraven#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) 30227825Stheraven#pragma GCC system_header 31227825Stheraven#endif 32227825Stheraven 33227825Stheraven#if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) 34227825Stheraven 35227825Stheraven#ifdef ELAST 36227825Stheraven 37227825Stheravenconst int __elast1 = ELAST+1; 38227825Stheravenconst int __elast2 = ELAST+2; 39227825Stheraven 40227825Stheraven#else 41227825Stheraven 42227825Stheravenconst int __elast1 = 104; 43227825Stheravenconst int __elast2 = 105; 44227825Stheraven 45227825Stheraven#endif 46227825Stheraven 47227825Stheraven#ifdef ENOTRECOVERABLE 48227825Stheraven 49227825Stheraven#define EOWNERDEAD __elast1 50227825Stheraven 51227825Stheraven#ifdef ELAST 52227825Stheraven#undef ELAST 53227825Stheraven#define ELAST EOWNERDEAD 54227825Stheraven#endif 55227825Stheraven 56227825Stheraven#elif defined(EOWNERDEAD) 57227825Stheraven 58227825Stheraven#define ENOTRECOVERABLE __elast1 59227825Stheraven#ifdef ELAST 60227825Stheraven#undef ELAST 61227825Stheraven#define ELAST ENOTRECOVERABLE 62227825Stheraven#endif 63227825Stheraven 64227825Stheraven#else // defined(EOWNERDEAD) 65227825Stheraven 66227825Stheraven#define EOWNERDEAD __elast1 67227825Stheraven#define ENOTRECOVERABLE __elast2 68227825Stheraven#ifdef ELAST 69227825Stheraven#undef ELAST 70227825Stheraven#define ELAST ENOTRECOVERABLE 71227825Stheraven#endif 72227825Stheraven 73227825Stheraven#endif // defined(EOWNERDEAD) 74227825Stheraven 75227825Stheraven#endif // !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) 76227825Stheraven 77227825Stheraven// supply errno values likely to be missing, particularly on Windows 78227825Stheraven 79227825Stheraven#ifndef EAFNOSUPPORT 80227825Stheraven#define EAFNOSUPPORT 9901 81227825Stheraven#endif 82227825Stheraven 83227825Stheraven#ifndef EADDRINUSE 84227825Stheraven#define EADDRINUSE 9902 85227825Stheraven#endif 86227825Stheraven 87227825Stheraven#ifndef EADDRNOTAVAIL 88227825Stheraven#define EADDRNOTAVAIL 9903 89227825Stheraven#endif 90227825Stheraven 91227825Stheraven#ifndef EISCONN 92227825Stheraven#define EISCONN 9904 93227825Stheraven#endif 94227825Stheraven 95227825Stheraven#ifndef EBADMSG 96227825Stheraven#define EBADMSG 9905 97227825Stheraven#endif 98227825Stheraven 99227825Stheraven#ifndef ECONNABORTED 100227825Stheraven#define ECONNABORTED 9906 101227825Stheraven#endif 102227825Stheraven 103227825Stheraven#ifndef EALREADY 104227825Stheraven#define EALREADY 9907 105227825Stheraven#endif 106227825Stheraven 107227825Stheraven#ifndef ECONNREFUSED 108227825Stheraven#define ECONNREFUSED 9908 109227825Stheraven#endif 110227825Stheraven 111227825Stheraven#ifndef ECONNRESET 112227825Stheraven#define ECONNRESET 9909 113227825Stheraven#endif 114227825Stheraven 115227825Stheraven#ifndef EDESTADDRREQ 116227825Stheraven#define EDESTADDRREQ 9910 117227825Stheraven#endif 118227825Stheraven 119227825Stheraven#ifndef EHOSTUNREACH 120227825Stheraven#define EHOSTUNREACH 9911 121227825Stheraven#endif 122227825Stheraven 123227825Stheraven#ifndef EIDRM 124227825Stheraven#define EIDRM 9912 125227825Stheraven#endif 126227825Stheraven 127227825Stheraven#ifndef EMSGSIZE 128227825Stheraven#define EMSGSIZE 9913 129227825Stheraven#endif 130227825Stheraven 131227825Stheraven#ifndef ENETDOWN 132227825Stheraven#define ENETDOWN 9914 133227825Stheraven#endif 134227825Stheraven 135227825Stheraven#ifndef ENETRESET 136227825Stheraven#define ENETRESET 9915 137227825Stheraven#endif 138227825Stheraven 139227825Stheraven#ifndef ENETUNREACH 140227825Stheraven#define ENETUNREACH 9916 141227825Stheraven#endif 142227825Stheraven 143227825Stheraven#ifndef ENOBUFS 144227825Stheraven#define ENOBUFS 9917 145227825Stheraven#endif 146227825Stheraven 147227825Stheraven#ifndef ENOLINK 148227825Stheraven#define ENOLINK 9918 149227825Stheraven#endif 150227825Stheraven 151227825Stheraven#ifndef ENODATA 152227825Stheraven#define ENODATA 9919 153227825Stheraven#endif 154227825Stheraven 155227825Stheraven#ifndef ENOMSG 156227825Stheraven#define ENOMSG 9920 157227825Stheraven#endif 158227825Stheraven 159227825Stheraven#ifndef ENOPROTOOPT 160227825Stheraven#define ENOPROTOOPT 9921 161227825Stheraven#endif 162227825Stheraven 163227825Stheraven#ifndef ENOSR 164227825Stheraven#define ENOSR 9922 165227825Stheraven#endif 166227825Stheraven 167227825Stheraven#ifndef ENOTSOCK 168227825Stheraven#define ENOTSOCK 9923 169227825Stheraven#endif 170227825Stheraven 171227825Stheraven#ifndef ENOSTR 172227825Stheraven#define ENOSTR 9924 173227825Stheraven#endif 174227825Stheraven 175227825Stheraven#ifndef ENOTCONN 176227825Stheraven#define ENOTCONN 9925 177227825Stheraven#endif 178227825Stheraven 179227825Stheraven#ifndef ENOTSUP 180227825Stheraven#define ENOTSUP 9926 181227825Stheraven#endif 182227825Stheraven 183227825Stheraven#ifndef ECANCELED 184227825Stheraven#define ECANCELED 9927 185227825Stheraven#endif 186227825Stheraven 187227825Stheraven#ifndef EINPROGRESS 188227825Stheraven#define EINPROGRESS 9928 189227825Stheraven#endif 190227825Stheraven 191227825Stheraven#ifndef EOPNOTSUPP 192227825Stheraven#define EOPNOTSUPP 9929 193227825Stheraven#endif 194227825Stheraven 195227825Stheraven#ifndef EWOULDBLOCK 196227825Stheraven#define EWOULDBLOCK 9930 197227825Stheraven#endif 198227825Stheraven 199227825Stheraven#ifndef EOWNERDEAD 200227825Stheraven#define EOWNERDEAD 9931 201227825Stheraven#endif 202227825Stheraven 203227825Stheraven#ifndef EPROTO 204227825Stheraven#define EPROTO 9932 205227825Stheraven#endif 206227825Stheraven 207227825Stheraven#ifndef EPROTONOSUPPORT 208227825Stheraven#define EPROTONOSUPPORT 9933 209227825Stheraven#endif 210227825Stheraven 211227825Stheraven#ifndef ENOTRECOVERABLE 212227825Stheraven#define ENOTRECOVERABLE 9934 213227825Stheraven#endif 214227825Stheraven 215227825Stheraven#ifndef ETIME 216227825Stheraven#define ETIME 9935 217227825Stheraven#endif 218227825Stheraven 219227825Stheraven#ifndef ETXTBSY 220227825Stheraven#define ETXTBSY 9936 221227825Stheraven#endif 222227825Stheraven 223227825Stheraven#ifndef ETIMEDOUT 224227825Stheraven#define ETIMEDOUT 9938 225227825Stheraven#endif 226227825Stheraven 227227825Stheraven#ifndef ELOOP 228227825Stheraven#define ELOOP 9939 229227825Stheraven#endif 230227825Stheraven 231227825Stheraven#ifndef EOVERFLOW 232227825Stheraven#define EOVERFLOW 9940 233227825Stheraven#endif 234227825Stheraven 235227825Stheraven#ifndef EPROTOTYPE 236227825Stheraven#define EPROTOTYPE 9941 237227825Stheraven#endif 238227825Stheraven 239227825Stheraven#ifndef ENOSYS 240227825Stheraven#define ENOSYS 9942 241227825Stheraven#endif 242227825Stheraven 243227825Stheraven#ifndef EINVAL 244227825Stheraven#define EINVAL 9943 245227825Stheraven#endif 246227825Stheraven 247227825Stheraven#ifndef ERANGE 248227825Stheraven#define ERANGE 9944 249227825Stheraven#endif 250227825Stheraven 251227825Stheraven#ifndef EILSEQ 252227825Stheraven#define EILSEQ 9945 253227825Stheraven#endif 254227825Stheraven 255227825Stheraven// Windows Mobile doesn't appear to define these: 256227825Stheraven 257227825Stheraven#ifndef E2BIG 258227825Stheraven#define E2BIG 9946 259227825Stheraven#endif 260227825Stheraven 261227825Stheraven#ifndef EDOM 262227825Stheraven#define EDOM 9947 263227825Stheraven#endif 264227825Stheraven 265227825Stheraven#ifndef EFAULT 266227825Stheraven#define EFAULT 9948 267227825Stheraven#endif 268227825Stheraven 269227825Stheraven#ifndef EBADF 270227825Stheraven#define EBADF 9949 271227825Stheraven#endif 272227825Stheraven 273227825Stheraven#ifndef EPIPE 274227825Stheraven#define EPIPE 9950 275227825Stheraven#endif 276227825Stheraven 277227825Stheraven#ifndef EXDEV 278227825Stheraven#define EXDEV 9951 279227825Stheraven#endif 280227825Stheraven 281227825Stheraven#ifndef EBUSY 282227825Stheraven#define EBUSY 9952 283227825Stheraven#endif 284227825Stheraven 285227825Stheraven#ifndef ENOTEMPTY 286227825Stheraven#define ENOTEMPTY 9953 287227825Stheraven#endif 288227825Stheraven 289227825Stheraven#ifndef ENOEXEC 290227825Stheraven#define ENOEXEC 9954 291227825Stheraven#endif 292227825Stheraven 293227825Stheraven#ifndef EEXIST 294227825Stheraven#define EEXIST 9955 295227825Stheraven#endif 296227825Stheraven 297227825Stheraven#ifndef EFBIG 298227825Stheraven#define EFBIG 9956 299227825Stheraven#endif 300227825Stheraven 301227825Stheraven#ifndef ENAMETOOLONG 302227825Stheraven#define ENAMETOOLONG 9957 303227825Stheraven#endif 304227825Stheraven 305227825Stheraven#ifndef ENOTTY 306227825Stheraven#define ENOTTY 9958 307227825Stheraven#endif 308227825Stheraven 309227825Stheraven#ifndef EINTR 310227825Stheraven#define EINTR 9959 311227825Stheraven#endif 312227825Stheraven 313227825Stheraven#ifndef ESPIPE 314227825Stheraven#define ESPIPE 9960 315227825Stheraven#endif 316227825Stheraven 317227825Stheraven#ifndef EIO 318227825Stheraven#define EIO 9961 319227825Stheraven#endif 320227825Stheraven 321227825Stheraven#ifndef EISDIR 322227825Stheraven#define EISDIR 9962 323227825Stheraven#endif 324227825Stheraven 325227825Stheraven#ifndef ECHILD 326227825Stheraven#define ECHILD 9963 327227825Stheraven#endif 328227825Stheraven 329227825Stheraven#ifndef ENOLCK 330227825Stheraven#define ENOLCK 9964 331227825Stheraven#endif 332227825Stheraven 333227825Stheraven#ifndef ENOSPC 334227825Stheraven#define ENOSPC 9965 335227825Stheraven#endif 336227825Stheraven 337227825Stheraven#ifndef ENXIO 338227825Stheraven#define ENXIO 9966 339227825Stheraven#endif 340227825Stheraven 341227825Stheraven#ifndef ENODEV 342227825Stheraven#define ENODEV 9967 343227825Stheraven#endif 344227825Stheraven 345227825Stheraven#ifndef ENOENT 346227825Stheraven#define ENOENT 9968 347227825Stheraven#endif 348227825Stheraven 349227825Stheraven#ifndef ESRCH 350227825Stheraven#define ESRCH 9969 351227825Stheraven#endif 352227825Stheraven 353227825Stheraven#ifndef ENOTDIR 354227825Stheraven#define ENOTDIR 9970 355227825Stheraven#endif 356227825Stheraven 357227825Stheraven#ifndef ENOMEM 358227825Stheraven#define ENOMEM 9971 359227825Stheraven#endif 360227825Stheraven 361227825Stheraven#ifndef EPERM 362227825Stheraven#define EPERM 9972 363227825Stheraven#endif 364227825Stheraven 365227825Stheraven#ifndef EACCES 366227825Stheraven#define EACCES 9973 367227825Stheraven#endif 368227825Stheraven 369227825Stheraven#ifndef EROFS 370227825Stheraven#define EROFS 9974 371227825Stheraven#endif 372227825Stheraven 373227825Stheraven#ifndef EDEADLK 374227825Stheraven#define EDEADLK 9975 375227825Stheraven#endif 376227825Stheraven 377227825Stheraven#ifndef EAGAIN 378227825Stheraven#define EAGAIN 9976 379227825Stheraven#endif 380227825Stheraven 381227825Stheraven#ifndef ENFILE 382227825Stheraven#define ENFILE 9977 383227825Stheraven#endif 384227825Stheraven 385227825Stheraven#ifndef EMFILE 386227825Stheraven#define EMFILE 9978 387227825Stheraven#endif 388227825Stheraven 389227825Stheraven#ifndef EMLINK 390227825Stheraven#define EMLINK 9979 391227825Stheraven#endif 392227825Stheraven 393227825Stheraven#endif // _LIBCPP_CERRNO 394