Add _tzset_unlocked and _tzset_unlocked_r

newlib:

	* libc/time/local.h (_tzset_unlocked_r): Add prototype.
	(_tzset_unlocked): Ditto.
	* libc/time/tzset.c (_tzset_unlocked): New function, call
	_tzset_unlocked_r.
	(tzset): Lock and call _tzset_unlocked_r.
	* libc/time/tzset_r (_tzset_unlocked_r): Remove locking and rename
	from _tzset_r.
	(_tzset_r): Lock and call _tzset_unlocked_r.

cygwin:

	* localtime.cc (tzset_unlocked): Export as _tzset_unlocked.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2015-03-31 11:14:22 +02:00
parent 792ecd7c34
commit 5f4e1e895c
6 changed files with 49 additions and 23 deletions

View File

@@ -500,7 +500,11 @@ static int tzload(timezone_t sp, const char * name,
int doextend);
static int tzparse(timezone_t sp, const char * name,
int lastditch);
#ifdef __CYGWIN__
extern "C" void tzset_unlocked(void);
#else
static void tzset_unlocked(void);
#endif
static long leapcorr(const timezone_t sp, time_t * timep);
static timezone_t lclptr;
@@ -1613,6 +1617,9 @@ tzsetwall (void)
static NO_COPY muto tzset_guard;
#ifdef __CYGWIN__
extern "C"
#else
#ifndef STD_INSPIRED
/*
** A non-static declaration of tzsetwall in a system header file
@@ -1620,6 +1627,7 @@ static NO_COPY muto tzset_guard;
*/
static
#endif /* !defined STD_INSPIRED */
#endif
void
tzset_unlocked(void)
{
@@ -1663,6 +1671,8 @@ tzset_unlocked(void)
settzname();
}
EXPORT_ALIAS (tzset_unlocked, _tzset_unlocked)
extern "C" void
tzset(void)
{