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> 2003-09-11 H.J. Lu <hongjiu.lu@intel.com>
* elf/tls-macros.h (TLS_IE): Add a stop bit for ia64. * 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) LDLIBS-c.so += $(gnulib)
# Give libc.so an entry point and make it directly runnable itself. # Give libc.so an entry point and make it directly runnable itself.
LDFLAGS-c.so += -e __libc_main 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 # 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 # 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 # contains some of libc_pic.a already, which will prevent the COMMONs

View file

@ -47,10 +47,15 @@ endif
ifeq ($(have-thread-library),yes) ifeq ($(have-thread-library),yes)
CFLAGS-getgrgid_r.c = -DUSE_NSCD=1 CFLAGS-getgrgid_r.c = -DUSE_NSCD=1 -fexceptions
CFLAGS-getgrnam_r.c = -DUSE_NSCD=1 CFLAGS-getgrnam_r.c = -DUSE_NSCD=1 -fexceptions
CFLAGS-getgrent_r.c = -fexceptions CFLAGS-getgrent_r.c = -fexceptions
CFLAGS-getgrent.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 endif

View file

@ -79,6 +79,10 @@ CFLAGS-getservent_r.c = -fexceptions
CFLAGS-getservent.c = -fexceptions CFLAGS-getservent.c = -fexceptions
CFLAGS-getprtent_r.c = -fexceptions CFLAGS-getprtent_r.c = -fexceptions
CFLAGS-getprtent.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 endif

View file

@ -71,6 +71,10 @@ CFLAGS-statfs.c = -fexceptions
CFLAGS-fstatfs.c = -fexceptions CFLAGS-fstatfs.c = -fexceptions
CFLAGS-statvfs.c = -fexceptions CFLAGS-statvfs.c = -fexceptions
CFLAGS-fstatvfs.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-stat.c = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
CFLAGS-test-lfs.c = -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. */ # define F_TEST 3 /* Test a region for other processes locks. */
# ifndef __USE_FILE_OFFSET64 # 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 # else
# ifdef __REDIRECT # ifdef __REDIRECT
extern int __REDIRECT (lockf, (int __fd, int __cmd, __off64_t __len) __THROW, extern int __REDIRECT (lockf, (int __fd, int __cmd, __off64_t __len), lockf64);
lockf64);
# else # else
# define lockf lockf64 # define lockf lockf64
# endif # endif
# endif # endif
# ifdef __USE_LARGEFILE64 # 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
#endif #endif

View file

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

View file

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

View file

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

View file

@ -106,7 +106,18 @@ __malloc_check_init()
__realloc_hook = realloc_check; __realloc_hook = realloc_check;
__memalign_hook = memalign_check; __memalign_hook = memalign_check;
if(check_action & 1) 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 /* A simple, standard set of debugging hooks. Overhead is `only' one
@ -224,7 +235,18 @@ top_check()
t == initial_top(&main_arena)) return 0; t == initial_top(&main_arena)) return 0;
if(check_action & 1) 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) if(check_action & 2)
abort(); abort();
@ -278,7 +300,18 @@ free_check(mem, caller) Void_t* mem; const Void_t *caller;
if(!p) { if(!p) {
(void)mutex_unlock(&main_arena.mutex); (void)mutex_unlock(&main_arena.mutex);
if(check_action & 1) 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) if(check_action & 2)
abort(); abort();
return; return;
@ -315,7 +348,18 @@ realloc_check(oldmem, bytes, caller)
(void)mutex_unlock(&main_arena.mutex); (void)mutex_unlock(&main_arena.mutex);
if(!oldp) { if(!oldp) {
if(check_action & 1) 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) if(check_action & 2)
abort(); abort();
return malloc_check(bytes, NULL); 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 (__builtin_expect ((uintptr_t) p > (uintptr_t) -size, 0))
{ {
if (check_action & 1) 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) if (check_action & 2)
abort (); abort ();
return; return;
@ -5108,6 +5119,11 @@ void mSTATs()
if(__malloc_initialized < 0) if(__malloc_initialized < 0)
ptmalloc_init (); 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++) { for (i=0, ar_ptr = &main_arena;; i++) {
(void)mutex_lock(&ar_ptr->mutex); (void)mutex_lock(&ar_ptr->mutex);
mi = mALLINFo(ar_ptr); mi = mALLINFo(ar_ptr);
@ -5152,6 +5168,10 @@ void mSTATs()
fprintf(stderr, "locked total = %10ld\n", fprintf(stderr, "locked total = %10ld\n",
stat_lock_direct + stat_lock_loop + stat_lock_wait); stat_lock_direct + stat_lock_loop + stat_lock_wait);
#endif #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-mkstemp64.c = -fexceptions
CFLAGS-getsysstats.c = -fexceptions CFLAGS-getsysstats.c = -fexceptions
CFLAGS-getusershell.c = -fexceptions CFLAGS-getusershell.c = -fexceptions
CFLAGS-err.c = -fexceptions
include ../Rules include ../Rules

View file

@ -1,5 +1,5 @@
/* 4.4BSD utility functions for error messages. /* 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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or 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, /* Print "program: ", FORMAT, ": ", the standard error string for errno,
and a newline, on stderr. */ and a newline, on stderr. */
extern void warn (__const char *__format, ...) 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) 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. */ /* Likewise, but without ": " and the standard error string. */
extern void warnx (__const char *__format, ...) 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) 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. */ /* Likewise, and then exit with STATUS. */
extern void err (int __status, __const char *__format, ...) 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) 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, ...) 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) 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 __END_DECLS

View file

@ -118,7 +118,7 @@ endif
endif endif
CFLAGS-regex.c = -Wno-strict-prototypes CFLAGS-regex.c = -Wno-strict-prototypes
CFLAGS-getaddrinfo.c = -DRESOLVER CFLAGS-getaddrinfo.c = -DRESOLVER -fexceptions
CFLAGS-pread.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-pread.c = -fexceptions -fasynchronous-unwind-tables
CFLAGS-pread64.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-pread64.c = -fexceptions -fasynchronous-unwind-tables
CFLAGS-pwrite.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-sysconf.c = -fexceptions
CFLAGS-pathconf.c = -fexceptions CFLAGS-pathconf.c = -fexceptions
CFLAGS-fpathconf.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 \ tstgetopt-ARGS = -a -b -cfoobar --required foobar --optional=bazbug \
--none random --col --color --colour --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 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 "Keep this file name-space clean" means, talk to drepper@gnu.org
before changing it! 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. Free Software Foundation, Inc.
This file is part of the GNU C Library. 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"), if (__asprintf (&buf, _("%s: option `%s' is ambiguous\n"),
argv[0], argv[optind]) >= 0) 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) if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s", buf); __fwprintf (stderr, L"%s", buf);
else else
fputs (buf, stderr); fputs (buf, stderr);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
free (buf); free (buf);
} }
#else #else
@ -761,11 +768,20 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
#if defined _LIBC && defined USE_IN_LIBIO #if defined _LIBC && defined USE_IN_LIBIO
if (n >= 0) 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) if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s", buf); __fwprintf (stderr, L"%s", buf);
else else
fputs (buf, stderr); fputs (buf, stderr);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
free (buf); free (buf);
} }
#endif #endif
@ -792,11 +808,20 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
%s: option `%s' requires an argument\n"), %s: option `%s' requires an argument\n"),
argv[0], argv[optind - 1]) >= 0) 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) if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s", buf); __fwprintf (stderr, L"%s", buf);
else else
fputs (buf, stderr); fputs (buf, stderr);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
free (buf); free (buf);
} }
#else #else
@ -861,11 +886,19 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
#if defined _LIBC && defined USE_IN_LIBIO #if defined _LIBC && defined USE_IN_LIBIO
if (n >= 0) 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) if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s", buf); __fwprintf (stderr, L"%s", buf);
else else
fputs (buf, stderr); fputs (buf, stderr);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
free (buf); free (buf);
} }
#endif #endif
@ -919,11 +952,19 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
#if defined _LIBC && defined USE_IN_LIBIO #if defined _LIBC && defined USE_IN_LIBIO
if (n >= 0) 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) if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s", buf); __fwprintf (stderr, L"%s", buf);
else else
fputs (buf, stderr); fputs (buf, stderr);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
free (buf); free (buf);
} }
#endif #endif
@ -962,11 +1003,19 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
_("%s: option requires an argument -- %c\n"), _("%s: option requires an argument -- %c\n"),
argv[0], c) >= 0) 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) if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s", buf); __fwprintf (stderr, L"%s", buf);
else else
fputs (buf, stderr); fputs (buf, stderr);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
free (buf); free (buf);
} }
#else #else
@ -1025,11 +1074,19 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
if (__asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"), if (__asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"),
argv[0], argv[optind]) >= 0) 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) if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s", buf); __fwprintf (stderr, L"%s", buf);
else else
fputs (buf, stderr); fputs (buf, stderr);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
free (buf); free (buf);
} }
#else #else
@ -1061,11 +1118,20 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
%s: option `-W %s' doesn't allow an argument\n"), %s: option `-W %s' doesn't allow an argument\n"),
argv[0], pfound->name) >= 0) 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) if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s", buf); __fwprintf (stderr, L"%s", buf);
else else
fputs (buf, stderr); fputs (buf, stderr);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
free (buf); free (buf);
} }
#else #else
@ -1094,11 +1160,20 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
%s: option `%s' requires an argument\n"), %s: option `%s' requires an argument\n"),
argv[0], argv[optind - 1]) >= 0) 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) if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s", buf); __fwprintf (stderr, L"%s", buf);
else else
fputs (buf, stderr); fputs (buf, stderr);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
free (buf); free (buf);
} }
#else #else
@ -1160,11 +1235,19 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
%s: option requires an argument -- %c\n"), %s: option requires an argument -- %c\n"),
argv[0], c) >= 0) 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) if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s", buf); __fwprintf (stderr, L"%s", buf);
else else
fputs (buf, stderr); fputs (buf, stderr);
((_IO_FILE *) stderr)->_flags2 = old_flags2;
_IO_funlockfile (stderr);
free (buf); free (buf);
} }
#else #else

View file

@ -1,5 +1,5 @@
/* Declarations for getopt. /* 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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -34,6 +34,14 @@
# include <ctype.h> # include <ctype.h>
#endif #endif
#ifndef __THROW
# if defined __cplusplus && __GNUC_PREREQ (2,8)
# define __THROW throw ()
# else
# define __THROW
# endif
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -142,7 +150,8 @@ struct option
/* Many other libraries have conflicting prototypes for getopt, with /* Many other libraries have conflicting prototypes for getopt, with
differences in the consts, in stdlib.h. To avoid compilation differences in the consts, in stdlib.h. To avoid compilation
errors, only prototype getopt for the GNU C library. */ 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__ */ # else /* not __GNU_LIBRARY__ */
extern int getopt (); extern int getopt ();
# endif /* __GNU_LIBRARY__ */ # endif /* __GNU_LIBRARY__ */
@ -150,10 +159,12 @@ extern int getopt ();
# ifndef __need_getopt # ifndef __need_getopt
extern int getopt_long (int ___argc, char *const *___argv, extern int getopt_long (int ___argc, char *const *___argv,
const char *__shortopts, 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, extern int getopt_long_only (int ___argc, char *const *___argv,
const char *__shortopts, const char *__shortopts,
const struct option *__longopts, int *__longind); const struct option *__longopts, int *__longind)
__THROW;
/* Internal only. Users should not call this directly. */ /* Internal only. Users should not call this directly. */
extern int _getopt_internal (int ___argc, char *const *___argv, 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-getpwnam_r.c = -DUSE_NSCD=1
CFLAGS-getpwent_r.c = -fexceptions CFLAGS-getpwent_r.c = -fexceptions
CFLAGS-getpwent.c = -fexceptions CFLAGS-getpwent.c = -fexceptions
CFLAGS-getpw.c = -fexceptions
endif 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 <unistd.h>
#include <libintl.h> #include <libintl.h>
#include <not-cancel.h>
const char *h_errlist[] = { const char *h_errlist[] = {
N_("Resolver Error 0 (no error)"), N_("Resolver Error 0 (no error)"),
@ -94,7 +95,7 @@ herror(const char *s) {
v++; v++;
v->iov_base = "\n"; v->iov_base = "\n";
v->iov_len = 1; 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_r.c = -fexceptions
CFLAGS-getspent.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 include ../Rules

View file

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

View file

@ -1,5 +1,5 @@
/* Functions to access FILE structure internals. /* 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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or 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 /* Return the size of the buffer of FP in bytes currently in use by
the given stream. */ 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 /* Return non-zero value iff the stream FP is opened readonly, or if the
last operation on the stream was a read operation. */ 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 /* 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 append-only, or if the last operation on the stream was a write
operation. */ 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 /* Return non-zero value iff stream FP is not opened write-only or
append-only. */ 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. */ /* 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. */ /* 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. */ /* 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. */ /* 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. */ /* Flush all line-buffered files. */
extern void _flushlbf (void); extern void _flushlbf (void);
/* Set locking status of stream FP to TYPE. */ /* 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 __END_DECLS

View file

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

View file

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