From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/134 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: cluts: Incorrect test expectations in buf module (errno) Date: Wed, 13 Jul 2011 09:51:24 -0400 Message-ID: <20110713135124.GC16618@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1310565657 2986 80.91.229.12 (13 Jul 2011 14:00:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 13 Jul 2011 14:00:57 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-218-gllmg-musl=m.gmane.org@lists.openwall.com Wed Jul 13 16:00:54 2011 Return-path: Envelope-to: gllmg-musl@lo.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by lo.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Qgzzg-0005F6-FL for gllmg-musl@lo.gmane.org; Wed, 13 Jul 2011 16:00:52 +0200 Original-Received: (qmail 11966 invoked by uid 550); 13 Jul 2011 14:00:51 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 11958 invoked from network); 13 Jul 2011 14:00:51 -0000 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:134 Archived-At: Hi, It seems cluts' buf module is surprised that strerror_r and ttyname_r did not set errno to ERANGE. However these functions are not specified to report anything in errno. Instead they return the error code directly. This is an unfortunate inconsistency created in the early days of "reentrant" (_r) functions due to confusion over whether errno could be safely used in multithreaded programs. Note that some other functions which return error codes directly are: posix_* (posix_memalign etc.) pthread_* Rich