1 // POSIX-specific implementation details of system_error_category
3 // Copyright 2018 Peter Dimov
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
19 inline bool is_generic_value( int ev ) BOOST_NOEXCEPT
23 static int const gen[] =
26 address_family_not_supported,
28 address_not_available,
30 argument_list_too_long,
31 argument_out_of_domain,
37 connection_already_in_progress,
41 destination_address_required,
42 device_or_resource_busy,
44 executable_format_error,
48 function_not_supported,
51 illegal_byte_sequence,
52 inappropriate_io_control_operation,
71 no_such_device_or_address,
73 no_such_file_or_directory,
82 operation_in_progress,
83 operation_not_permitted,
84 operation_not_supported,
85 operation_would_block,
89 protocol_not_supported,
90 read_only_file_system,
91 resource_deadlock_would_occur,
92 resource_unavailable_try_again,
94 state_not_recoverable,
98 too_many_files_open_in_system,
101 too_many_symbolic_link_levels,
106 int const n = sizeof( gen ) / sizeof( gen[0] );
108 for( int i = 0; i < n; ++i )
110 if( ev == gen[ i ] ) return true;
116 inline error_condition system_category_default_error_condition_posix( int ev ) BOOST_NOEXCEPT
118 if( is_generic_value( ev ) )
120 return error_condition( ev, generic_category() );
124 return error_condition( ev, system_category() );
128 } // namespace detail
130 } // namespace system