Title
Deprecate std::errc constants related to UNIX STREAMS
Status
c++23
Section
[system.error.syn]
Submitter
Jonathan Wakely

Created on 2023-01-30.00:00:00 last changed 12 months ago

Messages

Date: 2023-02-13.11:31:32

Proposed resolution:

This wording is relative to N4928.

  1. Modify [cerrno.syn], header <cerrno> synopsis, as indicated:

    
      #define ENETUNREACH see below
      #define ENFILE see below
      #define ENOBUFS see below
      #define ENODATA see below
      #define ENODEV see below
      #define ENOENT see below
      #define ENOEXEC see below
      #define ENOLCK see below
      #define ENOLINK see below
      #define ENOMEM see below
      #define ENOMSG see below
      #define ENOPROTOOPT see below
      #define ENOSPC see below
      #define ENOSR see below
      #define ENOSTR see below
      #define ENOSYS see below
      #define ENOTCONN see below
      #define ENOTDIR see below
      #define ENOTEMPTY see below
      ...
      #define EROFS see below
      #define ESPIPE see below
      #define ESRCH see below
      #define ETIME see below
      #define ETIMEDOUT see below
      #define ETXTBSY see below
      #define EWOULDBLOCK see below
      #define EXDEV see below
    

    -1- The meaning of the macros in this header is defined by the POSIX standard.

  2. Modify [system.error.syn], header <system_error> synopsis, as indicated:

    
        no_child_process,                   // ECHILD
        no_link,                            // ENOLINK
        no_lock_available,                  // ENOLCK
        no_message_available,               // ENODATA
        no_message,                         // ENOMSG
        no_protocol_option,                 // ENOPROTOOPT
        no_space_on_device,                 // ENOSPC
        no_stream_resources,                // ENOSR
        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
        not_a_stream,                       // ENOSTR
        not_connected,                      // ENOTCONN
        not_enough_memory,                  // ENOMEM
        ...
        result_out_of_range,                // ERANGE
        state_not_recoverable,              // ENOTRECOVERABLE
        stream_timeout,                     // ETIME
        text_file_busy,                     // ETXTBSY
        timed_out,                          // ETIMEDOUT
    
  3. Modify [depr], Annex D, Compatibility Features, by adding a new subclause before [depr.default.allocator]: :

    D.?? Deprecated error numbers [depr.cerrno]

    -1- The following macros are defined in addition to those specified in [cerrno.syn]:

    
      #define ENODATA see below
      #define ENOSR see below
      #define ENOSTR see below
      #define ETIME see below
    

    -2- The meaning of these macros is defined by the POSIX standard.

    -4- The following enum errc enumerators are defined in addition to those specified in [system.error.syn]:

    
      no_message_available,               // ENODATA
      no_stream_resources,                // ENOSR
      not_a_stream,                       // ENOSTR
      stream_timeout,                     // ETIME
    

    -4- The value of each enum errc enumerator above is the same as the value of the <cerrno> macro shown in the above synopsis.

Date: 2023-02-13.00:00:00

[ 2023-02-13 Approved at February 2023 meeting in Issaquah. Status changed: Immediate → WP. ]

Date: 2023-02-07.01:43:18

[ Issaquah 2023-02-06; LWG ]

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

Date: 2023-01-30.00:00:00

This is the resolution for NB comment GB-084

The error numbers ENODATA, ENOSR, ENOSTR and ETIME 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 <errno.h> and also defined corresponding errc enumerators: errc::no_message_available, errc::no_stream_resources, errc::not_a_stream and errc::stream_timeout.

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 ENODATA, ENOSR, ENOSTR and ETIME that are not defined in the POSIX reference.

After a period of deprecation they can be removed from Annex D, and the names added to [zombie.names] so that implementations can continue to define them if they need to.

History
Date User Action Args
2023-11-22 15:47:43adminsetstatus: wp -> c++23
2023-02-13 11:31:32adminsetmessages: + msg13396
2023-02-13 11:31:32adminsetstatus: immediate -> wp
2023-02-07 01:43:18adminsetmessages: + msg13275
2023-02-07 01:43:18adminsetstatus: new -> immediate
2023-01-30 21:15:49adminsetmessages: + msg13237
2023-01-30 00:00:00admincreate