Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Jan 2001 00:12:07 -0500 (EST)
From:      Daniel Eischen <eischen@vigrid.com>
To:        "Justin T. Gibbs" <gibbs@scsiguy.com>
Cc:        John Baldwin <jhb@FreeBSD.org>, =?ISO-8859-1?Q?G=E9rard_Roudier?= <groudier@club-internet.fr>, Jake Burkholder <jake@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org, Bruce Evans <bde@zeta.org.au>
Subject:   Re: cvs commit: src/sys/alpha/alpha interrupt.c machdep.c mp_mac 
Message-ID:  <Pine.SUN.3.91.1010111000241.27724A-100000@pcnet1.pcnet.com>
In-Reply-To: <200101110428.f0B4Rcs23445@aslan.scsiguy.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 10 Jan 2001, Justin T. Gibbs wrote:
> >No, shared variables are just variables.  Here is the problem.  There is no
> >'curproc' variable.  There is a gd_curproc member of a struct globaldata, and
> >each CPU has a struct globaldata tied to it.  We can obtain it via
> >PCPU_GET(curproc), or set it via PCPU_SET(curproc, myproc).  Having a 'curproc
> >'
> >"magic" variable that doesn't exist that we assume we can read and write to
> >like any other variable is a lot more hokie than admitting that we are
> >accessing a special variable in a special way.
> 
> Anyone touching these variables had better understand what they are for
> and how they operate.  I think our developers are smart enough to understand
> this without ugly upper-case macros.  Heck "errno" is not spelled
> PTHREAD_GET(errno), or PTHREAD_SET(errno, error) and still people seem
> to be able to write useful threaded apps. 8-)

Uh-oh.  I've just gone through libc (not committed yet) and replaced all 
instances of "errno = x" to _set_errno(x) to deal with threaded apps.  I
didn't realize that it actually worked correctly.

Should I discard these changes, or is _set_errno(x) seen as a better
interface than errno = x?

-- 
Dan Eischen



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SUN.3.91.1010111000241.27724A-100000>