aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2011-03-18 17:50:58 +0000
committerCorinna Vinschen <corinna@vinschen.de>2011-03-18 17:50:58 +0000
commit41e7a0632a686a2b84f0fb8f85b1a662829346ac (patch)
tree5c1aea1bf41ccad93810453e4145c2e238bef89a
parente374e54e1b4d1271537c98e3f67478a93295bb7a (diff)
downloadnewlib-41e7a0632a686a2b84f0fb8f85b1a662829346ac.zip
newlib-41e7a0632a686a2b84f0fb8f85b1a662829346ac.tar.gz
newlib-41e7a0632a686a2b84f0fb8f85b1a662829346ac.tar.bz2
2011-03-18 Christopher Faylor <me.cygwin2011@cgf.cx>
* fhandler.h (DEFAULT_PIPEBUFSIZE): Reset to 64K. 2011-03-18 Corinna Vinschen <corinna@vinschen.de> * mmap.cc (mmap_record::alloc_fh): Initialize name strings in fdev to empty strings or suffer a SEGV. Drop second parameter in call to build_fh_dev. 2011-03-18 Corinna Vinschen <corinna@vinschen.de> * mmap.cc (class mmap_record): Pack 4 byte-aligned. Convert member dev to plain int. (mmap_record::alloc_fh): Create temporary device from dev and use in call to build_fh_dev.
-rw-r--r--winsup/cygwin/ChangeLog17
-rw-r--r--winsup/cygwin/fhandler.h6
-rw-r--r--winsup/cygwin/mmap.cc15
3 files changed, 32 insertions, 6 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 2c4cf44..3d6a06b 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,20 @@
+2011-03-18 Christopher Faylor <me.cygwin2011@cgf.cx>
+
+ * fhandler.h (DEFAULT_PIPEBUFSIZE): Reset to 64K.
+
+2011-03-18 Corinna Vinschen <corinna@vinschen.de>
+
+ * mmap.cc (mmap_record::alloc_fh): Initialize name strings in fdev to
+ empty strings or suffer a SEGV. Drop second parameter in call to
+ build_fh_dev.
+
+2011-03-18 Corinna Vinschen <corinna@vinschen.de>
+
+ * mmap.cc (class mmap_record): Pack 4 byte-aligned. Convert member dev
+ to plain int.
+ (mmap_record::alloc_fh): Create temporary device from dev and use in
+ call to build_fh_dev.
+
2011-03-17 Corinna Vinschen <corinna@vinschen.de>
* fhandler_socket.cc (get_inet_addr): Make externally available.
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index ffe8ee1..f223a11 100644
--- a/winsup/cygwin/fhandler.h
+++ b/winsup/cygwin/fhandler.h
@@ -29,7 +29,11 @@ details. */
Using this blocksize in read/write calls in the application results
in a much better performance than using smaller values. */
#define PREFERRED_IO_BLKSIZE ((blksize_t) 65536)
-#define DEFAULT_PIPEBUFSIZE (31 * 1024 * 1024)
+
+/* It also appears that this may be the only acceptable block size for
+ atomic writes to a pipe. It is a shame that we have to make this
+ so small. http://cygwin.com/ml/cygwin/2011-03/msg00541.html */
+#define DEFAULT_PIPEBUFSIZE PREFERRED_IO_BLKSIZE
extern const char *windows_device_names[];
extern struct __cygwin_perfile *perfile_table;
diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc
index f04366b..91c2d7b 100644
--- a/winsup/cygwin/mmap.cc
+++ b/winsup/cygwin/mmap.cc
@@ -245,6 +245,7 @@ MapView (HANDLE h, void *addr, size_t len, DWORD openflags,
per mapped memory page. The bit is set if the page is accessible,
unset otherwise. */
+#pragma pack(push, 4)
class mmap_record
{
public:
@@ -259,7 +260,7 @@ class mmap_record
_off64_t offset;
DWORD len;
caddr_t base_address;
- device dev;
+ int dev;
DWORD page_map[0];
public:
@@ -274,16 +275,16 @@ class mmap_record
len (l),
base_address (b)
{
- dev.devn = 0;
+ dev = 0;
if (fd >= 0 && !cygheap->fdtab.not_open (fd))
dev = cygheap->fdtab[fd]->dev ();
else if (fd == -1)
- dev.parse (FH_ZERO);
+ dev = FH_ZERO;
}
int get_fd () const { return fd; }
HANDLE get_handle () const { return mapping_hdl; }
- device& get_device () { return dev; }
+ int get_device () { return dev; }
int get_prot () const { return prot; }
int get_openflags () const { return openflags; }
int get_flags () const { return flags; }
@@ -316,6 +317,7 @@ class mmap_record
{ return ::gen_protect (get_prot (), get_flags ()); }
bool compatible_flags (int fl) const;
};
+#pragma pack(pop)
class mmap_list
{
@@ -519,7 +521,10 @@ mmap_record::alloc_fh ()
the call to fork(). This requires creating a fhandler
of the correct type to be sure to call the method of the
correct class. */
- fhandler_base *fh = build_fh_dev (get_device ());
+ device fdev;
+ fdev.name = fdev.native = "";
+ fdev.parse (get_device ());
+ fhandler_base *fh = build_fh_dev (fdev);
fh->set_access (get_openflags ());
return fh;
}