--- src/winsup/cygwin/environ.cc 2002-05-24 22:22:50.000000000 -0400 +++ src-new/winsup/cygwin/environ.cc 2002-05-26 16:23:31.000000000 -0400 @@ -36,6 +36,7 @@ extern BOOL allow_winsymlinks; extern BOOL strip_title_path; extern int pcheck_case; extern int subauth_id; +extern BOOL stat_open_noread; BOOL reset_com = FALSE; static BOOL envcache = TRUE; @@ -525,6 +526,7 @@ static struct parse_thing {"title", {&display_title}, justset, NULL, {{FALSE}, {TRUE}}}, {"tty", {NULL}, set_process_state, NULL, {{0}, {PID_USETTY}}}, {"winsymlinks", {&allow_winsymlinks}, justset, NULL, {{FALSE}, {TRUE}}}, + {"statquery", {&stat_open_noread}, justset, NULL, {{FALSE},{TRUE}}}, {NULL, {0}, justset, 0, {{0}, {0}}} }; --- src/winsup/cygwin/fhandler_disk_file.cc 2002-05-24 01:44:10.000000000 -0400 +++ src-new/winsup/cygwin/fhandler_disk_file.cc 2002-05-26 16:05:46.000000000 -0400 @@ -31,6 +31,8 @@ details. */ #define _COMPILING_NEWLIB #include +BOOL stat_open_noread; + static int num_entries (const char *win32_name) { @@ -72,7 +74,7 @@ fhandler_disk_file::fstat (struct __stat if (!pc) return fstat_helper (buf); - if ((oret = open (pc, open_flags, 0))) + if (!stat_open_noread && (oret = open (pc, open_flags, 0))) /* ok */; else { --- src/winsup/cygwin/ChangeLog 2002-05-24 22:22:50.000000000 -0400 +++ src-new/winsup/cygwin/ChangeLog 2002-05-26 17:29:11.000000000 -0400 @@ -1,3 +1,12 @@ +2002-05-26 Don Bowman + + * Add new CYGWIN option, 'statquery', which causes the + stat() call to use the set_query_open(TRUE) all the time. + This significantly improves performance on e.g. ls -lR + operation. It would appear the CreateFile() on windows + reads a good chunk of the file when called for reading, + which isn't needed by stat(). + 2002-05-24 Christopher Faylor Remove unneeded sync.h, where appropriate, throughout.