* fhandler.cc (fhandler_base_overlapped::wait_overlapped): Remove special

treatment for ERROR_NO_SYSTEM_RESOURCES.  Cancel I/O and reset the overlapped
handle on error.
(fhandler_base_overlapped::write_overlapped): Limit writes to max_atomic_write
bytes in blocking case.  Incorporate code from now-defunct
write_overlapped_fallback.  Fix serious oversight where ptr was not advanced as
buffer was written.
(fhandler_base_overlapped::write_overlapped_fallback): Eliminate.
* fhandler.h (fhandler_base_overlapped::write_overlapped_fallback): Ditto for
declaration.
(DEFAULT_PIPEBUFSIZE): Lower size to slightly less than documented worst-case
atomic write size.
(fhandler_overlapped::wait_return): Remove unused element.
This commit is contained in:
Christopher Faylor
2011-03-13 20:20:58 +00:00
parent 7a9064faa5
commit 9636c4262e
3 changed files with 56 additions and 83 deletions

View File

@@ -29,7 +29,7 @@ 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 PREFERRED_IO_BLKSIZE
#define DEFAULT_PIPEBUFSIZE (31 * 1024 * 1024)
extern const char *windows_device_names[];
extern struct __cygwin_perfile *perfile_table;
@@ -570,8 +570,7 @@ protected:
{
overlapped_success = 0,
overlapped_signal,
overlapped_error,
overlapped_fallback
overlapped_error
};
bool io_pending;
OVERLAPPED io_status;
@@ -583,7 +582,6 @@ public:
void __stdcall destroy_overlapped () __attribute__ ((regparm (1)));
void __stdcall read_overlapped (void *ptr, size_t& len) __attribute__ ((regparm (3)));
ssize_t __stdcall write_overlapped (const void *ptr, size_t len) __attribute__ ((regparm (3)));
ssize_t __stdcall write_overlapped_fallback (const void *ptr, size_t orig_len)
__attribute__ ((regparm (3)));
OVERLAPPED *&get_overlapped () {return overlapped;}
OVERLAPPED *get_overlapped_buffer () {return &io_status;}