newlib-2.4.0
git-svn-id: svn://kolibrios.org@6536 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
12
contrib/sdk/sources/newlib/libc/include/_newlib_version.h
Normal file
12
contrib/sdk/sources/newlib/libc/include/_newlib_version.h
Normal file
@@ -0,0 +1,12 @@
|
||||
/* _newlib_version.h. Generated from _newlib_version.hin by configure. */
|
||||
/* Version macros for internal and downstream use. */
|
||||
#ifndef _NEWLIB_VERSION_H__
|
||||
#define _NEWLIB_VERSION_H__ 1
|
||||
|
||||
#define _NEWLIB_VERSION "2.4.0"
|
||||
#define __NEWLIB__ 2
|
||||
#define __NEWLIB_MINOR__ 4
|
||||
#define __NEWLIB_PATCHLEVEL__ 0
|
||||
|
||||
#endif /* !_NEWLIB_VERSION_H__ */
|
||||
|
@@ -108,18 +108,46 @@ long double cimagl(long double complex);
|
||||
/* 7.3.9.3 The conj functions */
|
||||
double complex conj(double complex);
|
||||
float complex conjf(float complex);
|
||||
/*long double complex conjl(long double complex); */
|
||||
|
||||
/* 7.3.9.4 The cproj functions */
|
||||
double complex cproj(double complex);
|
||||
float complex cprojf(float complex);
|
||||
/*long double complex cprojl(long double complex); */
|
||||
|
||||
/* 7.3.9.5 The creal functions */
|
||||
double creal(double complex);
|
||||
float crealf(float complex);
|
||||
long double creall(long double complex);
|
||||
|
||||
#if __GNU_VISIBLE
|
||||
double complex clog10(double complex);
|
||||
float complex clog10f(float complex);
|
||||
#endif
|
||||
|
||||
#if defined(__CYGWIN__)
|
||||
long double complex cacosl(long double complex);
|
||||
long double complex casinl(long double complex);
|
||||
long double complex catanl(long double complex);
|
||||
long double complex ccosl(long double complex);
|
||||
long double complex csinl(long double complex);
|
||||
long double complex ctanl(long double complex);
|
||||
long double complex cacoshl(long double complex);
|
||||
long double complex casinhl(long double complex);
|
||||
long double complex catanhl(long double complex);
|
||||
long double complex ccoshl(long double complex);
|
||||
long double complex csinhl(long double complex);
|
||||
long double complex ctanhl(long double complex);
|
||||
long double complex cexpl(long double complex);
|
||||
long double complex clogl(long double complex);
|
||||
long double complex cpowl(long double complex, long double complex);
|
||||
long double complex csqrtl(long double complex);
|
||||
long double cargl(long double complex);
|
||||
long double complex conjl(long double complex);
|
||||
long double complex cprojl(long double complex);
|
||||
#if __GNU_VISIBLE
|
||||
long double complex clog10l(long double complex);
|
||||
#endif
|
||||
#endif /* __CYGWIN__ */
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* ! _COMPLEX_H */
|
||||
|
@@ -2,6 +2,7 @@
|
||||
#define _CTYPE_H_
|
||||
|
||||
#include "_ansi.h"
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
_BEGIN_STD_C
|
||||
|
||||
@@ -19,11 +20,11 @@ int _EXFUN(isxdigit,(int __c));
|
||||
int _EXFUN(tolower, (int __c));
|
||||
int _EXFUN(toupper, (int __c));
|
||||
|
||||
#if !defined(__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L
|
||||
#if __ISO_C_VISIBLE >= 1999
|
||||
int _EXFUN(isblank, (int __c));
|
||||
#endif
|
||||
|
||||
#ifndef __STRICT_ANSI__
|
||||
#if __MISC_VISIBLE || __XSI_VISIBLE
|
||||
int _EXFUN(isascii, (int __c));
|
||||
int _EXFUN(toascii, (int __c));
|
||||
#define _tolower(__c) ((unsigned char)(__c) - 'A' + 'a')
|
||||
@@ -40,10 +41,9 @@ int _EXFUN(toascii, (int __c));
|
||||
#define _B 0200
|
||||
|
||||
#ifndef _MB_CAPABLE
|
||||
extern _CONST __IMPORT char *__ctype_ptr__;
|
||||
#else
|
||||
extern __IMPORT char *__ctype_ptr__;
|
||||
_CONST
|
||||
#endif
|
||||
extern __IMPORT char *__ctype_ptr__;
|
||||
|
||||
#ifndef __cplusplus
|
||||
/* These macros are intentionally written in a manner that will trigger
|
||||
@@ -69,8 +69,7 @@ extern __IMPORT char *__ctype_ptr__;
|
||||
#define isgraph(__c) (__ctype_lookup(__c)&(_P|_U|_L|_N))
|
||||
#define iscntrl(__c) (__ctype_lookup(__c)&_C)
|
||||
|
||||
#if defined(__GNUC__) && \
|
||||
(!defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901L)
|
||||
#if defined(__GNUC__) && __ISO_C_VISIBLE >= 1999
|
||||
#define isblank(__c) \
|
||||
__extension__ ({ __typeof__ (__c) __x = (__c); \
|
||||
(__ctype_lookup(__x)&_B) || (int) (__x) == '\t';})
|
||||
@@ -99,13 +98,14 @@ extern __IMPORT char *__ctype_ptr__;
|
||||
(void) __ctype_ptr__[__x]; (tolower) (__x);})
|
||||
# endif /* _MB_EXTENDED_CHARSETS* */
|
||||
# endif /* __GNUC__ */
|
||||
#endif /* !__cplusplus */
|
||||
|
||||
#ifndef __STRICT_ANSI__
|
||||
#if __MISC_VISIBLE || __XSI_VISIBLE
|
||||
#define isascii(__c) ((unsigned)(__c)<=0177)
|
||||
#define toascii(__c) ((__c)&0177)
|
||||
#endif
|
||||
|
||||
#endif /* !__cplusplus */
|
||||
|
||||
/* For C++ backward-compatibility only. */
|
||||
extern __IMPORT _CONST char _ctype_[];
|
||||
|
||||
|
@@ -3,9 +3,10 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/dirent.h>
|
||||
|
||||
#if !defined(MAXNAMLEN) && !defined(_POSIX_SOURCE)
|
||||
#if !defined(MAXNAMLEN) && __BSD_VISIBLE
|
||||
#define MAXNAMLEN 1024
|
||||
#endif
|
||||
|
||||
|
@@ -33,21 +33,21 @@
|
||||
#ifndef _FNMATCH_H_
|
||||
#define _FNMATCH_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#define FNM_NOMATCH 1 /* Match failed. */
|
||||
|
||||
#define FNM_NOESCAPE 0x01 /* Disable backslash escaping. */
|
||||
#define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */
|
||||
#define FNM_PERIOD 0x04 /* Period must be matched by period. */
|
||||
|
||||
#if defined(_GNU_SOURCE) || !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
|
||||
#if __GNU_VISIBLE
|
||||
#define FNM_LEADING_DIR 0x08 /* Ignore /<tail> after Imatch. */
|
||||
#define FNM_CASEFOLD 0x10 /* Case insensitive search. */
|
||||
#define FNM_IGNORECASE FNM_CASEFOLD
|
||||
#define FNM_FILE_NAME FNM_PATHNAME
|
||||
#endif
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
int fnmatch(const char *, const char *, int);
|
||||
__END_DECLS
|
||||
|
@@ -49,7 +49,7 @@
|
||||
#include <cygwin/grp.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
|
||||
#if __BSD_VISIBLE
|
||||
#define _PATH_GROUP "/etc/group"
|
||||
#endif
|
||||
|
||||
@@ -67,25 +67,20 @@ extern "C" {
|
||||
#ifndef __INSIDE_CYGWIN__
|
||||
struct group *getgrgid (gid_t);
|
||||
struct group *getgrnam (const char *);
|
||||
#if __MISC_VISIBLE || __POSIX_VISIBLE
|
||||
int getgrnam_r (const char *, struct group *,
|
||||
char *, size_t, struct group **);
|
||||
int getgrgid_r (gid_t, struct group *,
|
||||
char *, size_t, struct group **);
|
||||
#ifndef _POSIX_SOURCE
|
||||
#endif /* __MISC_VISIBLE || __POSIX_VISIBLE */
|
||||
#if __MISC_VISIBLE || __XSI_VISIBLE >= 4
|
||||
struct group *getgrent (void);
|
||||
void setgrent (void);
|
||||
void endgrent (void);
|
||||
#ifndef __CYGWIN__
|
||||
void setgrfile (const char *);
|
||||
#endif /* !__CYGWIN__ */
|
||||
#ifndef _XOPEN_SOURCE
|
||||
#ifndef __CYGWIN__
|
||||
char *group_from_gid (gid_t, int);
|
||||
int setgroupent (int);
|
||||
#endif /* !__CYGWIN__ */
|
||||
#endif /* __MISC_VISIBLE || __XSI_VISIBLE >= 4 */
|
||||
#if __BSD_VISIBLE
|
||||
int initgroups (const char *, gid_t);
|
||||
#endif /* !_XOPEN_SOURCE */
|
||||
#endif /* !_POSIX_SOURCE */
|
||||
#endif /* __BSD_VISIBLE */
|
||||
#endif /* !__INSIDE_CYGWIN__ */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -1,103 +0,0 @@
|
||||
/* Threads compatibility routines for libgcc2. */
|
||||
/* Compile this one with gcc. */
|
||||
/* Copyright (C) 1997, 1998, 2004, 2008, 2009 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_GTHR_H
|
||||
#define GCC_GTHR_H
|
||||
|
||||
typedef unsigned int __gthread_key_t;
|
||||
|
||||
typedef struct {
|
||||
volatile int done;
|
||||
int started;
|
||||
} __gthread_once_t;
|
||||
|
||||
typedef struct {
|
||||
volatile int counter;
|
||||
} __gthread_mutex_t;
|
||||
|
||||
|
||||
void *tls_alloc(void);
|
||||
|
||||
static int __gthread_mutex_lock (__gthread_mutex_t *mutex)
|
||||
{
|
||||
__mutex_lock(&mutex->counter);
|
||||
return 0;
|
||||
};
|
||||
|
||||
static int __gthread_mutex_unlock (__gthread_mutex_t *mutex)
|
||||
{
|
||||
mutex->counter = 0;
|
||||
return 0;
|
||||
};
|
||||
|
||||
static inline int __gthread_key_create (__gthread_key_t *__key,
|
||||
void (*__dtor) (void *) __attribute__((unused)))
|
||||
{
|
||||
int __status = 0;
|
||||
void *__tls_index = tls_alloc();
|
||||
if (__tls_index != NULL)
|
||||
{
|
||||
*__key = (unsigned int)__tls_index;
|
||||
|
||||
#ifdef MINGW32_SUPPORTS_MT_EH /* FIXME */
|
||||
/* Mingw runtime will run the dtors in reverse order for each thread
|
||||
when the thread exits. */
|
||||
// __status = __mingwthr_key_dtor (*__key, __dtor);
|
||||
#endif
|
||||
|
||||
}
|
||||
else
|
||||
__status = (int) ENOMEM;
|
||||
return __status;
|
||||
}
|
||||
|
||||
|
||||
static inline void *
|
||||
__gthread_getspecific (__gthread_key_t __key)
|
||||
{
|
||||
void *val;
|
||||
__asm__ __volatile__(
|
||||
"movl %%fs:(%1), %0"
|
||||
:"=r"(val)
|
||||
:"r"(__key));
|
||||
|
||||
return val;
|
||||
};
|
||||
|
||||
static inline int
|
||||
__gthread_setspecific (__gthread_key_t __key, const void *__ptr)
|
||||
{
|
||||
if(!(__key & 3))
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"movl %0, %%fs:(%1)"
|
||||
::"r"(__ptr),"r"(__key));
|
||||
return 0;
|
||||
}
|
||||
else return EINVAL;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
@@ -270,22 +270,17 @@ int _EXFUN(finitef, (float));
|
||||
#define __IEEE_DBL_NAN_EXP 0x7ff
|
||||
#define __IEEE_FLT_NAN_EXP 0xff
|
||||
|
||||
#ifndef __ieeefp_isnanf
|
||||
#define __ieeefp_isnanf(x) (((*(long *)&(x) & 0x7f800000L)==0x7f800000L) && \
|
||||
((*(long *)&(x) & 0x007fffffL)!=0000000000L))
|
||||
#endif
|
||||
#ifdef __ieeefp_isnanf
|
||||
#define isnanf(x) __ieeefp_isnanf(x)
|
||||
|
||||
#ifndef __ieeefp_isinff
|
||||
#define __ieeefp_isinff(x) (((*(long *)&(x) & 0x7f800000L)==0x7f800000L) && \
|
||||
((*(long *)&(x) & 0x007fffffL)==0000000000L))
|
||||
#endif
|
||||
|
||||
#ifdef __ieeefp_isinff
|
||||
#define isinff(x) __ieeefp_isinff(x)
|
||||
|
||||
#ifndef __ieeefp_finitef
|
||||
#define __ieeefp_finitef(x) (((*(long *)&(x) & 0x7f800000L)!=0x7f800000L))
|
||||
#endif
|
||||
|
||||
#ifdef __ieeefp_finitef
|
||||
#define finitef(x) __ieeefp_finitef(x)
|
||||
#endif
|
||||
|
||||
#ifdef _DOUBLE_IS_32BITS
|
||||
#undef __IEEE_DBL_EXPBIAS
|
||||
|
@@ -65,11 +65,11 @@ void end_draw(void)
|
||||
"int $0x40" ::"a"(12),"b"(2));
|
||||
};
|
||||
|
||||
static inline void
|
||||
static inline void
|
||||
put_image(uint16_t x_coord, uint16_t y_coord,
|
||||
uint16_t size_x, uint16_t size_y, void *img)
|
||||
{
|
||||
__asm__ __volatile__("int $0x40"
|
||||
__asm__ __volatile__("int $0x40"
|
||||
::"a"(25),
|
||||
"b"(img),
|
||||
"c"(size_x<<16 | size_y),
|
||||
@@ -237,7 +237,7 @@ static inline uint32_t set_wanted_events_mask(uint32_t event_mask)
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(old_event_mask)
|
||||
:"a"(40));
|
||||
:"a"(40),"b"(event_mask));
|
||||
|
||||
return old_event_mask;
|
||||
};
|
||||
@@ -273,7 +273,7 @@ uint32_t wait_for_event(uint32_t time)
|
||||
return val;
|
||||
};
|
||||
|
||||
static inline uint32_t check_os_event()
|
||||
static inline uint32_t check_os_event(void)
|
||||
{
|
||||
uint32_t val;
|
||||
__asm__ __volatile__(
|
||||
@@ -283,7 +283,7 @@ static inline uint32_t check_os_event()
|
||||
return val;
|
||||
};
|
||||
|
||||
static inline uint32_t get_os_event()
|
||||
static inline uint32_t get_os_event(void)
|
||||
{
|
||||
uint32_t val;
|
||||
__asm__ __volatile__(
|
||||
@@ -328,7 +328,7 @@ oskey_t get_key(void)
|
||||
}
|
||||
|
||||
static inline
|
||||
uint32_t get_os_button()
|
||||
uint32_t get_os_button(void)
|
||||
{
|
||||
uint32_t val;
|
||||
__asm__ __volatile__(
|
||||
@@ -453,7 +453,7 @@ static inline ufile_t load_file(const char *path)
|
||||
};
|
||||
static inline ufile_t LoadFile(const char *path) __attribute__ ((alias ("load_file")));
|
||||
|
||||
static inline int GetScreenSize()
|
||||
static inline int GetScreenSize(void)
|
||||
{
|
||||
int retval;
|
||||
|
||||
@@ -514,6 +514,42 @@ static inline void Blit(void *bitmap, int dst_x, int dst_y,
|
||||
::"a"(73),"b"(0),"c"(&bc.dstx));
|
||||
};
|
||||
|
||||
#define TLS_KEY_PID 0
|
||||
#define TLS_KEY_TID 4
|
||||
#define TLS_KEY_LOW_STACK 8
|
||||
#define TLS_KEY_HIGH_STACK 12
|
||||
#define TLS_KEY_LIBC 16
|
||||
|
||||
unsigned int tls_alloc(void);
|
||||
int tls_free(unsigned int key);
|
||||
|
||||
static inline int tls_set(unsigned int key, void *val)
|
||||
{
|
||||
int ret = -1;
|
||||
if(key < 4096)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"movl %0, %%fs:(%1)"
|
||||
::"r"(val),"r"(key));
|
||||
ret = 0;
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
static inline void *tls_get(unsigned int key)
|
||||
{
|
||||
void *val = (void*)-1;
|
||||
if(key < 4096)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"movl %%fs:(%1), %0"
|
||||
:"=r"(val)
|
||||
:"r"(key));
|
||||
};
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
int create_thread(int (*proc)(void *param), void *param, int stack_size);
|
||||
|
||||
void* load_library(const char *name);
|
||||
|
@@ -2,6 +2,7 @@
|
||||
# define _LIBC_LIMITS_H_ 1
|
||||
|
||||
#include <newlib.h>
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
# ifdef _MB_LEN_MAX
|
||||
# define MB_LEN_MAX _MB_LEN_MAX
|
||||
@@ -96,8 +97,7 @@
|
||||
# define __LONG_LONG_MAX__ 9223372036854775807LL
|
||||
# endif
|
||||
|
||||
# if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
|
||||
(defined(__cplusplus) && __cplusplus >= 201103L)
|
||||
# if __ISO_C_VISIBLE >= 1999
|
||||
/* Minimum and maximum values a `signed long long int' can hold. */
|
||||
# undef LLONG_MIN
|
||||
# define LLONG_MIN (-LLONG_MAX-1)
|
||||
@@ -109,7 +109,7 @@
|
||||
# define ULLONG_MAX (LLONG_MAX * 2ULL + 1)
|
||||
# endif
|
||||
|
||||
# if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__)
|
||||
# if __GNU_VISIBLE
|
||||
/* Minimum and maximum values a `signed long long int' can hold. */
|
||||
# undef LONG_LONG_MIN
|
||||
# define LONG_LONG_MIN (-LONG_LONG_MAX-1)
|
||||
|
@@ -1,100 +1,122 @@
|
||||
#ifdef __sysvnecv70_target
|
||||
double EXFUN(fast_sin,(double));
|
||||
double EXFUN(fast_cos,(double));
|
||||
double EXFUN(fast_tan,(double));
|
||||
#ifndef _MACHFASTMATH_H
|
||||
#define _MACHFASTMATH_H
|
||||
|
||||
double EXFUN(fast_asin,(double));
|
||||
double EXFUN(fast_acos,(double));
|
||||
double EXFUN(fast_atan,(double));
|
||||
#if defined(__GNUC__) && __STDC__ - 0 > 0
|
||||
|
||||
double EXFUN(fast_sinh,(double));
|
||||
double EXFUN(fast_cosh,(double));
|
||||
double EXFUN(fast_tanh,(double));
|
||||
#define __str1__(__x) #__x
|
||||
#define __str2__(__x) __str1__(__x)
|
||||
#define __U_L_PREFIX__ __str2__(__USER_LABEL_PREFIX__)
|
||||
|
||||
double EXFUN(fast_asinh,(double));
|
||||
double EXFUN(fast_acosh,(double));
|
||||
double EXFUN(fast_atanh,(double));
|
||||
__extension__ double atan2(double, double)
|
||||
__asm__(__U_L_PREFIX__ "_f_atan2");
|
||||
__extension__ double exp(double)
|
||||
__asm__(__U_L_PREFIX__ "_f_exp");
|
||||
__extension__ double frexp(double, int*)
|
||||
__asm__(__U_L_PREFIX__ "_f_frexp");
|
||||
__extension__ double ldexp(double, int)
|
||||
__asm__(__U_L_PREFIX__ "_f_ldexp");
|
||||
__extension__ double log(double)
|
||||
__asm__(__U_L_PREFIX__ "_f_log");
|
||||
__extension__ double log10(double)
|
||||
__asm__(__U_L_PREFIX__ "_f_log10");
|
||||
__extension__ double pow(double, double)
|
||||
__asm__(__U_L_PREFIX__ "_f_pow");
|
||||
__extension__ double tan(double)
|
||||
__asm__(__U_L_PREFIX__ "_f_tan");
|
||||
|
||||
double EXFUN(fast_abs,(double));
|
||||
double EXFUN(fast_sqrt,(double));
|
||||
double EXFUN(fast_exp2,(double));
|
||||
double EXFUN(fast_exp10,(double));
|
||||
double EXFUN(fast_expe,(double));
|
||||
double EXFUN(fast_log10,(double));
|
||||
double EXFUN(fast_log2,(double));
|
||||
double EXFUN(fast_loge,(double));
|
||||
#if !defined(__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L
|
||||
|
||||
|
||||
#define sin(x) fast_sin(x)
|
||||
#define cos(x) fast_cos(x)
|
||||
#define tan(x) fast_tan(x)
|
||||
#define asin(x) fast_asin(x)
|
||||
#define acos(x) fast_acos(x)
|
||||
#define atan(x) fast_atan(x)
|
||||
#define sinh(x) fast_sinh(x)
|
||||
#define cosh(x) fast_cosh(x)
|
||||
#define tanh(x) fast_tanh(x)
|
||||
#define asinh(x) fast_asinh(x)
|
||||
#define acosh(x) fast_acosh(x)
|
||||
#define atanh(x) fast_atanh(x)
|
||||
#define abs(x) fast_abs(x)
|
||||
#define sqrt(x) fast_sqrt(x)
|
||||
#define exp2(x) fast_exp2(x)
|
||||
#define exp10(x) fast_exp10(x)
|
||||
#define expe(x) fast_expe(x)
|
||||
#define log10(x) fast_log10(x)
|
||||
#define log2(x) fast_log2(x)
|
||||
#define loge(x) fast_loge(x)
|
||||
|
||||
#ifdef _HAVE_STDC
|
||||
/* These functions are in assembler, they really do take floats. This
|
||||
can only be used with a real ANSI compiler */
|
||||
|
||||
float EXFUN(fast_sinf,(float));
|
||||
float EXFUN(fast_cosf,(float));
|
||||
float EXFUN(fast_tanf,(float));
|
||||
|
||||
float EXFUN(fast_asinf,(float));
|
||||
float EXFUN(fast_acosf,(float));
|
||||
float EXFUN(fast_atanf,(float));
|
||||
|
||||
float EXFUN(fast_sinhf,(float));
|
||||
float EXFUN(fast_coshf,(float));
|
||||
float EXFUN(fast_tanhf,(float));
|
||||
|
||||
float EXFUN(fast_asinhf,(float));
|
||||
float EXFUN(fast_acoshf,(float));
|
||||
float EXFUN(fast_atanhf,(float));
|
||||
|
||||
float EXFUN(fast_absf,(float));
|
||||
float EXFUN(fast_sqrtf,(float));
|
||||
float EXFUN(fast_exp2f,(float));
|
||||
float EXFUN(fast_exp10f,(float));
|
||||
float EXFUN(fast_expef,(float));
|
||||
float EXFUN(fast_log10f,(float));
|
||||
float EXFUN(fast_log2f,(float));
|
||||
float EXFUN(fast_logef,(float));
|
||||
#define sinf(x) fast_sinf(x)
|
||||
#define cosf(x) fast_cosf(x)
|
||||
#define tanf(x) fast_tanf(x)
|
||||
#define asinf(x) fast_asinf(x)
|
||||
#define acosf(x) fast_acosf(x)
|
||||
#define atanf(x) fast_atanf(x)
|
||||
#define sinhf(x) fast_sinhf(x)
|
||||
#define coshf(x) fast_coshf(x)
|
||||
#define tanhf(x) fast_tanhf(x)
|
||||
#define asinhf(x) fast_asinhf(x)
|
||||
#define acoshf(x) fast_acoshf(x)
|
||||
#define atanhf(x) fast_atanhf(x)
|
||||
#define absf(x) fast_absf(x)
|
||||
#define sqrtf(x) fast_sqrtf(x)
|
||||
#define exp2f(x) fast_exp2f(x)
|
||||
#define exp10f(x) fast_exp10f(x)
|
||||
#define expef(x) fast_expef(x)
|
||||
#define log10f(x) fast_log10f(x)
|
||||
#define log2f(x) fast_log2f(x)
|
||||
#define logef(x) fast_logef(x)
|
||||
__extension__ float atan2f(float, float)
|
||||
__asm__(__U_L_PREFIX__ "_f_atan2f");
|
||||
__extension__ float expf(float)
|
||||
__asm__(__U_L_PREFIX__ "_f_expf");
|
||||
__extension__ float frexpf(float, int*)
|
||||
__asm__(__U_L_PREFIX__ "_f_frexpf");
|
||||
__extension__ float ldexpf(float, int)
|
||||
__asm__(__U_L_PREFIX__ "_f_ldexpf");
|
||||
__extension__ long long llrint(double)
|
||||
__asm__(__U_L_PREFIX__ "_f_llrint");
|
||||
__extension__ long long llrintf(float)
|
||||
__asm__(__U_L_PREFIX__ "_f_llrintf");
|
||||
__extension__ long long llrintl(long double)
|
||||
__asm__(__U_L_PREFIX__ "_f_llrintl");
|
||||
__extension__ float logf(float)
|
||||
__asm__(__U_L_PREFIX__ "_f_logf");
|
||||
__extension__ float log10f(float)
|
||||
__asm__(__U_L_PREFIX__ "_f_log10f");
|
||||
__extension__ long lrint(double)
|
||||
__asm__(__U_L_PREFIX__ "_f_lrint");
|
||||
__extension__ long lrintf(float)
|
||||
__asm__(__U_L_PREFIX__ "_f_lrintf");
|
||||
__extension__ long lrintl(long double)
|
||||
__asm__(__U_L_PREFIX__ "_f_lrintl");
|
||||
__extension__ float powf(float, float)
|
||||
__asm__(__U_L_PREFIX__ "_f_powf");
|
||||
__extension__ double rint(double)
|
||||
__asm__(__U_L_PREFIX__ "_f_rint");
|
||||
__extension__ float rintf(float)
|
||||
__asm__(__U_L_PREFIX__ "_f_rintf");
|
||||
__extension__ long double rintl(long double)
|
||||
__asm__(__U_L_PREFIX__ "_f_rintl");
|
||||
__extension__ float tanf(float)
|
||||
__asm__(__U_L_PREFIX__ "_f_tanf");
|
||||
#endif
|
||||
/* Override the functions defined in math.h */
|
||||
#endif /* __sysvnecv70_target */
|
||||
|
||||
#else
|
||||
|
||||
double EXFUN(_f_atan2,(double, double));
|
||||
double EXFUN(_f_exp,(double));
|
||||
double EXFUN(_f_frexp,(double, int*));
|
||||
double EXFUN(_f_ldexp,(double, int));
|
||||
double EXFUN(_f_log,(double));
|
||||
double EXFUN(_f_log10,(double));
|
||||
double EXFUN(_f_pow,(double, double));
|
||||
|
||||
#define atan2(__y,__x) _f_atan2((__y),(__x))
|
||||
#define exp(__x) _f_exp(__x)
|
||||
#define frexp(__x,__p) _f_frexp((__x),(__p))
|
||||
#define ldexp(__x,__e) _f_ldexp((__x),(__e))
|
||||
#define log(__x) _f_log(__x)
|
||||
#define log10(__x) _f_log10(__x)
|
||||
#define pow(__x,__y) _f_pow((__x),(__y))
|
||||
|
||||
#ifndef __STRICT_ANSI__
|
||||
|
||||
float EXFUN(_f_atan2f,(float, float));
|
||||
float EXFUN(_f_expf,(float));
|
||||
float EXFUN(_f_frexpf,(float, int*));
|
||||
float EXFUN(_f_ldexpf,(float, int));
|
||||
long long EXFUN(_f_llrint,(double));
|
||||
long long EXFUN(_f_llrintf,(float));
|
||||
long long EXFUN(_f_llrintl,(long double));
|
||||
float EXFUN(_f_logf,(float));
|
||||
float EXFUN(_f_log10f,(float));
|
||||
long EXFUN(_f_lrint,(double));
|
||||
long EXFUN(_f_lrintf,(float));
|
||||
long EXFUN(_f_lrintl,(long double));
|
||||
float EXFUN(_f_powf,(float, float));
|
||||
float EXFUN(_f_rint,(double));
|
||||
double EXFUN(_f_rintf,(float));
|
||||
long double EXFUN(_f_rintl,(long double));
|
||||
|
||||
#define atan2f(__y,__x) _f_atan2f((__y),(__x))
|
||||
#define expf(__x) _f_expf(__x)
|
||||
#define frexpf(__x,__p) _f_frexpf((__x),(__p))
|
||||
#define ldexpf(__x,__e) _f_ldexpf((__x),(__e))
|
||||
#define llrint(__x) _f_llrint((__x))
|
||||
#define llrintf(__x) _f_llrintf((__x))
|
||||
#define llrintl(__x) _f_llrintl((__x))
|
||||
#define logf(__x) _f_logf(__x)
|
||||
#define log10f(__x) _f_log10f(__x)
|
||||
#define lrint(__x) _f_lrint((__x))
|
||||
#define lrintf(__x) _f_lrintf((__x))
|
||||
#define lrintl(__x) _f_lrintl((__x))
|
||||
#define powf(__x,y) _f_powf((__x),(__y))
|
||||
#define rint(__x) _f_rint((__x))
|
||||
#define rintf(__x) _f_rintf((__x))
|
||||
#define rintl(__x) _f_rintl((__x))
|
||||
#endif
|
||||
|
||||
#endif /* GCC */
|
||||
#endif /* _MACHFASTMATH_H */
|
||||
|
@@ -3,6 +3,7 @@
|
||||
#define _MATH_H_
|
||||
|
||||
#include <sys/reent.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <machine/ieeefp.h>
|
||||
#include "_ansi.h"
|
||||
|
||||
@@ -136,9 +137,7 @@ extern double fmod _PARAMS((double, double));
|
||||
#endif /* ! defined (__math_68881) */
|
||||
#endif /* ! defined (_REENT_ONLY) */
|
||||
|
||||
#if !defined(__STRICT_ANSI__) || defined(__cplusplus) || \
|
||||
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
|
||||
|
||||
#if __ISO_C_VISIBLE >= 1999
|
||||
/* ISO C99 types and macros. */
|
||||
|
||||
/* FIXME: FLT_EVAL_METHOD should somehow be gotten from float.h (which is hard,
|
||||
@@ -205,35 +204,70 @@ extern int __fpclassifyd (double x);
|
||||
extern int __signbitf (float x);
|
||||
extern int __signbitd (double x);
|
||||
|
||||
#define fpclassify(__x) \
|
||||
((sizeof(__x) == sizeof(float)) ? __fpclassifyf(__x) : \
|
||||
__fpclassifyd(__x))
|
||||
|
||||
#ifndef isfinite
|
||||
#define isfinite(__y) \
|
||||
(__extension__ ({int __cy = fpclassify(__y); \
|
||||
__cy != FP_INFINITE && __cy != FP_NAN;}))
|
||||
#endif
|
||||
|
||||
/* Note: isinf and isnan were once functions in newlib that took double
|
||||
* arguments. C99 specifies that these names are reserved for macros
|
||||
* supporting multiple floating point types. Thus, they are
|
||||
* now defined as macros. Implementations of the old functions
|
||||
* taking double arguments still exist for compatibility purposes
|
||||
* (prototypes for them are in <ieeefp.h>). */
|
||||
#ifndef isinf
|
||||
#define isinf(y) (fpclassify(y) == FP_INFINITE)
|
||||
|
||||
#if __GNUC_PREREQ (4, 4)
|
||||
#define fpclassify(__x) (__builtin_fpclassify (FP_NAN, FP_INFINITE, \
|
||||
FP_NORMAL, FP_SUBNORMAL, \
|
||||
FP_ZERO, __x))
|
||||
#ifndef isfinite
|
||||
#define isfinite(__x) (__builtin_isfinite (__x))
|
||||
#endif
|
||||
#ifndef isinf
|
||||
#define isinf(__x) (__builtin_isinf_sign (__x))
|
||||
#endif
|
||||
#ifndef isnan
|
||||
#define isnan(__x) (__builtin_isnan (__x))
|
||||
#endif
|
||||
#define isnormal(__x) (__builtin_isnormal (__x))
|
||||
#else
|
||||
#define fpclassify(__x) \
|
||||
((sizeof(__x) == sizeof(float)) ? __fpclassifyf(__x) : \
|
||||
__fpclassifyd(__x))
|
||||
#ifndef isfinite
|
||||
#define isfinite(__y) \
|
||||
(__extension__ ({int __cy = fpclassify(__y); \
|
||||
__cy != FP_INFINITE && __cy != FP_NAN;}))
|
||||
#endif
|
||||
#ifndef isinf
|
||||
#define isinf(__x) (fpclassify(__x) == FP_INFINITE)
|
||||
#endif
|
||||
#ifndef isnan
|
||||
#define isnan(__x) (fpclassify(__x) == FP_NAN)
|
||||
#endif
|
||||
#define isnormal(__x) (fpclassify(__x) == FP_NORMAL)
|
||||
#endif
|
||||
|
||||
#ifndef isnan
|
||||
#define isnan(y) (fpclassify(y) == FP_NAN)
|
||||
#endif
|
||||
|
||||
#define isnormal(y) (fpclassify(y) == FP_NORMAL)
|
||||
#define signbit(__x) \
|
||||
#if __GNUC_PREREQ (4, 0)
|
||||
#if defined(_HAVE_LONG_DOUBLE)
|
||||
#define signbit(__x) \
|
||||
((sizeof(__x) == sizeof(float)) ? __builtin_signbitf(__x) : \
|
||||
(sizeof(__x) == sizeof(double)) ? __builtin_signbit (__x) : \
|
||||
__builtin_signbitl(__x))
|
||||
#else
|
||||
#define signbit(__x) \
|
||||
((sizeof(__x) == sizeof(float)) ? __builtin_signbitf(__x) : \
|
||||
__builtin_signbit (__x))
|
||||
#endif
|
||||
#else
|
||||
#define signbit(__x) \
|
||||
((sizeof(__x) == sizeof(float)) ? __signbitf(__x) : \
|
||||
__signbitd(__x))
|
||||
#endif
|
||||
|
||||
#if __GNUC_PREREQ (2, 97)
|
||||
#define isgreater(__x,__y) (__builtin_isgreater (__x, __y))
|
||||
#define isgreaterequal(__x,__y) (__builtin_isgreaterequal (__x, __y))
|
||||
#define isless(__x,__y) (__builtin_isless (__x, __y))
|
||||
#define islessequal(__x,__y) (__builtin_islessequal (__x, __y))
|
||||
#define islessgreater(__x,__y) (__builtin_islessgreater (__x, __y))
|
||||
#define isunordered(__x,__y) (__builtin_isunordered (__x, __y))
|
||||
#else
|
||||
#define isgreater(x,y) \
|
||||
(__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \
|
||||
!isunordered(__x,__y) && (__x > __y);}))
|
||||
@@ -253,6 +287,7 @@ extern int __signbitd (double x);
|
||||
#define isunordered(a,b) \
|
||||
(__extension__ ({__typeof__(a) __a = (a); __typeof__(b) __b = (b); \
|
||||
fpclassify(__a) == FP_NAN || fpclassify(__b) == FP_NAN;}))
|
||||
#endif
|
||||
|
||||
/* Non ANSI long double precision functions. */
|
||||
|
||||
@@ -386,8 +421,12 @@ extern float log2f _PARAMS((float));
|
||||
extern float hypotf _PARAMS((float, float));
|
||||
#endif /* ! defined (_REENT_ONLY) */
|
||||
|
||||
/* On platforms where long double equals double. */
|
||||
#ifdef _LDBL_EQ_DBL
|
||||
/* Newlib doesn't fully support long double math functions so far.
|
||||
On platforms where long double equals double the long double functions
|
||||
simply call the double functions. On Cygwin the long double functions
|
||||
are implemented independently from newlib to be able to use optimized
|
||||
assembler functions despite using the Microsoft x86_64 ABI. */
|
||||
#if defined (_LDBL_EQ_DBL) || defined (__CYGWIN__)
|
||||
/* Reentrant ANSI C functions. */
|
||||
#ifndef __math_68881
|
||||
extern long double atanl _PARAMS((long double));
|
||||
@@ -457,7 +496,7 @@ extern long double lgammal _PARAMS((long double));
|
||||
extern long double erfl _PARAMS((long double));
|
||||
extern long double erfcl _PARAMS((long double));
|
||||
#endif /* ! defined (_REENT_ONLY) */
|
||||
#else /* !_LDBL_EQ_DBL */
|
||||
#else /* !_LDBL_EQ_DBL && !__CYGWIN__ */
|
||||
extern long double hypotl _PARAMS((long double, long double));
|
||||
extern long double sqrtl _PARAMS((long double));
|
||||
#ifdef __i386__
|
||||
@@ -466,37 +505,47 @@ extern _LONG_DOUBLE rintl _PARAMS((_LONG_DOUBLE));
|
||||
extern long int lrintl _PARAMS((_LONG_DOUBLE));
|
||||
extern long long int llrintl _PARAMS((_LONG_DOUBLE));
|
||||
#endif /* __i386__ */
|
||||
#endif /* !_LDBL_EQ_DBL */
|
||||
#endif /* !_LDBL_EQ_DBL && !__CYGWIN__ */
|
||||
|
||||
#endif /* !defined (__STRICT_ANSI__) || defined(__cplusplus) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) */
|
||||
|
||||
#if !defined (__STRICT_ANSI__) || defined(__cplusplus)
|
||||
#endif /* __ISO_C_VISIBLE >= 1999 */
|
||||
|
||||
#if __MISC_VISIBLE
|
||||
extern double drem _PARAMS((double, double));
|
||||
extern void sincos _PARAMS((double, double *, double *));
|
||||
extern float dremf _PARAMS((float, float));
|
||||
#ifdef __CYGWIN__
|
||||
extern float dreml _PARAMS((long double, long double));
|
||||
#endif /* __CYGWIN__ */
|
||||
extern double gamma_r _PARAMS((double, int *));
|
||||
extern double lgamma_r _PARAMS((double, int *));
|
||||
extern float gammaf_r _PARAMS((float, int *));
|
||||
extern float lgammaf_r _PARAMS((float, int *));
|
||||
#endif
|
||||
|
||||
#if __MISC_VISIBLE || __XSI_VISIBLE
|
||||
extern double y0 _PARAMS((double));
|
||||
extern double y1 _PARAMS((double));
|
||||
extern double yn _PARAMS((int, double));
|
||||
extern double j0 _PARAMS((double));
|
||||
extern double j1 _PARAMS((double));
|
||||
extern double jn _PARAMS((int, double));
|
||||
#endif
|
||||
|
||||
extern float dremf _PARAMS((float, float));
|
||||
extern void sincosf _PARAMS((float, float *, float *));
|
||||
extern float gammaf_r _PARAMS((float, int *));
|
||||
extern float lgammaf_r _PARAMS((float, int *));
|
||||
|
||||
#if __MISC_VISIBLE || __XSI_VISIBLE >= 600
|
||||
extern float y0f _PARAMS((float));
|
||||
extern float y1f _PARAMS((float));
|
||||
extern float ynf _PARAMS((int, float));
|
||||
extern float j0f _PARAMS((float));
|
||||
extern float j1f _PARAMS((float));
|
||||
extern float jnf _PARAMS((int, float));
|
||||
#endif
|
||||
|
||||
/* GNU extensions */
|
||||
#if __GNU_VISIBLE
|
||||
extern void sincos _PARAMS((double, double *, double *));
|
||||
extern void sincosf _PARAMS((float, float *, float *));
|
||||
#ifdef __CYGWIN__
|
||||
extern void sincosl _PARAMS((long double, long double *, long double *));
|
||||
#endif /* __CYGWIN__ */
|
||||
# ifndef exp10
|
||||
extern double exp10 _PARAMS((double));
|
||||
# endif
|
||||
@@ -509,11 +558,17 @@ extern float exp10f _PARAMS((float));
|
||||
# ifndef pow10f
|
||||
extern float pow10f _PARAMS((float));
|
||||
# endif
|
||||
#ifdef __CYGWIN__
|
||||
# ifndef exp10l
|
||||
extern float exp10l _PARAMS((float));
|
||||
# endif
|
||||
# ifndef pow10l
|
||||
extern float pow10l _PARAMS((float));
|
||||
# endif
|
||||
#endif /* __CYGWIN__ */
|
||||
#endif /* __GNU_VISIBLE */
|
||||
|
||||
#endif /* !defined (__STRICT_ANSI__) || defined(__cplusplus) */
|
||||
|
||||
#ifndef __STRICT_ANSI__
|
||||
|
||||
#if __MISC_VISIBLE || __XSI_VISIBLE
|
||||
/* The gamma functions use a global variable, signgam. */
|
||||
#ifndef _REENT_ONLY
|
||||
#define signgam (*__signgam())
|
||||
@@ -521,7 +576,9 @@ extern int *__signgam _PARAMS((void));
|
||||
#endif /* ! defined (_REENT_ONLY) */
|
||||
|
||||
#define __signgam_r(ptr) _REENT_SIGNGAM(ptr)
|
||||
#endif /* __MISC_VISIBLE || __XSI_VISIBLE */
|
||||
|
||||
#if __SVID_VISIBLE
|
||||
/* The exception structure passed to the matherr routine. */
|
||||
/* We have a problem when using C++ since `exception' is a reserved
|
||||
name in C++. */
|
||||
@@ -554,11 +611,11 @@ extern int matherr _PARAMS((struct exception *e));
|
||||
#define TLOSS 5
|
||||
#define PLOSS 6
|
||||
|
||||
#endif /* ! defined (__STRICT_ANSI__) */
|
||||
#endif /* __SVID_VISIBLE */
|
||||
|
||||
/* Useful constants. */
|
||||
|
||||
#if !defined(__STRICT_ANSI__) || ((_XOPEN_SOURCE - 0) >= 500)
|
||||
#if __BSD_VISIBLE || __XSI_VISIBLE >= 500
|
||||
|
||||
#define MAXFLOAT 3.40282347e+38F
|
||||
|
||||
@@ -578,7 +635,7 @@ extern int matherr _PARAMS((struct exception *e));
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef __STRICT_ANSI__
|
||||
#if __BSD_VISIBLE
|
||||
|
||||
#define M_TWOPI (M_PI * 2.0)
|
||||
#define M_3PI_4 2.3561944901923448370E0
|
||||
@@ -610,7 +667,7 @@ extern __IMPORT _LIB_VERSION_TYPE _LIB_VERSION;
|
||||
#define _XOPEN_ __fdlibm_xopen
|
||||
#define _POSIX_ __fdlibm_posix
|
||||
|
||||
#endif /* ! defined (__STRICT_ANSI__) */
|
||||
#endif /* __BSD_VISIBLE */
|
||||
|
||||
_END_STD_C
|
||||
|
||||
|
@@ -11,11 +11,11 @@
|
||||
/* #undef _ELIX_LEVEL */
|
||||
|
||||
/* Newlib version */
|
||||
#define _NEWLIB_VERSION "2.3.0"
|
||||
#include <_newlib_version.h>
|
||||
|
||||
/* C99 formats support (such as %a, %zu, ...) in IO functions like
|
||||
* printf/scanf enabled */
|
||||
//#define _WANT_IO_C99_FORMATS
|
||||
/* #undef _WANT_IO_C99_FORMATS */
|
||||
|
||||
#define __DYNAMIC_REENT__
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
/* Define if the linker supports .preinit_array/.init_array/.fini_array
|
||||
* sections. */
|
||||
#define HAVE_INITFINI_ARRAY 1
|
||||
/* #undef HAVE_INITFINI_ARRAY */
|
||||
|
||||
/* True if atexit() may dynamically allocate space for cleanup
|
||||
functions. */
|
||||
@@ -58,6 +58,9 @@
|
||||
/* True if long double supported. */
|
||||
#define _HAVE_LONG_DOUBLE 1
|
||||
|
||||
/* Define if compiler supports -fno-tree-loop-distribute-patterns. */
|
||||
#define _HAVE_CC_INHIBIT_LOOP_TO_LIBCALL 1
|
||||
|
||||
/* True if long double supported and it is equal to double. */
|
||||
/* #undef _LDBL_EQ_DBL */
|
||||
|
||||
|
@@ -1,8 +1,7 @@
|
||||
/* pthread.h
|
||||
/*
|
||||
* Written by Joel Sherrill <joel.sherrill@OARcorp.com>.
|
||||
*
|
||||
* Written by Joel Sherrill <joel@OARcorp.com>.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-2013.
|
||||
* COPYRIGHT (c) 1989-2013, 2015.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
@@ -14,8 +13,6 @@
|
||||
* WARRANTY. IN PARTICULAR, THE AUTHOR MAKES NO REPRESENTATION
|
||||
* OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS
|
||||
* SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __PTHREAD_h
|
||||
@@ -96,6 +93,13 @@ int _EXFUN(pthread_mutex_timedlock,
|
||||
|
||||
int _EXFUN(pthread_condattr_init, (pthread_condattr_t *__attr));
|
||||
int _EXFUN(pthread_condattr_destroy, (pthread_condattr_t *__attr));
|
||||
|
||||
int _EXFUN(pthread_condattr_getclock,
|
||||
(const pthread_condattr_t *__restrict __attr,
|
||||
clockid_t *__restrict __clock_id));
|
||||
int _EXFUN(pthread_condattr_setclock,
|
||||
(pthread_condattr_t *__attr, clockid_t __clock_id));
|
||||
|
||||
int _EXFUN(pthread_condattr_getpshared,
|
||||
(_CONST pthread_condattr_t *__attr, int *__pshared));
|
||||
int _EXFUN(pthread_condattr_setpshared,
|
||||
@@ -161,6 +165,9 @@ int _EXFUN(pthread_getschedparam,
|
||||
int _EXFUN(pthread_setschedparam,
|
||||
(pthread_t __pthread, int __policy, struct sched_param *__param));
|
||||
|
||||
/* Set Scheduling Priority of a Thread */
|
||||
int _EXFUN(pthread_setschedprio, (pthread_t thread, int prio));
|
||||
|
||||
#endif /* defined(_POSIX_THREAD_PRIORITY_SCHEDULING) */
|
||||
|
||||
#if defined(_POSIX_THREAD_PRIO_INHERIT) || defined(_POSIX_THREAD_PRIO_PROTECT)
|
||||
@@ -253,7 +260,7 @@ int _EXFUN(pthread_detach, (pthread_t __pthread));
|
||||
|
||||
/* Thread Termination, p1003.1c/Draft 10, p. 150 */
|
||||
|
||||
void _EXFUN(pthread_exit, (void *__value_ptr));
|
||||
void _EXFUN(pthread_exit, (void *__value_ptr)) __dead2;
|
||||
|
||||
/* Get Calling Thread's ID, p1003.1c/Draft 10, p. XXX */
|
||||
|
||||
@@ -263,6 +270,14 @@ pthread_t _EXFUN(pthread_self, (void));
|
||||
|
||||
int _EXFUN(pthread_equal, (pthread_t __t1, pthread_t __t2));
|
||||
|
||||
/* Retrieve ID of a Thread's CPU Time Clock */
|
||||
int _EXFUN(pthread_getcpuclockid,
|
||||
(pthread_t thread, clockid_t *clock_id));
|
||||
|
||||
/* Get/Set Current Thread's Concurrency Level */
|
||||
int _EXFUN(pthread_setconcurrency, (int new_level));
|
||||
int _EXFUN(pthread_getconcurrency, (void));
|
||||
|
||||
/* Dynamic Package Initialization */
|
||||
|
||||
/* This is used to statically initialize a pthread_once_t. Example:
|
||||
@@ -329,7 +344,7 @@ void _EXFUN(_pthread_cleanup_pop,
|
||||
_pthread_cleanup_pop(&_pthread_clup_ctx, (_execute)); \
|
||||
} while (0)
|
||||
|
||||
#if defined(_GNU_SOURCE)
|
||||
#if __GNU_VISIBLE
|
||||
void _EXFUN(_pthread_cleanup_push_defer,
|
||||
(struct _pthread_cleanup_context *_context,
|
||||
void (*_routine)(void *), void *_arg));
|
||||
@@ -347,7 +362,7 @@ void _EXFUN(_pthread_cleanup_pop_restore,
|
||||
#define pthread_cleanup_pop_restore_np(_execute) \
|
||||
_pthread_cleanup_pop_restore(&_pthread_clup_ctx, (_execute)); \
|
||||
} while (0)
|
||||
#endif /* defined(_GNU_SOURCE) */
|
||||
#endif /* __GNU_VISIBLE */
|
||||
|
||||
#if defined(_POSIX_THREAD_CPUTIME)
|
||||
|
||||
|
@@ -63,14 +63,14 @@ struct passwd {
|
||||
struct passwd *getpwuid (uid_t);
|
||||
struct passwd *getpwnam (const char *);
|
||||
|
||||
#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 500
|
||||
#if __MISC_VISIBLE || __POSIX_VISIBLE
|
||||
int getpwnam_r (const char *, struct passwd *,
|
||||
char *, size_t , struct passwd **);
|
||||
int getpwuid_r (uid_t, struct passwd *, char *,
|
||||
size_t, struct passwd **);
|
||||
#endif
|
||||
|
||||
#if __XSI_VISIBLE >= 500
|
||||
#if __MISC_VISIBLE || __XSI_VISIBLE >= 4
|
||||
struct passwd *getpwent (void);
|
||||
void setpwent (void);
|
||||
void endpwent (void);
|
||||
|
@@ -2,15 +2,18 @@
|
||||
#define _SIGNAL_H_
|
||||
|
||||
#include "_ansi.h"
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/signal.h>
|
||||
|
||||
_BEGIN_STD_C
|
||||
|
||||
typedef int sig_atomic_t; /* Atomic entity type (ANSI) */
|
||||
#ifndef _POSIX_SOURCE
|
||||
#if __BSD_VISIBLE
|
||||
typedef _sig_func_ptr sig_t; /* BSD naming */
|
||||
#endif
|
||||
#if __GNU_VISIBLE
|
||||
typedef _sig_func_ptr sighandler_t; /* glibc naming */
|
||||
#endif /* !_POSIX_SOURCE */
|
||||
#endif
|
||||
|
||||
#define SIG_DFL ((_sig_func_ptr)0) /* Default action */
|
||||
#define SIG_IGN ((_sig_func_ptr)1) /* Ignore action */
|
||||
|
@@ -128,7 +128,7 @@ typedef _fpos64_t fpos64_t;
|
||||
#define L_tmpnam FILENAME_MAX
|
||||
#endif
|
||||
|
||||
#ifndef __STRICT_ANSI__
|
||||
#if __BSD_VISIBLE || __XSI_VISIBLE
|
||||
#define P_tmpdir "/tmp"
|
||||
#endif
|
||||
|
||||
@@ -230,7 +230,7 @@ int _EXFUN(rename, (const char *, const char *));
|
||||
int _EXFUN(_rename, (const char *, const char *));
|
||||
#endif
|
||||
#endif
|
||||
#if !defined(__STRICT_ANSI__) || defined(__USE_XOPEN2K)
|
||||
#if __LARGEFILE_VISIBLE || __POSIX_VISIBLE >= 200112
|
||||
#ifdef _COMPILING_NEWLIB
|
||||
int _EXFUN(fseeko, (FILE *, _off_t, int));
|
||||
_off_t _EXFUN(ftello, ( FILE *));
|
||||
@@ -242,16 +242,32 @@ off_t _EXFUN(ftello, ( FILE *));
|
||||
#if __GNU_VISIBLE
|
||||
int _EXFUN(fcloseall, (_VOID));
|
||||
#endif
|
||||
#if !defined(__STRICT_ANSI__) || (__STDC_VERSION__ >= 199901L) || (__cplusplus >= 201103L)
|
||||
#ifndef _REENT_ONLY
|
||||
#if __ISO_C_VISIBLE >= 1999
|
||||
int _EXFUN(snprintf, (char *__restrict, size_t, const char *__restrict, ...)
|
||||
_ATTRIBUTE ((__format__ (__printf__, 3, 4))));
|
||||
int _EXFUN(vsnprintf, (char *__restrict, size_t, const char *__restrict, __VALIST)
|
||||
_ATTRIBUTE ((__format__ (__printf__, 3, 0))));
|
||||
int _EXFUN(vfscanf, (FILE *__restrict, const char *__restrict, __VALIST)
|
||||
_ATTRIBUTE ((__format__ (__scanf__, 2, 0))));
|
||||
int _EXFUN(vscanf, (const char *, __VALIST)
|
||||
_ATTRIBUTE ((__format__ (__scanf__, 1, 0))));
|
||||
int _EXFUN(vsscanf, (const char *__restrict, const char *__restrict, __VALIST)
|
||||
_ATTRIBUTE ((__format__ (__scanf__, 2, 0))));
|
||||
#endif
|
||||
#if __GNU_VISIBLE
|
||||
int _EXFUN(asprintf, (char **__restrict, const char *__restrict, ...)
|
||||
_ATTRIBUTE ((__format__ (__printf__, 2, 3))));
|
||||
int _EXFUN(vasprintf, (char **, const char *, __VALIST)
|
||||
_ATTRIBUTE ((__format__ (__printf__, 2, 0))));
|
||||
#endif
|
||||
#if __MISC_VISIBLE /* Newlib-specific */
|
||||
int _EXFUN(asiprintf, (char **, const char *, ...)
|
||||
_ATTRIBUTE ((__format__ (__printf__, 2, 3))));
|
||||
char * _EXFUN(asniprintf, (char *, size_t *, const char *, ...)
|
||||
_ATTRIBUTE ((__format__ (__printf__, 3, 4))));
|
||||
char * _EXFUN(asnprintf, (char *__restrict, size_t *__restrict, const char *__restrict, ...)
|
||||
_ATTRIBUTE ((__format__ (__printf__, 3, 4))));
|
||||
int _EXFUN(asprintf, (char **__restrict, const char *__restrict, ...)
|
||||
_ATTRIBUTE ((__format__ (__printf__, 2, 3))));
|
||||
#ifndef diprintf
|
||||
int _EXFUN(diprintf, (int, const char *, ...)
|
||||
_ATTRIBUTE ((__format__ (__printf__, 2, 3))));
|
||||
@@ -268,8 +284,6 @@ int _EXFUN(siprintf, (char *, const char *, ...)
|
||||
_ATTRIBUTE ((__format__ (__printf__, 2, 3))));
|
||||
int _EXFUN(siscanf, (const char *, const char *, ...)
|
||||
_ATTRIBUTE ((__format__ (__scanf__, 2, 3))));
|
||||
int _EXFUN(snprintf, (char *__restrict, size_t, const char *__restrict, ...)
|
||||
_ATTRIBUTE ((__format__ (__printf__, 3, 4))));
|
||||
int _EXFUN(sniprintf, (char *, size_t, const char *, ...)
|
||||
_ATTRIBUTE ((__format__ (__printf__, 3, 4))));
|
||||
int _EXFUN(vasiprintf, (char **, const char *, __VALIST)
|
||||
@@ -278,50 +292,50 @@ char * _EXFUN(vasniprintf, (char *, size_t *, const char *, __VALIST)
|
||||
_ATTRIBUTE ((__format__ (__printf__, 3, 0))));
|
||||
char * _EXFUN(vasnprintf, (char *, size_t *, const char *, __VALIST)
|
||||
_ATTRIBUTE ((__format__ (__printf__, 3, 0))));
|
||||
int _EXFUN(vasprintf, (char **, const char *, __VALIST)
|
||||
_ATTRIBUTE ((__format__ (__printf__, 2, 0))));
|
||||
int _EXFUN(vdiprintf, (int, const char *, __VALIST)
|
||||
_ATTRIBUTE ((__format__ (__printf__, 2, 0))));
|
||||
int _EXFUN(vfiprintf, (FILE *, const char *, __VALIST)
|
||||
_ATTRIBUTE ((__format__ (__printf__, 2, 0))));
|
||||
int _EXFUN(vfiscanf, (FILE *, const char *, __VALIST)
|
||||
_ATTRIBUTE ((__format__ (__scanf__, 2, 0))));
|
||||
int _EXFUN(vfscanf, (FILE *__restrict, const char *__restrict, __VALIST)
|
||||
_ATTRIBUTE ((__format__ (__scanf__, 2, 0))));
|
||||
int _EXFUN(viprintf, (const char *, __VALIST)
|
||||
_ATTRIBUTE ((__format__ (__printf__, 1, 0))));
|
||||
int _EXFUN(viscanf, (const char *, __VALIST)
|
||||
_ATTRIBUTE ((__format__ (__scanf__, 1, 0))));
|
||||
int _EXFUN(vscanf, (const char *, __VALIST)
|
||||
_ATTRIBUTE ((__format__ (__scanf__, 1, 0))));
|
||||
int _EXFUN(vsiprintf, (char *, const char *, __VALIST)
|
||||
_ATTRIBUTE ((__format__ (__printf__, 2, 0))));
|
||||
int _EXFUN(vsiscanf, (const char *, const char *, __VALIST)
|
||||
_ATTRIBUTE ((__format__ (__scanf__, 2, 0))));
|
||||
int _EXFUN(vsniprintf, (char *, size_t, const char *, __VALIST)
|
||||
_ATTRIBUTE ((__format__ (__printf__, 3, 0))));
|
||||
int _EXFUN(vsnprintf, (char *__restrict, size_t, const char *__restrict, __VALIST)
|
||||
_ATTRIBUTE ((__format__ (__printf__, 3, 0))));
|
||||
int _EXFUN(vsscanf, (const char *__restrict, const char *__restrict, __VALIST)
|
||||
_ATTRIBUTE ((__format__ (__scanf__, 2, 0))));
|
||||
#endif /* __MISC_VISIBLE */
|
||||
#endif /* !_REENT_ONLY */
|
||||
#endif /* !__STRICT_ANSI__ */
|
||||
|
||||
/*
|
||||
* Routines in POSIX 1003.1:2001.
|
||||
*/
|
||||
|
||||
#ifndef __STRICT_ANSI__
|
||||
#if __POSIX_VISIBLE
|
||||
#ifndef _REENT_ONLY
|
||||
FILE * _EXFUN(fdopen, (int, const char *));
|
||||
#endif
|
||||
int _EXFUN(fileno, (FILE *));
|
||||
int _EXFUN(getw, (FILE *));
|
||||
#endif
|
||||
#if __MISC_VISIBLE || __POSIX_VISIBLE >= 199209
|
||||
int _EXFUN(pclose, (FILE *));
|
||||
FILE * _EXFUN(popen, (const char *, const char *));
|
||||
int _EXFUN(putw, (int, FILE *));
|
||||
#endif
|
||||
|
||||
#if __BSD_VISIBLE
|
||||
void _EXFUN(setbuffer, (FILE *, char *, int));
|
||||
int _EXFUN(setlinebuf, (FILE *));
|
||||
#endif
|
||||
|
||||
#if __MISC_VISIBLE || (__XSI_VISIBLE && __POSIX_VISIBLE < 200112)
|
||||
int _EXFUN(getw, (FILE *));
|
||||
int _EXFUN(putw, (int, FILE *));
|
||||
#endif
|
||||
#if __MISC_VISIBLE || __POSIX_VISIBLE
|
||||
int _EXFUN(getc_unlocked, (FILE *));
|
||||
int _EXFUN(getchar_unlocked, (void));
|
||||
void _EXFUN(flockfile, (FILE *));
|
||||
@@ -329,13 +343,13 @@ int _EXFUN(ftrylockfile, (FILE *));
|
||||
void _EXFUN(funlockfile, (FILE *));
|
||||
int _EXFUN(putc_unlocked, (int, FILE *));
|
||||
int _EXFUN(putchar_unlocked, (int));
|
||||
#endif /* ! __STRICT_ANSI__ */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Routines in POSIX 1003.1:200x.
|
||||
*/
|
||||
|
||||
#ifndef __STRICT_ANSI__
|
||||
#if __POSIX_VISIBLE >= 200809
|
||||
# ifndef _REENT_ONLY
|
||||
# ifndef dprintf
|
||||
int _EXFUN(dprintf, (int, const char *__restrict, ...)
|
||||
@@ -345,13 +359,13 @@ FILE * _EXFUN(fmemopen, (void *__restrict, size_t, const char *__restrict));
|
||||
/* getdelim - see __getdelim for now */
|
||||
/* getline - see __getline for now */
|
||||
FILE * _EXFUN(open_memstream, (char **, size_t *));
|
||||
#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809
|
||||
int _EXFUN(renameat, (int, const char *, int, const char *));
|
||||
#endif
|
||||
int _EXFUN(vdprintf, (int, const char *__restrict, __VALIST)
|
||||
_ATTRIBUTE ((__format__ (__printf__, 2, 0))));
|
||||
# endif
|
||||
#endif
|
||||
#if __ATFILE_VISIBLE
|
||||
int _EXFUN(renameat, (int, const char *, int, const char *));
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Recursive versions of the above.
|
||||
@@ -495,7 +509,7 @@ int _EXFUN(fpurge, (FILE *));
|
||||
ssize_t _EXFUN(__getdelim, (char **, size_t *, int, FILE *));
|
||||
ssize_t _EXFUN(__getline, (char **, size_t *, FILE *));
|
||||
|
||||
#if __BSD_VISIBLE
|
||||
#if __MISC_VISIBLE
|
||||
void _EXFUN(clearerr_unlocked, (FILE *));
|
||||
int _EXFUN(feof_unlocked, (FILE *));
|
||||
int _EXFUN(ferror_unlocked, (FILE *));
|
||||
@@ -545,7 +559,7 @@ int _EXFUN(__swbuf_r, (struct _reent *, int, FILE *));
|
||||
* Stdio function-access interface.
|
||||
*/
|
||||
|
||||
#ifndef __STRICT_ANSI__
|
||||
#if __BSD_VISIBLE
|
||||
# ifdef __LARGE64_FILES
|
||||
FILE *_EXFUN(funopen,(const _PTR __cookie,
|
||||
int (*__readfn)(_PTR __c, char *__buf,
|
||||
@@ -582,7 +596,9 @@ FILE *_EXFUN(_funopen_r,(struct _reent *, const _PTR __cookie,
|
||||
(fpos_t (*)())0, (int (*)())0)
|
||||
# define fwopen(__cookie, __fn) funopen(__cookie, (int (*)())0, __fn, \
|
||||
(fpos_t (*)())0, (int (*)())0)
|
||||
#endif /* __BSD_VISIBLE */
|
||||
|
||||
#if __GNU_VISIBLE
|
||||
typedef ssize_t cookie_read_function_t(void *__cookie, char *__buf, size_t __n);
|
||||
typedef ssize_t cookie_write_function_t(void *__cookie, const char *__buf,
|
||||
size_t __n);
|
||||
@@ -606,7 +622,7 @@ FILE *_EXFUN(fopencookie,(void *__cookie,
|
||||
const char *__mode, cookie_io_functions_t __functions));
|
||||
FILE *_EXFUN(_fopencookie_r,(struct _reent *, void *__cookie,
|
||||
const char *__mode, cookie_io_functions_t __functions));
|
||||
#endif /* ! __STRICT_ANSI__ */
|
||||
#endif /* __GNU_VISIBLE */
|
||||
|
||||
#ifndef __CUSTOM_FILE_IO__
|
||||
/*
|
||||
@@ -645,10 +661,12 @@ _ELIDABLE_INLINE int __sgetc_r(struct _reent *__ptr, FILE *__p)
|
||||
#define __sgetc_r(__ptr, __p) __sgetc_raw_r(__ptr, __p)
|
||||
#endif
|
||||
|
||||
#ifdef _never /* __GNUC__ */
|
||||
/* If this inline is actually used, then systems using coff debugging
|
||||
info get hopelessly confused. 21sept93 rich@cygnus.com. */
|
||||
#ifdef __GNUC__
|
||||
_ELIDABLE_INLINE int __sputc_r(struct _reent *_ptr, int _c, FILE *_p) {
|
||||
#ifdef __SCLE
|
||||
if ((_p->_flags & __SCLE) && _c == '\n')
|
||||
__sputc_r (_ptr, '\r', _p);
|
||||
#endif
|
||||
if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
|
||||
return (*_p->_p++ = _c);
|
||||
else
|
||||
@@ -686,14 +704,14 @@ _ELIDABLE_INLINE int __sputc_r(struct _reent *_ptr, int _c, FILE *_p) {
|
||||
#define ferror(p) __sferror(p)
|
||||
#define clearerr(p) __sclearerr(p)
|
||||
|
||||
#if __BSD_VISIBLE
|
||||
#if __MISC_VISIBLE
|
||||
#define feof_unlocked(p) __sfeof(p)
|
||||
#define ferror_unlocked(p) __sferror(p)
|
||||
#define clearerr_unlocked(p) __sclearerr(p)
|
||||
#endif /* __BSD_VISIBLE */
|
||||
#endif /* __MISC_VISIBLE */
|
||||
#endif /* _REENT_SMALL */
|
||||
|
||||
#if 0 /*ndef __STRICT_ANSI__ - FIXME: must initialize stdio first, use fn */
|
||||
#if 0 /* __POSIX_VISIBLE - FIXME: must initialize stdio first, use fn */
|
||||
#define fileno(p) __sfileno(p)
|
||||
#endif
|
||||
|
||||
@@ -704,11 +722,13 @@ _ELIDABLE_INLINE int __sputc_r(struct _reent *_ptr, int _c, FILE *_p) {
|
||||
#endif /* lint */
|
||||
#endif /* __CYGWIN__ */
|
||||
|
||||
#ifndef __STRICT_ANSI__
|
||||
#if __MISC_VISIBLE
|
||||
/* fast always-buffered version, true iff error */
|
||||
#define fast_putc(x,p) (--(p)->_w < 0 ? \
|
||||
__swbuf_r(_REENT, (int)(x), p) == EOF : (*(p)->_p = (x), (p)->_p++, 0))
|
||||
#endif
|
||||
|
||||
#if __XSI_VISIBLE
|
||||
#define L_cuserid 9 /* posix says it goes in stdio.h :( */
|
||||
#ifdef __CYGWIN__
|
||||
#define L_ctermid 16
|
||||
@@ -720,7 +740,7 @@ _ELIDABLE_INLINE int __sputc_r(struct _reent *_ptr, int _c, FILE *_p) {
|
||||
#define getchar() getc(stdin)
|
||||
#define putchar(x) putc(x, stdout)
|
||||
|
||||
#ifndef __STRICT_ANSI__
|
||||
#if __MISC_VISIBLE || __POSIX_VISIBLE
|
||||
#define getchar_unlocked() getc_unlocked(stdin)
|
||||
#define putchar_unlocked(x) putc_unlocked(x, stdout)
|
||||
#endif
|
||||
|
@@ -40,9 +40,7 @@ typedef struct
|
||||
long rem; /* remainder */
|
||||
} ldiv_t;
|
||||
|
||||
#if !defined(__STRICT_ANSI__) || \
|
||||
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
|
||||
(defined(__cplusplus) && __cplusplus >= 201103L)
|
||||
#if __ISO_C_VISIBLE >= 1999
|
||||
typedef struct
|
||||
{
|
||||
long long int quot; /* quotient */
|
||||
@@ -66,9 +64,14 @@ int _EXFUN(__locale_mb_cur_max,(_VOID));
|
||||
|
||||
_VOID _EXFUN(abort,(_VOID) _ATTRIBUTE ((__noreturn__)));
|
||||
int _EXFUN(abs,(int));
|
||||
#if __BSD_VISIBLE
|
||||
__uint32_t _EXFUN(arc4random, (void));
|
||||
__uint32_t _EXFUN(arc4random_uniform, (__uint32_t));
|
||||
void _EXFUN(arc4random_buf, (void *, size_t));
|
||||
#endif
|
||||
int _EXFUN(atexit,(_VOID (*__func)(_VOID)));
|
||||
double _EXFUN(atof,(const char *__nptr));
|
||||
#ifndef __STRICT_ANSI__
|
||||
#if __MISC_VISIBLE
|
||||
float _EXFUN(atoff,(const char *__nptr));
|
||||
#endif
|
||||
int _EXFUN(atoi,(const char *__nptr));
|
||||
@@ -88,7 +91,7 @@ char * _EXFUN(getenv,(const char *__string));
|
||||
char * _EXFUN(_getenv_r,(struct _reent *, const char *__string));
|
||||
char * _EXFUN(_findenv,(_CONST char *, int *));
|
||||
char * _EXFUN(_findenv_r,(struct _reent *, _CONST char *, int *));
|
||||
#ifndef __STRICT_ANSI__
|
||||
#if __POSIX_VISIBLE >= 200809
|
||||
extern char *suboptarg; /* getsubopt(3) external variable */
|
||||
int _EXFUN(getsubopt,(char **, char * const *, char **));
|
||||
#endif
|
||||
@@ -105,39 +108,49 @@ size_t _EXFUN(mbstowcs,(wchar_t *__restrict, const char *__restrict, size_t));
|
||||
size_t _EXFUN(_mbstowcs_r,(struct _reent *, wchar_t *__restrict, const char *__restrict, size_t, _mbstate_t *));
|
||||
size_t _EXFUN(wcstombs,(char *__restrict, const wchar_t *__restrict, size_t));
|
||||
size_t _EXFUN(_wcstombs_r,(struct _reent *, char *__restrict, const wchar_t *__restrict, size_t, _mbstate_t *));
|
||||
#ifndef __STRICT_ANSI__
|
||||
#ifndef _REENT_ONLY
|
||||
#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809
|
||||
char * _EXFUN(mkdtemp,(char *));
|
||||
#endif
|
||||
#if __GNU_VISIBLE
|
||||
int _EXFUN(mkostemp,(char *, int));
|
||||
int _EXFUN(mkostemps,(char *, int, int));
|
||||
#endif
|
||||
#if __MISC_VISIBLE || __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 4
|
||||
int _EXFUN(mkstemp,(char *));
|
||||
#endif
|
||||
#if __MISC_VISIBLE
|
||||
int _EXFUN(mkstemps,(char *, int));
|
||||
#endif
|
||||
#if __BSD_VISIBLE || (__XSI_VISIBLE >= 4 && __POSIX_VISIBLE < 200112)
|
||||
char * _EXFUN(mktemp,(char *) _ATTRIBUTE ((__deprecated__("the use of `mktemp' is dangerous; use `mkstemp' instead"))));
|
||||
#endif
|
||||
#endif /* !_REENT_ONLY */
|
||||
char * _EXFUN(_mkdtemp_r, (struct _reent *, char *));
|
||||
int _EXFUN(_mkostemp_r, (struct _reent *, char *, int));
|
||||
int _EXFUN(_mkostemps_r, (struct _reent *, char *, int, int));
|
||||
int _EXFUN(_mkstemp_r, (struct _reent *, char *));
|
||||
int _EXFUN(_mkstemps_r, (struct _reent *, char *, int));
|
||||
char * _EXFUN(_mktemp_r, (struct _reent *, char *) _ATTRIBUTE ((__deprecated__("the use of `mktemp' is dangerous; use `mkstemp' instead"))));
|
||||
#endif
|
||||
_VOID _EXFUN(qsort,(_PTR __base, size_t __nmemb, size_t __size, __compar_fn_t _compar));
|
||||
int _EXFUN(rand,(_VOID));
|
||||
_PTR _EXFUN_NOTHROW(realloc,(_PTR __r, size_t __size));
|
||||
#ifndef __STRICT_ANSI__
|
||||
#if __BSD_VISIBLE
|
||||
_PTR _EXFUN(reallocf,(_PTR __r, size_t __size));
|
||||
#endif
|
||||
#if __BSD_VISIBLE || __XSI_VISIBLE >= 4
|
||||
char * _EXFUN(realpath, (const char *__restrict path, char *__restrict resolved_path));
|
||||
#endif
|
||||
#if __BSD_VISIBLE
|
||||
int _EXFUN(rpmatch, (const char *response));
|
||||
#endif
|
||||
_VOID _EXFUN(srand,(unsigned __seed));
|
||||
double _EXFUN(strtod,(const char *__restrict __n, char **__restrict __end_PTR));
|
||||
double _EXFUN(_strtod_r,(struct _reent *,const char *__restrict __n, char **__restrict __end_PTR));
|
||||
#if !defined(__STRICT_ANSI__) || \
|
||||
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
|
||||
(defined(__cplusplus) && __cplusplus >= 201103L)
|
||||
#if __ISO_C_VISIBLE >= 1999
|
||||
float _EXFUN(strtof,(const char *__restrict __n, char **__restrict __end_PTR));
|
||||
#endif
|
||||
#ifndef __STRICT_ANSI__
|
||||
#if __MISC_VISIBLE
|
||||
/* the following strtodf interface is deprecated...use strtof instead */
|
||||
# ifndef strtodf
|
||||
# define strtodf strtof
|
||||
@@ -150,24 +163,28 @@ unsigned long _EXFUN(_strtoul_r,(struct _reent *,const char *__restrict __n, cha
|
||||
|
||||
int _EXFUN(system,(const char *__string));
|
||||
|
||||
#ifndef __STRICT_ANSI__
|
||||
#if __SVID_VISIBLE || __XSI_VISIBLE >= 4
|
||||
long _EXFUN(a64l,(const char *__input));
|
||||
char * _EXFUN(l64a,(long __input));
|
||||
char * _EXFUN(_l64a_r,(struct _reent *,long __input));
|
||||
#endif
|
||||
#if __MISC_VISIBLE
|
||||
int _EXFUN(on_exit,(_VOID (*__func)(int, _PTR),_PTR __arg));
|
||||
#endif /* ! __STRICT_ANSI__ */
|
||||
#if !defined(__STRICT_ANSI__) || \
|
||||
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
|
||||
(defined(__cplusplus) && __cplusplus >= 201103L)
|
||||
#endif
|
||||
#if __ISO_C_VISIBLE >= 1999
|
||||
_VOID _EXFUN(_Exit,(int __status) _ATTRIBUTE ((__noreturn__)));
|
||||
#endif
|
||||
#ifndef __STRICT_ANSI__
|
||||
#if __SVID_VISIBLE || __XSI_VISIBLE
|
||||
int _EXFUN(putenv,(char *__string));
|
||||
#endif
|
||||
int _EXFUN(_putenv_r,(struct _reent *, char *__string));
|
||||
_PTR _EXFUN(_reallocf_r,(struct _reent *, _PTR, size_t));
|
||||
#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112
|
||||
int _EXFUN(setenv,(const char *__string, const char *__value, int __overwrite));
|
||||
#endif
|
||||
int _EXFUN(_setenv_r,(struct _reent *, const char *__string, const char *__value, int __overwrite));
|
||||
|
||||
#if __XSI_VISIBLE >= 4 && __POSIX_VISIBLE < 200112
|
||||
char * _EXFUN(gcvt,(double,int,char *));
|
||||
char * _EXFUN(gcvtf,(float,int,char *));
|
||||
char * _EXFUN(fcvt,(double,int,int *,int *));
|
||||
@@ -176,15 +193,18 @@ char * _EXFUN(ecvt,(double,int,int *,int *));
|
||||
char * _EXFUN(ecvtbuf,(double, int, int*, int*, char *));
|
||||
char * _EXFUN(fcvtbuf,(double, int, int*, int*, char *));
|
||||
char * _EXFUN(ecvtf,(float,int,int *,int *));
|
||||
char * _EXFUN(dtoa,(double, int, int, int *, int*, char**));
|
||||
#endif
|
||||
char * _EXFUN(__itoa,(int, char *, int));
|
||||
char * _EXFUN(__utoa,(unsigned, char *, int));
|
||||
#ifndef __STRICT_ANSI__
|
||||
#if __MISC_VISIBLE
|
||||
char * _EXFUN(itoa,(int, char *, int));
|
||||
char * _EXFUN(utoa,(unsigned, char *, int));
|
||||
#endif
|
||||
#if __POSIX_VISIBLE
|
||||
int _EXFUN(rand_r,(unsigned *__seed));
|
||||
#endif
|
||||
|
||||
#if __SVID_VISIBLE || __XSI_VISIBLE
|
||||
double _EXFUN(drand48,(_VOID));
|
||||
double _EXFUN(_drand48_r,(struct _reent *));
|
||||
double _EXFUN(erand48,(unsigned short [3]));
|
||||
@@ -205,45 +225,42 @@ unsigned short *
|
||||
_EXFUN(_seed48_r,(struct _reent *, unsigned short [3]));
|
||||
_VOID _EXFUN(srand48,(long));
|
||||
_VOID _EXFUN(_srand48_r,(struct _reent *, long));
|
||||
#endif /* ! __STRICT_ANSI__ */
|
||||
#if !defined(__STRICT_ANSI__) || \
|
||||
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
|
||||
(defined(__cplusplus) && __cplusplus >= 201103L)
|
||||
#endif /* __SVID_VISIBLE || __XSI_VISIBLE */
|
||||
#if __SVID_VISIBLE || __XSI_VISIBLE >= 4 || __BSD_VISIBLE
|
||||
char * _EXFUN(initstate,(unsigned, char *, size_t));
|
||||
long _EXFUN(random,(_VOID));
|
||||
char * _EXFUN(setstate,(char *));
|
||||
_VOID _EXFUN(srandom,(unsigned));
|
||||
#endif
|
||||
#if __ISO_C_VISIBLE >= 1999
|
||||
long long _EXFUN(atoll,(const char *__nptr));
|
||||
#endif
|
||||
#ifndef __STRICT_ANSI__
|
||||
long long _EXFUN(_atoll_r,(struct _reent *, const char *__nptr));
|
||||
#endif /* ! __STRICT_ANSI__ */
|
||||
#if !defined(__STRICT_ANSI__) || \
|
||||
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
|
||||
(defined(__cplusplus) && __cplusplus >= 201103L)
|
||||
#if __ISO_C_VISIBLE >= 1999
|
||||
long long _EXFUN(llabs,(long long));
|
||||
lldiv_t _EXFUN(lldiv,(long long __numer, long long __denom));
|
||||
long long _EXFUN(strtoll,(const char *__restrict __n, char **__restrict __end_PTR, int __base));
|
||||
#endif
|
||||
#ifndef __STRICT_ANSI__
|
||||
long long _EXFUN(_strtoll_r,(struct _reent *, const char *__restrict __n, char **__restrict __end_PTR, int __base));
|
||||
#endif /* ! __STRICT_ANSI__ */
|
||||
#if !defined(__STRICT_ANSI__) || \
|
||||
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
|
||||
(defined(__cplusplus) && __cplusplus >= 201103L)
|
||||
#if __ISO_C_VISIBLE >= 1999
|
||||
unsigned long long _EXFUN(strtoull,(const char *__restrict __n, char **__restrict __end_PTR, int __base));
|
||||
#endif
|
||||
#ifndef __STRICT_ANSI__
|
||||
unsigned long long _EXFUN(_strtoull_r,(struct _reent *, const char *__restrict __n, char **__restrict __end_PTR, int __base));
|
||||
|
||||
#ifndef __CYGWIN__
|
||||
#if __MISC_VISIBLE
|
||||
_VOID _EXFUN(cfree,(_PTR));
|
||||
#endif
|
||||
#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112
|
||||
int _EXFUN(unsetenv,(const char *__string));
|
||||
#endif
|
||||
int _EXFUN(_unsetenv_r,(struct _reent *, const char *__string));
|
||||
#endif
|
||||
#endif /* !__CYGWIN__ */
|
||||
|
||||
#ifdef __rtems__
|
||||
int _EXFUN(posix_memalign,(void **, size_t, size_t));
|
||||
#if __POSIX_VISIBLE >= 200112
|
||||
int _EXFUN(__nonnull (1) posix_memalign,(void **, size_t, size_t));
|
||||
#endif
|
||||
|
||||
#endif /* ! __STRICT_ANSI__ */
|
||||
|
||||
char * _EXFUN(_dtoa_r,(struct _reent *, double, int, int, int *, int*, char**));
|
||||
#ifndef __CYGWIN__
|
||||
_PTR _EXFUN_NOTHROW(_malloc_r,(struct _reent *, size_t));
|
||||
@@ -260,7 +277,9 @@ _VOID _EXFUN(__eprintf,(const char *, const char *, unsigned int, const char *))
|
||||
_BSD_SOURCE, you get the BSD version; otherwise you get the GNU
|
||||
version. We want that #undef qsort_r will still let you
|
||||
invoke the underlying function, but that requires gcc support. */
|
||||
#ifdef _BSD_SOURCE
|
||||
#if __GNU_VISIBLE
|
||||
_VOID _EXFUN(qsort_r,(_PTR __base, size_t __nmemb, size_t __size, int (*_compar)(const _PTR, const _PTR, _PTR), _PTR __thunk));
|
||||
#elif __BSD_VISIBLE
|
||||
# ifdef __GNUC__
|
||||
_VOID _EXFUN(qsort_r,(_PTR __base, size_t __nmemb, size_t __size, _PTR __thunk, int (*_compar)(_PTR, const _PTR, const _PTR)))
|
||||
__asm__ (__ASMNAME ("__bsd_qsort_r"));
|
||||
@@ -268,16 +287,12 @@ _VOID _EXFUN(qsort_r,(_PTR __base, size_t __nmemb, size_t __size, _PTR __thunk,
|
||||
_VOID _EXFUN(__bsd_qsort_r,(_PTR __base, size_t __nmemb, size_t __size, _PTR __thunk, int (*_compar)(_PTR, const _PTR, const _PTR)));
|
||||
# define qsort_r __bsd_qsort_r
|
||||
# endif
|
||||
#elif __GNU_VISIBLE
|
||||
_VOID _EXFUN(qsort_r,(_PTR __base, size_t __nmemb, size_t __size, int (*_compar)(const _PTR, const _PTR, _PTR), _PTR __thunk));
|
||||
#endif
|
||||
|
||||
/* On platforms where long double equals double. */
|
||||
#ifdef _HAVE_LONG_DOUBLE
|
||||
extern long double _strtold_r (struct _reent *, const char *__restrict, char **__restrict);
|
||||
#if !defined(__STRICT_ANSI__) || \
|
||||
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
|
||||
(defined(__cplusplus) && __cplusplus >= 201103L)
|
||||
#if __ISO_C_VISIBLE >= 1999
|
||||
extern long double strtold (const char *__restrict, char **__restrict);
|
||||
#endif
|
||||
#endif /* _HAVE_LONG_DOUBLE */
|
||||
@@ -285,7 +300,7 @@ extern long double strtold (const char *__restrict, char **__restrict);
|
||||
/*
|
||||
* If we're in a mode greater than C99, expose C11 functions.
|
||||
*/
|
||||
#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L
|
||||
#if __ISO_C_VISIBLE >= 2011
|
||||
void * aligned_alloc(size_t, size_t) __malloc_like __alloc_align(1)
|
||||
__alloc_size(2);
|
||||
int at_quick_exit(void (*)(void));
|
||||
|
@@ -43,28 +43,35 @@ char *_EXFUN(strtok,(char *__restrict, const char *__restrict));
|
||||
#endif
|
||||
size_t _EXFUN(strxfrm,(char *__restrict, const char *__restrict, size_t));
|
||||
|
||||
#if __POSIX_VISIBLE
|
||||
#if __MISC_VISIBLE || __POSIX_VISIBLE
|
||||
char *_EXFUN(strtok_r,(char *__restrict, const char *__restrict, char **__restrict));
|
||||
#endif
|
||||
#if __BSD_VISIBLE
|
||||
#if __BSD_VISIBLE || (__POSIX_VISIBLE && __POSIX_VISIBLE < 200809)
|
||||
int _EXFUN(bcmp,(const void *, const void *, size_t));
|
||||
void _EXFUN(bcopy,(const void *, void *, size_t));
|
||||
void _EXFUN(bzero,(void *, size_t));
|
||||
#endif
|
||||
#if __BSD_VISIBLE
|
||||
void _EXFUN(explicit_bzero,(void *, size_t));
|
||||
int _EXFUN(timingsafe_bcmp,(const void *, const void *, size_t));
|
||||
int _EXFUN(timingsafe_memcmp,(const void *, const void *, size_t));
|
||||
#endif
|
||||
#if __MISC_VISIBLE || __POSIX_VISIBLE >= 200809
|
||||
int _EXFUN(ffs,(int));
|
||||
#endif
|
||||
#if __BSD_VISIBLE || (__POSIX_VISIBLE && __POSIX_VISIBLE < 200809)
|
||||
char *_EXFUN(index,(const char *, int));
|
||||
#endif
|
||||
#if __BSD_VISIBLE || __XSI_VISIBLE
|
||||
#if __MISC_VISIBLE || __POSIX_VISIBLE
|
||||
_PTR _EXFUN(memccpy,(_PTR __restrict, const _PTR __restrict, int, size_t));
|
||||
#endif
|
||||
#if __GNU_VISIBLE
|
||||
_PTR _EXFUN(mempcpy,(_PTR, const _PTR, size_t));
|
||||
_PTR _EXFUN(memmem, (const _PTR, size_t, const _PTR, size_t));
|
||||
#endif
|
||||
_PTR _EXFUN(memrchr,(const _PTR, int, size_t));
|
||||
#if __GNU_VISIBLE
|
||||
_PTR _EXFUN(rawmemchr,(const _PTR, int));
|
||||
#endif
|
||||
#if __BSD_VISIBLE
|
||||
#if __BSD_VISIBLE || (__POSIX_VISIBLE && __POSIX_VISIBLE < 200809)
|
||||
char *_EXFUN(rindex,(const char *, int));
|
||||
#endif
|
||||
char *_EXFUN(stpcpy,(char *__restrict, const char *__restrict));
|
||||
@@ -76,19 +83,14 @@ int _EXFUN(strcasecmp,(const char *, const char *));
|
||||
char *_EXFUN(strcasestr,(const char *, const char *));
|
||||
char *_EXFUN(strchrnul,(const char *, int));
|
||||
#endif
|
||||
#if __XSI_VISIBLE >= 500
|
||||
#if __MISC_VISIBLE || __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >= 4
|
||||
char *_EXFUN(strdup,(const char *));
|
||||
#endif
|
||||
#ifndef __STRICT_ANSI__
|
||||
char *_EXFUN(_strdup_r,(struct _reent *, const char *));
|
||||
#endif
|
||||
#if __XSI_VISIBLE >= 700
|
||||
#if __POSIX_VISIBLE >= 200809
|
||||
char *_EXFUN(strndup,(const char *, size_t));
|
||||
#endif
|
||||
|
||||
#ifndef __STRICT_ANSI__
|
||||
char *_EXFUN(_strndup_r,(struct _reent *, const char *, size_t));
|
||||
#endif
|
||||
|
||||
#if __GNU_VISIBLE
|
||||
int _EXFUN(ffsl,(long));
|
||||
@@ -101,7 +103,7 @@ int _EXFUN(ffsll, (long long));
|
||||
invoke the underlying function, but that requires gcc support. */
|
||||
#if __GNU_VISIBLE
|
||||
char *_EXFUN(strerror_r,(int, char *, size_t));
|
||||
#else
|
||||
#elif __POSIX_VISIBLE >= 200112
|
||||
# ifdef __GNUC__
|
||||
int _EXFUN(strerror_r,(int, char *, size_t))
|
||||
#ifdef __ASMNAME
|
||||
@@ -124,19 +126,14 @@ size_t _EXFUN(strlcpy,(char *, const char *, size_t));
|
||||
#if __BSD_VISIBLE || __POSIX_VISIBLE
|
||||
int _EXFUN(strncasecmp,(const char *, const char *, size_t));
|
||||
#endif
|
||||
#if !defined(__STRICT_ANSI__) || __POSIX_VISIBLE >= 200809 || \
|
||||
__XSI_VISIBLE >= 700
|
||||
#if __POSIX_VISIBLE >= 200809
|
||||
size_t _EXFUN(strnlen,(const char *, size_t));
|
||||
#endif
|
||||
#if __BSD_VISIBLE
|
||||
char *_EXFUN(strsep,(char **, const char *));
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The origin of these is unknown to me so I am conditionalizing them
|
||||
* on __STRICT_ANSI__. Finetuning this is definitely needed. --joel
|
||||
*/
|
||||
#if !defined(__STRICT_ANSI__)
|
||||
#if __MISC_VISIBLE
|
||||
char *_EXFUN(strlwr,(char *));
|
||||
char *_EXFUN(strupr,(char *));
|
||||
#endif
|
||||
@@ -149,7 +146,7 @@ char *_EXFUN(strsignal, (int __signo));
|
||||
int _EXFUN(strtosigno, (const char *__name));
|
||||
#endif
|
||||
|
||||
#if defined _GNU_SOURCE && defined __GNUC__
|
||||
#if __GNU_VISIBLE && defined(__GNUC__)
|
||||
#define strdupa(__s) \
|
||||
(__extension__ ({const char *__in = (__s); \
|
||||
size_t __len = strlen (__in) + 1; \
|
||||
@@ -161,7 +158,7 @@ int _EXFUN(strtosigno, (const char *__name));
|
||||
char *__out = (char *) __builtin_alloca (__len); \
|
||||
__out[__len-1] = '\0'; \
|
||||
(char *) memcpy (__out, __in, __len-1);}))
|
||||
#endif /* _GNU_SOURCE && __GNUC__ */
|
||||
#endif /* __GNU_VISIBLE && __GNUC__ */
|
||||
|
||||
/* There are two common basename variants. If you do NOT #include <libgen.h>
|
||||
and you do
|
||||
|
@@ -9,12 +9,12 @@
|
||||
|
||||
#include "_ansi.h"
|
||||
#include <sys/reent.h>
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h> /* for size_t */
|
||||
|
||||
_BEGIN_STD_C
|
||||
|
||||
#if !defined __STRICT_ANSI__ && _POSIX_VERSION < 200809L
|
||||
#if __BSD_VISIBLE || (__POSIX_VISIBLE && __POSIX_VISIBLE < 200809)
|
||||
/*
|
||||
* Marked LEGACY in Open Group Base Specifications Issue 6/IEEE Std 1003.1-2004
|
||||
* Removed from Open Group Base Specifications Issue 7/IEEE Std 1003.1-2008
|
||||
@@ -24,7 +24,7 @@ void _EXFUN(bcopy,(const void *, void *, size_t));
|
||||
void _EXFUN(bzero,(void *, size_t));
|
||||
char *_EXFUN(index,(const char *, int));
|
||||
char *_EXFUN(rindex,(const char *, int));
|
||||
#endif /* ! __STRICT_ANSI__ */
|
||||
#endif /* __BSD_VISIBLE || (__POSIX_VISIBLE && __POSIX_VISIBLE < 200809) */
|
||||
|
||||
int _EXFUN(ffs,(int));
|
||||
int _EXFUN(strcasecmp,(const char *, const char *));
|
||||
|
@@ -66,8 +66,7 @@ extern "C" {
|
||||
#define _O_BINARY O_BINARY
|
||||
#define _O_RAW O_BINARY
|
||||
#define _O_NOINHERIT O_NOINHERIT
|
||||
|
||||
#ifndef _POSIX_SOURCE
|
||||
#if __MISC_VISIBLE
|
||||
|
||||
/*
|
||||
* Flags that work for fcntl(fd, F_SETFL, FXXXX)
|
||||
@@ -99,7 +98,7 @@ extern "C" {
|
||||
#define FEXCL _FEXCL
|
||||
#define FNOCTTY _FNOCTTY
|
||||
|
||||
#endif /* !_POSIX_SOURCE */
|
||||
#endif /* __MISC_VISIBLE */
|
||||
|
||||
/* XXX close on exec request; must match UF_EXCLOSE in user.h */
|
||||
#define FD_CLOEXEC 1 /* posix */
|
||||
@@ -110,20 +109,20 @@ extern "C" {
|
||||
#define F_SETFD 2 /* Set fildes flags (close on exec) */
|
||||
#define F_GETFL 3 /* Get file flags */
|
||||
#define F_SETFL 4 /* Set file flags */
|
||||
#ifndef _POSIX_SOURCE
|
||||
#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112
|
||||
#define F_GETOWN 5 /* Get owner - for ASYNC */
|
||||
#define F_SETOWN 6 /* Set owner - for ASYNC */
|
||||
#endif /* !_POSIX_SOURCE */
|
||||
#endif /* __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 */
|
||||
#define F_GETLK 7 /* Get record-locking information */
|
||||
#define F_SETLK 8 /* Set or Clear a record-lock (Non-Blocking) */
|
||||
#define F_SETLKW 9 /* Set or Clear a record-lock (Blocking) */
|
||||
#ifndef _POSIX_SOURCE
|
||||
#if __MISC_VISIBLE
|
||||
#define F_RGETLK 10 /* Test a remote lock to see if it is blocked */
|
||||
#define F_RSETLK 11 /* Set or unlock a remote lock */
|
||||
#define F_CNVT 12 /* Convert a fhandle to an open fd */
|
||||
#define F_RSETLKW 13 /* Set or Clear remote record-lock(Blocking) */
|
||||
#endif /* !_POSIX_SOURCE */
|
||||
#ifdef __CYGWIN__
|
||||
#endif /* __MISC_VISIBLE */
|
||||
#if __POSIX_VISIBLE >= 200809
|
||||
#define F_DUPFD_CLOEXEC 14 /* As F_DUPFD, but set close-on-exec flag */
|
||||
#endif
|
||||
|
||||
@@ -131,11 +130,11 @@ extern "C" {
|
||||
#define F_RDLCK 1 /* read lock */
|
||||
#define F_WRLCK 2 /* write lock */
|
||||
#define F_UNLCK 3 /* remove lock(s) */
|
||||
#ifndef _POSIX_SOURCE
|
||||
#if __MISC_VISIBLE
|
||||
#define F_UNLKSYS 4 /* remove remote locks for a given system */
|
||||
#endif /* !_POSIX_SOURCE */
|
||||
#endif /* __MISC_VISIBLE */
|
||||
|
||||
#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 || defined(__CYGWIN__)
|
||||
#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809
|
||||
/* Special descriptor value to denote the cwd in calls to openat(2) etc. */
|
||||
#define AT_FDCWD -2
|
||||
|
||||
@@ -168,7 +167,7 @@ struct flock {
|
||||
};
|
||||
#endif /* __CYGWIN__ */
|
||||
|
||||
#ifndef _POSIX_SOURCE
|
||||
#if __MISC_VISIBLE
|
||||
/* extended file segment locking set data type */
|
||||
struct eflock {
|
||||
short l_type; /* F_RDLCK, F_WRLCK, or F_UNLCK */
|
||||
@@ -180,13 +179,13 @@ struct eflock {
|
||||
long l_rpid; /* Remote process id wanting this lock */
|
||||
long l_rsys; /* Remote system id wanting this lock */
|
||||
};
|
||||
#endif /* !_POSIX_SOURCE */
|
||||
#endif /* __MISC_VISIBLE */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h> /* sigh. for the mode bits for open/creat */
|
||||
|
||||
extern int open _PARAMS ((const char *, int, ...));
|
||||
#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 || defined(__CYGWIN__)
|
||||
#if __ATFILE_VISIBLE
|
||||
extern int openat _PARAMS ((int, const char *, int, ...));
|
||||
#endif
|
||||
extern int creat _PARAMS ((const char *, mode_t));
|
||||
@@ -194,7 +193,7 @@ extern int fcntl _PARAMS ((int, int, ...));
|
||||
#if __BSD_VISIBLE
|
||||
extern int flock _PARAMS ((int, int));
|
||||
#endif
|
||||
#ifdef __CYGWIN__
|
||||
#if __GNU_VISIBLE
|
||||
#include <sys/time.h>
|
||||
extern int futimesat _PARAMS ((int, const char *, const struct timeval *));
|
||||
#endif
|
||||
|
@@ -624,134 +624,6 @@
|
||||
#define __DEQUALIFY(type, var) ((type)(__uintptr_t)(const volatile void *)(var))
|
||||
#endif
|
||||
|
||||
/*-
|
||||
* The following definitions are an extension of the behavior originally
|
||||
* implemented in <sys/_posix.h>, but with a different level of granularity.
|
||||
* POSIX.1 requires that the macros we test be defined before any standard
|
||||
* header file is included.
|
||||
*
|
||||
* Here's a quick run-down of the versions:
|
||||
* defined(_POSIX_SOURCE) 1003.1-1988
|
||||
* _POSIX_C_SOURCE == 1 1003.1-1990
|
||||
* _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option
|
||||
* _POSIX_C_SOURCE == 199309 1003.1b-1993
|
||||
* _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995,
|
||||
* and the omnibus ISO/IEC 9945-1: 1996
|
||||
* _POSIX_C_SOURCE == 200112 1003.1-2001
|
||||
* _POSIX_C_SOURCE == 200809 1003.1-2008
|
||||
*
|
||||
* In addition, the X/Open Portability Guide, which is now the Single UNIX
|
||||
* Specification, defines a feature-test macro which indicates the version of
|
||||
* that specification, and which subsumes _POSIX_C_SOURCE.
|
||||
*
|
||||
* Our macros begin with two underscores to avoid namespace screwage.
|
||||
*/
|
||||
|
||||
/* Deal with _GNU_SOURCE, which implies everything and the kitchen sink */
|
||||
#ifdef _GNU_SOURCE
|
||||
#undef _XOPEN_SOURCE
|
||||
#define _XOPEN_SOURCE 700
|
||||
#define __BSD_VISIBLE 1
|
||||
#define __GNU_VISIBLE 1
|
||||
#endif
|
||||
|
||||
#define __GNU_VISIBLE 1
|
||||
|
||||
/* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */
|
||||
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1
|
||||
#undef _POSIX_C_SOURCE /* Probably illegal, but beyond caring now. */
|
||||
#define _POSIX_C_SOURCE 199009
|
||||
#endif
|
||||
|
||||
/* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. */
|
||||
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2
|
||||
#undef _POSIX_C_SOURCE
|
||||
#define _POSIX_C_SOURCE 199209
|
||||
#endif
|
||||
|
||||
/* Deal with various X/Open Portability Guides and Single UNIX Spec. */
|
||||
#ifdef _XOPEN_SOURCE
|
||||
#if _XOPEN_SOURCE - 0 >= 700
|
||||
#define __XSI_VISIBLE 700
|
||||
#undef _POSIX_C_SOURCE
|
||||
#define _POSIX_C_SOURCE 200809
|
||||
#elif _XOPEN_SOURCE - 0 >= 600
|
||||
#define __XSI_VISIBLE 600
|
||||
#undef _POSIX_C_SOURCE
|
||||
#define _POSIX_C_SOURCE 200112
|
||||
#elif _XOPEN_SOURCE - 0 >= 500
|
||||
#define __XSI_VISIBLE 500
|
||||
#undef _POSIX_C_SOURCE
|
||||
#define _POSIX_C_SOURCE 199506
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Deal with all versions of POSIX. The ordering relative to the tests above is
|
||||
* important.
|
||||
*/
|
||||
#if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)
|
||||
#define _POSIX_C_SOURCE 198808
|
||||
#endif
|
||||
#ifdef _POSIX_C_SOURCE
|
||||
#if _POSIX_C_SOURCE >= 200809
|
||||
#define __POSIX_VISIBLE 200809
|
||||
#define __ISO_C_VISIBLE 1999
|
||||
#elif _POSIX_C_SOURCE >= 200112
|
||||
#define __POSIX_VISIBLE 200112
|
||||
#define __ISO_C_VISIBLE 1999
|
||||
#elif _POSIX_C_SOURCE >= 199506
|
||||
#define __POSIX_VISIBLE 199506
|
||||
#define __ISO_C_VISIBLE 1990
|
||||
#elif _POSIX_C_SOURCE >= 199309
|
||||
#define __POSIX_VISIBLE 199309
|
||||
#define __ISO_C_VISIBLE 1990
|
||||
#elif _POSIX_C_SOURCE >= 199209
|
||||
#define __POSIX_VISIBLE 199209
|
||||
#define __ISO_C_VISIBLE 1990
|
||||
#elif _POSIX_C_SOURCE >= 199009
|
||||
#define __POSIX_VISIBLE 199009
|
||||
#define __ISO_C_VISIBLE 1990
|
||||
#else
|
||||
#define __POSIX_VISIBLE 198808
|
||||
#define __ISO_C_VISIBLE 0
|
||||
#endif /* _POSIX_C_SOURCE */
|
||||
#else
|
||||
/*-
|
||||
* Deal with _ANSI_SOURCE:
|
||||
* If it is defined, and no other compilation environment is explicitly
|
||||
* requested, then define our internal feature-test macros to zero. This
|
||||
* makes no difference to the preprocessor (undefined symbols in preprocessing
|
||||
* expressions are defined to have value zero), but makes it more convenient for
|
||||
* a test program to print out the values.
|
||||
*
|
||||
* If a program mistakenly defines _ANSI_SOURCE and some other macro such as
|
||||
* _POSIX_C_SOURCE, we will assume that it wants the broader compilation
|
||||
* environment (and in fact we will never get here).
|
||||
*/
|
||||
#if defined(_ANSI_SOURCE) /* Hide almost everything. */
|
||||
#define __POSIX_VISIBLE 0
|
||||
#define __XSI_VISIBLE 0
|
||||
#define __BSD_VISIBLE 0
|
||||
#define __ISO_C_VISIBLE 1990
|
||||
#elif defined(_C99_SOURCE) /* Localism to specify strict C99 env. */
|
||||
#define __POSIX_VISIBLE 0
|
||||
#define __XSI_VISIBLE 0
|
||||
#define __BSD_VISIBLE 0
|
||||
#define __ISO_C_VISIBLE 1999
|
||||
#elif defined(_C11_SOURCE) /* Localism to specify strict C11 env. */
|
||||
#define __POSIX_VISIBLE 0
|
||||
#define __XSI_VISIBLE 0
|
||||
#define __BSD_VISIBLE 0
|
||||
#define __ISO_C_VISIBLE 2011
|
||||
#else /* Default: everything except __GNU_VISIBLE. */
|
||||
#define __POSIX_VISIBLE 200809
|
||||
#define __XSI_VISIBLE 700
|
||||
#define __BSD_VISIBLE 1
|
||||
#define __ISO_C_VISIBLE 2011
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Type Safety Checking
|
||||
*
|
||||
|
@@ -232,9 +232,6 @@
|
||||
|
||||
#if defined(__CYGWIN__)
|
||||
#include <cygwin/config.h>
|
||||
#if !defined (__STRICT_ANSI__) || (__STDC_VERSION__ >= 199901L)
|
||||
#define __USE_XOPEN2K 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__rtems__)
|
||||
|
@@ -25,11 +25,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Macros to determine that newlib is being used. Put in this header to
|
||||
* be similar to where glibc stores its version of these macros.
|
||||
*/
|
||||
#define __NEWLIB__ 2
|
||||
#define __NEWLIB_MINOR__ 2
|
||||
#include <_newlib_version.h>
|
||||
|
||||
/* Macro to test version of GCC. Returns 0 for non-GCC or too old GCC. */
|
||||
#ifndef __GNUC_PREREQ
|
||||
@@ -43,6 +39,281 @@ extern "C" {
|
||||
/* Version with trailing underscores for BSD compatibility. */
|
||||
#define __GNUC_PREREQ__(ma, mi) __GNUC_PREREQ(ma, mi)
|
||||
|
||||
|
||||
/*
|
||||
* Feature test macros control which symbols are exposed by the system
|
||||
* headers. Any of these must be defined before including any headers.
|
||||
*
|
||||
* __STRICT_ANSI__ (defined by gcc -ansi, -std=c90, -std=c99, or -std=c11)
|
||||
* ISO C
|
||||
*
|
||||
* _POSIX_SOURCE (deprecated by _POSIX_C_SOURCE=1)
|
||||
* _POSIX_C_SOURCE >= 1
|
||||
* POSIX.1-1990
|
||||
*
|
||||
* _POSIX_C_SOURCE >= 2
|
||||
* POSIX.2-1992
|
||||
*
|
||||
* _POSIX_C_SOURCE >= 199309L
|
||||
* POSIX.1b-1993 Real-time extensions
|
||||
*
|
||||
* _POSIX_C_SOURCE >= 199506L
|
||||
* POSIX.1c-1995 Threads extensions
|
||||
*
|
||||
* _POSIX_C_SOURCE >= 200112L
|
||||
* POSIX.1-2001 and C99
|
||||
*
|
||||
* _POSIX_C_SOURCE >= 200809L
|
||||
* POSIX.1-2008
|
||||
*
|
||||
* _XOPEN_SOURCE
|
||||
* POSIX.1-1990 and XPG4
|
||||
*
|
||||
* _XOPEN_SOURCE_EXTENDED
|
||||
* SUSv1 (POSIX.2-1992 plus XPG4v2)
|
||||
*
|
||||
* _XOPEN_SOURCE >= 500
|
||||
* SUSv2 (POSIX.1c-1995 plus XSI)
|
||||
*
|
||||
* _XOPEN_SOURCE >= 600
|
||||
* SUSv3 (POSIX.1-2001 plus XSI) and C99
|
||||
*
|
||||
* _XOPEN_SOURCE >= 700
|
||||
* SUSv4 (POSIX.1-2008 plus XSI)
|
||||
*
|
||||
* _ISOC99_SOURCE or gcc -std=c99 or g++
|
||||
* ISO C99
|
||||
*
|
||||
* _ISOC11_SOURCE or gcc -std=c11 or g++ -std=c++11
|
||||
* ISO C11
|
||||
*
|
||||
* _ATFILE_SOURCE (implied by _POSIX_C_SOURCE >= 200809L)
|
||||
* "at" functions
|
||||
*
|
||||
* _LARGEFILE_SOURCE (deprecated by _XOPEN_SOURCE >= 500)
|
||||
* fseeko, ftello
|
||||
*
|
||||
* _GNU_SOURCE
|
||||
* All of the above plus GNU extensions
|
||||
*
|
||||
* _BSD_SOURCE (deprecated by _DEFAULT_SOURCE)
|
||||
* _SVID_SOURCE (deprecated by _DEFAULT_SOURCE)
|
||||
* _DEFAULT_SOURCE (or none of the above)
|
||||
* POSIX-1.2008 with BSD and SVr4 extensions
|
||||
*/
|
||||
|
||||
#ifdef _GNU_SOURCE
|
||||
#undef _ATFILE_SOURCE
|
||||
#define _ATFILE_SOURCE 1
|
||||
#undef _DEFAULT_SOURCE
|
||||
#define _DEFAULT_SOURCE 1
|
||||
#undef _ISOC99_SOURCE
|
||||
#define _ISOC99_SOURCE 1
|
||||
#undef _ISOC11_SOURCE
|
||||
#define _ISOC11_SOURCE 1
|
||||
#undef _POSIX_SOURCE
|
||||
#define _POSIX_SOURCE 1
|
||||
#undef _POSIX_C_SOURCE
|
||||
#define _POSIX_C_SOURCE 200809L
|
||||
#undef _XOPEN_SOURCE
|
||||
#define _XOPEN_SOURCE 700
|
||||
#undef _XOPEN_SOURCE_EXTENDED
|
||||
#define _XOPEN_SOURCE_EXTENDED 1
|
||||
#endif /* _GNU_SOURCE */
|
||||
|
||||
#if defined(_BSD_SOURCE) || defined(_SVID_SOURCE) || \
|
||||
(!defined(__STRICT_ANSI__) && !defined(_ANSI_SOURCE) && \
|
||||
!defined(_ISOC99_SOURCE) && !defined(_POSIX_SOURCE) && \
|
||||
!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE))
|
||||
#undef _DEFAULT_SOURCE
|
||||
#define _DEFAULT_SOURCE 1
|
||||
#endif
|
||||
|
||||
#if defined(_DEFAULT_SOURCE)
|
||||
#undef _POSIX_SOURCE
|
||||
#define _POSIX_SOURCE 1
|
||||
#undef _POSIX_C_SOURCE
|
||||
#define _POSIX_C_SOURCE 200809L
|
||||
#endif
|
||||
|
||||
#if !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) && \
|
||||
((!defined(__STRICT_ANSI__) && !defined(_ANSI_SOURCE)) || \
|
||||
(_XOPEN_SOURCE - 0) >= 500)
|
||||
#define _POSIX_SOURCE 1
|
||||
#if !defined(_XOPEN_SOURCE) || (_XOPEN_SOURCE - 0) >= 700
|
||||
#define _POSIX_C_SOURCE 200809L
|
||||
#elif (_XOPEN_SOURCE - 0) >= 600
|
||||
#define _POSIX_C_SOURCE 200112L
|
||||
#elif (_XOPEN_SOURCE - 0) >= 500
|
||||
#define _POSIX_C_SOURCE 199506L
|
||||
#elif (_XOPEN_SOURCE - 0) < 500
|
||||
#define _POSIX_C_SOURCE 2
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200809
|
||||
#undef _ATFILE_SOURCE
|
||||
#define _ATFILE_SOURCE 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The following private macros are used throughout the headers to control
|
||||
* which symbols should be exposed. They are for internal use only, as
|
||||
* indicated by the leading double underscore, and must never be used outside
|
||||
* of these headers.
|
||||
*
|
||||
* __POSIX_VISIBLE
|
||||
* any version of POSIX.1; enabled by default, or with _POSIX_SOURCE,
|
||||
* any value of _POSIX_C_SOURCE, or _XOPEN_SOURCE >= 500.
|
||||
*
|
||||
* __POSIX_VISIBLE >= 2
|
||||
* POSIX.2-1992; enabled by default, with _POSIX_C_SOURCE >= 2,
|
||||
* or _XOPEN_SOURCE >= 500.
|
||||
*
|
||||
* __POSIX_VISIBLE >= 199309
|
||||
* POSIX.1b-1993; enabled by default, with _POSIX_C_SOURCE >= 199309L,
|
||||
* or _XOPEN_SOURCE >= 500.
|
||||
*
|
||||
* __POSIX_VISIBLE >= 199506
|
||||
* POSIX.1c-1995; enabled by default, with _POSIX_C_SOURCE >= 199506L,
|
||||
* or _XOPEN_SOURCE >= 500.
|
||||
*
|
||||
* __POSIX_VISIBLE >= 200112
|
||||
* POSIX.1-2001; enabled by default, with _POSIX_C_SOURCE >= 200112L,
|
||||
* or _XOPEN_SOURCE >= 600.
|
||||
*
|
||||
* __POSIX_VISIBLE >= 200809
|
||||
* POSIX.1-2008; enabled by default, with _POSIX_C_SOURCE >= 200809L,
|
||||
* or _XOPEN_SOURCE >= 700.
|
||||
*
|
||||
* __XSI_VISIBLE
|
||||
* XPG4 XSI extensions; enabled with any version of _XOPEN_SOURCE.
|
||||
*
|
||||
* __XSI_VISIBLE >= 4
|
||||
* SUSv1 XSI extensions; enabled with both _XOPEN_SOURCE and
|
||||
* _XOPEN_SOURCE_EXTENDED together.
|
||||
*
|
||||
* __XSI_VISIBLE >= 500
|
||||
* SUSv2 XSI extensions; enabled with _XOPEN_SOURCE >= 500.
|
||||
*
|
||||
* __XSI_VISIBLE >= 600
|
||||
* SUSv3 XSI extensions; enabled with _XOPEN_SOURCE >= 600.
|
||||
*
|
||||
* __XSI_VISIBLE >= 700
|
||||
* SUSv4 XSI extensions; enabled with _XOPEN_SOURCE >= 700.
|
||||
*
|
||||
* __ISO_C_VISIBLE >= 1999
|
||||
* ISO C99; enabled with gcc -std=c99 or newer (on by default since GCC 5),
|
||||
* any version of C++, or with _ISOC99_SOURCE, _POSIX_C_SOURCE >= 200112L,
|
||||
* or _XOPEN_SOURCE >= 600.
|
||||
*
|
||||
* __ISO_C_VISIBLE >= 2011
|
||||
* ISO C11; enabled with gcc -std=c11 or newer (on by default since GCC 5),
|
||||
* g++ -std=c++11 or newer (on by default since GCC 6), or with
|
||||
* _ISOC11_SOURCE.
|
||||
*
|
||||
* __ATFILE_VISIBLE
|
||||
* "at" functions; enabled by default, with _ATFILE_SOURCE,
|
||||
* _POSIX_C_SOURCE >= 200809L, or _XOPEN_SOURCE >= 700.
|
||||
*
|
||||
* __LARGEFILE_VISIBLE
|
||||
* fseeko, ftello; enabled with _LARGEFILE_SOURCE or _XOPEN_SOURCE >= 500.
|
||||
*
|
||||
* __BSD_VISIBLE
|
||||
* BSD extensions; enabled by default, or with _BSD_SOURCE.
|
||||
*
|
||||
* __SVID_VISIBLE
|
||||
* SVr4 extensions; enabled by default, or with _SVID_SOURCE.
|
||||
*
|
||||
* __MISC_VISIBLE
|
||||
* Extensions found in both BSD and SVr4 (shorthand for
|
||||
* (__BSD_VISIBLE || __SVID_VISIBLE)), or newlib-specific
|
||||
* extensions; enabled by default.
|
||||
*
|
||||
* __GNU_VISIBLE
|
||||
* GNU extensions; enabled with _GNU_SOURCE.
|
||||
*
|
||||
* In all cases above, "enabled by default" means either by defining
|
||||
* _DEFAULT_SOURCE, or by not defining any of the public feature test macros.
|
||||
* Defining _GNU_SOURCE makes all of the above avaliable.
|
||||
*/
|
||||
|
||||
#ifdef _ATFILE_SOURCE
|
||||
#define __ATFILE_VISIBLE 1
|
||||
#else
|
||||
#define __ATFILE_VISIBLE 0
|
||||
#endif
|
||||
|
||||
#ifdef _DEFAULT_SOURCE
|
||||
#define __BSD_VISIBLE 1
|
||||
#else
|
||||
#define __BSD_VISIBLE 0
|
||||
#endif
|
||||
|
||||
#ifdef _GNU_SOURCE
|
||||
#define __GNU_VISIBLE 1
|
||||
#else
|
||||
#define __GNU_VISIBLE 0
|
||||
#endif
|
||||
|
||||
#if defined(_ISOC11_SOURCE) || \
|
||||
(__STDC_VERSION__ - 0) >= 201112L || (__cplusplus - 0) >= 201103L
|
||||
#define __ISO_C_VISIBLE 2011
|
||||
#elif defined(_ISOC99_SOURCE) || (_POSIX_C_SOURCE - 0) >= 200112L || \
|
||||
(__STDC_VERSION__ - 0) >= 199901L || defined(__cplusplus)
|
||||
#define __ISO_C_VISIBLE 1999
|
||||
#else
|
||||
#define __ISO_C_VISIBLE 1990
|
||||
#endif
|
||||
|
||||
#if defined(_LARGEFILE_SOURCE) || (_XOPEN_SOURCE - 0) >= 500
|
||||
#define __LARGEFILE_VISIBLE 1
|
||||
#else
|
||||
#define __LARGEFILE_VISIBLE 0
|
||||
#endif
|
||||
|
||||
#ifdef _DEFAULT_SOURCE
|
||||
#define __MISC_VISIBLE 1
|
||||
#else
|
||||
#define __MISC_VISIBLE 0
|
||||
#endif
|
||||
|
||||
#if (_POSIX_C_SOURCE - 0) >= 200809L
|
||||
#define __POSIX_VISIBLE 200809
|
||||
#elif (_POSIX_C_SOURCE - 0) >= 200112L
|
||||
#define __POSIX_VISIBLE 200112
|
||||
#elif (_POSIX_C_SOURCE - 0) >= 199506L
|
||||
#define __POSIX_VISIBLE 199506
|
||||
#elif (_POSIX_C_SOURCE - 0) >= 199309L
|
||||
#define __POSIX_VISIBLE 199309
|
||||
#elif (_POSIX_C_SOURCE - 0) >= 2 || defined(_XOPEN_SOURCE)
|
||||
#define __POSIX_VISIBLE 199209
|
||||
#elif defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE)
|
||||
#define __POSIX_VISIBLE 199009
|
||||
#else
|
||||
#define __POSIX_VISIBLE 0
|
||||
#endif
|
||||
|
||||
#ifdef _DEFAULT_SOURCE
|
||||
#define __SVID_VISIBLE 1
|
||||
#else
|
||||
#define __SVID_VISIBLE 0
|
||||
#endif
|
||||
|
||||
#if (_XOPEN_SOURCE - 0) >= 700
|
||||
#define __XSI_VISIBLE 700
|
||||
#elif (_XOPEN_SOURCE - 0) >= 600
|
||||
#define __XSI_VISIBLE 600
|
||||
#elif (_XOPEN_SOURCE - 0) >= 500
|
||||
#define __XSI_VISIBLE 500
|
||||
#elif defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)
|
||||
#define __XSI_VISIBLE 4
|
||||
#elif defined(_XOPEN_SOURCE)
|
||||
#define __XSI_VISIBLE 1
|
||||
#else
|
||||
#define __XSI_VISIBLE 0
|
||||
#endif
|
||||
|
||||
/* RTEMS adheres to POSIX -- 1003.1b with some features from annexes. */
|
||||
|
||||
#ifdef __rtems__
|
||||
@@ -112,50 +383,50 @@ extern "C" {
|
||||
#ifdef __CYGWIN__
|
||||
|
||||
#if !defined(__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L
|
||||
#define _POSIX_VERSION 200112L
|
||||
#define _POSIX2_VERSION 200112L
|
||||
#define _POSIX_VERSION 200809L
|
||||
#define _POSIX2_VERSION 200809L
|
||||
#define _XOPEN_VERSION 600
|
||||
|
||||
#define _POSIX_ADVISORY_INFO 200112L
|
||||
#define _POSIX_ADVISORY_INFO 200809L
|
||||
/* #define _POSIX_ASYNCHRONOUS_IO -1 */
|
||||
/* #define _POSIX_BARRIERS -1 */
|
||||
#define _POSIX_BARRIERS 200809L
|
||||
#define _POSIX_CHOWN_RESTRICTED 1
|
||||
#define _POSIX_CLOCK_SELECTION 200112L
|
||||
#define _POSIX_CPUTIME 200112L
|
||||
#define _POSIX_FSYNC 200112L
|
||||
#define _POSIX_IPV6 200112L
|
||||
#define _POSIX_CLOCK_SELECTION 200809L
|
||||
#define _POSIX_CPUTIME 200809L
|
||||
#define _POSIX_FSYNC 200809L
|
||||
#define _POSIX_IPV6 200809L
|
||||
#define _POSIX_JOB_CONTROL 1
|
||||
#define _POSIX_MAPPED_FILES 200112L
|
||||
#define _POSIX_MAPPED_FILES 200809L
|
||||
/* #define _POSIX_MEMLOCK -1 */
|
||||
#define _POSIX_MEMLOCK_RANGE 200112L
|
||||
#define _POSIX_MEMORY_PROTECTION 200112L
|
||||
#define _POSIX_MESSAGE_PASSING 200112L
|
||||
#define _POSIX_MONOTONIC_CLOCK 200112L
|
||||
#define _POSIX_MEMLOCK_RANGE 200809L
|
||||
#define _POSIX_MEMORY_PROTECTION 200809L
|
||||
#define _POSIX_MESSAGE_PASSING 200809L
|
||||
#define _POSIX_MONOTONIC_CLOCK 200809L
|
||||
#define _POSIX_NO_TRUNC 1
|
||||
/* #define _POSIX_PRIORITIZED_IO -1 */
|
||||
#define _POSIX_PRIORITY_SCHEDULING 200112L
|
||||
#define _POSIX_RAW_SOCKETS 200112L
|
||||
#define _POSIX_READER_WRITER_LOCKS 200112L
|
||||
#define _POSIX_REALTIME_SIGNALS 200112L
|
||||
#define _POSIX_PRIORITY_SCHEDULING 200809L
|
||||
#define _POSIX_RAW_SOCKETS 200809L
|
||||
#define _POSIX_READER_WRITER_LOCKS 200809L
|
||||
#define _POSIX_REALTIME_SIGNALS 200809L
|
||||
#define _POSIX_REGEXP 1
|
||||
#define _POSIX_SAVED_IDS 1
|
||||
#define _POSIX_SEMAPHORES 200112L
|
||||
#define _POSIX_SHARED_MEMORY_OBJECTS 200112L
|
||||
#define _POSIX_SEMAPHORES 200809L
|
||||
#define _POSIX_SHARED_MEMORY_OBJECTS 200809L
|
||||
#define _POSIX_SHELL 1
|
||||
/* #define _POSIX_SPAWN -1 */
|
||||
#define _POSIX_SPIN_LOCKS 200112L
|
||||
#define _POSIX_SPAWN 200809L
|
||||
#define _POSIX_SPIN_LOCKS 200809L
|
||||
/* #define _POSIX_SPORADIC_SERVER -1 */
|
||||
#define _POSIX_SYNCHRONIZED_IO 200112L
|
||||
#define _POSIX_THREAD_ATTR_STACKADDR 200112L
|
||||
#define _POSIX_THREAD_ATTR_STACKSIZE 200112L
|
||||
#define _POSIX_THREAD_CPUTIME 200112L
|
||||
#define _POSIX_SYNCHRONIZED_IO 200809L
|
||||
#define _POSIX_THREAD_ATTR_STACKADDR 200809L
|
||||
#define _POSIX_THREAD_ATTR_STACKSIZE 200809L
|
||||
#define _POSIX_THREAD_CPUTIME 200809L
|
||||
/* #define _POSIX_THREAD_PRIO_INHERIT -1 */
|
||||
/* #define _POSIX_THREAD_PRIO_PROTECT -1 */
|
||||
#define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L
|
||||
#define _POSIX_THREAD_PROCESS_SHARED 200112L
|
||||
#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L
|
||||
#define _POSIX_THREAD_PRIORITY_SCHEDULING 200809L
|
||||
#define _POSIX_THREAD_PROCESS_SHARED 200809L
|
||||
#define _POSIX_THREAD_SAFE_FUNCTIONS 200809L
|
||||
/* #define _POSIX_THREAD_SPORADIC_SERVER -1 */
|
||||
#define _POSIX_THREADS 200112L
|
||||
#define _POSIX_THREADS 200809L
|
||||
/* #define _POSIX_TIMEOUTS -1 */
|
||||
#define _POSIX_TIMERS 1
|
||||
/* #define _POSIX_TRACE -1 */
|
||||
@@ -164,9 +435,9 @@ extern "C" {
|
||||
/* #define _POSIX_TRACE_LOG -1 */
|
||||
/* #define _POSIX_TYPED_MEMORY_OBJECTS -1 */
|
||||
#define _POSIX_VDISABLE '\0'
|
||||
#define _POSIX2_C_BIND 200112L
|
||||
#define _POSIX2_C_DEV 200112L
|
||||
#define _POSIX2_CHAR_TERM 200112L
|
||||
#define _POSIX2_C_BIND 200809L
|
||||
#define _POSIX2_C_DEV 200809L
|
||||
#define _POSIX2_CHAR_TERM 200809L
|
||||
/* #define _POSIX2_FORT_DEV -1 */
|
||||
/* #define _POSIX2_FORT_RUN -1 */
|
||||
/* #define _POSIX2_LOCALEDEF -1 */
|
||||
@@ -176,8 +447,8 @@ extern "C" {
|
||||
/* #define _POSIX2_PBS_LOCATE -1 */
|
||||
/* #define _POSIX2_PBS_MESSAGE -1 */
|
||||
/* #define _POSIX2_PBS_TRACK -1 */
|
||||
#define _POSIX2_SW_DEV 200112L
|
||||
#define _POSIX2_UPE 200112L
|
||||
#define _POSIX2_SW_DEV 200809L
|
||||
#define _POSIX2_UPE 200809L
|
||||
#define _POSIX_V6_ILP32_OFF32 -1
|
||||
#ifdef __LP64__
|
||||
#define _POSIX_V6_ILP32_OFFBIG -1
|
||||
@@ -210,27 +481,6 @@ extern "C" {
|
||||
|
||||
#endif /* __CYGWIN__ */
|
||||
|
||||
/* Per the permission given in POSIX.1-2008 section 2.2.1, define
|
||||
* _POSIX_C_SOURCE if _XOPEN_SOURCE is defined and _POSIX_C_SOURCE is not.
|
||||
* (_XOPEN_SOURCE indicates that XSI extensions are desired by an application.)
|
||||
* This permission is first granted in 2008, but use it for older ones, also.
|
||||
* Allow for _XOPEN_SOURCE to be empty (from the earliest form of it, before it
|
||||
* was required to have specific values).
|
||||
*/
|
||||
#if !defined(_POSIX_C_SOURCE) && defined(_XOPEN_SOURCE)
|
||||
#if (_XOPEN_SOURCE - 0) == 700 /* POSIX.1-2008 */
|
||||
#define _POSIX_C_SOURCE 200809L
|
||||
#elif (_XOPEN_SOURCE - 0) == 600 /* POSIX.1-2001 or 2004 */
|
||||
#define _POSIX_C_SOURCE 200112L
|
||||
#elif (_XOPEN_SOURCE - 0) == 500 /* POSIX.1-1995 */
|
||||
#define _POSIX_C_SOURCE 199506L
|
||||
#elif (_XOPEN_SOURCE - 0) < 500 /* really old */
|
||||
#define _POSIX_C_SOURCE 2
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define _POSIX_MONOTONIC_CLOCK 200112L
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
215
contrib/sdk/sources/newlib/libc/include/sys/gthr-default.h
Normal file
215
contrib/sdk/sources/newlib/libc/include/sys/gthr-default.h
Normal file
@@ -0,0 +1,215 @@
|
||||
/* Threads compatibility routines for libgcc2 and libobjc. */
|
||||
/* Compile this one with gcc. */
|
||||
|
||||
/* Copyright (C) 1999-2015 Free Software Foundation, Inc.
|
||||
Contributed by Mumit Khan <khan@xraylith.wisc.edu>.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_GTHR_KOS32_H
|
||||
#define GCC_GTHR_KOS32_H
|
||||
|
||||
/* Make sure CONST_CAST2 (origin in system.h) is declared. */
|
||||
#ifndef CONST_CAST2
|
||||
#define CONST_CAST2(TOTYPE,FROMTYPE,X) ((__extension__(union {FROMTYPE _q; TOTYPE _nq;})(X))._nq)
|
||||
#endif
|
||||
|
||||
|
||||
#define __GTHREADS 1
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#ifndef __UNUSED_PARAM
|
||||
#define __UNUSED_PARAM(x) x
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef unsigned long __gthread_key_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int done;
|
||||
long started;
|
||||
} __gthread_once_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
volatile int lock;
|
||||
int handle;
|
||||
} __gthread_mutex_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
volatile int lock;
|
||||
int handle;
|
||||
long depth;
|
||||
unsigned long owner;
|
||||
} __gthread_recursive_mutex_t;
|
||||
|
||||
#define __GTHREAD_ONCE_INIT {0, -1}
|
||||
#define __GTHREAD_MUTEX_INIT_FUNCTION __gthread_mutex_init_function
|
||||
|
||||
#define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION \
|
||||
__gthread_recursive_mutex_init_function
|
||||
|
||||
|
||||
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||
#define MINGW32_SUPPORTS_MT_EH 1
|
||||
/* Mingw runtime >= v0.3 provides a magic variable that is set to nonzero
|
||||
if -mthreads option was specified, or 0 otherwise. This is to get around
|
||||
the lack of weak symbols in PE-COFF. */
|
||||
extern int _CRT_MT;
|
||||
extern int __mingwthr_key_dtor (unsigned long, void (*) (void *));
|
||||
#endif /* _WIN32 && !__CYGWIN__ */
|
||||
|
||||
|
||||
static inline int __gthread_active_p (void)
|
||||
{
|
||||
#ifdef MINGW32_SUPPORTS_MT_EH
|
||||
return _CRT_MT;
|
||||
#else
|
||||
return 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
extern int __gthr_kos32_once (__gthread_once_t *, void (*) (void));
|
||||
extern int __gthr_kos32_key_create (__gthread_key_t *, void (*) (void*));
|
||||
extern int __gthr_kos32_key_delete (__gthread_key_t);
|
||||
extern void * __gthr_kos32_getspecific (__gthread_key_t);
|
||||
extern int __gthr_kos32_setspecific (__gthread_key_t, const void *);
|
||||
extern void __gthr_kos32_mutex_init_function (__gthread_mutex_t *);
|
||||
extern int __gthr_kos32_mutex_lock (__gthread_mutex_t *);
|
||||
extern int __gthr_kos32_mutex_trylock (__gthread_mutex_t *);
|
||||
extern int __gthr_kos32_mutex_unlock (__gthread_mutex_t *);
|
||||
extern void __gthr_kos32_recursive_mutex_init_function (__gthread_recursive_mutex_t *);
|
||||
extern int __gthr_kos32_recursive_mutex_lock (__gthread_recursive_mutex_t *);
|
||||
extern int __gthr_kos32_recursive_mutex_trylock (__gthread_recursive_mutex_t *);
|
||||
extern int __gthr_kos32_recursive_mutex_unlock (__gthread_recursive_mutex_t *);
|
||||
extern void __gthr_kos32_mutex_destroy (__gthread_mutex_t *);
|
||||
extern int __gthr_kos32_recursive_mutex_destroy (__gthread_recursive_mutex_t *);
|
||||
|
||||
static inline int __gthread_once (__gthread_once_t *__once, void (*__func) (void))
|
||||
{
|
||||
if (__gthread_active_p ())
|
||||
return __gthr_kos32_once (__once, __func);
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
static inline int __gthread_key_create (__gthread_key_t *__key, void (*__dtor) (void *))
|
||||
{
|
||||
return __gthr_kos32_key_create (__key, __dtor);
|
||||
}
|
||||
|
||||
static inline int __gthread_key_delete (__gthread_key_t __key)
|
||||
{
|
||||
return __gthr_kos32_key_delete (__key);
|
||||
}
|
||||
|
||||
static inline void* __gthread_getspecific (__gthread_key_t __key)
|
||||
{
|
||||
return __gthr_kos32_getspecific (__key);
|
||||
}
|
||||
|
||||
static inline int __gthread_setspecific (__gthread_key_t __key, const void *__ptr)
|
||||
{
|
||||
return __gthr_kos32_setspecific (__key, __ptr);
|
||||
}
|
||||
|
||||
static inline void __gthread_mutex_init_function (__gthread_mutex_t *__mutex)
|
||||
{
|
||||
__gthr_kos32_mutex_init_function(__mutex);
|
||||
}
|
||||
|
||||
static inline void __gthread_mutex_destroy (__gthread_mutex_t *__mutex)
|
||||
{
|
||||
__gthr_kos32_mutex_destroy (__mutex);
|
||||
}
|
||||
|
||||
static inline int __gthread_mutex_lock (__gthread_mutex_t *__mutex)
|
||||
{
|
||||
if (__gthread_active_p ())
|
||||
return __gthr_kos32_mutex_lock (__mutex);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int __gthread_mutex_trylock (__gthread_mutex_t *__mutex)
|
||||
{
|
||||
if (__gthread_active_p ())
|
||||
return __gthr_kos32_mutex_trylock (__mutex);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int __gthread_mutex_unlock (__gthread_mutex_t *__mutex)
|
||||
{
|
||||
if (__gthread_active_p ())
|
||||
return __gthr_kos32_mutex_unlock (__mutex);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void __gthread_recursive_mutex_init_function (__gthread_recursive_mutex_t *__mutex)
|
||||
{
|
||||
__gthr_kos32_recursive_mutex_init_function (__mutex);
|
||||
}
|
||||
|
||||
static inline int __gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *__mutex)
|
||||
{
|
||||
if (__gthread_active_p ())
|
||||
return __gthr_kos32_recursive_mutex_lock (__mutex);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int __gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex)
|
||||
{
|
||||
if (__gthread_active_p ())
|
||||
return __gthr_kos32_recursive_mutex_trylock (__mutex);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int __gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex)
|
||||
{
|
||||
if (__gthread_active_p ())
|
||||
return __gthr_kos32_recursive_mutex_unlock (__mutex);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int __gthread_recursive_mutex_destroy (__gthread_recursive_mutex_t *__mutex)
|
||||
{
|
||||
return __gthr_kos32_recursive_mutex_destroy (__mutex);
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ! GCC_GTHR_WIN32_H */
|
154
contrib/sdk/sources/newlib/libc/include/sys/gthr.h
Normal file
154
contrib/sdk/sources/newlib/libc/include/sys/gthr.h
Normal file
@@ -0,0 +1,154 @@
|
||||
/* Threads compatibility routines for libgcc2. */
|
||||
/* Compile this one with gcc. */
|
||||
/* Copyright (C) 1997-2015 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _GLIBCXX_GCC_GTHR_H
|
||||
#define _GLIBCXX_GCC_GTHR_H
|
||||
|
||||
#ifndef _GLIBCXX_HIDE_EXPORTS
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
/* If this file is compiled with threads support, it must
|
||||
#define __GTHREADS 1
|
||||
to indicate that threads support is present. Also it has define
|
||||
function
|
||||
int __gthread_active_p ()
|
||||
that returns 1 if thread system is active, 0 if not.
|
||||
|
||||
The threads interface must define the following types:
|
||||
__gthread_key_t
|
||||
__gthread_once_t
|
||||
__gthread_mutex_t
|
||||
__gthread_recursive_mutex_t
|
||||
|
||||
The threads interface must define the following macros:
|
||||
|
||||
__GTHREAD_ONCE_INIT
|
||||
to initialize __gthread_once_t
|
||||
__GTHREAD_MUTEX_INIT
|
||||
to initialize __gthread_mutex_t to get a fast
|
||||
non-recursive mutex.
|
||||
__GTHREAD_MUTEX_INIT_FUNCTION
|
||||
to initialize __gthread_mutex_t to get a fast
|
||||
non-recursive mutex.
|
||||
Define this to a function which looks like this:
|
||||
void __GTHREAD_MUTEX_INIT_FUNCTION (__gthread_mutex_t *)
|
||||
Some systems can't initialize a mutex without a
|
||||
function call. Don't define __GTHREAD_MUTEX_INIT in this case.
|
||||
__GTHREAD_RECURSIVE_MUTEX_INIT
|
||||
__GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION
|
||||
as above, but for a recursive mutex.
|
||||
|
||||
The threads interface must define the following static functions:
|
||||
|
||||
int __gthread_once (__gthread_once_t *once, void (*func) ())
|
||||
|
||||
int __gthread_key_create (__gthread_key_t *keyp, void (*dtor) (void *))
|
||||
int __gthread_key_delete (__gthread_key_t key)
|
||||
|
||||
void *__gthread_getspecific (__gthread_key_t key)
|
||||
int __gthread_setspecific (__gthread_key_t key, const void *ptr)
|
||||
|
||||
int __gthread_mutex_destroy (__gthread_mutex_t *mutex);
|
||||
int __gthread_recursive_mutex_destroy (__gthread_recursive_mutex_t *mutex);
|
||||
|
||||
int __gthread_mutex_lock (__gthread_mutex_t *mutex);
|
||||
int __gthread_mutex_trylock (__gthread_mutex_t *mutex);
|
||||
int __gthread_mutex_unlock (__gthread_mutex_t *mutex);
|
||||
|
||||
int __gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *mutex);
|
||||
int __gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *mutex);
|
||||
int __gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *mutex);
|
||||
|
||||
The following are supported in POSIX threads only. They are required to
|
||||
fix a deadlock in static initialization inside libsupc++. The header file
|
||||
gthr-posix.h defines a symbol __GTHREAD_HAS_COND to signify that these extra
|
||||
features are supported.
|
||||
|
||||
Types:
|
||||
__gthread_cond_t
|
||||
|
||||
Macros:
|
||||
__GTHREAD_COND_INIT
|
||||
__GTHREAD_COND_INIT_FUNCTION
|
||||
|
||||
Interface:
|
||||
int __gthread_cond_broadcast (__gthread_cond_t *cond);
|
||||
int __gthread_cond_wait (__gthread_cond_t *cond, __gthread_mutex_t *mutex);
|
||||
int __gthread_cond_wait_recursive (__gthread_cond_t *cond,
|
||||
__gthread_recursive_mutex_t *mutex);
|
||||
|
||||
All functions returning int should return zero on success or the error
|
||||
number. If the operation is not supported, -1 is returned.
|
||||
|
||||
If the following are also defined, you should
|
||||
#define __GTHREADS_CXX0X 1
|
||||
to enable the c++0x thread library.
|
||||
|
||||
Types:
|
||||
__gthread_t
|
||||
__gthread_time_t
|
||||
|
||||
Interface:
|
||||
int __gthread_create (__gthread_t *thread, void *(*func) (void*),
|
||||
void *args);
|
||||
int __gthread_join (__gthread_t thread, void **value_ptr);
|
||||
int __gthread_detach (__gthread_t thread);
|
||||
int __gthread_equal (__gthread_t t1, __gthread_t t2);
|
||||
__gthread_t __gthread_self (void);
|
||||
int __gthread_yield (void);
|
||||
|
||||
int __gthread_mutex_timedlock (__gthread_mutex_t *m,
|
||||
const __gthread_time_t *abs_timeout);
|
||||
int __gthread_recursive_mutex_timedlock (__gthread_recursive_mutex_t *m,
|
||||
const __gthread_time_t *abs_time);
|
||||
|
||||
int __gthread_cond_signal (__gthread_cond_t *cond);
|
||||
int __gthread_cond_timedwait (__gthread_cond_t *cond,
|
||||
__gthread_mutex_t *mutex,
|
||||
const __gthread_time_t *abs_timeout);
|
||||
|
||||
*/
|
||||
|
||||
#if __GXX_WEAK__
|
||||
/* The pe-coff weak support isn't fully compatible to ELF's weak.
|
||||
For static libraries it might would work, but as we need to deal
|
||||
with shared versions too, we disable it for mingw-targets. */
|
||||
#ifdef __MINGW32__
|
||||
#undef _GLIBCXX_GTHREAD_USE_WEAK
|
||||
#define _GLIBCXX_GTHREAD_USE_WEAK 0
|
||||
#endif
|
||||
|
||||
#ifndef _GLIBCXX_GTHREAD_USE_WEAK
|
||||
#define _GLIBCXX_GTHREAD_USE_WEAK 1
|
||||
#endif
|
||||
#endif
|
||||
#include <sys/gthr-default.h>
|
||||
|
||||
#ifndef _GLIBCXX_HIDE_EXPORTS
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#endif /* ! _GLIBCXX_GCC_GTHR_H */
|
@@ -1,69 +1,47 @@
|
||||
#ifndef __SYS_LOCK_H__
|
||||
#define __SYS_LOCK_H__
|
||||
|
||||
//#define _LIBC 1
|
||||
#define NOT_IN_libc 1
|
||||
#ifndef _SYS_LOCK_H_
|
||||
#define _SYS_LOCK_H_
|
||||
|
||||
#ifndef __USE_GNU
|
||||
#define __USE_GNU 1
|
||||
#endif
|
||||
#include <sys/cdefs.h>
|
||||
#include <stddef.h>
|
||||
#include <sys/gthr.h>
|
||||
|
||||
void __mutex_lock(volatile int *val);
|
||||
typedef __gthread_mutex_t _LOCK_T;
|
||||
|
||||
typedef volatile int __libc_lock_t;
|
||||
typedef struct { volatile int mutex; } __libc_lock_recursive_t;
|
||||
typedef __gthread_recursive_mutex_t _LOCK_RECURSIVE_T;
|
||||
|
||||
#define __libc_lock_define(CLASS,NAME) \
|
||||
CLASS __libc_lock_t NAME;
|
||||
#define __libc_rwlock_define(CLASS,NAME) \
|
||||
CLASS __libc_rwlock_t NAME;
|
||||
#define __libc_lock_define_recursive(CLASS,NAME) \
|
||||
CLASS __libc_lock_recursive_t NAME;
|
||||
#define __rtld_lock_define_recursive(CLASS,NAME) \
|
||||
CLASS __rtld_lock_recursive_t NAME;
|
||||
#define _MUTEX_INITIALIZER { 0, -1 }
|
||||
|
||||
typedef __libc_lock_t _LOCK_T;
|
||||
typedef __libc_lock_recursive_t _LOCK_RECURSIVE_T;
|
||||
#define _MUTEX_RECURSIVE_INITIALIZER { 0,-1,0,0 }
|
||||
|
||||
#define __LOCK_INIT(class,lock) \
|
||||
__libc_lock_define_initialized(class, lock)
|
||||
#define __LOCK_INIT(_qualifier, _designator) \
|
||||
_qualifier _LOCK_T _designator = _MUTEX_INITIALIZER
|
||||
|
||||
#define __LOCK_INIT_RECURSIVE(class, lock) \
|
||||
__libc_lock_define_initialized_recursive(class, lock)
|
||||
#define __LOCK_INIT_RECURSIVE(_qualifier, _designator) \
|
||||
_qualifier _LOCK_RECURSIVE_T _designator = _MUTEX_RECURSIVE_INITIALIZER
|
||||
|
||||
#define __libc_lock_define_initialized(CLASS,NAME) \
|
||||
CLASS __libc_lock_t NAME;
|
||||
static inline int __libc_lock_acquire(_LOCK_T *lock)
|
||||
{
|
||||
if(lock->handle == -1)
|
||||
__gthread_mutex_init_function(lock);
|
||||
|
||||
#define __libc_lock_define_initialized_recursive(CLASS,NAME) \
|
||||
CLASS __libc_lock_recursive_t NAME = _LIBC_LOCK_RECURSIVE_INITIALIZER;
|
||||
return __gthread_mutex_lock(lock);
|
||||
}
|
||||
|
||||
#define _LIBC_LOCK_RECURSIVE_INITIALIZER {0}
|
||||
static inline int __libc_lock_acquire_recursive(_LOCK_RECURSIVE_T *lock)
|
||||
{
|
||||
if(lock->handle == -1)
|
||||
__gthread_recursive_mutex_init_function(lock);
|
||||
|
||||
#define __lock_init(__lock) __libc_lock_init(__lock)
|
||||
#define __lock_init_recursive(__lock) __libc_lock_init_recursive(__lock)
|
||||
#define __lock_acquire(__lock) __libc_lock_lock(__lock)
|
||||
#define __lock_acquire_recursive(__lock) __libc_lock_lock_recursive(__lock)
|
||||
#define __lock_release(__lock) __libc_lock_unlock(__lock)
|
||||
#define __lock_release_recursive(__lock) __libc_lock_unlock_recursive(__lock)
|
||||
#define __lock_try_acquire(__lock) __libc_lock_trylock(__lock)
|
||||
#define __lock_try_acquire_recursive(__lock) \
|
||||
__libc_lock_trylock_recursive(__lock)
|
||||
#define __lock_close(__lock) __libc_lock_fini(__lock)
|
||||
#define __lock_close_recursive(__lock) __libc_lock_fini_recursive(__lock)
|
||||
return __gthread_recursive_mutex_lock(lock);
|
||||
}
|
||||
|
||||
#define __lock_acquire(_lock) __libc_lock_acquire(&_lock)
|
||||
#define __lock_release(_lock) __gthread_mutex_unlock(&_lock)
|
||||
|
||||
#define __libc_lock_init_recursive(NAME) ((NAME).mutex=0)
|
||||
#define __libc_lock_fini(NAME)
|
||||
#define __lock_init_recursive(_lock) __gthread_recursive_mutex_init_function(&_lock)
|
||||
#define __lock_acquire_recursive(_lock) __libc_lock_acquire_recursive(&_lock)
|
||||
#define __lock_release_recursive(_lock) __gthread_recursive_mutex_unlock(&_lock)
|
||||
#define __lock_close_recursive(_lock) __gthread_recursive_mutex_destroy(&_lock)
|
||||
|
||||
#define __libc_lock_fini_recursive(NAME) __libc_lock_fini ((NAME).mutex)
|
||||
|
||||
|
||||
#define __libc_lock_lock(NAME) __mutex_lock (&(NAME))
|
||||
|
||||
/* Lock the recursive named lock variable. */
|
||||
#define __libc_lock_lock_recursive(NAME) __libc_lock_lock ((NAME).mutex)
|
||||
|
||||
#define __libc_lock_unlock(NAME) ((NAME)=0)
|
||||
#define __libc_lock_unlock_recursive(NAME) __libc_lock_unlock ((NAME).mutex)
|
||||
|
||||
#endif /* __SYS_LOCK_H__ */
|
||||
#endif /* _SYS_LOCK_H_ */
|
||||
|
@@ -19,10 +19,9 @@ details. */
|
||||
includes the W32api winsock[2].h header must know what it is doing;
|
||||
it must not call the Cygwin select function.
|
||||
*/
|
||||
# if !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || defined (_WINSOCKAPI_) || defined (__USE_W32_SOCKETS))
|
||||
# if !(defined (_WINSOCK_H) || defined (_WINSOCKAPI_) || defined (__USE_W32_SOCKETS))
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#include <sys/_sigset.h>
|
||||
#include <sys/_timeval.h>
|
||||
#include <sys/timespec.h>
|
||||
@@ -73,14 +72,16 @@ __BEGIN_DECLS
|
||||
|
||||
int select __P ((int __n, fd_set *__readfds, fd_set *__writefds,
|
||||
fd_set *__exceptfds, struct timeval *__timeout));
|
||||
#if __POSIX_VISIBLE >= 200112
|
||||
int pselect __P ((int __n, fd_set *__readfds, fd_set *__writefds,
|
||||
fd_set *__exceptfds, const struct timespec *__timeout,
|
||||
const sigset_t *__set));
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif
|
||||
#endif /* !__INSIDE_CYGWIN_NET__ */
|
||||
|
||||
#endif /* !_POSIX_SOURCE, !__INSIDE_CYGWIN_NET__ */
|
||||
#endif /* !(_WINSOCK_H || _WINSOCKAPI_ || __USE_W32_SOCKETS) */
|
||||
|
||||
#endif /* sys/select.h */
|
||||
|
@@ -13,8 +13,6 @@ extern "C" {
|
||||
#include <sys/_sigset.h>
|
||||
#include <sys/_timespec.h>
|
||||
|
||||
/* #ifndef __STRICT_ANSI__*/
|
||||
|
||||
#if !defined(_SIGSET_T_DECLARED)
|
||||
#define _SIGSET_T_DECLARED
|
||||
typedef __sigset_t sigset_t;
|
||||
@@ -77,7 +75,7 @@ typedef struct {
|
||||
#define SA_NOCLDSTOP 0x1 /* Do not generate SIGCHLD when children stop */
|
||||
#define SA_SIGINFO 0x2 /* Invoke the signal catching function with */
|
||||
/* three arguments instead of one. */
|
||||
#if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112
|
||||
#if __BSD_VISIBLE || __XSI_VISIBLE >= 4 || __POSIX_VISIBLE >= 200809
|
||||
#define SA_ONSTACK 0x4 /* Signal delivery will be on a separate stack. */
|
||||
#endif
|
||||
|
||||
@@ -125,7 +123,7 @@ struct sigaction
|
||||
};
|
||||
#endif /* defined(__rtems__) */
|
||||
|
||||
#if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112
|
||||
#if __BSD_VISIBLE || __XSI_VISIBLE >= 4 || __POSIX_VISIBLE >= 200809
|
||||
/*
|
||||
* Minimum and default signal stack constants. Allow for target overrides
|
||||
* from <sys/features.h>.
|
||||
@@ -158,15 +156,6 @@ typedef struct sigaltstack {
|
||||
#define SIG_BLOCK 1 /* set of signals to block */
|
||||
#define SIG_UNBLOCK 2 /* set of signals to, well, unblock */
|
||||
|
||||
/* These depend upon the type of sigset_t, which right now
|
||||
is always a long.. They're in the POSIX namespace, but
|
||||
are not ANSI. */
|
||||
#define sigaddset(what,sig) (*(what) |= (1<<(sig)), 0)
|
||||
#define sigdelset(what,sig) (*(what) &= ~(1<<(sig)), 0)
|
||||
#define sigemptyset(what) (*(what) = 0, 0)
|
||||
#define sigfillset(what) (*(what) = ~(0), 0)
|
||||
#define sigismember(what,sig) (((*(what)) & (1<<(sig))) != 0)
|
||||
|
||||
int _EXFUN(sigprocmask, (int how, const sigset_t *set, sigset_t *oset));
|
||||
|
||||
#if defined(_POSIX_THREADS)
|
||||
@@ -174,12 +163,6 @@ int _EXFUN(pthread_sigmask, (int how, const sigset_t *set, sigset_t *oset));
|
||||
#endif
|
||||
|
||||
#if defined(__CYGWIN__) || defined(__rtems__)
|
||||
#undef sigaddset
|
||||
#undef sigdelset
|
||||
#undef sigemptyset
|
||||
#undef sigfillset
|
||||
#undef sigismember
|
||||
|
||||
#ifdef _COMPILING_NEWLIB
|
||||
int _EXFUN(_kill, (pid_t, int));
|
||||
#endif /* _COMPILING_NEWLIB */
|
||||
@@ -187,7 +170,7 @@ int _EXFUN(_kill, (pid_t, int));
|
||||
|
||||
int _EXFUN(kill, (pid_t, int));
|
||||
|
||||
#if defined(__CYGWIN__) || defined(__rtems__)
|
||||
#if __BSD_VISIBLE || __XSI_VISIBLE >= 4
|
||||
int _EXFUN(killpg, (pid_t, int));
|
||||
int _EXFUN(sigaction, (int, const struct sigaction *, struct sigaction *));
|
||||
int _EXFUN(sigaddset, (sigset_t *, const int));
|
||||
@@ -199,11 +182,21 @@ int _EXFUN(sigpending, (sigset_t *));
|
||||
int _EXFUN(sigsuspend, (const sigset_t *));
|
||||
int _EXFUN(sigpause, (int));
|
||||
|
||||
#if defined(__CYGWIN__) || defined(__rtems__)
|
||||
#if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112
|
||||
#if !defined(__CYGWIN__) && !defined(__rtems__)
|
||||
/* These depend upon the type of sigset_t, which right now
|
||||
is always a long.. They're in the POSIX namespace, but
|
||||
are not ANSI. */
|
||||
#define sigaddset(what,sig) (*(what) |= (1<<(sig)), 0)
|
||||
#define sigdelset(what,sig) (*(what) &= ~(1<<(sig)), 0)
|
||||
#define sigemptyset(what) (*(what) = 0, 0)
|
||||
#define sigfillset(what) (*(what) = ~(0), 0)
|
||||
#define sigismember(what,sig) (((*(what)) & (1<<(sig))) != 0)
|
||||
#endif /* !__CYGWIN__ && !__rtems__ */
|
||||
#endif /* __BSD_VISIBLE || __XSI_VISIBLE >= 4 */
|
||||
|
||||
#if __BSD_VISIBLE || __XSI_VISIBLE >= 4 || __POSIX_VISIBLE >= 200809
|
||||
int _EXFUN(sigaltstack, (const stack_t *__restrict, stack_t *__restrict));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_POSIX_THREADS)
|
||||
#ifdef __CYGWIN__
|
||||
@@ -230,10 +223,6 @@ int _EXFUN(sigqueue, (pid_t pid, int signo, const union sigval value));
|
||||
|
||||
#endif /* defined(_POSIX_REALTIME_SIGNALS) */
|
||||
|
||||
#endif /* defined(__CYGWIN__) || defined(__rtems__) */
|
||||
|
||||
/* #endif __STRICT_ANSI__ */
|
||||
|
||||
#if defined(___AM29K__)
|
||||
/* These all need to be defined for ANSI C, but I don't think they are
|
||||
meaningful. */
|
||||
@@ -354,7 +343,7 @@ int _EXFUN(sigqueue, (pid_t pid, int signo, const union sigval value));
|
||||
#endif
|
||||
|
||||
#if defined(__CYGWIN__)
|
||||
#if __POSIX_VISIBLE >= 200809
|
||||
#if __XSI_VISIBLE >= 4 || __POSIX_VISIBLE >= 200809
|
||||
#include <sys/ucontext.h>
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -82,12 +82,12 @@ struct stat
|
||||
#define S_ISUID 0004000 /* set user id on execution */
|
||||
#define S_ISGID 0002000 /* set group id on execution */
|
||||
#define S_ISVTX 0001000 /* save swapped text even after use */
|
||||
#ifndef _POSIX_SOURCE
|
||||
#if __BSD_VISIBLE
|
||||
#define S_IREAD 0000400 /* read permission, owner */
|
||||
#define S_IWRITE 0000200 /* write permission, owner */
|
||||
#define S_IEXEC 0000100 /* execute/search permission, owner */
|
||||
#define S_ENFMT 0002000 /* enforcement-mode locking */
|
||||
#endif /* !_POSIX_SOURCE */
|
||||
#endif /* !_BSD_VISIBLE */
|
||||
|
||||
#define S_IFMT _IFMT
|
||||
#define S_IFDIR _IFDIR
|
||||
@@ -124,7 +124,7 @@ struct stat
|
||||
#define S_IWOTH 0000002 /* write permission, other */
|
||||
#define S_IXOTH 0000001/* execute/search permission, other */
|
||||
|
||||
#ifndef _POSIX_SOURCE
|
||||
#if __BSD_VISIBLE
|
||||
#define ACCESSPERMS (S_IRWXU | S_IRWXG | S_IRWXO) /* 0777 */
|
||||
#define ALLPERMS (S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO) /* 07777 */
|
||||
#define DEFFILEMODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) /* 0666 */
|
||||
@@ -144,6 +144,8 @@ struct stat
|
||||
#define UTIME_OMIT -1L
|
||||
#endif
|
||||
|
||||
int _EXFUN(chmod,( const char *__path, mode_t __mode ));
|
||||
int _EXFUN(fchmod,(int __fd, mode_t __mode));
|
||||
int _EXFUN(fstat,( int __fd, struct stat *__sbuf ));
|
||||
int _EXFUN(mkdir,( const char *_path, mode_t __mode ));
|
||||
int _EXFUN(mkfifo,( const char *__path, mode_t __mode ));
|
||||
@@ -155,19 +157,15 @@ int _EXFUN(lstat,( const char *__restrict __path, struct stat *__restrict __buf
|
||||
int _EXFUN(mknod,( const char *__path, mode_t __mode, dev_t __dev ));
|
||||
#endif
|
||||
|
||||
#if (__POSIX_VISIBLE >= 200809 || defined (__CYGWIN__)) && !defined(__INSIDE_CYGWIN__)
|
||||
#if __ATFILE_VISIBLE && !defined(__INSIDE_CYGWIN__)
|
||||
int _EXFUN(fchmodat, (int, const char *, mode_t, int));
|
||||
#endif
|
||||
#if (__BSD_VISIBLE || __POSIX_VISIBLE >= 200809 || defined (__CYGWIN__)) && !defined(__INSIDE_CYGWIN__)
|
||||
int _EXFUN(fstatat, (int, const char *__restrict , struct stat *__restrict, int));
|
||||
int _EXFUN(mkdirat, (int, const char *, mode_t));
|
||||
int _EXFUN(mkfifoat, (int, const char *, mode_t));
|
||||
#endif
|
||||
#if (__BSD_VISIBLE || __XSI_VISIBLE >= 700 || defined (__CYGWIN__)) && !defined(__INSIDE_CYGWIN__)
|
||||
int _EXFUN(mknodat, (int, const char *, mode_t, dev_t));
|
||||
#endif
|
||||
#if (__BSD_VISIBLE || __POSIX_VISIBLE >= 200809 || defined (__CYGWIN__)) && !defined(__INSIDE_CYGWIN__)
|
||||
int _EXFUN(utimensat, (int, const char *, const struct timespec *, int));
|
||||
#endif
|
||||
#if __POSIX_VISIBLE >= 200809 && !defined(__INSIDE_CYGWIN__)
|
||||
int _EXFUN(futimens, (int, const struct timespec *));
|
||||
#endif
|
||||
|
||||
|
@@ -9,11 +9,11 @@
|
||||
detect if FILE is private to sprintf/sscanf class of functions; if
|
||||
set then do nothing as lock is not initialised. */
|
||||
#if !defined(_flockfile)
|
||||
//#ifndef __SINGLE_THREAD__
|
||||
//# define _flockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_acquire_recursive((fp)->_lock))
|
||||
//#else
|
||||
#ifndef __SINGLE_THREAD__
|
||||
# define _flockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_acquire_recursive((fp)->_lock))
|
||||
#else
|
||||
# define _flockfile(fp) (_CAST_VOID 0)
|
||||
//#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(_funlockfile)
|
||||
|
@@ -43,7 +43,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/timespec.h>
|
||||
|
||||
#if __BSD_VISIBLE
|
||||
#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
|
||||
@@ -416,24 +416,27 @@ int tvtohz(struct timeval *tv);
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
int _EXFUN(setitimer, (int __which, const struct itimerval *__restrict __value,
|
||||
struct itimerval *__restrict __ovalue));
|
||||
int _EXFUN(utimes, (const char *__path, const struct timeval *__tvp));
|
||||
|
||||
#if __BSD_VISIBLE
|
||||
int _EXFUN(adjtime, (const struct timeval *, struct timeval *));
|
||||
int _EXFUN(futimes, (int, const struct timeval *));
|
||||
int _EXFUN(futimesat, (int, const char *, const struct timeval [2]));
|
||||
int _EXFUN(lutimes, (const char *, const struct timeval *));
|
||||
int _EXFUN(settimeofday, (const struct timeval *, const struct timezone *));
|
||||
#endif
|
||||
|
||||
#if __XSI_VISIBLE
|
||||
#if __MISC_VISIBLE || __XSI_VISIBLE
|
||||
int _EXFUN(getitimer, (int __which, struct itimerval *__value));
|
||||
int _EXFUN(setitimer, (int __which, const struct itimerval *__restrict __value,
|
||||
struct itimerval *__restrict __ovalue));
|
||||
int _EXFUN(gettimeofday, (struct timeval *__restrict __p,
|
||||
void *__restrict __tz));
|
||||
#endif
|
||||
|
||||
#if __GNU_VISIBLE
|
||||
int _EXFUN(futimesat, (int, const char *, const struct timeval [2]));
|
||||
#endif
|
||||
|
||||
#ifdef _COMPILING_NEWLIB
|
||||
int _EXFUN(_gettimeofday, (struct timeval *__p, void *__tz));
|
||||
#endif
|
||||
|
@@ -18,21 +18,12 @@
|
||||
#ifndef _SYS_TYPES_H
|
||||
|
||||
#include <_ansi.h>
|
||||
# include <sys/cdefs.h>
|
||||
|
||||
#ifndef __INTTYPES_DEFINED__
|
||||
#define __INTTYPES_DEFINED__
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <machine/_types.h>
|
||||
|
||||
#if defined(__rtems__) || defined(__XMK__)
|
||||
/*
|
||||
* The following section is RTEMS specific and is needed to more
|
||||
* closely match the types defined in the BSD sys/types.h.
|
||||
* This is needed to let the RTEMS/BSD TCP/IP stack compile.
|
||||
*/
|
||||
|
||||
/* deprecated */
|
||||
/* BSD types permitted by POSIX and always exposed as in Glibc. Only provided
|
||||
for backward compatibility with BSD code. The uintN_t standard types should
|
||||
be preferred in new code. */
|
||||
#if ___int8_t_defined
|
||||
typedef __uint8_t u_int8_t;
|
||||
#endif
|
||||
@@ -42,19 +33,25 @@ typedef __uint16_t u_int16_t;
|
||||
#if ___int32_t_defined
|
||||
typedef __uint32_t u_int32_t;
|
||||
#endif
|
||||
|
||||
#if ___int64_t_defined
|
||||
typedef __uint64_t u_int64_t;
|
||||
#endif
|
||||
|
||||
#if defined(__rtems__) || defined(__XMK__)
|
||||
/*
|
||||
* The following section is RTEMS specific and is needed to more
|
||||
* closely match the types defined in the BSD sys/types.h.
|
||||
* This is needed to let the RTEMS/BSD TCP/IP stack compile.
|
||||
*/
|
||||
|
||||
/* deprecated */
|
||||
#if ___int64_t_defined
|
||||
typedef __uint64_t u_quad_t;
|
||||
typedef __int64_t quad_t;
|
||||
typedef quad_t * qaddr_t;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* ! __INTTYPES_DEFINED */
|
||||
#endif /* __rtems__ || __XMK__ */
|
||||
|
||||
#ifndef __need_inttypes
|
||||
|
||||
@@ -84,11 +81,13 @@ typedef quad_t * qaddr_t;
|
||||
#define _ST_INT32
|
||||
#endif
|
||||
|
||||
# if __BSD_VISIBLE
|
||||
|
||||
#if __BSD_VISIBLE
|
||||
#include <sys/select.h>
|
||||
# define physadr physadr_t
|
||||
# define quad quad_t
|
||||
#endif
|
||||
|
||||
#if __MISC_VISIBLE
|
||||
#ifndef _BSDTYPES_DEFINED
|
||||
/* also defined in mingw/gmon.h and in w32api/winsock[2].h */
|
||||
#ifndef __u_char_defined
|
||||
@@ -109,11 +108,13 @@ typedef unsigned long u_long;
|
||||
#endif
|
||||
#define _BSDTYPES_DEFINED
|
||||
#endif
|
||||
#endif /*__BSD_VISIBLE || __CYGWIN__ */
|
||||
|
||||
#if __MISC_VISIBLE
|
||||
typedef unsigned short ushort; /* System V compatibility */
|
||||
typedef unsigned int uint; /* System V compatibility */
|
||||
typedef unsigned long ulong; /* System V compatibility */
|
||||
# endif /*__BSD_VISIBLE */
|
||||
#endif
|
||||
|
||||
#ifndef __clock_t_defined
|
||||
typedef _CLOCK_T_ clock_t;
|
||||
@@ -187,7 +188,11 @@ typedef _mode_t mode_t;
|
||||
#ifndef __CYGWIN__
|
||||
typedef long key_t;
|
||||
#endif
|
||||
|
||||
#ifndef _SSIZE_T_DECLARED
|
||||
typedef _ssize_t ssize_t;
|
||||
#define _SSIZE_T_DECLARED
|
||||
#endif
|
||||
|
||||
#if !defined(__CYGWIN__) && !defined(__rtems__)
|
||||
#ifdef __MS_types__
|
||||
@@ -410,6 +415,7 @@ typedef __uint32_t pthread_cond_t; /* identify a condition variable */
|
||||
|
||||
typedef struct {
|
||||
int is_initialized;
|
||||
clock_t clock; /* specifiy clock for timeouts */
|
||||
#if defined(_POSIX_THREAD_PROCESS_SHARED)
|
||||
int process_shared; /* allow this to be shared amongst processes */
|
||||
#endif
|
||||
@@ -431,6 +437,7 @@ typedef struct {
|
||||
|
||||
/* POSIX Barrier Types */
|
||||
|
||||
#if !defined(__CYGWIN__)
|
||||
#if defined(_POSIX_BARRIERS)
|
||||
typedef __uint32_t pthread_barrier_t; /* POSIX Barrier Object */
|
||||
typedef struct {
|
||||
@@ -443,7 +450,6 @@ typedef struct {
|
||||
|
||||
/* POSIX Spin Lock Types */
|
||||
|
||||
#if !defined (__CYGWIN__)
|
||||
#if defined(_POSIX_SPIN_LOCKS)
|
||||
typedef __uint32_t pthread_spinlock_t; /* POSIX Spin Lock Object */
|
||||
#endif /* defined(_POSIX_SPIN_LOCKS) */
|
||||
|
@@ -24,72 +24,79 @@ int _EXFUN(chmod, (const char *__path, mode_t __mode ));
|
||||
#if !defined(__INSIDE_CYGWIN__)
|
||||
int _EXFUN(chown, (const char *__path, uid_t __owner, gid_t __group ));
|
||||
#endif
|
||||
#if defined(__CYGWIN__) || defined(__rtems__)
|
||||
#if __BSD_VISIBLE || (__XSI_VISIBLE >= 4 && __POSIX_VISIBLE < 200112)
|
||||
int _EXFUN(chroot, (const char *__path ));
|
||||
#endif
|
||||
int _EXFUN(close, (int __fildes ));
|
||||
#if defined(__CYGWIN__)
|
||||
#if __POSIX_VISIBLE >= 199209
|
||||
size_t _EXFUN(confstr, (int __name, char *__buf, size_t __len));
|
||||
#endif
|
||||
char * _EXFUN(ctermid, (char *__s ));
|
||||
char * _EXFUN(cuserid, (char *__s ));
|
||||
#if defined(__CYGWIN__)
|
||||
#if __BSD_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 500)
|
||||
int _EXFUN(daemon, (int nochdir, int noclose));
|
||||
#endif
|
||||
int _EXFUN(dup, (int __fildes ));
|
||||
int _EXFUN(dup2, (int __fildes, int __fildes2 ));
|
||||
#if defined(__CYGWIN__)
|
||||
#if __GNU_VISIBLE
|
||||
int _EXFUN(dup3, (int __fildes, int __fildes2, int flags));
|
||||
int _EXFUN(eaccess, (const char *__path, int __mode));
|
||||
#endif
|
||||
#if __BSD_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 500)
|
||||
void _EXFUN(endusershell, (void));
|
||||
#endif
|
||||
#if __GNU_VISIBLE
|
||||
int _EXFUN(euidaccess, (const char *__path, int __mode));
|
||||
#endif
|
||||
int _EXFUN(execl, (const char *__path, const char *, ... ));
|
||||
int _EXFUN(execle, (const char *__path, const char *, ... ));
|
||||
int _EXFUN(execlp, (const char *__file, const char *, ... ));
|
||||
#if defined(__CYGWIN__)
|
||||
#if __MISC_VISIBLE
|
||||
int _EXFUN(execlpe, (const char *__file, const char *, ... ));
|
||||
#endif
|
||||
int _EXFUN(execv, (const char *__path, char * const __argv[] ));
|
||||
int _EXFUN(execve, (const char *__path, char * const __argv[], char * const __envp[] ));
|
||||
int _EXFUN(execvp, (const char *__file, char * const __argv[] ));
|
||||
#if defined(__CYGWIN__)
|
||||
#if __GNU_VISIBLE
|
||||
int _EXFUN(execvpe, (const char *__file, char * const __argv[], char * const __envp[] ));
|
||||
#endif
|
||||
#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE || defined(__CYGWIN__)
|
||||
#if __ATFILE_VISIBLE
|
||||
int _EXFUN(faccessat, (int __dirfd, const char *__path, int __mode, int __flags));
|
||||
#endif
|
||||
#if defined(__CYGWIN__) || defined(__rtems__) || defined(__SPU__)
|
||||
#if __BSD_VISIBLE || __XSI_VISIBLE >= 4
|
||||
int _EXFUN(fchdir, (int __fildes));
|
||||
#endif
|
||||
int _EXFUN(fchmod, (int __fildes, mode_t __mode ));
|
||||
#if !defined(__INSIDE_CYGWIN__)
|
||||
int _EXFUN(fchown, (int __fildes, uid_t __owner, gid_t __group ));
|
||||
#endif
|
||||
#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE || defined(__CYGWIN__)
|
||||
#if __ATFILE_VISIBLE
|
||||
int _EXFUN(fchownat, (int __dirfd, const char *__path, uid_t __owner, gid_t __group, int __flags));
|
||||
#endif
|
||||
#if defined(__CYGWIN__)
|
||||
#if __POSIX_VISIBLE >= 200809
|
||||
int _EXFUN(fexecve, (int __fd, char * const __argv[], char * const __envp[] ));
|
||||
#endif
|
||||
pid_t _EXFUN(fork, (void ));
|
||||
long _EXFUN(fpathconf, (int __fd, int __name ));
|
||||
int _EXFUN(fsync, (int __fd));
|
||||
int _EXFUN(fdatasync, (int __fd));
|
||||
#if defined(__CYGWIN__)
|
||||
#if __GNU_VISIBLE
|
||||
char * _EXFUN(get_current_dir_name, (void));
|
||||
#endif
|
||||
char * _EXFUN(getcwd, (char *__buf, size_t __size ));
|
||||
#if defined(__CYGWIN__)
|
||||
#if __BSD_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 500)
|
||||
int _EXFUN(getdomainname ,(char *__name, size_t __len));
|
||||
#endif
|
||||
#if __BSD_VISIBLE
|
||||
int _EXFUN(getentropy, (void *, size_t));
|
||||
#endif
|
||||
#if !defined(__INSIDE_CYGWIN__)
|
||||
gid_t _EXFUN(getegid, (void ));
|
||||
uid_t _EXFUN(geteuid, (void ));
|
||||
gid_t _EXFUN(getgid, (void ));
|
||||
#endif
|
||||
int _EXFUN(getgroups, (int __gidsetsize, gid_t __grouplist[] ));
|
||||
#if defined(__CYGWIN__)
|
||||
#if __BSD_VISIBLE || __XSI_VISIBLE >= 4
|
||||
long _EXFUN(gethostid, (void));
|
||||
#endif
|
||||
char * _EXFUN(getlogin, (void ));
|
||||
@@ -98,22 +105,26 @@ int _EXFUN(getlogin_r, (char *name, size_t namesize) );
|
||||
#endif
|
||||
char * _EXFUN(getpass, (const char *__prompt));
|
||||
int _EXFUN(getpagesize, (void));
|
||||
#if defined(__CYGWIN__)
|
||||
#if __BSD_VISIBLE
|
||||
int _EXFUN(getpeereid, (int, uid_t *, gid_t *));
|
||||
#endif
|
||||
pid_t _EXFUN(getpgid, (pid_t));
|
||||
pid_t _EXFUN(getpgrp, (void ));
|
||||
pid_t _EXFUN(getpid, (void ));
|
||||
pid_t _EXFUN(getppid, (void ));
|
||||
#if defined(__CYGWIN__) || defined(__rtems__)
|
||||
#if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >= 4
|
||||
pid_t _EXFUN(getsid, (pid_t));
|
||||
#endif
|
||||
#if !defined(__INSIDE_CYGWIN__)
|
||||
uid_t _EXFUN(getuid, (void ));
|
||||
#endif
|
||||
#ifdef __CYGWIN__
|
||||
#if __BSD_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 500)
|
||||
char * _EXFUN(getusershell, (void));
|
||||
#endif
|
||||
#if __BSD_VISIBLE || (__XSI_VISIBLE >= 4 && __POSIX_VISIBLE < 200809)
|
||||
char * _EXFUN(getwd, (char *__buf ));
|
||||
#endif
|
||||
#if __BSD_VISIBLE
|
||||
int _EXFUN(iruserok, (unsigned long raddr, int superuser, const char *ruser, const char *luser));
|
||||
#endif
|
||||
int _EXFUN(isatty, (int __fildes ));
|
||||
@@ -124,14 +135,14 @@ int _EXFUN(issetugid, (void));
|
||||
int _EXFUN(lchown, (const char *__path, uid_t __owner, gid_t __group ));
|
||||
#endif
|
||||
int _EXFUN(link, (const char *__path1, const char *__path2 ));
|
||||
#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE || defined(__CYGWIN__)
|
||||
#if __ATFILE_VISIBLE
|
||||
int _EXFUN(linkat, (int __dirfd1, const char *__path1, int __dirfd2, const char *__path2, int __flags ));
|
||||
#endif
|
||||
int _EXFUN(nice, (int __nice_value ));
|
||||
#if !defined(__INSIDE_CYGWIN__)
|
||||
off_t _EXFUN(lseek, (int __fildes, off_t __offset, int __whence ));
|
||||
#endif
|
||||
#if defined(__SPU__) || defined(__CYGWIN__)
|
||||
#if __MISC_VISIBLE || __XSI_VISIBLE >= 4
|
||||
#define F_ULOCK 0
|
||||
#define F_LOCK 1
|
||||
#define F_TLOCK 2
|
||||
@@ -140,41 +151,41 @@ int _EXFUN(lockf, (int __fd, int __cmd, off_t __len));
|
||||
#endif
|
||||
long _EXFUN(pathconf, (const char *__path, int __name ));
|
||||
int _EXFUN(pause, (void ));
|
||||
#ifdef __CYGWIN__
|
||||
#if __POSIX_VISIBLE >= 199506
|
||||
int _EXFUN(pthread_atfork, (void (*)(void), void (*)(void), void (*)(void)));
|
||||
#endif
|
||||
int _EXFUN(pipe, (int __fildes[2] ));
|
||||
#ifdef __CYGWIN__
|
||||
#if __GNU_VISIBLE
|
||||
int _EXFUN(pipe2, (int __fildes[2], int flags));
|
||||
#endif
|
||||
ssize_t _EXFUN(pread, (int __fd, void *__buf, size_t __nbytes, off_t __offset));
|
||||
ssize_t _EXFUN(pwrite, (int __fd, const void *__buf, size_t __nbytes, off_t __offset));
|
||||
_READ_WRITE_RETURN_TYPE _EXFUN(read, (int __fd, void *__buf, size_t __nbyte ));
|
||||
#if defined(__CYGWIN__)
|
||||
#if __BSD_VISIBLE
|
||||
int _EXFUN(rresvport, (int *__alport));
|
||||
int _EXFUN(revoke, (char *__path));
|
||||
#endif
|
||||
int _EXFUN(rmdir, (const char *__path ));
|
||||
#if defined(__CYGWIN__)
|
||||
#if __BSD_VISIBLE
|
||||
int _EXFUN(ruserok, (const char *rhost, int superuser, const char *ruser, const char *luser));
|
||||
#endif
|
||||
void * _EXFUN(sbrk, (ptrdiff_t __incr));
|
||||
#if !defined(__INSIDE_CYGWIN__)
|
||||
#if defined(__CYGWIN__) || defined(__rtems__)
|
||||
#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112
|
||||
int _EXFUN(setegid, (gid_t __gid ));
|
||||
int _EXFUN(seteuid, (uid_t __uid ));
|
||||
#endif
|
||||
int _EXFUN(setgid, (gid_t __gid ));
|
||||
#endif
|
||||
#if defined(__CYGWIN__)
|
||||
#if __BSD_VISIBLE
|
||||
int _EXFUN(setgroups, (int ngroups, const gid_t *grouplist ));
|
||||
#endif
|
||||
#if __BSD_VISIBLE || (defined(_XOPEN_SOURCE) && __XSI_VISIBLE < 500)
|
||||
#if __BSD_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 500)
|
||||
int _EXFUN(sethostname, (const char *, size_t));
|
||||
#endif
|
||||
int _EXFUN(setpgid, (pid_t __pid, pid_t __pgid ));
|
||||
int _EXFUN(setpgrp, (void ));
|
||||
#if defined(__CYGWIN__) && !defined(__INSIDE_CYGWIN__)
|
||||
#if (__BSD_VISIBLE || __XSI_VISIBLE >= 4) && !defined(__INSIDE_CYGWIN__)
|
||||
int _EXFUN(setregid, (gid_t __rgid, gid_t __egid));
|
||||
int _EXFUN(setreuid, (uid_t __ruid, uid_t __euid));
|
||||
#endif
|
||||
@@ -182,7 +193,7 @@ pid_t _EXFUN(setsid, (void ));
|
||||
#if !defined(__INSIDE_CYGWIN__)
|
||||
int _EXFUN(setuid, (uid_t __uid ));
|
||||
#endif
|
||||
#if defined(__CYGWIN__)
|
||||
#if __BSD_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 500)
|
||||
void _EXFUN(setusershell, (void));
|
||||
#endif
|
||||
unsigned _EXFUN(sleep, (unsigned int __seconds ));
|
||||
@@ -191,9 +202,7 @@ long _EXFUN(sysconf, (int __name ));
|
||||
pid_t _EXFUN(tcgetpgrp, (int __fildes ));
|
||||
int _EXFUN(tcsetpgrp, (int __fildes, pid_t __pgrp_id ));
|
||||
char * _EXFUN(ttyname, (int __fildes ));
|
||||
#if defined(__CYGWIN__) || defined(__rtems__)
|
||||
int _EXFUN(ttyname_r, (int, char *, size_t));
|
||||
#endif
|
||||
int _EXFUN(unlink, (const char *__path ));
|
||||
int _EXFUN(usleep, (useconds_t __useconds));
|
||||
int _EXFUN(vhangup, (void ));
|
||||
@@ -210,9 +219,9 @@ int getopt(int, char * const [], const char *);
|
||||
extern int optreset; /* getopt(3) external variable */
|
||||
#endif
|
||||
|
||||
#ifndef _POSIX_SOURCE
|
||||
#if __BSD_VISIBLE || (__XSI_VISIBLE >= 4 && __POSIX_VISIBLE < 200809)
|
||||
pid_t _EXFUN(vfork, (void ));
|
||||
#endif /* _POSIX_SOURCE */
|
||||
#endif
|
||||
|
||||
#ifdef _COMPILING_NEWLIB
|
||||
/* Provide prototypes for most of the _<systemcall> names that are
|
||||
@@ -255,14 +264,14 @@ char * _EXFUN(mktemp, (char *));
|
||||
void _EXFUN(sync, (void));
|
||||
#endif
|
||||
|
||||
#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 4
|
||||
ssize_t _EXFUN(readlink, (const char *__restrict __path,
|
||||
char *__restrict __buf, size_t __buflen));
|
||||
#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE || defined(__CYGWIN__)
|
||||
int _EXFUN(symlink, (const char *__name1, const char *__name2));
|
||||
#endif
|
||||
#if __ATFILE_VISIBLE
|
||||
ssize_t _EXFUN(readlinkat, (int __dirfd1, const char *__restrict __path,
|
||||
char *__restrict __buf, size_t __buflen));
|
||||
#endif
|
||||
int _EXFUN(symlink, (const char *__name1, const char *__name2));
|
||||
#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE || defined(__CYGWIN__)
|
||||
int _EXFUN(symlinkat, (const char *, int, const char *));
|
||||
int _EXFUN(unlinkat, (int, const char *, int));
|
||||
#endif
|
||||
|
@@ -79,7 +79,7 @@
|
||||
__tg_type3(__e1, __e2, __e3, long double _Complex) || \
|
||||
__tg_type3(__e1, __e2, __e3, __typeof__(_Complex_I)))
|
||||
|
||||
#ifdef _LDBL_EQ_DBL
|
||||
#if defined (_LDBL_EQ_DBL) || defined (__CYGWIN__)
|
||||
#define __tg_impl_simple(x, y, z, fn, fnf, fnl, ...) \
|
||||
__builtin_choose_expr(__tg_type_corr(x, y, z, long double), \
|
||||
fnl(__VA_ARGS__), __builtin_choose_expr( \
|
||||
@@ -161,9 +161,10 @@
|
||||
#define lround(__x) __tg_simple(__x, lround)
|
||||
#define nearbyint(__x) __tg_simple(__x, nearbyint)
|
||||
#define nextafter(__x, __y) __tg_simple2(__x, __y, nextafter)
|
||||
/* not yet implemented even for _LDBL_EQ_DBL platforms
|
||||
/* not yet implemented even for _LDBL_EQ_DBL platforms */
|
||||
#ifdef __CYGWIN__
|
||||
#define nexttoward(__x, __y) __tg_simplev(__x, nexttoward, __x, __y)
|
||||
*/
|
||||
#endif
|
||||
#define remainder(__x, __y) __tg_simple2(__x, __y, remainder)
|
||||
#define remquo(__x, __y, __z) __tg_impl_simple(__x, __x, __y, remquo, remquof, \
|
||||
remquol, __x, __y, __z)
|
||||
|
@@ -8,6 +8,7 @@
|
||||
#define _TIME_H_
|
||||
|
||||
#include "_ansi.h"
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/reent.h>
|
||||
|
||||
#define __need_size_t
|
||||
@@ -76,11 +77,14 @@ _END_STD_C
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef __STRICT_ANSI__
|
||||
#if __XSI_VISIBLE
|
||||
char *_EXFUN(strptime, (const char *__restrict,
|
||||
const char *__restrict,
|
||||
struct tm *__restrict));
|
||||
#endif
|
||||
#if __POSIX_VISIBLE
|
||||
_VOID _EXFUN(tzset, (_VOID));
|
||||
#endif
|
||||
_VOID _EXFUN(_tzset_r, (struct _reent *));
|
||||
|
||||
typedef struct __tzrule_struct
|
||||
@@ -106,6 +110,7 @@ __tzinfo_type *_EXFUN (__gettzinfo, (_VOID));
|
||||
/* getdate functions */
|
||||
|
||||
#ifdef HAVE_GETDATE
|
||||
#if __XSI_VISIBLE >= 4
|
||||
#ifndef _REENT_ONLY
|
||||
#define getdate_err (*__getdate_err())
|
||||
int *_EXFUN(__getdate_err,(_VOID));
|
||||
@@ -121,21 +126,27 @@ struct tm * _EXFUN(getdate, (const char *));
|
||||
7 there is no line in the template that matches the input,
|
||||
8 invalid input specification */
|
||||
#endif /* !_REENT_ONLY */
|
||||
#endif /* __XSI_VISIBLE >= 4 */
|
||||
|
||||
#if __GNU_VISIBLE
|
||||
/* getdate_r returns the error code as above */
|
||||
int _EXFUN(getdate_r, (const char *, struct tm *));
|
||||
#endif /* __GNU_VISIBLE */
|
||||
#endif /* HAVE_GETDATE */
|
||||
|
||||
/* defines for the opengroup specifications Derived from Issue 1 of the SVID. */
|
||||
#if __SVID_VISIBLE || __XSI_VISIBLE
|
||||
extern __IMPORT long _timezone;
|
||||
extern __IMPORT int _daylight;
|
||||
#endif
|
||||
#if __POSIX_VISIBLE
|
||||
extern __IMPORT char *_tzname[2];
|
||||
|
||||
/* POSIX defines the external tzname being defined in time.h */
|
||||
#ifndef tzname
|
||||
#define tzname _tzname
|
||||
#endif
|
||||
#endif /* !__STRICT_ANSI__ */
|
||||
#endif /* __POSIX_VISIBLE */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -189,7 +189,9 @@ wint_t _EXFUN(putwc_unlocked, (wchar_t, __FILE *));
|
||||
wint_t _EXFUN(putwchar_unlocked, (wchar_t));
|
||||
#endif
|
||||
|
||||
#if __POSIX_VISIBLE >= 200809
|
||||
__FILE *_EXFUN (open_wmemstream, (wchar_t **, size_t *));
|
||||
#endif
|
||||
__FILE *_EXFUN (_open_wmemstream_r, (struct _reent *, wchar_t **, size_t *));
|
||||
|
||||
#ifndef __VALIST
|
||||
|
Reference in New Issue
Block a user