]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Updated to fedora-glibc-20041012T1128 cvs/fedora-glibc-2_3_3-67
authorJakub Jelinek <jakub@redhat.com>
Tue, 12 Oct 2004 12:00:26 +0000 (12:00 +0000)
committerJakub Jelinek <jakub@redhat.com>
Tue, 12 Oct 2004 12:00:26 +0000 (12:00 +0000)
58 files changed:
ChangeLog
PROJECTS
elf/dl-addr.c
elf/dl-sym.c
elf/tst-dlopenrpath.c
fedora/branch.mk
fedora/glibc.spec.in
gmon/Makefile
localedata/ChangeLog
localedata/locales/fa_IR
malloc/malloc.c
misc/sys/uio.h
nptl/ChangeLog
nptl/allocatestack.c
nptl/pt-allocrtsig.c
nptl/pthread_attr_getstackaddr.c
nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
nptl/tst-clock2.c
posix/tst-getaddrinfo2.c
resolv/res_init.c
resolv/res_mkquery.c
resolv/res_send.c
stdio-common/vfscanf.c
sysdeps/m68k/fpu/bits/mathinline.h
sysdeps/m68k/memcopy.h
sysdeps/powerpc/powerpc64/Makefile
sysdeps/powerpc/powerpc64/__longjmp-common.S
sysdeps/powerpc/powerpc64/bsd-_setjmp.S
sysdeps/powerpc/powerpc64/bsd-setjmp.S
sysdeps/powerpc/powerpc64/fpu/s_ceil.S
sysdeps/powerpc/powerpc64/fpu/s_ceilf.S
sysdeps/powerpc/powerpc64/fpu/s_copysign.S
sysdeps/powerpc/powerpc64/fpu/s_floor.S
sysdeps/powerpc/powerpc64/fpu/s_floorf.S
sysdeps/powerpc/powerpc64/fpu/s_llrint.S
sysdeps/powerpc/powerpc64/fpu/s_llrintf.S
sysdeps/powerpc/powerpc64/fpu/s_llround.S
sysdeps/powerpc/powerpc64/fpu/s_llroundf.S
sysdeps/powerpc/powerpc64/fpu/s_rint.S
sysdeps/powerpc/powerpc64/fpu/s_rintf.S
sysdeps/powerpc/powerpc64/fpu/s_round.S
sysdeps/powerpc/powerpc64/fpu/s_roundf.S
sysdeps/powerpc/powerpc64/fpu/s_trunc.S
sysdeps/powerpc/powerpc64/fpu/s_truncf.S
sysdeps/powerpc/powerpc64/memcpy.S
sysdeps/powerpc/powerpc64/memset.S
sysdeps/powerpc/powerpc64/setjmp-common.S
sysdeps/powerpc/powerpc64/stpcpy.S
sysdeps/powerpc/powerpc64/strchr.S
sysdeps/powerpc/powerpc64/strcmp.S
sysdeps/powerpc/powerpc64/strcpy.S
sysdeps/powerpc/powerpc64/strlen.S
sysdeps/powerpc/powerpc64/strncmp.S
sysdeps/powerpc/powerpc64/sysdep.h
timezone/asia
timezone/private.h
timezone/southamerica
timezone/zdump.c

index aeb8bd9e93755478e44e33f3eea28b5f0ff629d0..b930c5e84062e547d564ad4bec09f863015318c6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,93 @@
+2004-10-11  Ulrich Drepper  <drepper@redhat.com>
+
+       * timezone/asia: Update from tzdata2004e.
+       * timezone/southamerica: Likewise.
+       * timezone/private.h: Update from tzcode2004e.
+       * timezone/zdump.c: Likewise.
+
+       * stdio-common/vfscanf.c: Add support for reading localized
+       digits.  Patch mainly by Hamed Malek <hamed@bamdad.org>.
+
+       * resolv/res_init.c (res_thread_freeres): Reset _res.options.
+       [BZ #434]
+
+       * resolv/res_send.c (send_dg): Use nonblocking sockets.  Add
+       appropriate poll/select calls and restart operation if necessary.
+       Also handle EINTR.
+
+       * elf/tst-dlopenrpath.c (do_test): Enable code which was disabled
+       for debugging.
+
+       * elf/dl-sym.c (do_sym): Avoid using global variable.
+
+       * elf/dl-addr.c (_dl_addr): Really use match everywhere.
+
+2004-10-09  Andreas Schwab  <schwab@suse.de>
+
+       * sysdeps/m68k/memcopy.h (WORD_COPY_BWD): Remove use of cast as
+       lvalue.
+
+       * sysdeps/m68k/fpu/bits/mathinline.h: Remove __THROW from inline
+       definitions.
+
+2004-10-07  Andreas Schwab  <schwab@suse.de>
+
+       * misc/sys/uio.h: Change __vector to __iovec to avoid clash with
+       altivec.
+
+2004-10-06  Alan Modra  <amodra@bigpond.net.au>
+
+       * gmon/Makefile (CFLAGS-mcount.c): Move before inclusion of "Rules".
+       * sysdeps/powerpc/powerpc64/Makefile (CFLAGS-mcount.c): Add
+       -msoft-float.
+       * sysdeps/powerpc/powerpc64/sysdep.h (SAVE_ARG, REST_ARG): New macros.
+       (CALL_MCOUNT): Replace with a gas macro implementation.
+       (EALIGN): Delete PROF version.
+       * sysdeps/powerpc/powerpc64/__longjmp-common.S: Invoke CALL_MCOUNT.
+       * sysdeps/powerpc/powerpc64/bsd-_setjmp.S: Likewise.
+       * sysdeps/powerpc/powerpc64/bsd-setjmp.S: Likewise.
+       * sysdeps/powerpc/powerpc64/setjmp-common.S: Likewise.
+       * sysdeps/powerpc/powerpc64/memcpy.S: Likewise.
+       * sysdeps/powerpc/powerpc64/memset.S: Likewise.
+       * sysdeps/powerpc/powerpc64/stpcpy.S: Likewise.
+       * sysdeps/powerpc/powerpc64/strchr.S: Likewise.
+       * sysdeps/powerpc/powerpc64/strcmp.S: Likewise.
+       * sysdeps/powerpc/powerpc64/strcpy.S: Likewise.
+       * sysdeps/powerpc/powerpc64/strlen.S: Likewise.
+       * sysdeps/powerpc/powerpc64/strncmp.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_ceil.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_ceilf.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_copysign.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_floor.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_floorf.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_llrint.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_llrintf.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_llround.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_llroundf.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_rint.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_rintf.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_round.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_roundf.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_trunc.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_truncf.S: Likewise.
+
+       * sysdeps/powerpc/powerpc64/setjmp-common.S: Add extra entry point
+       past _mcount call.
+       * sysdeps/powerpc/powerpc64/bsd-_setjmp.S: Use it.
+       * sysdeps/powerpc/powerpc64/bsd-setjmp.S: Likewise.
+
+2004-10-06  Ulrich Drepper  <drepper@redhat.com>
+
+       * resolv/res_mkquery.c (res_nmkquery): Reject randombits value if
+       low 16 bits are zero.
+
+2004-10-06  Jakub Jelinek  <jakub@redhat.com>
+
+       * posix/tst-getaddrinfo2.c: Include stdlib.h and string.h.
+       (do_test): Use %p instead of 0x%08X to print a pointer.
+
+       * malloc/malloc.c: Include stdio-common/_itoa.h.
+
 2004-10-05  Ulrich Drepper  <drepper@redhat.com>
 
        * elf/rtld.c (dl_main): Use _dl_debug_printf instead of _dl_printf
index 881d7d2046e0c126c5d8961f7d4789ed1ad3fb90..92ca9029435b19ec65ce57d18865a41035053698 100644 (file)
--- a/PROJECTS
+++ b/PROJECTS
@@ -1,6 +1,6 @@
 Open jobs for finishing GNU libc:
 ---------------------------------
-Status: September 2002
+Status: October 2004
 
 If you have time and talent to take over any of the jobs below please
 contact <bug-glibc@gnu.org>.
@@ -53,7 +53,7 @@ contact <bug-glibc@gnu.org>.
 
 
 [11] Write access function for netmasks, bootparams, and automount
-     databases for nss_files and nss_db module.
+     databases for nss_files, nss_nis, and nss_nisplus modules.
      The functions should be embedded in the nss scheme.  This is not
      hard and not all services must be supported at once.
 
@@ -76,7 +76,7 @@ contact <bug-glibc@gnu.org>.
 [18] Based on the sprof program we need tools to analyze the output.  The
      result should be a link map which specifies in which order the .o
      files are placed in the shared object.  This should help to improve
-     code locality and result in a smaller foorprint (in code and data
+     code locality and result in a smaller footprint (in code and data
      memory) since less pages are only used in small parts.
 
 
@@ -93,29 +93,6 @@ contact <bug-glibc@gnu.org>.
      available.
 
 
-[21] The nscd program and the stubs in the libc should be changed so
-     that each program uses only one socket connect.  Take a look at
-       http://people.redhat.com/drepper/nscd.html
-
-     An alternative approach is to use an mmap()ed file.  The idea is
-     the following:
-     - the nscd creates the hash tables and the information it stores
-       in it in a mmap()ed region.  This means no pointers must be
-       used, only offsets.
-     OR
-       if POSIX shared memory is available use a named shared memory
-       region to put the data in
-     - each program using NSS functionality tries to open the file
-       with the data.
-     - by checking some timestamp (which the nscd renews frequently)
-       the programs can test whether the file is still valid
-     - if the file is valid look through the nscd and locate the
-       appropriate hash table for the database and lookup the data.
-       If it is included we are set.
-     - if the data is not yet in the database we contact the nscd using
-       the currently implemented methods.
-
-
 [23] The `strptime' function needs to be completed.  This includes among
      other things that it must get teached about timezones.  The solution
      envisioned is to extract the timezones from the ADO timezone
@@ -127,18 +104,4 @@ contact <bug-glibc@gnu.org>.
      Australia/Canberra or if the current locale is en_AU.
 
 
-[25] Sun's nscd version implements a feature where the nscd keeps N entries
-     for each database current.  I.e., if an entries lifespan is over and
-     it is one of the N entries to be kept the nscd updates the information
-     instead of removing the entry.
-
-     How to decide about which N entries to keep has to be examined.
-     Factors should be number of uses (of course), influenced by aging.
-     Just imagine a computer used by several people.  The IDs of the current
-     user should be preferred even if the last user spent more time.
-
-
-[27] We need a second test suite with tests which cannot run during a normal
-     `make check' run.  This test suite can require root priviledges and
-     can test things like DNS (i.e., require network access),
-     user-interaction, networking in general, and probably many other things.
+[27] ...deleted...
index ae97398bad7617ee4498863d1220f20297b1010f..c373eb3b17745de986898ca9b2dd1810187eb93b 100644 (file)
@@ -28,7 +28,7 @@ _dl_addr (const void *address, Dl_info *info,
          struct link_map **mapp, const ElfW(Sym) **symbolp)
 {
   const ElfW(Addr) addr = DL_LOOKUP_ADDRESS (address);
-  struct link_map *l, *match;
+  struct link_map *match;
   const ElfW(Sym) *symtab, *matchsym, *symtabend;
   const char *strtab;
   ElfW(Word) strtabsize;
@@ -38,7 +38,7 @@ _dl_addr (const void *address, Dl_info *info,
 
   /* Find the highest-addressed object that ADDRESS is not below.  */
   match = NULL;
-  for (l = GL(dl_loaded); l; l = l->l_next)
+  for (struct link_map *l = GL(dl_loaded); l; l = l->l_next)
     if (addr >= l->l_map_start && addr < l->l_map_end)
       {
        /* We know ADDRESS lies within L if in any shared object.
@@ -67,8 +67,8 @@ _dl_addr (const void *address, Dl_info *info,
       info->dli_fbase = (void *) match->l_map_start;
 
       /* If this is the main program the information is incomplete.  */
-      if (__builtin_expect (l->l_name[0], 'a') == '\0'
-         && l->l_type == lt_executable)
+      if (__builtin_expect (match->l_name[0], 'a') == '\0'
+         && match->l_type == lt_executable)
        info->dli_fname = _dl_argv[0];
 
       symtab = (const void *) D_PTR (match, l_info[DT_SYMTAB]);
index c7c737804ec7e6871f3ddb33a8d4de386e427bb8..a94610263decf77a9d0d14053f2d008186ab7d8a 100644 (file)
@@ -90,9 +90,9 @@ do_sym (void *handle, const char *name, void *who,
     {
       if (__builtin_expect (match == GL(dl_loaded), 0))
        {
-         if (! GL(dl_loaded)
-             || caller < GL(dl_loaded)->l_map_start
-             || caller >= GL(dl_loaded)->l_map_end)
+         if (match == NULL
+             || caller < match->l_map_start
+             || caller >= match->l_map_end)
            GLRO(dl_signal_error) (0, NULL, NULL, N_("\
 RTLD_NEXT used in code not dynamically loaded"));
        }
index 964f103b8c3e304d77738372d841a9c4b57da5d4..bd4d888f34f3c5550c186d2956a58256aa3209a7 100644 (file)
@@ -62,10 +62,8 @@ do_test (void)
   result = foo ();
 
  out:
-#if 0
   unlink (PFX "test-subdir/in-subdir.so");
   rmdir (testsubdir);
-#endif
 
   return result;
 }
index 086ea6912bf248a321ff6298b063b660bd7f1ba3..abdfc0ce4110d94fc840e9329a521c8eaa57f7de 100644 (file)
@@ -1,5 +1,5 @@
 # This file is updated automatically by Makefile.
 glibc-branch := fedora
 glibc-base := HEAD
-fedora-sync-date := 2004-10-06 09:00 UTC
-fedora-sync-tag := fedora-glibc-20041006T0900
+fedora-sync-date := 2004-10-12 11:28 UTC
+fedora-sync-tag := fedora-glibc-20041012T1128
index b93411f1d7c5da34d87680750729deb37c226576..766d7c55189a88f4d7b6a0fdbb9646d56dcb958a 100644 (file)
@@ -1,4 +1,4 @@
-%define glibcrelease 66
+%define glibcrelease 67
 %define auxarches i586 i686 athlon sparcv9 alphaev6
 %define prelinkarches noarch
 %define nptlarches i386 i686 athlon x86_64 ia64 s390 s390x sparcv9 ppc ppc64
@@ -1239,6 +1239,13 @@ rm -f *.filelist*
 %endif
 
 %changelog
+* Tue Oct 12 2004 Jakub Jelinek <jakub@redhat.com> 2.3.3-67
+- update from CVS
+  - use non-blocking sockets in resolver (#135234)
+  - reset pd->res options on thread exit, so that threads
+    reusing cached stacks get resolver state properly initialized
+    (BZ #434)
+
 * Wed Oct  6 2004 Jakub Jelinek <jakub@redhat.com> 2.3.3-66
 - update from CVS
 - avoid using perl in the spec file, buildrequire sed >= 3.95
index 060ede1f8f5ca40a661a3010e75df632a475c37e..80a79456f72c704d2f6f0e4a6af0a60c198d7ade 100644 (file)
@@ -29,11 +29,11 @@ elide-routines.os = bb_init_func bb_exit_func
 
 tests  := tst-sprofil
 
-include ../Rules
-
 # The mcount code won't work without a frame pointer.
 CFLAGS-mcount.c := -fno-omit-frame-pointer
 
+include ../Rules
+
 # We cannot compile mcount.c with -pg because that would
 # create recursive calls.  Just copy the normal static object.
 # On systems where `profil' is not a system call, the same
index 065136e8d7a9264bf2678865d15cc4c9a7cb45e2..5f362c62b74b852d1b2ecbe00158b8f2b96250c9 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-11  Ulrich Drepper  <drepper@redhat.com>
+
+       * locales/fa_IR: Add to_inpunct map.
+       Patch by Hamed Malek <hamed@bamdad.org>.
+
 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
 
        * locales/gu_IN: Update various incorrect and missing information.
index 128c5d8cdcb3dc23f196c5a93fd8205d08110710..8f65b1edd89f02ce1abc9a0bb4da9b11a8c43c5e 100644 (file)
@@ -10,8 +10,8 @@ escape_char  /
 % Fax: +98 21 6019568
 % Language: fa
 % Territory: IR
-% Revision: 2.3
-% Date: 2004-03-16
+% Revision: 2.4
+% Date: 2004-09-04
 % Users: general
 % Repertoiremap:
 % Charset: UTF-8
@@ -50,6 +50,20 @@ copy "i18n"
 
 outdigit <U06F0>..<U06F9>
 
+map to_inpunct; /
+  (<U0030>,<U06F0>); /
+  (<U0031>,<U06F1>); /
+  (<U0032>,<U06F2>); /
+  (<U0033>,<U06F3>); /
+  (<U0034>,<U06F4>); /
+  (<U0035>,<U06F5>); /
+  (<U0036>,<U06F6>); /
+  (<U0037>,<U06F7>); /
+  (<U0038>,<U06F8>); /
+  (<U0039>,<U06F9>); /
+  (<U002E>,<U066B>); /
+  (<U002C>,<U066C>)
+
 map to_outpunct; /
   (<U002E>,<U066B>); /
   (<U002C>,<U066C>)
index a41171490a7a5df6968721505951e9039ae1439f..ad6009a198b660ad73dabfe13ff207a6b838f78f 100644 (file)
 
 #include <malloc-machine.h>
 
+#ifdef _LIBC
+#include <stdio-common/_itoa.h>
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
index 53add9f2e2c2ca39997c09c7d6252e4f9235ebe7..1b203f71c2ac314a2b2c3a852d49efb0f89cb6d2 100644 (file)
@@ -30,24 +30,24 @@ __BEGIN_DECLS
 
 
 /* Read data from file descriptor FD, and put the result in the
-   buffers described by VECTOR, which is a vector of COUNT `struct iovec's.
+   buffers described by IOVEC, which is a vector of COUNT `struct iovec's.
    The buffers are filled in the order specified.
    Operates just like `read' (see <unistd.h>) except that data are
-   put in VECTOR instead of a contiguous buffer.
+   put in IOVEC instead of a contiguous buffer.
 
    This function is a cancellation point and therefore not marked with
    __THROW.  */
-extern ssize_t readv (int __fd, __const struct iovec *__vector, int __count);
+extern ssize_t readv (int __fd, __const struct iovec *__iovec, int __count);
 
-/* Write data pointed by the buffers described by VECTOR, which
+/* Write data pointed by the buffers described by IOVEC, which
    is a vector of COUNT `struct iovec's, to file descriptor FD.
    The data is written in the order specified.
    Operates just like `write' (see <unistd.h>) except that the data
-   are taken from VECTOR instead of a contiguous buffer.
+   are taken from IOVEC instead of a contiguous buffer.
 
    This function is a cancellation point and therefore not marked with
    __THROW.  */
-extern ssize_t writev (int __fd, __const struct iovec *__vector, int __count);
+extern ssize_t writev (int __fd, __const struct iovec *__iovec, int __count);
 
 __END_DECLS
 
index 5d488cd1a5daf4c52e7c5ab1e2f1f4516fbce2cf..e842302cb8546e35a60d885f465df9e4fd31dea8 100644 (file)
@@ -4,9 +4,17 @@
        of pthread-functions.h and pthreaddef.h.
        * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
 
+       * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
+       Change __data.__nwaiters from int to unsigned int.
+
+       * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
+       sysconf (_SC_THREAD_CPUTIME) returns negative value.
+
+       * allocatestack.c (__find_thread_by_id): Move attribute_hidden
+       before return type.
+
        * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
-       (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from
-       CFA.
+       (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
 
 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
 
index 242da0a5a1f489ff0b2b333d3eb287d5592b0073..d4f3188f5375a6d28c79d50f5134fb24c547becd 100644 (file)
@@ -772,8 +772,8 @@ __reclaim_stacks (void)
 
 #if HP_TIMING_AVAIL
 /* Find a thread given the thread ID.  */
-struct pthread *
 attribute_hidden
+struct pthread *
 __find_thread_by_id (pid_t tid)
 {
   struct pthread *result = NULL;
index 9481e15f25bb41180a2ae859a76faaf0c03d36a6..347bf139ad81626f21f0b782e5bc0b0a59408a5d 100644 (file)
@@ -28,7 +28,7 @@ extern int __libc_allocate_rtsig_private (int high);
 
 
 /* We reserve __SIGRTMIN for use as the cancellation signal and
-   __SIGRTMIN+1 to andle setuid et.al.  These signals are used
+   __SIGRTMIN+1 to handle setuid et.al.  These signals are used
    internally.  */
 int
 __libc_current_sigrtmin (void)
index e6e25880ab0024dc7f0ad1fb33eca77f8ada2534..7656600dd5d5801898d70d2fef33fe697870a211 100644 (file)
@@ -33,7 +33,7 @@ __pthread_attr_getstackaddr (attr, stackaddr)
   iattr = (struct pthread_attr *) attr;
 
   /* Some code assumes this function to work even if no stack address
-     has been set.  Let them figure it our for themselves what the
+     has been set.  Let them figure it out for themselves what the
      value means.  Simply store the result.  */
   *stackaddr = iattr->stackaddr;
 
index 03c2ef8106dc0b4c62de2ef37e024ca64af3e92b..92fb08c951cf44b19f7c184ca7abfc44f727ff85 100644 (file)
@@ -100,7 +100,7 @@ typedef union
     __extension__ unsigned long long int __wakeup_seq;
     __extension__ unsigned long long int __woken_seq;
     void *__mutex;
-    int __nwaiters;
+    unsigned int __nwaiters;
     unsigned int __broadcast_seq;
   } __data;
   char __size[__SIZEOF_PTHREAD_COND_T];
index fd216b2ba14cf5ff4aa7cf7b4a12a12ad361c01e..bca40956e20d3659804b24f88a6740d93ee058cd 100644 (file)
@@ -58,6 +58,14 @@ do_test (void)
 #if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0
 # define N 10
 
+# if _POSIX_THREAD_CPUTIME == 0
+  if (sysconf (_SC_THREAD_CPUTIME) < 0)
+    {
+      puts ("_POSIX_THREAD_CPUTIME option not available");
+      return 0;
+    }
+# endif
+
   if (pthread_barrier_init (&b2, NULL, 2) != 0
       || pthread_barrier_init (&bN, NULL, N + 1) != 0)
     {
index b0bce5925ced7bfc339fa3cc96eb941c3240fb53..13edca0a34f2981337d8b6a0d76ee03cced6f7c7 100644 (file)
@@ -2,6 +2,8 @@
 #include <errno.h>
 #include <netdb.h>
 #include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
 #include <sys/socket.h>
 
 static int
@@ -47,7 +49,7 @@ do_test (void)
       if (err)
         {
           printf ("FAIL getaddrinfo IPv4 socktype 0,513: "
-                  "fam %d alen %d addr 0x%08X addr/fam %d "
+                  "fam %d alen %d addr %p addr/fam %d "
                   "addr/port %d H[%d]\n",
                   pai->ai_family, pai->ai_addrlen, psin,
                   psin ? psin->sin_family : 0,
index 4087597a87575173ef96b9a97498f23ed83ed8b3..731c784e17476754136fd774c3ba222bb1179856 100644 (file)
@@ -597,6 +597,9 @@ res_thread_freeres (void)
        free (_res._u._ext.nsaddrs[ns]);
        _res._u._ext.nsaddrs[ns] = NULL;
       }
+
+  /* Make sure we do a full re-initialization the next time.  */
+  _res.options = 0;
 }
 text_set_element (__libc_thread_subfreeres, res_thread_freeres);
 text_set_element (__libc_subfreeres, res_thread_freeres);
index 5b705b0e8b33bc592a8288949a36d6a76f7a26da..9825ae0fa33d1f00cad6f65ea6abd521bfe98f79 100644 (file)
@@ -141,7 +141,7 @@ res_nmkquery(res_state statp,
            randombits = (tv.tv_sec << 8) ^ tv.tv_usec;
 #endif
          }
-       while (randombits == 0);
+       while ((randombits & 0xffff) == 0);
        statp->id = (statp->id + randombits) & 0xffff;
 #endif
        hp->opcode = op;
index 2366f59cd2000afef9af28a38360ef58c721a0a0..44d8cb0feeccfe71f6c234a450de9d8f40551f95 100644 (file)
@@ -88,6 +88,7 @@ static const char rcsid[] = "$BINDId: res_send.c,v 8.38 2000/03/30 20:16:51 vixi
 #include <sys/ioctl.h>
 
 #include <errno.h>
+#include <fcntl.h>
 #include <netdb.h>
 #include <resolv.h>
 #include <signal.h>
@@ -965,12 +966,73 @@ send_dg(res_state statp,
                        return (0);
                }
 #endif /* !CANNOT_CONNECT_DGRAM */
+               /* Make socket non-blocking.  */
+               int fl = __fcntl (EXT(statp).nssocks[ns], F_GETFL);
+               if  (fl != -1)
+                       __fcntl (EXT(statp).nssocks[ns], F_SETFL,
+                                fl | O_NONBLOCK);
                Dprint(statp->options & RES_DEBUG,
                       (stdout, ";; new DG socket\n"))
        }
        s = EXT(statp).nssocks[ns];
+       /*
+        * Compute time for the total operation.
+        */
+       seconds = (statp->retrans << ns);
+       if (ns > 0)
+               seconds /= statp->nscount;
+       if (seconds <= 0)
+               seconds = 1;
+       evNowTime(&now);
+       evConsTime(&timeout, seconds, 0);
+       evAddTime(&finish, &now, &timeout);
+       int need_recompute = 0;
+ resend:
+#ifdef _LIBC
+        /* Convert struct timespec in milliseconds.  */
+       ptimeout = timeout.tv_sec * 1000 + timeout.tv_nsec / 1000000;
+
+       pfd[0].fd = s;
+       pfd[0].events = POLLOUT;
+       n = __poll (pfd, 1, 0);
+       if (__builtin_expect (n == 0, 0)) {
+               n = __poll (pfd, 1, ptimeout);
+               need_recompute = 1;
+       }
+#else
+       FD_ZERO(&dsmask);
+       FD_SET(s, &dsmask);
+       struct timeval zerotime = { 0, 0 };
+       n = pselect(s + 1, NULL, &dsmask, NULL, &zerotime, NULL);
+       if (n == 0) {
+               n = pselect(s + 1, NULL, &dsmask, NULL, &timeout, NULL);
+               need_recompute = 1;
+       }
+#endif
+       if (n == 0) {
+               Dprint(statp->options & RES_DEBUG, (stdout,
+                                                   ";; timeout sending\n"));
+               *gotsomewhere = 1;
+               return (0);
+       }
+       if (n < 0) {
+               if (errno == EINTR) {
+               recompute_resend:
+                       evNowTime(&now);
+                       if (evCmpTime(finish, now) > 0) {
+                               evSubTime(&timeout, &finish, &now);
+                               goto resend;
+                       }
+               }
+               Perror(statp, stderr, "select", errno);
+               res_nclose(statp);
+               return (0);
+       }
+       __set_errno (0);
 #ifndef CANNOT_CONNECT_DGRAM
        if (send(s, (char*)buf, buflen, 0) != buflen) {
+               if (errno == EINTR || errno == EAGAIN)
+                       goto recompute_resend;
                Perror(statp, stderr, "send", errno);
                res_nclose(statp);
                return (0);
@@ -984,6 +1046,8 @@ send_dg(res_state statp,
        if (sendto(s, (char*)buf, buflen, 0,
                   (struct sockaddr *)nsap, sizeof *nsap) != buflen)
        {
+               if (errno == EINTR || errno == EAGAIN)
+                       goto recompute_resend;
                Aerror(statp, stderr, "sendto", errno,
                       (struct sockaddr *) nsap);
                res_nclose(statp);
@@ -991,46 +1055,38 @@ send_dg(res_state statp,
        }
 #endif /* !CANNOT_CONNECT_DGRAM */
 
-       /*
-        * Wait for reply.
-        */
-       seconds = (statp->retrans << ns);
-       if (ns > 0)
-               seconds /= statp->nscount;
-       if (seconds <= 0)
-               seconds = 1;
-       evNowTime(&now);
-       evConsTime(&timeout, seconds, 0);
-       evAddTime(&finish, &now, &timeout);
  wait:
+       if (need_recompute) {
+               evNowTime(&now);
+               if (evCmpTime(finish, now) <= 0) {
+               err_return:
+                       Perror(statp, stderr, "select", errno);
+                       res_nclose(statp);
+                       return (0);
+               }
+               evSubTime(&timeout, &finish, &now);
+       }
 #ifdef _LIBC
         /* Convert struct timespec in milliseconds.  */
        ptimeout = timeout.tv_sec * 1000 + timeout.tv_nsec / 1000000;
 
-       pfd[0].fd = s;
        pfd[0].events = POLLIN;
        n = __poll (pfd, 1, ptimeout);
 #else
-       FD_ZERO(&dsmask);
-       FD_SET(s, &dsmask);
        n = pselect(s + 1, &dsmask, NULL, NULL, &timeout, NULL);
 #endif
        if (n == 0) {
-               Dprint(statp->options & RES_DEBUG, (stdout, ";; timeout\n"));
+               Dprint(statp->options & RES_DEBUG, (stdout,
+                                                   ";; timeout receiving\n"));
                *gotsomewhere = 1;
                return (0);
        }
        if (n < 0) {
                if (errno == EINTR) {
-                       evNowTime(&now);
-                       if (evCmpTime(finish, now) > 0) {
-                               evSubTime(&timeout, &finish, &now);
-                               goto wait;
-                       }
+                       need_recompute = 1;
+                       goto wait;
                }
-               Perror(statp, stderr, "select", errno);
-               res_nclose(statp);
-               return (0);
+               goto err_return;
        }
        __set_errno (0);
 #ifdef _LIBC
@@ -1056,6 +1112,10 @@ send_dg(res_state statp,
        resplen = recvfrom(s, (char*)ans, anssiz,0,
                           (struct sockaddr *)&from, &fromlen);
        if (resplen <= 0) {
+               if (errno == EINTR || errno == EAGAIN) {
+                       need_recompute = 1;
+                       goto wait;
+               }
                Perror(statp, stderr, "recvfrom", errno);
                res_nclose(statp);
                return (0);
index 63e7bd8815a38fb5efd73f338a14a3473941ea04..c641d2d37104c89847de88fb4749db13407d56f7 100644 (file)
@@ -1163,9 +1163,15 @@ _IO_vfscanf (s, format, argptr, errp)
              int level;
 #ifdef COMPILE_WSCANF
              const wchar_t *wcdigits[10];
+             const wchar_t *wcdigits_extended[10];
 #else
              const char *mbdigits[10];
+             const char *mbdigits_extended[10];
 #endif
+             /*  "to_inpunct" is a map from ASCII digits to their
+                 equivalent in locale. This is defined for locales
+                 which use an extra digits set.  */
+             wctrans_t map = __wctrans ("to_inpunct");
              int n;
 
              from_level = 0;
@@ -1176,6 +1182,66 @@ _IO_vfscanf (s, format, argptr, errp)
              to_level = (uint32_t) curctype->values[_NL_ITEM_INDEX (_NL_CTYPE_INDIGITS_MB_LEN)].word - 1;
 #endif
 
+             /* Get the alternative digit forms if there are any.  */
+             if (__builtin_expect (map != NULL, 0))
+               {
+                 /*  Adding new level for extra digits set in locale file.  */
+                 ++to_level;
+
+                 for (n = 0; n < 10; ++n)
+                   {
+#ifdef COMPILE_WSCANF
+                     wcdigits[n] = (const wchar_t *)
+                        _NL_CURRENT (LC_CTYPE, _NL_CTYPE_INDIGITS0_WC + n);
+
+                     wchar_t *wc_extended = (wchar_t *)
+                       alloca ((to_level + 2) * sizeof (wchar_t));
+                     __wmemcpy (wc_extended, wcdigits[n], to_level);
+                     wc_extended[to_level] = __towctrans (L'0' + n, map);
+                     wc_extended[to_level + 1] = '\0';
+                     wcdigits_extended[n] = wc_extended;
+#else
+                     mbdigits[n]
+                        = curctype->values[_NL_CTYPE_INDIGITS0_MB + n].string;
+
+                     /*  Get the equivalent wide char in map.  */
+                     wint_t extra_wcdigit = __towctrans (L'0' + n, map);
+
+                     /*  Convert it to multibyte representation.  */
+                     mbstate_t state;
+                     memset (&state, '\0', sizeof (state));
+
+                     char extra_mbdigit[MB_LEN_MAX];
+                     size_t mblen
+                       = __wcrtomb (extra_mbdigit, extra_wcdigit, &state);
+
+                     if (mblen == (size_t) -1)
+                       {
+                         /*  Ignore this new level.  */
+                         map = NULL;
+                         break;
+                       }
+
+                     /*  Calculate the length of mbdigits[n].  */
+                     const char *last_char = mbdigits[n];
+                     for (level = 0; level < to_level; ++level)
+                       last_char = strchr (last_char, '\0') + 1;
+
+                     size_t mbdigits_len = last_char - mbdigits[n];
+
+                     /*  Allocate memory for extended multibyte digit.  */
+                     char *mb_extended;
+                     mb_extended = (char *) alloca (mbdigits_len + mblen + 1);
+
+                     /*  And get the mbdigits + extra_digit string.  */
+                     *(char *) __mempcpy (__mempcpy (mb_extended, mbdigits[n],
+                                                     mbdigits_len),
+                                          extra_mbdigit, mblen) = '\0';
+                     mbdigits_extended[n] = mb_extended;
+#endif
+                   }
+               }
+
              /* Read the number into workspace.  */
              while (c != EOF && width != 0)
                {
@@ -1185,8 +1251,11 @@ _IO_vfscanf (s, format, argptr, errp)
                    {
                      /* Get the string for the digits with value N.  */
 #ifdef COMPILE_WSCANF
-                     wcdigits[n] = (const wchar_t *)
-                       _NL_CURRENT (LC_CTYPE, _NL_CTYPE_INDIGITS0_WC + n);
+                     if (__builtin_expect (map != NULL, 0))
+                       wcdigits[n] = wcdigits_extended[n];
+                     else
+                       wcdigits[n] = (const wchar_t *)
+                         _NL_CURRENT (LC_CTYPE, _NL_CTYPE_INDIGITS0_WC + n);
                      wcdigits[n] += from_level;
 
                      if (c == (wint_t) *wcdigits[n])
@@ -1201,8 +1270,11 @@ _IO_vfscanf (s, format, argptr, errp)
                      const char *cmpp;
                      int avail = width > 0 ? width : INT_MAX;
 
-                     mbdigits[n]
-                       = curctype->values[_NL_CTYPE_INDIGITS0_MB + n].string;
+                     if (__builtin_expect (map != NULL, 0))
+                       mbdigits[n] = mbdigits_extended[n];
+                     else
+                       mbdigits[n]
+                         = curctype->values[_NL_CTYPE_INDIGITS0_MB + n].string;
 
                      for (level = 0; level < from_level; level++)
                        mbdigits[n] = strchr (mbdigits[n], '\0') + 1;
index 1e43e43047009cee6c8fa2f08de4df4eab51101a..acbac47aacef2424cab36ba2ea21f3d91cda918f 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions of inline math functions implemented by the m68881/2.
-   Copyright (C) 1991,92,93,94,96,97,98,99,2000,2002, 2003
+   Copyright (C) 1991,92,93,94,96,97,98,99,2000,2002, 2003, 2004
      Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
 #if defined __USE_MISC || defined __USE_ISOC99
 # define __inline_mathop(func, op)                     \
   __inline_mathop1(double, func, op)                   \
-  __inline_mathop1(float, __CONCAT(func,f), op)                \
+  __inline_mathop1(float, __CONCAT(func,f), op)        \
   __inline_mathop1(long double, __CONCAT(func,l), op)
 #else
 # define __inline_mathop(func, op)                     \
 #endif
 
 #define __inline_mathop1(float_type,func, op)                                \
-  __m81_defun (float_type, func, (float_type __mathop_x)) __THROW            \
+  __m81_defun (float_type, func, (float_type __mathop_x))                    \
   {                                                                          \
     float_type __result;                                                     \
     __asm("f" __STRING(op) "%.x %1, %0" : "=f" (__result) : "f" (__mathop_x));\
@@ -175,7 +175,7 @@ __inline_mathop(trunc, intrz)
    for the function names.  */
 
 #define __inline_functions(float_type, s)                                \
-__m81_defun (float_type, __CONCAT(__floor,s), (float_type __x))        __THROW   \
+__m81_defun (float_type, __CONCAT(__floor,s), (float_type __x))          \
 {                                                                        \
   float_type __result;                                                   \
   unsigned long int __ctrl_reg;                                                  \
@@ -191,7 +191,7 @@ __m81_defun (float_type, __CONCAT(__floor,s), (float_type __x))     __THROW   \
   return __result;                                                       \
 }                                                                        \
                                                                          \
-__m81_defun (float_type, __CONCAT(__ceil,s), (float_type __x)) __THROW   \
+__m81_defun (float_type, __CONCAT(__ceil,s), (float_type __x))           \
 {                                                                        \
   float_type __result;                                                   \
   unsigned long int __ctrl_reg;                                                  \
@@ -217,7 +217,7 @@ __inline_functions(long double,l)
 #ifdef __USE_MISC
 
 # define __inline_functions(float_type, s)                               \
-__m81_defun (int, __CONCAT(__isinf,s), (float_type __value)) __THROW     \
+__m81_defun (int, __CONCAT(__isinf,s), (float_type __value))             \
 {                                                                        \
   /* There is no branch-condition for infinity,                                  \
      so we must extract and examine the condition codes manually.  */    \
@@ -227,7 +227,7 @@ __m81_defun (int, __CONCAT(__isinf,s), (float_type __value)) __THROW          \
   return (__fpsr & (2 << 24)) ? (__fpsr & (8 << 24) ? -1 : 1) : 0;       \
 }                                                                        \
                                                                          \
-__m81_defun (int, __CONCAT(__finite,s), (float_type __value)) __THROW    \
+__m81_defun (int, __CONCAT(__finite,s), (float_type __value))            \
 {                                                                        \
   /* There is no branch-condition for infinity, so we must extract and   \
      examine the condition codes manually.  */                           \
@@ -238,7 +238,7 @@ __m81_defun (int, __CONCAT(__finite,s), (float_type __value)) __THROW         \
 }                                                                        \
                                                                          \
 __m81_defun (float_type, __CONCAT(__scalbn,s),                           \
-            (float_type __x, int __n)) __THROW                           \
+            (float_type __x, int __n))                                   \
 {                                                                        \
   float_type __result;                                                   \
   __asm ("fscale%.l %1, %0" : "=f" (__result) : "dmi" (__n), "0" (__x));  \
@@ -255,7 +255,7 @@ __inline_functions(long double,l)
 #if defined __USE_MISC || defined __USE_XOPEN
 
 # define __inline_functions(float_type, s)                               \
-__m81_defun (int, __CONCAT(__isnan,s), (float_type __value)) __THROW     \
+__m81_defun (int, __CONCAT(__isnan,s), (float_type __value))             \
 {                                                                        \
   char __result;                                                         \
   __asm("ftst%.x %1\n"                                                   \
@@ -275,7 +275,7 @@ __inline_functions(long double,l)
 #ifdef __USE_ISOC99
 
 # define __inline_functions(float_type, s)                               \
-__m81_defun (int, __CONCAT(__signbit,s), (float_type __value)) __THROW   \
+__m81_defun (int, __CONCAT(__signbit,s), (float_type __value))           \
 {                                                                        \
   /* There is no branch-condition for the sign bit, so we must extract   \
      and examine the condition codes manually.  */                       \
@@ -285,13 +285,13 @@ __m81_defun (int, __CONCAT(__signbit,s), (float_type __value)) __THROW      \
   return (__fpsr >> 27) & 1;                                             \
 }                                                                        \
                                                                          \
-__m81_defun (float_type, __CONCAT(__scalbln,s),                                  \
-            (float_type __x, long int __n)) __THROW                      \
+  __m81_defun (float_type, __CONCAT(__scalbln,s),                        \
+            (float_type __x, long int __n))                              \
 {                                                                        \
   return __CONCAT(__scalbn,s) (__x, __n);                                \
 }                                                                        \
                                                                          \
-__m81_defun (float_type, __CONCAT(__nearbyint,s), (float_type __x)) __THROW \
+__m81_defun (float_type, __CONCAT(__nearbyint,s), (float_type __x))      \
 {                                                                        \
   float_type __result;                                                   \
   unsigned long int __ctrl_reg;                                                  \
@@ -305,7 +305,7 @@ __m81_defun (float_type, __CONCAT(__nearbyint,s), (float_type __x)) __THROW \
   return __result;                                                       \
 }                                                                        \
                                                                          \
-__m81_defun (long int, __CONCAT(__lrint,s), (float_type __x)) __THROW    \
+__m81_defun (long int, __CONCAT(__lrint,s), (float_type __x))            \
 {                                                                        \
   long int __result;                                                     \
   __asm ("fmove%.l %1, %0" : "=dm" (__result) : "f" (__x));              \
@@ -314,7 +314,7 @@ __m81_defun (long int, __CONCAT(__lrint,s), (float_type __x)) __THROW         \
                                                                          \
 __m81_inline float_type                                                          \
 __m81_u(__CONCAT(__fma,s))(float_type __x, float_type __y,               \
-                          float_type __z) __THROW                        \
+                          float_type __z)                                \
 {                                                                        \
   return (__x * __y) + __z;                                              \
 }
@@ -331,7 +331,7 @@ __inline_functions (long double,l)
 # define __inline_functions(float_type, s)                             \
 __m81_inline void                                                      \
 __m81_u(__CONCAT(__sincos,s))(float_type __x, float_type *__sinx,      \
-                             float_type *__cosx) __THROW               \
+                             float_type *__cosx)                       \
 {                                                                      \
   __asm ("fsincos%.x %2,%1:%0"                                         \
         : "=f" (*__sinx), "=f" (*__cosx) : "f" (__x));                 \
@@ -351,14 +351,14 @@ __inline_functions (long double,l)
 /* Note that there must be no whitespace before the argument passed for
    NAME, to make token pasting work correctly with -traditional.  */
 # define __inline_forward_c(rettype, name, args1, args2)       \
-extern __inline rettype __attribute__((__const__))     \
-name args1 __THROW                                     \
-{                                                      \
-  return __CONCAT(__,name) args2;                      \
+extern __inline rettype __attribute__((__const__))             \
+  name args1                                                   \
+{                                                              \
+  return __CONCAT(__,name) args2;                              \
 }
 
 # define __inline_forward(rettype, name, args1, args2) \
-extern __inline rettype name args1 __THROW             \
+extern __inline rettype name args1                     \
 {                                                      \
   return __CONCAT(__,name) args2;                      \
 }
index cdc268ad51133082e777034cac95cfcfcde392aa..0951eeaf7a50415f3375e7fc4111f308f424fc8c 100644 (file)
@@ -1,5 +1,5 @@
 /* memcopy.h -- definitions for memory copy functions.  Motorola 68020 version.
-   Copyright (C) 1991, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1997, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Torbjorn Granlund (tege@sics.se).
 
   do                                                                         \
     {                                                                        \
       size_t __nblocks = (nbytes) / 32 + 1;                                  \
+      op_t *__dst_ep = (op_t *) (dst_ep);                                    \
+      op_t *__src_ep = (op_t *) (src_ep);                                    \
       switch ((nbytes) / sizeof (op_t) % 8)                                  \
        do                                                                    \
          {                                                                   \
-           *--((op_t *) dst_ep) = *--((op_t *) src_ep);                      \
+           *--__dst_ep = *--__src_ep;                                        \
          case 7:                                                             \
-           *--((op_t *) dst_ep) = *--((op_t *) src_ep);                      \
+           *--__dst_ep = *--__src_ep;                                        \
          case 6:                                                             \
-           *--((op_t *) dst_ep) = *--((op_t *) src_ep);                      \
+           *--__dst_ep = *--__src_ep;                                        \
          case 5:                                                             \
-           *--((op_t *) dst_ep) = *--((op_t *) src_ep);                      \
+           *--__dst_ep = *--__src_ep;                                        \
          case 4:                                                             \
-           *--((op_t *) dst_ep) = *--((op_t *) src_ep);                      \
+           *--__dst_ep = *--__src_ep;                                        \
          case 3:                                                             \
-           *--((op_t *) dst_ep) = *--((op_t *) src_ep);                      \
+           *--__dst_ep = *--__src_ep;                                        \
          case 2:                                                             \
-           *--((op_t *) dst_ep) = *--((op_t *) src_ep);                      \
+           *--__dst_ep = *--__src_ep;                                        \
          case 1:                                                             \
-           *--((op_t *) dst_ep) = *--((op_t *) src_ep);                      \
+           *--__dst_ep = *--__src_ep;                                        \
          case 0:                                                             \
            __nblocks--;                                                      \
          }                                                                   \
       while (__nblocks != 0);                                                \
       (nbytes_left) = (nbytes) % sizeof (op_t);                                      \
+      (dst_ep) = (unsigned long) __dst_ep;                                   \
+      (src_ep) = (unsigned long) __src_ep;                                   \
     } while (0)
 
 #endif
index 758b856854829cdb8f0fcacb750331bd9350762b..3ced6568df0a496dc27dcb6f737881fd2d6d3f5d 100644 (file)
@@ -22,3 +22,10 @@ ifeq ($(subdir),elf)
 # help gcc inline asm code from dl-machine.h
 +cflags += -finline-limit=2000
 endif
+
+ifeq ($(subdir),gmon)
+# The assembly functions assume that fp arg regs are not trashed.
+# Compiling with -msoft-float ensures that fp regs are not used
+# for moving memory around.
+CFLAGS-mcount.c += -msoft-float
+endif
index b11a0fd7b53a437ebb0ed6aab1eb86392ef527d4..9d0195dd147fa5bcff86d754129c2c6b5d62cb43 100644 (file)
@@ -42,6 +42,7 @@
 
        .machine        "altivec"
 ENTRY (BP_SYM (__longjmp))
+       CALL_MCOUNT 2
        CHECK_BOUNDS_BOTH_WIDE_LIT (r3, r8, r9, JB_SIZE)
 #ifndef __NO_VMX__
        ld    r5,.LC__dl_hwcap@toc(r2)
index 13f405670618016303fbfac02e46a88f9efa5d80..82b79a80986fa449c59ab669e9a4b69a2777cca8 100644 (file)
@@ -25,8 +25,9 @@
 #if defined NOT_IN_libc
 /* Build a non-versioned object for rtld-*.  */
 ENTRY (BP_SYM (_setjmp))
+       CALL_MCOUNT 1
        li r4,0                 /* Set second argument to 0.  */
-       b JUMPTARGET(BP_SYM (__sigsetjmp))
+       b JUMPTARGET (__sigsetjmp_ent)
 END (BP_SYM (_setjmp))
 libc_hidden_def (_setjmp)
 
@@ -36,8 +37,9 @@ libc_hidden_def (_setjmp)
 symbol_version (__novmx_setjmp,_setjmp,GLIBC_2.3);
 
 ENTRY (BP_SYM (__novmx_setjmp))
+       CALL_MCOUNT 1
        li r4,0                 /* Set second argument to 0.  */
-       b JUMPTARGET(BP_SYM (__novmx__sigsetjmp))
+       b JUMPTARGET (__novmx__sigsetjmp_ent)
 END (BP_SYM (__novmx_setjmp))
 libc_hidden_def (__novmx_setjmp)
 # endif /* defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4) */
@@ -50,13 +52,15 @@ ENTRY (BP_SYM (__GI__setjmp))
 #if defined SHARED && !defined IS_IN_rtld
        std r2,40(r1)   /* Save the callers TOC in the save area.  */
 #endif
+       CALL_MCOUNT 1
        li r4,0                 /* Set second argument to 0.  */
-       b JUMPTARGET(BP_SYM (__vmx__sigsetjmp))
+       b JUMPTARGET (__vmx__sigsetjmp_ent)
 END (BP_SYM (__GI__setjmp))
 
 ENTRY (BP_SYM (__vmx_setjmp))
+       CALL_MCOUNT 1
        li r4,0                 /* Set second argument to 0.  */
-       b JUMPTARGET(BP_SYM (__vmx__sigsetjmp))
+       b JUMPTARGET (__vmx__sigsetjmp_ent)
 END (BP_SYM (__vmx_setjmp))
 libc_hidden_def (__vmx_setjmp)
 #endif /* !NOT_IN_libc */
index 73b9a4d34ecda7d34503ca218eac02471fc002ef..543e83faa3185f671697ed3cc7df936cb2bf6f1d 100644 (file)
@@ -25,8 +25,9 @@
 
 
 ENTRY (__novmxsetjmp)
+       CALL_MCOUNT 1
        li r4,1                 /* Set second argument to 1.  */
-       b JUMPTARGET (__novmx__sigsetjmp)
+       b JUMPTARGET (__novmx__sigsetjmp_ent)
 END (__novmxsetjmp)
 strong_alias (__novmxsetjmp, __novmx__setjmp)
 symbol_version (__novmxsetjmp, setjmp, GLIBC_2.3)
@@ -35,8 +36,9 @@ symbol_version (__novmxsetjmp, setjmp, GLIBC_2.3)
 
 
 ENTRY (__vmxsetjmp)
+       CALL_MCOUNT 1
        li r4,1                 /* Set second argument to 1.  */
-       b JUMPTARGET (__vmx__sigsetjmp)
+       b JUMPTARGET (__vmx__sigsetjmp_ent)
 END (__vmxsetjmp)
 strong_alias (__vmxsetjmp, __vmx__setjmp)
 strong_alias (__vmx__sigsetjmp, __setjmp)
index 127f302666212ae16112729160ca3a1db3f41b0c..a1bfaa70c2b6833a585f81208b0e08d6edec1151 100644 (file)
@@ -27,6 +27,7 @@
        .section        ".text"
 
 ENTRY (__ceil)
+       CALL_MCOUNT 0
        mffs    fp11            /* Save current FPU rounding mode.  */
        lfd     fp13,.LC0@toc(2)
        fabs    fp0,fp1
index 34f61423cc89cc77a97968a3aba605a54eea2500..42eb274389cbe5c6ba442b9ef034beb60f9f5d94 100644 (file)
@@ -27,6 +27,7 @@
        .section        ".text"
 
 ENTRY (__ceilf)
+       CALL_MCOUNT 0
        mffs    fp11            /* Save current FPU rounding mode.  */
        lfd     fp13,.LC0@toc(2)
        fabs    fp0,fp1
index 40fd83d3d1606206c47de836f5474a2f693460db..a43ed12cf0e978b7e056a92ab455d504cc4d1182 100644 (file)
@@ -23,6 +23,7 @@
 #include <sysdep.h>
 
 ENTRY(__copysign)
+       CALL_MCOUNT 0
 /* double [f1] copysign (double [f1] x, double [f2] y);
    copysign(x,y) returns a value with the magnitude of x and
    with the sign bit of y.  */
index 57fd63cd66f9a649fcc84c18dbed44303f0e2d61..80cbdc570930a0f765d86e4fc21b7010c18899fb 100644 (file)
@@ -25,6 +25,7 @@
        .section        ".text"
 
 ENTRY (__floor)
+       CALL_MCOUNT 0
        mffs    fp11            /* Save current FPU rounding mode.  */
        lfd     fp13,.LC0@toc(2)
        fabs    fp0,fp1
index cde92b9174f7e60a1a349b50317da923cf58f528..20cbb15ebd8c456275ac6a1d53c8c31670687814 100644 (file)
@@ -25,6 +25,7 @@
        .section        ".text"
 
 ENTRY (__floorf)
+       CALL_MCOUNT 0
        mffs    fp11            /* Save current FPU rounding mode.  */
        lfd     fp13,.LC0@toc(2)
        fabs    fp0,fp1
index bc976a7edbb559fbdc564e22b624cc18b247d67a..610b561f25f1e58dd8677c005ca71337cf86189d 100644 (file)
@@ -21,6 +21,7 @@
 
 /* long long int[r3] __llrint (double x[fp1])  */
 ENTRY (__llrint)       
+       CALL_MCOUNT 0
        fctid   fp13,fp1
        stfd    fp13,-16(r1)
        nop     /* Insure the following load is in a different dispatch group */
index aef84de8317f0863146e272f647ccf05d0d1f875..b7b2a8fc6354ab4f713e8195413612b67f4afc1e 100644 (file)
@@ -21,6 +21,7 @@
 
 /* long long int[r3] __llrintf (float x[fp1])  */
 ENTRY (__llrintf)      
+       CALL_MCOUNT 0
        fctid   fp13,fp1
        stfd    fp13,-16(r1)
        nop     /* Insure the following load is in a different dispatch group */
index 320ef0f6d8edd804bb69d42a3556b7b88d113dcd..a3dcd4c33d1883571701fc0ec731b86fb77dfbe8 100644 (file)
@@ -37,6 +37,7 @@
    to the integer value.  */
 
 ENTRY (__llround)
+       CALL_MCOUNT 0
        lfd     fp12,.LC0@toc(2)
        lfd     fp10,.LC1@toc(2)
        fcmpu   cr6,fp1,fp12    /* if (x > 0.0)  */
index ff923056b1bc057f80064c686ec280989f44e5bb..b5ca43bf2078ed1f706a598c84141843d1adffaf 100644 (file)
@@ -37,6 +37,7 @@
    to the integer value.  */
 
 ENTRY (__llroundf)
+       CALL_MCOUNT 0
        lfd     fp12,.LC0@toc(2)
        lfd     fp10,.LC1@toc(2)
        fcmpu   cr6,fp1,fp12    /* if (x < 0.0)  */
index f7db7ff80adfd5ae111baffdc6d6614f83066fbc..79e807269dfa6b81d4b461375c73f08291811bef 100644 (file)
@@ -28,6 +28,7 @@
        .section        ".text"
 
 ENTRY (__rint)
+       CALL_MCOUNT 0
        lfd     fp13,.LC0@toc(2)
        fabs    fp0,fp1
        fsub    fp12,fp13,fp13  /* generate 0.0  */
index de6d654796103f04177975dfa2f0ae54cf18b25f..eb34dd5e77c5e5191adf71a03814e5c6d3ce37c9 100644 (file)
@@ -25,6 +25,7 @@
        .section        ".text"
 
 ENTRY (__rintf)
+       CALL_MCOUNT 0
        lfd     fp13,.LC0@toc(2)
        fabs    fp0,fp1
        fsubs   fp12,fp13,fp13  /* generate 0.0  */
index 1c2e5299e565329128e3b49be449a367bb4a78f1..c0b6d46feaf252a38aa8c18e52ca889f46cad687 100644 (file)
@@ -39,6 +39,7 @@
    to the integer value.  */
 
 ENTRY (__round)
+       CALL_MCOUNT 0
        mffs    fp11            /* Save current FPU rounding mode.  */
        lfd     fp13,.LC0@toc(2)
        fabs    fp0,fp1
index fd8eb0aea38b3761dfaa98fa5aa085ad10afa9c4..23ee4c052b75ae067f54fc3562ab0cb1f7a46726 100644 (file)
@@ -39,6 +39,7 @@
    to the integer value.  */
 
 ENTRY (__roundf )
+       CALL_MCOUNT 0
        mffs    fp11            /* Save current FPU rounding mode.  */
        lfd     fp13,.LC0@toc(2)
        fabs    fp0,fp1
index dc345ab424ffd59463094ecfb38c0a368fb9fbd7..3ddd2985259fad67e6b915768f4a82cbb5528c97 100644 (file)
@@ -34,6 +34,7 @@
    subtracting +-2**52.  */
 
 ENTRY (__trunc)
+       CALL_MCOUNT 0
        mffs    fp11            /* Save current FPU rounding mode.  */
        lfd     fp13,.LC0@toc(2)
        fabs    fp0,fp1
index 727647f6de33a40c9afeb17624b10d9f49b2c721..b38b722a6f4c11175ed5887e531ffdbeb0e88776 100644 (file)
@@ -34,6 +34,7 @@
    subtracting +-2**23.  */
 
 ENTRY (__truncf)
+       CALL_MCOUNT 0
        mffs    fp11            /* Save current FPU rounding mode.  */
        lfd     fp13,.LC0@toc(2)
        fabs    fp0,fp1
index 251e1fed8094b0014a238f7d3656cf4dcdd08479..9df5bb42b6b4f9cdd6f02e4756eb59db0bc6d4f9 100644 (file)
@@ -37,6 +37,8 @@
    Each case has a optimized unrolled loop.   */
 
 EALIGN (BP_SYM (memcpy), 5, 0)
+       CALL_MCOUNT 3
+
     cmpldi cr1,5,31
     neg   0,3
     std   3,-16(1)
index f3a299d5c8055dfde05e6f9ff6b9e8de4a0dae88..1abc59bb1728c5f4b0409b48bf390cebba97421c 100644 (file)
@@ -41,6 +41,7 @@
    to 0, to take advantage of the dcbz instruction.  */
 
 EALIGN (BP_SYM (memset), 5, 0)
+       CALL_MCOUNT 3
 
 #define rTMP   r0
 #define rRTN   r3      /* Initial value of 1st argument.  */
@@ -274,6 +275,7 @@ libc_hidden_builtin_def (memset)
 /* Copied from bzero.S to prevent the linker from inserting a stub
    between bzero and memset.  */
 ENTRY (BP_SYM (__bzero))
+       CALL_MCOUNT 3
 #if __BOUNDED_POINTERS__
        mr      r6,r4
        li      r5,0
index ab57170875c7a9927e7c593d30c8fd0e38e815a8..f82d5a21f5a189cb41edfc6967761d27160f4743 100644 (file)
 
        .machine        "altivec"
 ENTRY (BP_SYM (__sigsetjmp))
+       CALL_MCOUNT 2
+       .globl JUMPTARGET(GLUE(__sigsetjmp,_ent))
+       .hidden JUMPTARGET(GLUE(__sigsetjmp,_ent))
+JUMPTARGET(GLUE(__sigsetjmp,_ent)):
        CHECK_BOUNDS_BOTH_WIDE_LIT (r3, r8, r9, JB_SIZE)
        std  r1,(JB_GPR1*8)(3)
        mflr r0
index deac0ea22981fc940dd27c7a3a4fd9fcc990b87f..cc7a6ab66a31ac6cf72a4ce938f9dee7dd77a755 100644 (file)
@@ -26,6 +26,7 @@
 /* char * [r3] stpcpy (char *dest [r3], const char *src [r4])  */
 
 EALIGN (BP_SYM (__stpcpy), 4, 0)
+       CALL_MCOUNT 2
 
 #define rTMP   r0
 #define rRTN   r3
index e3222f354d41af2850170ae7537fa91e03da4c3d..93ea61e49c4b9494bf1797ca004ed6a492242bb3 100644 (file)
@@ -26,6 +26,7 @@
 /* char * [r3] strchr (const char *s [r3] , int c [r4] )  */
 
 ENTRY (BP_SYM (strchr))
+       CALL_MCOUNT 2
 
 #define rTMP1  r0
 #define rRTN   r3      /* outgoing result */
index 7e2dae07f7c78f1e8649dfd09712a0e0c555c6fa..4d7eb21bf721c996751158436274b5e4564d3bec 100644 (file)
@@ -26,6 +26,7 @@
 /* int [r3] strcmp (const char *s1 [r3], const char *s2 [r4])  */
 
 EALIGN (BP_SYM(strcmp), 4, 0)
+       CALL_MCOUNT 2
 
 #define rTMP   r0
 #define rRTN   r3
index 4d12b82e5e3030be42f75838da32b80bda0dca78..e9e9fc78cd977b6113c4c70c8e994daa05c4a8e3 100644 (file)
@@ -26,6 +26,7 @@
 /* char * [r3] strcpy (char *dest [r3], const char *src [r4])  */
 
 EALIGN (BP_SYM (strcpy), 4, 0)
+       CALL_MCOUNT 2
 
 #define rTMP   r0
 #define rRTN   r3      /* incoming DEST arg preserved as result */
index 760be5884a5016889913aeaafa309f0d30477acb..4c1385aead6864e5446d238bc02539948923457d 100644 (file)
@@ -79,6 +79,7 @@
 /* int [r3] strlen (char *s [r3])  */
 
 ENTRY (BP_SYM (strlen))
+       CALL_MCOUNT 1
 
 #define rTMP1  r0
 #define rRTN   r3      /* incoming STR arg, outgoing result */
index bdcfab99e35035e3f650e3550396bb8c248db596..04bdc2f6069fc23ccaaa67f08e75517d5efbef3f 100644 (file)
@@ -26,6 +26,7 @@
 /* int [r3] strncmp (const char *s1 [r3], const char *s2 [r4], size_t size [r5])  */
 
 EALIGN (BP_SYM(strncmp), 4, 0)
+       CALL_MCOUNT 3
 
 #define rTMP   r0
 #define rRTN   r3
index 4420a6dfacbb21222d1807be5c87a6f749247687..fead0b578a2aea71fa41a51b929218c68e1b37e6 100644 (file)
 
 #ifdef __ASSEMBLER__
 
+/* Support macros for CALL_MCOUNT.  */
+       .macro SAVE_ARG NARG
+       .if \NARG
+       SAVE_ARG \NARG-1
+       std     2+\NARG,-72+8*(\NARG)(1)
+       .endif
+       .endm
+
+       .macro REST_ARG NARG
+       .if \NARG
+       REST_ARG \NARG-1
+       ld      2+\NARG,40+8*(\NARG)(1)
+       .endif
+       .endm
+
 /* If compiled for profiling, call `_mcount' at the start of each function.
    see ppc-mcount.S for more details.  */
+       .macro CALL_MCOUNT NARG
 #ifdef PROF
-/* The mcount code relies on a the return address being on the stack
-   to locate our caller and so it can restore it; so store one just
-   for its benefit.  */
-#ifdef SYSV_ELF_PROFILING
-#define CALL_MCOUNT    \
-  .pushsection;                        \
-  .section ".data";            \
-  .align ALIGNARG(2);          \
-__mcount:                      \
-  .long  0;                    \
-  .previous;                   \
-  .section ".toc","aw";                \
-.LC__mcount:;                  \
-  .tc __mcount[TC],__mcount;   \
-  .previous;                   \
-  mflr  r0;                    \
-  std   r0,16(r1);             \
-  ld    r0,.LC__mcount@toc(r2);        \
-  bl    JUMPTARGET(_mcount);
-#else /* SYSV_ELF_PROFILING */
-#define CALL_MCOUNT    \
-  mflr  r0;                    \
-  std   r0,16(r1);             \
-  bl    JUMPTARGET(_mcount);
-#endif /* SYSV_ELF_PROFILING */
-#else  /* PROF */
-#define CALL_MCOUNT            /* Do nothing.  */
-#endif /* PROF */
+       mflr    r0
+       SAVE_ARG \NARG
+       std     r0,16(r1)
+       stdu    r1,-112(r1)
+       bl      JUMPTARGET (_mcount)
+       ld      r0,128(r1)
+       REST_ARG \NARG
+       addi    r1,r1,112
+       mtlr    r0
+#endif
+       .endm
 
 #ifdef USE_PPC64_OVERLAPPING_OPD
 # define OPD_ENT(name) .quad BODY_LABEL (name), .TOC.@tocbase
@@ -106,24 +105,11 @@ BODY_LABEL(name):
 
 /* EALIGN is like ENTRY, but does alignment to 'words'*4 bytes
    past a 2^alignt boundary.  */
-#ifdef PROF
-#define EALIGN(name, alignt, words) \
-       ENTRY_2(name)                           \
-       .align ALIGNARG(alignt);                \
-       EALIGN_W_##words;                       \
-BODY_LABEL(name):                              \
-       CALL_MCOUNT                             \
-       b 0f;                                   \
-       .align ALIGNARG(alignt);                \
-       EALIGN_W_##words;                       \
-0:
-#else /* PROF */
 #define EALIGN(name, alignt, words) \
        ENTRY_2(name)                           \
        .align ALIGNARG(alignt);                \
        EALIGN_W_##words;                       \
 BODY_LABEL(name):
-#endif
 
 /* Local labels stripped out by the linker.  */
 #undef L
index 4417134dacae2f3f7d8a7576fab2f6b0e5efc229..3c2c1a1868e6d666d49f645238e181732ab78428 100644 (file)
@@ -1,4 +1,4 @@
-# @(#)asia     7.75
+# @(#)asia     7.77
 
 # This data is by no means authoritative; if you think you know better,
 # go ahead and edit the file (and please send any changes to
@@ -761,6 +761,26 @@ Zone       Asia/Jerusalem  2:20:56 -       LMT     1880
 # direction is expected until the latter part of 2004 which is a long
 # time off in terms of Israeli politics.
 
+# (2004-09-20):
+# The latest rumour, however, is that in 2005, when the clock changes to
+# Daylight Saving Time (date as yet unknown), the move will be a two-hour leap
+# forward (from UTC+0200 to UTC+0400) and then, in the fall, the clock will
+# move back only an hour to UTC+0300 thus effectively moving Israel's timezone
+# from UTC+0200 to UTC+0300.  However, no actual draft has been put before the
+# Knesset (Israel's Parliament) though the intention is to do so this
+# month [2004-09].
+
+# (2004-09-26):
+# Even though the draft law for the above did pass the Ministerial Committee
+# for Legislative Matters three months ago, it was voted down in today's
+# Cabinet meeting.  The current suggestion is to keep the current timezone at
+# UTC+0200 but have an extended period of Daylight Saving Time (UTC+0300) from
+# the beginning of Passover holiday in the spring to after the Tabernacle
+# holiday in the fall (i.e. the dates of which are governed by the Hebrew
+# calendar but this means at least 184 days of DST).  However, this is only a
+# suggestion that was raised in today's cabinet meeting and has not yet been
+# drafted.
+
 
 
 ###############################################################################
index c8f45486837f754d14f5974033afbca4d3a4a82a..57663052f09b0f581d103e0859a5902ceddb01dd 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 #ifndef NOID
-static char    privatehid[] = "@(#)private.h   7.53";
+static char    privatehid[] = "@(#)private.h   7.54";
 #endif /* !defined NOID */
 #endif /* !defined lint */
 
@@ -190,10 +190,21 @@ extern int        unlink P((const char * filename));
 ** But some newer errno.h implementations define it as a macro.
 ** Fix the former without affecting the latter.
 */
+
 #ifndef errno
 extern int errno;
 #endif /* !defined errno */
 
+/*
+** Some time.h implementations don't declare asctime_r.
+** Others might define it as a macro.
+** Fix the former without affecting the latter.
+*/
+
+#ifndef asctime_r
+extern char *  asctime_r();
+#endif
+
 /*
 ** Private function declarations.
 */
index 13bd5270e88f8e944abf6439789f52bdacfad164..912491049bec2786098eb7bf13e5e6ca3243861f 100644 (file)
@@ -1,4 +1,4 @@
-# @(#)southamerica     7.52
+# @(#)southamerica     7.54
 
 # This data is by no means authoritative; if you think you know better,
 # go ahead and edit the file (and please send any changes to
@@ -186,6 +186,20 @@ Rule       Arg     2000    only    -       Mar     Sun>=1  0:00    0       -
 # contains a contradiction.  I would give more credence to the Saturday/Sunday
 # date than the "three days earlier" phrase, and conclude that Tierra del
 # Fuego set its clocks back at 2004-05-30 00:00.
+#
+# From Steffen Thorsen (2004-10-05):
+# The previous law 7210 which changed the province of Mendoza's time zone
+# back in May have been modified slightly in a new law 7277, which set the
+# new end date to 2004-09-26 (original date was 2004-10-17).
+# http://www.gobernac.mendoza.gov.ar/boletin/pdf/20040924-27244-normas.pdf
+#
+# From Mariano Absatz (2004-10-05):
+# San Juan changed from UTC-03:00 to UTC-04:00 at midnight between
+# Sunday, May 30th and Monday, May 31st.  It changed back to UTC-03:00
+# at midnight between Saturday, July 24th and Sunday, July 25th....
+# http://www.sanjuan.gov.ar/prensa/archivo/000329.html
+# http://www.sanjuan.gov.ar/prensa/archivo/000426.html
+# http://www.sanjuan.gov.ar/prensa/archivo/000441.html
 
 # Unless otherwise specified, data are from Shanks through 1992, from
 # the IATA otherwise.  As noted below, Shanks says that
@@ -261,8 +275,8 @@ Zone America/Argentina/San_Juan -4:34:04 - LMT      1894 Oct 31
                        -4:00   -       WART    1991 May  7
                        -3:00   Arg     AR%sT   1999 Oct  3
                        -4:00   Arg     AR%sT   2000 Mar  3
-                       -3:00   -       ART     2004 Jun  1
-                       -4:00   -       WART    2004 Oct 17
+                       -3:00   -       ART     2004 May 31
+                       -4:00   -       WART    2004 Jul 25
                        -3:00   -       ART
 #
 # Jujuy (JY)
@@ -306,7 +320,7 @@ Zone America/Argentina/Mendoza -4:35:16 - LMT       1894 Oct 31
                        -3:00   Arg     AR%sT   1999 Oct  3
                        -4:00   Arg     AR%sT   2000 Mar  3
                        -3:00   -       ART     2004 May 23
-                       -4:00   -       WART    2004 Oct 17
+                       -4:00   -       WART    2004 Sep 26
                        -3:00   -       ART
 #
 # Chubut (CH)
@@ -420,6 +434,11 @@ Zone       America/La_Paz  -4:32:36 -      LMT     1890
 # the Government decided to postpone DST, instead of changing the Constitution
 # (maybe, for the next elections, it will be possible to change the clock)...
 
+# From Rodrigo Severo (2004-10-04):
+# It's just the biannual change made necessary by the much hyped, supposedly
+# modern Brazilian eletronic voting machines which, apparently, can't deal
+# with a time change between the first and the second rounds of the elections.
+
 # From Paul Eggert (2002-10-10):
 # The official decrees referenced below are mostly taken from
 # <a href="http://pcdsh01.on.br/DecHV.html">
@@ -556,11 +575,15 @@ Rule      Brazil  2001    max     -       Feb     Sun>=15  0:00   0       -
 Rule   Brazil  2002    only    -       Nov      3       0:00   1:00    S
 # Decree 4,844 (2003-09-24; corrected 2003-09-26) repeals DST in BA, MT, TO.
 # <a href="http://www.presidencia.gov.br/CCIVIL/decreto/2003/D4844.htm"></a>
-Rule   Brazil  2003    max     -       Oct     Sun>=15  0:00   1:00    S
+Rule   Brazil  2003    only    -       Oct     19       0:00   1:00    S
+# Decree 5,223 (2004-10-01) reestablishes DST in MT.
+# <a href="http://www.planalto.gov.br/ccivil_03/_Ato2004-2006/2004/Decreto/D5223.htm"></a>
+Rule   Brazil  2004    only    -       Nov      2       0:00   1:00    S
 # The latest ruleset listed above says that the following states observe DST:
-# DF, ES, GO, MG, MS, PR, RJ, RS, SC, SP.
+# DF, ES, GO, MG, MS, MT, PR, RJ, RS, SC, SP.
 #
-# For dates after mid-2004, the above rules with TO="max" are guesses
+Rule   Brazil  2005    max     -       Oct     Sun>=15  0:00   1:00    S
+# For dates after mid-2005, the above rules with TO="max" are guesses
 # and are quite possibly wrong, but are more likely than no DST at all.
 
 
@@ -648,7 +671,8 @@ Zone America/Campo_Grande -3:38:28 -        LMT     1914
 # Mato Grosso (MT)
 Zone America/Cuiaba    -3:44:20 -      LMT     1914
                        -4:00   Brazil  AM%sT   2003 Sep 24
-                       -4:00   -       AMT
+                       -4:00   -       AMT     2004 Oct  4
+                       -4:00   Brazil  AM%sT
 #
 # west Para (PA), Rondonia (RO)
 # West Para includes Altamira, Oribidos, Prainha, Oriximina, and Santarem.
@@ -1029,6 +1053,11 @@ Rule     Uruguay 1990    1992    -       Mar     Sun>=1   0:00   0       -
 Rule   Uruguay 1990    1991    -       Oct     Sun>=21  0:00   1:00    S
 Rule   Uruguay 1992    only    -       Oct     18       0:00   1:00    S
 Rule   Uruguay 1993    only    -       Feb     28       0:00   0       -
+# From Eduardo Cota (2004-09-20):
+# The uruguayan government has decreed a change in the local time....
+# http://www.presidencia.gub.uy/decretos/2004091502.htm
+Rule   Uruguay 2004    only    -       Sep     Sun>=15  0:00   1:00    S
+Rule   Uruguay 2005    only    -       Mar     Sun>=8   0:00   0       -
 # Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
 Zone America/Montevideo        -3:44:44 -      LMT     1898 Jun 28
                        -3:44:44 -      MMT     1920 May  1     # Montevideo MT
index 9faeaf21b2800da7de4576ce6c577eb81b6a646e..20bb916822b174394c207a59c0b7b1fc1e2eccaa 100644 (file)
@@ -1,4 +1,4 @@
-static char    elsieid[] = "@(#)zdump.c        7.31";
+static char    elsieid[] = "@(#)zdump.c        7.40";
 
 /*
 ** This code has been made independent of the rest of the time
@@ -64,16 +64,15 @@ static char elsieid[] = "@(#)zdump.c        7.31";
 #define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0)
 #endif /* !defined isleap */
 
-#if HAVE_GETTEXT - 0
+#if HAVE_GETTEXT
 #include "locale.h"    /* for setlocale */
 #include "libintl.h"
-#endif /* HAVE_GETTEXT - 0 */
+#endif /* HAVE_GETTEXT */
 
 #ifndef GNUC_or_lint
 #ifdef lint
 #define GNUC_or_lint
-#endif /* defined lint */
-#ifndef lint
+#else /* !defined lint */
 #ifdef __GNUC__
 #define GNUC_or_lint
 #endif /* defined __GNUC__ */
@@ -83,8 +82,7 @@ static char   elsieid[] = "@(#)zdump.c        7.31";
 #ifndef INITIALIZE
 #ifdef GNUC_or_lint
 #define INITIALIZE(x)  ((x) = 0)
-#endif /* defined GNUC_or_lint */
-#ifndef GNUC_or_lint
+#else /* !defined GNUC_or_lint */
 #define INITIALIZE(x)
 #endif /* !defined GNUC_or_lint */
 #endif /* !defined INITIALIZE */
@@ -96,11 +94,11 @@ static char elsieid[] = "@(#)zdump.c        7.31";
 */
 
 #ifndef _
-#if HAVE_GETTEXT - 0
+#if HAVE_GETTEXT
 #define _(msgid) gettext(msgid)
-#else /* !(HAVE_GETTEXT - 0) */
+#else /* !HAVE_GETTEXT */
 #define _(msgid) msgid
-#endif /* !(HAVE_GETTEXT - 0) */
+#endif /* !HAVE_GETTEXT */
 #endif /* !defined _ */
 
 #ifndef TZ_DOMAIN
@@ -110,8 +108,7 @@ static char elsieid[] = "@(#)zdump.c        7.31";
 #ifndef P
 #ifdef __STDC__
 #define P(x)   x
-#endif /* defined __STDC__ */
-#ifndef __STDC__
+#else /* !defined __STDC__ */
 #define P(x)   ()
 #endif /* !defined __STDC__ */
 #endif /* !defined P */
@@ -129,6 +126,7 @@ static time_t       hunt P((char * name, time_t lot, time_t hit));
 static size_t  longest;
 static char *  progname;
 static void    show P((char * zone, time_t t, int v));
+static void    dumptime P((const struct tm * tmp));
 
 int
 main(argc, argv)
@@ -150,14 +148,13 @@ char *    argv[];
        struct tm               newtm;
 
        INITIALIZE(cuttime);
-#if HAVE_GETTEXT - 0
-       (void) setlocale(LC_CTYPE, "");
+#if HAVE_GETTEXT
        (void) setlocale(LC_MESSAGES, "");
 #ifdef TZ_DOMAINDIR
        (void) bindtextdomain(TZ_DOMAIN, TZ_DOMAINDIR);
-#endif /* defined(TEXTDOMAINDIR) */
+#endif /* defined TEXTDOMAINDIR */
        (void) textdomain(TZ_DOMAIN);
-#endif /* HAVE_GETTEXT - 0 */
+#endif /* HAVE_GETTEXT */
        progname = argv[0];
        for (i = 1; i < argc; ++i)
                if (strcmp(argv[i], "--version") == 0) {
@@ -324,7 +321,7 @@ struct tm * oldp;
                return -delta(oldp, newp);
        result = 0;
        for (tmy = oldp->tm_year; tmy < newp->tm_year; ++tmy)
-               result += DAYSPERNYEAR + isleap(tmy + TM_YEAR_BASE);
+               result += DAYSPERNYEAR + isleap(tmy + (long) TM_YEAR_BASE);
        result += newp->tm_yday - oldp->tm_yday;
        result *= HOURSPERDAY;
        result += newp->tm_hour - oldp->tm_hour;
@@ -344,10 +341,12 @@ int       v;
        struct tm *     tmp;
 
        (void) printf("%-*s  ", (int) longest, zone);
-       if (v)
-               (void) printf("%.24s UTC = ", asctime(gmtime(&t)));
+       if (v) {
+               dumptime(gmtime(&t));
+               (void) printf(" UTC = ");
+       }
        tmp = localtime(&t);
-       (void) printf("%.24s", asctime(tmp));
+       dumptime(tmp);
        if (*abbr(tmp) != '\0')
                (void) printf(" %s", abbr(tmp));
        if (v) {
@@ -371,3 +370,37 @@ struct tm *        tmp;
        result = tzname[tmp->tm_isdst];
        return (result == NULL) ? &nada : result;
 }
+
+static void
+dumptime(timeptr)
+register const struct tm *     timeptr;
+{
+       static const char       wday_name[][3] = {
+               "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
+       };
+       static const char       mon_name[][3] = {
+               "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+               "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+       };
+       register const char *   wn;
+       register const char *   mn;
+
+       /*
+       ** The packaged versions of localtime and gmtime never put out-of-range
+       ** values in tm_wday or tm_mon, but since this code might be compiled
+       ** with other (perhaps experimental) versions, paranoia is in order.
+       */
+       if (timeptr->tm_wday < 0 || timeptr->tm_wday >=
+               (int) (sizeof wday_name / sizeof wday_name[0]))
+                       wn = "???";
+       else            wn = wday_name[timeptr->tm_wday];
+       if (timeptr->tm_mon < 0 || timeptr->tm_mon >=
+               (int) (sizeof mon_name / sizeof mon_name[0]))
+                       mn = "???";
+       else            mn = mon_name[timeptr->tm_mon];
+       (void) printf("%.3s %.3s%3d %.2d:%.2d:%.2d %ld",
+               wn, mn,
+               timeptr->tm_mday, timeptr->tm_hour,
+               timeptr->tm_min, timeptr->tm_sec,
+               timeptr->tm_year + (long) TM_YEAR_BASE);
+}