forked from KolibriOS/kolibrios
newlib-2.4.0
git-svn-id: svn://kolibrios.org@6536 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user