Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Dec 2005 13:04:54 -0500
From:      Charles Swiger <cswiger@mac.com>
To:        Dieter <freebsd@sopwith.solgatos.com>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: compiler can't tell int from function? nmh-1.0.4
Message-ID:  <256A38E9-6787-409A-B5C2-141D8336A42C@mac.com>
In-Reply-To: <200512231744.RAA06461@sopwith.solgatos.com>
References:  <200512231744.RAA06461@sopwith.solgatos.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?256A38E9-6787-409A-B5C2-141D8336A42C>