Browse Source

Sync headers w/ glibc

Peter S. Mazinger 18 years ago
parent
commit
4222cc97e9
3 changed files with 66 additions and 49 deletions
  1. 47 28
      include/dirent.h
  2. 17 8
      include/sys/wait.h
  3. 2 13
      include/time.h

+ 47 - 28
include/dirent.h

@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2000, 2003, 2004 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
@@ -128,12 +128,18 @@ enum
 typedef struct __dirstream DIR;
 typedef struct __dirstream DIR;
 
 
 /* Open a directory stream on NAME.
 /* Open a directory stream on NAME.
-   Return a DIR stream on the directory, or NULL if it could not be opened.  */
-extern DIR *opendir (__const char *__name) __THROW;
+   Return a DIR stream on the directory, or NULL if it could not be opened.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
+extern DIR *opendir (__const char *__name) __nonnull ((1));
 
 
 /* Close the directory stream DIRP.
 /* Close the directory stream DIRP.
-   Return 0 if successful, -1 if not.  */
-extern int closedir (DIR *__dirp) __THROW;
+   Return 0 if successful, -1 if not.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
+extern int closedir (DIR *__dirp) __nonnull ((1));
 
 
 /* Read a directory entry from DIRP.  Return a pointer to a `struct
 /* Read a directory entry from DIRP.  Return a pointer to a `struct
    dirent' describing the entry, or NULL for EOF or error.  The
    dirent' describing the entry, or NULL for EOF or error.  The
@@ -141,35 +147,43 @@ extern int closedir (DIR *__dirp) __THROW;
    same DIR stream.
    same DIR stream.
 
 
    If the Large File Support API is selected we have to use the
    If the Large File Support API is selected we have to use the
-   appropriate interface.  */
+   appropriate interface.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 #ifndef __USE_FILE_OFFSET64
 #ifndef __USE_FILE_OFFSET64
-extern struct dirent *readdir (DIR *__dirp) __THROW;
+extern struct dirent *readdir (DIR *__dirp) __nonnull ((1));
 #else
 #else
 # ifdef __REDIRECT
 # ifdef __REDIRECT
-extern struct dirent *__REDIRECT (readdir, (DIR *__dirp) __THROW, readdir64);
+extern struct dirent *__REDIRECT (readdir, (DIR *__dirp), readdir64)
+     __nonnull ((1));
 # else
 # else
 #  define readdir readdir64
 #  define readdir readdir64
 # endif
 # endif
 #endif
 #endif
 
 
 #ifdef __USE_LARGEFILE64
 #ifdef __USE_LARGEFILE64
-extern struct dirent64 *readdir64 (DIR *__dirp) __THROW;
+extern struct dirent64 *readdir64 (DIR *__dirp) __nonnull ((1));
 #endif
 #endif
 
 
 #if defined __USE_POSIX || defined __USE_MISC
 #if defined __USE_POSIX || defined __USE_MISC
 /* Reentrant version of `readdir'.  Return in RESULT a pointer to the
 /* Reentrant version of `readdir'.  Return in RESULT a pointer to the
-   next entry.  */
+   next entry.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
 # ifndef __USE_FILE_OFFSET64
 # ifndef __USE_FILE_OFFSET64
 extern int readdir_r (DIR *__restrict __dirp,
 extern int readdir_r (DIR *__restrict __dirp,
 		      struct dirent *__restrict __entry,
 		      struct dirent *__restrict __entry,
-		      struct dirent **__restrict __result) __THROW;
+		      struct dirent **__restrict __result)
+     __nonnull ((1, 2, 3));
 # else
 # else
 #  ifdef __REDIRECT
 #  ifdef __REDIRECT
 extern int __REDIRECT (readdir_r,
 extern int __REDIRECT (readdir_r,
 		       (DIR *__restrict __dirp,
 		       (DIR *__restrict __dirp,
 			struct dirent *__restrict __entry,
 			struct dirent *__restrict __entry,
-			struct dirent **__restrict __result) __THROW,
-		       readdir64_r);
+			struct dirent **__restrict __result),
+		       readdir64_r) __nonnull ((1, 2, 3));
 #  else
 #  else
 #   define readdir_r readdir64_r
 #   define readdir_r readdir64_r
 #  endif
 #  endif
@@ -178,27 +192,32 @@ extern int __REDIRECT (readdir_r,
 # ifdef __USE_LARGEFILE64
 # ifdef __USE_LARGEFILE64
 extern int readdir64_r (DIR *__restrict __dirp,
 extern int readdir64_r (DIR *__restrict __dirp,
 			struct dirent64 *__restrict __entry,
 			struct dirent64 *__restrict __entry,
-			struct dirent64 **__restrict __result) __THROW;
+			struct dirent64 **__restrict __result)
+     __nonnull ((1, 2, 3));
 # endif
 # endif
 #endif	/* POSIX or misc */
 #endif	/* POSIX or misc */
 
 
 /* Rewind DIRP to the beginning of the directory.  */
 /* Rewind DIRP to the beginning of the directory.  */
-extern void rewinddir (DIR *__dirp) __THROW;
+extern void rewinddir (DIR *__dirp) __THROW __nonnull ((1));
 
 
 #if defined __USE_BSD || defined __USE_MISC || defined __USE_XOPEN
 #if defined __USE_BSD || defined __USE_MISC || defined __USE_XOPEN
 # include <bits/types.h>
 # include <bits/types.h>
 
 
 /* Seek to position POS on DIRP.  */
 /* Seek to position POS on DIRP.  */
-extern void seekdir (DIR *__dirp, long int __pos) __THROW;
+extern void seekdir (DIR *__dirp, long int __pos) __THROW __nonnull ((1));
 
 
 /* Return the current position of DIRP.  */
 /* Return the current position of DIRP.  */
-extern long int telldir (DIR *__dirp) __THROW;
+extern long int telldir (DIR *__dirp) __THROW __nonnull ((1));
 #endif
 #endif
 
 
 #if defined __USE_BSD || defined __USE_MISC
 #if defined __USE_BSD || defined __USE_MISC
 
 
 /* Return the file descriptor used by DIRP.  */
 /* Return the file descriptor used by DIRP.  */
-extern int dirfd (DIR *__dirp) __THROW;
+extern int dirfd (DIR *__dirp) __THROW __nonnull ((1));
+
+# if 0 /* defined __OPTIMIZE__ && defined _DIR_dirfd */
+#  define dirfd(dirp)	_DIR_dirfd (dirp)
+# endif
 
 
 # ifndef MAXNAMLEN
 # ifndef MAXNAMLEN
 /* Get the definitions of the POSIX.1 limits.  */
 /* Get the definitions of the POSIX.1 limits.  */
@@ -223,15 +242,16 @@ extern int dirfd (DIR *__dirp) __THROW;
 extern int scandir (__const char *__restrict __dir,
 extern int scandir (__const char *__restrict __dir,
 		    struct dirent ***__restrict __namelist,
 		    struct dirent ***__restrict __namelist,
 		    int (*__selector) (__const struct dirent *),
 		    int (*__selector) (__const struct dirent *),
-		    int (*__cmp) (__const void *, __const void *)) __THROW;
+		    int (*__cmp) (__const void *, __const void *))
+     __nonnull ((1, 2));
 # else
 # else
 #  ifdef __REDIRECT
 #  ifdef __REDIRECT
 extern int __REDIRECT (scandir,
 extern int __REDIRECT (scandir,
 		       (__const char *__restrict __dir,
 		       (__const char *__restrict __dir,
 			struct dirent ***__restrict __namelist,
 			struct dirent ***__restrict __namelist,
 			int (*__selector) (__const struct dirent *),
 			int (*__selector) (__const struct dirent *),
-			int (*__cmp) (__const void *, __const void *)) __THROW,
-		       scandir64);
+			int (*__cmp) (__const void *, __const void *)),
+		       scandir64) __nonnull ((1, 2));
 #  else
 #  else
 #   define scandir scandir64
 #   define scandir scandir64
 #  endif
 #  endif
@@ -243,19 +263,19 @@ extern int __REDIRECT (scandir,
 extern int scandir64 (__const char *__restrict __dir,
 extern int scandir64 (__const char *__restrict __dir,
 		      struct dirent64 ***__restrict __namelist,
 		      struct dirent64 ***__restrict __namelist,
 		      int (*__selector) (__const struct dirent64 *),
 		      int (*__selector) (__const struct dirent64 *),
-		      int (*__cmp) (__const void *, __const void *)) __THROW;
+		      int (*__cmp) (__const void *, __const void *))
+     __nonnull ((1, 2));
 # endif
 # endif
 
 
 /* Function to compare two `struct dirent's alphabetically.  */
 /* Function to compare two `struct dirent's alphabetically.  */
 # ifndef __USE_FILE_OFFSET64
 # ifndef __USE_FILE_OFFSET64
 extern int alphasort (__const void *__e1, __const void *__e2)
 extern int alphasort (__const void *__e1, __const void *__e2)
-     __THROW __attribute_pure__;
+     __THROW __attribute_pure__ __nonnull ((1, 2));
 # else
 # else
 #  ifdef __REDIRECT
 #  ifdef __REDIRECT
 extern int __REDIRECT (alphasort,
 extern int __REDIRECT (alphasort,
-		       (__const void *__e1, __const void *__e2)
-		       __THROW,
-		       alphasort64) __attribute_pure__;
+			   (__const void *__e1, __const void *__e2),
+			   alphasort64) __attribute_pure__ __nonnull ((1, 2));
 #  else
 #  else
 #   define alphasort alphasort64
 #   define alphasort alphasort64
 #  endif
 #  endif
@@ -263,10 +283,9 @@ extern int __REDIRECT (alphasort,
 
 
 # if defined __USE_GNU && defined __USE_LARGEFILE64
 # if defined __USE_GNU && defined __USE_LARGEFILE64
 extern int alphasort64 (__const void *__e1, __const void *__e2)
 extern int alphasort64 (__const void *__e1, __const void *__e2)
-     __THROW __attribute_pure__;
+     __THROW __attribute_pure__ __nonnull ((1, 2));
 # endif
 # endif
 
 
-
 #endif /* Use BSD or misc.  */
 #endif /* Use BSD or misc.  */
 
 
 __END_DECLS
 __END_DECLS

+ 17 - 8
include/sys/wait.h

@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1994,96,97,98,99,2000,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1994,1996-2001,2003,2004 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
@@ -30,7 +30,7 @@ __BEGIN_DECLS
 #include <signal.h>
 #include <signal.h>
 #include <sys/resource.h>
 #include <sys/resource.h>
 
 
-/* These macros could also be defined int <stdlib.h>.  */
+/* These macros could also be defined in <stdlib.h>.  */
 #if !defined _STDLIB_H || !defined __USE_XOPEN
 #if !defined _STDLIB_H || !defined __USE_XOPEN
 /* This will define the `W*' macros for the flag
 /* This will define the `W*' macros for the flag
    bits to `waitpid', `wait3', and `wait4'.  */
    bits to `waitpid', `wait3', and `wait4'.  */
@@ -105,8 +105,11 @@ typedef enum
 
 
 
 
 /* Wait for a child to die.  When one does, put its status in *STAT_LOC
 /* Wait for a child to die.  When one does, put its status in *STAT_LOC
-   and return its process ID.  For errors, return (pid_t) -1.  */
-extern __pid_t wait (__WAIT_STATUS __stat_loc) __THROW;
+   and return its process ID.  For errors, return (pid_t) -1.
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
+extern __pid_t wait (__WAIT_STATUS __stat_loc);
 
 
 #ifdef	__USE_BSD
 #ifdef	__USE_BSD
 /* Special values for the PID argument to `waitpid' and `wait4'.  */
 /* Special values for the PID argument to `waitpid' and `wait4'.  */
@@ -125,8 +128,11 @@ extern __pid_t wait (__WAIT_STATUS __stat_loc) __THROW;
    is not already dead, return (pid_t) 0.  If successful,
    is not already dead, return (pid_t) 0.  If successful,
    return PID and store the dead child's status in STAT_LOC.
    return PID and store the dead child's status in STAT_LOC.
    Return (pid_t) -1 for errors.  If the WUNTRACED bit is
    Return (pid_t) -1 for errors.  If the WUNTRACED bit is
-   set in OPTIONS, return status for stopped children; otherwise don't.  */
-extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options) __THROW;
+   set in OPTIONS, return status for stopped children; otherwise don't.
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
+extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options);
 
 
 #if defined __USE_SVID || defined __USE_XOPEN
 #if defined __USE_SVID || defined __USE_XOPEN
 # define __need_siginfo_t
 # define __need_siginfo_t
@@ -138,9 +144,12 @@ extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options) __THROW;
    If IDTYPE is P_ALL, match any process.
    If IDTYPE is P_ALL, match any process.
    If the WNOHANG bit is set in OPTIONS, and that child
    If the WNOHANG bit is set in OPTIONS, and that child
    is not already dead, clear *INFOP and return 0.  If successful, store
    is not already dead, clear *INFOP and return 0.  If successful, store
-   exit code and status in *INFOP.  */
+   exit code and status in *INFOP.
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
 extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop,
 extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop,
-		   int __options) __THROW;
+		   int __options);
 #endif
 #endif
 
 
 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED

+ 2 - 13
include/time.h

@@ -143,10 +143,10 @@ struct tm
 #ifdef __UCLIBC_HAS_TM_EXTENSIONS__
 #ifdef __UCLIBC_HAS_TM_EXTENSIONS__
 #ifdef	__USE_BSD
 #ifdef	__USE_BSD
   long int tm_gmtoff;		/* Seconds east of UTC.  */
   long int tm_gmtoff;		/* Seconds east of UTC.  */
-  __const char *tm_zone;	/* Timezone abbreviation. */
+  __const char *tm_zone;	/* Timezone abbreviation.  */
 #else
 #else
   long int __tm_gmtoff;		/* Seconds east of UTC.  */
   long int __tm_gmtoff;		/* Seconds east of UTC.  */
-  __const char *__tm_zone;	/* Timezone abbreviation. */
+  __const char *__tm_zone;	/* Timezone abbreviation.  */
 #endif
 #endif
 #endif /* __UCLIBC_HAS_TM_EXTENSIONS__ */
 #endif /* __UCLIBC_HAS_TM_EXTENSIONS__ */
 };
 };
@@ -225,17 +225,6 @@ extern size_t strftime_l (char *__restrict __s, size_t __maxsize,
 extern char *strptime_l (__const char *__restrict __s,
 extern char *strptime_l (__const char *__restrict __s,
 			 __const char *__restrict __fmt, struct tm *__tp,
 			 __const char *__restrict __fmt, struct tm *__tp,
 			 __locale_t __loc) __THROW;
 			 __locale_t __loc) __THROW;
-
-
-extern size_t __strftime_l (char *__restrict __s, size_t __maxsize,
-							__const char *__restrict __format,
-							__const struct tm *__restrict __tp,
-							__locale_t __loc) __THROW;
-
-extern char *__strptime_l (__const char *__restrict __s,
-						   __const char *__restrict __fmt, struct tm *__tp,
-						   __locale_t __loc) __THROW;
-
 # endif
 # endif
 #endif
 #endif