summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler.h
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2008-12-23 18:22:33 +0000
committerChristopher Faylor <me@cgf.cx>2008-12-23 18:22:33 +0000
commit9a8597c13affb2f0e2a18cc808f9edf4d9b03d8c (patch)
treec056123f3070b52f60089b59bc7a88d103635cba /winsup/cygwin/fhandler.h
parenta432f501008457d23ffe41e63f1549e0ef5bccd1 (diff)
downloadcygnal-9a8597c13affb2f0e2a18cc808f9edf4d9b03d8c.tar.gz
cygnal-9a8597c13affb2f0e2a18cc808f9edf4d9b03d8c.tar.bz2
cygnal-9a8597c13affb2f0e2a18cc808f9edf4d9b03d8c.zip
* fhandler.h (fhandler_base_setup_overlapped): Add new argument.
(fhandler_base::get_overlapped_buffer): Declare new function. (fhandler_base::set_overlapped): Ditto. (fhandler_pipe::overlapped): New variable. (fhandler_pipe::get_overlapped): Rework to return contents of overlapped variable. (fhandler_pipe::set_overlapped): Set overlapped variable based on argument. (fhandler_fifo::get_overlapped_buffer): Return pointer to io_status. * fhandler.cc (handler_base::setup_overlapped): Set to overlapped pointer to NULL if new doit parameter is false. Otherwise set up overlapped event as usual. (fhandler_base::wait_overlapped): Return inres if this isn't an overlapped operation. (fhandler_base::read_overlapped): Remove inappropriate asserts. * pipe.cc (fhandler_pipe::fhandler_pipe): Zero overlapped element. (struct pipesync): Delete. (getov_result): Ditto. (pipe_handler): Ditto. (pipesync::pipesync): Ditto. (fhandler_pipe::init): Don't set up pipesync thread. Just pass opened_properly flag along to overlapped setup.
Diffstat (limited to 'winsup/cygwin/fhandler.h')
-rw-r--r--winsup/cygwin/fhandler.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index fdaf7d577..c98a7d533 100644
--- a/winsup/cygwin/fhandler.h
+++ b/winsup/cygwin/fhandler.h
@@ -144,7 +144,7 @@ class fhandler_base
HANDLE read_state;
int wait_overlapped (bool, bool, DWORD *) __attribute__ ((regparm (3)));
- bool setup_overlapped () __attribute__ ((regparm (1)));
+ bool setup_overlapped (bool doit = true) __attribute__ ((regparm (2)));
void destroy_overlapped () __attribute__ ((regparm (1)));
public:
@@ -344,6 +344,8 @@ class fhandler_base
virtual void raw_read (void *ptr, size_t& ulen);
virtual int raw_write (const void *ptr, size_t ulen);
virtual OVERLAPPED *get_overlapped () {return NULL;}
+ virtual OVERLAPPED *get_overlapped_buffer () {return NULL;}
+ virtual void set_overlapped (OVERLAPPED *) {}
/* Virtual accessor functions to hide the fact
that some fd's have two handles. */
@@ -532,9 +534,14 @@ class fhandler_pipe: public fhandler_base
private:
pid_t popen_pid;
OVERLAPPED io_status;
+ OVERLAPPED *overlapped;
public:
fhandler_pipe ();
- OVERLAPPED *get_overlapped () {return &io_status;}
+
+ OVERLAPPED *get_overlapped () {return overlapped;}
+ OVERLAPPED *get_overlapped_buffer () {return &io_status;}
+ void set_overlapped (OVERLAPPED *ov) {overlapped = ov;}
+
void set_popen_pid (pid_t pid) {popen_pid = pid;}
pid_t get_popen_pid () const {return popen_pid;}
_off64_t lseek (_off64_t offset, int whence);
@@ -577,6 +584,7 @@ public:
bool isfifo () { return true; }
int __stdcall fstatvfs (struct statvfs *buf) __attribute__ ((regparm (2)));
OVERLAPPED *get_overlapped () {return &io_status;}
+ OVERLAPPED *get_overlapped_buffer () {return &io_status;}
};
class fhandler_dev_raw: public fhandler_base