From: Daniel Jacobowitz <drow@false.org>
To: gdb-patches@sourceware.org
Subject: Re: Windows semihosting (remote-fileio) fix for console reads
Date: Sat, 10 Jun 2006 23:44:00 -0000 [thread overview]
Message-ID: <20060610234357.GB10491@nevyn.them.org> (raw)
In-Reply-To: <uwtbopuny.fsf@gnu.org>
On Sun, Jun 11, 2006 at 12:28:33AM +0300, Eli Zaretskii wrote:
> That rings a bell, but I'll need to dig deep into old files to find
> out the details. In the meantime, could you please post a short test
> program that demonstrates this failure?
I'm afraid I don't have one; I tested by changing the size of the read
performed by remote-fileio, which requires a remote target and stub to
reproduce.
It turned out to be trivial to reproduce it manually though. Here.
Running this under Cygwin works (there, stdin is a pipe); this includes
running it from a Cygwin bash in a command terminal. But if you
Start->Run cmd.exe, and then run the test program, read will fail.
[Interestingly, if I use a stack buffer and it's far too small for the
read request, Cygwin returns EINVAL... nice trick.]
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
static char buf[32768];
int
main (int argc, char **argv)
{
int ret, err;
sprintf (buf, "Type something:\n");
write (1, buf, strlen (buf));
errno = 0;
ret = read (0, buf, 26609);
err = errno;
sprintf (buf, "read returned %d, errno %d\n", ret, err);
write (1, buf, strlen (buf));
return 0;
}
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2006-06-10 23:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-10 18:21 Daniel Jacobowitz
2006-06-10 21:28 ` Eli Zaretskii
2006-06-10 23:44 ` Daniel Jacobowitz [this message]
2006-06-11 19:33 ` Eli Zaretskii
2006-06-14 0:32 ` Jim Blandy
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=20060610234357.GB10491@nevyn.them.org \
--to=drow@false.org \
--cc=gdb-patches@sourceware.org \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox