diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2001-09-12 17:46:37 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2001-09-12 17:46:37 +0000 |
commit | ba94682838272afc87b73833c02aaf6cea40815e (patch) | |
tree | 33443e904759c4bb192f674b2e8c30c59641f138 /winsup/cygwin/fhandler.cc | |
parent | c88bb51c3ca08f1cf79dd0215ff5f46817267ddb (diff) | |
download | cygnal-ba94682838272afc87b73833c02aaf6cea40815e.tar.gz cygnal-ba94682838272afc87b73833c02aaf6cea40815e.tar.bz2 cygnal-ba94682838272afc87b73833c02aaf6cea40815e.zip |
* Makefile.in: Build wincap.o.
* wincap.cc: New file.
* wincap.h: Ditto.
* autoload.cc: Add dynamic load statement for `CreateHardLinkA'.
* dcrt0.cc (os_being_run): Eliminated.
(osname): Ditto.
(iswinnt): Ditto.
(set_os_type): Ditto.
(dll_crt0_1): Call wincap.init() instead of set_os_type().
(_dll_crt0): Ditto.
* environ.cc (set_chunksize): New function.
(parse_thing): `forkchunk' setting now invokes function `set_chunksize'.
* fork.cc (chunksize): Eliminated. Moved to be member of wincap.
* host_dependent.h: Removed.
* syscalls.cc (_link): Try using `CreateHardLinkA' first, if available.
* cygheap.cc, dcrt0.cc, delqueue.cc, dir.cc,
environ.cc, fhandler.cc, fhandler.h, fhandler_console.cc,
fhandler_mem.cc, fork.cc, mmap.cc, net.cc, pinfo.cc, pinfo.h,
security.cc, syscalls.cc, sysconf.cc, syslog.cc, thread.cc,
times.cc, tty.cc, uinfo.cc, uname.cc, winsup.h: Use new wincap
capability check throughout.
* winsup.h: Include wincap.h. Eliminate extern declarations of
`os_being_run' and `iswinnt'. Eliminate `os_type" definition.
* include/cygwin/version.h: Bump version to 1.3.4.
Diffstat (limited to 'winsup/cygwin/fhandler.cc')
-rw-r--r-- | winsup/cygwin/fhandler.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index e8902562f..270c0d319 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -24,7 +24,6 @@ details. */ #include "cygheap.h" #include "path.h" #include "shared_info.h" -#include "host_dependent.h" static NO_COPY const int CHUNK_SIZE = 1024; /* Used for crlf conversions */ @@ -364,7 +363,7 @@ fhandler_base::open (int flags, mode_t mode) set_append_p(); /* These flags are host dependent. */ - shared = host_dependent.shared; + shared = wincap.shared (); file_attributes = FILE_ATTRIBUTE_NORMAL; if (flags & O_DIROPEN) @@ -579,7 +578,7 @@ fhandler_base::write (const void *ptr, size_t len) if (get_append_p ()) SetFilePointer (get_handle(), 0, 0, FILE_END); - else if (!iswinnt && get_check_win95_lseek_bug ()) + else if (wincap.has_lseek_bug () && get_check_win95_lseek_bug ()) { /* Note: this bug doesn't happen on NT4, even though the documentation for WriteFile() says that it *may* happen on any OS. */ @@ -1419,14 +1418,14 @@ fhandler_disk_file::lock (int cmd, struct flock *fl) if (win32_len == 0) { win32_len = 0xffffffff; - win32_upper = host_dependent.win32_upper; + win32_upper = wincap.lock_file_highword (); } else win32_upper = 0; BOOL res; - if (iswinnt) + if (wincap.has_lock_file_ex ()) { DWORD lock_flags = (cmd == F_SETLK) ? LOCKFILE_FAIL_IMMEDIATELY : 0; lock_flags |= (fl->l_type == F_WRLCK) ? LOCKFILE_EXCLUSIVE_LOCK : 0; |