From owner-freebsd-current@FreeBSD.ORG Tue Nov 25 05:46:53 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3F1B916A4CE for ; Tue, 25 Nov 2003 05:46:53 -0800 (PST) Received: from mail.rdslink.ro (mail.rdslink.ro [193.231.236.20]) by mx1.FreeBSD.org (Postfix) with ESMTP id 612BD43F93 for ; Tue, 25 Nov 2003 05:46:50 -0800 (PST) (envelope-from enache@rdslink.ro) Received: (qmail 3173 invoked from network); 25 Nov 2003 13:46:57 -0000 Received: from unknown (HELO ratsnest.hole) (10.100.0.57) by mail.rdslink.ro with SMTP; 25 Nov 2003 13:46:57 -0000 Date: Tue, 25 Nov 2003 16:46:24 +0200 From: Enache Adrian To: "Jacques A. Vidrine" Message-ID: <20031125144624.GA1088@ratsnest.hole> References: <20031123141408.GA1426@ratsnest.hole> <20031124174457.GB27782@madman.celabo.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031124174457.GB27782@madman.celabo.org> User-Agent: Mutt/1.4i cc: current@freebsd.org Subject: Re: [PATCH] libc_r bug: successful close(2) sets errno to ENOTTY X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Nov 2003 13:46:53 -0000 On Mon, Nov 24, 2003 a.d., Jacques A. Vidrine wrote: > The application is broken. You must only check errno if you get an > error indication from the library call. Sorry, but I don't see your point. I know when to check for errno. If you took the little illustrating program for a real life example of the use of errno, that's unfortunate :-) The problem is that the emulated/wrapped close from libc_r does not behave like the real one. libc_r is leaking some of its guts (the tricks it's doing with O_NONBLOCK, etc) in the interface. This is technically a bug. The fix was trivial. Regards, Adi