]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Tue, 4 May 1999 12:24:18 +0000 (12:24 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 4 May 1999 12:24:18 +0000 (12:24 +0000)
* elf/dl-load.c (expand_dynamic_string_token): Rewrite to loose st
variable.

ChangeLog
FAQ
FAQ.in
elf/dl-load.c

index a126fe9a28b2204dadada9cd827c970f9565fa38..4bb25b13940db5355c15f8d1ecc78db1433ec492 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 1999-05-04  Ulrich Drepper  <drepper@cygnus.com>
 
+       * elf/dl-load.c (expand_dynamic_string_token): Rewrite to loose st
+       variable.
+
        * elf/dl-load.c (expand_dynamic_string_token): Recognize { }
        around DST.  Correctly ignore ORIGIN IN SUID binaries.
 
diff --git a/FAQ b/FAQ
index 65d1e7d3d7b8254b764e2db446ad71637103e73c..69edb3d48e41d22488b82446b9882ea3215f55f5 100644 (file)
--- a/FAQ
+++ b/FAQ
@@ -147,6 +147,10 @@ please let me know.
        libc5.  What can be done?
 3.20.  Programs compiled with glibc 2.1 can't read db files made with glibc
        2.0.  What has changed that programs like rpm break?
+3.21.  Autoconf's AC_CHECK_FUNC macro reports that a function exists, but
+       when I try to use it, it always returns -1 and sets errno to ENOSYS.
+3.22.  My program segfaults when I call fclose() on the FILE* returned
+       from setmntent().  Is this a glibc bug?
 
 4. Miscellaneous
 
@@ -310,10 +314,10 @@ Binutils 2.9.1.0.16 or later is also required.
   as much as 400MB).
 
 * plenty of time.  Compiling just the shared and static libraries for
-  i?86-linux takes approximately 1h on an i586@133, or 2.5h on
-  i486@66, or 4.5h on i486@33.  Multiply this by 1.5 or 2.0 if you
-  build profiling and/or the highly optimized version as well.  For
-  Hurd systems times are much higher.
+  i?86-linux takes approximately 1h on an AMD-K6@225MHz w/ 96MB of RAM,
+  45mins on a Celeron@400MHz w/ 128MB, and 55mins on a Alpha@533MHz w/ 256MB.
+  Multiply this by 1.5 or 2.0 if you build profiling and/or the highly
+  optimized version as well.  For Hurd systems times are much higher.
 
   You should avoid compiling in a NFS mounted filesystem.  This is
   very slow.
@@ -1530,6 +1534,33 @@ interface.  For compilation with the old API, <db_185.h> has to be included
 (and not <db.h>) and you can link with either `-ldb1' or `-ldb' for either
 of the db formats.
 
+
+3.21.  Autoconf's AC_CHECK_FUNC macro reports that a function exists, but
+       when I try to use it, it always returns -1 and sets errno to ENOSYS.
+
+{ZW} You are using a 2.0 Linux kernel, and the function you are trying to
+use is only implemented in 2.1/2.2.  Libc considers this to be a function
+which exists, because if you upgrade to a 2.2 kernel, it will work.  One
+such function is sigaltstack.
+
+Your program should check at runtime whether the function works, and
+implement a fallback.  Note that Autoconf cannot detect unimplemented
+functions in other systems' C libraries, so you need to do this anyway.
+
+
+3.22.  My program segfaults when I call fclose() on the FILE* returned
+       from setmntent().  Is this a glibc bug?
+
+{GK} No.  Don't do this.  Use endmntent(), that's what it's for.
+
+In general, you should use the correct deallocation routine.  For instance,
+if you open a file using fopen(), you should deallocate the FILE * using
+fclose(), not free(), even though the FILE * is also a pointer.
+
+In the case of setmntent(), it may appear to work in most cases, but it
+won't always work.  Unfortunately, for compatibility reasons, we can't
+change the return type of setmntent() to something other than FILE *.
+
 \f
 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 
 
diff --git a/FAQ.in b/FAQ.in
index 0b950c81c5c83f050e067d05b345e96b978b50e9..6a841a07a3581af4337a91c0edb1046dad9f4451 100644 (file)
--- a/FAQ.in
+++ b/FAQ.in
@@ -1326,6 +1326,19 @@ Your program should check at runtime whether the function works, and
 implement a fallback.  Note that Autoconf cannot detect unimplemented
 functions in other systems' C libraries, so you need to do this anyway.
 
+??     My program segfaults when I call fclose() on the FILE* returned
+       from setmntent().  Is this a glibc bug?
+
+{GK} No.  Don't do this.  Use endmntent(), that's what it's for.
+
+In general, you should use the correct deallocation routine.  For instance,
+if you open a file using fopen(), you should deallocate the FILE * using
+fclose(), not free(), even though the FILE * is also a pointer.
+
+In the case of setmntent(), it may appear to work in most cases, but it
+won't always work.  Unfortunately, for compatibility reasons, we can't
+change the return type of setmntent() to something other than FILE *.
+
 
 ? Miscellaneous
 
index bdae4ba1da24d11c293c924351f1b9b23e21d6a6..46f0b67567ef5099256f44c8666d69af55c8d999 100644 (file)
@@ -158,13 +158,12 @@ expand_dynamic_string_token (struct link_map *l, const char *s)
      resulting string is and then we copy it over.  Since this is now
      frequently executed operation we are looking here not for performance
      but rather for code size.  */
-  const char *st, *sf;
+  const char *sf;
   size_t cnt = 0;
   size_t origin_len;
   size_t total;
   char *result, *last_elem, *wp;
 
-  st = s;
   sf = strchr (s, '$');
   while (sf != NULL)
     {
@@ -182,8 +181,7 @@ expand_dynamic_string_token (struct link_map *l, const char *s)
                      && (len = 11) != 0))))
        ++cnt;
 
-      st = sf + len;
-      sf = strchr (st, '$');
+      sf = strchr (sf + len, '$');
     }
 
   /* If we do not have to replace anything simply copy the string.  */