delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/02/15/18:16:52

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <3A8C5599.EA52B4EC@ece.gatech.edu>
Date: Thu, 15 Feb 2001 17:18:01 -0500
From: "Charles S. Wilson" <cwilson AT ece DOT gatech DOT edu>
X-Mailer: Mozilla 4.75 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: "Larry Hall (RFK Partners, Inc)" <lhall AT rfk DOT com>
CC: cygwin AT sources DOT redhat DOT com
Subject: Re: Optimizing away "ReadFile" calls when Make calls stat()
References: <4 DOT 3 DOT 1 DOT 2 DOT 20010213134821 DOT 019a7130 AT pop DOT ma DOT ultranet DOT com>
<20010213190131 DOT 14369 DOT qmail AT lizard DOT curl DOT com>
<200102131935 DOT OAA09136 AT envy DOT delorie DOT com>
<20010213194612 DOT 17311 DOT qmail AT lizard DOT curl DOT com>
<200102131954 DOT OAA09284 AT envy DOT delorie DOT com>
<20010213152313 DOT A12830 AT redhat DOT com>
<39319402546 DOT 20010214110838 AT logos-m DOT ru> <4 DOT 3 DOT 1 DOT 2 DOT 20010215160534 DOT 04a66d40 AT pop DOT ma DOT ultranet DOT com>

"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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019