|
@@ -50,9 +50,9 @@ __BEGIN_DECLS
|
|
as well as POSIX.1 use of `int' for the status word. */
|
|
as well as POSIX.1 use of `int' for the status word. */
|
|
|
|
|
|
# if defined __GNUC__ && !defined __cplusplus
|
|
# if defined __GNUC__ && !defined __cplusplus
|
|
-# define __WAIT_INT(status) \
|
|
+# define __WAIT_INT(status) \
|
|
- (__extension__ ({ union { __typeof(status) __in; int __i; } __u; \
|
|
+ (__extension__ (((union { __typeof(status) __in; int __i; }) \
|
|
- __u.__in = (status); __u.__i; }))
|
|
+ { .__in = (status) }).__i))
|
|
# else
|
|
# else
|
|
# define __WAIT_INT(status) (*(int *) &(status))
|
|
# define __WAIT_INT(status) (*(int *) &(status))
|
|
# endif
|
|
# endif
|
|
@@ -143,9 +143,11 @@ __END_NAMESPACE_C99
|
|
extern size_t __ctype_get_mb_cur_max (void) __THROW __wur;
|
|
extern size_t __ctype_get_mb_cur_max (void) __THROW __wur;
|
|
#else
|
|
#else
|
|
#ifdef __UCLIBC_HAS_WCHAR__
|
|
#ifdef __UCLIBC_HAS_WCHAR__
|
|
-#define MB_CUR_MAX (_stdlib_mb_cur_max ())
|
|
+# define MB_CUR_MAX (_stdlib_mb_cur_max ())
|
|
extern size_t _stdlib_mb_cur_max (void) __THROW __wur;
|
|
extern size_t _stdlib_mb_cur_max (void) __THROW __wur;
|
|
libc_hidden_proto(_stdlib_mb_cur_max)
|
|
libc_hidden_proto(_stdlib_mb_cur_max)
|
|
|
|
+#else
|
|
|
|
+# define MB_CUR_MAX 1
|
|
#endif
|
|
#endif
|
|
#endif
|
|
#endif
|
|
|
|
|
|
@@ -163,7 +165,6 @@ libc_hidden_proto(atoi)
|
|
/* Convert a string to a long integer. */
|
|
/* Convert a string to a long integer. */
|
|
extern long int atol (__const char *__nptr)
|
|
extern long int atol (__const char *__nptr)
|
|
__THROW __attribute_pure__ __nonnull ((1)) __wur;
|
|
__THROW __attribute_pure__ __nonnull ((1)) __wur;
|
|
-libc_hidden_proto(atol)
|
|
|
|
__END_NAMESPACE_STD
|
|
__END_NAMESPACE_STD
|
|
|
|
|
|
#if defined __USE_ISOC99 || defined __USE_MISC
|
|
#if defined __USE_ISOC99 || defined __USE_MISC
|
|
@@ -244,14 +245,14 @@ __END_NAMESPACE_C99
|
|
#if defined __USE_GNU && defined __UCLIBC_HAS_XLOCALE__
|
|
#if defined __USE_GNU && defined __UCLIBC_HAS_XLOCALE__
|
|
/* The concept of one static locale per category is not very well
|
|
/* The concept of one static locale per category is not very well
|
|
thought out. Many applications will need to process its data using
|
|
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
|
|
the implementation of the internationalization handling in the
|
|
- upcoming ISO C++ standard library. To support this another set of
|
|
+ ISO C++ standard library. To support this another set of
|
|
- the functions using locale data exist which have an additional
|
|
+ the functions using locale data exist which take an additional
|
|
argument.
|
|
argument.
|
|
|
|
|
|
- Attention: all these functions are *not* standardized in any form.
|
|
+ Attention: even though several *_l interfaces are part of POSIX:2008,
|
|
- This is a proof-of-concept implementation. */
|
|
+ these are not. */
|
|
|
|
|
|
/* Structure for reentrant locale using functions. This is an
|
|
/* Structure for reentrant locale using functions. This is an
|
|
(almost) opaque type for the user level programs. */
|
|
(almost) opaque type for the user level programs. */
|
|
@@ -347,10 +348,16 @@ struct random_data
|
|
int32_t *fptr; /* Front pointer. */
|
|
int32_t *fptr; /* Front pointer. */
|
|
int32_t *rptr; /* Rear pointer. */
|
|
int32_t *rptr; /* Rear pointer. */
|
|
int32_t *state; /* Array of state values. */
|
|
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 */
|
|
/* 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_type; /* Type of random number generator. */
|
|
int8_t rand_deg; /* Degree of random number generator. */
|
|
int8_t rand_deg; /* Degree of random number generator. */
|
|
int8_t rand_sep; /* Distance between front and rear. */
|
|
int8_t rand_sep; /* Distance between front and rear. */
|
|
|
|
+#endif
|
|
int32_t *end_ptr; /* Pointer behind state table. */
|
|
int32_t *end_ptr; /* Pointer behind state table. */
|
|
};
|
|
};
|
|
|
|
|
|
@@ -540,7 +547,7 @@ extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
|
|
|
|
|
|
__BEGIN_NAMESPACE_STD
|
|
__BEGIN_NAMESPACE_STD
|
|
/* Call all functions registered with `atexit' and `on_exit',
|
|
/* 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. */
|
|
perform stdio cleanup, and terminate program execution with STATUS. */
|
|
extern void exit (int __status) __THROW __attribute__ ((__noreturn__));
|
|
extern void exit (int __status) __THROW __attribute__ ((__noreturn__));
|
|
libc_hidden_proto(exit)
|
|
libc_hidden_proto(exit)
|
|
@@ -619,7 +626,7 @@ extern char *mktemp (char *__template) __THROW __nonnull ((1)) __wur;
|
|
Returns a file descriptor open on the file for reading and writing,
|
|
Returns a file descriptor open on the file for reading and writing,
|
|
or -1 if it cannot create a uniquely-named file.
|
|
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. */
|
|
marked with __THROW. */
|
|
# ifndef __USE_FILE_OFFSET64
|
|
# ifndef __USE_FILE_OFFSET64
|
|
extern int mkstemp (char *__template) __nonnull ((1)) __wur;
|
|
extern int mkstemp (char *__template) __nonnull ((1)) __wur;
|
|
@@ -636,7 +643,7 @@ extern int mkstemp64 (char *__template) __nonnull ((1)) __wur;
|
|
# endif
|
|
# endif
|
|
#endif
|
|
#endif
|
|
|
|
|
|
-#ifdef __USE_BSD
|
|
+#if defined __USE_BSD || defined __USE_XOPEN2K8
|
|
/* Create a unique temporary directory from TEMPLATE.
|
|
/* Create a unique temporary directory from TEMPLATE.
|
|
The last six characters of TEMPLATE must be "XXXXXX";
|
|
The last six characters of TEMPLATE must be "XXXXXX";
|
|
they are replaced with a string that makes the directory name unique.
|
|
they are replaced with a string that makes the directory name unique.
|
|
@@ -662,14 +669,17 @@ extern char *canonicalize_file_name (__const char *__name)
|
|
__THROW __nonnull ((1)) __wur;
|
|
__THROW __nonnull ((1)) __wur;
|
|
#endif
|
|
#endif
|
|
|
|
|
|
-/* Return the canonical absolute name of file NAME. If the
|
|
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
|
|
- canonical name is PATH_MAX chars or more, returns null
|
|
+/* Return the canonical absolute name of file NAME. If RESOLVED is
|
|
- with `errno' set to ENAMETOOLONG; if the name fits in
|
|
+ null, the result is malloc'd; otherwise, if the canonical name is
|
|
- fewer than PATH_MAX chars, returns the name in RESOLVED. */
|
|
+ PATH_MAX chars or more, returns null with `errno' set to
|
|
-/* we choose to handle __resolved==NULL as crash :) */
|
|
+ ENAMETOOLONG; if the name fits in fewer than PATH_MAX chars,
|
|
|
|
+ returns the name in RESOLVED. */
|
|
extern char *realpath (__const char *__restrict __name,
|
|
extern char *realpath (__const char *__restrict __name,
|
|
char *__restrict __resolved) __THROW __wur;
|
|
char *__restrict __resolved) __THROW __wur;
|
|
libc_hidden_proto(realpath)
|
|
libc_hidden_proto(realpath)
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
|
|
/* Shorthand for type of comparison functions. */
|
|
/* Shorthand for type of comparison functions. */
|
|
#ifndef __COMPAR_FN_T
|
|
#ifndef __COMPAR_FN_T
|
|
@@ -852,6 +862,7 @@ libc_hidden_proto(posix_openpt)
|
|
#ifdef __USE_XOPEN
|
|
#ifdef __USE_XOPEN
|
|
/* The next four functions all take a master pseudo-tty fd and
|
|
/* The next four functions all take a master pseudo-tty fd and
|
|
perform an operation on the associated slave: */
|
|
perform an operation on the associated slave: */
|
|
|
|
+
|
|
#ifdef __UCLIBC_HAS_PTY__
|
|
#ifdef __UCLIBC_HAS_PTY__
|
|
/* Chown the slave to the calling user. */
|
|
/* Chown the slave to the calling user. */
|
|
extern int grantpt (int __fd) __THROW;
|
|
extern int grantpt (int __fd) __THROW;
|
|
@@ -894,10 +905,16 @@ extern int getloadavg (double __loadavg[], int __nelem)
|
|
#include <stdint.h>
|
|
#include <stdint.h>
|
|
extern uint32_t arc4random(void);
|
|
extern uint32_t arc4random(void);
|
|
extern void arc4random_stir(void);
|
|
extern void arc4random_stir(void);
|
|
-libc_hidden_proto(arc4random_stir)
|
|
|
|
extern void arc4random_addrandom(unsigned char *, int);
|
|
extern void arc4random_addrandom(unsigned char *, int);
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+#ifdef _LIBC
|
|
|
|
+extern int __drand48_iterate (unsigned short int xsubi[3], struct drand48_data *buffer) attribute_hidden;
|
|
|
|
+
|
|
|
|
+/* Global state for non-reentrant functions. */
|
|
|
|
+extern struct drand48_data __libc_drand48_data attribute_hidden;
|
|
|
|
+#endif
|
|
|
|
+
|
|
#endif /* don't just need malloc and calloc */
|
|
#endif /* don't just need malloc and calloc */
|
|
#undef __need_malloc_and_calloc
|
|
#undef __need_malloc_and_calloc
|
|
|
|
|