Web lists-archives.com

Re: bug: cygwin-devel v3.0.2-1 socket.h does not #define MSG_EOR per the POSIX standard




On Apr 24 15:50, Eric Blake wrote:
> On 4/24/19 3:36 PM, Hans-Bernhard Bröker wrote:
> > Am 24.04.2019 um 19:54 schrieb Eliot Moss:
> >> On 4/24/2019 12:43 PM, Corinna Vinschen wrote:
> > 
> >>> Since MSG_EOR isn't implemented in the underlying transport layer,
> >>> there's no way to implement it in userspace.  That's why it's not
> >>> defined in Cygwin's headers.  If you have an idea how to implement
> >>> this in plain userspace, feel free to provide patches.
> >>
> >> I don't have a direct interest in this issue, but I do have a wondering.
> >> If Cygwin fails to define an error code -- even if the error cannot
> >> actually happen under Cygwin -- isn't that a problem when trying to
> >> compile imported software?  
> > 
> 
> Well, MSG_EOR is not an error, but we can certainly do better than not
> defining it at all. My suggestion for the least-cost implementation:
> 
> - add a define for MSG_EOR to a non-zero value that is bitwise distinct
> from other required MSG_ values
> - return EOPNOTSUPP on attempts to use the flag in
> send()/sendmsg()/sendto() (POSIX permits that failure for protocols that
> don't support it - and none of Cygwin's protocols support it)
> - optionally, document that MSG_EOR will never be set in the results
> returned by recvmsg() (POSIX says it will only be set on protocols that
> support it - and none of Cygwin's protocols support it)
> 
> This will at least let software compile that attempts to use it, and
> hopefully that software is robust to the fact that send() may reject the
> flag and that recvmsg() cannot reliably report use of that flag.

Interesting.  I really thought it's better that a programm does not
compile, rather than it compiles and misbehaves from the POV of the
developer.

I added the MSG_EOR definition and send(2) and friends return EOPNOTSUPP
now.  I uploaded a snapshot to https://cygwin.com/snapshots/ with this
change.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer

Attachment: signature.asc
Description: PGP signature