www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/04/02/02:47:10

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Date: Fri, 2 Apr 2004 09:45:50 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: zsh and line breaks
Message-ID: <20040402074550.GJ2598@cygbert.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <1vvf60l9i7n4nlobcroik2le5ofe6v2rn4 AT 4ax DOT com> <Pine DOT LNX DOT 4 DOT 53 DOT 0403291441160 DOT 5939 AT gremlin DOT fruitbat DOT org> <3372 DOT 1080639122 AT trentino DOT logica DOT co DOT uk> <Pine DOT LNX DOT 4 DOT 53 DOT 0403301047250 DOT 5939 AT gremlin DOT fruitbat DOT org> <2603 DOT 1080737128 AT trentino DOT logica DOT co DOT uk> <Pine DOT LNX DOT 4 DOT 53 DOT 0403310935450 DOT 9892 AT gremlin DOT fruitbat DOT org> <25057 DOT 1080810596 AT trentino DOT logica DOT co DOT uk> <Pine DOT LNX DOT 4 DOT 53 DOT 0404011224320 DOT 9892 AT gremlin DOT fruitbat DOT org> <Pine DOT GSO DOT 4 DOT 56 DOT 0404011646230 DOT 29906 AT slinky DOT cs DOT nyu DOT edu> <Pine DOT LNX DOT 4 DOT 53 DOT 0404011454580 DOT 9892 AT gremlin DOT fruitbat DOT org>
Mime-Version: 1.0
In-Reply-To: <Pine.LNX.4.53.0404011454580.9892@gremlin.fruitbat.org>
User-Agent: Mutt/1.4.2i

On Apr  1 15:11, Peter A. Castro wrote:
> On Thu, 1 Apr 2004, Igor Pechtchanski wrote:
> > I thought that that was what linking with automode.o did...
> 
> Hmmm... I'm not sure it'll help.  Doesn't automode open for read in text
> mode but open for write in binmode always (correct me if I'm wrong)?  If
> so, that's not really what I'm looking for.

You're right.  Automode.o is O_TEXT for reading and O_BINARY for writing.
If you only want O_TEXT for reading and the standard mode for writing,
you have to add your own version of a cygwin_premain0 function to your
binary, like I did in gawk:

  #ifdef __CYGWIN__
  #include <sys/cygwin.h>

  extern int _fmode;
  void
  cygwin_premain0 (int argc, char **argv, struct per_process *myself)
  {
    static struct __cygwin_perfile pf[] =
    {
      {"", O_RDONLY | O_TEXT},
      {NULL, 0}
    };
    cygwin_internal (CW_PERFILE, pf);
  }
  #endif


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

--
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