diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2024-03-08 20:57:06 +0100 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2024-03-11 15:29:32 +0100 |
commit | c1cf14a871528d1adba88a0128813b58d52ba926 (patch) | |
tree | bb3e9859c5113420a8fb647011394eee204a36cc /winsup/cygwin/dcrt0.cc | |
parent | f6be372ace889afa12163bd2c8a9cb717d7eff85 (diff) | |
download | newlib-c1cf14a871528d1adba88a0128813b58d52ba926.zip newlib-c1cf14a871528d1adba88a0128813b58d52ba926.tar.gz newlib-c1cf14a871528d1adba88a0128813b58d52ba926.tar.bz2 |
Cygwin: try to avoid recalling offline files
Chances are high that Cygwin recalls offline files from remote
storage, even if the file is only accessed during stat(2) or
readdir(3).
To avoid this
- make sure Cygwin is placeholder-aware,
- open files in path_conv handling, as well as in stat(2)/readdir(3)
scenarios with FILE_OPEN_NO_RECALL, and
- during symlink checking or testing for executablility, don't even
try to open the file if one of the OFFLINE attributes is set.
Reported-by: Marcin Wisnicki <mwisnicki@gmail.com>
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r-- | winsup/cygwin/dcrt0.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index fc1eec7..ea6a18b 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -809,6 +809,9 @@ dll_crt0_1 (void *) if (dynamically_loaded) sigproc_init (); + /* Call this before accessing any files. */ + RtlSetProcessPlaceholderCompatibilityMode (PHCM_EXPOSE_PLACEHOLDERS); + check_sanity_and_sync (user_data); /* Initialize malloc and then call user_shared_initialize since it relies |