[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#162576: marked as done (libc6-dev: errno is a function call in non-threaded program)



Your message dated Fri, 27 Sep 2002 10:12:09 -0400
with message-id <20020927141209.GK564@phunnypharm.org>
and subject line Bug#162576: libc6-dev: errno is a function call in non-threaded program
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 27 Sep 2002 10:55:42 +0000
>From herbert@gondor.apana.org.au Fri Sep 27 05:55:42 2002
Return-path: <herbert@gondor.apana.org.au>
Received: from eriador.apana.org.au [203.14.152.116] (mail)
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 17usmb-0001PH-00; Fri, 27 Sep 2002 05:55:42 -0500
Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail)
	by eriador.apana.org.au with esmtp (Exim 3.12 #1 (Debian))
	id 17usmR-00028Z-00
	for <submit@bugs.debian.org>; Fri, 27 Sep 2002 20:55:31 +1000
Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.35 #1 (Debian))
	id 17usmQ-0008Vz-00
	for <submit@bugs.debian.org>; Fri, 27 Sep 2002 20:55:30 +1000
From:  <herbert@gondor.apana.org.au>
Subject: libc6-dev: errno is a function call in non-threaded program
To: submit@bugs.debian.org
X-Mailer: bug 3.3.10.1
Message-Id: <[🔎] E17usmQ-0008Vz-00@gondolin.me.apana.org.au>
Date: Fri, 27 Sep 2002 20:55:30 +1000
Delivered-To: submit@bugs.debian.org

Package: libc6-dev
Version: 2.2.5-14.3
Severity: minor

bits/errno.h defines errno to be a function call even when the application
has no need for threads at all.  This definition should be made conditional
so that non-threaded programs do not suffer the overhead of the function
call.

-- System Information
Debian Release: testing/unstable
Kernel Version: Linux gondolin 2.4.18-686-smp #1 SMP Sun Apr 14 12:07:19 EST 2002 i686 unknown unknown GNU/Linux

Versions of the packages libc6-dev depends on:
ii  libc6          2.2.5-14.3     GNU C Library: Shared libraries and Timezone

---------------------------------------
Received: (at 162576-done) by bugs.debian.org; 27 Sep 2002 14:12:34 +0000
>From bmc@phunnypharm.org Fri Sep 27 09:12:34 2002
Return-path: <bmc@phunnypharm.org>
Received: from blowme.phunnypharm.org [65.207.35.140] 
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 17uvr7-0003xZ-00; Fri, 27 Sep 2002 09:12:34 -0500
Received: from hopper.phunnypharm.org ([192.168.0.13] ident=mail)
	by blowme.phunnypharm.org with esmtp (Exim 3.35 #1 (Debian))
	id 17uvqx-0006Di-00; Fri, 27 Sep 2002 10:12:23 -0400
Received: from bmc by hopper.phunnypharm.org with local (Exim 3.36 #1 (Debian))
	id 17uvqj-0001Qg-00; Fri, 27 Sep 2002 10:12:09 -0400
Date: Fri, 27 Sep 2002 10:12:09 -0400
From: Ben Collins <bcollins@debian.org>
To: herbert@gondor.apana.org.au, 162576-done@bugs.debian.org
Subject: Re: Bug#162576: libc6-dev: errno is a function call in non-threaded program
Message-ID: <20020927141209.GK564@phunnypharm.org>
References: <[🔎] E17usmQ-0008Vz-00@gondolin.me.apana.org.au>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <[🔎] E17usmQ-0008Vz-00@gondolin.me.apana.org.au>
User-Agent: Mutt/1.4i
Delivered-To: 162576-done@bugs.debian.org

On Fri, Sep 27, 2002 at 08:55:30PM +1000, herbert@gondor.apana.org.au wrote:
> Package: libc6-dev
> Version: 2.2.5-14.3
> Severity: minor
> 
> bits/errno.h defines errno to be a function call even when the application
> has no need for threads at all.  This definition should be made conditional
> so that non-threaded programs do not suffer the overhead of the function
> call.

How do you figure?

# ifndef __ASSEMBLER__
/* We now need a declaration of the `errno' variable.  */
extern int errno;

/* Function to get address of global `errno' variable.  */
extern int *__errno_location (void) __THROW __attribute__ ((__const__));

#  if defined _LIBC
/* We wouldn't need a special macro anymore but it is history.  */
#   define __set_errno(val) (*__errno_location ()) = (val)
#  endif /* _LIBC */

#  if !defined _LIBC || defined _LIBC_REENTRANT
/* When using threads, errno is a per-thread value.  */
#   define errno (*__errno_location ())
#  endif
# endif /* !__ASSEMBLER__ */

Clearly it only gets defined as (*__errno_location ()) if we are not
_LIBC (not the case for us ever) or _LIBC_REENTRANT is defined.

Now, -D_REENTRANT does not assume threads, but it does assume thread
safe, so the definition is perfectly normal in that case (e.g. a module
or library that does not use threads, being usable by a threaded program
should use this). I don't think this is a bug at all.

-- 
Debian     - http://www.debian.org/
Linux 1394 - http://www.linux1394.org/
Subversion - http://subversion.tigris.org/
Deqo       - http://www.deqo.com/



Reply to: