* Florian Weimer: > Can you look at the generated s-soscons.ads file? I suspect that the > default > > #ifndef MSG_WAITALL > # define MSG_WAITALL -1 > #endif > CND(MSG_WAITALL, "Wait for full reception") > > kicks in and sets MSG_WAITALL to -1. > > Debian's mingw hasn't got the MSG_WAITALL #define, either. It seems > that "8" would be the correct value.
It turns out that MSG_WAITALL is not actually available on older Windows (it was introduced in Windows Server 2003). That's why mingw and cygwin do not include the #define; it would break application compatibility with Windows XP. Does the following patch help? diff --git a/gcc/ada/g-socthi-mingw.adb b/gcc/ada/g-socthi-mingw.adb index 727a69d..697425e 100644 --- a/gcc/ada/g-socthi-mingw.adb +++ b/gcc/ada/g-socthi-mingw.adb @@ -277,7 +277,8 @@ package body GNAT.Sockets.Thin is use type C.size_t; Fill : constant Boolean := - (C.unsigned (Flags) and SOSC.MSG_WAITALL) /= 0; + SOSC.MSG_WAITALL /= -1 + and then (C.unsigned (Flags) and SOSC.MSG_WAITALL) /= 0; -- Is the MSG_WAITALL flag set? If so we need to fully fill all vectors Res : C.int;