summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler.h
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2013-06-04 10:24:43 +0000
committerCorinna Vinschen <corinna@vinschen.de>2013-06-04 10:24:43 +0000
commitedd73646f3c33f22d90957f1675308f902c6a00e (patch)
tree9e923948b0d9d08f9e4997b051fa2486fddfb029 /winsup/cygwin/fhandler.h
parentca1dd3a9b5ac53f50c12ea146cd9aa4485ad9aa4 (diff)
downloadcygnal-edd73646f3c33f22d90957f1675308f902c6a00e.tar.gz
cygnal-edd73646f3c33f22d90957f1675308f902c6a00e.tar.bz2
cygnal-edd73646f3c33f22d90957f1675308f902c6a00e.zip
* fhandler.cc (fhandler_base::lock): Move to flock.cc.
(fhandler_base::fixup_after_exec): Reset mandatory_locking. * fhandler.h (class fhandler_base): Add mandatory_locking status flag. Add mandatory_locking accessor methods. Accommodate change throughout. (fhandler_base::mand_lock): Declare. (class fhandler_disk_file): Drop in favor of new status flag. * (fhandler_disk_file::fcntl): Call need_fork_fixup if mandatory_locking flag gets set. * flock.cc (fhandler_base::lock): Define here. (flock): Handle mandatory_locking. (lockf): Ditto. (fhandler_base::mand_lock): Define.
Diffstat (limited to 'winsup/cygwin/fhandler.h')
-rw-r--r--winsup/cygwin/fhandler.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index 76e0ea768..f5e4bc0d6 100644
--- a/winsup/cygwin/fhandler.h
+++ b/winsup/cygwin/fhandler.h
@@ -147,12 +147,13 @@ class fhandler_base
unsigned close_on_exec : 1; /* close-on-exec */
unsigned need_fork_fixup : 1; /* Set if need to fixup after fork. */
unsigned isclosed : 1; /* Set when fhandler is closed. */
+ unsigned mandatory_locking : 1; /* Windows mandatory locking */
public:
status_flags () :
rbinary (0), rbinset (0), wbinary (0), wbinset (0), nohandle (0),
did_lseek (0), query_open (no_query), close_on_exec (0),
- need_fork_fixup (0), isclosed (0)
+ need_fork_fixup (0), isclosed (0), mandatory_locking (0)
{}
} status, open_status;
@@ -247,6 +248,7 @@ class fhandler_base
IMPLEMENT_STATUS_FLAG (bool, close_on_exec)
IMPLEMENT_STATUS_FLAG (bool, need_fork_fixup)
IMPLEMENT_STATUS_FLAG (bool, isclosed)
+ IMPLEMENT_STATUS_FLAG (bool, mandatory_locking)
int get_default_fmode (int flags);
@@ -360,6 +362,7 @@ public:
virtual ssize_t __reg3 pwrite (void *, size_t, off_t);
virtual off_t lseek (off_t offset, int whence);
virtual int lock (int, struct flock *);
+ virtual int mand_lock (int, struct flock *);
virtual int dup (fhandler_base *child, int flags);
virtual int fpathconf (int);
@@ -963,7 +966,6 @@ class fhandler_dev_tape: public fhandler_dev_raw
class fhandler_disk_file: public fhandler_base
{
HANDLE prw_handle;
- bool mandatory_locking;
int __reg3 readdir_helper (DIR *, dirent *, DWORD, DWORD, PUNICODE_STRING fname);
int prw_open (bool);