This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Optimizing away "ReadFile" calls when Make calls stat()


"Larry Hall (RFK Partners, Inc)" wrote:
>
> Sure, this is an idea for new, Cygwin specific code.  I'm not quite
> sure why someone who was writing new code (or changing old) wouldn't just
> use Win32 APIs to accomplish the required task though.  

If I were porting an old app from unix to cygwin, and wanted to tune
performance, I'd much rather do this:

#ifdef __CYGWIN__
	stat_select("foo", &st, ST_MODE | ST_MTIME);
#else
	stat("foo", &st);
#endif

Than this:

#ifdef __CYGWIN__
	lots of ugly Windows stuff here
	populate a fake st structure (if I don't do
		this, then I need lots more #ifdef 
		blocks in other parts of the code
		that references st->mode, etc.)
#else
	stat("foo", &st);
#endif

> I mean, so long as
> the change results in non-portable code, why not pick the less specific
> Win32 APIs (over some Cygwin-specific alternative)?  

I might not want to #include windows.h (which *REQUIRES* me to also
#define _WIN32 or compile with 'gcc -mwin32'.)  I might not want to
collude my native-win32-specific stuff with cygwin-specific stuff (which
will happen if I'm forced to #define _WIN32) 

> Still, if you want to
> implement such a patch and submit it, I'm sure it will get some thoughtful
> consideration.

I certainly hope so.

--Chuck

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]