2003-09-12  Ulrich Drepper  <drepper@redhat.com>

	* grp/Makefile (CFLAGS-getgrgid_r.c, CFLAGS-getgrnam_r.c,
	CFLAGS-fgetgrent.c, CFLAGS-fgetgrent_r.c, CFLAGS-putgrent.c,
	CFLAGS-initgroups.c, CFLAGS-getgrgid.c): Add -fexceptions.
	* inet/Makefile (CFLAGS-either_ntoh.c, CFLAGS-either_hton.c,
	CFLAGS-getnetgrent.c, CFLAGS-getnetgrent_r.c): Likewise.
	* io/Makefile (CFLAGS-posix_fallocate.c, CFLAGS-posix_fallocate64.c):
	Likewise.
	* misc/Makefile (CFLAGS-err.c): Likewise.
	* posix/Makefile (CFLAGS-getaddrinfo.c, CFLAGS-spawn.c,
	CFLAGS-spawnp.c, CFLAGS-spawni.c, CFLAGS-pause.c, CFLAGS-glob.c,
	CFLAGS-glob64.c): Likewise.
	* pwd/Makefile (CFLAGS-getpw.c): Likewise.
	* shadow/Makefile (CFLAGS-fgetspent.c, CFLAGS-fgetspent_r.c,
	CFLAGS-putspent.c, CFLAGS-getspnam.c, CFLAGS-getspnam_r.c): Likewise.
	* stdio-common/Makefile (CFLAGS-cuserid.c): Likewise.
	* sunrpc/Makefile (CFLAGS-openchild.c): Likewise.

	* stdlib/Makefile (CFLAGS-mkstemp.c): Remove definition.

	* libio/stdio.h: Remove __THROW from cuserid prototype.

	* locale/loadarchive.c: Use only non-cancelable interfaces.
	* resolv/herror.c (herror): Likewise.

	* malloc/hooks.c: Before using IO stream mark stream so it uses
	only non-cancelable interfaces.
	* malloc/malloc.c: Likewise.
	* posix/getopt.c: Likewise.


2003-09-11  Jakub Jelinek  <jakub@redhat.com>

	* Makerules (LDFLAGS-c.so): Remove -u __register_frame.

2003-09-12  Ulrich Drepper  <drepper@redhat.com>

	* stdio-common/stdio_ext.h: Mark most functions with __THROW.

	* misc/err.h: Remove __THROW from all prototypes.

	* posix/getopt.h (__THROW): Define if not already defined.  Add
	__THROW to the getopt functions.

2003-09-11  Ulrich Drepper  <drepper@redhat.com>

	* io/Makefile (CFLAGS-lockf.c): Add -fexceptions.
	(CFLAGS-fts.c): Likewise.
	* io/fcntl.h: Remove __THROW from lockf prototypes.
	* io/fts.h: Remove most __THROW.
This commit is contained in:
Ulrich Drepper 2003-09-12 22:37:19 +00:00
parent 6fee336275
commit 8dab36a119
23 changed files with 287 additions and 51 deletions

View File

@ -1,3 +1,55 @@
2003-09-12 Ulrich Drepper <drepper@redhat.com>
* grp/Makefile (CFLAGS-getgrgid_r.c, CFLAGS-getgrnam_r.c,
CFLAGS-fgetgrent.c, CFLAGS-fgetgrent_r.c, CFLAGS-putgrent.c,
CFLAGS-initgroups.c, CFLAGS-getgrgid.c): Add -fexceptions.
* inet/Makefile (CFLAGS-either_ntoh.c, CFLAGS-either_hton.c,
CFLAGS-getnetgrent.c, CFLAGS-getnetgrent_r.c): Likewise.
* io/Makefile (CFLAGS-posix_fallocate.c, CFLAGS-posix_fallocate64.c):
Likewise.
* misc/Makefile (CFLAGS-err.c): Likewise.
* posix/Makefile (CFLAGS-getaddrinfo.c, CFLAGS-spawn.c,
CFLAGS-spawnp.c, CFLAGS-spawni.c, CFLAGS-pause.c, CFLAGS-glob.c,
CFLAGS-glob64.c): Likewise.
* pwd/Makefile (CFLAGS-getpw.c): Likewise.
* shadow/Makefile (CFLAGS-fgetspent.c, CFLAGS-fgetspent_r.c,
CFLAGS-putspent.c, CFLAGS-getspnam.c, CFLAGS-getspnam_r.c): Likewise.
* stdio-common/Makefile (CFLAGS-cuserid.c): Likewise.
* sunrpc/Makefile (CFLAGS-openchild.c): Likewise.
* stdlib/Makefile (CFLAGS-mkstemp.c): Remove definition.
* libio/stdio.h: Remove __THROW from cuserid prototype.
* locale/loadarchive.c: Use only non-cancelable interfaces.
* resolv/herror.c (herror): Likewise.
* malloc/hooks.c: Before using IO stream mark stream so it uses
only non-cancelable interfaces.
* malloc/malloc.c: Likewise.
* posix/getopt.c: Likewise.
2003-09-11 Jakub Jelinek <jakub@redhat.com>
* Makerules (LDFLAGS-c.so): Remove -u __register_frame.
2003-09-12 Ulrich Drepper <drepper@redhat.com>
* stdio-common/stdio_ext.h: Mark most functions with __THROW.
* misc/err.h: Remove __THROW from all prototypes.
* posix/getopt.h (__THROW): Define if not already defined. Add
__THROW to the getopt functions.
2003-09-11 Ulrich Drepper <drepper@redhat.com>
* io/Makefile (CFLAGS-lockf.c): Add -fexceptions.
(CFLAGS-fts.c): Likewise.
* io/fcntl.h: Remove __THROW from lockf prototypes.
* io/fts.h: Remove most __THROW.
2003-09-11 H.J. Lu <hongjiu.lu@intel.com>
* elf/tls-macros.h (TLS_IE): Add a stop bit for ia64.

View File

@ -572,8 +572,6 @@ LDFLAGS-c.so = -nostdlib -nostartfiles
LDLIBS-c.so += $(gnulib)
# Give libc.so an entry point and make it directly runnable itself.
LDFLAGS-c.so += -e __libc_main
# Force the backward compatibility EH functions to be linked.
LDFLAGS-c.so += -u __register_frame
# Pre-link the objects of libc_pic.a so that we can locally resolve
# COMMON symbols before we link against ld.so. This is because ld.so
# contains some of libc_pic.a already, which will prevent the COMMONs

View File

@ -47,10 +47,15 @@ endif
ifeq ($(have-thread-library),yes)
CFLAGS-getgrgid_r.c = -DUSE_NSCD=1
CFLAGS-getgrnam_r.c = -DUSE_NSCD=1
CFLAGS-getgrgid_r.c = -DUSE_NSCD=1 -fexceptions
CFLAGS-getgrnam_r.c = -DUSE_NSCD=1 -fexceptions
CFLAGS-getgrent_r.c = -fexceptions
CFLAGS-getgrent.c = -fexceptions
CFLAGS-fgetgrent.c = -fexceptions
CFLAGS-fgetgrent_r.c = -fexceptions
CFLAGS-putgrent.c = -fexceptions
CFLAGS-initgroups.c = -fexceptions
CFLAGS-getgrgid.c = -fexceptions
endif

View File

@ -79,6 +79,10 @@ CFLAGS-getservent_r.c = -fexceptions
CFLAGS-getservent.c = -fexceptions
CFLAGS-getprtent_r.c = -fexceptions
CFLAGS-getprtent.c = -fexceptions
CFLAGS-either_ntoh.c = -fexceptions
CFLAGS-either_hton.c = -fexceptions
CFLAGS-getnetgrent.c = -fexceptions
CFLAGS-getnetgrent_r.c = -fexceptions
endif

View File

@ -71,6 +71,10 @@ CFLAGS-statfs.c = -fexceptions
CFLAGS-fstatfs.c = -fexceptions
CFLAGS-statvfs.c = -fexceptions
CFLAGS-fstatvfs.c = -fexceptions
CFLAGS-fts.c = -fexceptions
CFLAGS-lockf.c = -fexceptions
CFLAGS-posix_fallocate.c = -fexceptions
CFLAGS-posix_fallocate64.c = -fexceptions
CFLAGS-test-stat.c = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
CFLAGS-test-lfs.c = -D_LARGEFILE64_SOURCE

View File

@ -116,17 +116,16 @@ extern int creat64 (__const char *__file, __mode_t __mode);
# define F_TEST 3 /* Test a region for other processes locks. */
# ifndef __USE_FILE_OFFSET64
extern int lockf (int __fd, int __cmd, __off_t __len) __THROW;
extern int lockf (int __fd, int __cmd, __off_t __len);
# else
# ifdef __REDIRECT
extern int __REDIRECT (lockf, (int __fd, int __cmd, __off64_t __len) __THROW,
lockf64);
extern int __REDIRECT (lockf, (int __fd, int __cmd, __off64_t __len), lockf64);
# else
# define lockf lockf64
# endif
# endif
# ifdef __USE_LARGEFILE64
extern int lockf64 (int __fd, int __cmd, __off64_t __len) __THROW;
extern int lockf64 (int __fd, int __cmd, __off64_t __len);
# endif
#endif

View File

@ -120,11 +120,11 @@ typedef struct _ftsent {
} FTSENT;
__BEGIN_DECLS
FTSENT *fts_children (FTS *, int) __THROW;
int fts_close (FTS *) __THROW;
FTSENT *fts_children (FTS *, int);
int fts_close (FTS *);
FTS *fts_open (char * const *, int,
int (*)(const FTSENT **, const FTSENT **)) __THROW;
FTSENT *fts_read (FTS *) __THROW;
int (*)(const FTSENT **, const FTSENT **));
FTSENT *fts_read (FTS *);
int fts_set (FTS *, FTSENT *, int) __THROW;
__END_DECLS

View File

@ -782,7 +782,7 @@ extern char *ctermid (char *__s) __THROW;
#ifdef __USE_XOPEN
/* Return the name of the current user. */
extern char *cuserid (char *__s) __THROW;
extern char *cuserid (char *__s);
#endif /* Use X/Open, but not issue 6. */

View File

@ -1,5 +1,5 @@
/* Code to load locale data from the locale archive file.
Copyright (C) 2002 Free Software Foundation, Inc.
Copyright (C) 2002, 2003 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
@ -32,6 +32,7 @@
#include "localeinfo.h"
#include "locarchive.h"
#include <not-cancel.h>
/* Define the hash function. We define the function as static inline. */
#define compute_hashval static inline compute_hashval
@ -202,7 +203,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
archmapped = &headmap;
/* The archive has never been opened. */
fd = __open64 (archfname, O_RDONLY);
fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
if (fd < 0)
/* Cannot open the archive, for whatever reason. */
return NULL;
@ -212,7 +213,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
/* stat failed, very strange. */
close_and_out:
if (fd >= 0)
__close (fd);
close_not_cancel_no_status (fd);
return NULL;
}
@ -252,7 +253,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
{
/* We've mapped the whole file already, so we can be
sure we won't need this file descriptor later. */
__close (fd);
close_not_cancel_no_status (fd);
fd = -1;
}
@ -393,7 +394,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
if (fd == -1)
{
struct stat64 st;
fd = __open64 (archfname, O_RDONLY);
fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
if (fd == -1)
/* Cannot open the archive, for whatever reason. */
return NULL;
@ -446,7 +447,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
/* We don't need the file descriptor any longer. */
if (fd >= 0)
__close (fd);
close_not_cancel_no_status (fd);
fd = -1;
/* We succeeded in mapping all the necessary regions of the archive.

View File

@ -106,7 +106,18 @@ __malloc_check_init()
__realloc_hook = realloc_check;
__memalign_hook = memalign_check;
if(check_action & 1)
fprintf(stderr, "malloc: using debugging hooks\n");
{
#ifdef _LIBC
_IO_flockfile (stderr);
int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
#endif
fprintf(stderr, "malloc: using debugging hooks\n");
#ifdef _LIBC
((_IO_FILE *) stderr)->_flags2 |= old_flags2;
_IO_funlockfile (stderr);
#endif
}
}
/* A simple, standard set of debugging hooks. Overhead is `only' one
@ -224,7 +235,18 @@ top_check()
t == initial_top(&main_arena)) return 0;
if(check_action & 1)
fprintf(stderr, "malloc: top chunk is corrupt\n");
{
#ifdef _LIBC
_IO_flockfile (stderr);
int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
#endif
fprintf(stderr, "malloc: top chunk is corrupt\n");
#ifdef _LIBC
((_IO_FILE *) stderr)->_flags2 |= old_flags2;
_IO_funlockfile (stderr);
#endif
}
if(check_action & 2)
abort();
@ -278,7 +300,18 @@ free_check(mem, caller) Void_t* mem; const Void_t *caller;
if(!p) {
(void)mutex_unlock(&main_arena.mutex);
if(check_action & 1)
fprintf(stderr, "free(): invalid pointer %p!\n", mem);
{
#ifdef _LIBC
_IO_flockfile (stderr);
int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
#endif
fprintf(stderr, "free(): invalid pointer %p!\n", mem);
#ifdef _LIBC
((_IO_FILE *) stderr)->_flags2 |= old_flags2;
_IO_funlockfile (stderr);
#endif
}
if(check_action & 2)
abort();
return;
@ -315,7 +348,18 @@ realloc_check(oldmem, bytes, caller)
(void)mutex_unlock(&main_arena.mutex);
if(!oldp) {
if(check_action & 1)
fprintf(stderr, "realloc(): invalid pointer %p!\n", oldmem);
{
#ifdef _LIBC
_IO_flockfile (stderr);
int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
#endif
fprintf(stderr, "realloc(): invalid pointer %p!\n", oldmem);
#ifdef _LIBC
((_IO_FILE *) stderr)->_flags2 |= old_flags2;
_IO_funlockfile (stderr);
#endif
}
if(check_action & 2)
abort();
return malloc_check(bytes, NULL);

View File

@ -4139,7 +4139,18 @@ _int_free(mstate av, Void_t* mem)
if (__builtin_expect ((uintptr_t) p > (uintptr_t) -size, 0))
{
if (check_action & 1)
fprintf (stderr, "free(): invalid pointer %p!\n", mem);
{
#ifdef _LIBC
_IO_flockfile (stderr);
int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
#endif
fprintf (stderr, "free(): invalid pointer %p!\n", mem);
#ifdef _LIBC
((_IO_FILE *) stderr)->_flags2 |= old_flags2;
_IO_funlockfile (stderr);
#endif
}
if (check_action & 2)
abort ();
return;
@ -5108,6 +5119,11 @@ void mSTATs()
if(__malloc_initialized < 0)
ptmalloc_init ();
#ifdef _LIBC
_IO_flockfile (stderr);
int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
#endif
for (i=0, ar_ptr = &main_arena;; i++) {
(void)mutex_lock(&ar_ptr->mutex);
mi = mALLINFo(ar_ptr);
@ -5152,6 +5168,10 @@ void mSTATs()
fprintf(stderr, "locked total = %10ld\n",
stat_lock_direct + stat_lock_loop + stat_lock_wait);
#endif
#ifdef _LIBC
((_IO_FILE *) stderr)->_flags2 |= old_flags2;
_IO_funlockfile (stderr);
#endif
}

View File

@ -88,6 +88,7 @@ CFLAGS-mkstemp.c = -fexceptions
CFLAGS-mkstemp64.c = -fexceptions
CFLAGS-getsysstats.c = -fexceptions
CFLAGS-getusershell.c = -fexceptions
CFLAGS-err.c = -fexceptions
include ../Rules

View File

@ -1,5 +1,5 @@
/* 4.4BSD utility functions for error messages.
Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
Copyright (C) 1995,1996,1997,1998,1999,2003 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
@ -33,25 +33,25 @@ __BEGIN_DECLS
/* Print "program: ", FORMAT, ": ", the standard error string for errno,
and a newline, on stderr. */
extern void warn (__const char *__format, ...)
__THROW __attribute__ ((__format__ (__printf__, 1, 2)));
__attribute__ ((__format__ (__printf__, 1, 2)));
extern void vwarn (__const char *__format, __gnuc_va_list)
__THROW __attribute__ ((__format__ (__printf__, 1, 0)));
__attribute__ ((__format__ (__printf__, 1, 0)));
/* Likewise, but without ": " and the standard error string. */
extern void warnx (__const char *__format, ...)
__THROW __attribute__ ((__format__ (__printf__, 1, 2)));
__attribute__ ((__format__ (__printf__, 1, 2)));
extern void vwarnx (__const char *__format, __gnuc_va_list)
__THROW __attribute__ ((__format__ (__printf__, 1, 0)));
__attribute__ ((__format__ (__printf__, 1, 0)));
/* Likewise, and then exit with STATUS. */
extern void err (int __status, __const char *__format, ...)
__THROW __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
__attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
extern void verr (int __status, __const char *__format, __gnuc_va_list)
__THROW __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0)));
__attribute__ ((__noreturn__, __format__ (__printf__, 2, 0)));
extern void errx (int __status, __const char *__format, ...)
__THROW __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
__attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
extern void verrx (int __status, __const char *, __gnuc_va_list)
__THROW __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0)));
__attribute__ ((__noreturn__, __format__ (__printf__, 2, 0)));
__END_DECLS

View File

@ -118,7 +118,7 @@ endif
endif
CFLAGS-regex.c = -Wno-strict-prototypes
CFLAGS-getaddrinfo.c = -DRESOLVER
CFLAGS-getaddrinfo.c = -DRESOLVER -fexceptions
CFLAGS-pread.c = -fexceptions -fasynchronous-unwind-tables
CFLAGS-pread64.c = -fexceptions -fasynchronous-unwind-tables
CFLAGS-pwrite.c = -fexceptions -fasynchronous-unwind-tables
@ -132,6 +132,12 @@ CFLAGS-wordexp.c = -fexceptions
CFLAGS-sysconf.c = -fexceptions
CFLAGS-pathconf.c = -fexceptions
CFLAGS-fpathconf.c = -fexceptions
CFLAGS-spawn.c = -fexceptions
CFLAGS-spawnp.c = -fexceptions
CFLAGS-spawni.c = -fexceptions
CFLAGS-pause.c = -fexceptions
CFLAGS-glob.c = -fexceptions
CFLAGS-glob64.c = -fexceptions
tstgetopt-ARGS = -a -b -cfoobar --required foobar --optional=bazbug \
--none random --col --color --colour

View File

@ -2,7 +2,7 @@
NOTE: getopt is now part of the C library, so if you don't know what
"Keep this file name-space clean" means, talk to drepper@gnu.org
before changing it!
Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001,2002
Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001,2002,2003
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@ -692,12 +692,19 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
if (__asprintf (&buf, _("%s: option `%s' is ambiguous\n"),
argv[0], argv[optind]) >= 0)
{
_IO_flockfile (stderr);
int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s", buf);
else
fputs (buf, stderr);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
free (buf);
}
#else
@ -761,11 +768,20 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
#if defined _LIBC && defined USE_IN_LIBIO
if (n >= 0)
{
_IO_flockfile (stderr);
int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2
|= _IO_FLAGS2_NOTCANCEL;
if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s", buf);
else
fputs (buf, stderr);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
free (buf);
}
#endif
@ -792,11 +808,20 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
%s: option `%s' requires an argument\n"),
argv[0], argv[optind - 1]) >= 0)
{
_IO_flockfile (stderr);
int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2
|= _IO_FLAGS2_NOTCANCEL;
if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s", buf);
else
fputs (buf, stderr);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
free (buf);
}
#else
@ -861,11 +886,19 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
#if defined _LIBC && defined USE_IN_LIBIO
if (n >= 0)
{
_IO_flockfile (stderr);
int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s", buf);
else
fputs (buf, stderr);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
free (buf);
}
#endif
@ -919,11 +952,19 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
#if defined _LIBC && defined USE_IN_LIBIO
if (n >= 0)
{
_IO_flockfile (stderr);
int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s", buf);
else
fputs (buf, stderr);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
free (buf);
}
#endif
@ -962,11 +1003,19 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
_("%s: option requires an argument -- %c\n"),
argv[0], c) >= 0)
{
_IO_flockfile (stderr);
int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s", buf);
else
fputs (buf, stderr);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
free (buf);
}
#else
@ -1025,11 +1074,19 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
if (__asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"),
argv[0], argv[optind]) >= 0)
{
_IO_flockfile (stderr);
int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s", buf);
else
fputs (buf, stderr);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
free (buf);
}
#else
@ -1061,11 +1118,20 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
%s: option `-W %s' doesn't allow an argument\n"),
argv[0], pfound->name) >= 0)
{
_IO_flockfile (stderr);
int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2
|= _IO_FLAGS2_NOTCANCEL;
if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s", buf);
else
fputs (buf, stderr);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
free (buf);
}
#else
@ -1094,11 +1160,20 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
%s: option `%s' requires an argument\n"),
argv[0], argv[optind - 1]) >= 0)
{
_IO_flockfile (stderr);
int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2
|= _IO_FLAGS2_NOTCANCEL;
if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s", buf);
else
fputs (buf, stderr);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
free (buf);
}
#else
@ -1160,11 +1235,19 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
%s: option requires an argument -- %c\n"),
argv[0], c) >= 0)
{
_IO_flockfile (stderr);
int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s", buf);
else
fputs (buf, stderr);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
free (buf);
}
#else

View File

@ -1,5 +1,5 @@
/* Declarations for getopt.
Copyright (C) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc.
Copyright (C) 1989-1994, 1996-1999,2001,2003 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
@ -34,6 +34,14 @@
# include <ctype.h>
#endif
#ifndef __THROW
# if defined __cplusplus && __GNUC_PREREQ (2,8)
# define __THROW throw ()
# else
# define __THROW
# endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
@ -142,7 +150,8 @@ struct option
/* Many other libraries have conflicting prototypes for getopt, with
differences in the consts, in stdlib.h. To avoid compilation
errors, only prototype getopt for the GNU C library. */
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts);
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
__THROW;
# else /* not __GNU_LIBRARY__ */
extern int getopt ();
# endif /* __GNU_LIBRARY__ */
@ -150,10 +159,12 @@ extern int getopt ();
# ifndef __need_getopt
extern int getopt_long (int ___argc, char *const *___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind);
const struct option *__longopts, int *__longind)
__THROW;
extern int getopt_long_only (int ___argc, char *const *___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind);
const struct option *__longopts, int *__longind)
__THROW;
/* Internal only. Users should not call this directly. */
extern int _getopt_internal (int ___argc, char *const *___argv,

View File

@ -36,6 +36,7 @@ CFLAGS-getpwuid_r.c = -DUSE_NSCD=1
CFLAGS-getpwnam_r.c = -DUSE_NSCD=1
CFLAGS-getpwent_r.c = -fexceptions
CFLAGS-getpwent.c = -fexceptions
CFLAGS-getpw.c = -fexceptions
endif

View File

@ -62,6 +62,7 @@ static const char rcsid[] = "$BINDId: herror.c,v 8.11 1999/10/13 16:39:39 vixie
#include <unistd.h>
#include <libintl.h>
#include <not-cancel.h>
const char *h_errlist[] = {
N_("Resolver Error 0 (no error)"),
@ -94,7 +95,7 @@ herror(const char *s) {
v++;
v->iov_base = "\n";
v->iov_len = 1;
__writev(STDERR_FILENO, iov, (v - iov) + 1);
writev_not_cancel_no_status(STDERR_FILENO, iov, (v - iov) + 1);
}
/*

View File

@ -28,5 +28,10 @@ routines = getspent getspnam sgetspent fgetspent putspent \
CFLAGS-getspent_r.c = -fexceptions
CFLAGS-getspent.c = -fexceptions
CFLAGS-fgetspent.c = -fexceptions
CFLAGS-fgetspent_r.c = -fexceptions
CFLAGS-putspent.c = -fexceptions
CFLAGS-getspnam.c = -fexceptions
CFLAGS-getspnam_r.c = -fexceptions
include ../Rules

View File

@ -86,6 +86,7 @@ CFLAGS-tmpfile64.c = -fexceptions
CFLAGS-tempname.c = -fexceptions
CFLAGS-psignal.c = -fexceptions
CFLAGS-vprintf.c = -fexceptions
CFLAGS-cuserid.c = -fexceptions
tst-sscanf-ENV = LOCPATH=$(common-objpfx)localedata
tst-swprintf-ENV = LOCPATH=$(common-objpfx)localedata

View File

@ -1,5 +1,5 @@
/* Functions to access FILE structure internals.
Copyright (C) 2000, 2001 Free Software Foundation, Inc.
Copyright (C) 2000, 2001, 2003 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
@ -44,43 +44,43 @@ __BEGIN_DECLS
/* Return the size of the buffer of FP in bytes currently in use by
the given stream. */
extern size_t __fbufsize (FILE *__fp);
extern size_t __fbufsize (FILE *__fp) __THROW;
/* Return non-zero value iff the stream FP is opened readonly, or if the
last operation on the stream was a read operation. */
extern int __freading (FILE *__fp);
extern int __freading (FILE *__fp) __THROW;
/* Return non-zero value iff the stream FP is opened write-only or
append-only, or if the last operation on the stream was a write
operation. */
extern int __fwriting (FILE *__fp);
extern int __fwriting (FILE *__fp) __THROW;
/* Return non-zero value iff stream FP is not opened write-only or
append-only. */
extern int __freadable (FILE *__fp);
extern int __freadable (FILE *__fp) __THROW;
/* Return non-zero value iff stream FP is not opened read-only. */
extern int __fwritable (FILE *__fp);
extern int __fwritable (FILE *__fp) __THROW;
/* Return non-zero value iff the stream FP is line-buffered. */
extern int __flbf (FILE *__fp);
extern int __flbf (FILE *__fp) __THROW;
/* Discard all pending buffered I/O on the stream FP. */
extern void __fpurge (FILE *__fp);
extern void __fpurge (FILE *__fp) __THROW;
/* Return amount of output in bytes pending on a stream FP. */
extern size_t __fpending (FILE *__fp);
extern size_t __fpending (FILE *__fp) __THROW;
/* Flush all line-buffered files. */
extern void _flushlbf (void);
/* Set locking status of stream FP to TYPE. */
extern int __fsetlocking (FILE *__fp, int __type);
extern int __fsetlocking (FILE *__fp, int __type) __THROW;
__END_DECLS

View File

@ -83,7 +83,6 @@ CFLAGS-bsearch.c = $(exceptions)
CFLAGS-msort.c = $(exceptions)
CFLAGS-qsort.c = $(exceptions)
CFLAGS-system.c = -fexceptions
CFLAGS-mkstemp.c = -fexceptions
CFLAGS-fmtmsg.c = -fexceptions
include ../Makeconfig

View File

@ -122,6 +122,7 @@ CFLAGS-auth_unix.c = -fexceptions
CFLAGS-key_call.c = -fexceptions
CFLAGS-pmap_rmt.c = -fexceptions
CFLAGS-clnt_perr.c = -fexceptions
CFLAGS-openchild.c = -fexceptions
ifeq (yes,$(have_doors))
CPPFLAGS-key_call.c += -DHAVE_DOORS=1