From: Martin Stromberg Message-Id: <200106060720.JAA10029@lws256.lu.erisoft.se> Subject: Re: scratch _IOAPPEND To: djgpp-workers AT delorie DOT com Date: Wed, 6 Jun 2001 09:20:32 +0200 (MET DST) In-Reply-To: <3B1CE5F4.8282.A748BA@localhost> from "Mark E." at Jun 05, 2001 02:00:20 PM X-Mailer: ELM [version 2.5 PL3] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 Precedence: bulk > > Here's my patch to eliminate _IOAPPEND. I also took Martin's suggestion from > a while back and added/used __get_fd_flags. Great! > ! if (__has_fd_properties(fileno(f)) > ! && (__get_fd_flags(fileno(f)) & FILE_DESC_APPEND)) > { ... > + static __inline__ unsigned long __get_fd_flags(int _fd) > + { > + return __fd_properties[_fd]->flags; > + } I was thinking of having __get_fd_flags( fd ) do "if (__has_fd_properties( fd )) { return ( __get_fd_flags( fd )); } else { return( 0 ); }" Then for testing a flag we could just do "__get_fd_flags( ffileno( f ) ) & SOME_FLAG" instead of "if (__has_fd_properties(fileno(f)) && (__get_fd_flags(fileno(f)) & SOME_FLAG))". Because if there aren't any fd_properties no flags can be set! What do you think? Right, MartinS