1 //===----------------------- config_elast.h -------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef _LIBCPP_CONFIG_ELAST
10 #define _LIBCPP_CONFIG_ELAST
11 
12 #include <__config>
13 
14 #if defined(_LIBCPP_MSVCRT_LIKE)
15 #include <stdlib.h>
16 #else
17 #include <errno.h>
18 #endif
19 
20 #if defined(ELAST)
21 #define _LIBCPP_ELAST ELAST
22 #elif defined(_NEWLIB_VERSION)
23 #define _LIBCPP_ELAST __ELASTERROR
24 #elif defined(__Fuchsia__)
25 // No _LIBCPP_ELAST needed on Fuchsia
26 #elif defined(__linux__) || defined(_LIBCPP_HAS_MUSL_LIBC)
27 #define _LIBCPP_ELAST 4095
28 #elif defined(__APPLE__)
29 // No _LIBCPP_ELAST needed on Apple
30 #elif defined(__sun__)
31 #define _LIBCPP_ELAST ESTALE
32 #elif defined(_LIBCPP_MSVCRT_LIKE)
33 #define _LIBCPP_ELAST (_sys_nerr - 1)
34 #else
35 // Warn here so that the person doing the libcxx port has an easier time:
36 #warning ELAST for this platform not yet implemented
37 #endif
38 
39 #endif // _LIBCPP_CONFIG_ELAST
40