1// Specific definitions for generic platforms  -*- C++ -*-
2
3// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
4//
5// This file is part of the GNU ISO C++ Library.  This library is free
6// software; you can redistribute it and/or modify it under the
7// terms of the GNU General Public License as published by the
8// Free Software Foundation; either version 3, or (at your option)
9// any later version.
10
11// This library is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14// GNU General Public License for more details.
15
16// Under Section 7 of GPL version 3, you are granted additional
17// permissions described in the GCC Runtime Library Exception, version
18// 3.1, as published by the Free Software Foundation.
19
20// You should have received a copy of the GNU General Public License and
21// a copy of the GCC Runtime Library Exception along with this program;
22// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
23// <http://www.gnu.org/licenses/>.
24
25/** @file error_constants.h
26 *  This is an internal header file, included by other library headers.
27 *  You should not attempt to use it directly.
28 */
29
30#ifndef _GLIBCXX_ERROR_CONSTANTS
31#define _GLIBCXX_ERROR_CONSTANTS 1
32
33#include <bits/c++config.h>
34#include <cerrno>
35
36_GLIBCXX_BEGIN_NAMESPACE(std)
37
38  enum class errc
39    {
40      address_family_not_supported = 		EAFNOSUPPORT,
41      address_in_use = 				EADDRINUSE,
42      address_not_available = 			EADDRNOTAVAIL,
43      already_connected = 			EISCONN,
44      argument_list_too_long = 			E2BIG,
45      argument_out_of_domain = 			EDOM,
46      bad_address = 				EFAULT,
47      bad_file_descriptor = 			EBADF,
48
49#ifdef _GLIBCXX_HAVE_EBADMSG
50      bad_message = 				EBADMSG,
51#endif
52
53      broken_pipe = 				EPIPE,
54      connection_aborted = 			ECONNABORTED,
55      connection_already_in_progress = 		EALREADY,
56      connection_refused = 			ECONNREFUSED,
57      connection_reset = 			ECONNRESET,
58      cross_device_link = 			EXDEV,
59      destination_address_required = 		EDESTADDRREQ,
60      device_or_resource_busy = 		EBUSY,
61      directory_not_empty = 			ENOTEMPTY,
62      executable_format_error = 		ENOEXEC,
63      file_exists = 	       			EEXIST,
64      file_too_large = 				EFBIG,
65      filename_too_long = 			ENAMETOOLONG,
66      function_not_supported = 			ENOSYS,
67      host_unreachable = 			EHOSTUNREACH,
68
69#ifdef _GLIBCXX_HAVE_EIDRM
70      identifier_removed = 			EIDRM,
71#endif
72
73      illegal_byte_sequence = 			EILSEQ,
74      inappropriate_io_control_operation = 	ENOTTY,
75      interrupted = 				EINTR,
76      invalid_argument = 			EINVAL,
77      invalid_seek = 				ESPIPE,
78      io_error = 				EIO,
79      is_a_directory = 				EISDIR,
80      message_size = 				EMSGSIZE,
81      network_down = 				ENETDOWN,
82      network_reset = 				ENETRESET,
83      network_unreachable = 			ENETUNREACH,
84      no_buffer_space = 			ENOBUFS,
85      no_child_process = 			ECHILD,
86
87#ifdef _GLIBCXX_HAVE_ENOLINK
88      no_link = 				ENOLINK,
89#endif
90
91      no_lock_available = 			ENOLCK,
92
93#ifdef _GLIBCXX_HAVE_ENODATA
94      no_message_available = 			ENODATA,
95#endif
96
97      no_message = 				ENOMSG,
98      no_protocol_option = 			ENOPROTOOPT,
99      no_space_on_device = 			ENOSPC,
100
101#ifdef _GLIBCXX_HAVE_ENOSR
102      no_stream_resources = 			ENOSR,
103#endif
104
105      no_such_device_or_address = 		ENXIO,
106      no_such_device = 				ENODEV,
107      no_such_file_or_directory = 		ENOENT,
108      no_such_process = 			ESRCH,
109      not_a_directory = 			ENOTDIR,
110      not_a_socket = 				ENOTSOCK,
111
112#ifdef _GLIBCXX_HAVE_ENOSTR
113      not_a_stream = 				ENOSTR,
114#endif
115
116      not_connected = 				ENOTCONN,
117      not_enough_memory = 			ENOMEM,
118
119#ifdef _GLIBCXX_HAVE_ENOTSUP
120      not_supported = 				ENOTSUP,
121#endif
122
123#ifdef _GLIBCXX_HAVE_ECANCELED
124      operation_canceled = 			ECANCELED,
125#endif
126
127      operation_in_progress = 			EINPROGRESS,
128      operation_not_permitted = 		EPERM,
129      operation_not_supported = 		EOPNOTSUPP,
130      operation_would_block = 			EWOULDBLOCK,
131
132#ifdef _GLIBCXX_HAVE_EOWNERDEAD
133      owner_dead = 				EOWNERDEAD,
134#endif
135
136      permission_denied = 			EACCES,
137
138#ifdef _GLIBCXX_HAVE_EPROTO
139      protocol_error = 				EPROTO,
140#endif
141
142      protocol_not_supported = 			EPROTONOSUPPORT,
143      read_only_file_system = 			EROFS,
144      resource_deadlock_would_occur = 		EDEADLK,
145      resource_unavailable_try_again = 		EAGAIN,
146      result_out_of_range = 			ERANGE,
147
148#ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE
149      state_not_recoverable = 			ENOTRECOVERABLE,
150#endif
151
152#ifdef _GLIBCXX_HAVE_ETIME
153      stream_timeout = 				ETIME,
154#endif
155
156#ifdef _GLIBCXX_HAVE_ETXTBSY
157      text_file_busy = 				ETXTBSY,
158#endif
159
160      timed_out = 				ETIMEDOUT,
161      too_many_files_open_in_system = 		ENFILE,
162      too_many_files_open = 			EMFILE,
163      too_many_links = 				EMLINK,
164      too_many_symbolic_link_levels = 		ELOOP,
165
166#ifdef _GLIBCXX_HAVE_EOVERFLOW
167      value_too_large = 			EOVERFLOW,
168#endif
169
170      wrong_protocol_type = 			EPROTOTYPE
171    };
172
173_GLIBCXX_END_NAMESPACE
174
175#endif
176