X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f Sender: rich AT phekda DOT freeserve DOT co DOT uk Message-ID: <3CAD6FE7.1384C841@phekda.freeserve.co.uk> Date: Fri, 05 Apr 2002 10:35:35 +0100 From: Richard Dawe X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.19 i586) X-Accept-Language: de,fr MIME-Version: 1.0 To: djgpp-workers AT delorie DOT com Subject: Re: redirection problem with perl References: <3CAB1FDB DOT 68F9CF2F AT phekda DOT freeserve DOT co DOT uk> <7704-Fri05Apr2002112312+0300-eliz AT is DOT elta DOT co DOT il> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Hello. Eli Zaretskii wrote: > > Richard Dawe wrote: > [snip] > > BTW _creatnew seems to ignore the flags that are passed to it. For > > instance, if you try to create a new file in write-only mode, then > > _creatnew ignores the write-only flag and opens it read-write. > > That sounds like a bug that should be fixed, but could you please > elaborate? Where does _creatnew ignore the flags? I see the code > does use the value of flags when it invokes system calls. src/libc/dos/io/_creat_n.c, lines 31, 32: r.x.bx = 0x2002 | (flags & 0xfff0); /* r/w, no Int 24h, use caller-defined flags */ The bottom four bits specify the open mode. Here we override what the user specified with 2, which is read-write. _creatnew is used in the following sources: ansi/stdio/tmpfile.c compat/stdio/mkstemp.c posix/fcntl/open.c The calls to _creatnew in ansi/stdio/tmpfile.c and compat/stdio/mkstemp.c don't specify any flags in the call to open. If we fix the bug in _creatnew, we should probably specify the flags in those calls to open. Thanks, bye, Rich =] -- Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]