This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Windows semihosting (remote-fileio) fix for console reads
- From: Eli Zaretskii <eliz at gnu dot org>
- To: gdb-patches at sourceware dot org
- Date: Sun, 11 Jun 2006 00:28:33 +0300
- Subject: Re: Windows semihosting (remote-fileio) fix for console reads
- References: <20060610182130.GA3527@nevyn.them.org>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Sat, 10 Jun 2006 14:21:31 -0400
> From: Daniel Jacobowitz <drow@false.org>
>
> Here's the problem: a customer tried to use the remote file I/O protocol to
> read from standard input. Trivial little program, just a read() from stdin
> followed by a write() to stdout. Read was returning -1. A well-placed
> printf discovered that this was actually ENOMEM.
>
> By trial and error, we worked out that on the system we were using a read of
> 26609 bytes from the console, or more, would always return ENOMEM. Given
> 26608 bytes or less, it would succeed normally. Please don't ask me what
> that number means. No, it does not vary with the size of the malloced
> buffer.
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?
Thanks.