Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
	* stdlib/stdlib.h: Likewise.
  • Loading branch information
Ulrich Drepper committed Jan 6, 2005
1 parent 5cf53cc commit 0476597
Show file tree
Hide file tree
Showing 4 changed files with 152 additions and 137 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* misc/sys/cdefs.h: Define __wur.
* libio/stdio.h: Use __wur for a number of interfaces.
* posix/unistd.h: Likewise.
* stdlib/stdlib.h: Likewise.

2004-12-29 Jakub Jelinek <jakub@redhat.com>

Expand Down
49 changes: 25 additions & 24 deletions libio/stdio.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Define ISO C stdio on top of C++ iostreams.
Copyright (C) 1991,1994-2002,2003,2004 Free Software Foundation, Inc.
Copyright (C) 1991,1994-2004, 2005 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
Expand Down Expand Up @@ -149,9 +149,9 @@ extern struct _IO_FILE *stderr; /* Standard error output stream. */

__BEGIN_NAMESPACE_STD
/* Remove file FILENAME. */
extern int remove (__const char *__filename) __THROW;
extern int remove (__const char *__filename) __THROW __wur;
/* Rename file OLD to NEW. */
extern int rename (__const char *__old, __const char *__new) __THROW;
extern int rename (__const char *__old, __const char *__new) __THROW __wur;
__END_NAMESPACE_STD


Expand Down Expand Up @@ -391,15 +391,15 @@ __BEGIN_NAMESPACE_STD
This function is a possible cancellation point and therefore not
marked with __THROW. */
extern int fscanf (FILE *__restrict __stream,
__const char *__restrict __format, ...);
__const char *__restrict __format, ...) __wur;
/* Read formatted input from stdin.
This function is a possible cancellation point and therefore not
marked with __THROW. */
extern int scanf (__const char *__restrict __format, ...);
extern int scanf (__const char *__restrict __format, ...) __wur;
/* Read formatted input from S. */
extern int sscanf (__const char *__restrict __s,
__const char *__restrict __format, ...) __THROW;
__const char *__restrict __format, ...) __THROW __wur;
__END_NAMESPACE_STD

#ifdef __USE_ISOC99
Expand All @@ -410,19 +410,19 @@ __BEGIN_NAMESPACE_C99
marked with __THROW. */
extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format,
_G_va_list __arg)
__attribute__ ((__format__ (__scanf__, 2, 0)));
__attribute__ ((__format__ (__scanf__, 2, 0))) __wur;

/* Read formatted input from stdin into argument list ARG.
This function is a possible cancellation point and therefore not
marked with __THROW. */
extern int vscanf (__const char *__restrict __format, _G_va_list __arg)
__attribute__ ((__format__ (__scanf__, 1, 0)));
__attribute__ ((__format__ (__scanf__, 1, 0))) __wur;

/* Read formatted input from S into argument list ARG. */
extern int vsscanf (__const char *__restrict __s,
__const char *__restrict __format, _G_va_list __arg)
__THROW __attribute__ ((__format__ (__scanf__, 2, 0)));
__THROW __attribute__ ((__format__ (__scanf__, 2, 0))) __wur;
__END_NAMESPACE_C99
#endif /* Use ISO C9x. */

Expand Down Expand Up @@ -523,14 +523,15 @@ __BEGIN_NAMESPACE_STD
This function is a possible cancellation point and therefore not
marked with __THROW. */
extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream);
extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
__wur;

/* Get a newline-terminated string from stdin, removing the newline.
DO NOT USE THIS FUNCTION!! There is no limit on how much it will read.
This function is a possible cancellation point and therefore not
marked with __THROW. */
extern char *gets (char *__s);
extern char *gets (char *__s) __wur;
__END_NAMESPACE_STD

#ifdef __USE_GNU
Expand All @@ -541,7 +542,7 @@ __END_NAMESPACE_STD
or due to the implementation it is a cancellation point and
therefore not marked with __THROW. */
extern char *fgets_unlocked (char *__restrict __s, int __n,
FILE *__restrict __stream);
FILE *__restrict __stream) __wur;
#endif


Expand All @@ -558,10 +559,10 @@ extern char *fgets_unlocked (char *__restrict __s, int __n,
therefore not marked with __THROW. */
extern _IO_ssize_t __getdelim (char **__restrict __lineptr,
size_t *__restrict __n, int __delimiter,
FILE *__restrict __stream);
FILE *__restrict __stream) __wur;
extern _IO_ssize_t getdelim (char **__restrict __lineptr,
size_t *__restrict __n, int __delimiter,
FILE *__restrict __stream);
FILE *__restrict __stream) __wur;

/* Like `getdelim', but reads up to a newline.
Expand All @@ -571,7 +572,7 @@ extern _IO_ssize_t getdelim (char **__restrict __lineptr,
therefore not marked with __THROW. */
extern _IO_ssize_t getline (char **__restrict __lineptr,
size_t *__restrict __n,
FILE *__restrict __stream);
FILE *__restrict __stream) __wur;
#endif


Expand All @@ -593,21 +594,21 @@ extern int puts (__const char *__s);
This function is a possible cancellation points and therefore not
marked with __THROW. */
extern int ungetc (int __c, FILE *__stream);
extern int ungetc (int __c, FILE *__stream) __wur;


/* Read chunks of generic data from STREAM.
This function is a possible cancellation points and therefore not
marked with __THROW. */
extern size_t fread (void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __stream);
size_t __n, FILE *__restrict __stream) __wur;
/* Write chunks of generic data to STREAM.
This function is a possible cancellation points and therefore not
marked with __THROW. */
extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __s);
size_t __n, FILE *__restrict __s) __wur;
__END_NAMESPACE_STD

#ifdef __USE_GNU
Expand All @@ -629,9 +630,9 @@ extern int fputs_unlocked (__const char *__restrict __s,
or due to the implementation they are cancellation points and
therefore not marked with __THROW. */
extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __stream);
size_t __n, FILE *__restrict __stream) __wur;
extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __stream);
size_t __n, FILE *__restrict __stream) __wur;
#endif


Expand All @@ -645,7 +646,7 @@ extern int fseek (FILE *__stream, long int __off, int __whence);
This function is a possible cancellation point and therefore not
marked with __THROW. */
extern long int ftell (FILE *__stream);
extern long int ftell (FILE *__stream) __wur;
/* Rewind to the beginning of STREAM.
This function is a possible cancellation point and therefore not
Expand All @@ -669,7 +670,7 @@ extern int fseeko (FILE *__stream, __off_t __off, int __whence);
This function is a possible cancellation point and therefore not
marked with __THROW. */
extern __off_t ftello (FILE *__stream);
extern __off_t ftello (FILE *__stream) __wur;
# else
# ifdef __REDIRECT
extern int __REDIRECT (fseeko,
Expand Down Expand Up @@ -710,7 +711,7 @@ __END_NAMESPACE_STD

#ifdef __USE_LARGEFILE64
extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream);
extern __off64_t ftello64 (FILE *__stream) __wur;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, __const fpos64_t *__pos);
#endif
Expand Down Expand Up @@ -808,7 +809,7 @@ extern void flockfile (FILE *__stream) __THROW;

/* Try to acquire ownership of STREAM but do not block if it is not
possible. */
extern int ftrylockfile (FILE *__stream) __THROW;
extern int ftrylockfile (FILE *__stream) __THROW __wur;

/* Relinquish the ownership granted for STREAM. */
extern void funlockfile (FILE *__stream) __THROW;
Expand Down
Loading

0 comments on commit 0476597

Please sign in to comment.