delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/09/23/13:36:34

From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Martin Str|mberg <ams AT ludd DOT luth DOT se>
Cc: djgpp-workers AT delorie DOT com
In-reply-to: <200009171747.TAA19977@father.ludd.luth.se> (message from Martin
Str|mberg on Sun, 17 Sep 2000 19:47:27 +0200 (MET DST))
Subject: Re: FSEXT and write()
References: <200009171747 DOT TAA19977 AT father DOT ludd DOT luth DOT se>
Message-Id: <20000923173532.01A4D23146@titan.progiciels-bpi.ca>
Date: Sat, 23 Sep 2000 13:35:32 -0400 (EDT)
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: Martin Str|mberg <ams AT ludd DOT luth DOT se>
> Date: Sun, 17 Sep 2000 19:47:27 +0200 (MET DST)
> 
>   if(__file_handle_modes[handle] & O_BINARY)
>     return _write(handle, buf, count);
> 
>   /* Let's handle FSEXT_write ! */
>   if(func &&                            /* if handler is installed, ...*/
>      func(__FSEXT_write, &rv, &handle)) /* ... call extension ... */
>       return rv;                        /* ... and exit if handled. */
> 
> This seems to mean that if a file is open()ed with O_BINARY, the FSEXT
> won't be called.

It *will* be called: by `_write' itself.

The normal case is for the FSEXT to be called by the lowest-level
primitives, just before DOS is called.  In this case, that's `_write',
not `write'.  The fact that here `write' calls an FSEXT is an
exception rather than a rule.  This code was added to `write' in
preparation for v2.03, to fix a bug whereby FSEXT was not called on
text-mode writes, because `write' wasn't calling `_write' for text
files...

- Raw text -


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