From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13835 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: James Larrowe Newsgroups: gmane.linux.lib.musl.general Subject: fgets() doesn't call fsync() before getting input Date: Thu, 21 Feb 2019 10:09:03 -0500 Message-ID: Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="000000000000a14ae7058268dbdb" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="208235"; mail-complaints-to="usenet@blaine.gmane.org" To: musl@lists.openwall.com Original-X-From: musl-return-13851-gllmg-musl=m.gmane.org@lists.openwall.com Thu Feb 21 16:09:33 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.89) (envelope-from ) id 1gwpyd-000s1x-0F for gllmg-musl@m.gmane.org; Thu, 21 Feb 2019 16:09:31 +0100 Original-Received: (qmail 24275 invoked by uid 550); 21 Feb 2019 15:09:28 -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 24239 invoked from network); 21 Feb 2019 15:09:28 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=NI+ijTkvXfdiUwX+sWlRMe/yIRAlM4esDoFMSboEep8=; b=OGSsEz5EsvM6FKptYCDVXupwKXkrJ8yRylXgn4/luMw3AVYV1WqCbAe77UvwPLknHL +LGPBnF8el0fsMpEx+TvhRQ7A2Siyky5qhCIDhwcDsJD+aGhpydTxkhVwgJOjBEua7Oe 4bzB7bpINg5rFkk8xvxgazaEN/3X3mZCzg2YjDRknxTOV7vyz50LermTIVYcs/Kf3vDW uzmorC3S1p4xr4FgmeVFkI97WN4X6P3+UgV9xo1uIT3qrVaBPDsSHG2kuXe51ZMkcUOV s3uLcD/jgp39UaIxUjXe2EakL4nikid0+Hg2xq8wcTgaa5GbJicNI9Z+q2f8v21sAmt1 OSnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=NI+ijTkvXfdiUwX+sWlRMe/yIRAlM4esDoFMSboEep8=; b=KFSujbKVDSUfBy61Seb03r2VsHTbdQDu9ohxBCvpjixb8HsUZssPgKzp4TA2U7bqV7 lZJ5ylVOo+TXnKYSU8ZhFJX6/RkgFnFs1Z+sqmywOJ9nLW4koBc7iY4K9I0M9JBWPJhZ HqWBS9Ps8n9pDrUUW5Mv7V3vpJS04ZV0sIi8kp7+EdySxNDkWctmfOF8DySeOt9IyJU7 NAT7mazBzpwHUTJKajI/jD6C7h1Fu6t0Kb675tgblOGua6wJh15TNUo+TccWgMJXib5K A76i8jiqOYBEFwER1IWTAzLfqXOMqjsy/3HxsWxLwplH7mLQauso84NNktftCzVnKwBe 49Sw== X-Gm-Message-State: AHQUAuZ9Q2w6GYPk6SSaE5jY5C9kvI46e5pPCRQC5iqAq7/GK0fDVD4o eCL/M/hIjPiCHwdiLjFXo3DYIQeFspV10wKhk8SxRQ== X-Google-Smtp-Source: AHgI3IaHXerDHjIij4XOWMYJ0GaKDVTB4YYDGm3vi+Nrw+lRMk+UlzT6s6jG6rrmy+aUDP9IgsXL5rDhC5pTWA14y/4= X-Received: by 2002:a50:a3d5:: with SMTP id t21mr26264655edb.87.1550761756528; Thu, 21 Feb 2019 07:09:16 -0800 (PST) Xref: news.gmane.org gmane.linux.lib.musl.general:13835 Archived-At: --000000000000a14ae7058268dbdb Content-Type: multipart/alternative; boundary="000000000000a14ae3058268dbd9" --000000000000a14ae3058268dbd9 Content-Type: text/plain; charset="UTF-8" I'm writing a program that prints a dialogue to the screen and then asks for input. In musl, the dialogue does not show before fgets() is called, however in glibc it does. That causes a blank prompt and also some confusion. Attached is a minimal example and a log. --000000000000a14ae3058268dbd9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'm writing a program that prints a dialogue to the sc= reen and then asks for input. In musl, the dialogue does not show before fg= ets() is called, however in glibc it does. That causes a blank prompt and a= lso some confusion. Attached is a minimal example and a log.
--000000000000a14ae3058268dbd9-- --000000000000a14ae7058268dbdb Content-Type: application/octet-stream; name="minimal-example.c" Content-Disposition: attachment; filename="minimal-example.c" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_jserhumh0 I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbigpCnsKCWNoYXIgYnVmWzldOwoKCWZwdXRzKCJF bnRlciBhIHNldmVuIGxldHRlciB3b3JkOiAiLCBzdGRvdXQpOwoJZmdldHMoYnVmLCA5LCBzdGRp bik7CglwcmludGYoIllvdXIgd29yZCBpcyAlcyIsIGJ1Zik7CglyZXR1cm4gMDsKfQo= --000000000000a14ae7058268dbdb Content-Type: application/octet-stream; name=log Content-Disposition: attachment; filename=log Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_jseri00n1 Y2hyb25vc0Bsb2NhbGhvc3Qgfi9Eb3dubG9hZHMgJCBnY2MgbWluaW1hbC1leGFtcGxlLmMgCmNo cm9ub3NAbG9jYWxob3N0IH4vRG93bmxvYWRzICQgLi9hLm91dCAgCkVudGVyIGEgc2V2ZW4gbGV0 dGVyIHdvcmQ6IGxldHRlcnMKWW91ciB3b3JkIGlzIGxldHRlcnMKY2hyb25vc0Bsb2NhbGhvc3Qg fi9Eb3dubG9hZHMgJCBtdXNsLWdjYyBtaW5pbWFsLWV4YW1wbGUuYyAKY2hyb25vc0Bsb2NhbGhv c3Qgfi9Eb3dubG9hZHMgJCAuL2Eub3V0IApsZXR0ZXJzCkVudGVyIGEgc2V2ZW4gbGV0dGVyIHdv cmQ6IFlvdXIgd29yZCBpcyBsZXR0ZXJzCg== --000000000000a14ae7058268dbdb--