From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3901 invoked by alias); 14 Jun 2006 00:32:46 -0000 Received: (qmail 3893 invoked by uid 22791); 14 Jun 2006 00:32:45 -0000 X-Spam-Check-By: sourceware.org Received: from potter.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 14 Jun 2006 00:32:44 +0000 Received: (qmail 25506 invoked from network); 14 Jun 2006 00:32:42 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 14 Jun 2006 00:32:42 -0000 To: drow@false.org Cc: gdb-patches@sourceware.org Subject: Re: Windows semihosting (remote-fileio) fix for console reads References: <20060610182130.GA3527@nevyn.them.org> <20060610234357.GB10491@nevyn.them.org> From: Jim Blandy Date: Wed, 14 Jun 2006 00:32:00 -0000 In-Reply-To: (Eli Zaretskii's message of "Sun, 11 Jun 2006 22:33:17 +0300") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/msg00208.txt.bz2 Eli Zaretskii writes: >> Date: Sat, 10 Jun 2006 19:43:57 -0400 >> From: Daniel Jacobowitz >> >> #include >> #include >> #include >> #include >> >> 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; >> } > > I tried this on two XP boxes: on one, 26609 was the smallest value > that failed, on the other it started to fail with 31005. Go figure. > > Anyway, I suggest to go for 16K; 8K sounds too conservative. The patch looks okay to me; I agree with Eli's suggestion.