]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Sun, 9 Mar 1997 06:16:49 +0000 (06:16 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sun, 9 Mar 1997 06:16:49 +0000 (06:16 +0000)
1997-03-09 06:59  Ulrich Drepper  <drepper@cygnus.com>

* Makeconfig: Add ASFLAGS-% flags for SPARC assembler which need
-fPIC.
* Makerules (compile.S): Use ASFLAGS-%.
(COMPILE.S): Likewise.
* config.make.in (ASFLAGS-.so): Define from ASFLAGS_SO.
* configure.in: Substitute ASFLAGS_SO.
* sysdeps/sparc/configure.in: New file.

* posix/unitstd.h: Add prototype for __euidaccess.
* sysdeps/posix/euidaccess.c: Define as __euidaccess and make
euidaccess weak alias.
* sysdeps/stubs/euidaccess.c: Likewise.
* inet/rcmd.c: Use __ protected versions of non-standard functions.

* locale/setlocale.c (setlocale): Don't set usage_count to
MAX_USAGE_COUNT if it already has this value.

* locale/programs/localedef.c: Don't use LOCALE_PATH to find
binary locale files.  Use LOCALEDIR only.
* locale/programs/locfile.c: When named file not found and not
absolute use path in I18NPATH.

* stdlib/Makefile (headers): Add inttypes.h.

* sysdpes/generic/socketbits.h: Add PF_FILE as synonym for PF_LOCAL
and AF_FILE as synonym for AF_LOCAL.
* sysdpes/unix/sysv/linux/socketbits.h: Likewise.

* time/Makefile: Rewrite rules for test to handle parallel builds.

1997-03-09 05:26  Ulrich Drepper  <drepper@cygnus.com>

* manual/startup.texi (EXIT_FAILURE): Fix typo.  Patch by
robbe@orcus.priv.at.

1997-03-09 05:10  Edward Seidl  <seidl@janed.com>

* sysdeps/i386/elf/start.S (nofini): *Really* align stack to
8-byte boundary.

1997-03-09 01:48  Ulrich Drepper  <drepper@cygnus.com>

* elf/link.h: Define __need_NULL to get definition.  Include
<features.h>.
Patch by Andreas Jaeger  <aj@arthur.pfalz.de>.

1997-03-08 21:48  Thorsten Kukuk  <kukuk@tk.uni-paderborn.de>

Rewrite NIS code to allow empty keys.
* nis/nss_nis/nis-ethers.c: Rewritten.
* nis/nss_nis/nis-proto.c: Rewritten.
* nis/nss_nis/nis-publickey.c: Rewritten.
* nis/nss_nis/nis-rpc.c: Rewritten.
* nis/nss_nis/nis-service.c: Rewritten.

1997-03-08 16:02  Andreas Jaeger  <aj@arthur.pfalz.de>

* time/scheck.c (scheck): Add extra const to second argument.

* time/private.h: Correct prototypes to match definition.

1997-03-08 18:55  Ulrich Drepper  <drepper@cygnus.com>

* sysdeps/alpha/__math.h: Remove cabs inline definition.
Reported by Philip Blundell <pjb27@cam.ac.uk>.

Reported by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
Bug report by Andreas Jaeger <jaeger@informatik.uni-kl.de>.

33 files changed:
ChangeLog
Makeconfig
Makerules
config.make.in
configure
configure.in
elf/link.h
inet/rcmd.c
locale/programs/localedef.c
locale/programs/locfile.c
locale/setlocale.c
manual/startup.texi
nis/nss_nis/nis-ethers.c
nis/nss_nis/nis-proto.c
nis/nss_nis/nis-publickey.c
nis/nss_nis/nis-rpc.c
nis/nss_nis/nis-service.c
posix/unistd.h
stdlib/Makefile
sysdeps/alpha/__math.h
sysdeps/generic/socketbits.h
sysdeps/i386/elf/start.S
sysdeps/libm-ieee754/s_fpclassify.c
sysdeps/posix/euidaccess.c
sysdeps/sparc/configure [new file with mode: 0755]
sysdeps/sparc/configure.in [new file with mode: 0644]
sysdeps/stub/euidaccess.c
sysdeps/unix/sysv/linux/socketbits.h
sysdeps/wordsize-32/inttypes.h [new file with mode: 0644]
sysdeps/wordsize-64/inttypes.h [new file with mode: 0644]
time/Makefile
time/private.h
time/scheck.c

index 584ec076fe6d3d959228ca75497ff9c8942915fd..e503b3ff5ba84931bb3b15e6d22f784604850f17 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,71 @@
+1997-03-09 06:59  Ulrich Drepper  <drepper@cygnus.com>
+
+       * Makeconfig: Add ASFLAGS-% flags for SPARC assembler which need
+       -fPIC.
+       * Makerules (compile.S): Use ASFLAGS-%.
+       (COMPILE.S): Likewise.
+       * config.make.in (ASFLAGS-.so): Define from ASFLAGS_SO.
+       * configure.in: Substitute ASFLAGS_SO.
+       * sysdeps/sparc/configure.in: New file.
+
+       * posix/unitstd.h: Add prototype for __euidaccess.
+       * sysdeps/posix/euidaccess.c: Define as __euidaccess and make
+       euidaccess weak alias.
+       * sysdeps/stubs/euidaccess.c: Likewise.
+       * inet/rcmd.c: Use __ protected versions of non-standard functions.
+
+       * locale/setlocale.c (setlocale): Don't set usage_count to
+       MAX_USAGE_COUNT if it already has this value.
+
+       * locale/programs/localedef.c: Don't use LOCALE_PATH to find
+       binary locale files.  Use LOCALEDIR only.
+       * locale/programs/locfile.c: When named file not found and not
+       absolute use path in I18NPATH.
+
+       * stdlib/Makefile (headers): Add inttypes.h.
+
+       * sysdpes/generic/socketbits.h: Add PF_FILE as synonym for PF_LOCAL
+       and AF_FILE as synonym for AF_LOCAL.
+       * sysdpes/unix/sysv/linux/socketbits.h: Likewise.
+
+       * time/Makefile: Rewrite rules for test to handle parallel builds.
+
+1997-03-09 05:26  Ulrich Drepper  <drepper@cygnus.com>
+
+       * manual/startup.texi (EXIT_FAILURE): Fix typo.  Patch by
+       robbe@orcus.priv.at.
+
+1997-03-09 05:10  Edward Seidl  <seidl@janed.com>
+
+       * sysdeps/i386/elf/start.S (nofini): *Really* align stack to
+       8-byte boundary.
+
+1997-03-09 01:48  Ulrich Drepper  <drepper@cygnus.com>
+
+       * elf/link.h: Define __need_NULL to get definition.  Include
+       <features.h>.
+       Patch by Andreas Jaeger  <aj@arthur.pfalz.de>.
+
+1997-03-08 21:48  Thorsten Kukuk  <kukuk@tk.uni-paderborn.de>
+
+       Rewrite NIS code to allow empty keys.
+       * nis/nss_nis/nis-ethers.c: Rewritten.
+       * nis/nss_nis/nis-proto.c: Rewritten.
+       * nis/nss_nis/nis-publickey.c: Rewritten.
+       * nis/nss_nis/nis-rpc.c: Rewritten.
+       * nis/nss_nis/nis-service.c: Rewritten.
+
+1997-03-08 16:02  Andreas Jaeger  <aj@arthur.pfalz.de>
+
+       * time/scheck.c (scheck): Add extra const to second argument.
+
+       * time/private.h: Correct prototypes to match definition.
+
+1997-03-08 18:55  Ulrich Drepper  <drepper@cygnus.com>
+
+       * sysdeps/alpha/__math.h: Remove cabs inline definition.
+       Reported by Philip Blundell <pjb27@cam.ac.uk>.
+
 1997-03-08 05:30  Ulrich Drepper  <drepper@cygnus.com>
 
        * argp/Makefile (routines): Add argp-eexst.
 
        * sysdeps/libm-ieee754/s_fpclassify.c (__fpclassify): Don't use
        non-existing GET_WORDS macro, use EXTRACT_WORDS.
-       Reported by Andres Schwab <schwab@issan.informatik.uni-dortmund.de>.
+       Reported by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
 
 1997-03-07 05:27  Ulrich Drepper  <drepper@cygnus.com>
 
        * sysdeps/unix/sysv/linux/i386/sigaction.c: The user- and
        kernel-level sigaction structure is different.  handle this
        correctly.
-       Bug report by Andres Jaeger <jaeger@informatik.uni-kl.de>.
+       Bug report by Andreas Jaeger <jaeger@informatik.uni-kl.de>.
 
 1997-03-06 05:55  David Engel  <david@sw.ods.com>
 
index 2501789440f73b01bc873062a6b2a2a6df5a720e..d004e07accb72104eb688f24ef965b730911b519 100644 (file)
@@ -490,6 +490,9 @@ object-suffixes += .so
 CPPFLAGS-.so = -DPIC
 CFLAGS-.so = -fPIC -fno-common
 libtype.so := lib%_pic.a
+ifndef ASFLAGS-.so
+ASFLAGS-.so =
+endif
 endif
 ifeq (yes,$(build-profile))
 # Under --enable-profile, we will build a static library of profiled objects.
@@ -498,6 +501,9 @@ object-suffixes += .po
 CPPFLAGS-.po = -DPROF
 CFLAGS-.po = -pg
 libtype.po = lib%_p.a
+ifndef ASFLAGS-.po
+ASFLAGS-.po =
+endif
 endif
 ifeq (yes,$(build-omitfp))
 # Under --enable-omitfp, we build an the library optimized without
@@ -508,6 +514,9 @@ CFLAGS-.go = -g
 CFLAGS-.o = -g0 -O99 -fomit-frame-pointer
 CFLAGS-.so += $(CFLAGS-.o)
 libtype.go = lib%_g.a
+ifndef ASFLAGS-.go
+ASFLAGS-.go =
+endif
 endif
 ifeq (yes,$(build-bounded))
 # Under --enable-bounded, we build the library with `-fbounded-pointers -g'
@@ -516,6 +525,9 @@ object-suffixes += .bo
 CPPFLAGS-.bo = -DBOUNDED_POINTERS
 CFLAGS-.bo = -g -fbounded-pointers
 libtype.bo = lib%_b.a
+ifndef ASFLAGS-.bo
+ASFLAGS-.bo =
+endif
 endif
 
 
index 3636011e4373f695904c8d8174c0c7dbbb6285a8..7a99001c8ef4444a79f2af4b25690a3a1b2381bb 100644 (file)
--- a/Makerules
+++ b/Makerules
@@ -294,8 +294,10 @@ endif
 
 # GCC can grok options after the file name, and it looks nicer that way.
 compile.c = $(CC) $< -c $(CFLAGS) $(CPPFLAGS)
-compile.S = $(CC) $< -c $(CPPFLAGS) -DASSEMBLER $(asm-CPPFLAGS)
-COMPILE.S = $(CC) -c $(CPPFLAGS) -DASSEMBLER $(asm-CPPFLAGS)
+compile.S = \
+  $(CC) $< -c $(CPPFLAGS) -DASSEMBLER $(asm-CPPFLAGS) $(ASFLAGS-$(suffix $@))
+COMPILE.S = \
+  $(CC) -c $(CPPFLAGS) -DASSEMBLER $(asm-CPPFLAGS) $(ASFLAGS-$(suffix $@))
 COMPILE.s = $(filter-out -pipe,$(CC)) -c $(ASFLAGS)
 
 # We need this for the output to go in the right place.  It will default to
index 0a7d0379fd9b4e74e1884d70651b143c3082abab..8f7213936112a3e32607e7d0b8fc6f72bae37af4 100644 (file)
@@ -51,6 +51,9 @@ AR = @AR@
 RANLIB = @RANLIB@
 AS = $(CC) -c
 
+# Build tool flags.
+ASFLAGS-.so = @ASFLAGS_SO@
+
 # Installation tools.
 INSTALL = @INSTALL@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
index 3edb97d9843fc8e2cf1e73c8487dcc98e7f976a2..1dd8a6adb222d618240ba4bf162cc04781314b65 100755 (executable)
--- a/configure
+++ b/configure
@@ -2037,6 +2037,8 @@ fi
 
 
 
+
+
 if test "`(cd $srcdir; pwd)`" = "`pwd`"; then
   config_makefile=
 else
@@ -2223,6 +2225,7 @@ s%@profile@%$profile%g
 s%@omitfp@%$omitfp%g
 s%@bounded@%$bounded%g
 s%@DEFINES@%$DEFINES%g
+s%@ASFLAGS_SO@%$ASFLAGS_SO%g
 s%@VERSION@%$VERSION%g
 
 CEOF
index f36bcaf1bf12d9dea219c05f64cb1a75a900eff4..44147caf0b24bdfdf0a1a9a45e751e1e2d32cb52 100644 (file)
@@ -810,6 +810,8 @@ AC_SUBST(bounded)
 
 AC_SUBST(DEFINES)
 
+AC_SUBST(ASFLAGS_SO)
+
 if test "`(cd $srcdir; pwd)`" = "`pwd`"; then
   config_makefile=
 else
index b0b920074b5de54144ebc5f43ddb5b0264f6d801..62bf74c23be925f5a65531ed3ff2447dffed4a38 100644 (file)
    Boston, MA 02111-1307, USA.  */
 
 #ifndef        _LINK_H
+
 #define        _LINK_H 1
+#include <features.h>
 
 #define __need_size_t
+#define __need_NULL
 #include <stddef.h>
 
 #include <elf.h>
index 354ff35994262eacb7f8e5b7994b0b698ffdde72..0ee0c5d17fda96f0c17a2925a130d71f41346268 100644 (file)
@@ -326,7 +326,7 @@ again:
                char *buffer = __alloca (buflen);
 
                first = 0;
-               if (getpwnam_r (luser, &pwdbuf, buffer, buflen, &pwd) < 0)
+               if (__getpwnam_r (luser, &pwdbuf, buffer, buflen, &pwd) < 0)
                        return -1;
 
                dirlen = strlen (pwd->pw_dir);
@@ -339,7 +339,7 @@ again:
                 * reading an NFS mounted file system, can't read files that
                 * are protected read/write owner only.
                 */
-               if (euidaccess (pbuf, R_OK) != 0)
+               if (__euidaccess (pbuf, R_OK) != 0)
                  hostf = NULL;
                else
                  hostf = fopen(pbuf, "r");
index 96ff12eaff15a2c631bc88b371a8ce7076df394a..1830be3da455e918ccaccbe0a1d7950279e7d3f0 100644 (file)
@@ -240,21 +240,23 @@ main (int argc, char *argv[])
 
          if (! avail)
            {
-             const char *locale_names[] = { "LC_COLLATE", "LC_CTYPE",
-                                            "LC_MONETARY", "LC_NUMERIC",
-                                            "LC_TIME", "LC_MESSAGES" };
+             static const char *locale_names[] =
+             {
+               "LC_COLLATE", "LC_CTYPE", "LC_MONETARY",
+               "LC_NUMERIC", "LC_TIME", "LC_MESSAGES"
+             };
              char *fname;
              int fd;
              struct stat st;
 
-             asprintf (&fname, LOCALE_PATH "/%s/%s", act_add_locdef->name,
+             asprintf (&fname, LOCALEDIR "/%s/%s", act_add_locdef->name,
                        locale_names[cat]);
              fd = open (fname, O_RDONLY);
              if (fd == -1)
                {
                  free (fname);
 
-                 asprintf (&fname, LOCALE_PATH "/%s/%s/SYS_%s",
+                 asprintf (&fname, LOCALEDIR "/%s/%s/SYS_%s",
                            act_add_locdef->name, locale_names[cat],
                            locale_names[cat]);
 
index 4ab04253b9110339d0143c628c730d1790e3001e..aecc8913e2581aa66300016c51be2806b7de75a6 100644 (file)
@@ -26,6 +26,7 @@
 #include <locale.h>
 #include <malloc.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include <sys/stat.h>
@@ -76,10 +77,31 @@ locfile_read (const char *filename, struct charset_t *charset)
     {
       if (filename[0] != '/')
        {
-         char path[strlen (filename) + 1 + sizeof (LOCSRCDIR)];
+         char *i18npath = __secure_getenv ("I18NPATH");
+         if (i18npath != NULL && *i18npath != '\0')
+           {
+             char path[strlen (filename) + 1 + strlen (i18npath) + 1];
+             char *next;
+             i18npath = strdupa (i18npath);
+
+
+             while (ldfile == NULL
+                    && (next = strsep (&i18npath, ":")) != NULL)
+               {
+                 stpcpy (stpcpy (stpcpy (path, next), "/"), filename);
+
+                 ldfile = lr_open (path, locfile_hash);
+               }
+           }
 
-         stpcpy (stpcpy (stpcpy (path, LOCSRCDIR), "/"), filename);
-         ldfile = lr_open (path, locfile_hash);
+         /* Test in the default directory.  */
+         if (ldfile == NULL)
+           {
+             char path[strlen (filename) + 1 + sizeof (LOCSRCDIR)];
+
+             stpcpy (stpcpy (stpcpy (path, LOCSRCDIR), "/"), filename);
+             ldfile = lr_open (path, locfile_hash);
+           }
        }
 
       if (ldfile == NULL)
index 12e656938414d02fddda0aa817b2143e1f706c97..4eceea64466c3c235c6ebf7019673170abe561fe 100644 (file)
@@ -368,7 +368,8 @@ setlocale (int category, const char *locale)
 
          /* We must not simply free a global locale since we have no
             control over the usage.  So we mark it as un-deletable.  */
-         newdata->usage_count = MAX_USAGE_COUNT;
+         if (newdata->usage_count != MAX_USAGE_COUNT)
+           newdata->usage_count = MAX_USAGE_COUNT;
        }
 
       /* Create new composite name.  */
index 426f9496b5476ff3f3271856ef4bb56a7e1763d8..db6a4c8e3236109fd3f8c5c8d48216a98254def6 100644 (file)
@@ -830,7 +830,7 @@ unsuccessful program completion in a general sense.
 
 On POSIX systems, the value of this macro is @code{1}.  On other
 systems, the value might be some other (possibly non-constant) integer
-expression.  Other nonzero status values also indicate future.  Certain
+expression.  Other nonzero status values also indicate failures.  Certain
 programs use different nonzero status values to indicate particular
 kinds of "non-success".  For example, @code{diff} uses status value
 @code{1} to mean that the files are different, and @code{2} or more to
index d257cd7e4b0206caa6dcd6fd863cd1e5e6c3ef0b..c6656ee05fcf67afdc2860549cb15687ddccc5a9 100644 (file)
@@ -43,43 +43,101 @@ struct ether
 #define EXTERN_PARSER
 #include "../nss/nss_files/files-parse.c"
 
-static bool_t new_start = 1;
-static char *oldkey = NULL;
-static int oldkeylen = 0;
+struct response
+{
+  char *val;
+  struct response *next;
+};
 
-enum nss_status
-_nss_nis_setetherent (void)
+static struct response *start = NULL;
+static struct response *next = NULL;
+
+static int
+saveit (int instatus, char *inkey, int inkeylen, char *inval, 
+       int invallen, char *indata)
 {
-  __libc_lock_lock (lock);
+  if (instatus != YP_TRUE)
+    return instatus;
 
-  new_start = 1;
-  if (oldkey != NULL)
+  if (inkey && inkeylen > 0 && inval && invallen > 0)
     {
-      free (oldkey);
-      oldkey = NULL;
-      oldkeylen = 0;
+      if (start == NULL)
+       {
+         start = malloc (sizeof (struct response));
+         next = start;
+       }
+      else
+       {
+         next->next = malloc (sizeof (struct response));
+         next = next->next;
+       }
+      next->next = NULL;
+      next->val = malloc (invallen + 1);
+      strncpy (next->val, inval, invallen);
+      next->val[invallen] = '\0';
     }
+  
+  return 0;
+}
 
-  __libc_lock_unlock (lock);
+enum nss_status
+internal_nis_setetherent (void)
+{
+  char *domainname;
+  struct ypall_callback ypcb;
+  
+  yp_get_default_domain(&domainname);
+  
+  while (start != NULL)
+    {
+      if (start->val != NULL)
+       free (start->val);
+      next = start;
+      start = start->next;
+      free (next);
+    }
+  start = NULL;
+
+  ypcb.foreach = saveit;
+  ypcb.data = NULL;
+  yp_all(domainname, "ethers.byname", &ypcb);
+  next = start;
 
   return NSS_STATUS_SUCCESS;
 }
 
+enum nss_status
+_nss_nis_setetherent (void)
+{
+  enum nss_status result;
+
+  __libc_lock_lock (lock);
+
+  result = internal_nis_setetherent ();
+
+  __libc_lock_unlock (lock);
+
+  return result;
+}
+  
 enum nss_status
 _nss_nis_endetherent (void)
 {
   __libc_lock_lock (lock);
 
-  new_start = 1;
-  if (oldkey != NULL)
+  while (start != NULL)
     {
-      free (oldkey);
-      oldkey = NULL;
-      oldkeylen = 0;
+      if (start->val != NULL)
+       free (start->val);
+      next = start;
+      start = start->next;
+      free (next);
     }
-
+  start = NULL;
+  next = NULL;
+  
   __libc_lock_unlock (lock);
-
+  
   return NSS_STATUS_SUCCESS;
 }
 
@@ -87,54 +145,27 @@ static enum nss_status
 internal_nis_getetherent_r (struct ether *eth, char *buffer, size_t buflen)
 {
   struct parser_data *data = (void *) buffer;
-  char *domain, *result, *outkey;
-  int len, keylen, parse_res;
+  int parse_res;
 
-  if (yp_get_default_domain (&domain))
-    return NSS_STATUS_UNAVAIL;
+  if (start == NULL)
+    internal_nis_setetherent ();
 
   /* Get the next entry until we found a correct one. */
   do
     {
-      enum nss_status retval;
       char *p;
-
-      if (new_start)
-        retval = yperr2nss (yp_first (domain, "ethers.byaddr",
-                                      &outkey, &keylen, &result, &len));
-      else
-        retval = yperr2nss ( yp_next (domain, "ethers.byaddr",
-                                      oldkey, oldkeylen,
-                                      &outkey, &keylen, &result, &len));
-
-      if (retval != NSS_STATUS_SUCCESS)
-        {
-          if (retval == NSS_STATUS_TRYAGAIN)
-            __set_errno (EAGAIN);
-          return retval;
-        }
-
-      if ((size_t) (len + 1) > buflen)
-        {
-          free (result);
-          __set_errno (ERANGE);
-          return NSS_STATUS_TRYAGAIN;
-        }
-
-      p = strncpy (buffer, result, len);
-      buffer[len] = '\0';
+      
+      if (next == NULL)
+       return NSS_STATUS_NOTFOUND;
+      p = strcpy (buffer, next->val);
+      next = next->next;
+      
       while (isspace (*p))
         ++p;
-      free (result);
-
+      
       parse_res = _nss_files_parse_etherent (p, eth, data, buflen);
       if (!parse_res && errno == ERANGE)
         return NSS_STATUS_TRYAGAIN;
-
-      free (oldkey);
-      oldkey = outkey;
-      oldkeylen = keylen;
-      new_start = 0;
     }
   while (!parse_res);
 
index ccb95c3c412c3ed0c5ef5416ec351dedc3a1a177..3349fe5b3611b4843bb7aea215d2f92e0802cd76 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
 
 
 __libc_lock_define_initialized (static, lock)
 
-static bool_t new_start = 1;
-static char *oldkey = NULL;
-static int oldkeylen = 0;
+struct response
+{
+  char *val;
+  struct response *next;
+};
+
+static struct response *start = NULL;
+static struct response *next = NULL;
+
+static int
+saveit (int instatus, char *inkey, int inkeylen, char *inval, 
+        int invallen, char *indata)
+{
+  if (instatus != YP_TRUE)
+    return instatus;
+
+  if (inkey && inkeylen > 0 && inval && invallen > 0)
+    {
+      if (start == NULL)
+        {
+          start = malloc (sizeof (struct response));
+          next = start;
+        }
+      else
+        {
+          next->next = malloc (sizeof (struct response));
+          next = next->next;
+        }
+      next->next = NULL;
+      next->val = malloc (invallen + 1);
+      strncpy (next->val, inval, invallen);
+      next->val[invallen] = '\0';
+    }
+  
+  return 0;
+}
+
+enum nss_status
+internal_nis_setprotoent (void)
+{
+  char *domainname;
+  struct ypall_callback ypcb;
+  
+  yp_get_default_domain (&domainname);
+  
+  while (start != NULL)
+    {
+      if (start->val != NULL)
+        free (start->val);
+      next = start;
+      start = start->next;
+      free (next);
+    }
+  start = NULL;
+  
+  ypcb.foreach = saveit;
+  ypcb.data = NULL;
+  yp_all (domainname, "protocols.bynumber", &ypcb);
+  next = start;
+  
+  return NSS_STATUS_SUCCESS;
+}
 
 enum nss_status
 _nss_nis_setprotoent (void)
 {
+  enum nss_status status;
+
   __libc_lock_lock (lock);
 
-  new_start = 1;
-  if (oldkey != NULL)
-    {
-      free (oldkey);
-      oldkey = NULL;
-      oldkeylen = 0;
-    }
+  status = internal_nis_setprotoent ();
 
   __libc_lock_unlock (lock);
 
-  return NSS_STATUS_SUCCESS;
+  return status;
 }
 
 enum nss_status
@@ -62,16 +117,19 @@ _nss_nis_endprotoent (void)
 {
   __libc_lock_lock (lock);
 
-  new_start = 1;
-  if (oldkey != NULL)
+  while (start != NULL)
     {
-      free (oldkey);
-      oldkey = NULL;
-      oldkeylen = 0;
+      if (start->val != NULL)
+        free (start->val);
+      next = start;
+      start = start->next;
+      free (next);
     }
-
+  start = NULL;
+  next = NULL;
+  
   __libc_lock_unlock (lock);
-
+  
   return NSS_STATUS_SUCCESS;
 }
 
@@ -80,57 +138,30 @@ internal_nis_getprotoent_r (struct protoent *proto,
                            char *buffer, size_t buflen)
 {
   struct parser_data *data = (void *) buffer;
-  char *domain, *result, *outkey;
-  int len, keylen, parse_res;
+  int parse_res;
 
-  if (yp_get_default_domain (&domain))
-    return NSS_STATUS_UNAVAIL;
+  if (start == NULL)
+    internal_nis_setprotoent ();
 
   /* Get the next entry until we found a correct one. */
   do
     {
-      enum nss_status retval;
       char *p;
-
-      if (new_start)
-        retval = yperr2nss (yp_first (domain, "protocols.bynumber",
-                                      &outkey, &keylen, &result, &len));
-      else
-        retval = yperr2nss ( yp_next (domain, "protocols.bynumber",
-                                      oldkey, oldkeylen,
-                                      &outkey, &keylen, &result, &len));
-
-      if (retval != NSS_STATUS_SUCCESS)
-        {
-          if (retval == NSS_STATUS_TRYAGAIN)
-            __set_errno (EAGAIN);
-          return retval;
-        }
-
-      if ((size_t) (len + 1) > buflen)
-        {
-          free (result);
-          __set_errno (ERANGE);
-          return NSS_STATUS_TRYAGAIN;
-        }
-
-      p = strncpy (buffer, result, len);
-      buffer[len] = '\0';
+      
+      if (next == NULL)
+        return NSS_STATUS_NOTFOUND;
+      p = strcpy (buffer, next->val);
+      next = next->next;
+      
       while (isspace (*p))
         ++p;
-      free (result);
 
       parse_res = _nss_files_parse_protoent (p, proto, data, buflen);
       if (!parse_res && errno == ERANGE)
         return NSS_STATUS_TRYAGAIN;
-
-      free (oldkey);
-      oldkey = outkey;
-      oldkeylen = keylen;
-      new_start = 0;
     }
   while (!parse_res);
-
+  
   return NSS_STATUS_SUCCESS;
 }
 
index b9eda6a7424fede22b60089a806cd4e394020434..aad4da5cc28101835fff7513be62686eaa2e261b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
 
@@ -130,6 +130,7 @@ parse_netid_str (const char *s, uid_t *uidp, gid_t *gidp, int *gidlenp,
                 gid_t *gidlist)
 {
   char *p;
+  int gidlen;
 
   if (!s || !isdigit (*s))
     {
@@ -162,14 +163,15 @@ parse_netid_str (const char *s, uid_t *uidp, gid_t *gidp, int *gidlenp,
 
   *gidp = (atoi (p));
 
-  *gidlenp = 0;
-#if 0
+  gidlen = 0;
+
   while ((p = strchr (p, ',')) != NULL)
     {
       p++;
-      gidlist[*gidlenp++] = atoi (p);
+      gidlist[gidlen++] = atoi (p);
     }
-#endif
+
+  *gidlenp = gidlen;
 
   return NSS_STATUS_SUCCESS;
 }
index 2dae9ea8fac4376b779f529c271276c672590876..c0e21d83da2043809808fbfc440dabb09b344d86 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
 
 
 __libc_lock_define_initialized (static, lock)
 
+struct response_t
+{
+  char *val;
+  struct response_t *next;
+};
+
 struct intern_t
 {
-  bool_t new_start;
-  char *oldkey;
-  int oldkeylen;
+  struct response_t *start;
+  struct response_t *next;
 };
 typedef struct intern_t intern_t;
 
-static intern_t intern = {TRUE, NULL, 0};
+static intern_t intern = {NULL, NULL};
+
+static int
+saveit (int instatus, char *inkey, int inkeylen, char *inval, 
+        int invallen, char *indata)
+{
+  intern_t *intern = (intern_t *)indata;
+
+  if (instatus != YP_TRUE)
+    return instatus;
+
+  if (inkey && inkeylen > 0 && inval && invallen > 0)
+    {
+      if (intern->start == NULL)
+        {
+          intern->start = malloc (sizeof (struct response_t));
+          intern->next = intern->start;
+        }
+      else
+        {
+          intern->next->next = malloc (sizeof (struct response_t));
+          intern->next = intern->next->next;
+        }
+      intern->next->next = NULL;
+      intern->next->val = malloc (invallen + 1);
+      strncpy (intern->next->val, inval, invallen);
+      intern->next->val[invallen] = '\0';
+    }
+  
+  return 0;
+}
 
 static enum nss_status
-internal_nis_setrpcent (intern_t *data)
+internal_nis_setrpcent (intern_t *intern)
 {
-  data->new_start = 1;
-  if (data->oldkey != NULL)
+  char *domainname;
+  struct ypall_callback ypcb;
+  
+  if (yp_get_default_domain (&domainname))
+    return NSS_STATUS_UNAVAIL;
+  
+  while (intern->start != NULL)
     {
-      free (data->oldkey);
-      data->oldkey = NULL;
-      data->oldkeylen = 0;
+      if (intern->start->val != NULL)
+        free (intern->start->val);
+      intern->next = intern->start;
+      intern->start = intern->start->next;
+      free (intern->next);
     }
+  intern->start = NULL;
+
+  ypcb.foreach = saveit;
+  ypcb.data = (char *)intern;
+  yp_all(domainname, "rpc.bynumber", &ypcb);
+  intern->next = intern->start;
+
   return NSS_STATUS_SUCCESS;
 }
 
@@ -73,15 +122,18 @@ _nss_nis_setrpcent (void)
 }
 
 static enum nss_status
-internal_nis_endrpcent (intern_t *data)
+internal_nis_endrpcent (intern_t *intern)
 {
-  data->new_start = 1;
-  if (data->oldkey != NULL)
+  while (intern->start != NULL)
     {
-      free (data->oldkey);
-      data->oldkey = NULL;
-      data->oldkeylen = 0;
+      if (intern->start->val != NULL)
+        free (intern->start->val);
+      intern->next = intern->start;
+      intern->start = intern->start->next;
+      free (intern->next);
     }
+  intern->start = NULL;
+  
   return NSS_STATUS_SUCCESS;
 }
 
@@ -104,60 +156,28 @@ internal_nis_getrpcent_r (struct rpcent *rpc, char *buffer, size_t buflen,
                          intern_t *data)
 {
   struct parser_data *pdata = (void *) buffer;
-  char *domain;
-  char *result;
-  int len, parse_res;
-  char *outkey;
-  int keylen;
+  int parse_res;
   char *p;
-
-  if (yp_get_default_domain (&domain))
-    return NSS_STATUS_UNAVAIL;
-
+  
+  if (data->start == NULL)
+    internal_nis_setrpcent (data);
+  
   /* Get the next entry until we found a correct one. */
   do
     {
-      enum nss_status retval;
-
-      if (data->new_start)
-        retval = yperr2nss (yp_first (domain, "rpc.bynumber",
-                                      &outkey, &keylen, &result, &len));
-      else
-        retval = yperr2nss ( yp_next (domain, "rpc.bynumber",
-                                     data->oldkey, data->oldkeylen,
-                                     &outkey, &keylen, &result, &len));
-
-      if (retval != NSS_STATUS_SUCCESS)
-        {
-          if (retval == NSS_STATUS_TRYAGAIN)
-            __set_errno (EAGAIN);
-          return retval;
-        }
-
-      if ((size_t) (len + 1) > buflen)
-        {
-          free (result);
-          __set_errno (ERANGE);
-          return NSS_STATUS_TRYAGAIN;
-        }
-
-      p = strncpy (buffer, result, len);
-      buffer[len] = '\0';
+      if (data->next == NULL)
+        return NSS_STATUS_NOTFOUND;
+      p = strcpy (buffer, data->next->val);
+      data->next = data->next->next;
       while (isspace (*p))
         ++p;
-      free (result);
-
+      
       parse_res = _nss_files_parse_rpcent (p, rpc, pdata, buflen);
       if (!parse_res && errno == ERANGE)
        return NSS_STATUS_TRYAGAIN;
-
-      free (data->oldkey);
-      data->oldkey = outkey;
-      data->oldkeylen = keylen;
-      data->new_start = 0;
     }
   while (!parse_res);
-
+  
   return NSS_STATUS_SUCCESS;
 }
 
@@ -179,7 +199,7 @@ enum nss_status
 _nss_nis_getrpcbyname_r (const char *name, struct rpcent *rpc,
                         char *buffer, size_t buflen)
 {
-  intern_t data = {TRUE, NULL, 0};
+  intern_t data = {NULL, NULL};
   enum nss_status status;
   int found;
 
index 6d07479ee22096e675c091826f9a829674edbcbb..46c3364fe3aca0a7a23b42521a7f297284b3e328 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
 
@@ -37,26 +37,75 @@ extern int _nss_files_parse_servent (char *line, struct servent *result,
 
 __libc_lock_define_initialized (static, lock)
 
+struct response_t
+{
+  char *val;
+  struct response_t *next;
+};
+
 struct intern_t
 {
-  bool_t new_start;
-  char *oldkey;
-  int oldkeylen;
+  struct response_t *start;
+  struct response_t *next;
 };
 typedef struct intern_t intern_t;
 
-static intern_t intern = {TRUE, NULL, 0};
+static intern_t intern = {NULL, NULL};
+
+static int
+saveit (int instatus, char *inkey, int inkeylen, char *inval, 
+        int invallen, char *indata)
+{
+  intern_t *intern = (intern_t *)indata;
+
+  if (instatus != YP_TRUE)
+    return instatus;
+
+  if (inkey && inkeylen > 0 && inval && invallen > 0)
+    {
+      if (intern->start == NULL)
+        {
+          intern->start = malloc (sizeof (struct response_t));
+          intern->next = intern->start;
+        }
+      else
+        {
+          intern->next->next = malloc (sizeof (struct response_t));
+          intern->next = intern->next->next;
+        }
+      intern->next->next = NULL;
+      intern->next->val = malloc (invallen + 1);
+      strncpy (intern->next->val, inval, invallen);
+      intern->next->val[invallen] = '\0';
+    }
+  
+  return 0;
+}
 
 static enum nss_status
-internal_nis_setservent (intern_t * intern)
+internal_nis_setservent (intern_t *intern)
 {
-  intern->new_start = 1;
-  if (intern->oldkey != NULL)
+  char *domainname;
+  struct ypall_callback ypcb;
+  
+  if (yp_get_default_domain (&domainname))
+    return NSS_STATUS_UNAVAIL;
+  
+  while (intern->start != NULL)
     {
-      free (intern->oldkey);
-      intern->oldkey = NULL;
-      intern->oldkeylen = 0;
+      if (intern->start->val != NULL)
+        free (intern->start->val);
+      intern->next = intern->start;
+      intern->start = intern->start->next;
+      free (intern->next);
     }
+  intern->start = NULL;
+
+  ypcb.foreach = saveit;
+  ypcb.data = (char *)intern;
+  yp_all(domainname, "services.byname", &ypcb);
+  intern->next = intern->start;
+
   return NSS_STATUS_SUCCESS;
 }
 enum nss_status
@@ -76,13 +125,16 @@ _nss_nis_setservent (void)
 static enum nss_status
 internal_nis_endservent (intern_t * intern)
 {
-  intern->new_start = 1;
-  if (intern->oldkey != NULL)
+  while (intern->start != NULL)
     {
-      free (intern->oldkey);
-      intern->oldkey = NULL;
-      intern->oldkeylen = 0;
+      if (intern->start->val != NULL)
+        free (intern->start->val);
+      intern->next = intern->start;
+      intern->start = intern->start->next;
+      free (intern->next);
     }
+  intern->start = NULL;
+  
   return NSS_STATUS_SUCCESS;
 }
 
@@ -104,57 +156,25 @@ static enum nss_status
 internal_nis_getservent_r (struct servent *serv, char *buffer,
                           size_t buflen, intern_t *data)
 {
-  char *domain;
-  char *result;
-  int len, parse_res;
-  char *outkey;
-  int keylen;
+  int parse_res;
   char *p;
 
-  if (yp_get_default_domain (&domain))
-    return NSS_STATUS_UNAVAIL;
-
+  if (data->start == NULL)
+    internal_nis_setservent (data);
+  
   /* Get the next entry until we found a correct one. */
   do
     {
-      enum nss_status retval;
-
-      if (data->new_start)
-        retval = yperr2nss (yp_first (domain, "services.byname",
-                                      &outkey, &keylen, &result, &len));
-      else
-        retval = yperr2nss ( yp_next (domain, "services.byname",
-                                      data->oldkey, data->oldkeylen,
-                                      &outkey, &keylen, &result, &len));
-
-      if (retval != NSS_STATUS_SUCCESS)
-        {
-          if (retval == NSS_STATUS_TRYAGAIN)
-            __set_errno (EAGAIN);
-          return retval;
-        }
-
-      if ((size_t) (len + 1) > buflen)
-        {
-          free (result);
-          __set_errno (ERANGE);
-          return NSS_STATUS_TRYAGAIN;
-        }
-
-      p = strncpy (buffer, result, len);
-      buffer[len] = '\0';
+      if (data->next == NULL)
+       return NSS_STATUS_NOTFOUND;
+      p = strcpy (buffer, data->next->val);
+      data->next = data->next->next;
       while (isspace (*p))
         ++p;
-      free (result);
-
+      
       parse_res = _nss_files_parse_servent (p, serv, buffer, buflen);
       if (!parse_res && errno == ERANGE)
         return NSS_STATUS_TRYAGAIN;
-
-      free (data->oldkey);
-      data->oldkey = outkey;
-      data->oldkeylen = keylen;
-      data->new_start = 0;
     }
   while (!parse_res);
 
@@ -179,7 +199,7 @@ enum nss_status
 _nss_nis_getservbyname_r (const char *name, char *protocol,
                          struct servent *serv, char *buffer, size_t buflen)
 {
-  intern_t data = {TRUE, NULL, 0};
+  intern_t data = {NULL, NULL};
   enum nss_status status;
   int found;
 
@@ -198,15 +218,19 @@ _nss_nis_getservbyname_r (const char *name, char *protocol,
          ((status = internal_nis_getservent_r (serv, buffer, buflen, &data))
           == NSS_STATUS_SUCCESS))
     {
-      if (strcmp (serv->s_name, name) == 0)
-        {
-          if (strcmp (serv->s_proto, protocol) == 0)
-            {
-              found = 1;
-            }
-        }
+      if (strcmp (serv->s_proto, protocol) == 0)
+       {
+         char **cp;
+         
+         if (strcmp (serv->s_name, name) == 0)
+           found = 1;
+         else
+           for (cp = serv->s_aliases; *cp; cp++)
+             if (strcmp(name, *cp) == 0)
+               found = 1;
+       }
     }
-
+  
   internal_nis_endservent (&data);
 
   if (!found && status == NSS_STATUS_SUCCESS)
@@ -219,7 +243,7 @@ enum nss_status
 _nss_nis_getservbyport_r (int port, char *protocol, struct servent *serv,
                          char *buffer, size_t buflen)
 {
-  intern_t data = {TRUE, NULL, 0};
+  intern_t data = {NULL, NULL};
   enum nss_status status;
   int found;
 
index 57652bfc3c3f9e3297032ad437e6a8797ba198f8..0a75224134d7a2f0cda12a04ec506e1e8fd6d961 100644 (file)
@@ -171,6 +171,7 @@ extern int access __P ((__const char *__name, int __type));
 #ifdef __USE_GNU
 /* Test for access to NAME using the effective UID and GID
    (as normal file operations use).  */
+extern int __euidaccess __P ((__const char *__name, int __type));
 extern int euidaccess __P ((__const char *__name, int __type));
 #endif
 
index af80c0b3d8d434882de2e4f752692fd591d67b9a..a9e22ac44bf4920f8de609c18fde7c5b187b9112 100644 (file)
@@ -21,7 +21,7 @@
 #
 subdir := stdlib
 
-headers        := stdlib.h alloca.h monetary.h
+headers        := stdlib.h alloca.h monetary.h inttypes.h
 
 routines       :=                                                            \
        atof atoi atol atoll                                                  \
index 50d8ac3b0a11440577f7df6fdb58b8fcbe716eeb..0f76027317bcf4ac9c02fa5bb3cfa9aaf65564c5 100644 (file)
@@ -1,22 +1,22 @@
 /* Inline math functions for Alpha.
-Copyright (C) 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
-Contributed by David Mosberger-Tang.
+   Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Mosberger-Tang.
 
-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.
+   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.
 
-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.
+   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.
 
-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., 675 Mass Ave,
-Cambridge, MA 02139, USA.  */
+   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.  */
 
 #if defined (__GNUC__) && !defined (__NO_MATH_INLINES)
 
@@ -41,13 +41,4 @@ atan (double __x)
   return __atan2 (__x, 1.0);
 }
 
-#ifdef __USE_MISC
-extern __inline double
-cabs (struct __cabs_complex __z)
-{
-  extern double __hypot (double, double);
-  return __hypot(__z.x, __z.y);
-}
-#endif
-
 #endif
index db1a0ac7ee17a4ce317df06cdf478a2563d8ee31..5d85a8e079a7e088ac621ec5a9fa4289138d6411 100644 (file)
@@ -50,6 +50,7 @@ enum __socket_type
 #define        PF_UNSPEC       0       /* Unspecified.  */
 #define        PF_LOCAL        1       /* Local to host (pipes and file-domain).  */
 #define        PF_UNIX         PF_LOCAL /* Old BSD name for PF_LOCAL.  */
+#define        PF_FILE         PF_LOCAL /* POSIX name for PF_LOCAL.  */
 #define        PF_INET         2       /* IP protocol family.  */
 #define        PF_IMPLINK      3       /* ARPAnet IMP protocol.  */
 #define        PF_PUP          4       /* PUP protocols.  */
@@ -82,6 +83,7 @@ enum __socket_type
 #define        AF_UNSPEC       PF_UNSPEC
 #define        AF_LOCAL        PF_LOCAL
 #define        AF_UNIX         PF_UNIX
+#define        AF_FILE         PF_FILE
 #define        AF_INET         PF_INET
 #define        AF_IMPLINK      PF_IMPLINK
 #define        AF_PUP          PF_PUP
index 53e324b91b666308618d7666a09058bc23f2376d..8b7faaefc454f9e1063516a7a08585e4d70a0374 100644 (file)
@@ -73,6 +73,8 @@ nofini:
           boundary to avoid penalties from misaligned accesses.  Thanks
           to Edward Seidl <seidl@janed.com> for pointing this out.  */
        andl $0xfffffff8, %esp
+       pushl %eax              /* Push garbage because we allocate
+                                  twelve more bytes.  */
 
        pushl %eax              /* Push third argument: envp.  */
        pushl %edx              /* Push second argument: argv.  */
index dd4e742260ac96c315d2b4995c2406fd4ca824df..72a15369b55d9c75d80029ead9eb498a32a6a72f 100644 (file)
@@ -29,7 +29,7 @@ __fpclassify (double x)
   u_int32_t hx, lx;
   int retval = FP_NORMAL;
 
-  GET_WORDS (hx, lx, x);
+  EXTRACT_WORDS (hx, lx, x);
   lx |= hx & 0xfffff;
   hx &= 0x7ff00000;
   if ((hx | lx) == 0)
index 04648ce08b65bd7c8334bf7df94769e0761a5d2f..ed595821547aacab025b44bc4c9cf2a0af2e9f65 100644 (file)
@@ -1,22 +1,21 @@
-/* euidaccess -- check if effective user id can access file
-   Copyright (C) 1990, 1991, 1995, 1996 Free Software Foundation, Inc.
+/* Check if effective user id can access file
+   Copyright (C) 1990, 1991, 1995, 1996, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
 
-This file is part of the GNU C Library.
+   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.
 
-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.
+   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.
 
-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.
-
-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., 675 Mass Ave,
-Cambridge, MA 02139, USA.  */
+   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.  */
 
 /* Written by David MacKenzie and Torbjorn Granlund.
    Adapted for GNU C library by Roland McGrath.  */
@@ -95,6 +94,7 @@ extern int errno;
 #ifdef _LIBC
 
 #define group_member __group_member
+#define euidaccess __euidaccess
 
 #else
 
@@ -104,6 +104,14 @@ static uid_t uid;
 /* The user's real group id. */
 static gid_t gid;
 
+#ifdef HAVE_GETGROUPS
+int group_member ();
+#else
+#define group_member(gid)      0
+#endif
+
+#endif
+
 /* The user's effective user id. */
 static uid_t euid;
 
@@ -113,14 +121,6 @@ static gid_t egid;
 /* Nonzero if UID, GID, EUID, and EGID have valid values. */
 static int have_ids = 0;
 
-#ifdef HAVE_GETGROUPS
-int group_member ();
-#else
-#define group_member(gid)      0
-#endif
-
-#endif
-
 
 /* Return 0 if the user has permission of type MODE on file PATH;
    otherwise, return -1 and set `errno' to EACCESS.
@@ -137,9 +137,6 @@ euidaccess (path, mode)
   int granted;
 
 #ifdef _LIBC
-  uid_t euid;
-  gid_t egid;
-
   if (! __libc_enable_secure)
     /* If we are not set-uid or set-gid, access does the same.  */
     return access (path, mode);
@@ -171,8 +168,12 @@ euidaccess (path, mode)
 
 #ifdef _LIBC
   /* Now we need the IDs.  */
-  euid = geteuid ();
-  egid = getegid ();
+  if (have_ids == 0)
+    {
+      have_ids = 1;
+      euid = geteuid ();
+      egid = getegid ();
+    }
 #endif
 
   /* The super-user can read and write any file, and execute any file
@@ -192,6 +193,10 @@ euidaccess (path, mode)
   __set_errno (EACCESS);
   return -1;
 }
+#undef euidaccess
+#ifdef weak_alias
+weak_alias (__euidaccess, euidaccess)
+#endif
 \f
 #ifdef TEST
 #include <stdio.h>
diff --git a/sysdeps/sparc/configure b/sysdeps/sparc/configure
new file mode 100755 (executable)
index 0000000..5616867
--- /dev/null
@@ -0,0 +1,4 @@
+ # Local configure fragment for sysdeps/sparc.
+
+# The assembler on SPARC needs the -fPIC flag even when it's assembler code.
+ASFLAGS_SO = -fPIC
diff --git a/sysdeps/sparc/configure.in b/sysdeps/sparc/configure.in
new file mode 100644 (file)
index 0000000..3e2b2f0
--- /dev/null
@@ -0,0 +1,6 @@
+sinclude(./aclocal.m4)dnl Autoconf lossage
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/sparc.
+
+# The assembler on SPARC needs the -fPIC flag even when it's assembler code.
+ASFLAGS_SO = -fPIC
index 79296a77f41b99e8f19db3bc7c377b0b47266f34..f11c74b8f73c75666f587e0ae08fcf75d3d2120f 100644 (file)
@@ -1,28 +1,28 @@
 /* Test for access to FILE using effective UID and GID.  Stub version.
-Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+   Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
 
-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.
+   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.
 
-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.
+   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.
 
-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., 675 Mass Ave,
-Cambridge, MA 02139, USA.  */
+   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.  */
 
 #include <errno.h>
 #include <stddef.h>
 #include <unistd.h>
 
 int
-euidaccess (file, type)
+__euidaccess (file, type)
      const char *file;
      int type;
 {
@@ -35,4 +35,5 @@ euidaccess (file, type)
   __set_errno (ENOSYS);
   return -1;
 }
+weak_alias (__euidaccess, euidaccess)
 stub_warning (euidaccess)
index 915e0f001e2037d2ceba3fded886c62bc54cf11d..38a8fb74d172ae26f05e42ba9d01708ce39cadc0 100644 (file)
@@ -55,6 +55,7 @@ enum __socket_type
 #define        PF_UNSPEC       0       /* Unspecified.  */
 #define        PF_LOCAL        1       /* Local to host (pipes and file-domain).  */
 #define        PF_UNIX         PF_LOCAL /* Old BSD name for PF_LOCAL.  */
+#define        PF_FILE         PF_LOCAL /* POSIX name for PF_LOCAL.  */
 #define        PF_INET         2       /* IP protocol family.  */
 #define        PF_AX25         3       /* Amateur Radio AX.25.  */
 #define        PF_IPX          4       /* Novell Internet Protocol.  */
@@ -70,6 +71,7 @@ enum __socket_type
 #define        AF_UNSPEC       PF_UNSPEC
 #define        AF_LOCAL        PF_LOCAL
 #define        AF_UNIX         PF_UNIX
+#define        AF_FILE         PF_FILE
 #define        AF_INET         PF_INET
 #define        AF_AX25         PF_AX25
 #define        AF_IPX          PF_IPX
diff --git a/sysdeps/wordsize-32/inttypes.h b/sysdeps/wordsize-32/inttypes.h
new file mode 100644 (file)
index 0000000..f9735a1
--- /dev/null
@@ -0,0 +1,340 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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.
+
+   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.
+
+   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.  */
+
+/*
+ *     ISO C 9X: 7.4 Integral types    <inttypes.h>
+ */
+
+#ifndef _INTTYPES_H
+#define _INTTYPES_H    1
+
+/* Exact integral types.  */
+
+/* Signed.  */
+typedef signed char    int8_t;
+typedef short int     int16_t;
+typedef int           int32_t;
+typedef long long int int64_t;
+
+/* Unsigned.  */
+typedef unsigned char           uint8_t;
+typedef unsigned short int     uint16_t;
+typedef unsigned int           uint32_t;
+typedef unsigned long long int uint64_t;
+
+
+/* Largest integral types.  */
+typedef long long int           intmax_t;
+typedef unsigned long long int uintmax_t;
+
+
+/* Types for `void *' pointers.  */
+typedef int           intptr_t;
+typedef unsigned int uintptr_t;
+
+
+/* Efficient types.  */
+typedef int           intfast_t;
+typedef unsigned int uintfast_t;
+
+
+/* Small types.  */
+
+/* Signed.  */
+typedef signed char    int_least8_t;
+typedef short int     int_least16_t;
+typedef int           int_least32_t;
+typedef long long int int_least64_t;
+
+/* Unsigned.  */
+typedef unsigned char           int_least8_t;
+typedef unsigned short int     int_least16_t;
+typedef unsigned int           int_least32_t;
+typedef unsigned long long int int_least64_t;
+
+
+/* Fast types.  */
+
+/* Signed.  */
+typedef signed char    int_fast8_t;
+typedef int           int_fast16_t;
+typedef int           int_fast32_t;
+typedef long long int int_fast64_t;
+
+/* Unsigned.  */
+typedef unsigned char           int_fast8_t;
+typedef unsigned int           int_fast16_t;
+typedef unsigned int           int_fast32_t;
+typedef unsigned long long int int_fast64_t;
+
+
+/* Limits of integral types.  */
+
+/* Minimum of signed integral types.  */
+#define INT8_MIN               (-128)
+#define INT16_MIN              (-32767-1)
+#define INT32_MIN              (-2147483647-1)
+#define INT64_MIN              (-9223372036854775807LL-1)
+/* Maximum of signed integral types.  */
+#define INT8_MAX               (127)
+#define INT16_MAX              (32767)
+#define INT32_MAX              (2147483647)
+#define INT64_MAX              (9223372036854775807LL)
+
+/* Maximum of unsigned integral types.  */
+#define UINT8_MAX              (255U)
+#define UINT16_MAX             (65535U)
+#define UINT32_MAX             (4294967295U)
+#define UINT64_MAX             (18446744073709551615uLL)
+
+
+/* Minimum of signed integral types having a minimum size.  */
+#define INT_LEAST8_MIN         (-128)
+#define INT_LEAST16_MIN                (-32767-1)
+#define INT_LEAST32_MIN                (-2147483647-1)
+#define INT_LEAST64_MIN                (-9223372036854775807LL-1)
+/* Maximum of signed integral types having a minimum size.  */
+#define INT_LEAST8_MAX         (127)
+#define INT_LEAST16_MAX                (32767)
+#define INT_LEAST32_MAX                (2147483647)
+#define INT_LEAST64_MAX                (9223372036854775807LL)
+
+/* Maximum of unsigned integral types having a minimum size.  */
+#define UINT_LEAST8_MAX                (255U)
+#define UINT_LEAST16_MAX       (65535U)
+#define UINT_LEAST32_MAX       (4294967295U)
+#define UINT_LEAST64_MAX       (18446744073709551615uLL)
+
+
+/* Minimum of fast signed integral types having a minimum size.  */
+#define INT_LEAST8_MIN         (-128)
+#define INT_LEAST16_MIN                (-2147483647-1)
+#define INT_LEAST32_MIN                (-2147483647-1)
+#define INT_LEAST64_MIN                (-9223372036854775807LL-1)
+/* Maximum of fast signed integral types having a minimum size.  */
+#define INT_LEAST8_MAX         (127)
+#define INT_LEAST16_MAX                (2147483647)
+#define INT_LEAST32_MAX                (2147483647)
+#define INT_LEAST64_MAX                (9223372036854775807LL)
+
+/* Maximum of fast unsigned integral types having a minimum size.  */
+#define UINT_LEAST8_MAX                (255U)
+#define UINT_LEAST16_MAX       (4294967295U)
+#define UINT_LEAST32_MAX       (4294967295U)
+#define UINT_LEAST64_MAX       (18446744073709551615uLL)
+
+
+/* Minimum for most efficient signed integral types.  */
+#define INTFAST_MIN            (-128)
+/* Maximum for most efficient signed integral types.  */
+#define INTFAST_MAX            (127)
+
+/* Maximum for most efficient unsigned integral types.  */
+#define UINTFAST_MAX           (255)
+
+
+/* Minimum for largest signed integral type.  */
+#define INTMAX_MIN             (-9223372036854775807LL-1)
+/* Maximum for largest signed integral type.  */
+#define INTMAX_MAX             (9223372036854775807LL)
+
+/* Maximum for largest unsigned integral type.  */
+#define UINTMAX_MAX            (18446744073709551615uLL)
+
+
+/* Values to test for integral types holding `void *' pointer.  */
+#define INTPTR_MAX             (2147483647)
+#define UINTPTR_MAX            (4294967295U)
+
+
+/* Macros for creating constants.  */
+#define __CONCAT__(A, B) A ## B
+
+/* Signed.  */
+#define INT8_C(c)      ((int8_t) c)
+#define INT16_C(c)     ((int16_t) c)
+#define INT32_C(c)     ((int32_t) c)
+#define INT64_C(c)     ((int64_t) __CONCAT__ (c,ll))
+
+/* Unsigned.  */
+#define UINT8_C(c)     ((uint8_t) __CONCAT__ (c,u))
+#define UINT16_C(c)    ((uint16_t) __CONCAT__ (c,u))
+#define UINT32_C(c)    ((uint32_t) __CONCAT__ (c,u))
+#define UINT64_C(c)    ((uint64_t) __CONCAT__ (c,ull))
+
+/* Maximal type.  */
+#define INTMAX_C(c)    ((intmax_t) __CONCAT__ (c,ll))
+#define UINTMAX_C(c)   ((uintmax_t) __CONCAT__ (c,ull))
+
+
+/* Macros for printing format specifiers.  */
+
+/* Decimal notation.  */
+#define PRId8          "d"
+#define PRId16         "d"
+#define PRId32         "d"
+#define PRId64         "lld"
+
+#define PRIdLEAST8     "d"
+#define PRIdLEAST16    "d"
+#define PRIdLEAST32    "d"
+#define PRIdLEAST64    "lld"
+
+#define PRIdFAST8      "d"
+#define PRIdFAST16     "d"
+#define PRIdFAST32     "d"
+#define PRIdFAST64     "lld"
+
+
+#define PRIi8          "i"
+#define PRIi16         "i"
+#define PRIi32         "i"
+#define PRIi64         "lli"
+
+#define PRIiLEAST8     "i"
+#define PRIiLEAST16    "i"
+#define PRIiLEAST32    "i"
+#define PRIiLEAST64    "lli"
+
+#define PRIiFAST8      "i"
+#define PRIiFAST16     "i"
+#define PRIiFAST32     "i"
+#define PRIiFAST64     "lli"
+
+/* Octal notation.  */
+#define PRIo8          "o"
+#define PRIo16         "o"
+#define PRIo32         "o"
+#define PRIo64         "llo"
+
+#define PRIoLEAST8     "o"
+#define PRIoLEAST16    "o"
+#define PRIoLEAST32    "o"
+#define PRIoLEAST64    "llo"
+
+#define PRIoFAST8      "o"
+#define PRIoFAST16     "o"
+#define PRIoFAST32     "o"
+#define PRIoFAST64     "llo"
+
+/* lowercase hexadecimal notation.  */
+#define PRIx8          "x"
+#define PRIx16         "x"
+#define PRIx32         "x"
+#define PRIx64         "llx"
+
+#define PRIxLEAST8     "x"
+#define PRIxLEAST16    "x"
+#define PRIxLEAST32    "x"
+#define PRIxLEAST64    "llx"
+
+#define PRIxFAST8      "x"
+#define PRIxFAST16     "x"
+#define PRIxFAST32     "x"
+#define PRIxFAST64     "llx"
+
+/* UPPERCASE hexadecimal notation.  */
+#define PRIX8          "X"
+#define PRIX16         "X"
+#define PRIX32         "X"
+#define PRIX64         "llX"
+
+#define PRIXLEAST8     "X"
+#define PRIXLEAST16    "X"
+#define PRIXLEAST32    "X"
+#define PRIXLEAST64    "llX"
+
+#define PRIXFAST8      "X"
+#define PRIXFAST16     "X"
+#define PRIXFAST32     "X"
+#define PRIXFAST64     "llX"
+
+
+/* Unsigned integers.  */
+#define PRIu8          "u"
+#define PRIu16         "u"
+#define PRIu32         "u"
+#define PRIu64         "llu"
+
+#define PRIuLEAST8     "u"
+#define PRIuLEAST16    "u"
+#define PRIuLEAST32    "u"
+#define PRIuLEAST64    "llu"
+
+#define PRIuFAST8      "u"
+#define PRIuFAST16     "u"
+#define PRIuFAST32     "u"
+#define PRIuFAST64     "llu"
+
+
+/* Macros for printing `intmax_t' and `uintmax_t'.  */
+#define PRIdMAX                "lld"
+#define PRIoMAX                "llo"
+#define PRIxMAX                "llx"
+#define PRIuMAX                "llu"
+
+
+/* Macros for printing `intfast_t' and `uintfast_t'.  */
+#define PRIdFAST       "d"
+#define PRIoFAST       "o"
+#define PRIxFAST       "x"
+#define PRIuFAST       "u"
+
+
+/* Macros for printing `intptr_t' and `uintptr_t'.  */
+#define PRIdPTR                "d"
+#define PRIoPTR                "o"
+#define PRIxPTR                "x"
+#define PRIuPTR                "u"
+
+
+/* Macros for printing format specifiers.  */
+
+/* Decimal notation.  */
+#define SCNd16         "hd"
+#define SCNd32         "d"
+#define SCNd64         "lld"
+
+#define SCNi16         "hi"
+#define SCNi32         "i"
+#define SCNi64         "lli"
+
+/* Octal notation.  */
+#define SCNo16         "ho"
+#define SCNo32         "o"
+#define SCNo64         "llo"
+
+/* Hexadecimal notation.  */
+#define SCNx16         "hx"
+#define SCNx32         "x"
+#define SCNx64         "llx"
+
+
+/* Macros for scaning `intfast_t' and `uintfast_t'.  */
+#define SCNdFAST       "d"
+#define SCNiFAST       "i"
+#define SCNoFAST       "o"
+#define SCNxFAST       "x"
+
+/* Macros for scaning `intptr_t' and `uintptr_t'.  */
+#define SCNdPTR                "d"
+#define SCNiPTR                "i"
+#define SCNoPTR                "o"
+#define SCNxPTR                "x"
+
+#endif /* inttypes.h */
diff --git a/sysdeps/wordsize-64/inttypes.h b/sysdeps/wordsize-64/inttypes.h
new file mode 100644 (file)
index 0000000..a86e49c
--- /dev/null
@@ -0,0 +1,340 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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.
+
+   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.
+
+   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.  */
+
+/*
+ *     ISO C 9X: 7.4 Integral types    <inttypes.h>
+ */
+
+#ifndef _INTTYPES_H
+#define _INTTYPES_H    1
+
+/* Exact integral types.  */
+
+/* Signed.  */
+typedef signed char int8_t;
+typedef short int  int16_t;
+typedef int        int32_t;
+typedef long int   int64_t;
+
+/* Unsigned.  */
+typedef unsigned char       uint8_t;
+typedef unsigned short int uint16_t;
+typedef unsigned int       uint32_t;
+typedef unsigned long int  uint64_t;
+
+
+/* Largest integral types.  */
+typedef long long int      intmax_t;
+typedef unsigned long int uintmax_t;
+
+
+/* Types for `void *' pointers.  */
+typedef long int           intptr_t;
+typedef unsigned long int uintptr_t;
+
+
+/* Efficient types.  */
+typedef long int           intfast_t;
+typedef unsigned long int uintfast_t;
+
+
+/* Small types.  */
+
+/* Signed.  */
+typedef signed char int_least8_t;
+typedef short int  int_least16_t;
+typedef int        int_least32_t;
+typedef long int   int_least64_t;
+
+/* Unsigned.  */
+typedef unsigned char       int_least8_t;
+typedef unsigned short int int_least16_t;
+typedef unsigned int       int_least32_t;
+typedef unsigned long int  int_least64_t;
+
+
+/* Fast types.  */
+
+/* Signed.  */
+typedef signed char int_fast8_t;
+typedef int        int_fast16_t;
+typedef int        int_fast32_t;
+typedef long int   int_fast64_t;
+
+/* Unsigned.  */
+typedef unsigned char      int_fast8_t;
+typedef unsigned int      int_fast16_t;
+typedef unsigned int      int_fast32_t;
+typedef unsigned long int int_fast64_t;
+
+
+/* Limits of integral types.  */
+
+/* Minimum of signed integral types.  */
+#define INT8_MIN               (-128)
+#define INT16_MIN              (-32767-1)
+#define INT32_MIN              (-2147483647-1)
+#define INT64_MIN              (-9223372036854775807L-1)
+/* Maximum of signed integral types.  */
+#define INT8_MAX               (127)
+#define INT16_MAX              (32767)
+#define INT32_MAX              (2147483647)
+#define INT64_MAX              (9223372036854775807L)
+
+/* Maximum of unsigned integral types.  */
+#define UINT8_MAX              (255U)
+#define UINT16_MAX             (65535U)
+#define UINT32_MAX             (4294967295U)
+#define UINT64_MAX             (18446744073709551615uL)
+
+
+/* Minimum of signed integral types having a minimum size.  */
+#define INT_LEAST8_MIN         (-128)
+#define INT_LEAST16_MIN                (-32767-1)
+#define INT_LEAST32_MIN                (-2147483647-1)
+#define INT_LEAST64_MIN                (-9223372036854775807L-1)
+/* Maximum of signed integral types having a minimum size.  */
+#define INT_LEAST8_MAX         (127)
+#define INT_LEAST16_MAX                (32767)
+#define INT_LEAST32_MAX                (2147483647)
+#define INT_LEAST64_MAX                (9223372036854775807L)
+
+/* Maximum of unsigned integral types having a minimum size.  */
+#define UINT_LEAST8_MAX                (255U)
+#define UINT_LEAST16_MAX       (65535U)
+#define UINT_LEAST32_MAX       (4294967295U)
+#define UINT_LEAST64_MAX       (18446744073709551615uL)
+
+
+/* Minimum of fast signed integral types having a minimum size.  */
+#define INT_LEAST8_MIN         (-128)
+#define INT_LEAST16_MIN                (-2147483647-1)
+#define INT_LEAST32_MIN                (-2147483647-1)
+#define INT_LEAST64_MIN                (-9223372036854775807L-1)
+/* Maximum of fast signed integral types having a minimum size.  */
+#define INT_LEAST8_MAX         (127)
+#define INT_LEAST16_MAX                (2147483647)
+#define INT_LEAST32_MAX                (2147483647)
+#define INT_LEAST64_MAX                (9223372036854775807L)
+
+/* Maximum of fast unsigned integral types having a minimum size.  */
+#define UINT_LEAST8_MAX                (255U)
+#define UINT_LEAST16_MAX       (4294967295U)
+#define UINT_LEAST32_MAX       (4294967295U)
+#define UINT_LEAST64_MAX       (18446744073709551615uL)
+
+
+/* Minimum for most efficient signed integral types.  */
+#define INTFAST_MIN            (-128)
+/* Maximum for most efficient signed integral types.  */
+#define INTFAST_MAX            (127)
+
+/* Maximum for most efficient unsigned integral types.  */
+#define UINTFAST_MAX           (255)
+
+
+/* Minimum for largest signed integral type.  */
+#define INTMAX_MIN             (-9223372036854775807L-1)
+/* Maximum for largest signed integral type.  */
+#define INTMAX_MAX             (9223372036854775807L)
+
+/* Maximum for largest unsigned integral type.  */
+#define UINTMAX_MAX            (18446744073709551615uL)
+
+
+/* Values to test for integral types holding `void *' pointer.  */
+#define INTPTR_MAX             (9223372036854775807L)
+#define UINTPTR_MAX            (18446744073709551615uL)
+
+
+/* Macros for creating constants.  */
+#define __CONCAT__(A, B) A ## B
+
+/* Signed.  */
+#define INT8_C(c)      ((int8_t) c)
+#define INT16_C(c)     ((int16_t) c)
+#define INT32_C(c)     ((int32_t) c)
+#define INT64_C(c)     ((int64_t) __CONCAT__ (c,l))
+
+/* Unsigned.  */
+#define UINT8_C(c)     ((uint8_t) __CONCAT__ (c,u))
+#define UINT16_C(c)    ((uint16_t) __CONCAT__ (c,u))
+#define UINT32_C(c)    ((uint32_t) __CONCAT__ (c,u))
+#define UINT64_C(c)    ((uint64_t) __CONCAT__ (c,ul))
+
+/* Maximal type.  */
+#define INTMAX_C(c)    ((intmax_t) __CONCAT__ (c,ll))
+#define UINTMAX_C(c)   ((uintmax_t) __CONCAT__ (c,ul))
+
+
+/* Macros for printing format specifiers.  */
+
+/* Decimal notation.  */
+#define PRId8          "d"
+#define PRId16         "d"
+#define PRId32         "d"
+#define PRId64         "ld"
+
+#define PRIdLEAST8     "d"
+#define PRIdLEAST16    "d"
+#define PRIdLEAST32    "d"
+#define PRIdLEAST64    "ld"
+
+#define PRIdFAST8      "d"
+#define PRIdFAST16     "d"
+#define PRIdFAST32     "d"
+#define PRIdFAST64     "ld"
+
+
+#define PRIi8          "i"
+#define PRIi16         "i"
+#define PRIi32         "i"
+#define PRIi64         "li"
+
+#define PRIiLEAST8     "i"
+#define PRIiLEAST16    "i"
+#define PRIiLEAST32    "i"
+#define PRIiLEAST64    "li"
+
+#define PRIiFAST8      "i"
+#define PRIiFAST16     "i"
+#define PRIiFAST32     "i"
+#define PRIiFAST64     "li"
+
+/* Octal notation.  */
+#define PRIo8          "o"
+#define PRIo16         "o"
+#define PRIo32         "o"
+#define PRIo64         "lo"
+
+#define PRIoLEAST8     "o"
+#define PRIoLEAST16    "o"
+#define PRIoLEAST32    "o"
+#define PRIoLEAST64    "lo"
+
+#define PRIoFAST8      "o"
+#define PRIoFAST16     "o"
+#define PRIoFAST32     "o"
+#define PRIoFAST64     "lo"
+
+/* lowercase hexadecimal notation.  */
+#define PRIx8          "x"
+#define PRIx16         "x"
+#define PRIx32         "x"
+#define PRIx64         "lx"
+
+#define PRIxLEAST8     "x"
+#define PRIxLEAST16    "x"
+#define PRIxLEAST32    "x"
+#define PRIxLEAST64    "lx"
+
+#define PRIxFAST8      "x"
+#define PRIxFAST16     "x"
+#define PRIxFAST32     "x"
+#define PRIxFAST64     "lx"
+
+/* UPPERCASE hexadecimal notation.  */
+#define PRIX8          "X"
+#define PRIX16         "X"
+#define PRIX32         "X"
+#define PRIX64         "lX"
+
+#define PRIXLEAST8     "X"
+#define PRIXLEAST16    "X"
+#define PRIXLEAST32    "X"
+#define PRIXLEAST64    "lX"
+
+#define PRIXFAST8      "X"
+#define PRIXFAST16     "X"
+#define PRIXFAST32     "X"
+#define PRIXFAST64     "lX"
+
+
+/* Unsigned integers.  */
+#define PRIu8          "u"
+#define PRIu16         "u"
+#define PRIu32         "u"
+#define PRIu64         "lu"
+
+#define PRIuLEAST8     "u"
+#define PRIuLEAST16    "u"
+#define PRIuLEAST32    "u"
+#define PRIuLEAST64    "lu"
+
+#define PRIuFAST8      "u"
+#define PRIuFAST16     "u"
+#define PRIuFAST32     "u"
+#define PRIuFAST64     "lu"
+
+
+/* Macros for printing `intmax_t' and `uintmax_t'.  */
+#define PRIdMAX                "ld"
+#define PRIoMAX                "lo"
+#define PRIxMAX                "lx"
+#define PRIuMAX                "lu"
+
+
+/* Macros for printing `intfast_t' and `uintfast_t'.  */
+#define PRIdFAST       "d"
+#define PRIoFAST       "o"
+#define PRIxFAST       "x"
+#define PRIuFAST       "u"
+
+
+/* Macros for printing `intptr_t' and `uintptr_t'.  */
+#define PRIdPTR                "ld"
+#define PRIoPTR                "lo"
+#define PRIxPTR                "lx"
+#define PRIuPTR                "lu"
+
+
+/* Macros for printing format specifiers.  */
+
+/* Decimal notation.  */
+#define SCNd16         "hd"
+#define SCNd32         "d"
+#define SCNd64         "ld"
+
+#define SCNi16         "hi"
+#define SCNi32         "i"
+#define SCNi64         "li"
+
+/* Octal notation.  */
+#define SCNo16         "ho"
+#define SCNo32         "o"
+#define SCNo64         "lo"
+
+/* Hexadecimal notation.  */
+#define SCNx16         "hx"
+#define SCNx32         "x"
+#define SCNx64         "lx"
+
+
+/* Macros for scaning `intfast_t' and `uintfast_t'.  */
+#define SCNdFAST       "d"
+#define SCNiFAST       "i"
+#define SCNoFAST       "o"
+#define SCNxFAST       "x"
+
+/* Macros for scaning `intptr_t' and `uintptr_t'.  */
+#define SCNdPTR                "ld"
+#define SCNiPTR                "li"
+#define SCNoPTR                "lo"
+#define SCNxPTR                "lx"
+
+#endif /* inttypes.h */
index 044f15486daa5ae5a872a59aa21ae3de54fddb19..cf0ac6a89d7bd0d0203e98d1ee85f7d2ac48080e 100644 (file)
@@ -179,14 +179,20 @@ CFLAGS-tzset.c = $(tz-cflags)
 
 # We have to make sure the data for testing the tz functions is available.
 .PHONY: install-test-data
-install-test-data: northamerica $(objpfx)zic $(leapseconds) yearistype \
-                  etcetera simplebackw
+install-test-data: $(addprefx $(objpfx)testdata/, America/New_York \
+                                                 Etc/UTC UTC)
+
+$(objpfx)testdata/America/New_York: $(objpfx)zic $(leapseconds) yearistype
        $(built-program-cmd) -d $(objpfx)testdata -L $(leapseconds) \
          -y yearistype northamerica
+$(objpfx)testdata/Etc/UTC: $(objpfx)zic $(leapseconds) yearistype
        $(built-program-cmd) -d $(objpfx)testdata -L $(leapseconds) \
          -y yearistype etcetera
+$(objpfx)testdata/UTC: $(objpfx)testdata/Etc/UTC $(objpfx)zic  \
+                      $(leapseconds) yearistype
        $(built-program-cmd) -d $(objpfx)testdata -L $(leapseconds) \
          -y yearistype simplebackw
+
 test-tz-ENV = TZDIR=$(objpfx)testdata
 
 
index 5a5b516d0fd473a6223fe853d3bdea0dc788fda3..5502aa8c981eecab8c98131fa9f7fa7654691b02 100644 (file)
@@ -176,14 +176,13 @@ extern int errno;
 ** Private function declarations.
 */
 char * icalloc P((int nelem, int elsize));
-char * icatalloc P((char * old, const char * new));
-char * icpyalloc P((const char * string));
-char * imalloc P((int n));
-void * irealloc P((void * pointer, int size));
-void   icfree P((char * pointer));
-void   ifree P((char * pointer));
-char *  scheck P((const char *string, char *format));
-
+char * icatalloc P((char * old, const char * const new));
+char * icpyalloc P((const char * const string));
+char * imalloc P((const int n));
+void * irealloc P((void * const pointer, const int size));
+void   icfree P((char * const pointer));
+void   ifree P((char * const pointer));
+char * scheck P((const char * const string, const char * const format));
 
 /*
 ** Finally, some convenience items.
index b51f58d042742799b0fddb27e09e2f859aa4e948..52b4ff51fd9dc29207f5188afd3dee92f5291ef8 100644 (file)
@@ -11,7 +11,7 @@ static char   elsieid[] = "@(#)scheck.c       8.14";
 char *
 scheck(string, format)
 const char * const     string;
-char * const           format;
+const char * const     format;
 {
        register char *         fbuf;
        register const char *   fp;