From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <44F70DD0.9090509@asgaard.homelinux.org> Date: Thu, 31 Aug 2006 18:26:56 +0200 From: =?ISO-8859-1?Q?=22Nils_O=2E_Sel=E5sdal=22?= User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] trying to understand how fork/pipe a filtering program References: <200608302246.k7UMkCd13963@demeter.cs.utwente.nl> In-Reply-To: <200608302246.k7UMkCd13963@demeter.cs.utwente.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: ac785588-ead1-11e9-9d60-3106f5b1d025 Axel Belinfante wrote: > after the suggestion of resample(1) some days ago > I've tried run it as a filter from another program. > this other program is non-threaded; for testing all > it does is call initdraw and read an image file > after which the resample routine is called. > > in my resample routine it seems I need a call to sleep > to avoid the resample program to hang (in Pread). > (replacing the sleep by a fprint(2, "something\n") works too). > > I'm just trying to understand what goes on - > is this the way to do this? if not, what am I missing? > I'm sorry if it is something obvious; I'm just trying to learn. Remember to close the pipe ends you don't need in the respective parent/child, as well as the original pipes after dup'ing them.