mailing list of musl libc
 help / color / mirror / code / Atom feed
From: somethingfnothing <somethingfnothing@163.com>
To: "musl@lists.openwall.com " <musl@lists.openwall.com>
Subject: [musl] fputs stdout lost characters on nonblock tty
Date: Tue, 7 Mar 2023 20:42:37 +0800 (CST)	[thread overview]
Message-ID: <c74df3d.4bc5.186bc18576f.Coremail.somethingfnothing@163.com> (raw)

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

hi


I use fputs to write string to stdout, sometimes it will lost some characters, the error is EAGAIN, my tty is nonblock.


fputs did not handle this error, it reset the "wpos"  "wbase" "wend" and return -1 when recive error, thus the last characters was lost, and I cannot know how much characters was lost


I think fputs should retry write when recive EAGAIN since app cannot know how much characters was lost









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

             reply	other threads:[~2023-03-07 13:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-07 12:42 somethingfnothing [this message]
2023-03-07 13:18 ` Rich Felker

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=c74df3d.4bc5.186bc18576f.Coremail.somethingfnothing@163.com \
    --to=somethingfnothing@163.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).