This is the mail archive of the cygwin 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]
Other format: [Raw text]

Re: zsh and line breaks


On Fri, 2 Apr 2004, Corinna Vinschen wrote:

> 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

Now, this may be what I'm looking for!  I don't suppose this is
documented anywhere?  One question: Zsh has several DLLs, several of
which open files.  Do I need to add this block of code to each DLL or
could I put it in one master DLL, which the others link in?

Thanks!

> Corinna

-- 
Peter A. Castro <doctor@fruitbat.org> or <Peter.Castro@oracle.com>
	"Cats are just autistic Dogs" -- Dr. Tony Attwood

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


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