about summary refs log tree commit diff
path: root/io/sys
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-09-17 08:44:34 +0000
committerUlrich Drepper <drepper@redhat.com>2004-09-17 08:44:34 +0000
commit8a1f658bd783e625d947933b6603dbcedb31f75b (patch)
tree1e2bf5a9043e42bf3c51e9f0402e3c430e222cc4 /io/sys
parent5032f494227c2a080ed3034ef1b7490472fbafcc (diff)
downloadglibc-8a1f658bd783e625d947933b6603dbcedb31f75b.tar.gz
glibc-8a1f658bd783e625d947933b6603dbcedb31f75b.tar.xz
glibc-8a1f658bd783e625d947933b6603dbcedb31f75b.zip
Update.
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.
Diffstat (limited to 'io/sys')
-rw-r--r--io/sys/sendfile.h6
-rw-r--r--io/sys/stat.h60
-rw-r--r--io/sys/statfs.h16
-rw-r--r--io/sys/statvfs.h17
4 files changed, 60 insertions, 39 deletions
diff --git a/io/sys/sendfile.h b/io/sys/sendfile.h
index 4c1367b6be..24256b5414 100644
--- a/io/sys/sendfile.h
+++ b/io/sys/sendfile.h
@@ -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
diff --git a/io/sys/stat.h b/io/sys/stat.h
index abe68860cb..7075003922 100644
--- a/io/sys/stat.h
+++ b/io/sys/stat.h
@@ -205,16 +205,18 @@ __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
@@ -222,8 +224,8 @@ extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), fstat64);
 #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
@@ -231,31 +233,35 @@ extern int fstat64 (int __fd, struct stat64 *__buf) __THROW;
 /* 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.  */
@@ -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,
@@ -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
@@ -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.  */
diff --git a/io/sys/statfs.h b/io/sys/statfs.h
index c93d8f1d44..3b2226b41e 100644
--- a/io/sys/statfs.h
+++ b/io/sys/statfs.h
@@ -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
diff --git a/io/sys/statvfs.h b/io/sys/statvfs.h
index 7c6c90fae0..909662bc50 100644
--- a/io/sys/statvfs.h
+++ b/io/sys/statvfs.h
@@ -50,35 +50,40 @@ __BEGIN_DECLS
 /* Return information about the filesystem on which FILE resides.  */
 #ifndef __USE_FILE_OFFSET64
 extern int statvfs (__const char *__restrict __file,
-		    struct statvfs *__restrict __buf) __THROW;
+		    struct statvfs *__restrict __buf)
+     __THROW __nonnull ((1, 2));
 #else
 # ifdef __REDIRECT_NTH
 extern int __REDIRECT_NTH (statvfs,
 			   (__const char *__restrict __file,
-			    struct statvfs *__restrict __buf), statvfs64);
+			    struct statvfs *__restrict __buf), statvfs64)
+     __nonnull ((1, 2));
 # else
 #  define statvfs statvfs64
 # endif
 #endif
 #ifdef __USE_LARGEFILE64
 extern int statvfs64 (__const char *__restrict __file,
-		      struct statvfs64 *__restrict __buf) __THROW;
+		      struct statvfs64 *__restrict __buf)
+     __THROW __nonnull ((1, 2));
 #endif
 
 /* Return information about the filesystem containing the file FILDES
    refers to.  */
 #ifndef __USE_FILE_OFFSET64
-extern int fstatvfs (int __fildes, struct statvfs *__buf) __THROW;
+extern int fstatvfs (int __fildes, struct statvfs *__buf)
+     __THROW __nonnull ((2));
 #else
 # ifdef __REDIRECT_NTH
 extern int __REDIRECT_NTH (fstatvfs, (int __fildes, struct statvfs *__buf),
-			   fstatvfs64);
+			   fstatvfs64) __nonnull ((2));
 # else
 #  define fstatvfs fstatvfs64
 # endif
 #endif
 #ifdef __USE_LARGEFILE64
-extern int fstatvfs64 (int __fildes, struct statvfs64 *__buf) __THROW;
+extern int fstatvfs64 (int __fildes, struct statvfs64 *__buf)
+     __THROW __nonnull ((2));
 #endif
 
 __END_DECLS