diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2003-05-26 09:54:01 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2003-05-26 09:54:01 +0000 |
commit | fac297d5f84d06ec41652c42f410f105dd904b67 (patch) | |
tree | 34cd97034cede2b4fd3568d3a483ecd254e83eea /winsup/cygwin/fhandler.h | |
parent | 7b3a9e6e005345d47280cf93cf7dde679c651a6f (diff) | |
download | cygnal-fac297d5f84d06ec41652c42f410f105dd904b67.tar.gz cygnal-fac297d5f84d06ec41652c42f410f105dd904b67.tar.bz2 cygnal-fac297d5f84d06ec41652c42f410f105dd904b67.zip |
* fhandler.h: Rename FH_W95LSBUG flag to FH_LSEEKED.
(fhandler_base::set_did_lseek): Rename from set_check_win95_lseek_bug.
(fhandler_base::get_did_lseek): Rename from get_check_win95_lseek_bug.
(fhandler_base::set_fs_flags): New method.
(fhandler_base::get_fs_flags): Ditto.
* fhandler.cc (fhandler_base::write): Make 64 bit clean. Convert file
to a "sparse" file when writing after a long lseek (>64K) beyond EOF.
(fhandler_base::lseek): Call set_did_lseek() instead of
set_check_win95_lseek_bug().
(fhandler_base::fhandler_base): Initialize fs_flags to 0.
* fhandler_disk_file.cc (fhandler_disk_file::open): Don't create files
as "sparse" unconditionally. Set fs_flags member.
Diffstat (limited to 'winsup/cygwin/fhandler.h')
-rw-r--r-- | winsup/cygwin/fhandler.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index 8138d1d88..ae3becc32 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -28,9 +28,10 @@ enum FH_SYMLINK = 0x00100000, /* is a symlink */ FH_EXECABL = 0x00200000, /* file looked like it would run: * ends in .exe or .bat or begins with #! */ - FH_W95LSBUG = 0x00400000, /* set when lseek is called as a flag that + FH_LSEEKED = 0x00400000, /* set when lseek is called as a flag that * _write should check if we've moved beyond - * EOF, zero filling if so. */ + * EOF, zero filling or making file sparse + if so. */ FH_NOHANDLE = 0x00800000, /* No handle associated with fhandler. */ FH_NOEINTR = 0x01000000, /* Set if I/O should be uninterruptible. */ FH_FFIXUP = 0x02000000, /* Set if need to fixup after fork. */ @@ -167,6 +168,7 @@ class fhandler_base const char *unix_path_name; const char *win32_path_name; DWORD open_status; + DWORD fs_flags; HANDLE read_state; public: @@ -234,8 +236,8 @@ class fhandler_base return get_close_on_exec () ? &sec_none_nih : &sec_none; } - void set_check_win95_lseek_bug (int b = 1) { FHCONDSETF (b, W95LSBUG); } - bool get_check_win95_lseek_bug () { return FHISSETF (W95LSBUG); } + void set_did_lseek (int b = 1) { FHCONDSETF (b, LSEEKED); } + bool get_did_lseek () { return FHISSETF (LSEEKED); } bool get_need_fork_fixup () { return FHISSETF (FFIXUP); } void set_need_fork_fixup () { FHSETF (FFIXUP); } @@ -268,6 +270,10 @@ class fhandler_base void set_append_p (int val) { FHCONDSETF (val, APPEND); } void set_append_p () { FHSETF (APPEND); } + void set_fs_flags (DWORD flags) { fs_flags = flags; } + bool get_fs_flags (DWORD flagval = 0xffffffffUL) + { return (fs_flags & (flagval)); } + bool get_query_open () { return FHISSETF (QUERYOPEN); } void set_query_open (bool val) { FHCONDSETF (val, QUERYOPEN); } |