delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/09/01/13:31:50

X-Spam-Check-By: sourceware.org
Date: Fri, 1 Sep 2006 13:24:57 -0400
From: Christopher Faylor <cgf-no-personal-reply-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: cygwin fork()
Message-ID: <20060901172457.GA10511@trixie.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20060901100138 DOT GA7444 AT ns1 DOT anodized DOT com> <Pine DOT GSO DOT 4 DOT 63 DOT 0609011023420 DOT 13719 AT access1 DOT cims DOT nyu DOT edu> <20060901153709 DOT GC7663 AT ns1 DOT anodized DOT com> <20060901155403 DOT GE5926 AT trixie DOT casa DOT cgf DOT cx> <20060901160911 DOT GA30633 AT ns1 DOT anodized DOT com> <20060901163415 DOT GB30633 AT ns1 DOT anodized DOT com> <20060901170451 DOT GC30633 AT ns1 DOT anodized DOT com>
Mime-Version: 1.0
In-Reply-To: <20060901170451.GC30633@ns1.anodized.com>
User-Agent: Mutt/1.5.11
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Fri, Sep 01, 2006 at 10:04:51AM -0700, clayne AT anodized DOT com wrote:
>On Fri, Sep 01, 2006 at 09:34:15AM -0700, clayne AT anodized DOT com wrote:
>> BTW:
>> I started up filemon to watch what was going on from it's standpoint, and it
>> shows a huge number of READs on libtool, all SUCCESS, but the offset is always
>> 1 higher than previous, with a length of 1. Like it's literally reading the file
>> 1 byte at a time, then incrementing the offset - until it has fully been read.
>> 
>> -cl
>
>So right smack dab in the middle of _evalfile() under bash-3.1:
>
>#if defined (__CYGWIN__) && defined (O_TEXT)
>  setmode (fd, O_TEXT);
>#endif
>
>Also in read_comsub():
>
>#ifdef __CYGWIN__
>  setmode (fd, O_TEXT);         /* we don't want CR/LF, we want Unix-style */
>#endif
>
>And most importantly in open_shell_script():
>
>  /* Open the script.  But try to move the file descriptor to a randomly
>     large one, in the hopes that any descriptors used by the script will
>     not match with ours. */
>  fd = move_to_high_fd (fd, 0, -1);
>
>#if defined (__CYGWIN__) && defined (O_TEXT)
>  setmode (fd, O_TEXT);
>#endif
>
>The high fd part jives with the '255' seen in the readv() strace output as well.
>
>This post from 2000 looks related:
>
>http://ecos.sourceware.org/ml/cygwin/2000-10/msg00213.html
>
>In regards to setting the fd to textmode as a way of stripping CRs.
>Only problem is that it's making 213,110 syscalls for a 213k libtool
>script.  That cannot be an efficient way to remove CRs from input.

Opening a file with O_TEXT should not, AFAIK, cause a bunch of one-byte
reads.

A simple test case (tm) seems to confirm that.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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