mailing list of musl libc
 help / color / mirror / code / Atom feed
From: y38h5z@protonmail.com
To: "musl@lists.openwall.com" <musl@lists.openwall.com>
Subject: non-standard implementation of fflush()
Date: Thu, 21 Nov 2019 18:31:02 +0000	[thread overview]
Message-ID: <hWubjKhHb4ZfOGaZv79qXIyVWlWXwlqxkFR4yrVHEB9X2W2VPxj2Cv5RicGK3Ep8M3rd-CPtQJXyH4-dGSGeMnzbKmEwyS6hBSJghPJx__k=@protonmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 648 bytes --]

Hello everyone,

the implementation of fflush() in musl doesn't seem to conform to the opengroup standard:

https://pubs.opengroup.org/onlinepubs/009695399/functions/fflush.html

In addition to flushing unwritten data, which is expected, musl flushes the read buffer when calling fflush(). This leads to data loss in bidirectional communication uses. Other standard libraries don't do this.

As a reference compare musl to openbsd's libc:

https://git.musl-libc.org/cgit/musl/tree/src/stdio/fflush.c
https://github.com/openbsd/src/blob/master/lib/libc/stdio/fflush.c

I think this is unexpected behavior and should be changed.

Greetings,
  Michael

[-- Attachment #2: Type: text/html, Size: 1132 bytes --]

             reply	other threads:[~2019-11-21 18:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-21 18:31 y38h5z [this message]
2019-11-21 19:04 ` Rich Felker
     [not found]   ` <I6lA7ERFkqk6k724VlnK6OZT6Uy2zzixDgjODO9RLz0K0BW86wWppsTn8ockD67PPoO09kzCdwyXs6NZzTVf6kWj9VWtotdFS8doVeYzJck=@protonmail.com>
2019-11-21 22:58     ` Rich Felker
2019-11-23 21:35       ` y38h5z

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='hWubjKhHb4ZfOGaZv79qXIyVWlWXwlqxkFR4yrVHEB9X2W2VPxj2Cv5RicGK3Ep8M3rd-CPtQJXyH4-dGSGeMnzbKmEwyS6hBSJghPJx__k=@protonmail.com' \
    --to=y38h5z@protonmail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).