From: Damian McGuckin <damianm@esi.com.au>
To: musl@lists.openwall.com
Subject: Re: [musl] errno not set to EBADF when reading from invalid descriptor
Date: Fri, 26 Jun 2020 15:39:51 +1000 (AEST) [thread overview]
Message-ID: <alpine.LRH.2.02.2006261518390.19500@key0.esi.com.au> (raw)
In-Reply-To: <20200626051400.GB13001@voyager>
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
next prev parent reply other threads:[~2020-06-26 5:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-25 13:21 Stefan Ciotec
2020-06-25 15:38 ` Rich Felker
2020-06-26 5:14 ` Markus Wichmann
2020-06-26 5:39 ` Damian McGuckin [this message]
2020-06-26 16:06 ` 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=alpine.LRH.2.02.2006261518390.19500@key0.esi.com.au \
--to=damianm@esi.com.au \
--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).