Update.
authorUlrich Drepper <drepper@redhat.com>
Sun, 4 Aug 2002 20:54:20 +0000 (20:54 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sun, 4 Aug 2002 20:54:20 +0000 (20:54 +0000)
2002-08-04  Jakub Jelinek  <jakub@redhat.com>

* manual/debug.texi: Fix spelling to programmatically.
Reported by <hayastan132@hotmail.com>.

* include/libio.h: Add libc_hidden_proto for __uflow.
* include/stdio.h: Map fopen, fdopen, fclose, fputs, fsetpos, and
fgetpos to _IO_* names.
Add libc_hidden_proto for fileno, fwrite, fseek, fflush_unlocked,
fread_unlocked, fwrite_unlocked, fgets_unlocked, fputs_unlocked.
* include/wchar.h: Add libc_hidden_proto for fputws_unlocked,
putwc_unlocked, vswscanf.
* libio/iolibio.h: Add libc_hidden_proto for _IO_fputs.
* libio/fileno.c: Use <stdio.h> and libc_hidden_def.
* libio/fseek.c: Likewise.
* libio/fmemopen.c: Include "libioP.h".  Call _IO_fopencookie and
not fopencookie.
* libio/genops.c (__uflow): Add libc_hidden_def.
* libio/iofflush_u.c (fflush_unlocked): Likewise.
* libio/iofgets_u.c (fgets_unlocked): Likewise.
* libio/iofputs_u.c (fputs_unlocked): Likewise.
* libio/iofputws_u.c (fputws_unlocked): Likewise.
* libio/iofread_u.c (fread_unlocked): Likewise.
* libio/iofwrite_u.c (fwrite_unlocked): Likewise.
* libio/iovswscanf.c (vswscanf): Likewise.
* libio/putwc_u.c (putwc_unlocked): Likewise.
* libio/iofputs.c: Use libc_hidden_def instead of INTDEF.
* malloc/malloc.c: Redirect fwrite calls to _IO_fwrite.
* malloc/mtrace.c: Likewise.

* sunrpc/clnt_perr.c: Remove fputs macro.
* sunrpc/svc_simple.c: Likewise.
* sunrpc/svc_tcp.c: Likewise.
* sunrpc/svc_udp.c: Likewise.
* sunrpc/xdr_rec.c: Likewise.
* sunrpc/xdr_ref.c: Likewise.

* iconv/Makefile: Add CPPFLAGS definitions with -DNOT_in_libc for
iconv_prog, linereader, and charmap-dir.
* locale/Makefile: Likewise for locale and charmap-dir.
* malloc/Makefile: Likewise for memusagestat.
* nscd/Makefile: Likewise for nscd, nscd_conf, and dbg_log.
* sunrpc/Makefile: Likewise for rpc_main.
* sysdeps/unix/sysv/linux/Makefile: Likewise for lddlibc4.
* timezone/Makefile: Likewise for zic.

* stdio-common/perror.c: Avoid multiple calls to fileno_unlocked.

29 files changed:
ChangeLog
iconv/Makefile
include/libio.h
include/stdio.h
include/wchar.h
libio/fileno.c
libio/fmemopen.c
libio/fseek.c
libio/genops.c
libio/iofflush_u.c
libio/iofgets_u.c
libio/iofputs.c
libio/iofputs_u.c
libio/iofputws_u.c
libio/iofread_u.c
libio/iofwrite_u.c
libio/iolibio.h
libio/iovswscanf.c
libio/putwc_u.c
locale/Makefile
malloc/Makefile
malloc/malloc.c
malloc/mtrace.c
manual/debug.texi
nscd/Makefile
stdio-common/perror.c
sunrpc/Makefile
sysdeps/unix/sysv/linux/Makefile
timezone/Makefile

index 36f9d57..2b7c71f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,53 @@
+2002-08-04  Jakub Jelinek  <jakub@redhat.com>
+
+       * manual/debug.texi: Fix spelling to programmatically.
+       Reported by <hayastan132@hotmail.com>.
+
 2002-08-04  Ulrich Drepper  <drepper@redhat.com>
 
+       * include/libio.h: Add libc_hidden_proto for __uflow.
+       * include/stdio.h: Map fopen, fdopen, fclose, fputs, fsetpos, and
+       fgetpos to _IO_* names.
+       Add libc_hidden_proto for fileno, fwrite, fseek, fflush_unlocked,
+       fread_unlocked, fwrite_unlocked, fgets_unlocked, fputs_unlocked.
+       * include/wchar.h: Add libc_hidden_proto for fputws_unlocked,
+       putwc_unlocked, vswscanf.
+       * libio/iolibio.h: Add libc_hidden_proto for _IO_fputs.
+       * libio/fileno.c: Use <stdio.h> and libc_hidden_def.
+       * libio/fseek.c: Likewise.
+       * libio/fmemopen.c: Include "libioP.h".  Call _IO_fopencookie and
+       not fopencookie.
+       * libio/genops.c (__uflow): Add libc_hidden_def.
+       * libio/iofflush_u.c (fflush_unlocked): Likewise.
+       * libio/iofgets_u.c (fgets_unlocked): Likewise.
+       * libio/iofputs_u.c (fputs_unlocked): Likewise.
+       * libio/iofputws_u.c (fputws_unlocked): Likewise.
+       * libio/iofread_u.c (fread_unlocked): Likewise.
+       * libio/iofwrite_u.c (fwrite_unlocked): Likewise.
+       * libio/iovswscanf.c (vswscanf): Likewise.
+       * libio/putwc_u.c (putwc_unlocked): Likewise.
+       * libio/iofputs.c: Use libc_hidden_def instead of INTDEF.
+       * malloc/malloc.c: Redirect fwrite calls to _IO_fwrite.
+       * malloc/mtrace.c: Likewise.
+
+       * sunrpc/clnt_perr.c: Remove fputs macro.
+       * sunrpc/svc_simple.c: Likewise.
+       * sunrpc/svc_tcp.c: Likewise.
+       * sunrpc/svc_udp.c: Likewise.
+       * sunrpc/xdr_rec.c: Likewise.
+       * sunrpc/xdr_ref.c: Likewise.
+
+       * iconv/Makefile: Add CPPFLAGS definitions with -DNOT_in_libc for
+       iconv_prog, linereader, and charmap-dir.
+       * locale/Makefile: Likewise for locale and charmap-dir.
+       * malloc/Makefile: Likewise for memusagestat.
+       * nscd/Makefile: Likewise for nscd, nscd_conf, and dbg_log.
+       * sunrpc/Makefile: Likewise for rpc_main.
+       * sysdeps/unix/sysv/linux/Makefile: Likewise for lddlibc4.
+       * timezone/Makefile: Likewise for zic.
+
+       * stdio-common/perror.c: Avoid multiple calls to fileno_unlocked.
+
        * elf/dl-addr.c (_dl_addr): Add libc_hidden_def.
        * elf/dl-close.c (_dl_close): Add libc_hidden_def.
        * elf/dl-open.c (_dl_open): Add libc_hidden_def.
index eb8ffac..15846c2 100644 (file)
@@ -63,10 +63,13 @@ CFLAGS-gconv_cache.c += -DGCONV_DIR='"$(gconvdir)"'
 CFLAGS-gconv_conf.c = -DGCONV_PATH='"$(gconvdir)"'
 CFLAGS-iconvconfig.c = -DGCONV_PATH='"$(gconvdir)"' -DGCONV_DIR='"$(gconvdir)"'
 
+CPPFLAGS-iconv_prog = -DNOT_IN_libc
 CPPFLAGS-iconv_charmap = -DNOT_IN_libc
 CPPFLAGS-iconvconfig = -DNOT_IN_libc
+CPPFLAGS-linereader = -DNOT_IN_libc
 CPPFLAGS-strtab = -DNOT_IN_libc
 CPPFLAGS-charmap = -DNOT_IN_libc
+CPPFLAGS-charmap-dir = -DNOT_IN_libc
 
 include ../Rules
 
index a3a6518..ee727e2 100644 (file)
@@ -5,6 +5,7 @@
 
 libc_hidden_proto (__overflow)
 libc_hidden_proto (__underflow)
+libc_hidden_proto (__uflow)
 libc_hidden_proto (__woverflow)
 libc_hidden_proto (__wunderflow)
 libc_hidden_proto (__wuflow)
index 4f144d3..e58c033 100644 (file)
@@ -62,9 +62,7 @@ extern void __funlockfile (FILE *__stream);
 extern int __ftrylockfile (FILE *__stream);
 
 extern int __getc_unlocked (FILE *__fp);
-#  ifdef USE_IN_LIBIO
 extern wint_t __getwc_unlocked (FILE *__fp);
-#  endif
 
 
 extern __const char *__const _sys_errlist_internal[] attribute_hidden;
@@ -76,8 +74,31 @@ extern int __asprintf_internal (char **__restrict __ptr,
 #  ifndef NOT_IN_libc
 #    define __asprintf(ptr, fmt, args...) \
   INTUSE(__asprintf) (ptr, fmt, ##args)
+
+extern _IO_FILE *_IO_new_fopen __P((const char*, const char*));
+#   define fopen(fname, mode) _IO_new_fopen (fname, mode)
+extern _IO_FILE *_IO_new_fdopen __P((int, const char*));
+#   define fdopen(fd, mode) _IO_new_fdopen (fd, mode)
+extern int _IO_new_fclose __P((_IO_FILE*));
+#   define fclose(fp) _IO_new_fclose (fp)
+extern int _IO_fputs __P((const char*, _IO_FILE*));
+libc_hidden_proto (_IO_fputs)
+#   define fputs(str, fp) _IO_fputs (str, fp)
+extern int _IO_new_fsetpos __P ((_IO_FILE *, const _IO_fpos_t *));
+#   define fsetpos(fp, posp) _IO_new_fsetpos (fp, posp)
+extern int _IO_new_fgetpos __P ((_IO_FILE *, _IO_fpos_t *));
+#   define fgetpos(fp, posp) _IO_new_fgetpos (fp, posp)
 #  endif
 
+libc_hidden_proto (fileno)
+libc_hidden_proto (fwrite)
+libc_hidden_proto (fseek)
+libc_hidden_proto (fflush_unlocked)
+libc_hidden_proto (fread_unlocked)
+libc_hidden_proto (fwrite_unlocked)
+libc_hidden_proto (fgets_unlocked)
+libc_hidden_proto (fputs_unlocked)
+
 # endif
 
 #endif
index 8395392..cb63ed9 100644 (file)
@@ -14,6 +14,11 @@ libc_hidden_proto (__wcstoull_internal)
 libc_hidden_proto (__wcscasecmp_l)
 libc_hidden_proto (__wcsncasecmp_l)
 
+libc_hidden_proto (fputws_unlocked)
+libc_hidden_proto (putwc_unlocked)
+
+libc_hidden_proto (vswscanf)
+
 
 /* Now define the internal interfaces.  */
 extern int __wcscasecmp (__const wchar_t *__s1, __const wchar_t *__s2)
index 3b24cd0..036ddb1 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1996, 1997, 2002 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
@@ -26,7 +26,7 @@
    in files containing the exception.  */
 
 #include "libioP.h"
-#include "stdio.h"
+#include <stdio.h>
 
 int
 fileno (fp)
@@ -42,6 +42,7 @@ fileno (fp)
 
   return _IO_fileno (fp);
 }
+libc_hidden_def (fileno)
 
 #ifdef _IO_MTSAFE_IO
 #ifdef weak_alias
index 3afc049..a1c75f2 100644 (file)
@@ -1,5 +1,5 @@
 /* Fmemopen implementation.
-   Copyright (C) 2000 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by  Hanno Mueller, kontakt@hanno.de, 2000.
 
@@ -75,6 +75,8 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sys/types.h>
+#include "libioP.h"
+
 
 typedef struct fmemopen_cookie_struct fmemopen_cookie_t;
 struct fmemopen_cookie_struct
@@ -237,5 +239,5 @@ fmemopen (void *buf, size_t len, const char *mode)
   iof.seek = fmemopen_seek;
   iof.close = fmemopen_close;
 
-  return fopencookie (c, mode, iof);
+  return _IO_fopencookie (c, mode, iof);
 }
index ccb2238..831a4d4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1993,1995,1996,1997,1998,2002 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
@@ -26,7 +26,7 @@
    in files containing the exception.  */
 
 #include "libioP.h"
-#include "stdio.h"
+#include <stdio.h>
 
 int
 fseek (fp, offset, whence)
@@ -43,3 +43,4 @@ fseek (fp, offset, whence)
   _IO_cleanup_region_end (0);
   return result;
 }
+libc_hidden_def (fseek)
index eb03664..115c7df 100644 (file)
@@ -383,11 +383,12 @@ __uflow (fp)
     INTUSE(_IO_free_backup_area) (fp);
   return _IO_UFLOW (fp);
 }
+libc_hidden_def (__uflow)
 
 void
 _IO_setb (f, b, eb, a)
      _IO_FILE *f;
-      char *b;
+     char *b;
      char *eb;
      int a;
 {
index 4603ec3..d604ebf 100644 (file)
@@ -40,3 +40,4 @@ fflush_unlocked (fp)
       return _IO_SYNC (fp) ? EOF : 0;
     }
 }
+libc_hidden_def (fflush_unlocked)
index bf5bb09..ded2a7c 100644 (file)
@@ -59,3 +59,4 @@ fgets_unlocked (buf, n, fp)
   fp->_IO_file_flags |= old_error;
   return result;
 }
+libc_hidden_def (fgets_unlocked)
index 0835e84..f2fd21d 100644 (file)
@@ -45,7 +45,7 @@ _IO_fputs (str, fp)
   _IO_cleanup_region_end (0);
   return result;
 }
-INTDEF(_IO_fputs)
+libc_hidden_def (_IO_fputs)
 
 #ifdef weak_alias
 weak_alias (_IO_fputs, fputs)
index 02427f8..475e533 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1993,1996,1997,1998,1999,2002 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
@@ -41,3 +41,4 @@ fputs_unlocked (str, fp)
     result = 1;
   return result;
 }
+libc_hidden_def (fputs_unlocked)
index bbfef09..a73f6b5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993,1996,1997,1998,1999,2000 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1996-2000, 2002 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
@@ -42,3 +42,4 @@ fputws_unlocked (str, fp)
     result = 1;
   return result;
 }
+libc_hidden_def (fputws_unlocked)
index 527af10..98c7ffd 100644 (file)
@@ -45,3 +45,4 @@ fread_unlocked (buf, size, count, fp)
   bytes_read = INTUSE(_IO_sgetn) (fp, (char *) buf, bytes_requested);
   return bytes_requested == bytes_read ? count : bytes_read / size;
 }
+libc_hidden_def (fread_unlocked)
index e4e9733..738cc5b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1996-2000, 2002 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
@@ -51,3 +51,4 @@ fwrite_unlocked (buf, size, count, fp)
 
   return written / size;
 }
+libc_hidden_def (fwrite_unlocked)
index be04604..80fb527 100644 (file)
@@ -25,6 +25,7 @@ extern _IO_FILE *__fopen_internal __P((const char*, const char*, int));
 extern _IO_FILE *__fopen_maybe_mmap __P((_IO_FILE *));
 extern int _IO_fprintf __P((_IO_FILE*, const char*, ...));
 extern int _IO_fputs __P((const char*, _IO_FILE*));
+libc_hidden_proto (_IO_fputs)
 extern int _IO_fsetpos __P((_IO_FILE*, const _IO_fpos_t *));
 extern int _IO_fsetpos64 __P((_IO_FILE*, const _IO_fpos64_t *));
 extern long int _IO_ftell __P((_IO_FILE*));
index dd7dbf8..1bbddd4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997-2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1997-2000, 2001, 2002 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
@@ -47,3 +47,4 @@ vswscanf (string, format, args)
   ret = _IO_vfwscanf ((_IO_FILE *) &sf._sbf, format, args, NULL);
   return ret;
 }
+libc_hidden_def (vswscanf)
index 95db001..b76a313 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1995,1996,1997,1999,2002 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
@@ -27,3 +27,4 @@ putwc_unlocked (wc, fp)
   CHECK_FILE (fp, WEOF);
   return _IO_putc_unlocked (wc, fp);
 }
+libc_hidden_def (putwc_unlocked)
index ebcf7bd..d3c62ad 100644 (file)
@@ -99,6 +99,7 @@ CFLAGS-charmap.c = -Wno-write-strings -Wno-char-subscripts
 CFLAGS-locfile.c = -Wno-write-strings -Wno-char-subscripts
 CFLAGS-charmap-dir.c = -Wno-write-strings
 
+CPPFLAGS-locale = -DNOT_IN_libc
 CPPFLAGS-localedef = -DNOT_IN_libc
 CPPFLAGS-ld-ctype = -DNOT_IN_libc
 CPPFLAGS-ld-time = -DNOT_IN_libc
@@ -109,6 +110,7 @@ CPPFLAGS-ld-identification = -DNOT_IN_libc
 CPPFLAGS-charmap = -DNOT_IN_libc
 CPPFLAGS-locarchive = -DNOT_IN_libc
 CPPFLAGS-linereader = -DNOT_IN_libc
+CPPFLAGS-charmap-dir = -DNOT_IN_libc
 
 # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
 # This ensures they will load libc.so for needed symbols if loaded by
index 226ed99..bb7d15d 100644 (file)
@@ -56,6 +56,8 @@ aux := set-freeres
 
 include ../Makeconfig
 
+CPPFLAGS-memusagestat = -DNOT_IN_libc
+
 # The Perl script to analyze the output of the mtrace functions.
 ifneq ($(PERL),no)
 install-bin-script = mtrace
index 08b8e86..6855149 100644 (file)
@@ -490,6 +490,8 @@ Void_t *(*__morecore)(ptrdiff_t) = __default_morecore;
 
 #ifndef _LIBC
 #define __builtin_expect(expr, val)    (expr)
+
+#define fwrite(buf, size, count, fp) _IO_fwrite (buf, size, count, fp)
 #endif
 
 /*
index 171eb5a..52347ea 100644 (file)
@@ -42,6 +42,7 @@
 # include <libio/iolibio.h>
 # define fopen(f, n) _IO_fopen64 (f, n)
 # define setvbuf(s, b, f, l) INTUSE(_IO_setvbuf) (s, b, f, l)
+# define fwrite(buf, size, count, fp) _IO_fwrite (buf, size, count, fp)
 #endif
 
 #ifndef attribute_hidden
index fe5244a..a6ec0c4 100644 (file)
@@ -5,7 +5,7 @@
 
 Applications are usually debugged using dedicated debugger programs.
 But sometimes this is not possible and, in any case, it is useful to
-provide the developer with as much information as possible at the time 
+provide the developer with as much information as possible at the time
 the problems are experienced.  For this reason a few functions are
 provided which a program can use to help the developer more easily
 locate the problem.
@@ -26,7 +26,7 @@ locate the problem.
 A @dfn{backtrace} is a list of the function calls that are currently
 active in a thread.  The usual way to inspect a backtrace of a program
 is to use an external debugger such as gdb.  However, sometimes it is
-useful to obtain a backtrace programatically from within a program,
+useful to obtain a backtrace programmatically from within a program,
 e.g., for the purposes of logging or diagnostics.
 
 The header file @file{execinfo.h} declares three functions that obtain
index a3cbe7c..434cf4d 100644 (file)
@@ -53,6 +53,9 @@ distribute := nscd.h nscd-client.h dbg_log.h \
 
 include ../Rules
 
+CPPFLAGS-nscd = -DNOT_IN_libc
+CPPFLAGS-nscd_conf = -DNOT_IN_libc
+CPPFLAGS-dbg_log = -DNOT_IN_libc
 CPPFLAGS-connections = -DNOT_IN_libc
 CPPFLAGS-hstcache = -DNOT_IN_libc
 
index 077eed5..6a4e349 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1993,1997,1998,2000,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1993,1997,1998,2000-2002 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
@@ -65,8 +65,8 @@ perror (const char *s)
      oriented yet?  In this case we'll create a new stream which is
      using the same underlying file descriptor.  */
   if (__builtin_expect (_IO_fwide (stderr, 0) != 0, 1)
-      || fileno_unlocked (stderr) == -1
-      || (fd = __dup (fileno_unlocked (stderr))) == -1
+      || (fd = fileno (stderr)) == -1
+      || (fd = __dup (fd)) == -1
       || (fp = fdopen (fd, "w+")) == NULL)
     {
       if (__builtin_expect (fd != -1, 0))
index dd21ddf..6f978e6 100644 (file)
@@ -121,6 +121,7 @@ ifeq (yes,$(have_doors))
 CPPFLAGS-key_call.c += -DHAVE_DOORS=1
 endif
 CPPFLAGS += -D_RPC_THREAD_SAFE_
+CPPFLAGS-rpc_main += -DNOT_IN_libc
 
 include ../Rules
 
index 68e9a1e..9a2bbc4 100644 (file)
@@ -110,4 +110,6 @@ endif
 
 ifeq ($(subdir),elf)
 sysdep-rtld-routines += dl-brk dl-sbrk
+
+CPPFLAGS-lddlibc4 += -DNOT_IN_libc
 endif
index 41a9c1d..cf2c7d7 100644 (file)
@@ -48,6 +48,8 @@ all: # Make this the default target; it will be defined in Rules.
 
 include ../Makeconfig  # Get objpfx defined so we can use it below.
 
+CPPFLAGS-zic = -DNOT_IN_libc
+
 # z.* use this variable.
 define nl