mailing list of musl libc
 help / color / mirror / code / Atom feed
* mkfifo buffer exhibiting unexpected behaviour
@ 2019-01-17  1:08 Steven Hum
  2019-01-17  1:51 ` Rich Felker
  2019-01-17 11:45 ` Szabolcs Nagy
  0 siblings, 2 replies; 3+ messages in thread
From: Steven Hum @ 2019-01-17  1:08 UTC (permalink / raw)
  To: musl

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?

Regards,
Steven



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: mkfifo buffer exhibiting unexpected behaviour
  2019-01-17  1:08 mkfifo buffer exhibiting unexpected behaviour Steven Hum
@ 2019-01-17  1:51 ` Rich Felker
  2019-01-17 11:45 ` Szabolcs Nagy
  1 sibling, 0 replies; 3+ messages in thread
From: Rich Felker @ 2019-01-17  1:51 UTC (permalink / raw)
  To: musl

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: mkfifo buffer exhibiting unexpected behaviour
  2019-01-17  1:08 mkfifo buffer exhibiting unexpected behaviour Steven Hum
  2019-01-17  1:51 ` Rich Felker
@ 2019-01-17 11:45 ` Szabolcs Nagy
  1 sibling, 0 replies; 3+ messages in thread
From: Szabolcs Nagy @ 2019-01-17 11:45 UTC (permalink / raw)
  To: musl; +Cc: Steven Hum

* Steven Hum <sdothum@gmail.com> [2019-01-16 20:08:00 -0500]:
> 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.

maybe it was a regular file then, add ls -l before between
and after the clock calls.

if it's always a pipe then run the entire script under strace -f
to see what the clocks are doing.

> on void glibc, both input streams are displayed interleaved as expected.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-17 11:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-17  1:08 mkfifo buffer exhibiting unexpected behaviour Steven Hum
2019-01-17  1:51 ` Rich Felker
2019-01-17 11:45 ` Szabolcs Nagy

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).