Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
2004-09-17  Ulrich Drepper  <drepper@redhat.com>

	* misc/sys/cdefs.h: Define __nonnull using nonnull function attribute
	for gcc 3.3 and higher.
	* io/fcntl.h: Add __nonnull where appropriate.
	* io/ftw.h: Likewise.
	* io/utime.h: Likewise.
	* io/sys/poll.h: Likewise.
	* io/sys/sendfile.h: Likewise.
	* io/sys/stat.h: Likewise.
	* io/sys/statfs.h: Likewise.
	* io/sys/statvfs.h: Likewise.
	* posix/unistd.h: Likewise.
  • Loading branch information
Ulrich Drepper committed Sep 17, 2004
1 parent 5032f49 commit 8a1f658
Show file tree
Hide file tree
Showing 11 changed files with 176 additions and 90 deletions.
14 changes: 14 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
2004-09-17 Ulrich Drepper <drepper@redhat.com>

* misc/sys/cdefs.h: Define __nonnull using nonnull function attribute
for gcc 3.3 and higher.
* io/fcntl.h: Add __nonnull where appropriate.
* io/ftw.h: Likewise.
* io/utime.h: Likewise.
* io/sys/poll.h: Likewise.
* io/sys/sendfile.h: Likewise.
* io/sys/stat.h: Likewise.
* io/sys/statfs.h: Likewise.
* io/sys/statvfs.h: Likewise.
* posix/unistd.h: Likewise.

2004-09-16 Ulrich Drepper <drepper@redhat.com>

* posix/glob.h: Remove cruft to make header usable outside glibc.
Expand Down
22 changes: 22 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,28 @@ Version 2.3.4

* Support for RFC 3678. Real implementations exist only for Linux so far.
Implemented by Ulrich Drepper.

* nscd can now cache entries persistently. Expiring entries are reloaded.
For speedups the cache can be shared in memory with client processes.
Implemented by Ulrich Drepper.

* nscd can now perform SELinux checks.
Implemented by Matthew Rickard <mjricka@epoch.ncsc.mil>.

* getaddrinfo queries are not cached. Canonical name lookup is performed
efficiently.
Implemented by Ulrich Drepper.

* The nothrow function attribute is used when headers are used by gcc when
compiling C code. This can avoid significant amounts of exception
handling data.

* The malloc functions perform more error checking and are stricter when
it comes to reacting on errors. The default action is to terminate
the process after showing an error message.

* Reverse lookups of IPv6 addresses does not use bit string or .ip6.int
lookups anymore unless explicitly requested.

Version 2.3.3

Expand Down
13 changes: 7 additions & 6 deletions io/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,17 @@ extern int fcntl (int __fd, int __cmd, ...);
This function is a cancellation point and therefore not marked with
__THROW. */
#ifndef __USE_FILE_OFFSET64
extern int open (__const char *__file, int __oflag, ...);
extern int open (__const char *__file, int __oflag, ...) __nonnull ((1));
#else
# ifdef __REDIRECT
extern int __REDIRECT (open, (__const char *__file, int __oflag, ...), open64);
extern int __REDIRECT (open, (__const char *__file, int __oflag, ...), open64)
__nonnull ((1));
# else
# define open open64
# endif
#endif
#ifdef __USE_LARGEFILE64
extern int open64 (__const char *__file, int __oflag, ...);
extern int open64 (__const char *__file, int __oflag, ...) __nonnull ((1));
#endif

/* Create and open FILE, with mode MODE. This takes an `int' MODE
Expand All @@ -87,17 +88,17 @@ extern int open64 (__const char *__file, int __oflag, ...);
This function is a cancellation point and therefore not marked with
__THROW. */
#ifndef __USE_FILE_OFFSET64
extern int creat (__const char *__file, __mode_t __mode);
extern int creat (__const char *__file, __mode_t __mode) __nonnull ((1));
#else
# ifdef __REDIRECT
extern int __REDIRECT (creat, (__const char *__file, __mode_t __mode),
creat64);
creat64) __nonnull ((1));
# else
# define creat creat64
# endif
#endif
#ifdef __USE_LARGEFILE64
extern int creat64 (__const char *__file, __mode_t __mode);
extern int creat64 (__const char *__file, __mode_t __mode) __nonnull ((1));
#endif

#if !defined F_LOCK && (defined __USE_MISC || (defined __USE_XOPEN_EXTENDED \
Expand Down
16 changes: 9 additions & 7 deletions io/ftw.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 1992,1996,1997,1998,1999,2003 Free Software Foundation, Inc.
/* Copyright (C) 1992,1996-1999,2003,2004 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 @@ -134,18 +134,19 @@ typedef int (*__nftw64_func_t) (__const char *__filename,
This function is a possible cancellation point and therefore not
marked with __THROW. */
#ifndef __USE_FILE_OFFSET64
extern int ftw (__const char *__dir, __ftw_func_t __func, int __descriptors);
extern int ftw (__const char *__dir, __ftw_func_t __func, int __descriptors)
__nonnull ((1, 2));
#else
# ifdef __REDIRECT
extern int __REDIRECT (ftw, (__const char *__dir, __ftw_func_t __func,
int __descriptors), ftw64);
int __descriptors), ftw64) __nonnull ((1, 2));
# else
# define ftw ftw64
# endif
#endif
#ifdef __USE_LARGEFILE64
extern int ftw64 (__const char *__dir, __ftw64_func_t __func,
int __descriptors);
int __descriptors) __nonnull ((1, 2));
#endif

#ifdef __USE_XOPEN_EXTENDED
Expand All @@ -156,18 +157,19 @@ extern int ftw64 (__const char *__dir, __ftw64_func_t __func,
marked with __THROW. */
# ifndef __USE_FILE_OFFSET64
extern int nftw (__const char *__dir, __nftw_func_t __func, int __descriptors,
int __flag);
int __flag) __nonnull ((1, 2));
# else
# ifdef __REDIRECT
extern int __REDIRECT (nftw, (__const char *__dir, __nftw_func_t __func,
int __descriptors, int __flag), nftw64);
int __descriptors, int __flag), nftw64)
__nonnull ((1, 2));
# else
# define nftw nftw64
# endif
# endif
# ifdef __USE_LARGEFILE64
extern int nftw64 (__const char *__dir, __nftw64_func_t __func,
int __descriptors, int __flag);
int __descriptors, int __flag) __nonnull ((1, 2));
# endif
#endif

Expand Down
6 changes: 3 additions & 3 deletions io/sys/sendfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ __BEGIN_DECLS
case of error. */
#ifndef __USE_FILE_OFFSET64
extern ssize_t sendfile (int __out_fd, int __in_fd, off_t *__offset,
size_t __count) __THROW;
size_t __count) __THROW __nonnull ((3));
#else
# ifdef __REDIRECT_NTH
extern ssize_t __REDIRECT_NTH (sendfile,
(int __out_fd, int __in_fd, __off64_t *__offset,
size_t __count), sendfile64);
size_t __count), sendfile64) __nonnull ((3));
# else
# define sendfile sendfile64
# endif
#endif
#ifdef __USE_LARGEFILE64
extern ssize_t sendfile64 (int __out_fd, int __in_fd, __off64_t *__offset,
size_t __count) __THROW;
size_t __count) __THROW __nonnull ((3));
#endif

__END_DECLS
Expand Down
60 changes: 36 additions & 24 deletions io/sys/stat.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,57 +205,63 @@ __BEGIN_DECLS
#ifndef __USE_FILE_OFFSET64
/* Get file attributes for FILE and put them in BUF. */
extern int stat (__const char *__restrict __file,
struct stat *__restrict __buf) __THROW;
struct stat *__restrict __buf) __THROW __nonnull ((1, 2));

/* Get file attributes for the file, device, pipe, or socket
that file descriptor FD is open on and put them in BUF. */
extern int fstat (int __fd, struct stat *__buf) __THROW;
extern int fstat (int __fd, struct stat *__buf) __THROW __nonnull ((2));
#else
# ifdef __REDIRECT_NTH
extern int __REDIRECT_NTH (stat, (__const char *__restrict __file,
struct stat *__restrict __buf), stat64);
extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), fstat64);
struct stat *__restrict __buf), stat64)
__nonnull ((1, 2));
extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), fstat64)
__nonnull ((2));
# else
# define stat stat64
# define fstat fstat64
# endif
#endif
#ifdef __USE_LARGEFILE64
extern int stat64 (__const char *__restrict __file,
struct stat64 *__restrict __buf) __THROW;
extern int fstat64 (int __fd, struct stat64 *__buf) __THROW;
struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2));
extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2));
#endif

#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
# ifndef __USE_FILE_OFFSET64
/* Get file attributes about FILE and put them in BUF.
If FILE is a symbolic link, do not follow it. */
extern int lstat (__const char *__restrict __file,
struct stat *__restrict __buf) __THROW;
struct stat *__restrict __buf) __THROW __nonnull ((1, 2));
# else
# ifdef __REDIRECT_NTH
extern int __REDIRECT_NTH (lstat,
(__const char *__restrict __file,
struct stat *__restrict __buf), lstat64);
struct stat *__restrict __buf), lstat64)
__nonnull ((1, 2));
# else
# define lstat lstat64
# endif
# endif
# ifdef __USE_LARGEFILE64
extern int lstat64 (__const char *__restrict __file,
struct stat64 *__restrict __buf) __THROW;
struct stat64 *__restrict __buf)
__THROW __nonnull ((1, 2));
# endif
#endif

/* Set file access permissions for FILE to MODE.
If FILE is a symbolic link, this affects its target instead. */
extern int chmod (__const char *__file, __mode_t __mode) __THROW;
extern int chmod (__const char *__file, __mode_t __mode)
__THROW __nonnull ((1));

#ifdef __USE_BSD
/* Set file access permissions for FILE to MODE.
If FILE is a symbolic link, this affects the link itself
rather than its target. */
extern int lchmod (__const char *__file, __mode_t __mode) __THROW;
extern int lchmod (__const char *__file, __mode_t __mode)
__THROW __nonnull ((1));
#endif

/* Set file access permissions of the file FD is open on to MODE. */
Expand All @@ -275,19 +281,21 @@ extern __mode_t getumask (void) __THROW;
#endif

/* Create a new directory named PATH, with permission bits MODE. */
extern int mkdir (__const char *__path, __mode_t __mode) __THROW;
extern int mkdir (__const char *__path, __mode_t __mode)
__THROW __nonnull ((1));

/* Create a device file named PATH, with permission and special bits MODE
and device number DEV (which can be constructed from major and minor
device numbers with the `makedev' macro above). */
#if defined __USE_MISC || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
extern int mknod (__const char *__path, __mode_t __mode, __dev_t __dev)
__THROW;
__THROW __nonnull ((1));
#endif


/* Create a new FIFO named PATH, with permission bits MODE. */
extern int mkfifo (__const char *__path, __mode_t __mode) __THROW;
extern int mkfifo (__const char *__path, __mode_t __mode)
__THROW __nonnull ((1));

/* To allow the `struct stat' structure and the file type `mode_t'
bits to vary without changing shared library major version number,
Expand All @@ -313,19 +321,23 @@ extern int mkfifo (__const char *__path, __mode_t __mode) __THROW;

/* Wrappers for stat and mknod system calls. */
#ifndef __USE_FILE_OFFSET64
extern int __fxstat (int __ver, int __fildes, struct stat *__stat_buf) __THROW;
extern int __fxstat (int __ver, int __fildes, struct stat *__stat_buf)
__THROW __nonnull ((3));
extern int __xstat (int __ver, __const char *__filename,
struct stat *__stat_buf) __THROW;
struct stat *__stat_buf) __THROW __nonnull ((2, 3));
extern int __lxstat (int __ver, __const char *__filename,
struct stat *__stat_buf) __THROW;
struct stat *__stat_buf) __THROW __nonnull ((2, 3));
#else
# ifdef __REDIRECT_NTH
extern int __REDIRECT_NTH (__fxstat, (int __ver, int __fildes,
struct stat *__stat_buf), __fxstat64);
struct stat *__stat_buf), __fxstat64)
__nonnull ((3));
extern int __REDIRECT_NTH (__xstat, (int __ver, __const char *__filename,
struct stat *__stat_buf), __xstat64);
struct stat *__stat_buf), __xstat64)
__nonnull ((2, 3));
extern int __REDIRECT_NTH (__lxstat, (int __ver, __const char *__filename,
struct stat *__stat_buf), __lxstat64);
struct stat *__stat_buf), __lxstat64)
__nonnull ((2, 3));

# else
# define __fxstat __fxstat64
Expand All @@ -336,14 +348,14 @@ extern int __REDIRECT_NTH (__lxstat, (int __ver, __const char *__filename,

#ifdef __USE_LARGEFILE64
extern int __fxstat64 (int __ver, int __fildes, struct stat64 *__stat_buf)
__THROW;
__THROW __nonnull ((3));
extern int __xstat64 (int __ver, __const char *__filename,
struct stat64 *__stat_buf) __THROW;
struct stat64 *__stat_buf) __THROW __nonnull ((2, 3));
extern int __lxstat64 (int __ver, __const char *__filename,
struct stat64 *__stat_buf) __THROW;
struct stat64 *__stat_buf) __THROW __nonnull ((2, 3));
#endif
extern int __xmknod (int __ver, __const char *__path, __mode_t __mode,
__dev_t *__dev) __THROW;
__dev_t *__dev) __THROW __nonnull ((2, 4));

#if defined __GNUC__ && __GNUC__ >= 2
/* Inlined versions of the real stat and mknod functions. */
Expand Down
16 changes: 10 additions & 6 deletions io/sys/statfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,38 @@ __BEGIN_DECLS

/* Return information about the filesystem on which FILE resides. */
#ifndef __USE_FILE_OFFSET64
extern int statfs (__const char *__file, struct statfs *__buf) __THROW;
extern int statfs (__const char *__file, struct statfs *__buf)
__THROW __nonnull ((1, 2));
#else
# ifdef __REDIRECT_NTH
extern int __REDIRECT_NTH (statfs,
(__const char *__file, struct statfs *__buf),
statfs64);
statfs64) __nonnull ((1, 2));
# else
# define statfs statfs64
# endif
#endif
#ifdef __USE_LARGEFILE64
extern int statfs64 (__const char *__file, struct statfs64 *__buf) __THROW;
extern int statfs64 (__const char *__file, struct statfs64 *__buf)
__THROW __nonnull ((1, 2));
#endif

/* Return information about the filesystem containing the file FILDES
refers to. */
#ifndef __USE_FILE_OFFSET64
extern int fstatfs (int __fildes, struct statfs *__buf) __THROW;
extern int fstatfs (int __fildes, struct statfs *__buf)
__THROW __nonnull ((2));
#else
# ifdef __REDIRECT_NTH
extern int __REDIRECT_NTH (fstatfs, (int __fildes, struct statfs *__buf),
fstatfs64);
fstatfs64) __nonnull ((2));
# else
# define fstatfs fstatfs64
# endif
#endif
#ifdef __USE_LARGEFILE64
extern int fstatfs64 (int __fildes, struct statfs64 *__buf) __THROW;
extern int fstatfs64 (int __fildes, struct statfs64 *__buf)
__THROW __nonnull ((2));
#endif

__END_DECLS
Expand Down
Loading

0 comments on commit 8a1f658

Please sign in to comment.