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.
This commit is contained in:
Ulrich Drepper 2002-08-04 20:54:20 +00:00
parent a20d8dbee7
commit 3ba06713f8
29 changed files with 127 additions and 20 deletions

View File

@ -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.

View 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

View 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)

View 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

View 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)

View 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

View 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);
}

View 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)

View 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;
{

View File

@ -40,3 +40,4 @@ fflush_unlocked (fp)
return _IO_SYNC (fp) ? EOF : 0;
}
}
libc_hidden_def (fflush_unlocked)

View File

@ -59,3 +59,4 @@ fgets_unlocked (buf, n, fp)
fp->_IO_file_flags |= old_error;
return result;
}
libc_hidden_def (fgets_unlocked)

View 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)

View 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)

View 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)

View 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)

View 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)

View 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*));

View 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)

View 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)

View 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

View 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

View 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
/*

View 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

View 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

View 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

View 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))

View 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

View File

@ -110,4 +110,6 @@ endif
ifeq ($(subdir),elf)
sysdep-rtld-routines += dl-brk dl-sbrk
CPPFLAGS-lddlibc4 += -DNOT_IN_libc
endif

View 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