diff options
Diffstat (limited to 'bits')
81 files changed, 1422 insertions, 1111 deletions
diff --git a/bits/byteswap.h b/bits/byteswap.h index 0effea6899..23974e9083 100644 --- a/bits/byteswap.h +++ b/bits/byteswap.h @@ -1,5 +1,5 @@ -/* Macros to swap the order of bytes in integer values. - Copyright (C) 1997-2016 Free Software Foundation, Inc. +/* Macros and inline functions to swap the order of bytes in integer values. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -26,87 +26,54 @@ #include <features.h> #include <bits/types.h> -/* Swap bytes in 16 bit value. */ -#define __bswap_constant_16(x) \ - ((unsigned short int)((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8))) +/* Swap bytes in 16-bit value. */ +#define __bswap_constant_16(x) \ + ((__uint16_t) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))) -/* Get __bswap_16. */ -#include <bits/byteswap-16.h> +static __inline __uint16_t +__bswap_16 (__uint16_t __bsx) +{ +#if __GNUC_PREREQ (4, 8) + return __builtin_bswap16 (__bsx); +#else + return __bswap_constant_16 (__bsx); +#endif +} -/* Swap bytes in 32 bit value. */ -#define __bswap_constant_32(x) \ - ((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >> 8) | \ - (((x) & 0x0000ff00u) << 8) | (((x) & 0x000000ffu) << 24)) +/* Swap bytes in 32-bit value. */ +#define __bswap_constant_32(x) \ + ((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >> 8) \ + | (((x) & 0x0000ff00u) << 8) | (((x) & 0x000000ffu) << 24)) -#ifdef __GNUC__ -# if __GNUC_PREREQ (4, 3) -static __inline unsigned int -__bswap_32 (unsigned int __bsx) +static __inline __uint32_t +__bswap_32 (__uint32_t __bsx) { +#if __GNUC_PREREQ (4, 3) return __builtin_bswap32 (__bsx); -} -# else -# define __bswap_32(x) \ - (__extension__ \ - ({ unsigned int __bsx = (x); __bswap_constant_32 (__bsx); })) -# endif #else -static __inline unsigned int -__bswap_32 (unsigned int __bsx) -{ return __bswap_constant_32 (__bsx); -} #endif +} -/* Swap bytes in 64 bit value. */ -#if __GNUC_PREREQ (2, 0) -# define __bswap_constant_64(x) \ - (__extension__ ((((x) & 0xff00000000000000ull) >> 56) \ - | (((x) & 0x00ff000000000000ull) >> 40) \ - | (((x) & 0x0000ff0000000000ull) >> 24) \ - | (((x) & 0x000000ff00000000ull) >> 8) \ - | (((x) & 0x00000000ff000000ull) << 8) \ - | (((x) & 0x0000000000ff0000ull) << 24) \ - | (((x) & 0x000000000000ff00ull) << 40) \ - | (((x) & 0x00000000000000ffull) << 56))) +/* Swap bytes in 64-bit value. */ +#define __bswap_constant_64(x) \ + ((((x) & 0xff00000000000000ull) >> 56) \ + | (((x) & 0x00ff000000000000ull) >> 40) \ + | (((x) & 0x0000ff0000000000ull) >> 24) \ + | (((x) & 0x000000ff00000000ull) >> 8) \ + | (((x) & 0x00000000ff000000ull) << 8) \ + | (((x) & 0x0000000000ff0000ull) << 24) \ + | (((x) & 0x000000000000ff00ull) << 40) \ + | (((x) & 0x00000000000000ffull) << 56)) -# if __GNUC_PREREQ (4, 3) -static __inline __uint64_t +__extension__ static __inline __uint64_t __bswap_64 (__uint64_t __bsx) { +#if __GNUC_PREREQ (4, 3) return __builtin_bswap64 (__bsx); -} -# else -# define __bswap_64(x) \ - (__extension__ \ - ({ union { __extension__ __uint64_t __ll; \ - unsigned int __l[2]; } __w, __r; \ - if (__builtin_constant_p (x)) \ - __r.__ll = __bswap_constant_64 (x); \ - else \ - { \ - __w.__ll = (x); \ - __r.__l[0] = __bswap_32 (__w.__l[1]); \ - __r.__l[1] = __bswap_32 (__w.__l[0]); \ - } \ - __r.__ll; })) -# endif #else -# define __bswap_constant_64(x) \ - ((((x) & 0xff00000000000000ull) >> 56) \ - | (((x) & 0x00ff000000000000ull) >> 40) \ - | (((x) & 0x0000ff0000000000ull) >> 24) \ - | (((x) & 0x000000ff00000000ull) >> 8) \ - | (((x) & 0x00000000ff000000ull) << 8) \ - | (((x) & 0x0000000000ff0000ull) << 24) \ - | (((x) & 0x000000000000ff00ull) << 40) \ - | (((x) & 0x00000000000000ffull) << 56)) - -static __inline __uint64_t -__bswap_64 (__uint64_t __bsx) -{ return __bswap_constant_64 (__bsx); -} #endif +} #endif /* _BITS_BYTESWAP_H */ diff --git a/bits/confname.h b/bits/confname.h index b6359338cf..59d3172198 100644 --- a/bits/confname.h +++ b/bits/confname.h @@ -1,5 +1,5 @@ /* `sysconf', `pathconf', and `confstr' NAME values. Generic version. - Copyright (C) 1993-2016 Free Software Foundation, Inc. + Copyright (C) 1993-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/bits/dirent.h b/bits/dirent.h index 7b79a53ef5..d775540a13 100644 --- a/bits/dirent.h +++ b/bits/dirent.h @@ -1,5 +1,5 @@ /* Directory entry structure `struct dirent'. 4.4BSD/Generic version. - Copyright (C) 1996-2016 Free Software Foundation, Inc. + Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -56,4 +56,6 @@ struct dirent64 #ifdef __INO_T_MATCHES_INO64_T /* Inform libc code that these two types are effectively identical. */ # define _DIRENT_MATCHES_DIRENT64 1 +#else +# define _DIRENT_MATCHES_DIRENT64 0 #endif diff --git a/bits/dlfcn.h b/bits/dlfcn.h index f4f98a15b6..b0b129b66b 100644 --- a/bits/dlfcn.h +++ b/bits/dlfcn.h @@ -1,5 +1,5 @@ /* System dependent definitions for run-time dynamic loading. - Copyright (C) 1996-2016 Free Software Foundation, Inc. + Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/bits/environments.h b/bits/environments.h index 39d07025f9..22ea9f0bda 100644 --- a/bits/environments.h +++ b/bits/environments.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1999-2016 Free Software Foundation, Inc. +/* Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/bits/errno.h b/bits/errno.h index 5a6a6dbb26..36c09f3f3c 100644 --- a/bits/errno.h +++ b/bits/errno.h @@ -1,4 +1,5 @@ -/* Copyright (C) 1991-2016 Free Software Foundation, Inc. +/* Error constants. Generic version. + Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -15,20 +16,35 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -/* This file defines the `errno' constants. */ +/* This file defines the errno constants. */ -#if !defined __Emath_defined && (defined _ERRNO_H || defined __need_Emath) -#undef __need_Emath -#define __Emath_defined 1 +#ifndef _BITS_ERRNO_H +#define _BITS_ERRNO_H 1 -# define EDOM XXX <--- fill in what is actually needed -# define EILSEQ XXX <--- fill in what is actually needed -# define ERANGE XXX <--- fill in what is actually needed +#if !defined _ERRNO_H +# error "Never include <bits/errno.h> directly; use <errno.h> instead." #endif -#ifdef _ERRNO_H -# error "Define here all the missing error messages for the port. These" -# error "must match the numbers of the kernel." -# define Exxxx XXX -... -#endif +#error "Generic bits/errno.h included -- port is incomplete." + +/* Authors of new ports of the GNU C Library must override this file + with their own bits/errno.h in an appropriate subdirectory of + sysdeps/. Its function is to define all of the error constants + from C2011 and POSIX.1-2008, with values appropriate to the + operating system, and any additional OS-specific error constants. + + C2011 requires all error constants to be object-like macros that + expand to "integer constant expressions with type int, positive + values, and suitable for use in #if directives". Moreover, all of + their names must begin with a capital E, followed immediately by + either another capital letter, or a digit. It is OK to define + macros that are not error constants, but only in the implementation + namespace. + + errno.h is sometimes included from assembly language. Therefore, + when __ASSEMBLER__ is defined, bits/errno.h may only define macros; + it may not make any other kind of C declaration or definition. + Also, the error constants should, if at all possible, expand to + simple decimal or hexadecimal numbers. */ + +#endif /* bits/errno.h. */ diff --git a/bits/fcntl.h b/bits/fcntl.h index ff75b3c240..671c9e6877 100644 --- a/bits/fcntl.h +++ b/bits/fcntl.h @@ -1,5 +1,5 @@ /* O_*, F_*, FD_* bit values. 4.4BSD/Generic version. - Copyright (C) 1991-2016 Free Software Foundation, Inc. + Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -63,10 +63,7 @@ #endif #ifdef __USE_MISC -/* Bits in the file status flags returned by F_GETFL. - These are all the O_* flags, plus FREAD and FWRITE, which are - independent bits set by which of O_RDONLY, O_WRONLY, and O_RDWR, was - given to `open'. */ +/* Flags for TIOCFLUSH. */ # define FREAD 1 # define FWRITE 2 diff --git a/bits/fenv.h b/bits/fenv.h index f9b61d5e42..2dbf2abd16 100644 --- a/bits/fenv.h +++ b/bits/fenv.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997-2016 Free Software Foundation, Inc. +/* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -53,3 +53,11 @@ fenv_t; /* If the default argument is used we use this value. */ #define FE_DFL_ENV ((const fenv_t *) -1l) + +#if __GLIBC_USE (IEC_60559_BFP_EXT) +/* Type representing floating-point control modes. */ +typedef unsigned int femode_t; + +/* Default floating-point control modes. */ +# define FE_DFL_MODE ((const femode_t *) -1L) +#endif diff --git a/bits/floatn-common.h b/bits/floatn-common.h new file mode 100644 index 0000000000..1d8958a193 --- /dev/null +++ b/bits/floatn-common.h @@ -0,0 +1,329 @@ +/* Macros to control TS 18661-3 glibc features where the same + definitions are appropriate for all platforms. + Copyright (C) 2017-2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _BITS_FLOATN_COMMON_H +#define _BITS_FLOATN_COMMON_H + +#include <features.h> +#include <bits/long-double.h> + +/* This header should be included at the bottom of each bits/floatn.h. + It defines the following macros for each _FloatN and _FloatNx type, + where the same definitions, or definitions based only on the macros + in bits/floatn.h, are appropriate for all glibc configurations. */ + +/* Defined to 1 if the current compiler invocation provides a + floating-point type with the right format for this type, and this + glibc includes corresponding *fN or *fNx interfaces for it. */ +#define __HAVE_FLOAT16 0 +#define __HAVE_FLOAT32 1 +#define __HAVE_FLOAT64 1 +#define __HAVE_FLOAT32X 1 +#define __HAVE_FLOAT128X 0 + +/* Defined to 1 if the corresponding __HAVE_<type> macro is 1 and the + type is the first with its format in the sequence of (the default + choices for) float, double, long double, _Float16, _Float32, + _Float64, _Float128, _Float32x, _Float64x, _Float128x for this + glibc; that is, if functions present once per floating-point format + rather than once per type are present for this type. + + All configurations supported by glibc have _Float32 the same format + as float, _Float64 and _Float32x the same format as double, the + _Float64x the same format as either long double or _Float128. No + configurations support _Float128x or, as of GCC 7, have compiler + support for a type meeting the requirements for _Float128x. */ +#define __HAVE_DISTINCT_FLOAT16 __HAVE_FLOAT16 +#define __HAVE_DISTINCT_FLOAT32 0 +#define __HAVE_DISTINCT_FLOAT64 0 +#define __HAVE_DISTINCT_FLOAT32X 0 +#define __HAVE_DISTINCT_FLOAT64X 0 +#define __HAVE_DISTINCT_FLOAT128X __HAVE_FLOAT128X + +/* Defined to 1 if the corresponding _FloatN type is not binary compatible + with the corresponding ISO C type in the current compilation unit as + opposed to __HAVE_DISTINCT_FLOATN, which indicates the default types built + in glibc. */ +#define __HAVE_FLOAT128_UNLIKE_LDBL (__HAVE_DISTINCT_FLOAT128 \ + && __LDBL_MANT_DIG__ != 113) + +/* Defined to 1 if any _FloatN or _FloatNx types that are not + ABI-distinct are however distinct types at the C language level (so + for the purposes of __builtin_types_compatible_p and _Generic). */ +#if __GNUC_PREREQ (7, 0) && !defined __cplusplus +# define __HAVE_FLOATN_NOT_TYPEDEF 1 +#else +# define __HAVE_FLOATN_NOT_TYPEDEF 0 +#endif + +#ifndef __ASSEMBLER__ + +/* Defined to concatenate the literal suffix to be used with _FloatN + or _FloatNx types, if __HAVE_<type> is 1. The corresponding + literal suffixes exist since GCC 7, for C only. */ +# if __HAVE_FLOAT16 +# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +/* No corresponding suffix available for this type. */ +# define __f16(x) ((_Float16) x##f) +# else +# define __f16(x) x##f16 +# endif +# endif + +# if __HAVE_FLOAT32 +# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# define __f32(x) x##f +# else +# define __f32(x) x##f32 +# endif +# endif + +# if __HAVE_FLOAT64 +# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# ifdef __NO_LONG_DOUBLE_MATH +# define __f64(x) x##l +# else +# define __f64(x) x +# endif +# else +# define __f64(x) x##f64 +# endif +# endif + +# if __HAVE_FLOAT32X +# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# define __f32x(x) x +# else +# define __f32x(x) x##f32x +# endif +# endif + +# if __HAVE_FLOAT64X +# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# if __HAVE_FLOAT64X_LONG_DOUBLE +# define __f64x(x) x##l +# else +# define __f64x(x) __f128 (x) +# endif +# else +# define __f64x(x) x##f64x +# endif +# endif + +# if __HAVE_FLOAT128X +# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# error "_Float128X supported but no constant suffix" +# else +# define __f128x(x) x##f128x +# endif +# endif + +/* Defined to a complex type if __HAVE_<type> is 1. */ +# if __HAVE_FLOAT16 +# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__))); +# define __CFLOAT16 __cfloat16 +# else +# define __CFLOAT16 _Complex _Float16 +# endif +# endif + +# if __HAVE_FLOAT32 +# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# define __CFLOAT32 _Complex float +# else +# define __CFLOAT32 _Complex _Float32 +# endif +# endif + +# if __HAVE_FLOAT64 +# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# ifdef __NO_LONG_DOUBLE_MATH +# define __CFLOAT64 _Complex long double +# else +# define __CFLOAT64 _Complex double +# endif +# else +# define __CFLOAT64 _Complex _Float64 +# endif +# endif + +# if __HAVE_FLOAT32X +# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# define __CFLOAT32X _Complex double +# else +# define __CFLOAT32X _Complex _Float32x +# endif +# endif + +# if __HAVE_FLOAT64X +# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# if __HAVE_FLOAT64X_LONG_DOUBLE +# define __CFLOAT64X _Complex long double +# else +# define __CFLOAT64X __CFLOAT128 +# endif +# else +# define __CFLOAT64X _Complex _Float64x +# endif +# endif + +# if __HAVE_FLOAT128X +# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# error "_Float128X supported but no complex type" +# else +# define __CFLOAT128X _Complex _Float128x +# endif +# endif + +/* The remaining of this file provides support for older compilers. */ +# if __HAVE_FLOAT16 + +# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +typedef float _Float16 __attribute__ ((__mode__ (__HF__))); +# endif + +# if !__GNUC_PREREQ (7, 0) +# define __builtin_huge_valf16() ((_Float16) __builtin_huge_val ()) +# define __builtin_inff16() ((_Float16) __builtin_inf ()) +# define __builtin_nanf16(x) ((_Float16) __builtin_nan (x)) +# define __builtin_nansf16(x) ((_Float16) __builtin_nans (x)) +# endif + +# endif + +# if __HAVE_FLOAT32 + +# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +typedef float _Float32; +# endif + +# if !__GNUC_PREREQ (7, 0) +# define __builtin_huge_valf32() (__builtin_huge_valf ()) +# define __builtin_inff32() (__builtin_inff ()) +# define __builtin_nanf32(x) (__builtin_nanf (x)) +# define __builtin_nansf32(x) (__builtin_nansf (x)) +# endif + +# endif + +# if __HAVE_FLOAT64 + +/* If double, long double and _Float64 all have the same set of + values, TS 18661-3 requires the usual arithmetic conversions on + long double and _Float64 to produce _Float64. For this to be the + case when building with a compiler without a distinct _Float64 + type, _Float64 must be a typedef for long double, not for + double. */ + +# ifdef __NO_LONG_DOUBLE_MATH + +# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +typedef long double _Float64; +# endif + +# if !__GNUC_PREREQ (7, 0) +# define __builtin_huge_valf64() (__builtin_huge_vall ()) +# define __builtin_inff64() (__builtin_infl ()) +# define __builtin_nanf64(x) (__builtin_nanl (x)) +# define __builtin_nansf64(x) (__builtin_nansl (x)) +# endif + +# else + +# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +typedef double _Float64; +# endif + +# if !__GNUC_PREREQ (7, 0) +# define __builtin_huge_valf64() (__builtin_huge_val ()) +# define __builtin_inff64() (__builtin_inf ()) +# define __builtin_nanf64(x) (__builtin_nan (x)) +# define __builtin_nansf64(x) (__builtin_nans (x)) +# endif + +# endif + +# endif + +# if __HAVE_FLOAT32X + +# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +typedef double _Float32x; +# endif + +# if !__GNUC_PREREQ (7, 0) +# define __builtin_huge_valf32x() (__builtin_huge_val ()) +# define __builtin_inff32x() (__builtin_inf ()) +# define __builtin_nanf32x(x) (__builtin_nan (x)) +# define __builtin_nansf32x(x) (__builtin_nans (x)) +# endif + +# endif + +# if __HAVE_FLOAT64X + +# if __HAVE_FLOAT64X_LONG_DOUBLE + +# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +typedef long double _Float64x; +# endif + +# if !__GNUC_PREREQ (7, 0) +# define __builtin_huge_valf64x() (__builtin_huge_vall ()) +# define __builtin_inff64x() (__builtin_infl ()) +# define __builtin_nanf64x(x) (__builtin_nanl (x)) +# define __builtin_nansf64x(x) (__builtin_nansl (x)) +# endif + +# else + +# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +typedef _Float128 _Float64x; +# endif + +# if !__GNUC_PREREQ (7, 0) +# define __builtin_huge_valf64x() (__builtin_huge_valf128 ()) +# define __builtin_inff64x() (__builtin_inff128 ()) +# define __builtin_nanf64x(x) (__builtin_nanf128 (x)) +# define __builtin_nansf64x(x) (__builtin_nansf128 (x)) +# endif + +# endif + +# endif + +# if __HAVE_FLOAT128X + +# if !__GNUC_PREREQ (7, 0) || defined __cplusplus +# error "_Float128x supported but no type" +# endif + +# if !__GNUC_PREREQ (7, 0) +# define __builtin_huge_valf128x() ((_Float128x) __builtin_huge_val ()) +# define __builtin_inff128x() ((_Float128x) __builtin_inf ()) +# define __builtin_nanf128x(x) ((_Float128x) __builtin_nan (x)) +# define __builtin_nansf128x(x) ((_Float128x) __builtin_nans (x)) +# endif + +# endif + +#endif /* !__ASSEMBLER__. */ + +#endif /* _BITS_FLOATN_COMMON_H */ diff --git a/bits/floatn.h b/bits/floatn.h new file mode 100644 index 0000000000..7baf9acbdf --- /dev/null +++ b/bits/floatn.h @@ -0,0 +1,52 @@ +/* Macros to control TS 18661-3 glibc features. + Copyright (C) 2017-2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +/* Defined to 1 if the current compiler invocation provides a + floating-point type with the IEEE 754 binary128 format, and this glibc + includes corresponding *f128 interfaces for it. */ +#define __HAVE_FLOAT128 0 + +/* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct + from the default float, double and long double types in this glibc. */ +#define __HAVE_DISTINCT_FLOAT128 0 + +/* Defined to 1 if the current compiler invocation provides a + floating-point type with the right format for _Float64x, and this + glibc includes corresponding *f64x interfaces for it. */ +#define __HAVE_FLOAT64X 0 + +/* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format + of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has + the format of _Float128, which must be different from that of long + double. */ +#define __HAVE_FLOAT64X_LONG_DOUBLE 0 + +#ifndef __ASSEMBLER__ + +/* Defined to concatenate the literal suffix to be used with _Float128 + types, if __HAVE_FLOAT128 is 1. + E.g.: #define __f128(x) x##f128. */ +# undef __f128 + +/* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. + E.g.: #define __CFLOAT128 _Complex _Float128. */ +# undef __CFLOAT128 + +#endif /* !__ASSEMBLER__. */ + +#include <bits/floatn-common.h> diff --git a/bits/flt-eval-method.h b/bits/flt-eval-method.h new file mode 100644 index 0000000000..7eed671829 --- /dev/null +++ b/bits/flt-eval-method.h @@ -0,0 +1,42 @@ +/* Define __GLIBC_FLT_EVAL_METHOD. + Copyright (C) 2016-2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _MATH_H +# error "Never use <bits/flt-eval-method.h> directly; include <math.h> instead." +#endif + +/* __GLIBC_FLT_EVAL_METHOD is the value of FLT_EVAL_METHOD used to + determine the evaluation method typedefs such as float_t and + double_t. It must be a value from C11 or TS 18661-3:2015, and not + -1. */ + +/* In the default version of this header, follow __FLT_EVAL_METHOD__. + -1 is mapped to 2 (considering evaluation as long double to be a + conservatively safe assumption), and if __FLT_EVAL_METHOD__ is not + defined then assume there is no excess precision and use the value + 0. */ + +#ifdef __FLT_EVAL_METHOD__ +# if __FLT_EVAL_METHOD__ == -1 +# define __GLIBC_FLT_EVAL_METHOD 2 +# else +# define __GLIBC_FLT_EVAL_METHOD __FLT_EVAL_METHOD__ +# endif +#else +# define __GLIBC_FLT_EVAL_METHOD 0 +#endif diff --git a/bits/fp-fast.h b/bits/fp-fast.h new file mode 100644 index 0000000000..459facc2a8 --- /dev/null +++ b/bits/fp-fast.h @@ -0,0 +1,39 @@ +/* Define FP_FAST_* macros. + Copyright (C) 2016-2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _MATH_H +# error "Never use <bits/fp-fast.h> directly; include <math.h> instead." +#endif + +#ifdef __USE_ISOC99 + +/* The GCC 4.6 compiler will define __FP_FAST_FMA{,F,L} if the fma{,f,l} + builtins are supported. */ +# ifdef __FP_FAST_FMA +# define FP_FAST_FMA 1 +# endif + +# ifdef __FP_FAST_FMAF +# define FP_FAST_FMAF 1 +# endif + +# ifdef __FP_FAST_FMAL +# define FP_FAST_FMAL 1 +# endif + +#endif diff --git a/bits/huge_vall.h b/bits/fp-logb.h index 1886adf600..8b70a10148 100644 --- a/bits/huge_vall.h +++ b/bits/fp-logb.h @@ -1,6 +1,5 @@ -/* Default `HUGE_VALL' constant. - Used by <stdlib.h> and <math.h> functions for overflow. - Copyright (C) 1992-2016 Free Software Foundation, Inc. +/* Define __FP_LOGB0_IS_MIN and __FP_LOGBNAN_IS_MIN. + Copyright (C) 2016-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -18,11 +17,12 @@ <http://www.gnu.org/licenses/>. */ #ifndef _MATH_H -# error "Never use <bits/huge_vall.h> directly; include <math.h> instead." +# error "Never use <bits/fp-logb.h> directly; include <math.h> instead." #endif -#if __GNUC_PREREQ(3,3) -# define HUGE_VALL (__builtin_huge_vall()) -#else -# define HUGE_VALL ((long double) HUGE_VAL) -#endif +/* __FP_LOGB0_IS_MIN is defined to 1 if FP_ILOGB0 is INT_MIN, and 0 if + it is -INT_MAX. __FP_LOGBNAN_IS_MIN is defined to 1 if FP_ILOGBNAN + is INT_MIN, and 0 if it is INT_MAX. */ + +#define __FP_LOGB0_IS_MIN 0 +#define __FP_LOGBNAN_IS_MIN 0 diff --git a/bits/huge_valf.h b/bits/hwcap.h index 4fabc3697b..555b3bc359 100644 --- a/bits/huge_valf.h +++ b/bits/hwcap.h @@ -1,6 +1,5 @@ -/* Stub `HUGE_VALF' constant. - Used by <stdlib.h> and <math.h> functions for overflow. - Copyright (C) 1992-2016 Free Software Foundation, Inc. +/* Defines for bits in AT_HWCAP. + Copyright (C) 2012-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -17,12 +16,8 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#ifndef _MATH_H -# error "Never use <bits/huge_valf.h> directly; include <math.h> instead." +#ifndef _SYS_AUXV_H +# error "Never include <bits/hwcap.h> directly; use <sys/auxv.h> instead." #endif -#if __GNUC_PREREQ(3,3) -# define HUGE_VALF (__builtin_huge_valf()) -#else -# define HUGE_VALF 1e37f -#endif +/* No bits defined for this architecture. */ @@ -1,4 +1,4 @@ -/* Copyright (C) 1997-2016 Free Software Foundation, Inc. +/* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -21,6 +21,9 @@ # error "Never use <bits/in.h> directly; include <netinet/in.h> instead." #endif +/* This is the generic version, do not assume a linux-based kernel. */ +#define __USE_KERNEL_IPV6_DEFS 0 + /* To select the IP level. */ #define SOL_IP 0 @@ -36,11 +39,12 @@ #define IP_RECVDSTADDR 7 /* bool; Receive IP dst addr w/datagram. */ #define IP_RETOPTS 8 /* ip_opts; Set/get IP per-packet options. */ #define IP_MULTICAST_IF 9 /* in_addr; set/get IP multicast i/f */ -#define IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */ -#define IP_MULTICAST_LOOP 11 /* i_char; set/get IP multicast loopback */ +#define IP_MULTICAST_TTL 10 /* unsigned char; set/get IP multicast ttl */ +#define IP_MULTICAST_LOOP 11 /* bool; set/get IP multicast loopback */ #define IP_ADD_MEMBERSHIP 12 /* ip_mreq; add an IP group membership */ #define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */ +#ifdef __USE_MISC /* Structure used to describe IP options for IP_OPTIONS and IP_RETOPTS. The `ip_dst' field is used for the first-hop gateway when using a source route (this gets put into the header proper). */ @@ -49,6 +53,7 @@ struct ip_opts struct in_addr ip_dst; /* First hop; zero without source route. */ char ip_opts[40]; /* Actually variable in size. */ }; +#endif /* Socket-level values for IPv6. */ #define SOL_IPV6 41 @@ -56,17 +61,17 @@ struct ip_opts /* IPV6 socket options. */ #define IPV6_ADDRFORM 1 -#define IPV6_PKTINFO 2 -#define IPV6_HOPOPTS 3 -#define IPV6_DSTOPTS 4 -#define IPV6_RTHDR 5 -#define IPV6_PKTOPTIONS 6 +#define IPV6_2292PKTINFO 2 +#define IPV6_2292HOPOPTS 3 +#define IPV6_2292DSTOPTS 4 +#define IPV6_2292RTHDR 5 +#define IPV6_2292PKTOPTIONS 6 #define IPV6_CHECKSUM 7 -#define IPV6_HOPLIMIT 8 +#define IPV6_2292HOPLIMIT 8 -#define IPV6_RXINFO IPV6_PKTINFO -#define IPV6_TXINFO IPV6_PKTINFO -#define SCM_SRCINFO IPV6_PKTINFO +#define IPV6_RXINFO IPV6_2292PKTINFO +#define IPV6_TXINFO IPV6_RXINFO +#define SCM_SRCINFO IPV6_TXINFO #define SCM_SRCRT IPV6_RXSRCRT #define IPV6_UNICAST_HOPS 16 @@ -83,11 +88,27 @@ struct ip_opts #define IPV6_JOIN_ANYCAST 27 #define IPV6_LEAVE_ANYCAST 28 +/* Advanced API (RFC3542) (1). */ +#define IPV6_RECVPKTINFO 49 +#define IPV6_PKTINFO 50 +#define IPV6_RECVHOPLIMIT 51 +#define IPV6_HOPLIMIT 52 +#define IPV6_RECVHOPOPTS 53 +#define IPV6_HOPOPTS 54 +#define IPV6_RTHDRDSTOPTS 55 +#define IPV6_RECVRTHDR 56 +#define IPV6_RTHDR 57 +#define IPV6_RECVDSTOPTS 58 +#define IPV6_DSTOPTS 59 +#define IPV6_RECVPATHMTU 60 +#define IPV6_PATHMTU 61 +#define IPV6_DONTFRAG 62 + /* Obsolete synonyms for the above. */ #define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP #define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP -#define IPV6_RXHOPOPTS IPV6_HOPOPTS -#define IPV6_RXDSTOPTS IPV6_DSTOPTS +#define IPV6_RXHOPOPTS IPV6_2292HOPOPTS +#define IPV6_RXDSTOPTS IPV6_2292DSTOPTS /* Routing header options for IPv6. */ #define IPV6_RTHDR_LOOSE 0 /* Hop doesn't need to be neighbour. */ diff --git a/bits/indirect-return.h b/bits/indirect-return.h new file mode 100644 index 0000000000..47f6f15a6e --- /dev/null +++ b/bits/indirect-return.h @@ -0,0 +1,25 @@ +/* Definition of __INDIRECT_RETURN. Generic version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _UCONTEXT_H +# error "Never include <bits/indirect-return.h> directly; use <ucontext.h> instead." +#endif + +/* __INDIRECT_RETURN is used on swapcontext to indicate if it requires + special compiler treatment. */ +#define __INDIRECT_RETURN diff --git a/bits/ioctl-types.h b/bits/ioctl-types.h index 51928f9d4c..471d240e63 100644 --- a/bits/ioctl-types.h +++ b/bits/ioctl-types.h @@ -1,5 +1,5 @@ /* Structure types for pre-termios terminal ioctls. Generic Unix version. - Copyright (C) 1996-2016 Free Software Foundation, Inc. + Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/bits/ipc.h b/bits/ipc.h index 1006d0a3e2..ce341bb963 100644 --- a/bits/ipc.h +++ b/bits/ipc.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1995-2016 Free Software Foundation, Inc. +/* Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/bits/ipctypes.h b/bits/ipctypes.h index bf791ce138..1238801680 100644 --- a/bits/ipctypes.h +++ b/bits/ipctypes.h @@ -1,5 +1,5 @@ /* bits/ipctypes.h -- Define some types used by SysV IPC/MSG/SHM. Generic. - Copyright (C) 2002-2016 Free Software Foundation, Inc. + Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/bits/iscanonical.h b/bits/iscanonical.h new file mode 100644 index 0000000000..56934af96c --- /dev/null +++ b/bits/iscanonical.h @@ -0,0 +1,28 @@ +/* Define iscanonical macro. + Copyright (C) 2016-2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _MATH_H +# error "Never use <bits/iscanonical.h> directly; include <math.h> instead." +#endif + +/* Return nonzero value if X is canonical. By default, we only have + IEEE interchange binary formats, in which all values are canonical, + but the argument must still be converted to its semantic type for + any exceptions arising from the conversion, before being + discarded. */ +#define iscanonical(x) ((void) (__typeof (x)) (x), 1) diff --git a/bits/libc-header-start.h b/bits/libc-header-start.h new file mode 100644 index 0000000000..b4a429b83c --- /dev/null +++ b/bits/libc-header-start.h @@ -0,0 +1,70 @@ +/* Handle feature test macros at the start of a header. + Copyright (C) 2016-2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +/* This header is internal to glibc and should not be included outside + of glibc headers. Headers including it must define + __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION first. This header + cannot have multiple include guards because ISO C feature test + macros depend on the definition of the macro when an affected + header is included, not when the first system header is + included. */ + +#ifndef __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION +# error "Never include <bits/libc-header-start.h> directly." +#endif + +#undef __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION + +#include <features.h> + +/* ISO/IEC TR 24731-2:2010 defines the __STDC_WANT_LIB_EXT2__ + macro. */ +#undef __GLIBC_USE_LIB_EXT2 +#if (defined __USE_GNU \ + || (defined __STDC_WANT_LIB_EXT2__ && __STDC_WANT_LIB_EXT2__ > 0)) +# define __GLIBC_USE_LIB_EXT2 1 +#else +# define __GLIBC_USE_LIB_EXT2 0 +#endif + +/* ISO/IEC TS 18661-1:2014 defines the __STDC_WANT_IEC_60559_BFP_EXT__ + macro. */ +#undef __GLIBC_USE_IEC_60559_BFP_EXT +#if defined __USE_GNU || defined __STDC_WANT_IEC_60559_BFP_EXT__ +# define __GLIBC_USE_IEC_60559_BFP_EXT 1 +#else +# define __GLIBC_USE_IEC_60559_BFP_EXT 0 +#endif + +/* ISO/IEC TS 18661-4:2015 defines the + __STDC_WANT_IEC_60559_FUNCS_EXT__ macro. */ +#undef __GLIBC_USE_IEC_60559_FUNCS_EXT +#if defined __USE_GNU || defined __STDC_WANT_IEC_60559_FUNCS_EXT__ +# define __GLIBC_USE_IEC_60559_FUNCS_EXT 1 +#else +# define __GLIBC_USE_IEC_60559_FUNCS_EXT 0 +#endif + +/* ISO/IEC TS 18661-3:2015 defines the + __STDC_WANT_IEC_60559_TYPES_EXT__ macro. */ +#undef __GLIBC_USE_IEC_60559_TYPES_EXT +#if defined __USE_GNU || defined __STDC_WANT_IEC_60559_TYPES_EXT__ +# define __GLIBC_USE_IEC_60559_TYPES_EXT 1 +#else +# define __GLIBC_USE_IEC_60559_TYPES_EXT 0 +#endif diff --git a/bits/libm-simd-decl-stubs.h b/bits/libm-simd-decl-stubs.h index 541cb3f556..520b4bbe43 100644 --- a/bits/libm-simd-decl-stubs.h +++ b/bits/libm-simd-decl-stubs.h @@ -1,5 +1,5 @@ /* Empty definitions required for __MATHCALL_VEC unfolding in mathcalls.h. - Copyright (C) 2014-2016 Free Software Foundation, Inc. + Copyright (C) 2014-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -36,24 +36,66 @@ #define __DECL_SIMD_cos #define __DECL_SIMD_cosf #define __DECL_SIMD_cosl +#define __DECL_SIMD_cosf16 +#define __DECL_SIMD_cosf32 +#define __DECL_SIMD_cosf64 +#define __DECL_SIMD_cosf128 +#define __DECL_SIMD_cosf32x +#define __DECL_SIMD_cosf64x +#define __DECL_SIMD_cosf128x #define __DECL_SIMD_sin #define __DECL_SIMD_sinf #define __DECL_SIMD_sinl +#define __DECL_SIMD_sinf16 +#define __DECL_SIMD_sinf32 +#define __DECL_SIMD_sinf64 +#define __DECL_SIMD_sinf128 +#define __DECL_SIMD_sinf32x +#define __DECL_SIMD_sinf64x +#define __DECL_SIMD_sinf128x #define __DECL_SIMD_sincos #define __DECL_SIMD_sincosf #define __DECL_SIMD_sincosl +#define __DECL_SIMD_sincosf16 +#define __DECL_SIMD_sincosf32 +#define __DECL_SIMD_sincosf64 +#define __DECL_SIMD_sincosf128 +#define __DECL_SIMD_sincosf32x +#define __DECL_SIMD_sincosf64x +#define __DECL_SIMD_sincosf128x #define __DECL_SIMD_log #define __DECL_SIMD_logf #define __DECL_SIMD_logl +#define __DECL_SIMD_logf16 +#define __DECL_SIMD_logf32 +#define __DECL_SIMD_logf64 +#define __DECL_SIMD_logf128 +#define __DECL_SIMD_logf32x +#define __DECL_SIMD_logf64x +#define __DECL_SIMD_logf128x #define __DECL_SIMD_exp #define __DECL_SIMD_expf #define __DECL_SIMD_expl +#define __DECL_SIMD_expf16 +#define __DECL_SIMD_expf32 +#define __DECL_SIMD_expf64 +#define __DECL_SIMD_expf128 +#define __DECL_SIMD_expf32x +#define __DECL_SIMD_expf64x +#define __DECL_SIMD_expf128x #define __DECL_SIMD_pow #define __DECL_SIMD_powf #define __DECL_SIMD_powl +#define __DECL_SIMD_powf16 +#define __DECL_SIMD_powf32 +#define __DECL_SIMD_powf64 +#define __DECL_SIMD_powf128 +#define __DECL_SIMD_powf32x +#define __DECL_SIMD_powf64x +#define __DECL_SIMD_powf128x #endif diff --git a/bits/long-double.h b/bits/long-double.h new file mode 100644 index 0000000000..33b8dfc454 --- /dev/null +++ b/bits/long-double.h @@ -0,0 +1,39 @@ +/* Properties of long double type. + Copyright (C) 2016-2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +/* This header is included by <sys/cdefs.h>. + + If long double is ABI-compatible with double, it should define + __NO_LONG_DOUBLE_MATH to 1; otherwise, it should leave + __NO_LONG_DOUBLE_MATH undefined. + + If this build of the GNU C Library supports both long double + ABI-compatible with double and some other long double format not + ABI-compatible with double, it should define + __LONG_DOUBLE_MATH_OPTIONAL to 1; otherwise, it should leave + __LONG_DOUBLE_MATH_OPTIONAL undefined. + + If __NO_LONG_DOUBLE_MATH is already defined, this header must not + define anything; this is needed to work with the definition of + __NO_LONG_DOUBLE_MATH in nldbl-compat.h. */ + +/* In the default version of this header, long double is + ABI-compatible with double. */ +#ifndef __NO_LONG_DOUBLE_MATH +# define __NO_LONG_DOUBLE_MATH 1 +#endif diff --git a/bits/math-vector.h b/bits/math-vector.h index 975724aca9..318d3eba1f 100644 --- a/bits/math-vector.h +++ b/bits/math-vector.h @@ -1,5 +1,5 @@ /* Platform-specific SIMD declarations of math functions. - Copyright (C) 2014-2016 Free Software Foundation, Inc. + Copyright (C) 2014-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/bits/mathdef.h b/bits/mathdef.h index c5d5f8c0a8..8fbf7e6cbc 100644 --- a/bits/mathdef.h +++ b/bits/mathdef.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997-2016 Free Software Foundation, Inc. +/* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -15,42 +15,6 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#if !defined _MATH_H && !defined _COMPLEX_H -# error "Never use <bits/mathdef.h> directly; include <math.h> instead" -#endif - -#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF -# define _MATH_H_MATHDEF 1 - -/* Normally, there is no long double type and the `float' and `double' - expressions are evaluated as `double'. */ -typedef double float_t; /* `float' expressions are evaluated as - `double'. */ -typedef double double_t; /* `double' expressions are evaluated as - `double'. */ - -/* The values returned by `ilogb' for 0 and NaN respectively. */ -# define FP_ILOGB0 (-2147483647) -# define FP_ILOGBNAN 2147483647 - -/* The GCC 4.6 compiler will define __FP_FAST_FMA{,F,L} if the fma{,f,l} - builtins are supported. */ -#ifdef __FP_FAST_FMA -# define FP_FAST_FMA 1 -#endif - -#ifdef __FP_FAST_FMAF -# define FP_FAST_FMAF 1 -#endif - -#ifdef __FP_FAST_FMAL -# define FP_FAST_FMAL 1 -#endif - -#endif /* ISO C99 */ - -#ifndef __NO_LONG_DOUBLE_MATH -/* Signal that we do not really have a `long double'. The disables the - declaration of all the `long double' function variants. */ -# define __NO_LONG_DOUBLE_MATH 1 +#ifndef _COMPLEX_H +# error "Never use <bits/mathdef.h> directly; include <complex.h> instead" #endif diff --git a/bits/mman-linux.h b/bits/mman-linux.h deleted file mode 100644 index dbb994bf4d..0000000000 --- a/bits/mman-linux.h +++ /dev/null @@ -1,113 +0,0 @@ -/* Definitions for POSIX memory map interface. Linux generic version. - Copyright (C) 2001-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#ifndef _SYS_MMAN_H -# error "Never use <bits/mman-linux.h> directly; include <sys/mman.h> instead." -#endif - -/* The following definitions basically come from the kernel headers. - But the kernel header is not namespace clean. - - This file is also used by some non-Linux configurations of the - GNU C Library, for other systems that use these same bit values. */ - - -/* Protections are chosen from these bits, OR'd together. The - implementation does not necessarily support PROT_EXEC or PROT_WRITE - without PROT_READ. The only guarantees are that no writing will be - allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */ - -#define PROT_READ 0x1 /* Page can be read. */ -#define PROT_WRITE 0x2 /* Page can be written. */ -#define PROT_EXEC 0x4 /* Page can be executed. */ -#define PROT_NONE 0x0 /* Page can not be accessed. */ -#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of - growsdown vma (mprotect only). */ -#define PROT_GROWSUP 0x02000000 /* Extend change to start of - growsup vma (mprotect only). */ - -/* Sharing types (must choose one and only one of these). */ -#define MAP_SHARED 0x01 /* Share changes. */ -#define MAP_PRIVATE 0x02 /* Changes are private. */ -#ifdef __USE_MISC -# define MAP_TYPE 0x0f /* Mask for type of mapping. */ -#endif - -/* Other flags. */ -#define MAP_FIXED 0x10 /* Interpret addr exactly. */ -#ifdef __USE_MISC -# define MAP_FILE 0 -# ifdef __MAP_ANONYMOUS -# define MAP_ANONYMOUS __MAP_ANONYMOUS /* Don't use a file. */ -# else -# define MAP_ANONYMOUS 0x20 /* Don't use a file. */ -# endif -# define MAP_ANON MAP_ANONYMOUS -/* When MAP_HUGETLB is set bits [26:31] encode the log2 of the huge page size. */ -# define MAP_HUGE_SHIFT 26 -# define MAP_HUGE_MASK 0x3f -#endif - -/* Flags to `msync'. */ -#define MS_ASYNC 1 /* Sync memory asynchronously. */ -#define MS_SYNC 4 /* Synchronous memory sync. */ -#define MS_INVALIDATE 2 /* Invalidate the caches. */ - -/* Flags for `mremap'. */ -#ifdef __USE_GNU -# define MREMAP_MAYMOVE 1 -# define MREMAP_FIXED 2 -#endif - -/* Advice to `madvise'. */ -#ifdef __USE_MISC -# define MADV_NORMAL 0 /* No further special treatment. */ -# define MADV_RANDOM 1 /* Expect random page references. */ -# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ -# define MADV_WILLNEED 3 /* Will need these pages. */ -# define MADV_DONTNEED 4 /* Don't need these pages. */ -# define MADV_REMOVE 9 /* Remove these pages and resources. */ -# define MADV_DONTFORK 10 /* Do not inherit across fork. */ -# define MADV_DOFORK 11 /* Do inherit across fork. */ -# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */ -# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */ -# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */ -# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */ -# define MADV_DONTDUMP 16 /* Explicity exclude from the core dump, - overrides the coredump filter bits. */ -# define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */ -# define MADV_HWPOISON 100 /* Poison a page for testing. */ -#endif - -/* The POSIX people had to invent similar names for the same things. */ -#ifdef __USE_XOPEN2K -# define POSIX_MADV_NORMAL 0 /* No further special treatment. */ -# define POSIX_MADV_RANDOM 1 /* Expect random page references. */ -# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */ -# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */ -# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */ -#endif - -/* Flags for `mlockall'. */ -#ifndef MCL_CURRENT -# define MCL_CURRENT 1 /* Lock all currently mapped pages. */ -# define MCL_FUTURE 2 /* Lock all additions to address - space. */ -# define MCL_ONFAULT 4 /* Lock all pages that are - faulted in. */ -#endif diff --git a/bits/mman.h b/bits/mman.h index f773a4350c..e41b84b6dc 100644 --- a/bits/mman.h +++ b/bits/mman.h @@ -1,5 +1,5 @@ /* Definitions for BSD-style memory management. - Copyright (C) 1994-2016 Free Software Foundation, Inc. + Copyright (C) 1994-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/bits/mqueue.h b/bits/mqueue.h index 0b5f015fbb..5521569895 100644 --- a/bits/mqueue.h +++ b/bits/mqueue.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2016 Free Software Foundation, Inc. +/* Copyright (C) 2004-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/bits/msq.h b/bits/msq.h index 4f13fae4a9..2204aa0a2e 100644 --- a/bits/msq.h +++ b/bits/msq.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1995-2016 Free Software Foundation, Inc. +/* Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/bits/nan.h b/bits/nan.h deleted file mode 100644 index ab38168ea4..0000000000 --- a/bits/nan.h +++ /dev/null @@ -1,5 +0,0 @@ -#ifndef _MATH_H -#error "Never use <bits/nan.h> directly; include <math.h> instead." -#endif - -/* This file should define `NAN' on machines that have such things. */ diff --git a/bits/netdb.h b/bits/netdb.h index 3cd0db34b7..dcac8543d9 100644 --- a/bits/netdb.h +++ b/bits/netdb.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2016 Free Software Foundation, Inc. +/* Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/bits/param.h b/bits/param.h index 3e9f830b51..3e81803669 100644 --- a/bits/param.h +++ b/bits/param.h @@ -1,5 +1,5 @@ /* Old-style Unix parameters and limits. Stub version. - Copyright (C) 1995-2016 Free Software Foundation, Inc. + Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/bits/poll.h b/bits/poll.h index ad808a372e..22ef926a4b 100644 --- a/bits/poll.h +++ b/bits/poll.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997-2016 Free Software Foundation, Inc. +/* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/bits/resource.h b/bits/resource.h index 7d2d66c7c9..7693d20fed 100644 --- a/bits/resource.h +++ b/bits/resource.h @@ -1,5 +1,5 @@ /* Bit values & structures for resource limits. 4.4 BSD/generic GNU version. - Copyright (C) 1994-2016 Free Software Foundation, Inc. + Copyright (C) 1994-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -86,6 +86,10 @@ enum __rlimit_resource # define RLIM64_INFINITY 0x7fffffffffffffffLL #endif +/* We can represent all limits. */ +#define RLIM_SAVED_MAX RLIM_INFINITY +#define RLIM_SAVED_CUR RLIM_INFINITY + /* Type for resource quantity measurement. */ #ifndef __USE_FILE_OFFSET64 @@ -129,51 +133,8 @@ enum __rusage_who #define RUSAGE_CHILDREN RUSAGE_CHILDREN }; -#define __need_timeval -#include <bits/time.h> /* For `struct timeval'. */ - -/* Structure which says how much of each resource has been used. */ -struct rusage - { - /* Total amount of user time used. */ - struct timeval ru_utime; - /* Total amount of system time used. */ - struct timeval ru_stime; - /* Maximum resident set size (in kilobytes). */ - long int ru_maxrss; - /* Amount of sharing of text segment memory - with other processes (kilobyte-seconds). */ - long int ru_ixrss; - /* Amount of data segment memory used (kilobyte-seconds). */ - long int ru_idrss; - /* Amount of stack memory used (kilobyte-seconds). */ - long int ru_isrss; - /* Number of soft page faults (i.e. those serviced by reclaiming - a page from the list of pages awaiting reallocation. */ - long int ru_minflt; - /* Number of hard page faults (i.e. those that required I/O). */ - long int ru_majflt; - /* Number of times a process was swapped out of physical memory. */ - long int ru_nswap; - /* Number of input operations via the file system. Note: This - and `ru_oublock' do not include operations with the cache. */ - long int ru_inblock; - /* Number of output operations via the file system. */ - long int ru_oublock; - /* Number of IPC messages sent. */ - long int ru_msgsnd; - /* Number of IPC messages received. */ - long int ru_msgrcv; - /* Number of signals delivered. */ - long int ru_nsignals; - /* Number of voluntary context switches, i.e. because the process - gave up the process before it had to (usually to wait for some - resource to be available). */ - long int ru_nvcsw; - /* Number of involuntary context switches, i.e. a higher priority process - became runnable or the current process used up its time slice. */ - long int ru_nivcsw; - }; +#include <bits/types/struct_timeval.h> +#include <bits/types/struct_rusage.h> /* Priority limits. */ #define PRIO_MIN -20 /* Minimum priority a process can have. */ diff --git a/bits/sched.h b/bits/sched.h index ca105696a1..bdd94c969d 100644 --- a/bits/sched.h +++ b/bits/sched.h @@ -1,6 +1,6 @@ /* Definitions of constants and data structure for POSIX 1003.1b-1993 scheduling interface. - Copyright (C) 1996-2016 Free Software Foundation, Inc. + Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -17,135 +17,18 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#ifndef __need_schedparam +#ifndef _BITS_SCHED_H +#define _BITS_SCHED_H 1 #ifndef _SCHED_H # error "Never include <bits/sched.h> directly; use <sched.h> instead." #endif - /* Scheduling algorithms. */ #define SCHED_OTHER 0 #define SCHED_FIFO 1 #define SCHED_RR 2 -/* Data structure to describe a process' schedulability. */ -struct sched_param -{ - int __sched_priority; -}; - -#endif /* need schedparam */ - -#if !defined __defined_schedparam \ - && (defined __need_schedparam || defined _SCHED_H) -# define __defined_schedparam 1 -/* Data structure to describe a process' schedulability. */ -struct __sched_param - { - int __sched_priority; - }; -# undef __need_schedparam -#endif - - -#if defined _SCHED_H && !defined __cpu_set_t_defined -# define __cpu_set_t_defined -/* Size definition for CPU sets. */ -# define __CPU_SETSIZE 1024 -# define __NCPUBITS (8 * sizeof (__cpu_mask)) - -/* Type for array elements in 'cpu_set_t'. */ -typedef unsigned long int __cpu_mask; - -/* Basic access functions. */ -# define __CPUELT(cpu) ((cpu) / __NCPUBITS) -# define __CPUMASK(cpu) ((__cpu_mask) 1 << ((cpu) % __NCPUBITS)) - -/* Data structure to describe CPU mask. */ -typedef struct -{ - __cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS]; -} cpu_set_t; +#include <bits/types/struct_sched_param.h> -/* Access functions for CPU masks. */ -# if __GNUC_PREREQ (2, 91) -# define __CPU_ZERO_S(setsize, cpusetp) \ - do __builtin_memset (cpusetp, '\0', setsize); while (0) -# else -# define __CPU_ZERO_S(setsize, cpusetp) \ - do { \ - size_t __i; \ - size_t __imax = (setsize) / sizeof (__cpu_mask); \ - __cpu_mask *__bits = (cpusetp)->__bits; \ - for (__i = 0; __i < __imax; ++__i) \ - __bits[__i] = 0; \ - } while (0) -# endif -# define __CPU_SET_S(cpu, setsize, cpusetp) \ - (__extension__ \ - ({ size_t __cpu = (cpu); \ - __cpu < 8 * (setsize) \ - ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \ - |= __CPUMASK (__cpu)) \ - : 0; })) -# define __CPU_CLR_S(cpu, setsize, cpusetp) \ - (__extension__ \ - ({ size_t __cpu = (cpu); \ - __cpu < 8 * (setsize) \ - ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \ - &= ~__CPUMASK (__cpu)) \ - : 0; })) -# define __CPU_ISSET_S(cpu, setsize, cpusetp) \ - (__extension__ \ - ({ size_t __cpu = (cpu); \ - __cpu < 8 * (setsize) \ - ? ((((const __cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \ - & __CPUMASK (__cpu))) != 0 \ - : 0; })) - -# define __CPU_COUNT_S(setsize, cpusetp) \ - __sched_cpucount (setsize, cpusetp) - -# if __GNUC_PREREQ (2, 91) -# define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \ - (__builtin_memcmp (cpusetp1, cpusetp2, setsize) == 0) -# else -# define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \ - (__extension__ \ - ({ const __cpu_mask *__arr1 = (cpusetp1)->__bits; \ - const __cpu_mask *__arr2 = (cpusetp2)->__bits; \ - size_t __imax = (setsize) / sizeof (__cpu_mask); \ - size_t __i; \ - for (__i = 0; __i < __imax; ++__i) \ - if (__arr1[__i] != __arr2[__i]) \ - break; \ - __i == __imax; })) -# endif - -# define __CPU_OP_S(setsize, destset, srcset1, srcset2, op) \ - (__extension__ \ - ({ cpu_set_t *__dest = (destset); \ - const __cpu_mask *__arr1 = (srcset1)->__bits; \ - const __cpu_mask *__arr2 = (srcset2)->__bits; \ - size_t __imax = (setsize) / sizeof (__cpu_mask); \ - size_t __i; \ - for (__i = 0; __i < __imax; ++__i) \ - ((__cpu_mask *) __dest->__bits)[__i] = __arr1[__i] op __arr2[__i]; \ - __dest; })) - -# define __CPU_ALLOC_SIZE(count) \ - ((((count) + __NCPUBITS - 1) / __NCPUBITS) * sizeof (__cpu_mask)) -# define __CPU_ALLOC(count) __sched_cpualloc (count) -# define __CPU_FREE(cpuset) __sched_cpufree (cpuset) - -__BEGIN_DECLS - -extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp) - __THROW; -extern cpu_set_t *__sched_cpualloc (size_t __count) __THROW __wur; -extern void __sched_cpufree (cpu_set_t *__set) __THROW; - -__END_DECLS - -#endif +#endif /* bits/sched.h */ diff --git a/bits/select.h b/bits/select.h index 6a93c3d02c..371c5c15cd 100644 --- a/bits/select.h +++ b/bits/select.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997-2016 Free Software Foundation, Inc. +/* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/bits/sem.h b/bits/sem.h index 9caa99aae5..232555a4af 100644 --- a/bits/sem.h +++ b/bits/sem.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1995-2016 Free Software Foundation, Inc. +/* Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/bits/shm.h b/bits/shm.h index 37ddbdab26..b739090105 100644 --- a/bits/shm.h +++ b/bits/shm.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1995-2016 Free Software Foundation, Inc. +/* Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -44,7 +44,7 @@ typedef unsigned short int shmatt_t; struct shmid_ds { struct ipc_perm shm_perm; /* operation permission struct */ - int shm_segsz; /* size of segment in bytes */ + size_t shm_segsz; /* size of segment in bytes */ __time_t shm_atime; /* time of last shmat() */ __time_t shm_dtime; /* time of last shmdt() */ __time_t shm_ctime; /* time of last change by shmctl() */ diff --git a/bits/sigaction.h b/bits/sigaction.h index 40abaaa111..7797017c29 100644 --- a/bits/sigaction.h +++ b/bits/sigaction.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2016 Free Software Foundation, Inc. +/* Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -15,6 +15,9 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ +#ifndef _BITS_SIGACTION_H +#define _BITS_SIGACTION_H 1 + #ifndef _SIGNAL_H # error "Never include <bits/sigaction.h> directly; use <signal.h> instead." #endif @@ -29,7 +32,7 @@ struct sigaction { /* Signal handler. */ -#ifdef __USE_POSIX199309 +#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED union { /* Used if SA_SIGINFO is not set. */ @@ -52,10 +55,10 @@ struct sigaction }; /* Bits in `sa_flags'. */ -#if defined __USE_UNIX98 || defined __USE_MISC +#if defined __USE_XOPEN_EXTENDED || defined __USE_MISC # define SA_ONSTACK 0x0001 /* Take signal on signal stack. */ #endif -#if defined __USE_UNIX98 || defined __USE_XOPEN2K8 +#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 # define SA_RESTART 0x0002 /* Restart syscall on signal return. */ # define SA_NODEFER 0x0010 /* Don't automatically block the signal when its handler is being executed. */ @@ -77,3 +80,5 @@ struct sigaction #define SIG_BLOCK 1 /* Block signals. */ #define SIG_UNBLOCK 2 /* Unblock signals. */ #define SIG_SETMASK 3 /* Set the set of blocked signals. */ + +#endif diff --git a/bits/sigcontext.h b/bits/sigcontext.h index 85b2a96d9f..5d4a7f5e73 100644 --- a/bits/sigcontext.h +++ b/bits/sigcontext.h @@ -1,5 +1,5 @@ /* Structure describing state saved while handling a signal. Stub version. - Copyright (C) 1991-2016 Free Software Foundation, Inc. + Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,10 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#ifndef _SIGNAL_H +#ifndef _BITS_SIGCONTEXT_H +#define _BITS_SIGCONTEXT_H 1 + +#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H # error "Never use <bits/sigcontext.h> directly; include <signal.h> instead." #endif @@ -30,3 +33,5 @@ struct sigcontext }; /* Signal subcodes should be defined here. */ + +#endif /* bits/sigcontext.h */ diff --git a/bits/byteswap-16.h b/bits/sigevent-consts.h index 8063aa82da..4cf9f6c0d3 100644 --- a/bits/byteswap-16.h +++ b/bits/sigevent-consts.h @@ -1,5 +1,5 @@ -/* Macros to swap the order of bytes in 16-bit integer values. - Copyright (C) 2012-2016 Free Software Foundation, Inc. +/* sigevent constants. Stub version. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,19 +16,22 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#ifndef _BITS_BYTESWAP_H -# error "Never use <bits/byteswap-16.h> directly; include <byteswap.h> instead." +#ifndef _BITS_SIGEVENT_CONSTS_H +#define _BITS_SIGEVENT_CONSTS_H 1 + +#if !defined _SIGNAL_H && !defined _AIO_H +#error "Don't include <bits/sigevent-consts.h> directly; use <signal.h> instead." #endif -#ifdef __GNUC__ -# define __bswap_16(x) \ - (__extension__ \ - ({ unsigned short int __bsx = (unsigned short int) (x); \ - __bswap_constant_16 (__bsx); })) -#else -static __inline unsigned short int -__bswap_16 (unsigned short int __bsx) +/* `sigev_notify' values. */ +enum { - return __bswap_constant_16 (__bsx); -} + SIGEV_SIGNAL = 0, /* Notify via signal. */ +# define SIGEV_SIGNAL SIGEV_SIGNAL + SIGEV_NONE, /* Other notification: meaningless. */ +# define SIGEV_NONE SIGEV_NONE + SIGEV_THREAD /* Deliver via thread creation. */ +# define SIGEV_THREAD SIGEV_THREAD +}; + #endif diff --git a/bits/siginfo.h b/bits/siginfo-consts.h index 7cb8055417..7464c1882b 100644 --- a/bits/siginfo.h +++ b/bits/siginfo-consts.h @@ -1,5 +1,5 @@ -/* siginfo_t, sigevent and constants. Stub version. - Copyright (C) 1997-2016 Free Software Foundation, Inc. +/* siginfo_t constants. Stub version. + Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,42 +16,8 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#if !defined _SIGNAL_H && !defined __need_siginfo_t \ - && !defined __need_sigevent_t -# error "Never include this file directly. Use <signal.h> instead" -#endif - -#if (!defined __have_sigval_t \ - && (defined _SIGNAL_H || defined __need_siginfo_t \ - || defined __need_sigevent_t)) -# define __have_sigval_t 1 - -/* Type for data associated with a signal. */ -typedef union sigval - { - int sival_int; - void *sival_ptr; - } sigval_t; -#endif - -#if (!defined __have_siginfo_t \ - && (defined _SIGNAL_H || defined __need_siginfo_t)) -# define __have_siginfo_t 1 - -typedef struct siginfo - { - int si_signo; /* Signal number. */ - int si_errno; /* If non-zero, an errno value associated with - this signal, as defined in <errno.h>. */ - int si_code; /* Signal code. */ - __pid_t si_pid; /* Sending process ID. */ - __uid_t si_uid; /* Real user ID of sending process. */ - void *si_addr; /* Address of faulting instruction. */ - int si_status; /* Exit value or signal. */ - long int si_band; /* Band event for SIGPOLL. */ - union sigval si_value; /* Signal value. */ - } siginfo_t; - +#ifndef _BITS_SIGINFO_CONSTS_H +#define _BITS_SIGINFO_CONSTS_H 1 /* Values for `si_code'. Positive values are reserved for kernel-generated signals. */ @@ -181,36 +147,4 @@ enum }; # endif -# undef __need_siginfo_t -#endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */ - - -#if (defined _SIGNAL_H || defined __need_sigevent_t) \ - && !defined __have_sigevent_t -# define __have_sigevent_t 1 - -/* Structure to transport application-defined values with signals. */ -# define SIGEV_MAX_SIZE 64 -# define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE / sizeof (int)) - 3) - -typedef struct sigevent - { - sigval_t sigev_value; - int sigev_signo; - int sigev_notify; - void (*sigev_notify_function) (sigval_t); /* Function to start. */ - void *sigev_notify_attributes; /* Really pthread_attr_t.*/ - } sigevent_t; - -/* `sigev_notify' values. */ -enum -{ - SIGEV_SIGNAL = 0, /* Notify via signal. */ -# define SIGEV_SIGNAL SIGEV_SIGNAL - SIGEV_NONE, /* Other notification: meaningless. */ -# define SIGEV_NONE SIGEV_NONE - SIGEV_THREAD /* Deliver via thread creation. */ -# define SIGEV_THREAD SIGEV_THREAD -}; - -#endif /* have _SIGNAL_H. */ +#endif diff --git a/bits/signum-generic.h b/bits/signum-generic.h new file mode 100644 index 0000000000..8f1044a144 --- /dev/null +++ b/bits/signum-generic.h @@ -0,0 +1,102 @@ +/* Signal number constants. Generic template. + Copyright (C) 1991-2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _BITS_SIGNUM_GENERIC_H +#define _BITS_SIGNUM_GENERIC_H 1 + +#ifndef _SIGNAL_H +#error "Never include <bits/signum-generic.h> directly; use <signal.h> instead." +#endif + +/* Fake signal functions. */ + +#define SIG_ERR ((__sighandler_t) -1) /* Error return. */ +#define SIG_DFL ((__sighandler_t) 0) /* Default action. */ +#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ + +#ifdef __USE_XOPEN +# define SIG_HOLD ((__sighandler_t) 2) /* Add signal to hold mask. */ +#endif + +/* We define here all the signal names listed in POSIX (1003.1-2008); + as of 1003.1-2013, no additional signals have been added by POSIX. + We also define here signal names that historically exist in every + real-world POSIX variant (e.g. SIGWINCH). + + Signals in the 1-15 range are defined with their historical numbers. + For other signals, we use the BSD numbers. + There are two unallocated signal numbers in the 1-31 range: 7 and 29. + Signal number 0 is reserved for use as kill(pid, 0), to test whether + a process exists without sending it a signal. */ + +/* ISO C99 signals. */ +#define SIGINT 2 /* Interactive attention signal. */ +#define SIGILL 4 /* Illegal instruction. */ +#define SIGABRT 6 /* Abnormal termination. */ +#define SIGFPE 8 /* Erroneous arithmetic operation. */ +#define SIGSEGV 11 /* Invalid access to storage. */ +#define SIGTERM 15 /* Termination request. */ + +/* Historical signals specified by POSIX. */ +#define SIGHUP 1 /* Hangup. */ +#define SIGQUIT 3 /* Quit. */ +#define SIGTRAP 5 /* Trace/breakpoint trap. */ +#define SIGKILL 9 /* Killed. */ +#define SIGBUS 10 /* Bus error. */ +#define SIGSYS 12 /* Bad system call. */ +#define SIGPIPE 13 /* Broken pipe. */ +#define SIGALRM 14 /* Alarm clock. */ + +/* New(er) POSIX signals (1003.1-2008, 1003.1-2013). */ +#define SIGURG 16 /* Urgent data is available at a socket. */ +#define SIGSTOP 17 /* Stop, unblockable. */ +#define SIGTSTP 18 /* Keyboard stop. */ +#define SIGCONT 19 /* Continue. */ +#define SIGCHLD 20 /* Child terminated or stopped. */ +#define SIGTTIN 21 /* Background read from control terminal. */ +#define SIGTTOU 22 /* Background write to control terminal. */ +#define SIGPOLL 23 /* Pollable event occurred (System V). */ +#define SIGXCPU 24 /* CPU time limit exceeded. */ +#define SIGXFSZ 25 /* File size limit exceeded. */ +#define SIGVTALRM 26 /* Virtual timer expired. */ +#define SIGPROF 27 /* Profiling timer expired. */ +#define SIGUSR1 30 /* User-defined signal 1. */ +#define SIGUSR2 31 /* User-defined signal 2. */ + +/* Nonstandard signals found in all modern POSIX systems + (including both BSD and Linux). */ +#define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */ + +/* Archaic names for compatibility. */ +#define SIGIO SIGPOLL /* I/O now possible (4.2 BSD). */ +#define SIGIOT SIGABRT /* IOT instruction, abort() on a PDP-11. */ +#define SIGCLD SIGCHLD /* Old System V name */ + +/* Not all systems support real-time signals. bits/signum.h indicates + that they are supported by overriding __SIGRTMAX to a value greater + than __SIGRTMIN. These constants give the kernel-level hard limits, + but some real-time signals may be used internally by glibc. Do not + use these constants in application code; use SIGRTMIN and SIGRTMAX + (defined in signal.h) instead. */ +#define __SIGRTMIN 32 +#define __SIGRTMAX __SIGRTMIN + +/* Biggest signal number + 1 (including real-time signals). */ +#define _NSIG (__SIGRTMAX + 1) + +#endif /* bits/signum-generic.h. */ diff --git a/bits/signum.h b/bits/signum.h index 9fccd9c70c..bd9fe29cff 100644 --- a/bits/signum.h +++ b/bits/signum.h @@ -1,5 +1,5 @@ /* Signal number constants. Generic version. - Copyright (C) 1991-2016 Free Software Foundation, Inc. + Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,69 +16,17 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#ifdef _SIGNAL_H +#ifndef _BITS_SIGNUM_H +#define _BITS_SIGNUM_H 1 -/* Fake signal functions. */ - -#define SIG_ERR ((__sighandler_t) -1) /* Error return. */ -#define SIG_DFL ((__sighandler_t) 0) /* Default action. */ -#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ - -#ifdef __USE_UNIX98 -# define SIG_HOLD ((__sighandler_t) 2) /* Add signal to hold mask. */ +#ifndef _SIGNAL_H +#error "Never include <bits/signum.h> directly; use <signal.h> instead." #endif -/* We define here all the signal names listed in POSIX (1003.1-2008); - as of 1003.1-2013, no additional signals have been added by POSIX. - We also define here signal names that historically exist in every - real-world POSIX variant (e.g. SIGWINCH). - - Signals in the 1-15 range are defined with their historical numbers. - For other signals, we use the BSD numbers. */ - -/* ISO C99 signals. */ -#define SIGINT 2 /* Interactive attention signal. */ -#define SIGILL 4 /* Illegal instruction. */ -#define SIGABRT 6 /* Abnormal termination. */ -#define SIGFPE 8 /* Erroneous arithmetic operation. */ -#define SIGSEGV 11 /* Invalid access to storage. */ -#define SIGTERM 15 /* Termination request. */ - -/* Historical signals specified by POSIX. */ -#define SIGHUP 1 /* Hangup. */ -#define SIGQUIT 3 /* Quit. */ -#define SIGTRAP 5 /* Trace/breakpoint trap. */ -#define SIGKILL 9 /* Killed. */ -#define SIGBUS 10 /* Bus error. */ -#define SIGSYS 12 /* Bad system call. */ -#define SIGPIPE 13 /* Broken pipe. */ -#define SIGALRM 14 /* Alarm clock. */ - -/* New(er) POSIX signals (1003.1-2008, 1003.1-2013). */ -#define SIGURG 16 /* High bandwidth data is available at a socket. */ -#define SIGSTOP 17 /* Stopped (signal). */ -#define SIGTSTP 18 /* Stopped. */ -#define SIGCONT 19 /* Continued. */ -#define SIGCHLD 20 /* Child terminated or stopped. */ -#define SIGTTIN 21 /* Background read from control terminal. */ -#define SIGTTOU 22 /* Background write to control terminal. */ -#define SIGPOLL 23 /* Pollable event occurred (System V). */ -#define SIGIO SIGPOLL /* I/O now possible (4.2 BSD). */ -#define SIGXCPU 24 /* CPU time limit exceeded. */ -#define SIGXFSZ 25 /* File size limit exceeded. */ -#define SIGVTALRM 26 /* Virtual timer expired. */ -#define SIGPROF 27 /* Profiling timer expired. */ -#define SIGUSR1 30 /* User-defined signal 1. */ -#define SIGUSR2 31 /* User-defined signal 2. */ - -/* Nonstandard signals found in all modern POSIX systems - (including both BSD and Linux). */ -#define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */ - -#define _NSIG 32 +#include <bits/signum-generic.h> -/* Archaic names for compatibility. */ -#define SIGIOT SIGABRT /* IOT instruction, abort() on a PDP-11. */ -#define SIGCLD SIGCHLD /* Old System V name */ +/* This operating system does not need to override any of the generic + signal number assignments in bits/signum-generic.h, nor to add any + additional signal constants. */ -#endif /* <signal.h> included. */ +#endif /* bits/signum.h. */ diff --git a/bits/sigset.h b/bits/sigset.h deleted file mode 100644 index 7da345e578..0000000000 --- a/bits/sigset.h +++ /dev/null @@ -1,84 +0,0 @@ -/* __sig_atomic_t, __sigset_t, and related definitions. Generic/BSD version. - Copyright (C) 1991-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#ifndef _SIGSET_H_types -#define _SIGSET_H_types 1 - -typedef int __sig_atomic_t; - -/* A `sigset_t' has a bit for each signal. */ -typedef unsigned long int __sigset_t; - -#endif - - -/* We only want to define these functions if <signal.h> was actually - included; otherwise we were included just to define the types. Since we - are namespace-clean, it wouldn't hurt to define extra macros. But - trouble can be caused by functions being defined (e.g., any global - register vars declared later will cause compilation errors). */ - -#if !defined _SIGSET_H_fns && defined _SIGNAL_H -#define _SIGSET_H_fns 1 - -#ifndef _EXTERN_INLINE -# define _EXTERN_INLINE __extern_inline -#endif - -/* Return a mask that includes SIG only. The cast to `sigset_t' avoids - overflow if `sigset_t' is wider than `int'. */ -#define __sigmask(sig) (((__sigset_t) 1) << ((sig) - 1)) - -#define __sigemptyset(set) \ - (__extension__ ({ *(set) = (__sigset_t) 0; 0; }) -#define __sigfillset(set) \ - (__extension__ ({ *(set) = ~(__sigset_t) 0; 0; })) - -#ifdef _GNU_SOURCE -# define __sigisemptyset(set) (*(set) == (__sigset_t) 0) -# define __sigandset(dest, left, right) \ - (__extension__ ({ *(dest) = *(left) & *(right); 0; })) -# define __sigorset(dest, left, right) \ - (__extension__ ({ *(dest) = *(left) | *(right); 0; })) -#endif - -/* These functions needn't check for a bogus signal number -- error - checking is done in the non __ versions. */ - -extern int __sigismember (const __sigset_t *, int); -extern int __sigaddset (__sigset_t *, int); -extern int __sigdelset (__sigset_t *, int); - -#ifdef __USE_EXTERN_INLINES -# define __SIGSETFN(NAME, BODY, CONST) \ - _EXTERN_INLINE int \ - NAME (CONST __sigset_t *__set, int __sig) \ - { \ - __sigset_t __mask = __sigmask (__sig); \ - return BODY; \ - } - -__SIGSETFN (__sigismember, (*__set & __mask) ? 1 : 0, const) -__SIGSETFN (__sigaddset, ((*__set |= __mask), 0), ) -__SIGSETFN (__sigdelset, ((*__set &= ~__mask), 0), ) - -# undef __SIGSETFN -#endif - - -#endif /* ! _SIGSET_H_fns. */ diff --git a/bits/sigstack.h b/bits/sigstack.h index b4b911e7d1..d3bcbd48e6 100644 --- a/bits/sigstack.h +++ b/bits/sigstack.h @@ -1,5 +1,5 @@ /* sigstack, sigaltstack definitions. - Copyright (C) 1998-2016 Free Software Foundation, Inc. + Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,39 +16,17 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#ifndef _SIGNAL_H +#ifndef _BITS_SIGSTACK_H +#define _BITS_SIGSTACK_H 1 + +#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H # error "Never include this file directly. Use <signal.h> instead" #endif - -/* Structure describing a signal stack (obsolete). */ -struct sigstack - { - __ptr_t ss_sp; /* Signal stack pointer. */ - int ss_onstack; /* Nonzero if executing on this stack. */ - }; - - -/* Alternate, preferred interface. */ -typedef struct sigaltstack - { - __ptr_t ss_sp; - size_t ss_size; - int ss_flags; - } stack_t; - - -/* Possible values for `ss_flags.'. */ -enum -{ - SS_ONSTACK = 0x0001, -#define SS_ONSTACK SS_ONSTACK - SS_DISABLE = 0x0004 -#define SS_DISABLE SS_DISABLE -}; - /* Minumum stack size for a signal handler. */ #define MINSIGSTKSZ 8192 /* System default stack size. */ #define SIGSTKSZ (MINSIGSTKSZ + 32768) + +#endif /* bits/sigstack.h */ diff --git a/bits/sigthread.h b/bits/sigthread.h index 5c05211a51..004d8837a3 100644 --- a/bits/sigthread.h +++ b/bits/sigthread.h @@ -1,5 +1,5 @@ /* Signal handling function for threaded programs. Generic version. - Copyright (C) 2000-2016 Free Software Foundation, Inc. + Copyright (C) 2000-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -20,7 +20,7 @@ #define _BITS_SIGTHREAD_H 1 #if !defined _SIGNAL_H && !defined _PTHREAD_H -# error "Never include this file directly. Use <pthread.h> instead" +# error "Never include this file directly. Use <signal.h> instead" #endif /* Modify the signal mask for the calling thread. The arguments have the diff --git a/bits/sockaddr.h b/bits/sockaddr.h index e91f837954..edf36c2855 100644 --- a/bits/sockaddr.h +++ b/bits/sockaddr.h @@ -1,5 +1,5 @@ -/* Definition of `struct sockaddr_*' common members. Generic/4.2 BSD version. - Copyright (C) 1995-2016 Free Software Foundation, Inc. +/* Definition of struct sockaddr_* common members and sizes, generic version. + Copyright (C) 1995-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -36,4 +36,7 @@ typedef unsigned short int sa_family_t; #define __SOCKADDR_COMMON_SIZE (sizeof (unsigned short int)) +/* Size of struct sockaddr_storage. */ +#define _SS_SIZE 128 + #endif /* bits/sockaddr.h */ diff --git a/bits/socket.h b/bits/socket.h index ab9f242cf0..725798882e 100644 --- a/bits/socket.h +++ b/bits/socket.h @@ -1,5 +1,5 @@ /* System-specific socket constants and types. 4.4 BSD version. - Copyright (C) 1991-2016 Free Software Foundation, Inc. + Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -24,10 +24,9 @@ #endif #define __need_size_t -#define __need_NULL #include <stddef.h> -#include <limits.h> /* XXX Is this allowed? */ +#include <bits/wordsize.h> #include <bits/types.h> /* Type for length arguments in socket calls. */ @@ -127,13 +126,19 @@ enum __socket_type #define AF_APPLETALK PF_APPLETALK #define AF_ROUTE PF_ROUTE #define AF_LINK PF_LINK -#define pseudo_AF_XTP PF_XTP +#ifdef __USE_MISC +# define pseudo_AF_XTP PF_XTP +#endif #define AF_COIP PF_COIP #define AF_CNT PF_CNT -#define pseudo_AF_RTIP PF_RTIP +#ifdef __USE_MISC +# define pseudo_AF_RTIP PF_RTIP +#endif #define AF_IPX PF_IPX #define AF_SIP PF_SIP -#define pseudo_AF_PIP PF_PIP +#ifdef __USE_MISC +# define pseudo_AF_PIP PF_PIP +#endif #define AF_INET6 PF_INET6 #define AF_MAX PF_MAX @@ -152,20 +157,20 @@ struct sockaddr /* Structure large enough to hold any socket address (with the historical - exception of AF_UNIX). We reserve 128 bytes. */ -#if ULONG_MAX > 0xffffffff + exception of AF_UNIX). */ +#if __WORDSIZE == 64 # define __ss_aligntype __uint64_t #else # define __ss_aligntype __uint32_t #endif -#define _SS_SIZE 128 -#define _SS_PADSIZE (_SS_SIZE - (2 * sizeof (__ss_aligntype))) +#define _SS_PADSIZE \ + (_SS_SIZE - __SOCKADDR_COMMON_SIZE - sizeof (__ss_aligntype)) struct sockaddr_storage { __SOCKADDR_COMMON (ss_); /* Address family, etc. */ - __ss_aligntype __ss_align; /* Force desired alignment. */ char __ss_padding[_SS_PADSIZE]; + __ss_aligntype __ss_align; /* Force desired alignment. */ }; @@ -216,13 +221,13 @@ struct cmsghdr of cmsghdr structure. */ int cmsg_level; /* Originating protocol. */ int cmsg_type; /* Protocol specific type. */ -#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L +#if __glibc_c99_flexarr_available __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */ #endif }; /* Ancillary data object manipulation macros. */ -#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L +#if __glibc_c99_flexarr_available # define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data) #else # define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1)) @@ -232,7 +237,7 @@ struct cmsghdr #define CMSG_FIRSTHDR(mhdr) \ ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \ - ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL) + ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) 0) #define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \ & (size_t) ~(sizeof (size_t) - 1)) @@ -251,7 +256,7 @@ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg)) { if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr)) /* The kernel header does this so there may be a reason. */ - return NULL; + return (struct cmsghdr *) 0; __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)); @@ -260,7 +265,7 @@ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg)) || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len) > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen))) /* No more entries. */ - return NULL; + return (struct cmsghdr *) 0; return __cmsg; } #endif /* Use `extern inline'. */ @@ -276,6 +281,7 @@ enum #define SCM_CREDS SCM_CREDS }; +#ifdef __USE_MISC /* Unfortunately, BSD practice dictates this structure be of fixed size. If there are more than CMGROUP_MAX groups, the list is truncated. (On GNU systems, the `cmcred_euid' field is just the first in the @@ -296,6 +302,7 @@ struct cmsgcred int cmcred_ngroups; __gid_t cmcred_groups[CMGROUP_MAX]; }; +#endif /* Protocol number used to manipulate socket-level options with `getsockopt' and `setsockopt'. */ diff --git a/bits/ss_flags.h b/bits/ss_flags.h new file mode 100644 index 0000000000..d54c711228 --- /dev/null +++ b/bits/ss_flags.h @@ -0,0 +1,35 @@ +/* ss_flags values for stack_t. + Copyright (C) 1998-2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _BITS_SS_FLAGS_H +#define _BITS_SS_FLAGS_H 1 + +#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H +# error "Never include this file directly. Use <signal.h> instead" +#endif + +/* Possible values for `ss_flags.'. */ +enum +{ + SS_ONSTACK = 0x0001, +#define SS_ONSTACK SS_ONSTACK + SS_DISABLE = 0x0004 +#define SS_DISABLE SS_DISABLE +}; + +#endif /* bits/ss_flags.h */ diff --git a/bits/stat.h b/bits/stat.h index 7d96d0db27..0330f9ad27 100644 --- a/bits/stat.h +++ b/bits/stat.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2016 Free Software Foundation, Inc. +/* Copyright (C) 1992-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/bits/statfs.h b/bits/statfs.h index e1696b7f92..5dc7cd6830 100644 --- a/bits/statfs.h +++ b/bits/statfs.h @@ -1,5 +1,5 @@ /* Definition of `struct statfs', information about a filesystem. - Copyright (C) 1996-2016 Free Software Foundation, Inc. + Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/bits/statvfs.h b/bits/statvfs.h index d6287475fb..d223dc70be 100644 --- a/bits/statvfs.h +++ b/bits/statvfs.h @@ -1,5 +1,5 @@ /* Definition of `struct statvfs', information about a filesystem. - Copyright (C) 1998-2016 Free Software Foundation, Inc. + Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/bits/stdint-intn.h b/bits/stdint-intn.h new file mode 100644 index 0000000000..de1ffcceeb --- /dev/null +++ b/bits/stdint-intn.h @@ -0,0 +1,29 @@ +/* Define intN_t types. + Copyright (C) 2017-2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _BITS_STDINT_INTN_H +#define _BITS_STDINT_INTN_H 1 + +#include <bits/types.h> + +typedef __int8_t int8_t; +typedef __int16_t int16_t; +typedef __int32_t int32_t; +typedef __int64_t int64_t; + +#endif /* bits/stdint-intn.h */ diff --git a/bits/stdint-uintn.h b/bits/stdint-uintn.h new file mode 100644 index 0000000000..350b65b266 --- /dev/null +++ b/bits/stdint-uintn.h @@ -0,0 +1,29 @@ +/* Define uintN_t types. + Copyright (C) 2017-2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _BITS_STDINT_UINTN_H +#define _BITS_STDINT_UINTN_H 1 + +#include <bits/types.h> + +typedef __uint8_t uint8_t; +typedef __uint16_t uint16_t; +typedef __uint32_t uint32_t; +typedef __uint64_t uint64_t; + +#endif /* bits/stdint-uintn.h */ diff --git a/bits/stdlib-bsearch.h b/bits/stdlib-bsearch.h index bbc8f98f3b..d83239a3af 100644 --- a/bits/stdlib-bsearch.h +++ b/bits/stdlib-bsearch.h @@ -1,5 +1,5 @@ /* Perform binary search - inline version. - Copyright (C) 1991-2016 Free Software Foundation, Inc. + Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/bits/string.h b/bits/string.h deleted file mode 100644 index 89c627c182..0000000000 --- a/bits/string.h +++ /dev/null @@ -1,18 +0,0 @@ -/* This file should provide inline versions of string functions. - - Surround GCC-specific parts with #ifdef __GNUC__, and use `__extern_inline'. - - This file should define __STRING_INLINES if functions are actually defined - as inlines. */ - -#ifndef _BITS_STRING_H -#define _BITS_STRING_H 1 - -/* Define whether to use the unaligned string inline ABI. - The string inline functions are an external ABI, thus cannot be changed - after the first release of a new target (unlike _STRING_ARCH_unaligned - which may be changed from release to release). Targets must support - unaligned accesses in hardware if either define is set to true. */ -#define _STRING_INLINE_unaligned 0 - -#endif /* bits/string.h */ diff --git a/bits/stropts.h b/bits/stropts.h index d419e5233f..8410b6c3ce 100644 --- a/bits/stropts.h +++ b/bits/stropts.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1998-2016 Free Software Foundation, Inc. +/* Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/bits/sys_errlist.h b/bits/sys_errlist.h index 163a9b2676..5dc7385ee5 100644 --- a/bits/sys_errlist.h +++ b/bits/sys_errlist.h @@ -1,5 +1,5 @@ /* Declare sys_errlist and sys_nerr, or don't. Don't version. - Copyright (C) 2002-2016 Free Software Foundation, Inc. + Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/bits/syslog-path.h b/bits/syslog-path.h index 6aab5e06ea..b569190cf4 100644 --- a/bits/syslog-path.h +++ b/bits/syslog-path.h @@ -1,5 +1,5 @@ /* <bits/syslog-path.h> -- _PATH_LOG definition - Copyright (C) 2006-2016 Free Software Foundation, Inc. + Copyright (C) 2006-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/bits/sysmacros.h b/bits/sysmacros.h new file mode 100644 index 0000000000..ea8d562c0a --- /dev/null +++ b/bits/sysmacros.h @@ -0,0 +1,74 @@ +/* Definitions of macros to access `dev_t' values. + Copyright (C) 1996-2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _BITS_SYSMACROS_H +#define _BITS_SYSMACROS_H 1 + +#ifndef _SYS_SYSMACROS_H +# error "Never include <bits/sysmacros.h> directly; use <sys/sysmacros.h> instead." +#endif + +/* dev_t in glibc is a 64-bit quantity, with 32-bit major and minor numbers. + Our default encoding is MMMM Mmmm mmmM MMmm, where M is a hex digit of + the major number and m is a hex digit of the minor number. This is + downward compatible with legacy systems where dev_t is 16 bits wide, + encoded as MMmm. It is also downward compatible with the Linux kernel, + which (as of 2016) uses 32-bit dev_t, encoded as mmmM MMmm. + + Systems that use an incompatible encoding for dev_t should override this + file in the appropriate sysdeps subdirectory. */ + +#define __SYSMACROS_DECLARE_MAJOR(DECL_TEMPL) \ + DECL_TEMPL(unsigned int, major, (__dev_t __dev)) + +#define __SYSMACROS_DEFINE_MAJOR(DECL_TEMPL) \ + __SYSMACROS_DECLARE_MAJOR (DECL_TEMPL) \ + { \ + unsigned int __major; \ + __major = ((__dev & (__dev_t) 0x00000000000fff00u) >> 8); \ + __major |= ((__dev & (__dev_t) 0xfffff00000000000u) >> 32); \ + return __major; \ + } + +#define __SYSMACROS_DECLARE_MINOR(DECL_TEMPL) \ + DECL_TEMPL(unsigned int, minor, (__dev_t __dev)) + +#define __SYSMACROS_DEFINE_MINOR(DECL_TEMPL) \ + __SYSMACROS_DECLARE_MINOR (DECL_TEMPL) \ + { \ + unsigned int __minor; \ + __minor = ((__dev & (__dev_t) 0x00000000000000ffu) >> 0); \ + __minor |= ((__dev & (__dev_t) 0x00000ffffff00000u) >> 12); \ + return __minor; \ + } + +#define __SYSMACROS_DECLARE_MAKEDEV(DECL_TEMPL) \ + DECL_TEMPL(__dev_t, makedev, (unsigned int __major, unsigned int __minor)) + +#define __SYSMACROS_DEFINE_MAKEDEV(DECL_TEMPL) \ + __SYSMACROS_DECLARE_MAKEDEV (DECL_TEMPL) \ + { \ + __dev_t __dev; \ + __dev = (((__dev_t) (__major & 0x00000fffu)) << 8); \ + __dev |= (((__dev_t) (__major & 0xfffff000u)) << 32); \ + __dev |= (((__dev_t) (__minor & 0x000000ffu)) << 0); \ + __dev |= (((__dev_t) (__minor & 0xffffff00u)) << 12); \ + return __dev; \ + } + +#endif /* bits/sysmacros.h */ diff --git a/bits/termios.h b/bits/termios.h index f28b492c10..c6d572bbc3 100644 --- a/bits/termios.h +++ b/bits/termios.h @@ -1,5 +1,5 @@ /* termios type and macro definitions. 4.4 BSD/generic GNU version. - Copyright (C) 1993-2016 Free Software Foundation, Inc. + Copyright (C) 1993-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -123,13 +123,13 @@ struct termios #define ICRNL (1 << 8) /* Map CR to NL on input. */ #define IXON (1 << 9) /* Enable start/stop output control. */ #define IXOFF (1 << 10) /* Enable start/stop input control. */ -#if defined __USE_MISC || defined __USE_UNIX98 +#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_XOPEN2K8 # define IXANY (1 << 11) /* Any character will restart after stop. */ #endif #ifdef __USE_MISC # define IMAXBEL (1 << 13) /* Ring bell when input queue is full. */ #endif -#ifdef __USE_GNU +#if defined __USE_GNU || (defined __USE_XOPEN && !defined __USE_XOPEN2K) # define IUCLC (1 << 14) /* Translate upper case input to lower case. */ #endif @@ -152,7 +152,7 @@ struct termios # define NLDLY (3 << 8) /* NL delay. */ # define NL0 (0 << 8) /* NL type 0. */ # define NL1 (1 << 8) /* NL type 1. */ -# define TABDLY (3 << 10) /* TAB delay. */ +# define TABDLY (3 << 10 | 1 << 2) /* TAB delay. */ # define TAB0 (0 << 10) /* TAB delay type 0. */ # define TAB1 (1 << 10) /* TAB delay type 1. */ # define TAB2 (2 << 10) /* TAB delay type 2. */ @@ -172,11 +172,12 @@ struct termios # define VT0 (0 << 16) /* VT delay type 0. */ # define VT1 (1 << 16) /* VT delay type 1. */ #endif /* __USE_MISC || __USE_XOPEN */ -#ifdef __USE_GNU +#if defined __USE_GNU || (defined __USE_XOPEN && !defined __USE_XOPEN2K) # define OLCUC (1 << 17) /* Translate lower case output to upper case */ #endif #ifdef __USE_XOPEN # define OFILL (1 << 18) /* Send fill characters for delays. */ +# define OFDEL (1 << 19) /* Fill is DEL. */ #endif /* Control modes. */ @@ -237,6 +238,11 @@ struct termios #define TOSTOP _TOSTOP #ifdef __USE_MISC # define FLUSHO (1 << 23) /* Output being flushed (state). */ +#endif +#if defined __USE_XOPEN && !defined __USE_XOPEN2K +# define XCASE (1 << 24) /* Canonical upper/lower case. */ +#endif +#ifdef __USE_MISC # define NOKERNINFO (1 << 25) /* Disable VSTATUS. */ # define PENDIN (1 << 29) /* Retype pending input (state). */ #endif diff --git a/bits/time.h b/bits/time.h index 19c7ab0997..e253a04261 100644 --- a/bits/time.h +++ b/bits/time.h @@ -1,5 +1,5 @@ /* System-dependent timing definitions. Generic version. - Copyright (C) 1996-2016 Free Software Foundation, Inc. + Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -20,9 +20,10 @@ * Never include this file directly; use <time.h> instead. */ -#ifndef __need_timeval -# ifndef _BITS_TIME_H -# define _BITS_TIME_H 1 +#ifndef _BITS_TIME_H +#define _BITS_TIME_H 1 + +#include <bits/types.h> /* ISO/IEC 9899:1999 7.23.1: Components of time The macro `CLOCKS_PER_SEC' is an expression with type `clock_t' that is @@ -30,51 +31,34 @@ /* CAE XSH, Issue 4, Version 2: <time.h> The value of CLOCKS_PER_SEC is required to be 1 million on all XSI-conformant systems. */ -# define CLOCKS_PER_SEC ((clock_t) 1000000) +#define CLOCKS_PER_SEC ((__clock_t) 1000000) -# if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K +#if (!defined __STRICT_ANSI__ || defined __USE_POSIX) \ + && !defined __USE_XOPEN2K /* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK presents the real value for clock ticks per second for the system. */ -# include <bits/types.h> extern long int __sysconf (int); -# define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */ -# endif +# define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */ +#endif -# ifdef __USE_POSIX199309 +#ifdef __USE_POSIX199309 /* Identifier for system-wide realtime clock. */ -# define CLOCK_REALTIME 0 +# define CLOCK_REALTIME 0 /* Monotonic system-wide clock. */ -# define CLOCK_MONOTONIC 1 +# define CLOCK_MONOTONIC 1 /* High-resolution timer from the CPU. */ -# define CLOCK_PROCESS_CPUTIME_ID 2 +# define CLOCK_PROCESS_CPUTIME_ID 2 /* Thread-specific CPU-time clock. */ -# define CLOCK_THREAD_CPUTIME_ID 3 +# define CLOCK_THREAD_CPUTIME_ID 3 /* Monotonic system-wide clock, not adjusted for frequency scaling. */ -# define CLOCK_MONOTONIC_RAW 4 +# define CLOCK_MONOTONIC_RAW 4 /* Identifier for system-wide realtime clock, updated only on ticks. */ -# define CLOCK_REALTIME_COARSE 5 +# define CLOCK_REALTIME_COARSE 5 /* Monotonic system-wide clock, updated only on ticks. */ -# define CLOCK_MONOTONIC_COARSE 6 +# define CLOCK_MONOTONIC_COARSE 6 /* Flag to indicate time is absolute. */ -# define TIMER_ABSTIME 1 -# endif - -# endif /* bits/time.h */ +# define TIMER_ABSTIME 1 #endif -#ifdef __need_timeval -# undef __need_timeval -# ifndef _STRUCT_TIMEVAL -# define _STRUCT_TIMEVAL 1 -# include <bits/types.h> - -/* A time value that is accurate to the nearest - microsecond but also has a range of years. */ -struct timeval - { - __time_t tv_sec; /* Seconds. */ - __suseconds_t tv_usec; /* Microseconds. */ - }; -# endif /* struct timeval */ -#endif /* need timeval */ +#endif /* bits/time.h */ diff --git a/bits/types.h b/bits/types.h deleted file mode 100644 index 01753bd0dc..0000000000 --- a/bits/types.h +++ /dev/null @@ -1,194 +0,0 @@ -/* bits/types.h -- definitions of __*_t types underlying *_t types. - Copyright (C) 2002-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -/* - * Never include this file directly; use <sys/types.h> instead. - */ - -#ifndef _BITS_TYPES_H -#define _BITS_TYPES_H 1 - -#include <features.h> -#include <bits/wordsize.h> - -/* Convenience types. */ -typedef unsigned char __u_char; -typedef unsigned short int __u_short; -typedef unsigned int __u_int; -typedef unsigned long int __u_long; - -/* Fixed-size types, underlying types depend on word size and compiler. */ -typedef signed char __int8_t; -typedef unsigned char __uint8_t; -typedef signed short int __int16_t; -typedef unsigned short int __uint16_t; -typedef signed int __int32_t; -typedef unsigned int __uint32_t; -#if __WORDSIZE == 64 -typedef signed long int __int64_t; -typedef unsigned long int __uint64_t; -#else -__extension__ typedef signed long long int __int64_t; -__extension__ typedef unsigned long long int __uint64_t; -#endif - -/* quad_t is also 64 bits. */ -#if __WORDSIZE == 64 -typedef long int __quad_t; -typedef unsigned long int __u_quad_t; -#else -__extension__ typedef long long int __quad_t; -__extension__ typedef unsigned long long int __u_quad_t; -#endif - - -/* The machine-dependent file <bits/typesizes.h> defines __*_T_TYPE - macros for each of the OS types we define below. The definitions - of those macros must use the following macros for underlying types. - We define __S<SIZE>_TYPE and __U<SIZE>_TYPE for the signed and unsigned - variants of each of the following integer types on this machine. - - 16 -- "natural" 16-bit type (always short) - 32 -- "natural" 32-bit type (always int) - 64 -- "natural" 64-bit type (long or long long) - LONG32 -- 32-bit type, traditionally long - QUAD -- 64-bit type, always long long - WORD -- natural type of __WORDSIZE bits (int or long) - LONGWORD -- type of __WORDSIZE bits, traditionally long - - We distinguish WORD/LONGWORD, 32/LONG32, and 64/QUAD so that the - conventional uses of `long' or `long long' type modifiers match the - types we define, even when a less-adorned type would be the same size. - This matters for (somewhat) portably writing printf/scanf formats for - these types, where using the appropriate l or ll format modifiers can - make the typedefs and the formats match up across all GNU platforms. If - we used `long' when it's 64 bits where `long long' is expected, then the - compiler would warn about the formats not matching the argument types, - and the programmer changing them to shut up the compiler would break the - program's portability. - - Here we assume what is presently the case in all the GCC configurations - we support: long long is always 64 bits, long is always word/address size, - and int is always 32 bits. */ - -#define __S16_TYPE short int -#define __U16_TYPE unsigned short int -#define __S32_TYPE int -#define __U32_TYPE unsigned int -#define __SLONGWORD_TYPE long int -#define __ULONGWORD_TYPE unsigned long int -#if __WORDSIZE == 32 -# define __SQUAD_TYPE __quad_t -# define __UQUAD_TYPE __u_quad_t -# define __SWORD_TYPE int -# define __UWORD_TYPE unsigned int -# define __SLONG32_TYPE long int -# define __ULONG32_TYPE unsigned long int -# define __S64_TYPE __quad_t -# define __U64_TYPE __u_quad_t -/* We want __extension__ before typedef's that use nonstandard base types - such as `long long' in C89 mode. */ -# define __STD_TYPE __extension__ typedef -#elif __WORDSIZE == 64 -# define __SQUAD_TYPE long int -# define __UQUAD_TYPE unsigned long int -# define __SWORD_TYPE long int -# define __UWORD_TYPE unsigned long int -# define __SLONG32_TYPE int -# define __ULONG32_TYPE unsigned int -# define __S64_TYPE long int -# define __U64_TYPE unsigned long int -/* No need to mark the typedef with __extension__. */ -# define __STD_TYPE typedef -#else -# error -#endif -#include <bits/typesizes.h> /* Defines __*_T_TYPE macros. */ - - -__STD_TYPE __DEV_T_TYPE __dev_t; /* Type of device numbers. */ -__STD_TYPE __UID_T_TYPE __uid_t; /* Type of user identifications. */ -__STD_TYPE __GID_T_TYPE __gid_t; /* Type of group identifications. */ -__STD_TYPE __INO_T_TYPE __ino_t; /* Type of file serial numbers. */ -__STD_TYPE __INO64_T_TYPE __ino64_t; /* Type of file serial numbers (LFS).*/ -__STD_TYPE __MODE_T_TYPE __mode_t; /* Type of file attribute bitmasks. */ -__STD_TYPE __NLINK_T_TYPE __nlink_t; /* Type of file link counts. */ -__STD_TYPE __OFF_T_TYPE __off_t; /* Type of file sizes and offsets. */ -__STD_TYPE __OFF64_T_TYPE __off64_t; /* Type of file sizes and offsets (LFS). */ -__STD_TYPE __PID_T_TYPE __pid_t; /* Type of process identifications. */ -__STD_TYPE __FSID_T_TYPE __fsid_t; /* Type of file system IDs. */ -__STD_TYPE __CLOCK_T_TYPE __clock_t; /* Type of CPU usage counts. */ -__STD_TYPE __RLIM_T_TYPE __rlim_t; /* Type for resource measurement. */ -__STD_TYPE __RLIM64_T_TYPE __rlim64_t; /* Type for resource measurement (LFS). */ -__STD_TYPE __ID_T_TYPE __id_t; /* General type for IDs. */ -__STD_TYPE __TIME_T_TYPE __time_t; /* Seconds since the Epoch. */ -__STD_TYPE __USECONDS_T_TYPE __useconds_t; /* Count of microseconds. */ -__STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds. */ - -__STD_TYPE __DADDR_T_TYPE __daddr_t; /* The type of a disk address. */ -__STD_TYPE __KEY_T_TYPE __key_t; /* Type of an IPC key. */ - -/* Clock ID used in clock and timer functions. */ -__STD_TYPE __CLOCKID_T_TYPE __clockid_t; - -/* Timer ID returned by `timer_create'. */ -__STD_TYPE __TIMER_T_TYPE __timer_t; - -/* Type to represent block size. */ -__STD_TYPE __BLKSIZE_T_TYPE __blksize_t; - -/* Types from the Large File Support interface. */ - -/* Type to count number of disk blocks. */ -__STD_TYPE __BLKCNT_T_TYPE __blkcnt_t; -__STD_TYPE __BLKCNT64_T_TYPE __blkcnt64_t; - -/* Type to count file system blocks. */ -__STD_TYPE __FSBLKCNT_T_TYPE __fsblkcnt_t; -__STD_TYPE __FSBLKCNT64_T_TYPE __fsblkcnt64_t; - -/* Type to count file system nodes. */ -__STD_TYPE __FSFILCNT_T_TYPE __fsfilcnt_t; -__STD_TYPE __FSFILCNT64_T_TYPE __fsfilcnt64_t; - -/* Type of miscellaneous file system fields. */ -__STD_TYPE __FSWORD_T_TYPE __fsword_t; - -__STD_TYPE __SSIZE_T_TYPE __ssize_t; /* Type of a byte count, or error. */ - -/* Signed long type used in system calls. */ -__STD_TYPE __SYSCALL_SLONG_TYPE __syscall_slong_t; -/* Unsigned long type used in system calls. */ -__STD_TYPE __SYSCALL_ULONG_TYPE __syscall_ulong_t; - -/* These few don't really vary by system, they always correspond - to one of the other defined types. */ -typedef __off64_t __loff_t; /* Type of file sizes and offsets (LFS). */ -typedef __quad_t *__qaddr_t; -typedef char *__caddr_t; - -/* Duplicates info from stdint.h but this is used in unistd.h. */ -__STD_TYPE __SWORD_TYPE __intptr_t; - -/* Duplicate info from sys/socket.h. */ -__STD_TYPE __U32_TYPE __socklen_t; - - -#undef __STD_TYPE - -#endif /* bits/types.h */ diff --git a/bits/types/__sigset_t.h b/bits/types/__sigset_t.h new file mode 100644 index 0000000000..c90d760a6e --- /dev/null +++ b/bits/types/__sigset_t.h @@ -0,0 +1,7 @@ +#ifndef ____sigset_t_defined +#define ____sigset_t_defined 1 + +/* A `sigset_t' has a bit for each signal. */ +typedef unsigned long int __sigset_t; + +#endif diff --git a/bits/huge_val.h b/bits/types/error_t.h index 9b4fac4e07..8ea7a8149e 100644 --- a/bits/huge_val.h +++ b/bits/types/error_t.h @@ -1,6 +1,5 @@ -/* Stub `HUGE_VAL' constant. - Used by <stdlib.h> and <math.h> functions for overflow. - Copyright (C) 1992-2016 Free Software Foundation, Inc. +/* Define error_t. + Copyright (C) 1991-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -17,12 +16,9 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#ifndef _MATH_H -# error "Never use <bits/huge_val.h> directly; include <math.h> instead." -#endif +#ifndef __error_t_defined +# define __error_t_defined 1 + +typedef int error_t; -#if __GNUC_PREREQ(3,3) -# define HUGE_VAL (__builtin_huge_val()) -#else -# define HUGE_VAL 1e37 #endif diff --git a/bits/types/sigevent_t.h b/bits/types/sigevent_t.h new file mode 100644 index 0000000000..5611268610 --- /dev/null +++ b/bits/types/sigevent_t.h @@ -0,0 +1,17 @@ +#ifndef __sigevent_t_defined +#define __sigevent_t_defined 1 + +#include <bits/types.h> +#include <bits/types/__sigval_t.h> + +/* Structure to transport application-defined values with signals. */ +typedef struct sigevent + { + __sigval_t sigev_value; + int sigev_signo; + int sigev_notify; + void (*sigev_notify_function) (__sigval_t); /* Function to start. */ + void *sigev_notify_attributes; /* Really pthread_attr_t.*/ + } sigevent_t; + +#endif diff --git a/bits/types/siginfo_t.h b/bits/types/siginfo_t.h new file mode 100644 index 0000000000..450cb9431f --- /dev/null +++ b/bits/types/siginfo_t.h @@ -0,0 +1,21 @@ +#ifndef __siginfo_t_defined +#define __siginfo_t_defined 1 + +#include <bits/types.h> +#include <bits/types/__sigval_t.h> + +typedef struct + { + int si_signo; /* Signal number. */ + int si_errno; /* If non-zero, an errno value associated with + this signal, as defined in <errno.h>. */ + int si_code; /* Signal code. */ + __pid_t si_pid; /* Sending process ID. */ + __uid_t si_uid; /* Real user ID of sending process. */ + void *si_addr; /* Address of faulting instruction. */ + int si_status; /* Exit value or signal. */ + long int si_band; /* Band event for SIGPOLL. */ + __sigval_t si_value; /* Signal value. */ + } siginfo_t; + +#endif diff --git a/bits/uio.h b/bits/types/stack_t.h index 5d3e48443e..d57f94c211 100644 --- a/bits/uio.h +++ b/bits/types/stack_t.h @@ -1,4 +1,5 @@ -/* Copyright (C) 1996-2016 Free Software Foundation, Inc. +/* Define stack_t. + Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -15,17 +16,18 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#ifndef _SYS_UIO_H -# error "Never include <bits/uio.h> directly; use <sys/uio.h> instead." -#endif +#ifndef __stack_t_defined +#define __stack_t_defined 1 +#define __need_size_t +#include <stddef.h> -/* `struct iovec' -- Structure describing a section of memory. */ +/* Structure describing a signal stack. */ +typedef struct + { + void *ss_sp; + size_t ss_size; + int ss_flags; + } stack_t; -struct iovec -{ - /* Starting address. */ - __ptr_t iov_base; - /* Length in bytes. */ - size_t iov_len; -}; +#endif diff --git a/bits/types/struct_sched_param.h b/bits/types/struct_sched_param.h new file mode 100644 index 0000000000..2f24d426fb --- /dev/null +++ b/bits/types/struct_sched_param.h @@ -0,0 +1,28 @@ +/* Sched parameter structure. Generic version. + Copyright (C) 1996-2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _BITS_TYPES_STRUCT_SCHED_PARAM +#define _BITS_TYPES_STRUCT_SCHED_PARAM 1 + +/* Data structure to describe a process' schedulability. */ +struct sched_param +{ + int sched_priority; +}; + +#endif /* bits/types/struct_sched_param.h */ diff --git a/bits/typesizes.h b/bits/typesizes.h index 53047b8531..85eacf2518 100644 --- a/bits/typesizes.h +++ b/bits/typesizes.h @@ -1,5 +1,5 @@ /* bits/typesizes.h -- underlying types for *_t. Generic version. - Copyright (C) 2002-2016 Free Software Foundation, Inc. + Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -69,6 +69,11 @@ /* Same for ino_t and ino64_t. */ # define __INO_T_MATCHES_INO64_T 1 + +/* And for rlim_t and rlim64_t. */ +# define __RLIM_T_MATCHES_RLIM64_T 1 +#else +# define __RLIM_T_MATCHES_RLIM64_T 0 #endif /* Number of descriptors that can fit in an `fd_set'. */ diff --git a/bits/uintn-identity.h b/bits/uintn-identity.h new file mode 100644 index 0000000000..2ce92351a9 --- /dev/null +++ b/bits/uintn-identity.h @@ -0,0 +1,50 @@ +/* Inline functions to return unsigned integer values unchanged. + Copyright (C) 2017-2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#if !defined _NETINET_IN_H && !defined _ENDIAN_H +# error "Never use <bits/uintn-identity.h> directly; include <netinet/in.h> or <endian.h> instead." +#endif + +#ifndef _BITS_UINTN_IDENTITY_H +#define _BITS_UINTN_IDENTITY_H 1 + +#include <bits/types.h> + +/* These inline functions are to ensure the appropriate type + conversions and associated diagnostics from macros that convert to + a given endianness. */ + +static __inline __uint16_t +__uint16_identity (__uint16_t __x) +{ + return __x; +} + +static __inline __uint32_t +__uint32_identity (__uint32_t __x) +{ + return __x; +} + +static __inline __uint64_t +__uint64_identity (__uint64_t __x) +{ + return __x; +} + +#endif /* _BITS_UINTN_IDENTITY_H. */ diff --git a/bits/inf.h b/bits/uio-ext.h index 46fcf9f2df..d5aa06fd08 100644 --- a/bits/inf.h +++ b/bits/uio-ext.h @@ -1,5 +1,5 @@ -/* Default `INFINITY' constant. - Copyright (C) 2004-2016 Free Software Foundation, Inc. +/* Operating system-specific extensions to sys/uio.h - generic version. + Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,17 +16,18 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#ifndef _MATH_H -# error "Never use <bits/inf.h> directly; include <math.h> instead." +#ifndef _BITS_UIO_EXT_H +#define _BITS_UIO_EXT_H 1 + +#ifndef _SYS_UIO_H +# error "Never include <bits/uio-ext.h> directly; use <sys/uio.h> instead." #endif -/* If we don't have real infinity, then we're supposed to produce a float - value that overflows at translation time, which is required to produce - a diagnostic. GCC's __builtin_inff produces a quite nice diagnostic - that tells the user that the target doesn't support infinities. */ +/* Flags for preadv2/pwritev2. */ +#define RWF_HIPRI 0x00000001 /* High priority request. */ +#define RWF_DSYNC 0x00000002 /* per-IO O_DSYNC. */ +#define RWF_SYNC 0x00000004 /* per-IO O_SYNC. */ +#define RWF_NOWAIT 0x00000008 /* per-IO nonblocking mode. */ +#define RWF_APPEND 0x00000010 /* per-IO O_APPEND. */ -#if __GNUC_PREREQ(3,3) -# define INFINITY (__builtin_inff()) -#else -# define INFINITY (1e9999f) -#endif +#endif /* sys/uio_ext.h */ diff --git a/bits/ustat.h b/bits/uio_lim.h index 0da6240f38..c6603db49e 100644 --- a/bits/ustat.h +++ b/bits/uio_lim.h @@ -1,4 +1,5 @@ -/* Copyright (C) 1997-2016 Free Software Foundation, Inc. +/* Implementation limits related to sys/uio.h - generic version. + Copyright (C) 2017-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -15,16 +16,11 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#ifndef _SYS_USTAT_H -# error "Never include <bits/ustat.h> directly; use <sys/ustat.h> instead." -#endif +#ifndef _BITS_UIO_LIM_H +#define _BITS_UIO_LIM_H 1 -#include <sys/types.h> +/* Maximum length of the 'struct iovec' array in a single call to + readv or writev. If there is no limit, the macro is not defined. */ +#undef __IOV_MAX -struct ustat - { - __daddr_t f_tfree; /* Number of free blocks. */ - __ino_t f_tinode; /* Number of free inodes. */ - char f_fname[6]; - char f_fpack[6]; - }; +#endif diff --git a/bits/utmp.h b/bits/utmp.h index 341925f712..6e8695fbf0 100644 --- a/bits/utmp.h +++ b/bits/utmp.h @@ -1,5 +1,5 @@ /* The `struct utmp' type, describing entries in the utmp file. Generic/BSDish - Copyright (C) 1993-2016 Free Software Foundation, Inc. + Copyright (C) 1993-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/bits/utsname.h b/bits/utsname.h index b49f9005a7..5e8cfcebb2 100644 --- a/bits/utsname.h +++ b/bits/utsname.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997-2016 Free Software Foundation, Inc. +/* Copyright (C) 1997-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/bits/waitflags.h b/bits/waitflags.h index 91407688ff..b6092dd779 100644 --- a/bits/waitflags.h +++ b/bits/waitflags.h @@ -1,5 +1,5 @@ /* Definitions of flag bits for `waitpid' et al. - Copyright (C) 1992-2016 Free Software Foundation, Inc. + Copyright (C) 1992-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/bits/waitstatus.h b/bits/waitstatus.h index 38c33bc2dc..a1c232612c 100644 --- a/bits/waitstatus.h +++ b/bits/waitstatus.h @@ -1,5 +1,5 @@ /* Definitions of status bits for `wait' et al. - Copyright (C) 1992-2016 Free Software Foundation, Inc. + Copyright (C) 1992-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -57,49 +57,3 @@ #define __W_STOPCODE(sig) ((sig) << 8 | 0x7f) #define __W_CONTINUED 0xffff #define __WCOREFLAG 0x80 - - -#ifdef __USE_MISC - -# include <endian.h> - -union wait - { - int w_status; - struct - { -# if __BYTE_ORDER == __LITTLE_ENDIAN - unsigned int __w_termsig:7; /* Terminating signal. */ - unsigned int __w_coredump:1; /* Set if dumped core. */ - unsigned int __w_retcode:8; /* Return code if exited normally. */ - unsigned int:16; -# endif /* Little endian. */ -# if __BYTE_ORDER == __BIG_ENDIAN - unsigned int:16; - unsigned int __w_retcode:8; - unsigned int __w_coredump:1; - unsigned int __w_termsig:7; -# endif /* Big endian. */ - } __wait_terminated; - struct - { -# if __BYTE_ORDER == __LITTLE_ENDIAN - unsigned int __w_stopval:8; /* W_STOPPED if stopped. */ - unsigned int __w_stopsig:8; /* Stopping signal. */ - unsigned int:16; -# endif /* Little endian. */ -# if __BYTE_ORDER == __BIG_ENDIAN - unsigned int:16; - unsigned int __w_stopsig:8; /* Stopping signal. */ - unsigned int __w_stopval:8; /* W_STOPPED if stopped. */ -# endif /* Big endian. */ - } __wait_stopped; - }; - -# define w_termsig __wait_terminated.__w_termsig -# define w_coredump __wait_terminated.__w_coredump -# define w_retcode __wait_terminated.__w_retcode -# define w_stopsig __wait_stopped.__w_stopsig -# define w_stopval __wait_stopped.__w_stopval - -#endif /* Use misc. */ diff --git a/bits/wchar.h b/bits/wchar.h index 54f00d5eb8..5fa6ccd4af 100644 --- a/bits/wchar.h +++ b/bits/wchar.h @@ -1,5 +1,5 @@ /* wchar_t type related definitions. - Copyright (C) 2000-2016 Free Software Foundation, Inc. + Copyright (C) 2000-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/bits/wordsize.h b/bits/wordsize.h index 9ef0e8526a..14edae3a11 100644 --- a/bits/wordsize.h +++ b/bits/wordsize.h @@ -1 +1,27 @@ #error "This file must be written based on the data type sizes of the target" + +/* The following entries are a template for what defines should be in the + wordsize.h header file for a target. */ + +/* Size in bits of the 'long int' and pointer types. */ +#define __WORDSIZE + +/* This should be set to 1 if __WORDSIZE is 32 and size_t is type + 'unsigned long' instead of type 'unsigned int'. This will ensure + that SIZE_MAX is defined as an unsigned long constant instead of an + unsigned int constant. Set to 0 if __WORDSIZE is 32 and size_t is + 'unsigned int' and leave undefined if __WORDSIZE is 64. */ +#define __WORDSIZE32_SIZE_ULONG + +/* This should be set to 1 if __WORDSIZE is 32 and ptrdiff_t is type 'long' + instead of type 'int'. This will ensure that PTRDIFF_MIN and PTRDIFF_MAX + are defined as long constants instead of int constants. Set to 0 if + __WORDSIZE is 32 and ptrdiff_t is type 'int' and leave undefined if + __WORDSIZE is 64. */ +#define __WORDSIZE32_PTRDIFF_LONG + +/* Set to 1 in order to force time types to be 32 bits instead of 64 bits in + struct lastlog and struct utmp{,x} on 64-bit ports. This may be done in + order to make 64-bit ports compatible with 32-bit ports. Set to 0 for + 64-bit ports where the time types are 64-bits or for any 32-bit ports. */ +#define __WORDSIZE_TIME64_COMPAT32 diff --git a/bits/xtitypes.h b/bits/xtitypes.h index d794cf4adf..1b5c8ace40 100644 --- a/bits/xtitypes.h +++ b/bits/xtitypes.h @@ -1,5 +1,5 @@ /* bits/xtitypes.h -- Define some types used by <bits/stropts.h>. Generic. - Copyright (C) 2002-2016 Free Software Foundation, Inc. + Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or |