From 005d20f04dff3665c9533417bdad06d7d208bf9a Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Fri, 4 Nov 2005 22:52:26 +0000 Subject: Sync up w/ glibc --- include/arpa/nameser.h | 100 +++++++++---------- include/cpio.h | 1 - include/err.h | 18 ++-- include/error.h | 13 ++- include/ftw.h | 42 ++++++-- include/grp.h | 111 ++++++++++++++++----- include/iconv.h | 20 ++-- include/libintl.h | 4 +- include/link.h | 16 ++- include/math.h | 18 ++-- include/net/if_ppp.h | 2 +- include/netdb.h | 4 +- include/nl_types.h | 13 ++- include/paths.h | 18 ++-- include/pwd.h | 85 +++++++++++----- include/regexp.h | 5 +- include/rpc/auth.h | 20 ++-- include/rpc/clnt.h | 6 +- include/shadow.h | 84 ++++++++++++---- include/signal.h | 106 ++++++++++++-------- include/stdio_ext.h | 20 ++-- include/stdlib.h | 257 ++++++++++++++++++++++++++++++++++--------------- include/string.h | 8 +- include/sys/epoll.h | 2 +- include/sys/kd.h | 6 ++ include/sys/mman.h | 27 ++++-- include/sys/msg.h | 16 ++- include/sys/poll.h | 4 +- include/sys/sendfile.h | 11 +-- include/sys/socket.h | 69 ++++++++----- include/sys/stat.h | 83 ++++++++++------ include/sys/statvfs.h | 24 +++-- include/sys/syslog.h | 31 ++++-- include/sys/uio.h | 22 +++-- include/sys/wait.h | 3 + include/termios.h | 9 +- include/utime.h | 7 +- include/utmp.h | 13 +++ include/wordexp.h | 4 +- 39 files changed, 865 insertions(+), 437 deletions(-) diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h index 6ae1bc61e..496c8dbe8 100644 --- a/include/arpa/nameser.h +++ b/include/arpa/nameser.h @@ -1,7 +1,7 @@ /* * Copyright (c) 1983, 1989, 1993 * The Regents of the University of California. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -499,53 +499,55 @@ typedef enum __ns_cert_types { #define ns_samename __ns_samename __BEGIN_DECLS -u_int ns_get16 __P((const u_char *)); -u_long ns_get32 __P((const u_char *)); -void ns_put16 __P((u_int, u_char *)); -void ns_put32 __P((u_long, u_char *)); -int ns_initparse __P((const u_char *, int, ns_msg *)); -int ns_skiprr __P((const u_char *, const u_char *, ns_sect, int)); -int ns_parserr __P((ns_msg *, ns_sect, int, ns_rr *)); -int ns_sprintrr __P((const ns_msg *, const ns_rr *, - const char *, const char *, char *, size_t)); -int ns_sprintrrf __P((const u_char *, size_t, const char *, - ns_class, ns_type, u_long, const u_char *, - size_t, const char *, const char *, - char *, size_t)); -int ns_format_ttl __P((u_long, char *, size_t)); -int ns_parse_ttl __P((const char *, u_long *)); -u_int32_t ns_datetosecs __P((const char *cp, int *errp)); -int ns_name_ntol __P((const u_char *, u_char *, size_t)); -int ns_name_ntop __P((const u_char *, char *, size_t)); -int ns_name_pton __P((const char *, u_char *, size_t)); -int ns_name_unpack __P((const u_char *, const u_char *, - const u_char *, u_char *, size_t)); -int ns_name_pack __P((const u_char *, u_char *, int, - const u_char **, const u_char **)); -int ns_name_uncompress __P((const u_char *, const u_char *, - const u_char *, char *, size_t)); -int ns_name_compress __P((const char *, u_char *, size_t, - const u_char **, const u_char **)); -int ns_name_skip __P((const u_char **, const u_char *)); -void ns_name_rollback __P((const u_char *, const u_char **, - const u_char **)); -int ns_sign __P((u_char *, int *, int, int, void *, - const u_char *, int, u_char *, int *, time_t)); -int ns_sign_tcp __P((u_char *, int *, int, int, - ns_tcp_tsig_state *, int)); -int ns_sign_tcp_init __P((void *, const u_char *, int, - ns_tcp_tsig_state *)); -u_char *ns_find_tsig __P((u_char *, u_char *)); -int ns_verify __P((u_char *, int *, void *, - const u_char *, int, u_char *, int *, - time_t *, int)); -int ns_verify_tcp __P((u_char *, int *, ns_tcp_tsig_state *, int)); -int ns_verify_tcp_init __P((void *, const u_char *, int, - ns_tcp_tsig_state *)); -int ns_samedomain __P((const char *, const char *)); -int ns_subdomain __P((const char *, const char *)); -int ns_makecanon __P((const char *, char *, size_t)); -int ns_samename __P((const char *, const char *)); +u_int ns_get16 (const u_char *) __THROW; +u_long ns_get32 (const u_char *) __THROW; +void ns_put16 (u_int, u_char *) __THROW; +void ns_put32 (u_long, u_char *) __THROW; +int ns_initparse (const u_char *, int, ns_msg *) __THROW; +int ns_skiprr (const u_char *, const u_char *, ns_sect, int) + __THROW; +int ns_parserr (ns_msg *, ns_sect, int, ns_rr *) __THROW; +int ns_sprintrr (const ns_msg *, const ns_rr *, + const char *, const char *, char *, size_t) + __THROW; +int ns_sprintrrf (const u_char *, size_t, const char *, + ns_class, ns_type, u_long, const u_char *, + size_t, const char *, const char *, + char *, size_t) __THROW; +int ns_format_ttl (u_long, char *, size_t) __THROW; +int ns_parse_ttl (const char *, u_long *) __THROW; +u_int32_t ns_datetosecs (const char *cp, int *errp) __THROW; +int ns_name_ntol (const u_char *, u_char *, size_t) __THROW; +int ns_name_ntop (const u_char *, char *, size_t) __THROW; +int ns_name_pton (const char *, u_char *, size_t) __THROW; +int ns_name_unpack (const u_char *, const u_char *, + const u_char *, u_char *, size_t) __THROW; +int ns_name_pack (const u_char *, u_char *, int, + const u_char **, const u_char **) __THROW; +int ns_name_uncompress (const u_char *, const u_char *, + const u_char *, char *, size_t) __THROW; +int ns_name_compress (const char *, u_char *, size_t, + const u_char **, const u_char **) __THROW; +int ns_name_skip (const u_char **, const u_char *) __THROW; +void ns_name_rollback (const u_char *, const u_char **, + const u_char **) __THROW; +int ns_sign (u_char *, int *, int, int, void *, + const u_char *, int, u_char *, int *, time_t) __THROW; +int ns_sign_tcp (u_char *, int *, int, int, + ns_tcp_tsig_state *, int) __THROW; +int ns_sign_tcp_init (void *, const u_char *, int, + ns_tcp_tsig_state *) __THROW; +u_char *ns_find_tsig (u_char *, u_char *) __THROW; +int ns_verify (u_char *, int *, void *, const u_char *, int, + u_char *, int *, time_t *, int) __THROW; +int ns_verify_tcp (u_char *, int *, ns_tcp_tsig_state *, int) + __THROW; +int ns_verify_tcp_init (void *, const u_char *, int, + ns_tcp_tsig_state *) __THROW; +int ns_samedomain (const char *, const char *) __THROW; +int ns_subdomain (const char *, const char *) __THROW; +int ns_makecanon (const char *, char *, size_t) __THROW; +int ns_samename (const char *, const char *) __THROW; __END_DECLS #ifdef BIND_4_COMPAT diff --git a/include/cpio.h b/include/cpio.h index a2fefab51..fae32752a 100644 --- a/include/cpio.h +++ b/include/cpio.h @@ -2,7 +2,6 @@ This file is part of the GNU C Library. Copyright (C) 1992, 1998 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU cpio. - Bugs can be reported to bug-glibc@gnu.org. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/include/err.h b/include/err.h index 9791a659c..7ff3553ab 100644 --- a/include/err.h +++ b/include/err.h @@ -1,5 +1,5 @@ /* 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. 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, and a newline, on stderr. */ 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) - __THROW __attribute__ ((__format__ (__printf__, 1, 0))); + __attribute__ ((__format__ (__printf__, 1, 0))); /* Likewise, but without ": " and the standard error string. */ 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) - __THROW __attribute__ ((__format__ (__printf__, 1, 0))); + __attribute__ ((__format__ (__printf__, 1, 0))); /* Likewise, and then exit with STATUS. */ 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) - __THROW __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0))); + __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0))); 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) - __THROW __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0))); + __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0))); __END_DECLS diff --git a/include/error.h b/include/error.h index da5cf2f16..3638bc6e9 100644 --- a/include/error.h +++ b/include/error.h @@ -1,7 +1,6 @@ /* Declaration for error-reporting function - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. Its master source is NOT part of - the C library, however. The master source lives in /gd/gnu/lib. + Copyright (C) 1995, 1996, 1997, 2003 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 modify it under the terms of the GNU Lesser General Public @@ -38,17 +37,17 @@ extern "C" { #endif -#if defined (__STDC__) && __STDC__ +#if defined __STDC__ && __STDC__ /* Print a message with `fprintf (stderr, FORMAT, ...)'; if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM). If STATUS is nonzero, terminate the program with `exit (STATUS)'. */ -extern void error (int status, int errnum, const char *format, ...) +extern void error (int __status, int __errnum, const char *__format, ...) __attribute__ ((__format__ (__printf__, 3, 4))); -extern void error_at_line (int status, int errnum, const char *fname, - unsigned int lineno, const char *format, ...) +extern void error_at_line (int __status, int __errnum, const char *__fname, + unsigned int __lineno, const char *__format, ...) __attribute__ ((__format__ (__printf__, 5, 6))); /* If NULL, error will flush stdout, then print on stderr the program diff --git a/include/ftw.h b/include/ftw.h index 4939297b3..b1f7e09cb 100644 --- a/include/ftw.h +++ b/include/ftw.h @@ -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 @@ -74,7 +74,33 @@ enum # define FTW_CHDIR FTW_CHDIR FTW_DEPTH = 8 /* Report files in directory before directory itself.*/ # define FTW_DEPTH FTW_DEPTH +# if 0 /* def __USE_GNU */ + , + FTW_ACTIONRETVAL = 16 /* Assume callback to return FTW_* values instead of + zero to continue and non-zero to terminate. */ +# define FTW_ACTIONRETVAL FTW_ACTIONRETVAL +# endif +}; + +#if 0 /* def __USE_GNU */ +/* Return values from callback functions. */ +enum +{ + FTW_CONTINUE = 0, /* Continue with next sibling or for FTW_D with the + first child. */ +# define FTW_CONTINUE FTW_CONTINUE + FTW_STOP = 1, /* Return from `ftw' or `nftw' with FTW_STOP as return + value. */ +# define FTW_STOP FTW_STOP + FTW_SKIP_SUBTREE = 2, /* Only meaningful for FTW_D: Don't walk through the + subtree, instead just continue with its next + sibling. */ +# define FTW_SKIP_SUBTREE FTW_SKIP_SUBTREE + FTW_SKIP_SIBLINGS = 3,/* Continue with FTW_DP callback for current directory + (if FTW_DEPTH) and then its siblings. */ +# define FTW_SKIP_SIBLINGS FTW_SKIP_SIBLINGS }; +#endif /* Structure used for fourth argument to callback function for `nftw'. */ struct FTW @@ -108,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 @@ -130,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 diff --git a/include/grp.h b/include/grp.h index 48cce31e3..6ad8be1dd 100644 --- a/include/grp.h +++ b/include/grp.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991,92,95,96,97,98,99,2000,01 Free Software Foundation, Inc. +/* Copyright (C) 1991,1992,1995-2001,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 @@ -34,7 +34,7 @@ __BEGIN_DECLS /* For the Single Unix specification we must define this type here. */ -#if defined __USE_XOPEN && !defined __gid_t_defined +#if (defined __USE_XOPEN || defined __USE_XOPEN2K) && !defined __gid_t_defined typedef __gid_t gid_t; # define __gid_t_defined #endif @@ -56,32 +56,57 @@ struct group #if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED -/* Rewind the group-file stream. */ -extern void setgrent (void) __THROW; +/* Rewind the group-file stream. -/* Close the group-file stream. */ -extern void endgrent (void) __THROW; + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern void setgrent (void); -/* Read an entry from the group-file stream, opening it if necessary. */ -extern struct group *getgrent (void) __THROW; +/* Close the group-file stream. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern void endgrent (void); + +/* Read an entry from the group-file stream, opening it if necessary. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern struct group *getgrent (void); #endif #ifdef __USE_SVID -/* Read a group entry from STREAM. */ -extern struct group *fgetgrent (FILE *__stream) __THROW; +/* Read a group entry from STREAM. + + This function is not part of POSIX and therefore no official + cancellation point. But due to similarity with an POSIX interface + or due to the implementation it is a cancellation point and + therefore not marked with __THROW. */ +extern struct group *fgetgrent (FILE *__stream); #endif #ifdef __USE_GNU -/* Write the given entry onto the given stream. */ +/* Write the given entry onto the given stream. + + This function is not part of POSIX and therefore no official + cancellation point. But due to similarity with an POSIX interface + or due to the implementation it is a cancellation point and + therefore not marked with __THROW. */ extern int putgrent (__const struct group *__restrict __p, - FILE *__restrict __f) __THROW; + FILE *__restrict __f); #endif -/* Search for an entry with a matching group ID. */ -extern struct group *getgrgid (__gid_t __gid) __THROW; +/* Search for an entry with a matching group ID. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern struct group *getgrgid (__gid_t __gid); + +/* Search for an entry with a matching group name. -/* Search for an entry with a matching group name. */ -extern struct group *getgrnam (__const char *__name) __THROW; + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern struct group *getgrnam (__const char *__name); #if defined __USE_POSIX || defined __USE_MISC @@ -97,32 +122,48 @@ extern struct group *getgrnam (__const char *__name) __THROW; The interface may change in later versions of this library. But the interface is designed following the principals used for the other reentrant functions so the chances are good this is what the - POSIX people would choose. */ + POSIX people would choose. + + This function is not part of POSIX and therefore no official + cancellation point. But due to similarity with an POSIX interface + or due to the implementation it is a cancellation point and + therefore not marked with __THROW. */ # ifdef __USE_GNU extern int getgrent_r (struct group *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, - struct group **__restrict __result) __THROW; + struct group **__restrict __result); # endif -/* Search for an entry with a matching group ID. */ +/* Search for an entry with a matching group ID. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ extern int getgrgid_r (__gid_t __gid, struct group *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, - struct group **__restrict __result) __THROW; + struct group **__restrict __result); -/* Search for an entry with a matching group name. */ +/* Search for an entry with a matching group name. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ extern int getgrnam_r (__const char *__restrict __name, struct group *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, - struct group **__restrict __result) __THROW; + struct group **__restrict __result); # ifdef __USE_SVID /* Read a group entry from STREAM. This function is not standardized - an probably never will. */ + an probably never will. + + This function is not part of POSIX and therefore no official + cancellation point. But due to similarity with an POSIX interface + or due to the implementation it is a cancellation point and + therefore not marked with __THROW. */ extern int fgetgrent_r (FILE *__restrict __stream, struct group *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, - struct group **__restrict __result) __THROW; + struct group **__restrict __result); # endif #endif /* POSIX or reentrant */ @@ -136,10 +177,28 @@ extern int fgetgrent_r (FILE *__restrict __stream, /* Set the group set for the current user to GROUPS (N of them). */ extern int setgroups (size_t __n, __const __gid_t *__groups) __THROW; +#if 0 +/* Store at most *NGROUPS members of the group set for USER into + *GROUPS. Also include GROUP. The actual number of groups found is + returned in *NGROUPS. Return -1 if the if *NGROUPS is too small. + + This function is not part of POSIX and therefore no official + cancellation point. But due to similarity with an POSIX interface + or due to the implementation it is a cancellation point and + therefore not marked with __THROW. */ +extern int getgrouplist (__const char *__user, __gid_t __group, + __gid_t *__groups, int *__ngroups); +#endif + /* Initialize the group set for the current user by reading the group database and using all groups - of which USER is a member. Also include GROUP. */ -extern int initgroups (__const char *__user, __gid_t __group) __THROW; + of which USER is a member. Also include GROUP. + + This function is not part of POSIX and therefore no official + cancellation point. But due to similarity with an POSIX interface + or due to the implementation it is a cancellation point and + therefore not marked with __THROW. */ +extern int initgroups (__const char *__user, __gid_t __group); #endif /* Use BSD. */ diff --git a/include/iconv.h b/include/iconv.h index e17360335..0a19c049d 100644 --- a/include/iconv.h +++ b/include/iconv.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998, 1999, 2000, 2003 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 @@ -24,9 +24,10 @@ #include #ifndef __UCLIBC_HAS_LOCALE__ -#error Attempted to include iconv.h when uClibc built without locale support. +#error Attempted to include iconv.h when uClibc was built without locale support. #endif + __BEGIN_DECLS /* Identifier for conversion method from one codeset to another. */ @@ -34,9 +35,11 @@ typedef void *iconv_t; /* Allocate descriptor for code conversion from codeset FROMCODE to - codeset TOCODE. */ -extern iconv_t iconv_open (__const char *__tocode, __const char *__fromcode) - __THROW; + codeset TOCODE. + + This function is a possible cancellation points and therefore not + marked with __THROW. */ +extern iconv_t iconv_open (__const char *__tocode, __const char *__fromcode); /* Convert at most *INBYTESLEFT bytes from *INBUF according to the code conversion algorithm specified by CD and place up to @@ -46,8 +49,11 @@ extern size_t iconv (iconv_t __cd, char **__restrict __inbuf, char **__restrict __outbuf, size_t *__restrict __outbytesleft); -/* Free resources allocated for descriptor CD for code conversion. */ -extern int iconv_close (iconv_t __cd) __THROW; +/* Free resources allocated for descriptor CD for code conversion. + + This function is a possible cancellation points and therefore not + marked with __THROW. */ +extern int iconv_close (iconv_t __cd); __END_DECLS diff --git a/include/libintl.h b/include/libintl.h index 1ba9d0d8c..fd009c3d6 100644 --- a/include/libintl.h +++ b/include/libintl.h @@ -1,5 +1,5 @@ /* Message catalogs for internationalization. - Copyright (C) 1995-1999, 2000-2002 Free Software Foundation, Inc. + Copyright (C) 1995-1999, 2000-2002, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. This file is derived from the file libgettext.h in the GNU gettext package. @@ -97,7 +97,7 @@ extern char *bind_textdomain_codeset (__const char *__domainname, /* Optimized version of the function above. */ -#if defined __OPTIMIZE__ +#if defined __OPTIMIZE__ && !defined __cplusplus /* We need NULL for `gettext'. */ # define __need_NULL diff --git a/include/link.h b/include/link.h index f8e7f629d..6fa4d0fc0 100644 --- a/include/link.h +++ b/include/link.h @@ -1,6 +1,6 @@ /* Data structure for communication from the run-time dynamic linker for loaded ELF shared objects. - Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1995-1999, 2000, 2001, 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 @@ -100,13 +100,25 @@ struct dl_phdr_info const char *dlpi_name; const ElfW(Phdr) *dlpi_phdr; ElfW(Half) dlpi_phnum; + +#if 0 + /* Note: the next two members were introduced after the first + version of this structure was available. Check the SIZE + argument passed to the dl_iterate_phdr() callback to determine + whether or not they are provided. */ + + /* Incremented when a new object may have been added. */ + unsigned long long int dlpi_adds; + /* Incremented when an object may have been removed. */ + unsigned long long int dlpi_subs; +#endif }; __BEGIN_DECLS extern int dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info, size_t size, void *data), - void *data) __THROW; + void *data); __END_DECLS diff --git a/include/math.h b/include/math.h index 8a2e86c2f..8c11b5a76 100644 --- a/include/math.h +++ b/include/math.h @@ -32,8 +32,8 @@ __BEGIN_DECLS On all IEEE754 machines, this is +Infinity. */ #include -/* Get machine-dependent NAN value (returned for some domain errors). */ #ifdef __USE_ISOC99 +/* Get machine-dependent NAN value (returned for some domain errors). */ # include #endif /* Get general and ISO C99 specific information. */ @@ -115,7 +115,7 @@ extern int signgam; /* ISO C99 defines some generic macros which work on any data type. */ -#if __USE_ISOC99 +#ifdef __USE_ISOC99 /* Get the architecture specific values describing the floating-point evaluation. The following symbols will get defined: @@ -323,7 +323,7 @@ extern int matherr (struct exception *__exc); GNU extension. Provide enough digits for the 128-bit IEEE quad. */ #ifdef __USE_GNU # define M_El 2.7182818284590452353602874713526625L /* e */ -# define M_LOG2El 1.4426950408889634073599246810018922L /* log_2 e */ +# define M_LOG2El 1.4426950408889634073599246810018921L /* log_2 e */ # define M_LOG10El 0.4342944819032518276511289189166051L /* log_10 e */ # define M_LN2l 0.6931471805599453094172321214581766L /* log_e 2 */ # define M_LN10l 2.3025850929940456840179914546843642L /* log_e 10 */ @@ -351,12 +351,12 @@ extern int matherr (struct exception *__exc); #endif -#if __USE_ISOC99 -/* ISO C99 defines some macros to compare number while taking care - for unordered numbers. Since many FPUs provide special - instructions to support these operations and these tests are - defined in , we define the generic macros at - this late point and only if they are not defined yet. */ +#ifdef __USE_ISOC99 +/* ISO C99 defines some macros to compare number while taking care for + unordered numbers. Many FPUs provide special instructions to support + these operations and these tests are defined in , + we define the generic macros at this late point and only if they are + not defined yet. */ /* Return nonzero value if X is greater than Y. */ # ifndef isgreater diff --git a/include/net/if_ppp.h b/include/net/if_ppp.h index 1b1c3ea6e..bf5ec8387 100644 --- a/include/net/if_ppp.h +++ b/include/net/if_ppp.h @@ -3,7 +3,7 @@ /* * if_ppp.h - Point-to-Point Protocol definitions. * - * Copyright (c) 1989 Carnegie Mellon University. + * Copyright (c) 1989 Carnegie Mellon University. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/netdb.h b/include/netdb.h index 9ed963d87..fe3da8239 100644 --- a/include/netdb.h +++ b/include/netdb.h @@ -58,7 +58,7 @@ __BEGIN_DECLS We always need the extern int here in case internal libc code undefines the macro because it needs access to the underlying storage. */ extern int h_errno; -#if defined(__UCLIBC_HAS_THREADS__) +#ifdef __UCLIBC_HAS_THREADS__ # define h_errno (*__h_errno_location ()) #endif @@ -392,7 +392,7 @@ extern int getprotobynumber_r (int __proto, struct protoent **__restrict __result); -#if defined(__UCLIBC_HAS_NETGROUP__) +#ifdef __UCLIBC_HAS_NETGROUP__ /* Establish network group NETGROUP for enumeration. This function is not part of POSIX and therefore no official diff --git a/include/nl_types.h b/include/nl_types.h index 65b7d9e47..74e762113 100644 --- a/include/nl_types.h +++ b/include/nl_types.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 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 @@ -40,16 +40,19 @@ typedef void *nl_catd; /* Type used by `nl_langinfo'. */ typedef int nl_item; -/* Open message catalog for later use, returning descriptor. */ -extern nl_catd catopen (__const char *__cat_name, int __flag) __THROW; +/* Open message catalog for later use, returning descriptor. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern nl_catd catopen (__const char *__cat_name, int __flag) __nonnull ((1)); /* Return translation with NUMBER in SET of CATALOG; if not found return STRING. */ extern char *catgets (nl_catd __catalog, int __set, int __number, - __const char *__string) __THROW; + __const char *__string) __THROW __nonnull ((1)); /* Close message CATALOG. */ -extern int catclose (nl_catd __catalog) __THROW; +extern int catclose (nl_catd __catalog) __THROW __nonnull ((1)); __END_DECLS diff --git a/include/paths.h b/include/paths.h index 90edcf8fd..ae892c4cf 100644 --- a/include/paths.h +++ b/include/paths.h @@ -56,22 +56,24 @@ #define _PATH_PRESERVE "/var/lib" #define _PATH_RWHODIR "/var/spool/rwho" #define _PATH_SENDMAIL "/usr/sbin/sendmail" +#define _PATH_SHADOW "/etc/shadow" #define _PATH_SHELLS "/etc/shells" #define _PATH_TTY "/dev/tty" #define _PATH_UNIX "/boot/vmlinux" -#define _PATH_UTMP "/var/run/utmp" +#define _PATH_UTMP "/var/run/utmp" #define _PATH_VI "/usr/bin/vi" -#define _PATH_WTMP "/var/log/wtmp" -#define _PATH_LOCALE "/usr/lib/locale" -#define _PATH_LASTLOG "/var/log/lastlog" -#define _PATH_SHADOW "/etc/shadow" -#define _PATH_PASSWD "/etc/passwd" -#define _PATH_GROUP "/etc/group" +#define _PATH_WTMP "/var/log/wtmp" + +/* uClibc */ +#ifdef _LIBC +#define _PATH_PASSWD "/etc/passwd" +#define _PATH_GROUP "/etc/group" +#endif /* Provide trailing slash, since mostly used for building pathnames. */ #define _PATH_DEV "/dev/" #define _PATH_TMP "/tmp/" -#define _PATH_VARDB "/var/lib/misc/" +#define _PATH_VARDB "/var/db/" #define _PATH_VARRUN "/var/run/" #define _PATH_VARTMP "/var/tmp/" diff --git a/include/pwd.h b/include/pwd.h index 8a54578b8..e87413304 100644 --- a/include/pwd.h +++ b/include/pwd.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991,92,95,96,97,98,99,2001 Free Software Foundation, Inc. +/* Copyright (C) 1991,1992,1995-2001,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 @@ -32,7 +32,7 @@ __BEGIN_DECLS #define __need_size_t #include -#ifdef __USE_XOPEN +#if defined __USE_XOPEN || defined __USE_XOPEN2K /* The Single Unix specification says that some more types are available here. */ # ifndef __gid_t_defined @@ -66,30 +66,55 @@ struct passwd #if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN_EXTENDED -/* Rewind the password-file stream. */ -extern void setpwent (void) __THROW; +/* Rewind the password-file stream. -/* Close the password-file stream. */ -extern void endpwent (void) __THROW; + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern void setpwent (void); -/* Read an entry from the password-file stream, opening it if necessary. */ -extern struct passwd *getpwent (void) __THROW; +/* Close the password-file stream. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern void endpwent (void); + +/* Read an entry from the password-file stream, opening it if necessary. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern struct passwd *getpwent (void); #endif #ifdef __USE_SVID -/* Read an entry from STREAM. */ -extern struct passwd *fgetpwent (FILE *__stream) __THROW; +/* Read an entry from STREAM. + + This function is not part of POSIX and therefore no official + cancellation point. But due to similarity with an POSIX interface + or due to the implementation it is a cancellation point and + therefore not marked with __THROW. */ +extern struct passwd *fgetpwent (FILE *__stream); + +/* Write the given entry onto the given stream. -/* Write the given entry onto the given stream. */ + This function is not part of POSIX and therefore no official + cancellation point. But due to similarity with an POSIX interface + or due to the implementation it is a cancellation point and + therefore not marked with __THROW. */ extern int putpwent (__const struct passwd *__restrict __p, - FILE *__restrict __f) __THROW; + FILE *__restrict __f); #endif -/* Search for an entry with a matching user ID. */ -extern struct passwd *getpwuid (__uid_t __uid) __THROW; +/* Search for an entry with a matching user ID. -/* Search for an entry with a matching username. */ -extern struct passwd *getpwnam (__const char *__name) __THROW; + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern struct passwd *getpwuid (__uid_t __uid); + +/* Search for an entry with a matching username. + + This function is a possible cancellation point and therefore not + marked with __THROW. */ +extern struct passwd *getpwnam (__const char *__name); #if defined __USE_POSIX || defined __USE_MISC @@ -108,29 +133,38 @@ extern struct passwd *getpwnam (__const char *__name) __THROW; POSIX people would choose. */ # if defined __USE_SVID || defined __USE_MISC +/* This function is not part of POSIX and therefore no official + cancellation point. But due to similarity with an POSIX interface + or due to the implementation it is a cancellation point and + therefore not marked with __THROW. */ extern int getpwent_r (struct passwd *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, - struct passwd **__restrict __result) __THROW; + struct passwd **__restrict __result); # endif extern int getpwuid_r (__uid_t __uid, struct passwd *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, - struct passwd **__restrict __result) __THROW; + struct passwd **__restrict __result); extern int getpwnam_r (__const char *__restrict __name, struct passwd *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, - struct passwd **__restrict __result) __THROW; + struct passwd **__restrict __result); # ifdef __USE_SVID /* Read an entry from STREAM. This function is not standardized and - probably never will. */ + probably never will. + + This function is not part of POSIX and therefore no official + cancellation point. But due to similarity with an POSIX interface + or due to the implementation it is a cancellation point and + therefore not marked with __THROW. */ extern int fgetpwent_r (FILE *__restrict __stream, struct passwd *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, - struct passwd **__restrict __result) __THROW; + struct passwd **__restrict __result); # endif #endif /* POSIX or reentrant */ @@ -138,8 +172,13 @@ extern int fgetpwent_r (FILE *__restrict __stream, #ifdef __USE_GNU /* Re-construct the password-file line for the given uid in the given buffer. This knows the format that the caller - will expect, but this need not be the format of the password file. */ -extern int getpw (__uid_t __uid, char *__buffer) __THROW; + will expect, but this need not be the format of the password file. + + This function is not part of POSIX and therefore no official + cancellation point. But due to similarity with an POSIX interface + or due to the implementation it is a cancellation point and + therefore not marked with __THROW. */ +extern int getpw (__uid_t __uid, char *__buffer); #endif __END_DECLS diff --git a/include/regexp.h b/include/regexp.h index bb1c4017f..b7b50b710 100644 --- a/include/regexp.h +++ b/include/regexp.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 1998, 1999, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. @@ -22,7 +22,8 @@ /* The contents of this header file was first standardized in X/Open System Interface and Headers Issue 2, originally coming from SysV. - In issue 4, version 2, it is marked as TO BE WITDRAWN. + In issue 4, version 2, it is marked as TO BE WITDRAWN, and it has + been withdrawn in SUSv3. This code shouldn't be used in any newly written code. It is included only for compatibility reasons. Use the POSIX definition diff --git a/include/rpc/auth.h b/include/rpc/auth.h index b0ff4d5de..17eb59f70 100644 --- a/include/rpc/auth.h +++ b/include/rpc/auth.h @@ -170,8 +170,8 @@ extern struct opaque_auth _null_auth; * int *aup_gids; */ extern AUTH *authunix_create (char *__machname, __uid_t __uid, __gid_t __gid, - int __len, __gid_t *__aup_gids) __THROW; -extern AUTH *authunix_create_default (void) __THROW; + int __len, __gid_t *__aup_gids); +extern AUTH *authunix_create_default (void); extern AUTH *authnone_create (void) __THROW; extern AUTH *authdes_create (const char *__servername, u_int __window, struct sockaddr *__syncaddr, des_block *__ckey) @@ -205,14 +205,14 @@ extern int netname2host (__const char *, char *, __const int) __THROW; * These routines interface to the keyserv daemon * */ -extern int key_decryptsession (char *, des_block *) __THROW; -extern int key_decryptsession_pk (char *, netobj *, des_block *) __THROW; -extern int key_encryptsession (char *, des_block *) __THROW; -extern int key_encryptsession_pk (char *, netobj *, des_block *) __THROW; -extern int key_gendes (des_block *) __THROW; -extern int key_setsecret (char *) __THROW; -extern int key_secretkey_is_set (void) __THROW; -extern int key_get_conv (char *, des_block *) __THROW; +extern int key_decryptsession (char *, des_block *); +extern int key_decryptsession_pk (char *, netobj *, des_block *); +extern int key_encryptsession (char *, des_block *); +extern int key_encryptsession_pk (char *, netobj *, des_block *); +extern int key_gendes (des_block *); +extern int key_setsecret (char *); +extern int key_secretkey_is_set (void); +extern int key_get_conv (char *, des_block *); /* * XDR an opaque authentication struct. diff --git a/include/rpc/clnt.h b/include/rpc/clnt.h index a19fc773b..cf271c5c1 100644 --- a/include/rpc/clnt.h +++ b/include/rpc/clnt.h @@ -368,18 +368,18 @@ extern int _rpc_dtablesize (void) __THROW; /* * Print why creation failed */ -extern void clnt_pcreateerror (__const char *__msg) __THROW; /* stderr */ +extern void clnt_pcreateerror (__const char *__msg); /* stderr */ extern char *clnt_spcreateerror(__const char *__msg) __THROW; /* string */ /* * Like clnt_perror(), but is more verbose in its output */ -extern void clnt_perrno (enum clnt_stat __num) __THROW; /* stderr */ +extern void clnt_perrno (enum clnt_stat __num); /* stderr */ /* * Print an English error message, given the client error code */ -extern void clnt_perror (CLIENT *__clnt, __const char *__msg) __THROW; +extern void clnt_perror (CLIENT *__clnt, __const char *__msg); /* stderr */ extern char *clnt_sperror (CLIENT *__clnt, __const char *__msg) __THROW; /* string */ diff --git a/include/shadow.h b/include/shadow.h index 81ddc71f1..778df52b9 100644 --- a/include/shadow.h +++ b/include/shadow.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 1998, 1999, 2003 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 @@ -54,46 +54,90 @@ struct spwd }; -/* Open database for reading. */ -extern void setspent (void) __THROW; +/* Open database for reading. -/* Close database. */ -extern void endspent (void) __THROW; + This function is not part of POSIX and therefore no official + cancellation point. But due to similarity with an POSIX interface + or due to the implementation it is a cancellation point and + therefore not marked with __THROW. */ +extern void setspent (void); -/* Get next entry from database, perhaps after opening the file. */ -extern struct spwd *getspent (void) __THROW; +/* Close database. -/* Get shadow entry matching NAME. */ -extern struct spwd *getspnam (__const char *__name) __THROW; + This function is not part of POSIX and therefore no official + cancellation point. But due to similarity with an POSIX interface + or due to the implementation it is a cancellation point and + therefore not marked with __THROW. */ +extern void endspent (void); -/* Read shadow entry from STRING. */ -extern struct spwd *sgetspent (__const char *__string) __THROW; +/* Get next entry from database, perhaps after opening the file. -/* Read next shadow entry from STREAM. */ -extern struct spwd *fgetspent (FILE *__stream) __THROW; + This function is not part of POSIX and therefore no official + cancellation point. But due to similarity with an POSIX interface + or due to the implementation it is a cancellation point and + therefore not marked with __THROW. */ +extern struct spwd *getspent (void); -/* Write line containing shadow password entry to stream. */ -extern int putspent (__const struct spwd *__p, FILE *__stream) __THROW; +/* Get shadow entry matching NAME. + + This function is not part of POSIX and therefore no official + cancellation point. But due to similarity with an POSIX interface + or due to the implementation it is a cancellation point and + therefore not marked with __THROW. */ +extern struct spwd *getspnam (__const char *__name); + +/* Read shadow entry from STRING. + + This function is not part of POSIX and therefore no official + cancellation point. But due to similarity with an POSIX interface + or due to the implementation it is a cancellation point and + therefore not marked with __THROW. */ +extern struct spwd *sgetspent (__const char *__string); + +/* Read next shadow entry from STREAM. + + This function is not part of POSIX and therefore no official + cancellation point. But due to similarity with an POSIX interface + or due to the implementation it is a cancellation point and + therefore not marked with __THROW. */ +extern struct spwd *fgetspent (FILE *__stream); + +/* Write line containing shadow password entry to stream. + + This function is not part of POSIX and therefore no official + cancellation point. But due to similarity with an POSIX interface + or due to the implementation it is a cancellation point and + therefore not marked with __THROW. */ +extern int putspent (__const struct spwd *__p, FILE *__stream); #ifdef __USE_MISC -/* Reentrant versions of some of the functions above. */ +/* Reentrant versions of some of the functions above. + + These functions are not part of POSIX and therefore no official + cancellation point. But due to similarity with an POSIX interface + or due to the implementation they are cancellation points and + therefore not marked with __THROW. */ extern int getspent_r (struct spwd *__result_buf, char *__buffer, - size_t __buflen, struct spwd **__result) __THROW; + size_t __buflen, struct spwd **__result); extern int getspnam_r (__const char *__name, struct spwd *__result_buf, char *__buffer, size_t __buflen, - struct spwd **__result)__THROW; + struct spwd **__result); extern int sgetspent_r (__const char *__string, struct spwd *__result_buf, char *__buffer, size_t __buflen, - struct spwd **__result) __THROW; + struct spwd **__result); extern int fgetspent_r (FILE *__stream, struct spwd *__result_buf, char *__buffer, size_t __buflen, - struct spwd **__result) __THROW; + struct spwd **__result); #endif /* misc */ + +/* The simple locking functionality provided here is not suitable for + multi-threaded applications. */ + /* Protect password file against multi writers. */ extern int lckpwdf (void) __THROW; diff --git a/include/signal.h b/include/signal.h index c22b4372c..1be2dbb84 100644 --- a/include/signal.h +++ b/include/signal.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-1999, 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1991-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 @@ -37,7 +37,9 @@ __BEGIN_DECLS #if defined __need_sig_atomic_t || defined _SIGNAL_H # ifndef __sig_atomic_t_defined # define __sig_atomic_t_defined +__BEGIN_NAMESPACE_STD typedef __sig_atomic_t sig_atomic_t; +__END_NAMESPACE_STD # endif # undef __need_sig_atomic_t #endif @@ -55,10 +57,12 @@ typedef __sigset_t sigset_t; #include #include -#ifdef __USE_XOPEN +#if defined __USE_XOPEN || defined __USE_XOPEN2K # ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined +#endif +#ifdef __USE_XOPEN # endif # ifndef __uid_t_defined typedef __uid_t uid_t; @@ -83,24 +87,27 @@ extern __sighandler_t sysv_signal (int __sig, __sighandler_t __handler) /* Set the handler for the signal SIG to HANDLER, returning the old handler, or SIG_ERR on error. By default `signal' has the BSD semantic. */ +__BEGIN_NAMESPACE_STD #ifdef __USE_BSD -extern __sighandler_t signal (int __sig, __sighandler_t __handler) __THROW; +extern __sighandler_t signal (int __sig, __sighandler_t __handler) + __THROW; #else /* Make sure the used `signal' implementation is the SVID version. */ # ifdef __REDIRECT extern __sighandler_t __REDIRECT (signal, - (int __sig, - __sighandler_t __handler) __THROW, - __sysv_signal); + (int __sig, __sighandler_t __handler), + __sysv_signal); # else # define signal __sysv_signal # endif #endif +__END_NAMESPACE_STD #ifdef __USE_XOPEN /* The X/Open definition of `signal' conflicts with the BSD version. So they defined another function `bsd_signal'. */ -extern __sighandler_t bsd_signal (int __sig, __sighandler_t __handler) __THROW; +extern __sighandler_t bsd_signal (int __sig, __sighandler_t __handler) + __THROW; #endif /* Send signal SIG to process number PID. If PID is zero, @@ -117,18 +124,21 @@ extern int kill (__pid_t __pid, int __sig) __THROW; extern int killpg (__pid_t __pgrp, int __sig) __THROW; #endif /* Use BSD || X/Open Unix. */ +__BEGIN_NAMESPACE_STD /* Raise signal SIG, i.e., send SIG to yourself. */ extern int raise (int __sig) __THROW; +__END_NAMESPACE_STD #ifdef __USE_SVID /* SVID names for the same things. */ -extern __sighandler_t ssignal (int __sig, __sighandler_t __handler) __THROW; +extern __sighandler_t ssignal (int __sig, __sighandler_t __handler) + __THROW; extern int gsignal (int __sig) __THROW; #endif /* Use SVID. */ #ifdef __USE_MISC /* Print a message describing the meaning of the given signal number. */ -extern void psignal (int __sig, __const char *__s) __THROW; +extern void psignal (int __sig, __const char *__s); #endif /* Use misc. */ @@ -136,21 +146,25 @@ extern void psignal (int __sig, __const char *__s) __THROW; BSD definition defines the argument as a mask of the signal, while the more modern interface in X/Open defines it as the signal number. We go with the BSD version unless the user explicitly - selects the X/Open version. */ -extern int __sigpause (int __sig_or_mask, int __is_sig) __THROW; + selects the X/Open version. -#ifdef __USE_BSD + This function is a cancellation point and therefore not marked with + __THROW. */ +extern int __sigpause (int __sig_or_mask, int __is_sig); + +#ifdef __FAVOR_BSD /* Set the mask of blocked signals to MASK, wait for a signal to arrive, and then restore the mask. */ -extern int sigpause (int __mask) __THROW; # define sigpause(mask) __sigpause ((mask), 0) +extern int sigpause (int __mask) __THROW __attribute_deprecated__; #else # ifdef __USE_XOPEN # ifdef __GNUC__ -extern int sigpause (int __sig) __THROW __asm__ ("__xpg_sigpause"); -# endif +extern int sigpause (int __sig) __asm__ ("__xpg_sigpause"); +# else /* Remove a signal from the signal mask and suspend the process. */ -# define sigpause(sig) __sigpause ((sig), 1) +# define sigpause(sig) __sigpause ((sig), 1) +# endif # endif #endif @@ -165,13 +179,13 @@ extern int sigpause (int __sig) __THROW __asm__ ("__xpg_sigpause"); # define sigmask(sig) __sigmask(sig) /* Block signals in MASK, returning the old mask. */ -extern int sigblock (int __mask) __THROW; +extern int sigblock (int __mask) __THROW __attribute_deprecated__; /* Set the mask of blocked signals to MASK, returning the old mask. */ -extern int sigsetmask (int __mask) __THROW; +extern int sigsetmask (int __mask) __THROW __attribute_deprecated__; /* Return currently selected signal mask. */ -extern int siggetmask (void) __THROW; +extern int siggetmask (void) __THROW __attribute_deprecated__; #endif /* Use BSD. */ @@ -200,31 +214,32 @@ typedef __sighandler_t sig_t; # endif /* Clear all signals from SET. */ -extern int sigemptyset (sigset_t *__set) __THROW; +extern int sigemptyset (sigset_t *__set) __THROW __nonnull ((1)); /* Set all signals in SET. */ -extern int sigfillset (sigset_t *__set) __THROW; +extern int sigfillset (sigset_t *__set) __THROW __nonnull ((1)); /* Add SIGNO to SET. */ -extern int sigaddset (sigset_t *__set, int __signo) __THROW; +extern int sigaddset (sigset_t *__set, int __signo) __THROW __nonnull ((1)); /* Remove SIGNO from SET. */ -extern int sigdelset (sigset_t *__set, int __signo) __THROW; +extern int sigdelset (sigset_t *__set, int __signo) __THROW __nonnull ((1)); /* Return 1 if SIGNO is in SET, 0 if not. */ -extern int sigismember (__const sigset_t *__set, int __signo) __THROW; +extern int sigismember (__const sigset_t *__set, int __signo) + __THROW __nonnull ((1)); # ifdef __USE_GNU /* Return non-empty value is SET is not empty. */ -extern int sigisemptyset (__const sigset_t *__set) __THROW; +extern int sigisemptyset (__const sigset_t *__set) __THROW __nonnull ((1)); /* Build new signal set by combining the two inputs set using logical AND. */ extern int sigandset (sigset_t *__set, __const sigset_t *__left, - __const sigset_t *__right) __THROW; + __const sigset_t *__right) __THROW __nonnull ((1, 2, 3)); /* Build new signal set by combining the two inputs set using logical OR. */ extern int sigorset (sigset_t *__set, __const sigset_t *__left, - __const sigset_t *__right) __THROW; + __const sigset_t *__right) __THROW __nonnull ((1, 2, 3)); # endif /* GNU */ /* Get the system-specific definitions of `struct sigaction' @@ -236,32 +251,44 @@ extern int sigprocmask (int __how, __const sigset_t *__restrict __set, sigset_t *__restrict __oset) __THROW; /* Change the set of blocked signals to SET, - wait until a signal arrives, and restore the set of blocked signals. */ -extern int sigsuspend (__const sigset_t *__set) __THROW; + wait until a signal arrives, and restore the set of blocked signals. + + This function is a cancellation point and therefore not marked with + __THROW. */ +extern int sigsuspend (__const sigset_t *__set) __nonnull ((1)); /* Get and/or set the action for signal SIG. */ extern int sigaction (int __sig, __const struct sigaction *__restrict __act, struct sigaction *__restrict __oact) __THROW; /* Put in SET all signals that are blocked and waiting to be delivered. */ -extern int sigpending (sigset_t *__set) __THROW; +extern int sigpending (sigset_t *__set) __THROW __nonnull ((1)); -/* Select any of pending signals from SET or wait for any to arrive. */ +/* Select any of pending signals from SET or wait for any to arrive. + + This function is a cancellation point and therefore not marked with + __THROW. */ extern int sigwait (__const sigset_t *__restrict __set, int *__restrict __sig) - __THROW; + __nonnull ((1, 2)); # ifdef __USE_POSIX199309 -/* Select any of pending signals from SET and place information in INFO. */ +/* Select any of pending signals from SET and place information in INFO. + + This function is a cancellation point and therefore not marked with + __THROW. */ extern int sigwaitinfo (__const sigset_t *__restrict __set, - siginfo_t *__restrict __info) __THROW; + siginfo_t *__restrict __info) __nonnull ((1)); /* Select any of pending signals from SET and place information in INFO. - Wait the imte specified by TIMEOUT if no signal is pending. */ + Wait the time specified by TIMEOUT if no signal is pending. + + This function is a cancellation point and therefore not marked with + __THROW. */ extern int sigtimedwait (__const sigset_t *__restrict __set, siginfo_t *__restrict __info, __const struct timespec *__restrict __timeout) - __THROW; + __nonnull ((1)); /* Send signal SIG to the process PID. Associate data in VAL with the signal. */ @@ -323,13 +350,15 @@ extern int siginterrupt (int __sig, int __interrupt) __THROW; # include # ifdef __USE_XOPEN +/* This will define `ucontext_t' and `mcontext_t'. */ # include # endif /* Run signals handlers on the stack specified by SS (if not NULL). If OSS is not NULL, it is filled in with the old signal stack status. This interface is obsolete and on many platform not implemented. */ -extern int sigstack (struct sigstack *__ss, struct sigstack *__oss) __THROW; +extern int sigstack (struct sigstack *__ss, struct sigstack *__oss) + __THROW __attribute_deprecated__; /* Alternate signal handler stack interface. This interface should always be preferred over `sigstack'. */ @@ -338,7 +367,7 @@ extern int sigaltstack (__const struct sigaltstack *__restrict __ss, #endif /* use BSD or X/Open Unix. */ -#ifdef __USE_UNIX98 +#ifdef __USE_XOPEN_EXTENDED /* Simplified interface for signal management. */ /* Add SIG to the calling process' signal mask. */ @@ -357,6 +386,7 @@ extern __sighandler_t sigset (int __sig, __sighandler_t __disp) __THROW; #if defined __UCLIBC_HAS_THREADS__ && (defined __USE_POSIX199506 || defined __USE_UNIX98) /* Some of the functions for handling signals in threaded programs must be defined here. */ +# include # include #endif /* use Unix98 */ diff --git a/include/stdio_ext.h b/include/stdio_ext.h index 55586ea84..23d12e092 100644 --- a/include/stdio_ext.h +++ b/include/stdio_ext.h @@ -1,5 +1,5 @@ /* 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. 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 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 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 append-only, or if the last operation on the stream was a write 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 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. */ -extern int __fwritable (FILE *__fp); +extern int __fwritable (FILE *__fp) __THROW; /* 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. */ -extern void __fpurge (FILE *__fp); +extern void __fpurge (FILE *__fp) __THROW; /* 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. */ extern void _flushlbf (void); /* 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 diff --git a/include/stdlib.h b/include/stdlib.h index cb84675d5..069363e87 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 1991-2002, 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 @@ -27,9 +27,9 @@ /* Get size_t, wchar_t and NULL from . */ #define __need_size_t #ifndef __need_malloc_and_calloc -#ifdef __UCLIBC_HAS_WCHAR__ -# define __need_wchar_t -#endif +# ifdef __UCLIBC_HAS_WCHAR__ +# define __need_wchar_t +# endif # define __need_NULL #endif #include @@ -90,6 +90,9 @@ typedef union # define WIFEXITED(status) __WIFEXITED(__WAIT_INT(status)) # define WIFSIGNALED(status) __WIFSIGNALED(__WAIT_INT(status)) # define WIFSTOPPED(status) __WIFSTOPPED(__WAIT_INT(status)) +# if 0 /* def __WIFCONTINUED */ +# define WIFCONTINUED(status) __WIFCONTINUED(__WAIT_INT(status)) +# endif #endif /* X/Open and not included. */ __BEGIN_NAMESPACE_STD @@ -135,10 +138,11 @@ __END_NAMESPACE_C99 /* Maximum length of a multibyte character in the current locale. */ -/* #define MB_CUR_MAX (__ctype_get_mb_cur_max ()) */ -/* extern size_t __ctype_get_mb_cur_max (void) __THROW; */ +#if 0 +#define MB_CUR_MAX (__ctype_get_mb_cur_max ()) +extern size_t __ctype_get_mb_cur_max (void) __THROW; +#endif #ifdef __UCLIBC_HAS_WCHAR__ -/* Maximum length of a multibyte character in the current locale. */ #define MB_CUR_MAX (_stdlib_mb_cur_max ()) extern size_t _stdlib_mb_cur_max (void) __THROW; #endif @@ -147,19 +151,22 @@ extern size_t _stdlib_mb_cur_max (void) __THROW; __BEGIN_NAMESPACE_STD #ifdef __UCLIBC_HAS_FLOATS__ /* Convert a string to a floating-point number. */ -extern double atof (__const char *__nptr) __THROW __attribute_pure__; +extern double atof (__const char *__nptr) + __THROW __attribute_pure__ __nonnull ((1)); #endif /* __UCLIBC_HAS_FLOATS__ */ /* Convert a string to an integer. */ -extern int atoi (__const char *__nptr) __THROW __attribute_pure__; +extern int atoi (__const char *__nptr) + __THROW __attribute_pure__ __nonnull ((1)); /* Convert a string to a long integer. */ -extern long int atol (__const char *__nptr) __THROW __attribute_pure__; +extern long int atol (__const char *__nptr) + __THROW __attribute_pure__ __nonnull ((1)); __END_NAMESPACE_STD #if defined __USE_ISOC99 || defined __USE_MISC __BEGIN_NAMESPACE_C99 /* Convert a string to a long long integer. */ __extension__ extern long long int atoll (__const char *__nptr) - __THROW __attribute_pure__; + __THROW __attribute_pure__ __nonnull ((1)); __END_NAMESPACE_C99 #endif @@ -167,17 +174,18 @@ __END_NAMESPACE_C99 __BEGIN_NAMESPACE_STD /* Convert a string to a floating-point number. */ extern double strtod (__const char *__restrict __nptr, - char **__restrict __endptr) __THROW; + char **__restrict __endptr) __THROW __nonnull ((1)); __END_NAMESPACE_STD #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Likewise for `float' and `long double' sizes of floating-point numbers. */ extern float strtof (__const char *__restrict __nptr, - char **__restrict __endptr) __THROW; + char **__restrict __endptr) __THROW __nonnull ((1)); extern long double strtold (__const char *__restrict __nptr, - char **__restrict __endptr) __THROW; + char **__restrict __endptr) + __THROW __nonnull ((1)); __END_NAMESPACE_C99 #endif #endif /* __UCLIBC_HAS_FLOATS__ */ @@ -185,23 +193,25 @@ __END_NAMESPACE_C99 __BEGIN_NAMESPACE_STD /* Convert a string to a long integer. */ extern long int strtol (__const char *__restrict __nptr, - char **__restrict __endptr, int __base) __THROW; + char **__restrict __endptr, int __base) + __THROW __nonnull ((1)); /* Convert a string to an unsigned long integer. */ extern unsigned long int strtoul (__const char *__restrict __nptr, char **__restrict __endptr, int __base) - __THROW; -__END_NAMESPACE_C99 + __THROW __nonnull ((1)); +__END_NAMESPACE_STD -#if defined __USE_BSD +#ifdef __USE_BSD /* Convert a string to a quadword integer. */ __extension__ extern long long int strtoq (__const char *__restrict __nptr, - char **__restrict __endptr, int __base) __THROW; + char **__restrict __endptr, int __base) + __THROW __nonnull ((1)); /* Convert a string to an unsigned quadword integer. */ __extension__ extern unsigned long long int strtouq (__const char *__restrict __nptr, char **__restrict __endptr, int __base) - __THROW; + __THROW __nonnull ((1)); #endif /* GCC and use BSD. */ #if defined __USE_ISOC99 || defined __USE_MISC @@ -209,12 +219,13 @@ __BEGIN_NAMESPACE_C99 /* Convert a string to a quadword integer. */ __extension__ extern long long int strtoll (__const char *__restrict __nptr, - char **__restrict __endptr, int __base) __THROW; + char **__restrict __endptr, int __base) + __THROW __nonnull ((1)); /* Convert a string to an unsigned quadword integer. */ __extension__ extern unsigned long long int strtoull (__const char *__restrict __nptr, char **__restrict __endptr, int __base) - __THROW; + __THROW __nonnull ((1)); __END_NAMESPACE_C99 #endif /* ISO C99 or GCC and use MISC. */ @@ -240,64 +251,70 @@ __END_NAMESPACE_C99 use as an additional parameter. */ extern long int strtol_l (__const char *__restrict __nptr, char **__restrict __endptr, int __base, - __locale_t __loc) __THROW; + __locale_t __loc) __THROW __nonnull ((1, 4)); extern unsigned long int strtoul_l (__const char *__restrict __nptr, char **__restrict __endptr, - int __base, __locale_t __loc) __THROW; + int __base, __locale_t __loc) + __THROW __nonnull ((1, 4)); __extension__ extern long long int strtoll_l (__const char *__restrict __nptr, char **__restrict __endptr, int __base, - __locale_t __loc) __THROW; + __locale_t __loc) + __THROW __nonnull ((1, 4)); __extension__ extern unsigned long long int strtoull_l (__const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) - __THROW; + __THROW __nonnull ((1, 4)); extern double strtod_l (__const char *__restrict __nptr, char **__restrict __e