From owner-freebsd-hackers Fri Sep 20 16:37:27 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id QAA01269 for hackers-outgoing; Fri, 20 Sep 1996 16:37:27 -0700 (PDT) Received: from melb.werple.net.au (melb.werple.net.au [203.9.190.18]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id QAA01231 for ; Fri, 20 Sep 1996 16:37:23 -0700 (PDT) Received: (from uucp@localhost) by melb.werple.net.au (8.7.6/8.7.3/2) with UUCP id IAA25413; Sat, 21 Sep 1996 08:58:23 +1000 (EST) Received: (from jb@localhost) by freebsd3.cimlogic.com.au (8.7.5/8.7.3) id IAA13922; Sat, 21 Sep 1996 08:20:51 +1000 (EST) From: John Birrell Message-Id: <199609202220.IAA13922@freebsd3.cimlogic.com.au> Subject: Re: libc_r bug To: hsu@freefall.freebsd.org (Jeffrey Hsu) Date: Sat, 21 Sep 1996 08:20:51 +1000 (EST) Cc: hackers@FreeBSD.org, jb@cimlogic.com.au In-Reply-To: <199609200828.BAA01366@freefall.freebsd.org> from Jeffrey Hsu at "Sep 20, 96 01:28:29 am" X-Mailer: ELM [version 2.4ME+ PL22 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk > The following program exhibits a bug in the latest version of libc_r. > If the two lines are reversed, then everything's okay. > > main() > { > write(1, "hi", 2); > printf("hello world\n"); > } > I see. I assume write() is returning errno = EBADF. Try adding... _thread_fd_table_init(0); _thread_fd_table_init(1); _thread_fd_table_init(2); to _thread_init() [in uthread_init.c] after the loop that sets _thread_fd_table[i] to NULL. Regards, -- John Birrell CIMlogic Pty Ltd jb@cimlogic.com.au 119 Cecil Street Ph +61 3 9690 6900 South Melbourne Vic 3205 Fax +61 3 9690 6650 Australia Mob +61 18 353 137