This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: __errno_location export
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Roland McGrath <roland at redhat dot com>
- Cc: Momchil Velikov <velco at fadata dot bg>, libc-alpha at sources dot redhat dot com
- Date: Mon, 25 Nov 2002 01:10:05 +0100
- Subject: Re: __errno_location export
- References: <874ra6v8e4.fsf@merlin.maxx.bg> <200211250000.gAP00OE06993@magilla.sf.frob.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Sun, Nov 24, 2002 at 04:00:24PM -0800, Roland McGrath wrote:
> > For non-threaded libc needs to be exported.
>
> The use of __errno_location is in only in sysdeps/.../bits/errno.h files
> (and not the generic ones). So as things stand, it belongs in a
> corresponding sysdeps/.../Versions file, not the generic one. That's why
> it is in sysdeps/unix/sysv/linux/Versions and sysdeps/mach/hurd/Versions.
Actually, there seems to be one generic use of __errno_location - in
include/errno.h. I don't think it makes sense to use any other definition
than (errno = (val)), if errno = val and __set_errno(val) do different
things then something is broken.
2002-11-25 Jakub Jelinek <jakub@redhat.com>
* include/errno.h (__set_errno): Define as errno = val
unconditionally.
--- libc/include/errno.h.jj 2002-10-16 23:21:24.000000000 +0200
+++ libc/include/errno.h 2002-11-25 02:26:52.000000000 +0100
@@ -16,7 +16,6 @@
# undef errno
# define errno errno /* For #ifndef errno tests. */
extern int errno attribute_hidden;
-# define __set_errno(val) (errno = (val))
# else
@@ -30,13 +29,12 @@ extern int errno attribute_hidden;
# define errno errno /* For #ifndef errno tests. */
# endif
extern __thread int errno attribute_tls_model_ie;
-# define __set_errno(val) (errno = (val))
-# else
-# define __set_errno(val) (*__errno_location ()) = (val)
# endif
# endif /* RTLD_PRIVATE_ERRNO */
+# define __set_errno(val) (errno = (val))
+
#endif /* _ERRNO_H */
#endif /* ! _ERRNO_H */
Jakub