<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Issue 3869: Deprecate std::errc constants related to UNIX STREAMS</title>
<meta property="og:title" content="Issue 3869: Deprecate std::errc constants related to UNIX STREAMS">
<meta property="og:description" content="C++ library issue. Status: C++23">
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue3869.html">
<meta property="og:type" content="website">
<meta property="og:image" content="http://cplusplus.github.io/LWG/images/cpp_logo.png">
<meta property="og:image:alt" content="C++ logo">
<style>
  p {text-align:justify}
  li {text-align:justify}
  pre code.backtick::before { content: "`" }
  pre code.backtick::after { content: "`" }
  blockquote.note
  {
    background-color:#E0E0E0;
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 1px;
    padding-bottom: 1px;
  }
  ins {background-color:#A0FFA0}
  del {background-color:#FFA0A0}
  table.issues-index { border: 1px solid; border-collapse: collapse; }
  table.issues-index th { text-align: center; padding: 4px; border: 1px solid; }
  table.issues-index td { padding: 4px; border: 1px solid; }
  table.issues-index td:nth-child(1) { text-align: right; }
  table.issues-index td:nth-child(2) { text-align: left; }
  table.issues-index td:nth-child(3) { text-align: left; }
  table.issues-index td:nth-child(4) { text-align: left; }
  table.issues-index td:nth-child(5) { text-align: center; }
  table.issues-index td:nth-child(6) { text-align: center; }
  table.issues-index td:nth-child(7) { text-align: left; }
  table.issues-index td:nth-child(5) span.no-pr { color: red; }
  @media (prefers-color-scheme: dark) {
     html {
        color: #ddd;
        background-color: black;
     }
     ins {
        background-color: #225522
     }
     del {
        background-color: #662222
     }
     a {
        color: #6af
     }
     a:visited {
        color: #6af
     }
     blockquote.note
     {
        background-color: rgba(255, 255, 255, .10)
     }
  }
</style>
</head>
<body>
<hr>
<p><em>This page is a snapshot from the LWG issues list, see the <a href="lwg-active.html">Library Active Issues List</a> for more information and the meaning of <a href="lwg-active.html#C++23">C++23</a> status.</em></p>
<h3 id="3869"><a href="lwg-defects.html#3869">3869</a>. Deprecate <code>std::errc</code> constants related to UNIX STREAMS</h3>
<p><b>Section:</b> 19.5.2 <a href="https://wg21.link/system.error.syn">[system.error.syn]</a> <b>Status:</b> <a href="lwg-active.html#C++23">C++23</a>
 <b>Submitter:</b> Jonathan Wakely <b>Opened:</b> 2023-01-30 <b>Last modified:</b> 2023-11-22</p>
<p><b>Priority: </b>Not Prioritized
</p>
<p><b>View all other</b> <a href="lwg-index.html#system.error.syn">issues</a> in [system.error.syn].</p>
<p><b>View all issues with</b> <a href="lwg-status.html#C++23">C++23</a> status.</p>
<p><b>Discussion:</b></p>
<p>
This is the resolution for NB comment <b><a href="https://github.com/cplusplus/nbballot/issues/444">GB-084</a></b>
</p>
<p>
The error numbers
<code>ENODATA</code>, <code>ENOSR</code>, <code>ENOSTR</code> and <code>ETIME</code>
are all marked "obsolecent" in POSIX 2017 (the current normative reference for C++)
and they are absent in the current POSIX 202x draft.
They related to the obsolete STREAMS API,
which was optional and not required for conformance to the previous POSIX standard
(because popular unix-like systems refused to implement it).
C++11 added those error numbers to <code>&lt;errno.h&gt;</code>
and also defined corresponding <code>errc</code> enumerators:
<code>errc::no_message_available</code>,
<code>errc::no_stream_resources</code>,
<code>errc::not_a_stream</code> and
<code>errc::stream_timeout</code>.
</p>
<p>
Given the obsolescent status of those constants in the current normative reference
and their absence from the next POSIX standard, WG21 should consider deprecating them now.
A deprecation period will allow removing them when C++ is eventually rebased to a new POSIX standard.
Otherwise C++ will be left with dangling references to
<code>ENODATA</code>, <code>ENOSR</code>, <code>ENOSTR</code> and <code>ETIME</code>
that are not defined in the POSIX reference.
</p>
<p>
After a period of deprecation they can be removed from Annex D,
and the names added to 16.4.5.3.2 <a href="https://wg21.link/zombie.names">[zombie.names]</a> so that implementations
can continue to define them if they need to.
</p>

<p><i>[Issaquah 2023-02-06; LWG]</i></p>

<p>Unanimous consent (9/0/0) to move to Immediate for C++23.</p>

<p><i>[2023-02-13 Approved at February 2023 meeting in Issaquah. Status changed: Immediate &rarr; WP.]</i></p>



<p id="res-3869"><b>Proposed resolution:</b></p>
<p>
This wording is relative to <a href="https://wg21.link/N4928" title=" Working Draft, Standard for Programming Language C++">N4928</a>.
</p>

<ol>
<li><p>Modify 19.4.2 <a href="https://wg21.link/cerrno.syn">[cerrno.syn]</a>, header <code>&lt;cerrno&gt;</code> synopsis, as indicated:</p>

<blockquote>
<pre><code>
  #define ENETUNREACH <i>see below</i>
  #define ENFILE <i>see below</i>
  #define ENOBUFS <i>see below</i>
  <del>#define ENODATA <i>see below</i></del>
  #define ENODEV <i>see below</i>
  #define ENOENT <i>see below</i>
  #define ENOEXEC <i>see below</i>
  #define ENOLCK <i>see below</i>
  #define ENOLINK <i>see below</i>
  #define ENOMEM <i>see below</i>
  #define ENOMSG <i>see below</i>
  #define ENOPROTOOPT <i>see below</i>
  #define ENOSPC <i>see below</i>
  <del>#define ENOSR <i>see below</i></del>
  <del>#define ENOSTR <i>see below</i></del>
  #define ENOSYS <i>see below</i>
  #define ENOTCONN <i>see below</i>
  #define ENOTDIR <i>see below</i>
  #define ENOTEMPTY <i>see below</i>
  ...
  #define EROFS <i>see below</i>
  #define ESPIPE <i>see below</i>
  #define ESRCH <i>see below</i>
  <del>#define ETIME <i>see below</i></del>
  #define ETIMEDOUT <i>see below</i>
  #define ETXTBSY <i>see below</i>
  #define EWOULDBLOCK <i>see below</i>
  #define EXDEV <i>see below</i>
</code></pre>
<p>-1- The meaning of the macros in this header is defined by the POSIX standard.</p>
</blockquote>
</li>

<li><p>Modify 19.5.2 <a href="https://wg21.link/system.error.syn">[system.error.syn]</a>, header <code>&lt;system_error&gt;</code> synopsis, as indicated:</p>

<blockquote>
<pre><code>
    no_child_process,                   // ECHILD
    no_link,                            // ENOLINK
    no_lock_available,                  // ENOLCK
    <del>no_message_available,               // ENODATA</del>
    no_message,                         // ENOMSG
    no_protocol_option,                 // ENOPROTOOPT
    no_space_on_device,                 // ENOSPC
    <del>no_stream_resources,                // ENOSR</del>
    no_such_device_or_address,          // ENXIO
    no_such_device,                     // ENODEV
    no_such_file_or_directory,          // ENOENT
    no_such_process,                    // ESRCH
    not_a_directory,                    // ENOTDIR
    not_a_socket,                       // ENOTSOCK
    <del>not_a_stream,                       // ENOSTR</del>
    not_connected,                      // ENOTCONN
    not_enough_memory,                  // ENOMEM
    ...
    result_out_of_range,                // ERANGE
    state_not_recoverable,              // ENOTRECOVERABLE
    <del>stream_timeout,                     // ETIME</del>
    text_file_busy,                     // ETXTBSY
    timed_out,                          // ETIMEDOUT
</code></pre>
</blockquote>
</li>

<li>
<p>
Modify D <a href="https://wg21.link/depr">[depr]</a>, Annex D, Compatibility Features, by adding a new subclause
before  [depr.default.allocator]:
:</p>

<blockquote>
<p><ins><b>D.?? Deprecated error numbers [depr.cerrno]</b></ins></p>
<p><ins>
-1- The following macros are defined in addition to those specified in
19.4.2 <a href="https://wg21.link/cerrno.syn">[cerrno.syn]</a>:
</ins></p>

<pre><code>
  <ins>#define ENODATA <i>see below</i></ins>
  <ins>#define ENOSR <i>see below</i></ins>
  <ins>#define ENOSTR <i>see below</i></ins>
  <ins>#define ETIME <i>see below</i></ins>
</code></pre>
<p><ins>-2- The meaning of these macros is defined by the POSIX standard.</ins></p>

<p><ins>
-4- The following <code>enum errc</code> enumerators are defined
in addition to those specified in 19.5.2 <a href="https://wg21.link/system.error.syn">[system.error.syn]</a>:
</ins></p>

<pre><code>
  <ins>no_message_available,               // ENODATA</ins>
  <ins>no_stream_resources,                // ENOSR</ins>
  <ins>not_a_stream,                       // ENOSTR</ins>
  <ins>stream_timeout,                     // ETIME</ins>
</code></pre>

<p><ins>
-4-
The value of each <code>enum errc</code> enumerator above
is the same as the value of the <code>&lt;cerrno&gt;</code> macro shown in the above synopsis.
</ins></p>
</blockquote>
</li>
</ol>






</body>
</html>
