TOPDIR=../../../
include $(TOPDIR)Rules.mak
-CSRC=ultostr.c ltostr.c __uClibc_main.c tempname.c errno.c __errno_location.c
+CSRC=ultostr.c ltostr.c __uClibc_main.c tempname.c errno.c __errno_location.c __h_errno_location.c
ifeq ($(HAS_FLOATING_POINT),true)
CSRC += dtostr.c zoicheck.c
endif
weak_alias(__environ, environ);
extern void weak_function __init_stdio(void);
extern void weak_function __stdio_flush_buffers(void);
-extern int *weak_function __errno_location (void);
+extern int *weak_const_function __errno_location (void);
+extern int *weak_const_function __h_errno_location (void);
#else
extern void __init_stdio(void);
extern void __stdio_flush_buffers(void);
extern int *__errno_location (void);
+extern int *__h_errno_location (void);
#endif
/*
*/
if (__errno_location)
*(__errno_location()) = 0;
+ /* Set h_errno to 0 as well */
+ if (__h_errno_location)
+ *(__h_errno_location()) = 0;
/*
* Finally, invoke application's main and then exit.