From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13611 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: mkfifo buffer exhibiting unexpected behaviour Date: Wed, 16 Jan 2019 20:51:13 -0500 Message-ID: <20190117015113.GM23599@brightrain.aerifal.cx> References: <154768728054.8191.12261377846874978788@localhost.localdomain> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1547689763 10252 195.159.176.226 (17 Jan 2019 01:49:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 17 Jan 2019 01:49:23 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-13627-gllmg-musl=m.gmane.org@lists.openwall.com Thu Jan 17 02:49:19 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1gjwo1-0002XU-SY for gllmg-musl@m.gmane.org; Thu, 17 Jan 2019 02:49:17 +0100 Original-Received: (qmail 7545 invoked by uid 550); 17 Jan 2019 01:51:27 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 7525 invoked from network); 17 Jan 2019 01:51:26 -0000 Content-Disposition: inline In-Reply-To: <154768728054.8191.12261377846874978788@localhost.localdomain> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:13611 Archived-At: On Wed, Jan 16, 2019 at 08:08:00PM -0500, Steven Hum wrote: > Running this simple test using clock from sutils to produce a repeating one second interval input stream.. > > mkfifo fifo > clock -i 1 -sf "T> stream one" >fifo & > clock -i 1 -sf "D> stream two" >fifo & > cat fifo > > on void musl only the second fifo input stream is displayed. > on void glibc, both input streams are displayed interleaved as expected. > > Are fifo buffers handled differently under musl? No, aside from possible stdio buffering it's entirely a kernel matter. I looked up the sutils source and see it's flushing after each output, and tried it on an Alpine-based box here (with musl) and could not reproduce what you're seeing. Both outputs are visible and roughly interleaved (although their order sometimes swaps with scheduling, of course). Rich