From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20134 invoked by alias); 10 Jun 2006 21:28:40 -0000 Received: (qmail 20124 invoked by uid 22791); 10 Jun 2006 21:28:39 -0000 X-Spam-Check-By: sourceware.org Received: from romy.inter.net.il (HELO romy.inter.net.il) (192.114.186.66) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 10 Jun 2006 21:28:36 +0000 Received: from HOME-C4E4A596F7 (IGLD-83-130-4-151.inter.net.il [83.130.4.151]) by romy.inter.net.il (MOS 3.7.3-GA) with ESMTP id EVT36520 (AUTH halo1); Sun, 11 Jun 2006 00:28:32 +0300 (IDT) Date: Sat, 10 Jun 2006 21:28:00 -0000 Message-Id: From: Eli Zaretskii To: gdb-patches@sourceware.org In-reply-to: <20060610182130.GA3527@nevyn.them.org> (message from Daniel Jacobowitz on Sat, 10 Jun 2006 14:21:31 -0400) Subject: Re: Windows semihosting (remote-fileio) fix for console reads Reply-to: Eli Zaretskii References: <20060610182130.GA3527@nevyn.them.org> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-06/txt/msg00127.txt.bz2 > Date: Sat, 10 Jun 2006 14:21:31 -0400 > From: Daniel Jacobowitz > > 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.