]> sourceware.org Git - newlib-cygwin.git/commitdiff
Cygwin: define MSG_EOR and refuse in send(2)
authorCorinna Vinschen <corinna@vinschen.de>
Thu, 25 Apr 2019 16:49:32 +0000 (18:49 +0200)
committerCorinna Vinschen <corinna@vinschen.de>
Thu, 25 Apr 2019 17:00:08 +0000 (19:00 +0200)
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/cygwin/fhandler_socket_inet.cc
winsup/cygwin/include/cygwin/socket.h
winsup/cygwin/release/3.1.0

index 46af1c4be563dc27ea4f30323952c6266be45519..6f4383861d1574033c4f88754f4cb94db89fd5df 100644 (file)
@@ -1351,6 +1351,13 @@ fhandler_socket_wsock::send_internal (struct _WSAMSG *wsamsg, int flags)
   DWORD wait_flags = flags & MSG_DONTWAIT;
   bool nosignal = !!(flags & MSG_NOSIGNAL);
 
+  /* MSG_EOR not supported by any protocol */
+  if (flags & MSG_EOR)
+    {
+      set_errno (EOPNOTSUPP);
+      return SOCKET_ERROR;
+    }
+
   flags &= (MSG_OOB | MSG_DONTROUTE);
   if (wsamsg->Control.len > 0)
     use_sendmsg = true;
index 77d87ff0940f6255fa795dd9c7b3c01c95f741fe..cdfa4b9334ecf2a7e7f1ab539d2fb12eecc2c15c 100644 (file)
@@ -207,6 +207,8 @@ struct OLD_msghdr
 /* AF_UNIX specific */
 #define MSG_CMSG_CLOEXEC 0x1000                /* Set O_CLOEXEC on fd's passed via
                                           SCM_RIGHTS */
+/* MSG_EOR is not supported.  We use the MSG_PARTIAL flag here */
+#define MSG_EOR                0x8000          /* Terminates a record */
 
 /* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */
 #define SOL_IP         0
index 95569fc2b954ec71dbe7ac8e1c3e1e34c63a6c84..fe65e5082c97431690d3f145d443275e0aa13b75 100644 (file)
@@ -24,3 +24,7 @@ Bug Fixes
   completed, instead of when only one key is typed.
 
 - Make console I/O functions thread-safe.
+
+- Define missing MSG_EOR.  It's unsupported by the underlying Winsock
+  layer so using it in send(2), sendto(2), or sendmsg(2) will return -1
+  with errno set to EOPNOTSUPP and recvmsg(2) will never return it.
This page took 0.035203 seconds and 5 git commands to generate.