summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorscottc <scottc>2002-08-28 16:09:14 +0000
committerscottc <scottc>2002-08-28 16:09:14 +0000
commit3bd5548c0ab42d41c63e9bdd7e5be07a6061c6d7 (patch)
tree88a92834bfe77d871b7a23cdb69fc0f09c68924d
parent18120a9be3de3adb5263ee501716cefa799b202b (diff)
downloadgdb-3bd5548c0ab42d41c63e9bdd7e5be07a6061c6d7.tar.gz
Merged changes from HEAD
-rw-r--r--winsup/cygwin/ChangeLog24
-rw-r--r--winsup/cygwin/cygwin.din8
-rw-r--r--winsup/cygwin/fhandler_socket.cc14
-rw-r--r--winsup/cygwin/include/cygwin/socket.h2
-rw-r--r--winsup/cygwin/include/cygwin/version.h5
-rw-r--r--winsup/cygwin/malloc.cc4
-rw-r--r--winsup/cygwin/newlib.h0
-rw-r--r--winsup/cygwin/poll.cc2
8 files changed, 54 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 35fe3510664..78afb92b854 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,27 @@
+2002-08-28 Christopher Faylor <cgf@redhat.com>
+
+ * malloc.cc: Protect some definitions to avoid a compile time warning.
+
+2002-08-27 Nicholas Wourms <nwourms@netscape.net>
+
+ * cygwin.din: Export getc_unlocked, getchar_unlocked,
+ putc_unlocked, putchar_unlocked functions.
+ * include/cygwin/version.h: Bump api minor.
+
+2002-08-28 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_socket.cc (fhandler_socket::recvfrom): Eliminate flags
+ not understood by WinSock.
+ (fhandler_socket::sendto): Ditto. If WinSock sendto() returns
+ WSAESHUTDOWN, change errno to EPIPE and raise SIGPIPE if MSG_NOSIGNAL
+ isn't set in flags.
+ * include/cygwin/socket.h: Define MSG_WINMASK and MSG_NOSIGNAL.
+ * include/cygwin/version.h: Bump API minor number.
+
+2002-08-28 Corinna Vinschen <corinna@vinschen.de>
+
+ * poll.cc (poll): Eliminate erroneous POLLERR conditional.
+
2002-08-26 Conrad Scott <conrad.scott@dsl.pipex.com>
* fhandler_socket.cc (fhandler_socket::check_peer_secret_event):
diff --git a/winsup/cygwin/cygwin.din b/winsup/cygwin/cygwin.din
index b3b54e82527..1a9de94c377 100644
--- a/winsup/cygwin/cygwin.din
+++ b/winsup/cygwin/cygwin.din
@@ -346,8 +346,12 @@ gcvtf
_gcvtf = gcvtf
getc
_getc = getc
+getc_unlocked
+_getc_unlocked = getc_unlocked
getchar
_getchar = getchar
+getchar_unlocked
+_getchar_unlocked = getchar_unlocked
getcwd
_getcwd = getcwd
getdtablesize
@@ -609,8 +613,12 @@ printf
_printf = printf
putc
_putc = putc
+putc_unlocked
+_putc_unlocked = putc_unlocked
putchar
_putchar = putchar
+putchar_unlocked
+_putchar_unlocked = putchar_unlocked
puts
_puts = puts
putw
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
index 2057a9eec12..85b2107525b 100644
--- a/winsup/cygwin/fhandler_socket.cc
+++ b/winsup/cygwin/fhandler_socket.cc
@@ -674,6 +674,7 @@ fhandler_socket::recvfrom (void *ptr, size_t len, int flags,
wsock_event wsock_evt;
LPWSAOVERLAPPED ovr;
+ flags &= MSG_WINMASK;
if (is_nonblocking () || !(ovr = wsock_evt.prepare ()))
{
debug_printf ("Fallback to winsock 1 recvfrom call");
@@ -765,7 +766,8 @@ fhandler_socket::sendto (const void *ptr, size_t len, int flags,
if (is_nonblocking () || !(ovr = wsock_evt.prepare ()))
{
debug_printf ("Fallback to winsock 1 sendto call");
- if ((res = ::sendto (get_socket (), (const char *) ptr, len, flags,
+ if ((res = ::sendto (get_socket (), (const char *) ptr, len,
+ flags & MSG_WINMASK,
(to ? (sockaddr *) &sin : NULL),
tolen)) == SOCKET_ERROR)
{
@@ -777,7 +779,8 @@ fhandler_socket::sendto (const void *ptr, size_t len, int flags,
{
WSABUF wsabuf = { len, (char *) ptr };
DWORD ret = 0;
- if (WSASendTo (get_socket (), &wsabuf, 1, &ret, (DWORD)flags,
+ if (WSASendTo (get_socket (), &wsabuf, 1, &ret,
+ (DWORD)(flags & MSG_WINMASK),
(to ? (sockaddr *) &sin : NULL),
tolen,
ovr, NULL) != SOCKET_ERROR)
@@ -791,6 +794,13 @@ fhandler_socket::sendto (const void *ptr, size_t len, int flags,
set_winsock_errno ();
}
+ /* Special handling for SIGPIPE */
+ if (get_errno () == ESHUTDOWN)
+ {
+ set_errno (EPIPE);
+ if (! (flags & MSG_NOSIGNAL))
+ _raise (SIGPIPE);
+ }
return res;
}
diff --git a/winsup/cygwin/include/cygwin/socket.h b/winsup/cygwin/include/cygwin/socket.h
index b66c38f73c2..3a40c12a3e3 100644
--- a/winsup/cygwin/include/cygwin/socket.h
+++ b/winsup/cygwin/include/cygwin/socket.h
@@ -112,6 +112,8 @@ struct msghdr
#define MSG_OOB 0x1 /* process out-of-band data */
#define MSG_PEEK 0x2 /* peek at incoming message */
#define MSG_DONTROUTE 0x4 /* send without using routing tables */
+#define MSG_WINMASK 0x7 /* flags understood by WinSock calls */
+#define MSG_NOSIGNAL 0x20 /* Don't raise SIGPIPE */
/* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */
#define SOL_IP 0
diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h
index e9459070d3b..69a1d04addf 100644
--- a/winsup/cygwin/include/cygwin/version.h
+++ b/winsup/cygwin/include/cygwin/version.h
@@ -158,12 +158,15 @@ details. */
58: Export memalign, valloc, malloc_trim, malloc_usable_size, mallopt,
malloc_stats
59: getsid
+ 60: MSG_NOSIGNAL
+ 61: Export getc_unlocked, getchar_unlocked, putc_unlocked,
+ putchar_unlocked
*/
/* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
#define CYGWIN_VERSION_API_MAJOR 0
-#define CYGWIN_VERSION_API_MINOR 59
+#define CYGWIN_VERSION_API_MINOR 61
/* There is also a compatibity version number associated with the
shared memory regions. It is incremented when incompatible
diff --git a/winsup/cygwin/malloc.cc b/winsup/cygwin/malloc.cc
index 02832bb9946..2e0a5cce0d7 100644
--- a/winsup/cygwin/malloc.cc
+++ b/winsup/cygwin/malloc.cc
@@ -2510,14 +2510,18 @@ static void malloc_init_state(av) mstate av;
#if __STD_C
static Void_t* sYSMALLOc(INTERNAL_SIZE_T, mstate);
+#ifndef MORECORE_CANNOT_TRIM
static int sYSTRIm(size_t, mstate);
+#endif
static void malloc_consolidate(mstate);
#ifdef NEED_INDEPENDENT
static Void_t** iALLOc(size_t, size_t*, int, Void_t**);
#endif
#else
static Void_t* sYSMALLOc();
+#ifndef MORECORE_CANNOT_TRIM
static int sYSTRIm();
+#endif
static void malloc_consolidate();
#ifdef NEED_INDEPENDENT
static Void_t** iALLOc();
diff --git a/winsup/cygwin/newlib.h b/winsup/cygwin/newlib.h
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/winsup/cygwin/newlib.h
diff --git a/winsup/cygwin/poll.cc b/winsup/cygwin/poll.cc
index a1c50e8b03d..89a3124d198 100644
--- a/winsup/cygwin/poll.cc
+++ b/winsup/cygwin/poll.cc
@@ -88,8 +88,6 @@ poll (struct pollfd *fds, unsigned int nfds, int timeout)
fds[i].revents |= POLLIN;
if (FD_ISSET(fds[i].fd, write_fds))
fds[i].revents |= POLLOUT;
- if (FD_ISSET(fds[i].fd, read_fds) && FD_ISSET(fds[i].fd, write_fds))
- fds[i].revents |= POLLERR;
if (FD_ISSET(fds[i].fd, except_fds))
fds[i].revents |= POLLPRI;
}