aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/dcrt0.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2024-03-08 20:57:06 +0100
committerCorinna Vinschen <corinna@vinschen.de>2024-03-08 20:57:06 +0100
commitf6b56abec1865f8da7632644210bae36b395569b (patch)
treecd8398dfcc6de0c948fbe8a8d2efbd697a7d47c5 /winsup/cygwin/dcrt0.cc
parentf2010ed78479b1b6b4518ea79acb6cd36514344f (diff)
downloadnewlib-f6b56abec1865f8da7632644210bae36b395569b.zip
newlib-f6b56abec1865f8da7632644210bae36b395569b.tar.gz
newlib-f6b56abec1865f8da7632644210bae36b395569b.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.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index a40129c..7229377 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