1 // boost/system/linux_error.hpp -------------------------------------------//
3 // Copyright Beman Dawes 2007
5 // Distributed under the Boost Software License, Version 1.0. (See accompanying
6 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 // See library home page at http://www.boost.org/libs/system
10 #ifndef BOOST_SYSTEM_LINUX_ERROR_HPP
11 #define BOOST_SYSTEM_LINUX_ERROR_HPP
13 #include <boost/config/pragma_message.hpp>
15 #if !defined(BOOST_ALLOW_DEPRECATED_HEADERS)
16 BOOST_PRAGMA_MESSAGE("This header is deprecated and is slated for removal."
17 " If you want it retained, please open an issue in github.com/boostorg/system.")
20 // This header is effectively empty for compiles on operating systems where
21 // it is not applicable.
23 #if defined(linux) || defined(__linux) || defined(__linux__)
25 #include <boost/system/error_code.hpp>
31 // To construct an error_code after a API error:
33 // error_code( errno, system_category() )
35 // User code should use the portable "posix" enums for POSIX errors; this
36 // allows such code to be portable to non-POSIX systems. For the non-POSIX
37 // errno values that POSIX-based systems typically provide in addition to
38 // POSIX values, use the system specific enums below.
44 advertise_error = EADV,
46 bad_file_number = EBADFD,
47 bad_font_format = EBFONT,
48 bad_request_code = EBADRQC,
49 bad_request_descriptor = EBADR,
51 channel_range = ECHRNG,
52 communication_error = ECOMM,
53 dot_dot_error = EDOTDOT,
54 exchange_full = EXFULL,
55 host_down = EHOSTDOWN,
56 is_named_file_type= EISNAM,
57 key_expired = EKEYEXPIRED,
58 key_rejected = EKEYREJECTED,
59 key_revoked = EKEYREVOKED,
61 level2_no_syncronized= EL2NSYNC,
63 level3_reset = EL3RST,
65 medium_type = EMEDIUMTYPE,
67 no_block_device = ENOTBLK,
70 no_medium = ENOMEDIUM,
74 not_named_file_type= ENOTNAM,
75 not_recoverable = ENOTRECOVERABLE,
76 not_unique = ENOTUNIQ,
77 owner_dead = EOWNERDEAD,
78 protocol_no_supported = EPFNOSUPPORT,
79 remote_address_changed = EREMCHG,
80 remote_io_error = EREMOTEIO,
81 remote_object = EREMOTE,
82 restart_needed = ERESTART,
83 shared_library_access = ELIBACC,
84 shared_library_bad = ELIBBAD,
85 shared_library_execute = ELIBEXEC,
86 shared_library_max_ = ELIBMAX,
87 shared_library_section= ELIBSCN,
89 socket_type_not_supported = ESOCKTNOSUPPORT,
90 srmount_error = ESRMNT,
91 stream_pipe_error = ESTRPIPE,
92 too_many_references = ETOOMANYREFS,
93 too_many_users = EUSERS,
97 } // namespace linux_error
99 # ifdef BOOST_SYSTEM_ENABLE_DEPRECATED
100 namespace Linux = linux_error;
103 template<> struct is_error_code_enum<linux_error::linux_errno>
104 { static const bool value = true; };
106 namespace linux_error
108 inline error_code make_error_code( linux_errno e )
109 { return error_code( e, system_category() ); }
112 } // namespace system
117 #endif // BOOST_SYSTEM_LINUX_ERROR_HPP