diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2011-06-17 15:04:44 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2011-06-17 15:04:44 +0400 |
commit | c36cd56c548a27683e64b93348bbe9ad1d47b1ea (patch) | |
tree | 349247e874430bb4dd8f0ff7b0ce51812c5387cb /winsup/cygwin/fhandler.h | |
parent | a71625261972960776d7602a2673fcd98fddae62 (diff) |
* fhandler.cc (fhandler_base::open): Drop local create_options variable.
Use options member instead.
* fhandler.h (class fhandler_base): Change type of access member to
ACCESS_MASK. Change get_access and set_access methods accordingly.
Add options member. Add get_options and set_options methods.
(class fhandler_disk_file): Add prw_handle.
(fhandler_disk_file::prw_open): Declare.
(fhandler_disk_file::close): Declare.
(fhandler_disk_file::dup): Declare.
(fhandler_disk_file::fixup_after_fork): Declare.
* fhandler_disk_file.cc (fhandler_disk_file::fhandler_disk_file):
Initialize prw_handle to NULL.
(fhandler_disk_file::close): Close prw_handle.
(fhandler_disk_file::dup): New method.
(fhandler_disk_file::fixup_after_fork): Set prw_handle to NULL since
prw_handle is not inherited.
(fhandler_disk_file::prw_open): New method. Add long comment to
explain current behaviour.
(fhandler_disk_file::pread): Revert previous change. Change to use
prw_handle if possible.
(fhandler_disk_file::pwrite): Change to use prw_handle if possible.
Diffstat (limited to 'winsup/cygwin/fhandler.h')
-rw-r--r-- | winsup/cygwin/fhandler.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index 8268a9ae7..5120a3ce2 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -152,7 +152,9 @@ class fhandler_base } status, open_status; private: - int access; + ACCESS_MASK access; + ULONG options; + HANDLE io_handle; __ino64_t ino; /* file ID or hashed filename, depends on FS. */ @@ -206,8 +208,11 @@ class fhandler_base DWORD get_minor () { return dev ().get_minor (); } virtual int get_unit () { return dev ().get_minor (); } - int get_access () const { return access; } - void set_access (int x) { access = x; } + ACCESS_MASK get_access () const { return access; } + void set_access (ACCESS_MASK x) { access = x; } + + ULONG get_options () const { return options; } + void set_options (ULONG x) { options = x; } int get_flags () { return openflags; } void set_flags (int x, int supplied_bin = 0); @@ -801,13 +806,19 @@ class fhandler_dev_tape: public fhandler_dev_raw class fhandler_disk_file: public fhandler_base { + HANDLE prw_handle; int readdir_helper (DIR *, dirent *, DWORD, DWORD, PUNICODE_STRING fname) __attribute__ ((regparm (3))); + int prw_open (bool); + public: fhandler_disk_file (); fhandler_disk_file (path_conv &pc); int open (int flags, mode_t mode); + int close (); + int dup (fhandler_base *child); + void fixup_after_fork (HANDLE parent); int lock (int, struct __flock64 *); bool isdevice () const { return false; } int __stdcall fstat (struct __stat64 *buf) __attribute__ ((regparm (2))); |