This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: __errno_location export


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]