From: Szabolcs Nagy <nsz@port70.net>
To: musl@lists.openwall.com
Subject: Re: errno (was: Weekly reports - B)
Date: Wed, 6 Jul 2011 14:57:38 +0200 [thread overview]
Message-ID: <20110706125738.GN27634@port70.net> (raw)
In-Reply-To: <20110706113508.GA21773@openwall.com>
* Solar Designer <solar@openwall.com> [2011-07-06 15:35:08 +0400]:
> On Mon, Jun 13, 2011 at 12:54:18AM -0400, Rich Felker wrote:
> > ... errno is a macro and has been for a
> > long time (ever since threads) on most systems. It's required by the
> > standard to be an lvalue macro.
>
> Any idea why glibc has __set_errno() internally instead of assigning to
> its errno directly, then? The implementation for __set_errno() does a
> direct assignment anyway. What did the glibc developers need
it seems there was a different definition under sysdeps until
2002-07-19 Ulrich Drepper <drepper@redhat.com>
* sysdeps/generic/bits/errno.h: Remove __set_errno definition.
* ...
and then
2002-11-25 Jakub Jelinek <jakub@redhat.com>
* include/errno.h (__set_errno): Define as errno = val
unconditionally.
in older glibc eg sysdeps/unix/sysv/linux/bits/errno.h had code like
#ifdef _ERRNO_H
# undef EDOM
# undef EILSEQ
# undef ERANGE
# include <linux/errno.h>
/* Linux has no ENOTSUP error code. */
# define ENOTSUP EOPNOTSUPP
/* Linux also has no ECANCELED error code. Since it is not used here
we define it to an invalid value. */
# define ECANCELED 125
# 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 __P ((void)) __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__ */
#endif /* _ERRNO_H */
next prev parent reply other threads:[~2011-07-06 12:57 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-09 20:20 Weekly reports - B Luka Marčetić
2011-06-12 23:13 ` Rich Felker
2011-06-13 2:11 ` Solar Designer
2011-06-13 2:22 ` Rich Felker
2011-06-13 2:56 ` Solar Designer
2011-06-13 4:54 ` Rich Felker
2011-06-13 6:48 ` Solar Designer
2011-07-06 11:35 ` errno (was: Weekly reports - B) Solar Designer
2011-07-06 12:57 ` Szabolcs Nagy [this message]
2011-07-06 13:14 ` errno Solar Designer
2011-07-07 2:56 ` errno (was: Weekly reports - B) Rich Felker
2011-06-26 21:05 ` Weekly reports - X Luka Marčetić
2011-06-26 21:13 ` rich felker
2011-06-27 22:18 ` Solar Designer
2011-07-04 19:30 ` Luka Marčetić
2011-07-04 19:39 ` Rich Felker
2011-06-13 2:22 ` specification of cluts tests - code or/and data? (was: Weekly reports - B) Solar Designer
2011-06-13 9:19 ` specification of cluts tests - code or/and data? Solar Designer
2011-07-09 6:41 ` cluts repository (was: Weekly reports - B) Solar Designer
2011-07-09 11:31 ` cluts repository Solar Designer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110706125738.GN27634@port70.net \
--to=nsz@port70.net \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).