1997-01-07 06:07:28 +08:00
|
|
|
|
/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
|
1996-12-08 16:01:13 +08:00
|
|
|
|
This file is part of the GNU C Library.
|
1995-02-18 09:27:10 +08:00
|
|
|
|
|
1996-12-08 16:01:13 +08:00
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU Library General Public License as
|
|
|
|
|
published by the Free Software Foundation; either version 2 of the
|
|
|
|
|
License, or (at your option) any later version.
|
1995-02-18 09:27:10 +08:00
|
|
|
|
|
1996-12-08 16:01:13 +08:00
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
Library General Public License for more details.
|
1995-02-18 09:27:10 +08:00
|
|
|
|
|
1996-12-08 16:01:13 +08:00
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
|
|
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
|
|
|
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
|
Boston, MA 02111-1307, USA. */
|
1995-02-18 09:27:10 +08:00
|
|
|
|
|
|
|
|
|
#include <ctype.h>
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
|
|
/* Defined in mktime.c. */
|
1996-12-08 16:01:13 +08:00
|
|
|
|
extern const unsigned short int __mon_yday[2][13];
|
1995-02-18 09:27:10 +08:00
|
|
|
|
|
|
|
|
|
#define NOID
|
|
|
|
|
#include "tzfile.h"
|
|
|
|
|
|
|
|
|
|
extern int __use_tzfile;
|
1996-12-08 16:01:13 +08:00
|
|
|
|
extern void __tzfile_read __P ((const char *file));
|
|
|
|
|
extern void __tzfile_default __P ((char *std, char *dst,
|
|
|
|
|
long int stdoff, long int dstoff));
|
|
|
|
|
extern int __tz_compute __P ((time_t timer, const struct tm *tm));
|
1995-02-18 09:27:10 +08:00
|
|
|
|
|
|
|
|
|
char *__tzname[2] = { (char *) "GMT", (char *) "GMT" };
|
|
|
|
|
int __daylight = 0;
|
|
|
|
|
long int __timezone = 0L;
|
|
|
|
|
|
1995-04-20 07:41:29 +08:00
|
|
|
|
weak_alias (__tzname, tzname)
|
|
|
|
|
weak_alias (__daylight, daylight)
|
|
|
|
|
weak_alias (__timezone, timezone)
|
|
|
|
|
|
1995-02-18 09:27:10 +08:00
|
|
|
|
|
|
|
|
|
#define min(a, b) ((a) < (b) ? (a) : (b))
|
|
|
|
|
#define max(a, b) ((a) > (b) ? (a) : (b))
|
|
|
|
|
#define sign(x) ((x) < 0 ? -1 : 1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* This structure contains all the information about a
|
|
|
|
|
timezone given in the POSIX standard TZ envariable. */
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
|
|
/* When to change. */
|
|
|
|
|
enum { J0, J1, M } type; /* Interpretation of: */
|
|
|
|
|
unsigned short int m, n, d; /* Month, week, day. */
|
|
|
|
|
unsigned int secs; /* Time of day. */
|
|
|
|
|
|
|
|
|
|
long int offset; /* Seconds east of GMT (west if < 0). */
|
|
|
|
|
|
|
|
|
|
/* We cache the computed time of change for a
|
|
|
|
|
given year so we don't have to recompute it. */
|
|
|
|
|
time_t change; /* When to change to this zone. */
|
|
|
|
|
int computed_for; /* Year above is computed for. */
|
|
|
|
|
} tz_rule;
|
|
|
|
|
|
|
|
|
|
/* tz_rules[0] is standard, tz_rules[1] is daylight. */
|
|
|
|
|
static tz_rule tz_rules[2];
|
1996-12-08 16:01:13 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int compute_change __P ((tz_rule *rule, int year));
|
1995-02-18 09:27:10 +08:00
|
|
|
|
|
1996-12-15 10:15:29 +08:00
|
|
|
|
static char *old_tz = NULL;
|
1995-02-18 09:27:10 +08:00
|
|
|
|
|
|
|
|
|
/* Interpret the TZ envariable. */
|
1997-01-07 06:07:28 +08:00
|
|
|
|
void __tzset_internal __P ((int always));
|
1995-02-18 09:27:10 +08:00
|
|
|
|
void
|
1997-01-07 06:07:28 +08:00
|
|
|
|
__tzset_internal (always)
|
|
|
|
|
int always;
|
1995-02-18 09:27:10 +08:00
|
|
|
|
{
|
1997-01-07 06:07:28 +08:00
|
|
|
|
static int is_initialized = 0;
|
1996-12-08 16:01:13 +08:00
|
|
|
|
register const char *tz;
|
1995-02-18 09:27:10 +08:00
|
|
|
|
register size_t l;
|
|
|
|
|
unsigned short int hh, mm, ss;
|
|
|
|
|
unsigned short int whichrule;
|
|
|
|
|
|
1997-01-07 06:07:28 +08:00
|
|
|
|
if (is_initialized && !always)
|
|
|
|
|
return;
|
|
|
|
|
is_initialized = 1;
|
|
|
|
|
|
1996-12-15 10:15:29 +08:00
|
|
|
|
/* Examine the TZ environment variable. */
|
|
|
|
|
tz = getenv ("TZ");
|
|
|
|
|
|
|
|
|
|
/* A leading colon means "implementation defined syntax".
|
|
|
|
|
We ignore the colon and always use the same algorithm:
|
|
|
|
|
try a data file, and if none exists parse the 1003.1 syntax. */
|
|
|
|
|
if (tz && *tz == ':')
|
|
|
|
|
++tz;
|
|
|
|
|
|
|
|
|
|
/* Check whether the value changes since the last run. */
|
|
|
|
|
if (old_tz != NULL && tz != NULL && strcmp (tz, old_tz) == 0)
|
|
|
|
|
/* No change, simply return. */
|
|
|
|
|
return;
|
|
|
|
|
|
1995-02-18 09:27:10 +08:00
|
|
|
|
/* Free old storage. */
|
|
|
|
|
if (tz_rules[0].name != NULL && *tz_rules[0].name != '\0')
|
update from main archive 970118
Sun Jan 19 04:38:20 1997 Ulrich Drepper <drepper@cygnus.com>
* config.make.in (have-ksh, KSH): New variables. Will be filled
in by configure.
* configure.in: Add test for ksh like shell (prefer bash).
* time/Makefile (tests): Depend on install-test-data.
(distribute): Add simplebackw.
(generated-dirs): New variable.
[$(have-ksh)==yes] (install-others): Add iso3166.tab and zone.tab.
(install-bin): Add tzselect.
(install-test-data): Install the zoneinfo files which are needed
for the test case in the build directory.
(test-tz-ENV): New variable. Call test-tz program using data in
build directory.
* time/simpleback: New file.
* time/test-tz.c: Pretty print.
* time/tzfile.c: Use value of environment variable TZDIR as directory
to look for zone info files.
don't let search for DST data destroy already found values.
* time/tzselect.ksh: Use @KSH@ and @TZDIR@ to be substituted when
installing.
* time/tzset.c (__tzset_internal): Avoid freeing string twice.
Set DST zone name to normal zone name if no information is provided.
* time/mktime.c (mktime): Call __tzset_internal to use current
value of TZ.
* Makerules (common-clean): Remove $(generated-dirs) inclusing content.
* glibcbug.in: Fix several bugs. Reported by several people.
* elf/Makefile: Correct dependecies for $(objpfx)ldd.
* inet/netinet/ip.h: Define IPTOS_LOWCOST and IPTOS_MINCOST.
* locale/C-time.c: Update copyright.
* locale/localeinfo.h: Likewise.
* sysdeps/unix/bsd/bsd4.4/direntry.h: Likewise.
* locale/programs/ld-time.c (time_finish): Correct message string.
* locale/programs/linereader.c (lr_token): Use correctly `number'
not `digit' in message string.
* stdlib/strtol.c [UNSIGNED]: Don't punt immediately when `-' is
seen. Instead return ULONG_MAX and set ERANGE.
* stdlib/tst-strtol.c: Correct test to reflect above change.
Sun Jan 19 03:22:30 1997 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/sys/mtio.h: Don't use <linux/mtio.h>.
We must not use <linux/posix_types.h>.
* sysdeps/unix/sysv/linux/sys/ipc_buf.h: Don't use __kernel_* types
since we must not use <linux/posix_types.h>.
* sysdeps/unix/sysv/linux/sys/procfs.h: Likewise.
* sysdeps/unix/sysv/linux/alpha/sys/ipc_buf.h: New file. Similar
to sysdeps/unix/sysv/linux/sys/ipc_buf.h, but use alpha relavent
types.
* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: New file. Similar
to sysdeps/unix/sysv/linux/sys/procfs.h, but use alpha relavent
types.
Sun Jan 19 01:48:20 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
* sysdeps/libm-i387/e_exp.S: Correct computation of fractional
part.
* sysdeps/libm-i387/e_expf.S: Likewise.
* sysdeps/libm-i387/e_expl.S: Likewise.
* sysdeps/libm-i387/s_expm1.S: Correct computation of fractional
part. Take care of additional value left on stack by fscale.
* sysdeps/libm-i387/s_expm1f.S: Likewise.
* sysdeps/libm-i387/s_expm1l.S: Likewise.
Fri Jan 17 17:45:32 1997 Ulrich Drepper <drepper@cygnus.com>
* posix/getopt.c: Change all direct usages of `gettext' to `_'.
* sysdeps/generic/sysd-stdio.c (__stdio_reopen): Add missing
parameter.
Reported by Harmanjit Singh <harman@netearth.iitd.ernet.in>.
Thu Jan 16 23:39:25 1997 Ulrich Drepper <drepper@cygnus.com>
* stdio-common/Makefile (tests): Add scanf11.
* stdio-common/scanf11.c: New file.
* stdio-common/vfscanf.c (__vfscanf): Increment `done' when %n
was processed and value is not suppressed.
* stdio-common/bug10.c: Correct test to expect %n increment the
return value of scanf.
* stdio-common/scanf1.c: Likewise.
* stdio-common/scanf3.c: Likewise.
* stdio-common/scanf10.c: Likewise.
* stdio-common/tstdiomisc.c: Likewise.
* time/strptime.c: Add lots of conditional compiling to enable use
outside glibc. When used in glibc, make sure C locale format
strings will always be recognized.
Sat Jan 11 18:53:47 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/sysv/linux/sys/sysmacros.h (major, minor, makedev):
Fix definitions so that they work with __kernel_dev_t.
Sat Jan 11 14:24:10 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/sysv/linux/kernel_sigaction.h,
sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h,
sysdeps/unix/sysv/linux/sigaction.c: New files.
* sysdeps/unix/sysv/linux/syscalls.list: Add s_sigaction.
Sun Jan 12 15:22:33 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* libc-symbols.h (link_warning): Make sure that the .gnu.warning
section is not allocated.
Update and reformat copyright.
Sun Jan 12 12:19:28 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* elf/Makefile ($(objpfx)ldd): Fix depedency list.
Sat Jan 11 15:11:26 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/Makefile ($(common-objpfx)sysd-syscalls): Fix
command so that it works in subdirectories.
Wed Jan 8 22:07:58 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/sysv/linux/i386/syscalls.list: Add s_getgroups and
s_setgroups.
* sysdeps/unix/sysv/linux/m68k/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/i386/getgroups.c,
sysdeps/unix/sysv/linux/i386/setgroups.c,
sysdeps/unix/sysv/linux/m68k/getgroups.c,
sysdeps/unix/sysv/linux/m68k/setgroups.c: New files.
Wed Jan 8 19:42:59 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makefile (config.status): Delete bogus rule.
($(objpfx)glibcbug): Renamed from plain `glibcbug', depend on
config.status in build directory, fix command to change to build
directory.
* Makeconfig ($(common-objpfx)config.status): Depend on version.h.
Thu Jan 9 08:47:54 1997 Andreas Jaeger <aj@arthur.pfalz.de>
* glibcbug.in (while): We test for four and not five conditions,
set MAIL_AGENT instead of RMAIL, filter spaces and tabs.
Thu Jan 16 22:00:27 1997 Ulrich Drepper <drepper@cygnus.com>
* misc/syslog.c: Don't define cancel_handler if _LIBC_REENTRANT
is not defined. Reported by Andreas Jaeger.
Thu Jan 9 08:47:54 1997 Andreas Jaeger <aj@arthur.pfalz.de>
* new-malloc/malloc.c (__MALLOC_P): define call to pthread
initializer only if NO_THREADS is not defined.
Wed Jan 8 21:28:58 1997 Andreas Jaeger <aj@arthur.pfalz.de>
* resolv/nss_dns/dns-host.c: Clean-up: delete unnecessary includes
and variables.
Thu Jan 16 21:50:27 1997 Ulrich Drepper <drepper@cygnus.com>
* inet/arpa/inet.h: Include <netinet/in.h> to get struct in_addr
defined.
Tue Jan 7 17:29:59 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makerules (LDLIBS-c.so): New variable.
Tue Jan 7 19:22:00 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makefile ($(includedir)/gnu/lib-names.h): Define the library
names as strings, not as sequence of tokens that may fall apart.
Fri Jan 10 14:08:41 1997 Roland McGrath <roland@fmh.frob.com>
* time/tzfile.c (__tzfile_read): Check for bogus type and zone name
indices in data file and punt, so a bogus file can't crash us.
Thu Jan 16 20:29:15 1997 Ulrich Drepper <drepper@cygnus.com>
* values.h [__USE_MISC]: Define BITSPERBYTE.
Fri Jan 17 14:16:28 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* stdio/vdprintf.c: Moved file to ...
* sysdeps/posix/vdprintf.c: Here. De-ansideclificate.
* sysdeps/stub/vdprintf.c: New file.
* sysdeps/mach/hurd/vdprintf.c: New file.
Thu Jan 9 15:59:35 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* sysdeps/mach/hurd/posix_opt.h: New file.
* sysdeps/mach/hurd/sigwait.c (sigwait): Don't affect signal mask.
* sysdeps/unix/bsd/tcsendbrk.c (tcsendbreak): Finish
deansideclification.
* sysdeps/mach/libc-lock.h: Add kludges to pretend to implement
recursive locks.
Tue Jan 7 09:48:15 1997 Andreas Jaeger <aj@arthur.pfalz.de>
* signal/sigempty.c (sigemptyset): Correct typo: Empty set should
have all bits zero.
1997-01-19 12:54:28 +08:00
|
|
|
|
free((void *) tz_rules[0].name);
|
1995-02-18 09:27:10 +08:00
|
|
|
|
if (tz_rules[1].name != NULL && *tz_rules[1].name != '\0' &&
|
|
|
|
|
tz_rules[1].name != tz_rules[0].name)
|
update from main archive 970118
Sun Jan 19 04:38:20 1997 Ulrich Drepper <drepper@cygnus.com>
* config.make.in (have-ksh, KSH): New variables. Will be filled
in by configure.
* configure.in: Add test for ksh like shell (prefer bash).
* time/Makefile (tests): Depend on install-test-data.
(distribute): Add simplebackw.
(generated-dirs): New variable.
[$(have-ksh)==yes] (install-others): Add iso3166.tab and zone.tab.
(install-bin): Add tzselect.
(install-test-data): Install the zoneinfo files which are needed
for the test case in the build directory.
(test-tz-ENV): New variable. Call test-tz program using data in
build directory.
* time/simpleback: New file.
* time/test-tz.c: Pretty print.
* time/tzfile.c: Use value of environment variable TZDIR as directory
to look for zone info files.
don't let search for DST data destroy already found values.
* time/tzselect.ksh: Use @KSH@ and @TZDIR@ to be substituted when
installing.
* time/tzset.c (__tzset_internal): Avoid freeing string twice.
Set DST zone name to normal zone name if no information is provided.
* time/mktime.c (mktime): Call __tzset_internal to use current
value of TZ.
* Makerules (common-clean): Remove $(generated-dirs) inclusing content.
* glibcbug.in: Fix several bugs. Reported by several people.
* elf/Makefile: Correct dependecies for $(objpfx)ldd.
* inet/netinet/ip.h: Define IPTOS_LOWCOST and IPTOS_MINCOST.
* locale/C-time.c: Update copyright.
* locale/localeinfo.h: Likewise.
* sysdeps/unix/bsd/bsd4.4/direntry.h: Likewise.
* locale/programs/ld-time.c (time_finish): Correct message string.
* locale/programs/linereader.c (lr_token): Use correctly `number'
not `digit' in message string.
* stdlib/strtol.c [UNSIGNED]: Don't punt immediately when `-' is
seen. Instead return ULONG_MAX and set ERANGE.
* stdlib/tst-strtol.c: Correct test to reflect above change.
Sun Jan 19 03:22:30 1997 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/sys/mtio.h: Don't use <linux/mtio.h>.
We must not use <linux/posix_types.h>.
* sysdeps/unix/sysv/linux/sys/ipc_buf.h: Don't use __kernel_* types
since we must not use <linux/posix_types.h>.
* sysdeps/unix/sysv/linux/sys/procfs.h: Likewise.
* sysdeps/unix/sysv/linux/alpha/sys/ipc_buf.h: New file. Similar
to sysdeps/unix/sysv/linux/sys/ipc_buf.h, but use alpha relavent
types.
* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: New file. Similar
to sysdeps/unix/sysv/linux/sys/procfs.h, but use alpha relavent
types.
Sun Jan 19 01:48:20 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
* sysdeps/libm-i387/e_exp.S: Correct computation of fractional
part.
* sysdeps/libm-i387/e_expf.S: Likewise.
* sysdeps/libm-i387/e_expl.S: Likewise.
* sysdeps/libm-i387/s_expm1.S: Correct computation of fractional
part. Take care of additional value left on stack by fscale.
* sysdeps/libm-i387/s_expm1f.S: Likewise.
* sysdeps/libm-i387/s_expm1l.S: Likewise.
Fri Jan 17 17:45:32 1997 Ulrich Drepper <drepper@cygnus.com>
* posix/getopt.c: Change all direct usages of `gettext' to `_'.
* sysdeps/generic/sysd-stdio.c (__stdio_reopen): Add missing
parameter.
Reported by Harmanjit Singh <harman@netearth.iitd.ernet.in>.
Thu Jan 16 23:39:25 1997 Ulrich Drepper <drepper@cygnus.com>
* stdio-common/Makefile (tests): Add scanf11.
* stdio-common/scanf11.c: New file.
* stdio-common/vfscanf.c (__vfscanf): Increment `done' when %n
was processed and value is not suppressed.
* stdio-common/bug10.c: Correct test to expect %n increment the
return value of scanf.
* stdio-common/scanf1.c: Likewise.
* stdio-common/scanf3.c: Likewise.
* stdio-common/scanf10.c: Likewise.
* stdio-common/tstdiomisc.c: Likewise.
* time/strptime.c: Add lots of conditional compiling to enable use
outside glibc. When used in glibc, make sure C locale format
strings will always be recognized.
Sat Jan 11 18:53:47 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/sysv/linux/sys/sysmacros.h (major, minor, makedev):
Fix definitions so that they work with __kernel_dev_t.
Sat Jan 11 14:24:10 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/sysv/linux/kernel_sigaction.h,
sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h,
sysdeps/unix/sysv/linux/sigaction.c: New files.
* sysdeps/unix/sysv/linux/syscalls.list: Add s_sigaction.
Sun Jan 12 15:22:33 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* libc-symbols.h (link_warning): Make sure that the .gnu.warning
section is not allocated.
Update and reformat copyright.
Sun Jan 12 12:19:28 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* elf/Makefile ($(objpfx)ldd): Fix depedency list.
Sat Jan 11 15:11:26 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/Makefile ($(common-objpfx)sysd-syscalls): Fix
command so that it works in subdirectories.
Wed Jan 8 22:07:58 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/sysv/linux/i386/syscalls.list: Add s_getgroups and
s_setgroups.
* sysdeps/unix/sysv/linux/m68k/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/i386/getgroups.c,
sysdeps/unix/sysv/linux/i386/setgroups.c,
sysdeps/unix/sysv/linux/m68k/getgroups.c,
sysdeps/unix/sysv/linux/m68k/setgroups.c: New files.
Wed Jan 8 19:42:59 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makefile (config.status): Delete bogus rule.
($(objpfx)glibcbug): Renamed from plain `glibcbug', depend on
config.status in build directory, fix command to change to build
directory.
* Makeconfig ($(common-objpfx)config.status): Depend on version.h.
Thu Jan 9 08:47:54 1997 Andreas Jaeger <aj@arthur.pfalz.de>
* glibcbug.in (while): We test for four and not five conditions,
set MAIL_AGENT instead of RMAIL, filter spaces and tabs.
Thu Jan 16 22:00:27 1997 Ulrich Drepper <drepper@cygnus.com>
* misc/syslog.c: Don't define cancel_handler if _LIBC_REENTRANT
is not defined. Reported by Andreas Jaeger.
Thu Jan 9 08:47:54 1997 Andreas Jaeger <aj@arthur.pfalz.de>
* new-malloc/malloc.c (__MALLOC_P): define call to pthread
initializer only if NO_THREADS is not defined.
Wed Jan 8 21:28:58 1997 Andreas Jaeger <aj@arthur.pfalz.de>
* resolv/nss_dns/dns-host.c: Clean-up: delete unnecessary includes
and variables.
Thu Jan 16 21:50:27 1997 Ulrich Drepper <drepper@cygnus.com>
* inet/arpa/inet.h: Include <netinet/in.h> to get struct in_addr
defined.
Tue Jan 7 17:29:59 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makerules (LDLIBS-c.so): New variable.
Tue Jan 7 19:22:00 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makefile ($(includedir)/gnu/lib-names.h): Define the library
names as strings, not as sequence of tokens that may fall apart.
Fri Jan 10 14:08:41 1997 Roland McGrath <roland@fmh.frob.com>
* time/tzfile.c (__tzfile_read): Check for bogus type and zone name
indices in data file and punt, so a bogus file can't crash us.
Thu Jan 16 20:29:15 1997 Ulrich Drepper <drepper@cygnus.com>
* values.h [__USE_MISC]: Define BITSPERBYTE.
Fri Jan 17 14:16:28 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* stdio/vdprintf.c: Moved file to ...
* sysdeps/posix/vdprintf.c: Here. De-ansideclificate.
* sysdeps/stub/vdprintf.c: New file.
* sysdeps/mach/hurd/vdprintf.c: New file.
Thu Jan 9 15:59:35 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* sysdeps/mach/hurd/posix_opt.h: New file.
* sysdeps/mach/hurd/sigwait.c (sigwait): Don't affect signal mask.
* sysdeps/unix/bsd/tcsendbrk.c (tcsendbreak): Finish
deansideclification.
* sysdeps/mach/libc-lock.h: Add kludges to pretend to implement
recursive locks.
Tue Jan 7 09:48:15 1997 Andreas Jaeger <aj@arthur.pfalz.de>
* signal/sigempty.c (sigemptyset): Correct typo: Empty set should
have all bits zero.
1997-01-19 12:54:28 +08:00
|
|
|
|
free((void *) tz_rules[1].name);
|
|
|
|
|
tz_rules[0].name = NULL;
|
|
|
|
|
tz_rules[1].name = NULL;
|
1995-02-18 09:27:10 +08:00
|
|
|
|
|
1996-12-15 10:15:29 +08:00
|
|
|
|
/* Save the value of `tz'. */
|
|
|
|
|
if (old_tz != NULL)
|
|
|
|
|
free (old_tz);
|
|
|
|
|
old_tz = tz ? __strdup (tz) : NULL;
|
1996-06-16 12:52:54 +08:00
|
|
|
|
|
|
|
|
|
/* Try to read a data file. */
|
|
|
|
|
__tzfile_read (tz);
|
|
|
|
|
if (__use_tzfile)
|
1996-12-15 10:15:29 +08:00
|
|
|
|
return;
|
1995-02-18 09:27:10 +08:00
|
|
|
|
|
1996-06-16 12:52:54 +08:00
|
|
|
|
/* No data file found. Default to UTC if nothing specified. */
|
|
|
|
|
|
1995-02-18 09:27:10 +08:00
|
|
|
|
if (tz == NULL || *tz == '\0')
|
|
|
|
|
{
|
1996-06-16 12:52:54 +08:00
|
|
|
|
static const char UTC[] = "UTC";
|
|
|
|
|
size_t len = sizeof UTC;
|
1996-12-15 10:15:29 +08:00
|
|
|
|
tz_rules[0].name = (char *) malloc (len);
|
1996-06-16 12:52:54 +08:00
|
|
|
|
if (tz_rules[0].name == NULL)
|
|
|
|
|
return;
|
1996-12-15 10:15:29 +08:00
|
|
|
|
tz_rules[1].name = (char *) malloc (len);
|
1996-06-16 12:52:54 +08:00
|
|
|
|
if (tz_rules[1].name == NULL)
|
|
|
|
|
return;
|
1996-12-08 16:01:13 +08:00
|
|
|
|
memcpy ((void *) tz_rules[0].name, UTC, len);
|
|
|
|
|
memcpy ((void *) tz_rules[1].name, UTC, len);
|
1996-06-16 12:52:54 +08:00
|
|
|
|
tz_rules[0].type = tz_rules[1].type = J0;
|
|
|
|
|
tz_rules[0].m = tz_rules[0].n = tz_rules[0].d = 0;
|
|
|
|
|
tz_rules[1].m = tz_rules[1].n = tz_rules[1].d = 0;
|
|
|
|
|
tz_rules[0].secs = tz_rules[1].secs = 0;
|
|
|
|
|
tz_rules[0].offset = tz_rules[1].offset = 0L;
|
|
|
|
|
tz_rules[0].change = tz_rules[1].change = (time_t) -1;
|
|
|
|
|
tz_rules[0].computed_for = tz_rules[1].computed_for = 0;
|
1995-02-18 09:27:10 +08:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
Sun Mar 5 19:40:13 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* locale/localeinfo.h: Rewritten for new locale system, using
locale data files and with <langinfo.h> interface.
* locale/setlocale.c: Rewritten to use locale data files.
* langinfo.h: New file.
* locale/langinfo.h: New file.
* locale/nl_langinfo.c: New file.
* locale/loadlocale.c: New file.
* locale/lc-ctype.c: New file.
* locale/lc-messages.c: New file.
* locale/lc-monetary.c: New file.
* locale/lc-numeric.c: New file.
* locale/lc-time.c: New file.
* locale/categories.def: New file.
* locale/Makefile (headers): Remove localeinfo.h.
(distribute): New variable; put localeinfo.h here, and categories.def.
(routines): Add loadlocale.
(categories): New variable.
(aux): Use that to get C-category and lc-category.
* ctype/ctype.h (_IS*): Use independent bits for all but _ISalnum.
* locale/C-ctype.c, locale/C-messages.c: New files.
* locale/C-monetary.c, locale/C-numeric.c, locale/C-time.c:
Default "C" locale data updated for new locale system.
* locale/C-collate.c: File removed.
* locale/C-ctype_ct.c: File removed.
* locale/C-ctype_mb.c: File removed.
* locale/C-response.c: File removed.
* locale/localeconv.c: Use _NL_CURRENT macro to access locale data.
* stdio/printf_fp.c, stdio/vfprintf.c, stdio/vfscanf.c,
stdlib/strtod.c, time/asctime.c, time/strftime.c:
Include ../locale/localeinfo.h and use _NL_CURRENT macro to access
locale data.
* time/localtime.c: Don't include <localeinfo.h>.
* time/tzset.c: Don't use locale items for default TZ value or
"GMT" string (use "UTC").
* stdio/vfprintf.c [USE_IN_LIBIO] (PAD): Only call the function if
WIDTH>0; update DONE.
* malloc/malloc.c (morecore): Fix last change to calculate by
blocks instead of bytes.
1995-03-06 11:00:08 +08:00
|
|
|
|
/* Clear out old state and reset to unnamed UTC. */
|
1995-02-18 09:27:10 +08:00
|
|
|
|
memset (tz_rules, 0, sizeof tz_rules);
|
|
|
|
|
tz_rules[0].name = tz_rules[1].name = (char *) "";
|
|
|
|
|
|
|
|
|
|
/* Get the standard timezone name. */
|
|
|
|
|
tz_rules[0].name = (char *) malloc (strlen (tz) + 1);
|
|
|
|
|
if (tz_rules[0].name == NULL)
|
1996-12-15 10:15:29 +08:00
|
|
|
|
{
|
|
|
|
|
/* Clear the old tz name so we will try again. */
|
|
|
|
|
free (old_tz);
|
|
|
|
|
old_tz = NULL;
|
|
|
|
|
return;
|
|
|
|
|
}
|
1995-02-18 09:27:10 +08:00
|
|
|
|
|
|
|
|
|
if (sscanf(tz, "%[^0-9,+-]", tz_rules[0].name) != 1 ||
|
|
|
|
|
(l = strlen(tz_rules[0].name)) < 3)
|
|
|
|
|
{
|
|
|
|
|
free (tz_rules[0].name);
|
|
|
|
|
tz_rules[0].name = (char *) "";
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
1996-12-08 16:01:13 +08:00
|
|
|
|
char *n = realloc ((void *) tz_rules[0].name, l + 1);
|
1995-02-18 09:27:10 +08:00
|
|
|
|
if (n != NULL)
|
|
|
|
|
tz_rules[0].name = n;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tz += l;
|
|
|
|
|
|
Sun Mar 5 19:40:13 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* locale/localeinfo.h: Rewritten for new locale system, using
locale data files and with <langinfo.h> interface.
* locale/setlocale.c: Rewritten to use locale data files.
* langinfo.h: New file.
* locale/langinfo.h: New file.
* locale/nl_langinfo.c: New file.
* locale/loadlocale.c: New file.
* locale/lc-ctype.c: New file.
* locale/lc-messages.c: New file.
* locale/lc-monetary.c: New file.
* locale/lc-numeric.c: New file.
* locale/lc-time.c: New file.
* locale/categories.def: New file.
* locale/Makefile (headers): Remove localeinfo.h.
(distribute): New variable; put localeinfo.h here, and categories.def.
(routines): Add loadlocale.
(categories): New variable.
(aux): Use that to get C-category and lc-category.
* ctype/ctype.h (_IS*): Use independent bits for all but _ISalnum.
* locale/C-ctype.c, locale/C-messages.c: New files.
* locale/C-monetary.c, locale/C-numeric.c, locale/C-time.c:
Default "C" locale data updated for new locale system.
* locale/C-collate.c: File removed.
* locale/C-ctype_ct.c: File removed.
* locale/C-ctype_mb.c: File removed.
* locale/C-response.c: File removed.
* locale/localeconv.c: Use _NL_CURRENT macro to access locale data.
* stdio/printf_fp.c, stdio/vfprintf.c, stdio/vfscanf.c,
stdlib/strtod.c, time/asctime.c, time/strftime.c:
Include ../locale/localeinfo.h and use _NL_CURRENT macro to access
locale data.
* time/localtime.c: Don't include <localeinfo.h>.
* time/tzset.c: Don't use locale items for default TZ value or
"GMT" string (use "UTC").
* stdio/vfprintf.c [USE_IN_LIBIO] (PAD): Only call the function if
WIDTH>0; update DONE.
* malloc/malloc.c (morecore): Fix last change to calculate by
blocks instead of bytes.
1995-03-06 11:00:08 +08:00
|
|
|
|
/* Figure out the standard offset from UTC. */
|
1995-02-18 09:27:10 +08:00
|
|
|
|
if (*tz == '\0' || (*tz != '+' && *tz != '-' && !isdigit(*tz)))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (*tz == '-' || *tz == '+')
|
|
|
|
|
tz_rules[0].offset = *tz++ == '-' ? 1L : -1L;
|
|
|
|
|
else
|
|
|
|
|
tz_rules[0].offset = -1L;
|
|
|
|
|
switch (sscanf (tz, "%hu:%hu:%hu", &hh, &mm, &ss))
|
|
|
|
|
{
|
|
|
|
|
default:
|
|
|
|
|
return;
|
|
|
|
|
case 1:
|
|
|
|
|
mm = 0;
|
|
|
|
|
case 2:
|
|
|
|
|
ss = 0;
|
|
|
|
|
case 3:
|
|
|
|
|
break;
|
|
|
|
|
}
|
1996-12-08 16:01:13 +08:00
|
|
|
|
tz_rules[0].offset *= (min (ss, 59) + (min (mm, 59) * 60) +
|
|
|
|
|
(min (hh, 23) * 60 * 60));
|
1995-02-18 09:27:10 +08:00
|
|
|
|
|
|
|
|
|
for (l = 0; l < 3; ++l)
|
|
|
|
|
{
|
|
|
|
|
while (isdigit(*tz))
|
|
|
|
|
++tz;
|
|
|
|
|
if (l < 2 && *tz == ':')
|
|
|
|
|
++tz;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Get the DST timezone name (if any). */
|
|
|
|
|
if (*tz != '\0')
|
|
|
|
|
{
|
1996-12-08 16:01:13 +08:00
|
|
|
|
char *n = malloc (strlen (tz) + 1);
|
1995-02-18 09:27:10 +08:00
|
|
|
|
if (n != NULL)
|
|
|
|
|
{
|
|
|
|
|
tz_rules[1].name = n;
|
1996-12-08 16:01:13 +08:00
|
|
|
|
if (sscanf (tz, "%[^0-9,+-]", tz_rules[1].name) != 1 ||
|
|
|
|
|
(l = strlen (tz_rules[1].name)) < 3)
|
1995-02-18 09:27:10 +08:00
|
|
|
|
{
|
|
|
|
|
free (n);
|
|
|
|
|
tz_rules[1].name = (char *) "";
|
|
|
|
|
goto done_names; /* Punt on name, set up the offsets. */
|
|
|
|
|
}
|
1996-12-08 16:01:13 +08:00
|
|
|
|
n = realloc ((void *) tz_rules[1].name, l + 1);
|
1995-02-18 09:27:10 +08:00
|
|
|
|
if (n != NULL)
|
|
|
|
|
tz_rules[1].name = n;
|
1996-12-08 16:01:13 +08:00
|
|
|
|
|
|
|
|
|
tz += l;
|
1995-02-18 09:27:10 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
update from main archive 970118
Sun Jan 19 04:38:20 1997 Ulrich Drepper <drepper@cygnus.com>
* config.make.in (have-ksh, KSH): New variables. Will be filled
in by configure.
* configure.in: Add test for ksh like shell (prefer bash).
* time/Makefile (tests): Depend on install-test-data.
(distribute): Add simplebackw.
(generated-dirs): New variable.
[$(have-ksh)==yes] (install-others): Add iso3166.tab and zone.tab.
(install-bin): Add tzselect.
(install-test-data): Install the zoneinfo files which are needed
for the test case in the build directory.
(test-tz-ENV): New variable. Call test-tz program using data in
build directory.
* time/simpleback: New file.
* time/test-tz.c: Pretty print.
* time/tzfile.c: Use value of environment variable TZDIR as directory
to look for zone info files.
don't let search for DST data destroy already found values.
* time/tzselect.ksh: Use @KSH@ and @TZDIR@ to be substituted when
installing.
* time/tzset.c (__tzset_internal): Avoid freeing string twice.
Set DST zone name to normal zone name if no information is provided.
* time/mktime.c (mktime): Call __tzset_internal to use current
value of TZ.
* Makerules (common-clean): Remove $(generated-dirs) inclusing content.
* glibcbug.in: Fix several bugs. Reported by several people.
* elf/Makefile: Correct dependecies for $(objpfx)ldd.
* inet/netinet/ip.h: Define IPTOS_LOWCOST and IPTOS_MINCOST.
* locale/C-time.c: Update copyright.
* locale/localeinfo.h: Likewise.
* sysdeps/unix/bsd/bsd4.4/direntry.h: Likewise.
* locale/programs/ld-time.c (time_finish): Correct message string.
* locale/programs/linereader.c (lr_token): Use correctly `number'
not `digit' in message string.
* stdlib/strtol.c [UNSIGNED]: Don't punt immediately when `-' is
seen. Instead return ULONG_MAX and set ERANGE.
* stdlib/tst-strtol.c: Correct test to reflect above change.
Sun Jan 19 03:22:30 1997 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/sys/mtio.h: Don't use <linux/mtio.h>.
We must not use <linux/posix_types.h>.
* sysdeps/unix/sysv/linux/sys/ipc_buf.h: Don't use __kernel_* types
since we must not use <linux/posix_types.h>.
* sysdeps/unix/sysv/linux/sys/procfs.h: Likewise.
* sysdeps/unix/sysv/linux/alpha/sys/ipc_buf.h: New file. Similar
to sysdeps/unix/sysv/linux/sys/ipc_buf.h, but use alpha relavent
types.
* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: New file. Similar
to sysdeps/unix/sysv/linux/sys/procfs.h, but use alpha relavent
types.
Sun Jan 19 01:48:20 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
* sysdeps/libm-i387/e_exp.S: Correct computation of fractional
part.
* sysdeps/libm-i387/e_expf.S: Likewise.
* sysdeps/libm-i387/e_expl.S: Likewise.
* sysdeps/libm-i387/s_expm1.S: Correct computation of fractional
part. Take care of additional value left on stack by fscale.
* sysdeps/libm-i387/s_expm1f.S: Likewise.
* sysdeps/libm-i387/s_expm1l.S: Likewise.
Fri Jan 17 17:45:32 1997 Ulrich Drepper <drepper@cygnus.com>
* posix/getopt.c: Change all direct usages of `gettext' to `_'.
* sysdeps/generic/sysd-stdio.c (__stdio_reopen): Add missing
parameter.
Reported by Harmanjit Singh <harman@netearth.iitd.ernet.in>.
Thu Jan 16 23:39:25 1997 Ulrich Drepper <drepper@cygnus.com>
* stdio-common/Makefile (tests): Add scanf11.
* stdio-common/scanf11.c: New file.
* stdio-common/vfscanf.c (__vfscanf): Increment `done' when %n
was processed and value is not suppressed.
* stdio-common/bug10.c: Correct test to expect %n increment the
return value of scanf.
* stdio-common/scanf1.c: Likewise.
* stdio-common/scanf3.c: Likewise.
* stdio-common/scanf10.c: Likewise.
* stdio-common/tstdiomisc.c: Likewise.
* time/strptime.c: Add lots of conditional compiling to enable use
outside glibc. When used in glibc, make sure C locale format
strings will always be recognized.
Sat Jan 11 18:53:47 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/sysv/linux/sys/sysmacros.h (major, minor, makedev):
Fix definitions so that they work with __kernel_dev_t.
Sat Jan 11 14:24:10 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/sysv/linux/kernel_sigaction.h,
sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h,
sysdeps/unix/sysv/linux/sigaction.c: New files.
* sysdeps/unix/sysv/linux/syscalls.list: Add s_sigaction.
Sun Jan 12 15:22:33 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* libc-symbols.h (link_warning): Make sure that the .gnu.warning
section is not allocated.
Update and reformat copyright.
Sun Jan 12 12:19:28 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* elf/Makefile ($(objpfx)ldd): Fix depedency list.
Sat Jan 11 15:11:26 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/Makefile ($(common-objpfx)sysd-syscalls): Fix
command so that it works in subdirectories.
Wed Jan 8 22:07:58 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/sysv/linux/i386/syscalls.list: Add s_getgroups and
s_setgroups.
* sysdeps/unix/sysv/linux/m68k/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/i386/getgroups.c,
sysdeps/unix/sysv/linux/i386/setgroups.c,
sysdeps/unix/sysv/linux/m68k/getgroups.c,
sysdeps/unix/sysv/linux/m68k/setgroups.c: New files.
Wed Jan 8 19:42:59 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makefile (config.status): Delete bogus rule.
($(objpfx)glibcbug): Renamed from plain `glibcbug', depend on
config.status in build directory, fix command to change to build
directory.
* Makeconfig ($(common-objpfx)config.status): Depend on version.h.
Thu Jan 9 08:47:54 1997 Andreas Jaeger <aj@arthur.pfalz.de>
* glibcbug.in (while): We test for four and not five conditions,
set MAIL_AGENT instead of RMAIL, filter spaces and tabs.
Thu Jan 16 22:00:27 1997 Ulrich Drepper <drepper@cygnus.com>
* misc/syslog.c: Don't define cancel_handler if _LIBC_REENTRANT
is not defined. Reported by Andreas Jaeger.
Thu Jan 9 08:47:54 1997 Andreas Jaeger <aj@arthur.pfalz.de>
* new-malloc/malloc.c (__MALLOC_P): define call to pthread
initializer only if NO_THREADS is not defined.
Wed Jan 8 21:28:58 1997 Andreas Jaeger <aj@arthur.pfalz.de>
* resolv/nss_dns/dns-host.c: Clean-up: delete unnecessary includes
and variables.
Thu Jan 16 21:50:27 1997 Ulrich Drepper <drepper@cygnus.com>
* inet/arpa/inet.h: Include <netinet/in.h> to get struct in_addr
defined.
Tue Jan 7 17:29:59 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makerules (LDLIBS-c.so): New variable.
Tue Jan 7 19:22:00 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makefile ($(includedir)/gnu/lib-names.h): Define the library
names as strings, not as sequence of tokens that may fall apart.
Fri Jan 10 14:08:41 1997 Roland McGrath <roland@fmh.frob.com>
* time/tzfile.c (__tzfile_read): Check for bogus type and zone name
indices in data file and punt, so a bogus file can't crash us.
Thu Jan 16 20:29:15 1997 Ulrich Drepper <drepper@cygnus.com>
* values.h [__USE_MISC]: Define BITSPERBYTE.
Fri Jan 17 14:16:28 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* stdio/vdprintf.c: Moved file to ...
* sysdeps/posix/vdprintf.c: Here. De-ansideclificate.
* sysdeps/stub/vdprintf.c: New file.
* sysdeps/mach/hurd/vdprintf.c: New file.
Thu Jan 9 15:59:35 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* sysdeps/mach/hurd/posix_opt.h: New file.
* sysdeps/mach/hurd/sigwait.c (sigwait): Don't affect signal mask.
* sysdeps/unix/bsd/tcsendbrk.c (tcsendbreak): Finish
deansideclification.
* sysdeps/mach/libc-lock.h: Add kludges to pretend to implement
recursive locks.
Tue Jan 7 09:48:15 1997 Andreas Jaeger <aj@arthur.pfalz.de>
* signal/sigempty.c (sigemptyset): Correct typo: Empty set should
have all bits zero.
1997-01-19 12:54:28 +08:00
|
|
|
|
else
|
|
|
|
|
/* There is no DST. */
|
|
|
|
|
tz_rules[1].name = tz_rules[0].name;
|
1995-02-18 09:27:10 +08:00
|
|
|
|
|
|
|
|
|
/* Figure out the DST offset from GMT. */
|
|
|
|
|
if (*tz == '-' || *tz == '+')
|
|
|
|
|
tz_rules[1].offset = *tz++ == '-' ? 1L : -1L;
|
|
|
|
|
else
|
|
|
|
|
tz_rules[1].offset = -1L;
|
|
|
|
|
|
|
|
|
|
switch (sscanf (tz, "%hu:%hu:%hu", &hh, &mm, &ss))
|
|
|
|
|
{
|
|
|
|
|
default:
|
|
|
|
|
/* Default to one hour later than standard time. */
|
|
|
|
|
tz_rules[1].offset = tz_rules[0].offset + (60 * 60);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
|
mm = 0;
|
|
|
|
|
case 2:
|
|
|
|
|
ss = 0;
|
|
|
|
|
case 3:
|
1996-12-08 16:01:13 +08:00
|
|
|
|
tz_rules[1].offset *= (min (ss, 59) + (min (mm, 59) * 60) +
|
|
|
|
|
(min (hh, 23) * (60 * 60)));
|
1995-02-18 09:27:10 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
for (l = 0; l < 3; ++l)
|
|
|
|
|
{
|
|
|
|
|
while (isdigit (*tz))
|
|
|
|
|
++tz;
|
|
|
|
|
if (l < 2 && *tz == ':')
|
|
|
|
|
++tz;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
done_names:
|
|
|
|
|
|
|
|
|
|
if (*tz == '\0' || (tz[0] == ',' && tz[1] == '\0'))
|
|
|
|
|
{
|
|
|
|
|
/* There is no rule. See if there is a default rule file. */
|
|
|
|
|
__tzfile_default (tz_rules[0].name, tz_rules[1].name,
|
|
|
|
|
tz_rules[0].offset, tz_rules[1].offset);
|
|
|
|
|
if (__use_tzfile)
|
|
|
|
|
{
|
1996-12-15 10:15:29 +08:00
|
|
|
|
free (old_tz);
|
|
|
|
|
old_tz = NULL;
|
1995-02-18 09:27:10 +08:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Figure out the standard <-> DST rules. */
|
|
|
|
|
for (whichrule = 0; whichrule < 2; ++whichrule)
|
|
|
|
|
{
|
|
|
|
|
register tz_rule *tzr = &tz_rules[whichrule];
|
1996-02-17 00:15:45 +08:00
|
|
|
|
|
1995-02-18 09:27:10 +08:00
|
|
|
|
if (*tz == ',')
|
|
|
|
|
{
|
|
|
|
|
++tz;
|
|
|
|
|
if (*tz == '\0')
|
|
|
|
|
return;
|
|
|
|
|
}
|
1996-02-17 00:15:45 +08:00
|
|
|
|
|
1995-02-18 09:27:10 +08:00
|
|
|
|
/* Get the date of the change. */
|
|
|
|
|
if (*tz == 'J' || isdigit (*tz))
|
|
|
|
|
{
|
|
|
|
|
char *end;
|
|
|
|
|
tzr->type = *tz == 'J' ? J1 : J0;
|
|
|
|
|
if (tzr->type == J1 && !isdigit (*++tz))
|
|
|
|
|
return;
|
|
|
|
|
tzr->d = (unsigned short int) strtoul (tz, &end, 10);
|
|
|
|
|
if (end == tz || tzr->d > 365)
|
|
|
|
|
return;
|
|
|
|
|
else if (tzr->type == J1 && tzr->d == 0)
|
|
|
|
|
return;
|
|
|
|
|
tz = end;
|
|
|
|
|
}
|
|
|
|
|
else if (*tz == 'M')
|
|
|
|
|
{
|
|
|
|
|
int n;
|
|
|
|
|
tzr->type = M;
|
|
|
|
|
if (sscanf (tz, "M%hu.%hu.%hu%n",
|
|
|
|
|
&tzr->m, &tzr->n, &tzr->d, &n) != 3 ||
|
|
|
|
|
tzr->m < 1 || tzr->m > 12 ||
|
|
|
|
|
tzr->n < 1 || tzr->n > 5 || tzr->d > 6)
|
|
|
|
|
return;
|
|
|
|
|
tz += n;
|
|
|
|
|
}
|
|
|
|
|
else if (*tz == '\0')
|
|
|
|
|
{
|
|
|
|
|
/* United States Federal Law, the equivalent of "M4.1.0,M10.5.0". */
|
|
|
|
|
tzr->type = M;
|
|
|
|
|
if (tzr == &tz_rules[0])
|
|
|
|
|
{
|
|
|
|
|
tzr->m = 4;
|
|
|
|
|
tzr->n = 1;
|
|
|
|
|
tzr->d = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
tzr->m = 10;
|
|
|
|
|
tzr->n = 5;
|
|
|
|
|
tzr->d = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return;
|
1996-02-17 00:15:45 +08:00
|
|
|
|
|
1995-02-18 09:27:10 +08:00
|
|
|
|
if (*tz != '\0' && *tz != '/' && *tz != ',')
|
|
|
|
|
return;
|
|
|
|
|
else if (*tz == '/')
|
|
|
|
|
{
|
|
|
|
|
/* Get the time of day of the change. */
|
|
|
|
|
++tz;
|
|
|
|
|
if (*tz == '\0')
|
|
|
|
|
return;
|
|
|
|
|
switch (sscanf (tz, "%hu:%hu:%hu", &hh, &mm, &ss))
|
|
|
|
|
{
|
|
|
|
|
default:
|
|
|
|
|
hh = 2; /* Default to 2:00 AM. */
|
|
|
|
|
case 1:
|
|
|
|
|
mm = 0;
|
|
|
|
|
case 2:
|
|
|
|
|
ss = 0;
|
|
|
|
|
case 3:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
for (l = 0; l < 3; ++l)
|
|
|
|
|
{
|
1996-12-08 16:01:13 +08:00
|
|
|
|
while (isdigit (*tz))
|
1995-02-18 09:27:10 +08:00
|
|
|
|
++tz;
|
|
|
|
|
if (l < 2 && *tz == ':')
|
|
|
|
|
++tz;
|
|
|
|
|
}
|
|
|
|
|
tzr->secs = (hh * 60 * 60) + (mm * 60) + ss;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
/* Default to 2:00 AM. */
|
|
|
|
|
tzr->secs = 2 * 60 * 60;
|
|
|
|
|
|
|
|
|
|
tzr->computed_for = -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Maximum length of a timezone name. __tz_compute keeps this up to date
|
|
|
|
|
(never decreasing it) when ! __use_tzfile.
|
|
|
|
|
tzfile.c keeps it up to date when __use_tzfile. */
|
update from main archive 960911
Thu Sep 12 03:35:27 1996 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/i386/Dist: Remove init-first.h.
* sysdeps/unix/sysv/linux/m68k/Dist: Likewise.
* sysdeps/unix/sysv/linux/Dist: Add init-first.h.
1996-09-11 Paul Eggert <eggert@twinsun.com>
* strftime.c (strftime):
Handle E and O modifiers, required for POSIX.2 and XPG4.
Don't use sprintf to format numbers; this way, we can handle time_t
correctly regardless of whether it's signed.
Don't dump core if format ends in %.
In default %c format, use %e instead of %d, for POSIX.2 compatibility.
For %z:
Use tm_gmtoff if available.
Output nothing if tm_isdst is negative.
Output correct value even if arg is 1969-12-31 23:59:59 UTC.
Don't assume that UTC offset is less than 24 hours;
Posix requires support for 24 hours, and there's no point
limiting it at all.
(HAVE_TM_GMTOFF, TYPE_SIGNED, INT_STRLEN_BOUND): New macros.
(CHAR_BIT): Define if <limits.h> doesn't.
(tm_diff): New function.
(fmt, <stdio.h>): Remove; no longer used.
Thu Sep 12 02:21:44 1996 Ulrich Drepper <drepper@cygnus.com>
* db/Makefile: Add extra-libs-others variable so that shared
library is built in `others' pass.
* elf/Makefile: Likewise.
* math/Makefile: Likewise.
* resolv/Makefile: Likewise.
* Makefile (generated): Add version.info.h.
* time/checktab.awk: New file. From ADO 96k.
* time/iso3166.tab: Likewise.
* time/tzselect.ksh: Likewise.
* time/zone.tab: Likewise.
* stdio-common/vfprintf.c: Correct cleanup registration. We
cannot use a macro
1996-09-11 Paul Eggert <eggert@twinsun.com>
* time/time.h (tm_gmtoff, tm_zone): Prefix with `__' unless
__USE_BSD; this is required for ANSI C compatibility.
* manual/time.texi: Replace GMT by UTC, daylight savings by
daylight saving, timezone by time zone.
Rewrite description of %V to match ISO 8601.
Fix TZ Posix string example for US Eastern time.
Explain tzname[1] when DST isn't used.
Explain tzname when multiple abbreviations used (e.g. EST/EWT/EDT).
Explain that timezone's sign is opposite from tm_gmtoff, and that
timezone lacks DST adjustment whereas tm_gmtoff has it.
Deprecate tzname and timezone.
Tue Sep 10 14:46:16 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
Implement Roland McGrath's idea of how to put an .interp into
shared libraries.
* interp.c: New file.
* Makerules (interp-obj): New object, linked into every shared
library.
(common-generated): Add interp.so.
(CFLAGS-interp.c): Pass name of interpreter.
Tue Sep 10 21:09:35 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* db/Makefile: Fix typo.
Tue Sep 10 19:29:53 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* nss/db-Makefile ($(VAR_DB)/passwd.db): Look for multiple
occurences of the same uid, and only generate a mapping for the
first one.
Tue Sep 10 03:14:59 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/sysv/linux/system.c: New file, to override
sysdeps/unix/system.c.
Tue Sep 10 15:05:40 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makefile (before-compile): Add version-info.h, needed to build
version.d.
Tue Sep 10 14:14:33 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/sysv/linux/m68k/sysdep.S: Remove check for
EWOULDBLOCK, never true on Linux.
(__errno_location): New function.
[_LIBC_REENTRANT]: Set errno using __errno_location function.
* sysdeps/unix/sysv/linux/m68k/sysdep.h [PIC]: Add second
syscall_error handler for reentrant libc.
Tue Sep 10 13:27:49 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* elf/Makefile (extra-objs): Add eval.so to get dependencies.
Wed Sep 11 04:40:57 1996 Ulrich Drepper <drepper@cygnus.com>
* time/tzset.c (__tzname_cur_max): Use type `size_t' to avoid
warning.
* time/tzfile.c (compute_tzname_max): Likewise.
1996-09-12 10:51:03 +08:00
|
|
|
|
size_t __tzname_cur_max;
|
1995-02-18 09:27:10 +08:00
|
|
|
|
|
|
|
|
|
long int
|
1996-12-08 16:01:13 +08:00
|
|
|
|
__tzname_max ()
|
1995-02-18 09:27:10 +08:00
|
|
|
|
{
|
1997-01-07 06:07:28 +08:00
|
|
|
|
__tzset_internal (0);
|
1995-02-18 09:27:10 +08:00
|
|
|
|
|
|
|
|
|
return __tzname_cur_max;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Figure out the exact time (as a time_t) in YEAR
|
|
|
|
|
when the change described by RULE will occur and
|
|
|
|
|
put it in RULE->change, saving YEAR in RULE->computed_for.
|
|
|
|
|
Return nonzero if successful, zero on failure. */
|
|
|
|
|
static int
|
1996-12-08 16:01:13 +08:00
|
|
|
|
compute_change (rule, year)
|
|
|
|
|
tz_rule *rule;
|
|
|
|
|
int year;
|
1995-02-18 09:27:10 +08:00
|
|
|
|
{
|
|
|
|
|
register time_t t;
|
|
|
|
|
int y;
|
|
|
|
|
|
|
|
|
|
if (year != -1 && rule->computed_for == year)
|
|
|
|
|
/* Operations on times in 1969 will be slower. Oh well. */
|
|
|
|
|
return 1;
|
1996-02-17 00:15:45 +08:00
|
|
|
|
|
1995-02-18 09:27:10 +08:00
|
|
|
|
/* First set T to January 1st, 0:00:00 GMT in YEAR. */
|
|
|
|
|
t = 0;
|
|
|
|
|
for (y = 1970; y < year; ++y)
|
|
|
|
|
t += SECSPERDAY * (__isleap (y) ? 366 : 365);
|
|
|
|
|
|
|
|
|
|
switch (rule->type)
|
|
|
|
|
{
|
|
|
|
|
case J1:
|
|
|
|
|
/* Jn - Julian day, 1 == January 1, 60 == March 1 even in leap years.
|
|
|
|
|
In non-leap years, or if the day number is 59 or less, just
|
|
|
|
|
add SECSPERDAY times the day number-1 to the time of
|
|
|
|
|
January 1, midnight, to get the day. */
|
|
|
|
|
t += (rule->d - 1) * SECSPERDAY;
|
|
|
|
|
if (rule->d >= 60 && __isleap (year))
|
|
|
|
|
t += SECSPERDAY;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case J0:
|
|
|
|
|
/* n - Day of year.
|
|
|
|
|
Just add SECSPERDAY times the day number to the time of Jan 1st. */
|
|
|
|
|
t += rule->d * SECSPERDAY;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case M:
|
|
|
|
|
/* Mm.n.d - Nth "Dth day" of month M. */
|
|
|
|
|
{
|
|
|
|
|
register int i, d, m1, yy0, yy1, yy2, dow;
|
1996-12-08 16:01:13 +08:00
|
|
|
|
register const unsigned short int *myday =
|
Fri Sep 29 03:43:51 1995 Paul Eggert <eggert@twinsun.com>
Rewrite mktime from scratch for performance, and for correctness
in the presence of leap seconds.
* time/mktime.c (ydhms_tm_diff, not_equal_tm, print_tm, check_result):
New functions.
(LEAP_SECONDS_POSSIBLE, CHAR_BIT, INT_MIN, INT_MAX,
TIME_T_MIN, TIME_T_MAX, TM_YEAR_BASE, EPOCH_YEAR): New macros.
<limits.h>, <stdlib.h>: New #includes.
(main): Support tests with given broken-down value; support benchmarks.
(__mon_lengths, debugging_enabled, printtm, dist_tm, doit,
do_normalization, normalize, BAD_STRUCT_TM, SKIP_VALUE,
<ctype.h>): Remove.
* time/time.h, time/mktime.c (__mktime_internal): New offset arg.
* time/mktime.c (mktime), time/timegm.c (timegm): Use it.
* time/mktime.c (__mon_yday): New variable; replaces `__mon_lengths'.
time/offtime.c (__offtime), time/tzset.c (compute_change): Use it.
* time/offtime.c (__offtime): Remove useless assignment
`tp->tm_isdst = -1'.
* manual/maint.texi: Update credits.
Fri Oct 6 00:28:53 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* sysdeps/unix/common/readv.S: Moved to sysdeps/unix/bsd.
* sysdeps/unix/common/writev.S: Moved to sysdeps/unix/bsd.
* sysdeps/unix/sysv/linux/readv.c: File removed.
* sysdeps/unix/sysv/linux/writev.c: File removed.
* sysdeps/unix/configure.in: Check for readv and writev syscalls.
* sysdeps/unix/configure.in: If eval doesn't set $unix_srcname,
set it to $unix_syscall instead of $unix_function.
1995-10-06 12:50:55 +08:00
|
|
|
|
&__mon_yday[__isleap (year)][rule->m];
|
1995-02-18 09:27:10 +08:00
|
|
|
|
|
|
|
|
|
/* First add SECSPERDAY for each day in months before M. */
|
Fri Sep 29 03:43:51 1995 Paul Eggert <eggert@twinsun.com>
Rewrite mktime from scratch for performance, and for correctness
in the presence of leap seconds.
* time/mktime.c (ydhms_tm_diff, not_equal_tm, print_tm, check_result):
New functions.
(LEAP_SECONDS_POSSIBLE, CHAR_BIT, INT_MIN, INT_MAX,
TIME_T_MIN, TIME_T_MAX, TM_YEAR_BASE, EPOCH_YEAR): New macros.
<limits.h>, <stdlib.h>: New #includes.
(main): Support tests with given broken-down value; support benchmarks.
(__mon_lengths, debugging_enabled, printtm, dist_tm, doit,
do_normalization, normalize, BAD_STRUCT_TM, SKIP_VALUE,
<ctype.h>): Remove.
* time/time.h, time/mktime.c (__mktime_internal): New offset arg.
* time/mktime.c (mktime), time/timegm.c (timegm): Use it.
* time/mktime.c (__mon_yday): New variable; replaces `__mon_lengths'.
time/offtime.c (__offtime), time/tzset.c (compute_change): Use it.
* time/offtime.c (__offtime): Remove useless assignment
`tp->tm_isdst = -1'.
* manual/maint.texi: Update credits.
Fri Oct 6 00:28:53 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* sysdeps/unix/common/readv.S: Moved to sysdeps/unix/bsd.
* sysdeps/unix/common/writev.S: Moved to sysdeps/unix/bsd.
* sysdeps/unix/sysv/linux/readv.c: File removed.
* sysdeps/unix/sysv/linux/writev.c: File removed.
* sysdeps/unix/configure.in: Check for readv and writev syscalls.
* sysdeps/unix/configure.in: If eval doesn't set $unix_srcname,
set it to $unix_syscall instead of $unix_function.
1995-10-06 12:50:55 +08:00
|
|
|
|
t += myday[-1] * SECSPERDAY;
|
1995-02-18 09:27:10 +08:00
|
|
|
|
|
|
|
|
|
/* Use Zeller's Congruence to get day-of-week of first day of month. */
|
|
|
|
|
m1 = (rule->m + 9) % 12 + 1;
|
|
|
|
|
yy0 = (rule->m <= 2) ? (year - 1) : year;
|
|
|
|
|
yy1 = yy0 / 100;
|
|
|
|
|
yy2 = yy0 % 100;
|
|
|
|
|
dow = ((26 * m1 - 2) / 10 + 1 + yy2 + yy2 / 4 + yy1 / 4 - 2 * yy1) % 7;
|
|
|
|
|
if (dow < 0)
|
|
|
|
|
dow += 7;
|
|
|
|
|
|
|
|
|
|
/* DOW is the day-of-week of the first day of the month. Get the
|
|
|
|
|
day-of-month (zero-origin) of the first DOW day of the month. */
|
|
|
|
|
d = rule->d - dow;
|
|
|
|
|
if (d < 0)
|
|
|
|
|
d += 7;
|
|
|
|
|
for (i = 1; i < rule->n; ++i)
|
|
|
|
|
{
|
Fri Sep 29 03:43:51 1995 Paul Eggert <eggert@twinsun.com>
Rewrite mktime from scratch for performance, and for correctness
in the presence of leap seconds.
* time/mktime.c (ydhms_tm_diff, not_equal_tm, print_tm, check_result):
New functions.
(LEAP_SECONDS_POSSIBLE, CHAR_BIT, INT_MIN, INT_MAX,
TIME_T_MIN, TIME_T_MAX, TM_YEAR_BASE, EPOCH_YEAR): New macros.
<limits.h>, <stdlib.h>: New #includes.
(main): Support tests with given broken-down value; support benchmarks.
(__mon_lengths, debugging_enabled, printtm, dist_tm, doit,
do_normalization, normalize, BAD_STRUCT_TM, SKIP_VALUE,
<ctype.h>): Remove.
* time/time.h, time/mktime.c (__mktime_internal): New offset arg.
* time/mktime.c (mktime), time/timegm.c (timegm): Use it.
* time/mktime.c (__mon_yday): New variable; replaces `__mon_lengths'.
time/offtime.c (__offtime), time/tzset.c (compute_change): Use it.
* time/offtime.c (__offtime): Remove useless assignment
`tp->tm_isdst = -1'.
* manual/maint.texi: Update credits.
Fri Oct 6 00:28:53 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* sysdeps/unix/common/readv.S: Moved to sysdeps/unix/bsd.
* sysdeps/unix/common/writev.S: Moved to sysdeps/unix/bsd.
* sysdeps/unix/sysv/linux/readv.c: File removed.
* sysdeps/unix/sysv/linux/writev.c: File removed.
* sysdeps/unix/configure.in: Check for readv and writev syscalls.
* sysdeps/unix/configure.in: If eval doesn't set $unix_srcname,
set it to $unix_syscall instead of $unix_function.
1995-10-06 12:50:55 +08:00
|
|
|
|
if (d + 7 >= myday[0] - myday[-1])
|
1995-02-18 09:27:10 +08:00
|
|
|
|
break;
|
|
|
|
|
d += 7;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* D is the day-of-month (zero-origin) of the day we want. */
|
|
|
|
|
t += d * SECSPERDAY;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* T is now the Epoch-relative time of 0:00:00 GMT on the day we want.
|
|
|
|
|
Just add the time of day and local offset from GMT, and we're done. */
|
|
|
|
|
|
1996-12-15 10:15:29 +08:00
|
|
|
|
rule->change = t - rule->offset + rule->secs;
|
1995-02-18 09:27:10 +08:00
|
|
|
|
rule->computed_for = year;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Figure out the correct timezone for *TIMER and TM (which must be the same)
|
|
|
|
|
and set `__tzname', `__timezone', and `__daylight' accordingly.
|
|
|
|
|
Return nonzero on success, zero on failure. */
|
|
|
|
|
int
|
1996-12-08 16:01:13 +08:00
|
|
|
|
__tz_compute (timer, tm)
|
|
|
|
|
time_t timer;
|
|
|
|
|
const struct tm *tm;
|
1995-02-18 09:27:10 +08:00
|
|
|
|
{
|
1997-01-07 06:07:28 +08:00
|
|
|
|
__tzset_internal (0);
|
1995-02-18 09:27:10 +08:00
|
|
|
|
|
|
|
|
|
if (! compute_change (&tz_rules[0], 1900 + tm->tm_year) ||
|
|
|
|
|
! compute_change (&tz_rules[1], 1900 + tm->tm_year))
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
__daylight = timer >= tz_rules[0].change && timer < tz_rules[1].change;
|
|
|
|
|
__timezone = tz_rules[__daylight ? 1 : 0].offset;
|
|
|
|
|
__tzname[0] = (char *) tz_rules[0].name;
|
|
|
|
|
__tzname[1] = (char *) tz_rules[1].name;
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
/* Keep __tzname_cur_max up to date. */
|
|
|
|
|
size_t len0 = strlen (__tzname[0]);
|
|
|
|
|
size_t len1 = strlen (__tzname[1]);
|
|
|
|
|
if (len0 > __tzname_cur_max)
|
|
|
|
|
__tzname_cur_max = len0;
|
|
|
|
|
if (len1 > __tzname_cur_max)
|
|
|
|
|
__tzname_cur_max = len1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
1996-07-24 05:40:11 +08:00
|
|
|
|
|
|
|
|
|
#include <libc-lock.h>
|
|
|
|
|
|
|
|
|
|
/* This locks all the state variables in tzfile.c and this file. */
|
|
|
|
|
__libc_lock_define (, __tzset_lock)
|
|
|
|
|
|
|
|
|
|
/* Reinterpret the TZ environment variable and set `tzname'. */
|
1996-07-26 06:41:27 +08:00
|
|
|
|
#undef tzset
|
1995-02-18 09:27:10 +08:00
|
|
|
|
|
1996-07-24 05:40:11 +08:00
|
|
|
|
void
|
update from main archive 961217
Wed Dec 18 03:31:58 1996 Ulrich Drepper <drepper@cygnus.com>
* dirent/scandir.c: Undo change from Mon Dec 2 15:32:15 1996.
The stream is private and usages outside glibc don't care about
reentrancy.
* io/fts.c: Likewise.
* io/ftw.c: Likewise.
* sysdeps/posix/getcwd.c: Likewise.
* sysdeps/posix/ttyname.c: Likewise.
* sysdeps/posix/ttyname_r.c: Likewise.
* sysdeps/posix/glob.c: Likewise.
* libio/iovsprintf.c: Add cast to prevent warning.
* libio/iovsscanf.c: Likewise.
* libio/libioP.h: Define mmap to __mmap and munmap to __munmap
to keep namespace clean.
* new-malloc/malloc.c: Update to last version from Wolfram Gloger.
Add hooks and check functions from old GNU malloc.
* new-malloc/malloc.h: Likewise.
* nis/ypclnt.c: Remove prototype for xdr_free.
* snrpc/rpc/xdr.h: Add prototype for xdr_free.
* manual/nss.texi: Correct description of default values and don't
meantion NSS as an add-on.
* nss/grp-lookup.c: Provide default value as
"compat [NOTFOUND=return] files".
* nss/pwd-lookup.c: Likewise.
* nss/spwd-lookup.c: Likewise.
* nss/network-lookup.c: Correct default to
"dns [!UNAVAIL=return] files".
* nss/nsswitch.c: Change default-default value to "nis
[NOTFOUND=return] files" since compat is only available for group,
passwd, and shadow.
* stdlib/on_exit.c (on_exit): Rename to __on_exit and make old name
a weak alias.
* stdlib/stdlib.h: Add prototype for __on_exit.
* sysdeps/unix/sysv/linux/schedbits.h: Add prototype for __clone.
* time/Makefile: Undo change from Sun Dec 8 06:56:49 1996.
The new malloc now has mcheck.
* time/ap.c: Likewise.
* time/tzset.c (__tzset): Rename to __tzset_internal.
(tzset): Rename to __tzset. Make tzset a weak alias for __tzset.
* time/localtime.c: Use __tzset_internal not __tzset.
* time/strftime.c [_LIBC]: Define tzname as __tzname and tzset
as __tzset to prevent namespace pollution.
* wctype/iswctype.h (icwctype): Rename to __iswctype. Make iswctype
a weak alias of __iswctype.
* wctype/wctype.h: Add prototype for __iswctype.
(iswalnum, iswalpha, iswcntrl, iswdigit, iswlower, iswgraph,
iswprint, iswpunct, iswspace, iswupper, iswxdigit, iswblank):
Use __iswctype for the test, not iswctype.
1996-12-16 Paul Eggert <eggert@twinsun.com>
* hurd/hurd/sigpreempt.h
(struct hurd_signal_preemptor.preemptor, _hurdsig_preemptors),
hurd/hurd/signal.h (struct hurd_sigstate.preemptors),
hurd/hurdfault.c, hurd/hurdfault.h (_hurdsig_fault_preemptor),
hurd/hurdsig.c (_hurdsig_preempters):
Renamed to fix spelling from `preempter' to `preemptor'.
All uses changed.
1996-12-15 Paul Eggert <eggert@twinsun.com>
* ctime.c (ctime): Return asctime (localtime (t)), as the C
standard requires.
Tue Dec 17 02:05:48 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* sysdeps/mach/libc-lock.h (__libc_lock_trylock): Invert return
value because Mach/cthreads uses the opposite convention from
Posix/glibc.
Mon Dec 16 22:41:01 1996 Ulrich Drepper <drepper@cygnus.com>
* stdio-common/fcloseall.c: Correct test of already_called.
Reported by Thomas Bushnell, n/BSG.
Mon Dec 16 14:52:07 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* mach/lock-intern.h (__mutex_try_lock): New function.
Sun Dec 15 16:33:44 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* termios/sys/ttydefaults.h (TTYDEF_OFLAG): Only use OXTABS if
defined, else XTABS.
(CEOL, CSTATUS): Use _POSIX_VDISABLE if defined.
Sun Dec 15 11:56:19 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/sysv/linux/m68k/mremap.S: New file.
* sysdeps/unix/sysv/linux/m68k/Dist: Distribute it.
* sysdeps/unix/sysv/linux/m68k/Makefile (sysdep_routines): Add mremap.
1996-12-18 11:23:47 +08:00
|
|
|
|
__tzset (void)
|
1996-07-24 05:40:11 +08:00
|
|
|
|
{
|
|
|
|
|
__libc_lock_lock (__tzset_lock);
|
1996-12-15 10:15:29 +08:00
|
|
|
|
|
1997-01-07 06:07:28 +08:00
|
|
|
|
__tzset_internal (1);
|
1996-12-15 10:15:29 +08:00
|
|
|
|
|
1996-12-16 09:40:21 +08:00
|
|
|
|
if (!__use_tzfile)
|
|
|
|
|
{
|
|
|
|
|
/* Set `tzname'. */
|
|
|
|
|
__tzname[0] = (char *) tz_rules[0].name;
|
|
|
|
|
__tzname[1] = (char *) tz_rules[1].name;
|
|
|
|
|
}
|
1996-12-15 10:15:29 +08:00
|
|
|
|
|
1996-07-24 05:40:11 +08:00
|
|
|
|
__libc_lock_unlock (__tzset_lock);
|
|
|
|
|
}
|
update from main archive 961217
Wed Dec 18 03:31:58 1996 Ulrich Drepper <drepper@cygnus.com>
* dirent/scandir.c: Undo change from Mon Dec 2 15:32:15 1996.
The stream is private and usages outside glibc don't care about
reentrancy.
* io/fts.c: Likewise.
* io/ftw.c: Likewise.
* sysdeps/posix/getcwd.c: Likewise.
* sysdeps/posix/ttyname.c: Likewise.
* sysdeps/posix/ttyname_r.c: Likewise.
* sysdeps/posix/glob.c: Likewise.
* libio/iovsprintf.c: Add cast to prevent warning.
* libio/iovsscanf.c: Likewise.
* libio/libioP.h: Define mmap to __mmap and munmap to __munmap
to keep namespace clean.
* new-malloc/malloc.c: Update to last version from Wolfram Gloger.
Add hooks and check functions from old GNU malloc.
* new-malloc/malloc.h: Likewise.
* nis/ypclnt.c: Remove prototype for xdr_free.
* snrpc/rpc/xdr.h: Add prototype for xdr_free.
* manual/nss.texi: Correct description of default values and don't
meantion NSS as an add-on.
* nss/grp-lookup.c: Provide default value as
"compat [NOTFOUND=return] files".
* nss/pwd-lookup.c: Likewise.
* nss/spwd-lookup.c: Likewise.
* nss/network-lookup.c: Correct default to
"dns [!UNAVAIL=return] files".
* nss/nsswitch.c: Change default-default value to "nis
[NOTFOUND=return] files" since compat is only available for group,
passwd, and shadow.
* stdlib/on_exit.c (on_exit): Rename to __on_exit and make old name
a weak alias.
* stdlib/stdlib.h: Add prototype for __on_exit.
* sysdeps/unix/sysv/linux/schedbits.h: Add prototype for __clone.
* time/Makefile: Undo change from Sun Dec 8 06:56:49 1996.
The new malloc now has mcheck.
* time/ap.c: Likewise.
* time/tzset.c (__tzset): Rename to __tzset_internal.
(tzset): Rename to __tzset. Make tzset a weak alias for __tzset.
* time/localtime.c: Use __tzset_internal not __tzset.
* time/strftime.c [_LIBC]: Define tzname as __tzname and tzset
as __tzset to prevent namespace pollution.
* wctype/iswctype.h (icwctype): Rename to __iswctype. Make iswctype
a weak alias of __iswctype.
* wctype/wctype.h: Add prototype for __iswctype.
(iswalnum, iswalpha, iswcntrl, iswdigit, iswlower, iswgraph,
iswprint, iswpunct, iswspace, iswupper, iswxdigit, iswblank):
Use __iswctype for the test, not iswctype.
1996-12-16 Paul Eggert <eggert@twinsun.com>
* hurd/hurd/sigpreempt.h
(struct hurd_signal_preemptor.preemptor, _hurdsig_preemptors),
hurd/hurd/signal.h (struct hurd_sigstate.preemptors),
hurd/hurdfault.c, hurd/hurdfault.h (_hurdsig_fault_preemptor),
hurd/hurdsig.c (_hurdsig_preempters):
Renamed to fix spelling from `preempter' to `preemptor'.
All uses changed.
1996-12-15 Paul Eggert <eggert@twinsun.com>
* ctime.c (ctime): Return asctime (localtime (t)), as the C
standard requires.
Tue Dec 17 02:05:48 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* sysdeps/mach/libc-lock.h (__libc_lock_trylock): Invert return
value because Mach/cthreads uses the opposite convention from
Posix/glibc.
Mon Dec 16 22:41:01 1996 Ulrich Drepper <drepper@cygnus.com>
* stdio-common/fcloseall.c: Correct test of already_called.
Reported by Thomas Bushnell, n/BSG.
Mon Dec 16 14:52:07 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* mach/lock-intern.h (__mutex_try_lock): New function.
Sun Dec 15 16:33:44 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* termios/sys/ttydefaults.h (TTYDEF_OFLAG): Only use OXTABS if
defined, else XTABS.
(CEOL, CSTATUS): Use _POSIX_VDISABLE if defined.
Sun Dec 15 11:56:19 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/sysv/linux/m68k/mremap.S: New file.
* sysdeps/unix/sysv/linux/m68k/Dist: Distribute it.
* sysdeps/unix/sysv/linux/m68k/Makefile (sysdep_routines): Add mremap.
1996-12-18 11:23:47 +08:00
|
|
|
|
weak_alias (__tzset, tzset)
|