From 10d002160949c985e6f99fb8d647d5e3c67ef554 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Wed, 17 Apr 2002 21:23:31 +0000 Subject: 2002-04-17 Jeff Johnston * libc/include/time.h (tzset, _tzset_r): Added prototypes. (strptime): Moved prototype to be within !__STRICT_ANSI__. (_tzname, _daylight, _timezone): No long __CYGWIN__ only. (tzname): Defined for all platforms. (daylight, timezone): Defined only for CYGWIN. * libc/sys/linux/machine/i386/crt0.c: Add call to tzset() after environment set up. * libc/stdlib/setenv_r.c (_setenv_r): Call tzset() if the TZ environment variable is set. * libc/time/Makefile.am: Add support for tzset.c, tzlock.c, and tzset_r.c. * libc/time/Makefile.in: Regenerated. * libc/time/gmtime.c (gmtime): Changed to call gmtime_r. * libc/time/gmtime_r.c (gmtime_r): Changed to call _mktm_r. * libc/time/lcltime_r.c (lcltime_r): Ditto. * libc/time/local.h: New local header file. * libc/time/mktime.c (mktime): Add timezone support. * libc/time/mktm_r.c: New file which is the common engine for gmtime_r and lcltime_r. This code has timezone support. * libc/time/strftime.c (strftime): Add %Z timezone support. * libc/time/tzlock.c: New file containing timezone lock stubs. * libc/time/tzset.c: New file containing tzset() routine. * libc/time/tzset_r.c: New file containing _tzset_r and internal routine for calculating timezone changes for specified year. --- newlib/libc/time/tzlock.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 newlib/libc/time/tzlock.c (limited to 'newlib/libc/time/tzlock.c') diff --git a/newlib/libc/time/tzlock.c b/newlib/libc/time/tzlock.c new file mode 100644 index 000000000..66fa1c366 --- /dev/null +++ b/newlib/libc/time/tzlock.c @@ -0,0 +1,44 @@ +/* +FUNCTION +<<__tz_lock>>, <<__tz_unlock>>--lock time zone global variables + +INDEX + __tz_lock +INDEX + __tz_unlock + +ANSI_SYNOPSIS + #include "local.h" + void __tz_lock (void); + void __tz_unlock (void); + +TRAD_SYNOPSIS + void __tz_lock(); + void __tz_unlock(); + +DESCRIPTION +The <> facility functions call these functions when they need +to ensure the values of global variables. The version of these routines supplied +in the library do not do anything. If multiple threads of execution +can call the time functions and give up scheduling in the middle, then you +you need to define your own versions of these functions in order to +safely lock the time zone variables during a call. If you do not, the results +of <>, <>, <>, and <> are undefined. + +The lock <<__tz_lock>> may not be called recursively; that is, +a call <<__tz_lock>> will always lock all subsequent <<__tz_lock>> calls +until the corresponding <<__tz_unlock>> call on the same thread is made. +*/ + +#include <_ansi.h> +#include "local.h" + +_VOID +_DEFUN_VOID (__tz_lock) +{ +} + +_VOID +_DEFUN_VOID (__tz_unlock) +{ +} -- cgit v1.2.3