From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roger Leigh Subject: Re: LPT timeout and forcing a flush Date: Wed, 21 Sep 2005 13:25:01 +0100 Message-ID: <20050921122501.GB22140@epictechnology.co.uk> References: <20050920143932.GA27010@epictechnology.co.uk> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-msdos-owner@vger.kernel.org List-Id: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-msdos@vger.kernel.org On Wed, Sep 21, 2005 at 09:33:24AM +1200, Bart Oldeman wrote: > On Tue, 20 Sep 2005, Roger Leigh wrote: > > >I'm abusing INT 17h. Is there a cleaner (or at least, approved) > >way of doing this? > > have a look at 1.3.2 or CVS: the flushing on dosemu's side was removed. > Instead the byte from int17 is written directly to the file/pipe, and C > stdio is set to use line buffering (_IOLBF), so the C library flushes > every \n. > > Then the tick/timeout causes an fclose() of the printer file (or pipe). That sounds a lot better. Unfortunately, not all the data I'm sending is line buffered. Some are sequences of control codes I want the device to respond to immediately: it's these I need to flush by hand. Regards, Roger