From owner-freebsd-ports@FreeBSD.ORG Fri Dec 23 18:04:57 2005 Return-Path: X-Original-To: freebsd-ports@freebsd.org Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 93A3C16A41F for ; Fri, 23 Dec 2005 18:04:57 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from pi.codefab.com (pi.codefab.com [199.103.21.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1C4E643D5E for ; Fri, 23 Dec 2005 18:04:57 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from localhost (localhost [127.0.0.1]) by pi.codefab.com (Postfix) with ESMTP id 49B6E5D5D; Fri, 23 Dec 2005 13:04:56 -0500 (EST) Received: from pi.codefab.com ([127.0.0.1]) by localhost (pi.codefab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 04367-02; Fri, 23 Dec 2005 13:04:55 -0500 (EST) Received: from [199.103.21.238] (pan.codefab.com [199.103.21.238]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by pi.codefab.com (Postfix) with ESMTP id 6040A5C56; Fri, 23 Dec 2005 13:04:55 -0500 (EST) In-Reply-To: <200512231744.RAA06461@sopwith.solgatos.com> References: <200512231744.RAA06461@sopwith.solgatos.com> Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <256A38E9-6787-409A-B5C2-141D8336A42C@mac.com> Content-Transfer-Encoding: 7bit From: Charles Swiger Date: Fri, 23 Dec 2005 13:04:54 -0500 To: Dieter X-Mailer: Apple Mail (2.746.2) X-Virus-Scanned: amavisd-new at codefab.com Cc: freebsd-ports@freebsd.org Subject: Re: compiler can't tell int from function? nmh-1.0.4 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Dec 2005 18:04:57 -0000 On Dec 23, 2005, at 4:44 AM, Dieter wrote: >> See errno(2), errno is redefined like this >> #define errno (* __error()) >> in /usr/include/errno.h > > Oh! Someone changed errno from an int to a function, breaking massive > amounts of code. Bizzare. See "man errno". The notion that errno is an int works fine for single-threaded programs; but with multiple threads, you can have multiple system errors happening in parallel, which means you need a mechanism to identify and return the right one for each thread. Note that you should not try to define external references to variables being provided to you via the standard includes yourself, because lots of them will do things like use functions or macros to inline references to the right code without exposing the inner workings to consumers of that API. -- -Chuck