diff options
Diffstat (limited to 'winsup/cygwin/fhandler.h')
-rw-r--r-- | winsup/cygwin/fhandler.h | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index 74eebf558..ee08e5990 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -29,6 +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 extern const char *windows_device_names[]; extern struct __cygwin_perfile *perfile_table; @@ -397,7 +398,7 @@ public: bool issymlink () {return pc.issymlink ();} bool device_access_denied (int) __attribute__ ((regparm (2))); int fhaccess (int flags, bool) __attribute__ ((regparm (3))); - virtual bool has_ongoing_io () {return false;} + virtual bool __stdcall has_ongoing_io () __attribute__ ((regparm (1))) {return false;} }; class fhandler_mailslot : public fhandler_base @@ -565,23 +566,33 @@ class fhandler_socket: public fhandler_base class fhandler_base_overlapped: public fhandler_base { protected: + enum wait_return + { + overlapped_success = 0, + overlapped_signal, + overlapped_error, + overlapped_fallback + }; bool io_pending; OVERLAPPED io_status; OVERLAPPED *overlapped; + size_t max_atomic_write; public: - int wait_overlapped (bool, bool, DWORD *, DWORD = 0) __attribute__ ((regparm (3))); - int setup_overlapped () __attribute__ ((regparm (1))); - void destroy_overlapped () __attribute__ ((regparm (1))); + wait_return __stdcall wait_overlapped (bool, bool, DWORD *, bool, DWORD = 0) __attribute__ ((regparm (3))); + int __stdcall setup_overlapped () __attribute__ ((regparm (1))); + 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); + 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;} void set_overlapped (OVERLAPPED *ov) {overlapped = ov;} - fhandler_base_overlapped (): io_pending (false), overlapped (NULL) + fhandler_base_overlapped (): io_pending (false), overlapped (NULL), max_atomic_write (0) { memset (&io_status, 0, sizeof io_status); } - bool has_ongoing_io (); + bool __stdcall has_ongoing_io () __attribute__ ((regparm (1))); void fixup_after_fork (HANDLE); void fixup_after_exec (); |