https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95609

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-06-11

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
As discussed on the reflector, that's only going to work on some targets.

Libstdc++ doesn't dictate the layout of struct iovec, and POSIX only
guarantees:

  The <sys/uio.h> header shall define the iovec structure, which shall
  include at least the following members:

  void   *iov_base  Base address of a memory region for input or output. 
  size_t  iov_len   The size of the memory pointed to by iov_base. 

POSIX doesn't say what order the members are in, and allows additional members.

So while there is some value making span<byte> layout-compatible with linux's
iovec, there's no guarantee it will be usable on other POSIX systems, nor
Windows. So a custom buffer type will probably need to be defined eventually
anyway.

Linux's layout is the obvious one though, and is also used by AIX 7.2, Solaris
11, FreeBSD 12 and OpenBSD 6.6, which means we can assume it's true for most of
the widely-used unix-like systems.

Reply via email to