diff options
author | Peter S. Mazinger <ps.m@gmx.net> | 2011-03-03 11:37:16 +0100 |
---|---|---|
committer | Peter S. Mazinger <ps.m@gmx.net> | 2011-03-03 18:22:51 +0100 |
commit | a37f5fd55332b72c7e8ca5436ab6cd04617985a7 (patch) | |
tree | 34de2594c338daacfaec090a525761352488f77a | |
parent | 152e66242f2af7cd26e29d59a31f8bb8479595e5 (diff) |
update some headers
Sync some headers with glibc.
realpath is an XSI extension in SuSv4, add back guard and update comment,
since it seems to allow != NULL in second arg.
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
-rw-r--r-- | include/stdint.h | 1 | ||||
-rw-r--r-- | include/stdlib.h | 42 | ||||
-rw-r--r-- | include/sys/wait.h | 30 |
3 files changed, 40 insertions, 33 deletions
diff --git a/include/stdint.h b/include/stdint.h index 465a1b5bc..a0d7da947 100644 --- a/include/stdint.h +++ b/include/stdint.h @@ -238,6 +238,7 @@ typedef unsigned long long int uintmax_t; # define UINTPTR_MAX (4294967295U) # endif + #if !defined(__H8300H__) && !defined(__H8300S__) /* Minimum for largest signed integral type. */ # define INTMAX_MIN (-__INT64_C(9223372036854775807)-1) diff --git a/include/stdlib.h b/include/stdlib.h index 300edf04a..00bba5f54 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -50,9 +50,9 @@ __BEGIN_DECLS as well as POSIX.1 use of `int' for the status word. */ # if defined __GNUC__ && !defined __cplusplus -# define __WAIT_INT(status) \ - (__extension__ ({ union { __typeof(status) __in; int __i; } __u; \ - __u.__in = (status); __u.__i; })) +# define __WAIT_INT(status) \ + (__extension__ (((union { __typeof(status) __in; int __i; }) \ + { .__in = (status) }).__i)) # else # define __WAIT_INT(status) (*(int *) &(status)) # endif @@ -244,14 +244,14 @@ __END_NAMESPACE_C99 #if defined __USE_GNU && defined __UCLIBC_HAS_XLOCALE__ /* The concept of one static locale per category is not very well thought out. Many applications will need to process its data using - information from several different locales. Another application is + information from several different locales. Another problem is the implementation of the internationalization handling in the - upcoming ISO C++ standard library. To support this another set of - the functions using locale data exist which have an additional + ISO C++ standard library. To support this another set of + the functions using locale data exist which take an additional argument. - Attention: all these functions are *not* standardized in any form. - This is a proof-of-concept implementation. */ + Attention: even though several *_l interfaces are part of POSIX:2008, + these are not. */ /* Structure for reentrant locale using functions. This is an (almost) opaque type for the user level programs. */ @@ -347,10 +347,16 @@ struct random_data int32_t *fptr; /* Front pointer. */ int32_t *rptr; /* Rear pointer. */ int32_t *state; /* Array of state values. */ +#if 0 + int rand_type; /* Type of random number generator. */ + int rand_deg; /* Degree of random number generator. */ + int rand_sep; /* Distance between front and rear. */ +#else /* random_r.c, TYPE_x, DEG_x, SEP_x - small enough for int8_t */ int8_t rand_type; /* Type of random number generator. */ int8_t rand_deg; /* Degree of random number generator. */ int8_t rand_sep; /* Distance between front and rear. */ +#endif int32_t *end_ptr; /* Pointer behind state table. */ }; @@ -540,7 +546,7 @@ extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg) __BEGIN_NAMESPACE_STD /* Call all functions registered with `atexit' and `on_exit', - in the reverse of the order in which they were registered + in the reverse of the order in which they were registered, perform stdio cleanup, and terminate program execution with STATUS. */ extern void exit (int __status) __THROW __attribute__ ((__noreturn__)); libc_hidden_proto(exit) @@ -619,7 +625,7 @@ extern char *mktemp (char *__template) __THROW __nonnull ((1)) __wur; Returns a file descriptor open on the file for reading and writing, or -1 if it cannot create a uniquely-named file. - This function is a possible cancellation points and therefore not + This function is a possible cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 extern int mkstemp (char *__template) __nonnull ((1)) __wur; @@ -636,7 +642,7 @@ extern int mkstemp64 (char *__template) __nonnull ((1)) __wur; # endif #endif -#ifdef __USE_BSD +#if defined __USE_BSD || defined __USE_XOPEN2K8 /* Create a unique temporary directory from TEMPLATE. The last six characters of TEMPLATE must be "XXXXXX"; they are replaced with a string that makes the directory name unique. @@ -662,14 +668,17 @@ extern char *canonicalize_file_name (__const char *__name) __THROW __nonnull ((1)) __wur; #endif -/* Return the canonical absolute name of file NAME. If the - canonical name is PATH_MAX chars or more, returns null - with `errno' set to ENAMETOOLONG; if the name fits in - fewer than PATH_MAX chars, returns the name in RESOLVED. */ -/* we choose to handle __resolved==NULL as crash :) */ +#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED +/* Return the canonical absolute name of file NAME. If RESOLVED is + null, the result is malloc'd; otherwise, if the canonical name is + PATH_MAX chars or more, returns null with `errno' set to + ENAMETOOLONG; if the name fits in fewer than PATH_MAX chars, + returns the name in RESOLVED. */ extern char *realpath (__const char *__restrict __name, char *__restrict __resolved) __THROW __wur; libc_hidden_proto(realpath) +#endif + /* Shorthand for type of comparison functions. */ #ifndef __COMPAR_FN_T @@ -852,6 +861,7 @@ libc_hidden_proto(posix_openpt) #ifdef __USE_XOPEN /* The next four functions all take a master pseudo-tty fd and perform an operation on the associated slave: */ + #ifdef __UCLIBC_HAS_PTY__ /* Chown the slave to the calling user. */ extern int grantpt (int __fd) __THROW; diff --git a/include/sys/wait.h b/include/sys/wait.h index f283fe228..16893c0b9 100644 --- a/include/sys/wait.h +++ b/include/sys/wait.h @@ -1,5 +1,5 @@ -/* Copyright (C) 1991-1994,1996-2001,2003,2004,2005 - Free Software Foundation, Inc. +/* Copyright (C) 1991-1994,1996-2001,2003,2004,2005,2007,2009 + 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 @@ -51,7 +51,7 @@ __BEGIN_DECLS # endif /* This is the type of the argument to `wait'. The funky union - causes redeclarations with ether `int *' or `union wait *' to be + causes redeclarations with either `int *' or `union wait *' to be allowed without complaint. __WAIT_STATUS_DEFN is the type used in the actual function definitions. */ @@ -79,22 +79,22 @@ typedef union /* This will define all the `__W*' macros. */ # include <bits/waitstatus.h> -# define WEXITSTATUS(status) __WEXITSTATUS(__WAIT_INT(status)) -# define WTERMSIG(status) __WTERMSIG(__WAIT_INT(status)) -# define WSTOPSIG(status) __WSTOPSIG(__WAIT_INT(status)) -# define WIFEXITED(status) __WIFEXITED(__WAIT_INT(status)) -# define WIFSIGNALED(status) __WIFSIGNALED(__WAIT_INT(status)) -# define WIFSTOPPED(status) __WIFSTOPPED(__WAIT_INT(status)) +# define WEXITSTATUS(status) __WEXITSTATUS (__WAIT_INT (status)) +# define WTERMSIG(status) __WTERMSIG (__WAIT_INT (status)) +# define WSTOPSIG(status) __WSTOPSIG (__WAIT_INT (status)) +# define WIFEXITED(status) __WIFEXITED (__WAIT_INT (status)) +# define WIFSIGNALED(status) __WIFSIGNALED (__WAIT_INT (status)) +# define WIFSTOPPED(status) __WIFSTOPPED (__WAIT_INT (status)) # ifdef __WIFCONTINUED -# define WIFCONTINUED(status) __WIFCONTINUED(__WAIT_INT(status)) +# define WIFCONTINUED(status) __WIFCONTINUED (__WAIT_INT (status)) # endif #endif /* <stdlib.h> not included. */ #ifdef __USE_BSD # define WCOREFLAG __WCOREFLAG -# define WCOREDUMP(status) __WCOREDUMP(__WAIT_INT(status)) -# define W_EXITCODE(ret, sig) __W_EXITCODE(ret, sig) -# define W_STOPCODE(sig) __W_STOPCODE(sig) +# define WCOREDUMP(status) __WCOREDUMP (__WAIT_INT (status)) +# define W_EXITCODE(ret, sig) __W_EXITCODE (ret, sig) +# define W_STOPCODE(sig) __W_STOPCODE (sig) #endif /* The following values are used by the `waitid' function. */ @@ -172,10 +172,6 @@ extern __pid_t wait3 (__WAIT_STATUS __stat_loc, int __options, #endif #ifdef __USE_BSD -/* This being here makes the prototypes valid whether or not - we have already included <sys/resource.h> to define `struct rusage'. */ -struct rusage; - /* PID is like waitpid. Other args are like wait3. */ extern __pid_t wait4 (__pid_t __pid, __WAIT_STATUS __stat_loc, int __options, struct rusage *__usage) __THROW; |