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.3 required=5.0 tests=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 5508 invoked from network); 26 Jun 2020 05:40:13 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 26 Jun 2020 05:40:13 -0000 Received: (qmail 7859 invoked by uid 550); 26 Jun 2020 05:40:07 -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 7838 invoked from network); 26 Jun 2020 05:40:07 -0000 X-Authentication-Warning: key0.esi.com.au: damianm owned process doing -bs Date: Fri, 26 Jun 2020 15:39:51 +1000 (AEST) From: Damian McGuckin To: musl@lists.openwall.com In-Reply-To: <20200626051400.GB13001@voyager> Message-ID: References: <20200625153803.GO6430@brightrain.aerifal.cx> <20200626051400.GB13001@voyager> User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Subject: Re: [musl] errno not set to EBADF when reading from invalid descriptor On Fri, 26 Jun 2020, Markus Wichmann wrote: > 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? Certainly STDIO allows this, but you need to be very careful. about doing it. Years ago, I would send a string down a serial line opened Read/Write, as an atomic write, and then immediately, sit on the line waiting for a reply on the same serial line. I was simply trying to retreive the Postscript handshake between the system and the printer which was a very small number of characters. Doing it with 2 FILEs is much smarter for the general case. Regards - Damian Pacific Engineering Systems International, 277-279 Broadway, Glebe NSW 2037 Ph:+61-2-8571-0847 .. Fx:+61-2-9692-9623 | unsolicited email not wanted here Views & opinions here are mine and not those of any past or present employer