From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 3123 invoked from network); 26 Jun 2020 05:14:17 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 26 Jun 2020 05:14:17 -0000 Received: (qmail 23803 invoked by uid 550); 26 Jun 2020 05:14:13 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 23782 invoked from network); 26 Jun 2020 05:14:13 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1593148441; bh=Yykdgqn3akul8kLiiuRTSoz6TiHuP5FgI1vq3BMrob0=; h=X-UI-Sender-Class:Date:From:To:Subject:References:In-Reply-To; b=RzzMx4MUXNfs3wMQ4WAUdnNOGtB+FCUMqtFDdTCE8imUQwqkyhRM7vvNFDAXwx1Y5 FHrwZ4cj9o7Abp6klxjq1MrhdiKxw/si2bO5PBNuy5M1S/S+/pqOFIUHW6xRqKZtwK IzfMIFZfDcWGZFNrzmIQxjms9GTUDqKTM1ut80Sg= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Date: Fri, 26 Jun 2020 07:14:00 +0200 From: Markus Wichmann To: musl@lists.openwall.com Message-ID: <20200626051400.GB13001@voyager> References: <20200625153803.GO6430@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200625153803.GO6430@brightrain.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C4FHly+0WyP2Ll6WIf2rRCJMM4GnJGvI8BsEB8vY2e7rzzWFVTQDx GGxsDiv+t2BAB7bV3jcOzehyrT2blw9db6yPPS5vU7MB7ZlpOW8K3b3A1e5wEoPCjPTeBvNEi KB52nZej8BuGuPdgcx0tbU5OG10WwkZvoSmd01WFLryS1x3FVSi//t+eS8y3YTlQ3pN+6DaxQ 9TdRY7rKrMFHQQZKyN3VoTgJRtzkvC0c5OG5SWhWmYRC5Af7bBiKgGo9dbwkih0ceIndgHbyK cXcg17kTHVUR17yQsc2ppqknevouyyh0KqLv3zt7WkyTXgjUYrzhx3ilP/XfR1vXSAiO1ubvo oZ8b3bbsZit3eEsy1oRSKTF11G2vRtqtlTo5IJyOIhSfg14Dx0OZCLsnvSNvR4ju+sbcHdhP+ /pI5VWykbfSOOcWNGIPCVXDPGR/b/WZzjrE4OiOgond3fFdQv1G2iq/JNPdFrGsDVj201/+MW GwmUUDyZlXuH8kENL Content-Transfer-Encoding: quoted-printable Subject: Re: [musl] errno not set to EBADF when reading from invalid descriptor On Thu, Jun 25, 2020 at 11:38:04AM -0400, Rich Felker wrote: > Note that there are lots of other reasons you can't safely use stdio > read functions on a stream you don't know is suitable for it. > Switching from writing to reading without a successful flush produces > UB, and switching the other direction without a successful seek does, > even if the FILE stream is open for both. > > Rich So I can't actually use a FILE open for reading and writing that refers to something non-seekable, like a serial line, to both read and write to it? I mean, I suppose I could write something and then flush and stay in read mode forever, but that is not really the nature of my application. I suppose I'll just open the serial line twice. Ciao, Markus