github.com/afumu/libc@v0.0.6/pthread/pthread_linux_riscv64.go (about)

     1  // Code generated by 'ccgo pthread/gen.c -crt-import-path "" -export-defines "" -export-enums "" -export-externs X -export-fields F -export-structs "" -export-typedefs "" -header -hide _OSSwapInt16,_OSSwapInt32,_OSSwapInt64 -o pthread/pthread_linux_riscv64.go -pkgname pthread', DO NOT EDIT.
     2  
     3  package pthread
     4  
     5  import (
     6  	"math"
     7  	"reflect"
     8  	"sync/atomic"
     9  	"unsafe"
    10  )
    11  
    12  var _ = math.Pi
    13  var _ reflect.Kind
    14  var _ atomic.Value
    15  var _ unsafe.Pointer
    16  
    17  const (
    18  	CLOCK_BOOTTIME                  = 7
    19  	CLOCK_BOOTTIME_ALARM            = 9
    20  	CLOCK_MONOTONIC                 = 1
    21  	CLOCK_MONOTONIC_COARSE          = 6
    22  	CLOCK_MONOTONIC_RAW             = 4
    23  	CLOCK_PROCESS_CPUTIME_ID        = 2
    24  	CLOCK_REALTIME                  = 0
    25  	CLOCK_REALTIME_ALARM            = 8
    26  	CLOCK_REALTIME_COARSE           = 5
    27  	CLOCK_TAI                       = 11
    28  	CLOCK_THREAD_CPUTIME_ID         = 3
    29  	PTHREAD_BARRIER_SERIAL_THREAD   = -1
    30  	PTHREAD_ONCE_INIT               = 0
    31  	PTHREAD_STACK_MIN               = 16384
    32  	SCHED_FIFO                      = 1
    33  	SCHED_OTHER                     = 0
    34  	SCHED_RR                        = 2
    35  	TIMER_ABSTIME                   = 1
    36  	TIME_UTC                        = 1
    37  	X_ATFILE_SOURCE                 = 1
    38  	X_BITS_CPU_SET_H                = 1
    39  	X_BITS_ENDIANNESS_H             = 1
    40  	X_BITS_ENDIAN_H                 = 1
    41  	X_BITS_PTHREADTYPES_ARCH_H      = 1
    42  	X_BITS_PTHREADTYPES_COMMON_H    = 1
    43  	X_BITS_SCHED_H                  = 1
    44  	X_BITS_TIME64_H                 = 1
    45  	X_BITS_TIME_H                   = 1
    46  	X_BITS_TYPESIZES_H              = 1
    47  	X_BITS_TYPES_H                  = 1
    48  	X_BITS_TYPES_LOCALE_T_H         = 1
    49  	X_BITS_TYPES_STRUCT_SCHED_PARAM = 1
    50  	X_BITS_TYPES___LOCALE_T_H       = 1
    51  	X_BSD_SIZE_T_                   = 0
    52  	X_BSD_SIZE_T_DEFINED_           = 0
    53  	X_DEFAULT_SOURCE                = 1
    54  	X_FEATURES_H                    = 1
    55  	X_FILE_OFFSET_BITS              = 64
    56  	X_GCC_SIZE_T                    = 0
    57  	X_LP64                          = 1
    58  	X_POSIX_C_SOURCE                = 200809
    59  	X_POSIX_SOURCE                  = 1
    60  	X_PTHREAD_H                     = 1
    61  	X_RISCV_BITS_SETJMP_H           = 0
    62  	X_RWLOCK_INTERNAL_H             = 0
    63  	X_SCHED_H                       = 1
    64  	X_SIZET_                        = 0
    65  	X_SIZE_T                        = 0
    66  	X_SIZE_T_                       = 0
    67  	X_SIZE_T_DECLARED               = 0
    68  	X_SIZE_T_DEFINED                = 0
    69  	X_SIZE_T_DEFINED_               = 0
    70  	X_STDC_PREDEF_H                 = 1
    71  	X_STRUCT_TIMESPEC               = 1
    72  	X_SYS_CDEFS_H                   = 1
    73  	X_SYS_SIZE_T_H                  = 0
    74  	X_THREAD_MUTEX_INTERNAL_H       = 1
    75  	X_THREAD_SHARED_TYPES_H         = 1
    76  	X_TIME_H                        = 1
    77  	X_T_SIZE                        = 0
    78  	X_T_SIZE_                       = 0
    79  	Linux                           = 1
    80  	Unix                            = 1
    81  )
    82  
    83  // Read-write lock types.
    84  const ( /* pthread.h:104:1: */
    85  	PTHREAD_RWLOCK_PREFER_READER_NP              = 0
    86  	PTHREAD_RWLOCK_PREFER_WRITER_NP              = 1
    87  	PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP = 2
    88  	PTHREAD_RWLOCK_DEFAULT_NP                    = 0
    89  )
    90  
    91  // Read-write lock initializers.
    92  
    93  // Scheduler inheritance.
    94  const ( /* pthread.h:124:1: */
    95  	PTHREAD_INHERIT_SCHED  = 0
    96  	PTHREAD_EXPLICIT_SCHED = 1
    97  )
    98  
    99  // Scope handling.
   100  const ( /* pthread.h:134:1: */
   101  	PTHREAD_SCOPE_SYSTEM  = 0
   102  	PTHREAD_SCOPE_PROCESS = 1
   103  )
   104  
   105  // Process shared or private flag.
   106  const ( /* pthread.h:144:1: */
   107  	PTHREAD_PROCESS_PRIVATE = 0
   108  	PTHREAD_PROCESS_SHARED  = 1
   109  )
   110  
   111  // Cancellation
   112  const ( /* pthread.h:168:1: */
   113  	PTHREAD_CANCEL_ENABLE  = 0
   114  	PTHREAD_CANCEL_DISABLE = 1
   115  )
   116  const ( /* pthread.h:175:1: */
   117  	PTHREAD_CANCEL_DEFERRED     = 0
   118  	PTHREAD_CANCEL_ASYNCHRONOUS = 1
   119  )
   120  
   121  // Definition of PTHREAD_STACK_MIN, possibly dynamic.
   122  //    Copyright (C) 2021 Free Software Foundation, Inc.
   123  //    This file is part of the GNU C Library.
   124  //
   125  //    The GNU C Library is free software; you can redistribute it and/or
   126  //    modify it under the terms of the GNU Lesser General Public
   127  //    License as published by the Free Software Foundation; either
   128  //    version 2.1 of the License, or (at your option) any later version.
   129  //
   130  //    The GNU C Library is distributed in the hope that it will be useful,
   131  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   132  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   133  //    Lesser General Public License for more details.
   134  //
   135  //    You should have received a copy of the GNU Lesser General Public
   136  //    License along with the GNU C Library; if not, see
   137  //    <https://www.gnu.org/licenses/>.
   138  
   139  // Definition of PTHREAD_STACK_MIN.  Linux version.
   140  //    Copyright (C) 2021 Free Software Foundation, Inc.
   141  //    This file is part of the GNU C Library.
   142  //
   143  //    The GNU C Library is free software; you can redistribute it and/or
   144  //    modify it under the terms of the GNU Lesser General Public
   145  //    License as published by the Free Software Foundation; either
   146  //    version 2.1 of the License, or (at your option) any later version.
   147  //
   148  //    The GNU C Library is distributed in the hope that it will be useful,
   149  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   150  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   151  //    Lesser General Public License for more details.
   152  //
   153  //    You should have received a copy of the GNU Lesser General Public
   154  //    License along with the GNU C Library; if not, see
   155  //    <https://www.gnu.org/licenses/>.
   156  
   157  // Minimum size for a thread.  We are free to choose a reasonable value.
   158  
   159  // Detach state.
   160  const ( /* pthread.h:37:1: */
   161  	PTHREAD_CREATE_JOINABLE = 0
   162  	PTHREAD_CREATE_DETACHED = 1
   163  )
   164  
   165  // Mutex types.
   166  const ( /* pthread.h:47:1: */
   167  	PTHREAD_MUTEX_TIMED_NP      = 0
   168  	PTHREAD_MUTEX_RECURSIVE_NP  = 1
   169  	PTHREAD_MUTEX_ERRORCHECK_NP = 2
   170  	PTHREAD_MUTEX_ADAPTIVE_NP   = 3
   171  	PTHREAD_MUTEX_NORMAL        = 0
   172  	PTHREAD_MUTEX_RECURSIVE     = 1
   173  	PTHREAD_MUTEX_ERRORCHECK    = 2
   174  	PTHREAD_MUTEX_DEFAULT       = 0
   175  )
   176  
   177  // Robust mutex or not flags.
   178  const ( /* pthread.h:69:1: */
   179  	PTHREAD_MUTEX_STALLED    = 0
   180  	PTHREAD_MUTEX_STALLED_NP = 0
   181  	PTHREAD_MUTEX_ROBUST     = 1
   182  	PTHREAD_MUTEX_ROBUST_NP  = 1
   183  )
   184  
   185  // Mutex protocols.
   186  const ( /* pthread.h:81:1: */
   187  	PTHREAD_PRIO_NONE    = 0
   188  	PTHREAD_PRIO_INHERIT = 1
   189  	PTHREAD_PRIO_PROTECT = 2
   190  )
   191  
   192  type Ptrdiff_t = int64 /* <builtin>:3:26 */
   193  
   194  type Size_t = uint64 /* <builtin>:9:23 */
   195  
   196  type Wchar_t = int32 /* <builtin>:15:24 */
   197  
   198  type X__int128_t = struct {
   199  	Flo int64
   200  	Fhi int64
   201  } /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128
   202  type X__uint128_t = struct {
   203  	Flo uint64
   204  	Fhi uint64
   205  } /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128
   206  
   207  type X__builtin_va_list = uintptr /* <builtin>:46:14 */
   208  type X__float128 = float64        /* <builtin>:47:21 */
   209  
   210  // Copyright (C) 2002-2021 Free Software Foundation, Inc.
   211  //    This file is part of the GNU C Library.
   212  //
   213  //    The GNU C Library is free software; you can redistribute it and/or
   214  //    modify it under the terms of the GNU Lesser General Public
   215  //    License as published by the Free Software Foundation; either
   216  //    version 2.1 of the License, or (at your option) any later version.
   217  //
   218  //    The GNU C Library is distributed in the hope that it will be useful,
   219  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   220  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   221  //    Lesser General Public License for more details.
   222  //
   223  //    You should have received a copy of the GNU Lesser General Public
   224  //    License along with the GNU C Library; if not, see
   225  //    <https://www.gnu.org/licenses/>.
   226  
   227  // Copyright (C) 1991-2021 Free Software Foundation, Inc.
   228  //    This file is part of the GNU C Library.
   229  //
   230  //    The GNU C Library is free software; you can redistribute it and/or
   231  //    modify it under the terms of the GNU Lesser General Public
   232  //    License as published by the Free Software Foundation; either
   233  //    version 2.1 of the License, or (at your option) any later version.
   234  //
   235  //    The GNU C Library is distributed in the hope that it will be useful,
   236  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   237  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   238  //    Lesser General Public License for more details.
   239  //
   240  //    You should have received a copy of the GNU Lesser General Public
   241  //    License along with the GNU C Library; if not, see
   242  //    <https://www.gnu.org/licenses/>.
   243  
   244  // These are defined by the user (or the compiler)
   245  //    to specify the desired environment:
   246  //
   247  //    __STRICT_ANSI__	ISO Standard C.
   248  //    _ISOC99_SOURCE	Extensions to ISO C89 from ISO C99.
   249  //    _ISOC11_SOURCE	Extensions to ISO C99 from ISO C11.
   250  //    _ISOC2X_SOURCE	Extensions to ISO C99 from ISO C2X.
   251  //    __STDC_WANT_LIB_EXT2__
   252  // 			Extensions to ISO C99 from TR 27431-2:2010.
   253  //    __STDC_WANT_IEC_60559_BFP_EXT__
   254  // 			Extensions to ISO C11 from TS 18661-1:2014.
   255  //    __STDC_WANT_IEC_60559_FUNCS_EXT__
   256  // 			Extensions to ISO C11 from TS 18661-4:2015.
   257  //    __STDC_WANT_IEC_60559_TYPES_EXT__
   258  // 			Extensions to ISO C11 from TS 18661-3:2015.
   259  //    __STDC_WANT_IEC_60559_EXT__
   260  // 			ISO C2X interfaces defined only in Annex F.
   261  //
   262  //    _POSIX_SOURCE	IEEE Std 1003.1.
   263  //    _POSIX_C_SOURCE	If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2;
   264  // 			if >=199309L, add IEEE Std 1003.1b-1993;
   265  // 			if >=199506L, add IEEE Std 1003.1c-1995;
   266  // 			if >=200112L, all of IEEE 1003.1-2004
   267  // 			if >=200809L, all of IEEE 1003.1-2008
   268  //    _XOPEN_SOURCE	Includes POSIX and XPG things.  Set to 500 if
   269  // 			Single Unix conformance is wanted, to 600 for the
   270  // 			sixth revision, to 700 for the seventh revision.
   271  //    _XOPEN_SOURCE_EXTENDED XPG things and X/Open Unix extensions.
   272  //    _LARGEFILE_SOURCE	Some more functions for correct standard I/O.
   273  //    _LARGEFILE64_SOURCE	Additional functionality from LFS for large files.
   274  //    _FILE_OFFSET_BITS=N	Select default filesystem interface.
   275  //    _ATFILE_SOURCE	Additional *at interfaces.
   276  //    _DYNAMIC_STACK_SIZE_SOURCE Select correct (but non compile-time constant)
   277  // 			MINSIGSTKSZ, SIGSTKSZ and PTHREAD_STACK_MIN.
   278  //    _GNU_SOURCE		All of the above, plus GNU extensions.
   279  //    _DEFAULT_SOURCE	The default set of features (taking precedence over
   280  // 			__STRICT_ANSI__).
   281  //
   282  //    _FORTIFY_SOURCE	Add security hardening to many library functions.
   283  // 			Set to 1 or 2; 2 performs stricter checks than 1.
   284  //
   285  //    _REENTRANT, _THREAD_SAFE
   286  // 			Obsolete; equivalent to _POSIX_C_SOURCE=199506L.
   287  //
   288  //    The `-ansi' switch to the GNU C compiler, and standards conformance
   289  //    options such as `-std=c99', define __STRICT_ANSI__.  If none of
   290  //    these are defined, or if _DEFAULT_SOURCE is defined, the default is
   291  //    to have _POSIX_SOURCE set to one and _POSIX_C_SOURCE set to
   292  //    200809L, as well as enabling miscellaneous functions from BSD and
   293  //    SVID.  If more than one of these are defined, they accumulate.  For
   294  //    example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE together
   295  //    give you ISO C, 1003.1, and 1003.2, but nothing else.
   296  //
   297  //    These are defined by this file and are used by the
   298  //    header files to decide what to declare or define:
   299  //
   300  //    __GLIBC_USE (F)	Define things from feature set F.  This is defined
   301  // 			to 1 or 0; the subsequent macros are either defined
   302  // 			or undefined, and those tests should be moved to
   303  // 			__GLIBC_USE.
   304  //    __USE_ISOC11		Define ISO C11 things.
   305  //    __USE_ISOC99		Define ISO C99 things.
   306  //    __USE_ISOC95		Define ISO C90 AMD1 (C95) things.
   307  //    __USE_ISOCXX11	Define ISO C++11 things.
   308  //    __USE_POSIX		Define IEEE Std 1003.1 things.
   309  //    __USE_POSIX2		Define IEEE Std 1003.2 things.
   310  //    __USE_POSIX199309	Define IEEE Std 1003.1, and .1b things.
   311  //    __USE_POSIX199506	Define IEEE Std 1003.1, .1b, .1c and .1i things.
   312  //    __USE_XOPEN		Define XPG things.
   313  //    __USE_XOPEN_EXTENDED	Define X/Open Unix things.
   314  //    __USE_UNIX98		Define Single Unix V2 things.
   315  //    __USE_XOPEN2K        Define XPG6 things.
   316  //    __USE_XOPEN2KXSI     Define XPG6 XSI things.
   317  //    __USE_XOPEN2K8       Define XPG7 things.
   318  //    __USE_XOPEN2K8XSI    Define XPG7 XSI things.
   319  //    __USE_LARGEFILE	Define correct standard I/O things.
   320  //    __USE_LARGEFILE64	Define LFS things with separate names.
   321  //    __USE_FILE_OFFSET64	Define 64bit interface as default.
   322  //    __USE_MISC		Define things from 4.3BSD or System V Unix.
   323  //    __USE_ATFILE		Define *at interfaces and AT_* constants for them.
   324  //    __USE_DYNAMIC_STACK_SIZE Define correct (but non compile-time constant)
   325  // 			MINSIGSTKSZ, SIGSTKSZ and PTHREAD_STACK_MIN.
   326  //    __USE_GNU		Define GNU extensions.
   327  //    __USE_FORTIFY_LEVEL	Additional security measures used, according to level.
   328  //
   329  //    The macros `__GNU_LIBRARY__', `__GLIBC__', and `__GLIBC_MINOR__' are
   330  //    defined by this file unconditionally.  `__GNU_LIBRARY__' is provided
   331  //    only for compatibility.  All new code should use the other symbols
   332  //    to test for features.
   333  //
   334  //    All macros listed above as possibly being defined by this file are
   335  //    explicitly undefined if they are not explicitly defined.
   336  //    Feature-test macros that are not defined by the user or compiler
   337  //    but are implied by the other feature-test macros defined (or by the
   338  //    lack of any definitions) are defined by the file.
   339  //
   340  //    ISO C feature test macros depend on the definition of the macro
   341  //    when an affected header is included, not when the first system
   342  //    header is included, and so they are handled in
   343  //    <bits/libc-header-start.h>, which does not have a multiple include
   344  //    guard.  Feature test macros that can be handled from the first
   345  //    system header included are handled here.
   346  
   347  // Undefine everything, so we get a clean slate.
   348  
   349  // Suppress kernel-name space pollution unless user expressedly asks
   350  //    for it.
   351  
   352  // Convenience macro to test the version of gcc.
   353  //    Use like this:
   354  //    #if __GNUC_PREREQ (2,8)
   355  //    ... code requiring gcc 2.8 or later ...
   356  //    #endif
   357  //    Note: only works for GCC 2.0 and later, because __GNUC_MINOR__ was
   358  //    added in 2.0.
   359  
   360  // Similarly for clang.  Features added to GCC after version 4.2 may
   361  //    or may not also be available in clang, and clang's definitions of
   362  //    __GNUC(_MINOR)__ are fixed at 4 and 2 respectively.  Not all such
   363  //    features can be queried via __has_extension/__has_feature.
   364  
   365  // Whether to use feature set F.
   366  
   367  // _BSD_SOURCE and _SVID_SOURCE are deprecated aliases for
   368  //    _DEFAULT_SOURCE.  If _DEFAULT_SOURCE is present we do not
   369  //    issue a warning; the expectation is that the source is being
   370  //    transitioned to use the new macro.
   371  
   372  // If _GNU_SOURCE was defined by the user, turn on all the other features.
   373  
   374  // If nothing (other than _GNU_SOURCE and _DEFAULT_SOURCE) is defined,
   375  //    define _DEFAULT_SOURCE.
   376  
   377  // This is to enable the ISO C2X extension.
   378  
   379  // This is to enable the ISO C11 extension.
   380  
   381  // This is to enable the ISO C99 extension.
   382  
   383  // This is to enable the ISO C90 Amendment 1:1995 extension.
   384  
   385  // If none of the ANSI/POSIX macros are defined, or if _DEFAULT_SOURCE
   386  //    is defined, use POSIX.1-2008 (or another version depending on
   387  //    _XOPEN_SOURCE).
   388  
   389  // Some C libraries once required _REENTRANT and/or _THREAD_SAFE to be
   390  //    defined in all multithreaded code.  GNU libc has not required this
   391  //    for many years.  We now treat them as compatibility synonyms for
   392  //    _POSIX_C_SOURCE=199506L, which is the earliest level of POSIX with
   393  //    comprehensive support for multithreaded code.  Using them never
   394  //    lowers the selected level of POSIX conformance, only raises it.
   395  
   396  // Features part to handle 64-bit time_t support.
   397  //    Copyright (C) 2021 Free Software Foundation, Inc.
   398  //    This file is part of the GNU C Library.
   399  //
   400  //    The GNU C Library is free software; you can redistribute it and/or
   401  //    modify it under the terms of the GNU Lesser General Public
   402  //    License as published by the Free Software Foundation; either
   403  //    version 2.1 of the License, or (at your option) any later version.
   404  //
   405  //    The GNU C Library is distributed in the hope that it will be useful,
   406  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   407  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   408  //    Lesser General Public License for more details.
   409  //
   410  //    You should have received a copy of the GNU Lesser General Public
   411  //    License along with the GNU C Library; if not, see
   412  //    <https://www.gnu.org/licenses/>.
   413  
   414  // We need to know the word size in order to check the time size.
   415  // Determine the wordsize from the preprocessor defines.  RISC-V version.
   416  //    Copyright (C) 2002-2021 Free Software Foundation, Inc.
   417  //    This file is part of the GNU C Library.
   418  //
   419  //    The GNU C Library is free software; you can redistribute it and/or
   420  //    modify it under the terms of the GNU Lesser General Public
   421  //    License as published by the Free Software Foundation; either
   422  //    version 2.1 of the License, or (at your option) any later version.
   423  //
   424  //    The GNU C Library is distributed in the hope that it will be useful,
   425  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   426  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   427  //    Lesser General Public License for more details.
   428  //
   429  //    You should have received a copy of the GNU Lesser General Public
   430  //    License along with the GNU C Library.  If not, see
   431  //    <https://www.gnu.org/licenses/>.
   432  
   433  // Bit size of the time_t type at glibc build time, RISC-V case.
   434  //    Copyright (C) 2020-2021 Free Software Foundation, Inc.
   435  //    This file is part of the GNU C Library.
   436  //
   437  //    The GNU C Library is free software; you can redistribute it and/or
   438  //    modify it under the terms of the GNU Lesser General Public
   439  //    License as published by the Free Software Foundation; either
   440  //    version 2.1 of the License, or (at your option) any later version.
   441  //
   442  //    The GNU C Library is distributed in the hope that it will be useful,
   443  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   444  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   445  //    Lesser General Public License for more details.
   446  //
   447  //    You should have received a copy of the GNU Lesser General Public
   448  //    License along with the GNU C Library; if not, see
   449  //    <https://www.gnu.org/licenses/>.
   450  
   451  // Determine the wordsize from the preprocessor defines.  RISC-V version.
   452  //    Copyright (C) 2002-2021 Free Software Foundation, Inc.
   453  //    This file is part of the GNU C Library.
   454  //
   455  //    The GNU C Library is free software; you can redistribute it and/or
   456  //    modify it under the terms of the GNU Lesser General Public
   457  //    License as published by the Free Software Foundation; either
   458  //    version 2.1 of the License, or (at your option) any later version.
   459  //
   460  //    The GNU C Library is distributed in the hope that it will be useful,
   461  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   462  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   463  //    Lesser General Public License for more details.
   464  //
   465  //    You should have received a copy of the GNU Lesser General Public
   466  //    License along with the GNU C Library.  If not, see
   467  //    <https://www.gnu.org/licenses/>.
   468  
   469  // RV32 and RV64 both use 64-bit time_t
   470  
   471  // The function 'gets' existed in C89, but is impossible to use
   472  //    safely.  It has been removed from ISO C11 and ISO C++14.  Note: for
   473  //    compatibility with various implementations of <cstdio>, this test
   474  //    must consider only the value of __cplusplus when compiling C++.
   475  
   476  // GNU formerly extended the scanf functions with modified format
   477  //    specifiers %as, %aS, and %a[...] that allocate a buffer for the
   478  //    input using malloc.  This extension conflicts with ISO C99, which
   479  //    defines %a as a standalone format specifier that reads a floating-
   480  //    point number; moreover, POSIX.1-2008 provides the same feature
   481  //    using the modifier letter 'm' instead (%ms, %mS, %m[...]).
   482  //
   483  //    We now follow C99 unless GNU extensions are active and the compiler
   484  //    is specifically in C89 or C++98 mode (strict or not).  For
   485  //    instance, with GCC, -std=gnu11 will have C99-compliant scanf with
   486  //    or without -D_GNU_SOURCE, but -std=c89 -D_GNU_SOURCE will have the
   487  //    old extension.
   488  
   489  // Get definitions of __STDC_* predefined macros, if the compiler has
   490  //    not preincluded this header automatically.
   491  // Copyright (C) 1991-2021 Free Software Foundation, Inc.
   492  //    This file is part of the GNU C Library.
   493  //
   494  //    The GNU C Library is free software; you can redistribute it and/or
   495  //    modify it under the terms of the GNU Lesser General Public
   496  //    License as published by the Free Software Foundation; either
   497  //    version 2.1 of the License, or (at your option) any later version.
   498  //
   499  //    The GNU C Library is distributed in the hope that it will be useful,
   500  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   501  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   502  //    Lesser General Public License for more details.
   503  //
   504  //    You should have received a copy of the GNU Lesser General Public
   505  //    License along with the GNU C Library; if not, see
   506  //    <https://www.gnu.org/licenses/>.
   507  
   508  // This macro indicates that the installed library is the GNU C Library.
   509  //    For historic reasons the value now is 6 and this will stay from now
   510  //    on.  The use of this variable is deprecated.  Use __GLIBC__ and
   511  //    __GLIBC_MINOR__ now (see below) when you want to test for a specific
   512  //    GNU C library version and use the values in <gnu/lib-names.h> to get
   513  //    the sonames of the shared libraries.
   514  
   515  // Major and minor version number of the GNU C library package.  Use
   516  //    these macros to test for features in specific releases.
   517  
   518  // This is here only because every header file already includes this one.
   519  // Copyright (C) 1992-2021 Free Software Foundation, Inc.
   520  //    This file is part of the GNU C Library.
   521  //
   522  //    The GNU C Library is free software; you can redistribute it and/or
   523  //    modify it under the terms of the GNU Lesser General Public
   524  //    License as published by the Free Software Foundation; either
   525  //    version 2.1 of the License, or (at your option) any later version.
   526  //
   527  //    The GNU C Library is distributed in the hope that it will be useful,
   528  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   529  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   530  //    Lesser General Public License for more details.
   531  //
   532  //    You should have received a copy of the GNU Lesser General Public
   533  //    License along with the GNU C Library; if not, see
   534  //    <https://www.gnu.org/licenses/>.
   535  
   536  // We are almost always included from features.h.
   537  
   538  // The GNU libc does not support any K&R compilers or the traditional mode
   539  //    of ISO C compilers anymore.  Check for some of the combinations not
   540  //    supported anymore.
   541  
   542  // Some user header file might have defined this before.
   543  
   544  // Compilers that lack __has_attribute may object to
   545  //        #if defined __has_attribute && __has_attribute (...)
   546  //    even though they do not need to evaluate the right-hand side of the &&.
   547  //    Similarly for __has_builtin, etc.
   548  
   549  // All functions, except those with callbacks or those that
   550  //    synchronize memory, are leaf functions.
   551  
   552  // GCC can always grok prototypes.  For C++ programs we add throw()
   553  //    to help it optimize the function calls.  But this only works with
   554  //    gcc 2.8.x and egcs.  For gcc 3.4 and up we even mark C functions
   555  //    as non-throwing using a function attribute since programs can use
   556  //    the -fexceptions options for C code as well.
   557  
   558  // These two macros are not used in glibc anymore.  They are kept here
   559  //    only because some other projects expect the macros to be defined.
   560  
   561  // For these things, GCC behaves the ANSI way normally,
   562  //    and the non-ANSI way under -traditional.
   563  
   564  // This is not a typedef so `const __ptr_t' does the right thing.
   565  
   566  // C++ needs to know that types and declarations are C, not C++.
   567  
   568  // Fortify support.
   569  
   570  // Use __builtin_dynamic_object_size at _FORTIFY_SOURCE=3 when available.
   571  
   572  // Support for flexible arrays.
   573  //    Headers that should use flexible arrays only if they're "real"
   574  //    (e.g. only if they won't affect sizeof()) should test
   575  //    #if __glibc_c99_flexarr_available.
   576  
   577  // __asm__ ("xyz") is used throughout the headers to rename functions
   578  //    at the assembly language level.  This is wrapped by the __REDIRECT
   579  //    macro, in order to support compilers that can do this some other
   580  //    way.  When compilers don't support asm-names at all, we have to do
   581  //    preprocessor tricks instead (which don't have exactly the right
   582  //    semantics, but it's the best we can do).
   583  //
   584  //    Example:
   585  //    int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid);
   586  
   587  //
   588  // #elif __SOME_OTHER_COMPILER__
   589  //
   590  // # define __REDIRECT(name, proto, alias) name proto; 	_Pragma("let " #name " = " #alias)
   591  
   592  // GCC and clang have various useful declarations that can be made with
   593  //    the '__attribute__' syntax.  All of the ways we use this do fine if
   594  //    they are omitted for compilers that don't understand it.
   595  
   596  // At some point during the gcc 2.96 development the `malloc' attribute
   597  //    for functions was introduced.  We don't want to use it unconditionally
   598  //    (although this would be possible) since it generates warnings.
   599  
   600  // Tell the compiler which arguments to an allocation function
   601  //    indicate the size of the allocation.
   602  
   603  // At some point during the gcc 2.96 development the `pure' attribute
   604  //    for functions was introduced.  We don't want to use it unconditionally
   605  //    (although this would be possible) since it generates warnings.
   606  
   607  // This declaration tells the compiler that the value is constant.
   608  
   609  // At some point during the gcc 3.1 development the `used' attribute
   610  //    for functions was introduced.  We don't want to use it unconditionally
   611  //    (although this would be possible) since it generates warnings.
   612  
   613  // Since version 3.2, gcc allows marking deprecated functions.
   614  
   615  // Since version 4.5, gcc also allows one to specify the message printed
   616  //    when a deprecated function is used.  clang claims to be gcc 4.2, but
   617  //    may also support this feature.
   618  
   619  // At some point during the gcc 2.8 development the `format_arg' attribute
   620  //    for functions was introduced.  We don't want to use it unconditionally
   621  //    (although this would be possible) since it generates warnings.
   622  //    If several `format_arg' attributes are given for the same function, in
   623  //    gcc-3.0 and older, all but the last one are ignored.  In newer gccs,
   624  //    all designated arguments are considered.
   625  
   626  // At some point during the gcc 2.97 development the `strfmon' format
   627  //    attribute for functions was introduced.  We don't want to use it
   628  //    unconditionally (although this would be possible) since it
   629  //    generates warnings.
   630  
   631  // The nonnull function attribute marks pointer parameters that
   632  //    must not be NULL.
   633  
   634  // The returns_nonnull function attribute marks the return type of the function
   635  //    as always being non-null.
   636  
   637  // If fortification mode, we warn about unused results of certain
   638  //    function calls which can lead to problems.
   639  
   640  // Forces a function to be always inlined.
   641  // The Linux kernel defines __always_inline in stddef.h (283d7573), and
   642  //    it conflicts with this definition.  Therefore undefine it first to
   643  //    allow either header to be included first.
   644  
   645  // Associate error messages with the source location of the call site rather
   646  //    than with the source location inside the function.
   647  
   648  // GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
   649  //    inline semantics, unless -fgnu89-inline is used.  Using __GNUC_STDC_INLINE__
   650  //    or __GNUC_GNU_INLINE is not a good enough check for gcc because gcc versions
   651  //    older than 4.3 may define these macros and still not guarantee GNU inlining
   652  //    semantics.
   653  //
   654  //    clang++ identifies itself as gcc-4.2, but has support for GNU inlining
   655  //    semantics, that can be checked for by using the __GNUC_STDC_INLINE_ and
   656  //    __GNUC_GNU_INLINE__ macro definitions.
   657  
   658  // GCC 4.3 and above allow passing all anonymous arguments of an
   659  //    __extern_always_inline function to some other vararg function.
   660  
   661  // It is possible to compile containing GCC extensions even if GCC is
   662  //    run in pedantic mode if the uses are carefully marked using the
   663  //    `__extension__' keyword.  But this is not generally available before
   664  //    version 2.8.
   665  
   666  // __restrict is known in EGCS 1.2 and above, and in clang.
   667  //    It works also in C++ mode (outside of arrays), but only when spelled
   668  //    as '__restrict', not 'restrict'.
   669  
   670  // ISO C99 also allows to declare arrays as non-overlapping.  The syntax is
   671  //      array_name[restrict]
   672  //    GCC 3.1 and clang support this.
   673  //    This syntax is not usable in C++ mode.
   674  
   675  // Describes a char array whose address can safely be passed as the first
   676  //    argument to strncpy and strncat, as the char array is not necessarily
   677  //    a NUL-terminated string.
   678  
   679  // Undefine (also defined in libc-symbols.h).
   680  // Copies attributes from the declaration or type referenced by
   681  //    the argument.
   682  
   683  // The #ifndef lets Gnulib avoid including these on non-glibc
   684  //    platforms, where the includes typically do not exist.
   685  // Determine the wordsize from the preprocessor defines.  RISC-V version.
   686  //    Copyright (C) 2002-2021 Free Software Foundation, Inc.
   687  //    This file is part of the GNU C Library.
   688  //
   689  //    The GNU C Library is free software; you can redistribute it and/or
   690  //    modify it under the terms of the GNU Lesser General Public
   691  //    License as published by the Free Software Foundation; either
   692  //    version 2.1 of the License, or (at your option) any later version.
   693  //
   694  //    The GNU C Library is distributed in the hope that it will be useful,
   695  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   696  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   697  //    Lesser General Public License for more details.
   698  //
   699  //    You should have received a copy of the GNU Lesser General Public
   700  //    License along with the GNU C Library.  If not, see
   701  //    <https://www.gnu.org/licenses/>.
   702  
   703  // Properties of long double type.  ldbl-128 version.
   704  //    Copyright (C) 2016-2021 Free Software Foundation, Inc.
   705  //    This file is part of the GNU C Library.
   706  //
   707  //    The GNU C Library is free software; you can redistribute it and/or
   708  //    modify it under the terms of the GNU Lesser General Public
   709  //    License  published by the Free Software Foundation; either
   710  //    version 2.1 of the License, or (at your option) any later version.
   711  //
   712  //    The GNU C Library is distributed in the hope that it will be useful,
   713  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   714  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   715  //    Lesser General Public License for more details.
   716  //
   717  //    You should have received a copy of the GNU Lesser General Public
   718  //    License along with the GNU C Library; if not, see
   719  //    <https://www.gnu.org/licenses/>.
   720  
   721  // long double is distinct from double, so there is nothing to
   722  //    define here.
   723  
   724  // __glibc_macro_warning (MESSAGE) issues warning MESSAGE.  This is
   725  //    intended for use in preprocessor macros.
   726  //
   727  //    Note: MESSAGE must be a _single_ string; concatenation of string
   728  //    literals is not supported.
   729  
   730  // Generic selection (ISO C11) is a C-only feature, available in GCC
   731  //    since version 4.9.  Previous versions do not provide generic
   732  //    selection, even though they might set __STDC_VERSION__ to 201112L,
   733  //    when in -std=c11 mode.  Thus, we must check for !defined __GNUC__
   734  //    when testing __STDC_VERSION__ for generic selection support.
   735  //    On the other hand, Clang also defines __GNUC__, so a clang-specific
   736  //    check is required to enable the use of generic selection.
   737  
   738  // Designates a 1-based positional argument ref-index of pointer type
   739  //    that can be used to access size-index elements of the pointed-to
   740  //    array according to access mode, or at least one element when
   741  //    size-index is not provided:
   742  //      access (access-mode, <ref-index> [, <size-index>])
   743  
   744  // Designates dealloc as a function to call to deallocate objects
   745  //    allocated by the declared function.
   746  
   747  // Specify that a function such as setjmp or vfork may return
   748  //    twice.
   749  
   750  // If we don't have __REDIRECT, prototypes will be missing if
   751  //    __USE_FILE_OFFSET64 but not __USE_LARGEFILE[64].
   752  
   753  // Decide whether we can define 'extern inline' functions in headers.
   754  
   755  // This is here only because every header file already includes this one.
   756  //    Get the definitions of all the appropriate `__stub_FUNCTION' symbols.
   757  //    <gnu/stubs.h> contains `#define __stub_FUNCTION' when FUNCTION is a stub
   758  //    that will always return failure (and set errno to ENOSYS).
   759  // This file is automatically generated.
   760  //    This file selects the right generated file of `__stub_FUNCTION' macros
   761  //    based on the architecture being compiled for.
   762  
   763  // Determine the wordsize from the preprocessor defines.  RISC-V version.
   764  //    Copyright (C) 2002-2021 Free Software Foundation, Inc.
   765  //    This file is part of the GNU C Library.
   766  //
   767  //    The GNU C Library is free software; you can redistribute it and/or
   768  //    modify it under the terms of the GNU Lesser General Public
   769  //    License as published by the Free Software Foundation; either
   770  //    version 2.1 of the License, or (at your option) any later version.
   771  //
   772  //    The GNU C Library is distributed in the hope that it will be useful,
   773  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   774  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   775  //    Lesser General Public License for more details.
   776  //
   777  //    You should have received a copy of the GNU Lesser General Public
   778  //    License along with the GNU C Library.  If not, see
   779  //    <https://www.gnu.org/licenses/>.
   780  
   781  // This file is automatically generated.
   782  //    It defines a symbol `__stub_FUNCTION' for each function
   783  //    in the C library which is a stub, meaning it will fail
   784  //    every time called, usually setting errno to ENOSYS.
   785  
   786  // Definitions for POSIX 1003.1b-1993 (aka POSIX.4) scheduling interface.
   787  //    Copyright (C) 1996-2021 Free Software Foundation, Inc.
   788  //    This file is part of the GNU C Library.
   789  //
   790  //    The GNU C Library is free software; you can redistribute it and/or
   791  //    modify it under the terms of the GNU Lesser General Public
   792  //    License as published by the Free Software Foundation; either
   793  //    version 2.1 of the License, or (at your option) any later version.
   794  //
   795  //    The GNU C Library is distributed in the hope that it will be useful,
   796  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   797  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   798  //    Lesser General Public License for more details.
   799  //
   800  //    You should have received a copy of the GNU Lesser General Public
   801  //    License along with the GNU C Library; if not, see
   802  //    <https://www.gnu.org/licenses/>.
   803  
   804  // Copyright (C) 1991-2021 Free Software Foundation, Inc.
   805  //    This file is part of the GNU C Library.
   806  //
   807  //    The GNU C Library is free software; you can redistribute it and/or
   808  //    modify it under the terms of the GNU Lesser General Public
   809  //    License as published by the Free Software Foundation; either
   810  //    version 2.1 of the License, or (at your option) any later version.
   811  //
   812  //    The GNU C Library is distributed in the hope that it will be useful,
   813  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   814  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   815  //    Lesser General Public License for more details.
   816  //
   817  //    You should have received a copy of the GNU Lesser General Public
   818  //    License along with the GNU C Library; if not, see
   819  //    <https://www.gnu.org/licenses/>.
   820  
   821  // Get type definitions.
   822  // bits/types.h -- definitions of __*_t types underlying *_t types.
   823  //    Copyright (C) 2002-2021 Free Software Foundation, Inc.
   824  //    This file is part of the GNU C Library.
   825  //
   826  //    The GNU C Library is free software; you can redistribute it and/or
   827  //    modify it under the terms of the GNU Lesser General Public
   828  //    License as published by the Free Software Foundation; either
   829  //    version 2.1 of the License, or (at your option) any later version.
   830  //
   831  //    The GNU C Library is distributed in the hope that it will be useful,
   832  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   833  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   834  //    Lesser General Public License for more details.
   835  //
   836  //    You should have received a copy of the GNU Lesser General Public
   837  //    License along with the GNU C Library; if not, see
   838  //    <https://www.gnu.org/licenses/>.
   839  
   840  // Never include this file directly; use <sys/types.h> instead.
   841  
   842  // Copyright (C) 1991-2021 Free Software Foundation, Inc.
   843  //    This file is part of the GNU C Library.
   844  //
   845  //    The GNU C Library is free software; you can redistribute it and/or
   846  //    modify it under the terms of the GNU Lesser General Public
   847  //    License as published by the Free Software Foundation; either
   848  //    version 2.1 of the License, or (at your option) any later version.
   849  //
   850  //    The GNU C Library is distributed in the hope that it will be useful,
   851  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   852  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   853  //    Lesser General Public License for more details.
   854  //
   855  //    You should have received a copy of the GNU Lesser General Public
   856  //    License along with the GNU C Library; if not, see
   857  //    <https://www.gnu.org/licenses/>.
   858  
   859  // Determine the wordsize from the preprocessor defines.  RISC-V version.
   860  //    Copyright (C) 2002-2021 Free Software Foundation, Inc.
   861  //    This file is part of the GNU C Library.
   862  //
   863  //    The GNU C Library is free software; you can redistribute it and/or
   864  //    modify it under the terms of the GNU Lesser General Public
   865  //    License as published by the Free Software Foundation; either
   866  //    version 2.1 of the License, or (at your option) any later version.
   867  //
   868  //    The GNU C Library is distributed in the hope that it will be useful,
   869  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   870  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   871  //    Lesser General Public License for more details.
   872  //
   873  //    You should have received a copy of the GNU Lesser General Public
   874  //    License along with the GNU C Library.  If not, see
   875  //    <https://www.gnu.org/licenses/>.
   876  
   877  // Bit size of the time_t type at glibc build time, RISC-V case.
   878  //    Copyright (C) 2020-2021 Free Software Foundation, Inc.
   879  //    This file is part of the GNU C Library.
   880  //
   881  //    The GNU C Library is free software; you can redistribute it and/or
   882  //    modify it under the terms of the GNU Lesser General Public
   883  //    License as published by the Free Software Foundation; either
   884  //    version 2.1 of the License, or (at your option) any later version.
   885  //
   886  //    The GNU C Library is distributed in the hope that it will be useful,
   887  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   888  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   889  //    Lesser General Public License for more details.
   890  //
   891  //    You should have received a copy of the GNU Lesser General Public
   892  //    License along with the GNU C Library; if not, see
   893  //    <https://www.gnu.org/licenses/>.
   894  
   895  // Determine the wordsize from the preprocessor defines.  RISC-V version.
   896  //    Copyright (C) 2002-2021 Free Software Foundation, Inc.
   897  //    This file is part of the GNU C Library.
   898  //
   899  //    The GNU C Library is free software; you can redistribute it and/or
   900  //    modify it under the terms of the GNU Lesser General Public
   901  //    License as published by the Free Software Foundation; either
   902  //    version 2.1 of the License, or (at your option) any later version.
   903  //
   904  //    The GNU C Library is distributed in the hope that it will be useful,
   905  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   906  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   907  //    Lesser General Public License for more details.
   908  //
   909  //    You should have received a copy of the GNU Lesser General Public
   910  //    License along with the GNU C Library.  If not, see
   911  //    <https://www.gnu.org/licenses/>.
   912  
   913  // RV32 and RV64 both use 64-bit time_t
   914  
   915  // Convenience types.
   916  type X__u_char = uint8   /* types.h:31:23 */
   917  type X__u_short = uint16 /* types.h:32:28 */
   918  type X__u_int = uint32   /* types.h:33:22 */
   919  type X__u_long = uint64  /* types.h:34:27 */
   920  
   921  // Fixed-size types, underlying types depend on word size and compiler.
   922  type X__int8_t = int8     /* types.h:37:21 */
   923  type X__uint8_t = uint8   /* types.h:38:23 */
   924  type X__int16_t = int16   /* types.h:39:26 */
   925  type X__uint16_t = uint16 /* types.h:40:28 */
   926  type X__int32_t = int32   /* types.h:41:20 */
   927  type X__uint32_t = uint32 /* types.h:42:22 */
   928  type X__int64_t = int64   /* types.h:44:25 */
   929  type X__uint64_t = uint64 /* types.h:45:27 */
   930  
   931  // Smallest types with at least a given width.
   932  type X__int_least8_t = X__int8_t     /* types.h:52:18 */
   933  type X__uint_least8_t = X__uint8_t   /* types.h:53:19 */
   934  type X__int_least16_t = X__int16_t   /* types.h:54:19 */
   935  type X__uint_least16_t = X__uint16_t /* types.h:55:20 */
   936  type X__int_least32_t = X__int32_t   /* types.h:56:19 */
   937  type X__uint_least32_t = X__uint32_t /* types.h:57:20 */
   938  type X__int_least64_t = X__int64_t   /* types.h:58:19 */
   939  type X__uint_least64_t = X__uint64_t /* types.h:59:20 */
   940  
   941  // quad_t is also 64 bits.
   942  type X__quad_t = int64    /* types.h:63:18 */
   943  type X__u_quad_t = uint64 /* types.h:64:27 */
   944  
   945  // Largest integral types.
   946  type X__intmax_t = int64   /* types.h:72:18 */
   947  type X__uintmax_t = uint64 /* types.h:73:27 */
   948  
   949  // The machine-dependent file <bits/typesizes.h> defines __*_T_TYPE
   950  //    macros for each of the OS types we define below.  The definitions
   951  //    of those macros must use the following macros for underlying types.
   952  //    We define __S<SIZE>_TYPE and __U<SIZE>_TYPE for the signed and unsigned
   953  //    variants of each of the following integer types on this machine.
   954  //
   955  // 	16		-- "natural" 16-bit type (always short)
   956  // 	32		-- "natural" 32-bit type (always int)
   957  // 	64		-- "natural" 64-bit type (long or long long)
   958  // 	LONG32		-- 32-bit type, traditionally long
   959  // 	QUAD		-- 64-bit type, traditionally long long
   960  // 	WORD		-- natural type of __WORDSIZE bits (int or long)
   961  // 	LONGWORD	-- type of __WORDSIZE bits, traditionally long
   962  //
   963  //    We distinguish WORD/LONGWORD, 32/LONG32, and 64/QUAD so that the
   964  //    conventional uses of `long' or `long long' type modifiers match the
   965  //    types we define, even when a less-adorned type would be the same size.
   966  //    This matters for (somewhat) portably writing printf/scanf formats for
   967  //    these types, where using the appropriate l or ll format modifiers can
   968  //    make the typedefs and the formats match up across all GNU platforms.  If
   969  //    we used `long' when it's 64 bits where `long long' is expected, then the
   970  //    compiler would warn about the formats not matching the argument types,
   971  //    and the programmer changing them to shut up the compiler would break the
   972  //    program's portability.
   973  //
   974  //    Here we assume what is presently the case in all the GCC configurations
   975  //    we support: long long is always 64 bits, long is always word/address size,
   976  //    and int is always 32 bits.
   977  
   978  // No need to mark the typedef with __extension__.
   979  // bits/typesizes.h -- underlying types for *_t.  For the generic Linux ABI.
   980  //    Copyright (C) 2011-2021 Free Software Foundation, Inc.
   981  //    This file is part of the GNU C Library.
   982  //    Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
   983  //
   984  //    The GNU C Library is free software; you can redistribute it and/or
   985  //    modify it under the terms of the GNU Lesser General Public
   986  //    License as published by the Free Software Foundation; either
   987  //    version 2.1 of the License, or (at your option) any later version.
   988  //
   989  //    The GNU C Library is distributed in the hope that it will be useful,
   990  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   991  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   992  //    Lesser General Public License for more details.
   993  //
   994  //    You should have received a copy of the GNU Lesser General Public
   995  //    License along with the GNU C Library.  If not, see
   996  //    <https://www.gnu.org/licenses/>.
   997  
   998  // See <bits/types.h> for the meaning of these macros.  This file exists so
   999  //    that <bits/types.h> need not vary across different GNU platforms.
  1000  
  1001  // Tell the libc code that off_t and off64_t are actually the same type
  1002  //    for all ABI purposes, even if possibly expressed as different base types
  1003  //    for C type-checking purposes.
  1004  
  1005  // Same for ino_t and ino64_t.
  1006  
  1007  // And for __rlim_t and __rlim64_t.
  1008  
  1009  // And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t.
  1010  
  1011  // And for getitimer, setitimer and rusage
  1012  
  1013  // Number of descriptors that can fit in an `fd_set'.
  1014  
  1015  // bits/time64.h -- underlying types for __time64_t.  RISC-V version.
  1016  //    Copyright (C) 2020-2021 Free Software Foundation, Inc.
  1017  //    This file is part of the GNU C Library.
  1018  //
  1019  //    The GNU C Library is free software; you can redistribute it and/or
  1020  //    modify it under the terms of the GNU Lesser General Public
  1021  //    License as published by the Free Software Foundation; either
  1022  //    version 2.1 of the License, or (at your option) any later version.
  1023  //
  1024  //    The GNU C Library is distributed in the hope that it will be useful,
  1025  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1026  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1027  //    Lesser General Public License for more details.
  1028  //
  1029  //    You should have received a copy of the GNU Lesser General Public
  1030  //    License along with the GNU C Library; if not, see
  1031  //    <https://www.gnu.org/licenses/>.
  1032  
  1033  // Define __TIME64_T_TYPE so that it is always a 64-bit type.
  1034  
  1035  // If we already have 64-bit time type then use it.
  1036  
  1037  type X__dev_t = uint64                     /* types.h:145:25 */ // Type of device numbers.
  1038  type X__uid_t = uint32                     /* types.h:146:25 */ // Type of user identifications.
  1039  type X__gid_t = uint32                     /* types.h:147:25 */ // Type of group identifications.
  1040  type X__ino_t = uint64                     /* types.h:148:25 */ // Type of file serial numbers.
  1041  type X__ino64_t = uint64                   /* types.h:149:27 */ // Type of file serial numbers (LFS).
  1042  type X__mode_t = uint32                    /* types.h:150:26 */ // Type of file attribute bitmasks.
  1043  type X__nlink_t = uint32                   /* types.h:151:27 */ // Type of file link counts.
  1044  type X__off_t = int64                      /* types.h:152:25 */ // Type of file sizes and offsets.
  1045  type X__off64_t = int64                    /* types.h:153:27 */ // Type of file sizes and offsets (LFS).
  1046  type X__pid_t = int32                      /* types.h:154:25 */ // Type of process identifications.
  1047  type X__fsid_t = struct{ F__val [2]int32 } /* types.h:155:26 */ // Type of file system IDs.
  1048  type X__clock_t = int64                    /* types.h:156:27 */ // Type of CPU usage counts.
  1049  type X__rlim_t = uint64                    /* types.h:157:26 */ // Type for resource measurement.
  1050  type X__rlim64_t = uint64                  /* types.h:158:28 */ // Type for resource measurement (LFS).
  1051  type X__id_t = uint32                      /* types.h:159:24 */ // General type for IDs.
  1052  type X__time_t = int64                     /* types.h:160:26 */ // Seconds since the Epoch.
  1053  type X__useconds_t = uint32                /* types.h:161:30 */ // Count of microseconds.
  1054  type X__suseconds_t = int64                /* types.h:162:31 */ // Signed count of microseconds.
  1055  type X__suseconds64_t = int64              /* types.h:163:33 */
  1056  
  1057  type X__daddr_t = int32 /* types.h:165:27 */ // The type of a disk address.
  1058  type X__key_t = int32   /* types.h:166:25 */ // Type of an IPC key.
  1059  
  1060  // Clock ID used in clock and timer functions.
  1061  type X__clockid_t = int32 /* types.h:169:29 */
  1062  
  1063  // Timer ID returned by `timer_create'.
  1064  type X__timer_t = uintptr /* types.h:172:12 */
  1065  
  1066  // Type to represent block size.
  1067  type X__blksize_t = int32 /* types.h:175:29 */
  1068  
  1069  // Types from the Large File Support interface.
  1070  
  1071  // Type to count number of disk blocks.
  1072  type X__blkcnt_t = int64   /* types.h:180:28 */
  1073  type X__blkcnt64_t = int64 /* types.h:181:30 */
  1074  
  1075  // Type to count file system blocks.
  1076  type X__fsblkcnt_t = uint64   /* types.h:184:30 */
  1077  type X__fsblkcnt64_t = uint64 /* types.h:185:32 */
  1078  
  1079  // Type to count file system nodes.
  1080  type X__fsfilcnt_t = uint64   /* types.h:188:30 */
  1081  type X__fsfilcnt64_t = uint64 /* types.h:189:32 */
  1082  
  1083  // Type of miscellaneous file system fields.
  1084  type X__fsword_t = int64 /* types.h:192:28 */
  1085  
  1086  type X__ssize_t = int64 /* types.h:194:27 */ // Type of a byte count, or error.
  1087  
  1088  // Signed long type used in system calls.
  1089  type X__syscall_slong_t = int64 /* types.h:197:33 */
  1090  // Unsigned long type used in system calls.
  1091  type X__syscall_ulong_t = uint64 /* types.h:199:33 */
  1092  
  1093  // These few don't really vary by system, they always correspond
  1094  //
  1095  //	to one of the other defined types.
  1096  type X__loff_t = X__off64_t /* types.h:203:19 */ // Type of file sizes and offsets (LFS).
  1097  type X__caddr_t = uintptr   /* types.h:204:14 */
  1098  
  1099  // Duplicates info from stdint.h but this is used in unistd.h.
  1100  type X__intptr_t = int64 /* types.h:207:25 */
  1101  
  1102  // Duplicate info from sys/socket.h.
  1103  type X__socklen_t = uint32 /* types.h:210:23 */
  1104  
  1105  // C99: An integer type that can be accessed as an atomic entity,
  1106  //
  1107  //	even in the presence of asynchronous interrupts.
  1108  //	It is not currently necessary for this to be machine-specific.
  1109  type X__sig_atomic_t = int32 /* types.h:215:13 */
  1110  
  1111  // Wide character type.
  1112  //    Locale-writers should change this as necessary to
  1113  //    be big enough to hold unique values not between 0 and 127,
  1114  //    and not (wchar_t) -1, for each defined multibyte character.
  1115  
  1116  // Define this type if we are doing the whole job,
  1117  //    or if we want this type in particular.
  1118  
  1119  // A null pointer constant.
  1120  
  1121  // bits/types.h -- definitions of __*_t types underlying *_t types.
  1122  //    Copyright (C) 2002-2021 Free Software Foundation, Inc.
  1123  //    This file is part of the GNU C Library.
  1124  //
  1125  //    The GNU C Library is free software; you can redistribute it and/or
  1126  //    modify it under the terms of the GNU Lesser General Public
  1127  //    License as published by the Free Software Foundation; either
  1128  //    version 2.1 of the License, or (at your option) any later version.
  1129  //
  1130  //    The GNU C Library is distributed in the hope that it will be useful,
  1131  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1132  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1133  //    Lesser General Public License for more details.
  1134  //
  1135  //    You should have received a copy of the GNU Lesser General Public
  1136  //    License along with the GNU C Library; if not, see
  1137  //    <https://www.gnu.org/licenses/>.
  1138  
  1139  // Never include this file directly; use <sys/types.h> instead.
  1140  
  1141  // Returned by `time'.
  1142  type Time_t = X__time_t /* time_t.h:10:18 */
  1143  
  1144  // NB: Include guard matches what <linux/time.h> uses.
  1145  
  1146  // bits/types.h -- definitions of __*_t types underlying *_t types.
  1147  //    Copyright (C) 2002-2021 Free Software Foundation, Inc.
  1148  //    This file is part of the GNU C Library.
  1149  //
  1150  //    The GNU C Library is free software; you can redistribute it and/or
  1151  //    modify it under the terms of the GNU Lesser General Public
  1152  //    License as published by the Free Software Foundation; either
  1153  //    version 2.1 of the License, or (at your option) any later version.
  1154  //
  1155  //    The GNU C Library is distributed in the hope that it will be useful,
  1156  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1157  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1158  //    Lesser General Public License for more details.
  1159  //
  1160  //    You should have received a copy of the GNU Lesser General Public
  1161  //    License along with the GNU C Library; if not, see
  1162  //    <https://www.gnu.org/licenses/>.
  1163  
  1164  // Never include this file directly; use <sys/types.h> instead.
  1165  
  1166  // Endian macros for string.h functions
  1167  //    Copyright (C) 1992-2021 Free Software Foundation, Inc.
  1168  //    This file is part of the GNU C Library.
  1169  //
  1170  //    The GNU C Library is free software; you can redistribute it and/or
  1171  //    modify it under the terms of the GNU Lesser General Public
  1172  //    License as published by the Free Software Foundation; either
  1173  //    version 2.1 of the License, or (at your option) any later version.
  1174  //
  1175  //    The GNU C Library is distributed in the hope that it will be useful,
  1176  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1177  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1178  //    Lesser General Public License for more details.
  1179  //
  1180  //    You should have received a copy of the GNU Lesser General Public
  1181  //    License along with the GNU C Library; if not, see
  1182  //    <http://www.gnu.org/licenses/>.
  1183  
  1184  // Definitions for byte order, according to significance of bytes,
  1185  //    from low addresses to high addresses.  The value is what you get by
  1186  //    putting '4' in the most significant byte, '3' in the second most
  1187  //    significant byte, '2' in the second least significant byte, and '1'
  1188  //    in the least significant byte, and then writing down one digit for
  1189  //    each byte, starting with the byte at the lowest address at the left,
  1190  //    and proceeding to the byte with the highest address at the right.
  1191  
  1192  // This file defines `__BYTE_ORDER' for the particular machine.
  1193  
  1194  // RISC-V is little-endian.
  1195  
  1196  // Some machines may need to use a different endianness for floating point
  1197  //    values.
  1198  
  1199  // POSIX.1b structure for a time value.  This is like a `struct timeval' but
  1200  //
  1201  //	has nanoseconds instead of microseconds.
  1202  type Timespec = struct {
  1203  	Ftv_sec  X__time_t
  1204  	Ftv_nsec X__syscall_slong_t
  1205  } /* struct_timespec.h:11:1 */
  1206  
  1207  type Pid_t = X__pid_t /* sched.h:38:17 */
  1208  
  1209  // Get system specific constant and data structure definitions.
  1210  // Definitions of constants and data structure for POSIX 1003.1b-1993
  1211  //    scheduling interface.
  1212  //    Copyright (C) 1996-2021 Free Software Foundation, Inc.
  1213  //    This file is part of the GNU C Library.
  1214  //
  1215  //    The GNU C Library is free software; you can redistribute it and/or
  1216  //    modify it under the terms of the GNU Lesser General Public
  1217  //    License as published by the Free Software Foundation; either
  1218  //    version 2.1 of the License, or (at your option) any later version.
  1219  //
  1220  //    The GNU C Library is distributed in the hope that it will be useful,
  1221  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1222  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1223  //    Lesser General Public License for more details.
  1224  //
  1225  //    You should have received a copy of the GNU Lesser General Public
  1226  //    License along with the GNU C Library; if not, see
  1227  //    <https://www.gnu.org/licenses/>.
  1228  
  1229  // Scheduling algorithms.
  1230  
  1231  // Sched parameter structure.  Generic version.
  1232  //    Copyright (C) 1996-2021 Free Software Foundation, Inc.
  1233  //    This file is part of the GNU C Library.
  1234  //
  1235  //    The GNU C Library is free software; you can redistribute it and/or
  1236  //    modify it under the terms of the GNU Lesser General Public
  1237  //    License as published by the Free Software Foundation; either
  1238  //    version 2.1 of the License, or (at your option) any later version.
  1239  //
  1240  //    The GNU C Library is distributed in the hope that it will be useful,
  1241  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1242  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1243  //    Lesser General Public License for more details.
  1244  //
  1245  //    You should have received a copy of the GNU Lesser General Public
  1246  //    License along with the GNU C Library;  if not, see
  1247  //    <https://www.gnu.org/licenses/>.
  1248  
  1249  // Data structure to describe a process' schedulability.
  1250  type Sched_param = struct{ Fsched_priority int32 } /* struct_sched_param.h:23:1 */
  1251  
  1252  // Definition of the cpu_set_t structure used by the POSIX 1003.1b-1993
  1253  //    scheduling interface.
  1254  //    Copyright (C) 1996-2021 Free Software Foundation, Inc.
  1255  //    This file is part of the GNU C Library.
  1256  //
  1257  //    The GNU C Library is free software; you can redistribute it and/or
  1258  //    modify it under the terms of the GNU Lesser General Public
  1259  //    License as published by the Free Software Foundation; either
  1260  //    version 2.1 of the License, or (at your option) any later version.
  1261  //
  1262  //    The GNU C Library is distributed in the hope that it will be useful,
  1263  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1264  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1265  //    Lesser General Public License for more details.
  1266  //
  1267  //    You should have received a copy of the GNU Lesser General Public
  1268  //    License along with the GNU C Library; if not, see
  1269  //    <https://www.gnu.org/licenses/>.
  1270  
  1271  // Size definition for CPU sets.
  1272  
  1273  // Type for array elements in 'cpu_set_t'.
  1274  type X__cpu_mask = uint64 /* cpu-set.h:32:25 */
  1275  
  1276  // Basic access functions.
  1277  
  1278  // Data structure to describe CPU mask.
  1279  type Cpu_set_t = struct{ F__bits [16]X__cpu_mask } /* cpu-set.h:42:3 */
  1280  
  1281  // Copyright (C) 1991-2021 Free Software Foundation, Inc.
  1282  //    This file is part of the GNU C Library.
  1283  //
  1284  //    The GNU C Library is free software; you can redistribute it and/or
  1285  //    modify it under the terms of the GNU Lesser General Public
  1286  //    License as published by the Free Software Foundation; either
  1287  //    version 2.1 of the License, or (at your option) any later version.
  1288  //
  1289  //    The GNU C Library is distributed in the hope that it will be useful,
  1290  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1291  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1292  //    Lesser General Public License for more details.
  1293  //
  1294  //    You should have received a copy of the GNU Lesser General Public
  1295  //    License along with the GNU C Library; if not, see
  1296  //    <https://www.gnu.org/licenses/>.
  1297  
  1298  //	ISO C99 Standard: 7.23 Date and time	<time.h>
  1299  
  1300  // Copyright (C) 1991-2021 Free Software Foundation, Inc.
  1301  //    This file is part of the GNU C Library.
  1302  //
  1303  //    The GNU C Library is free software; you can redistribute it and/or
  1304  //    modify it under the terms of the GNU Lesser General Public
  1305  //    License as published by the Free Software Foundation; either
  1306  //    version 2.1 of the License, or (at your option) any later version.
  1307  //
  1308  //    The GNU C Library is distributed in the hope that it will be useful,
  1309  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1310  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1311  //    Lesser General Public License for more details.
  1312  //
  1313  //    You should have received a copy of the GNU Lesser General Public
  1314  //    License along with the GNU C Library; if not, see
  1315  //    <https://www.gnu.org/licenses/>.
  1316  
  1317  // Copyright (C) 1989-2021 Free Software Foundation, Inc.
  1318  //
  1319  // This file is part of GCC.
  1320  //
  1321  // GCC is free software; you can redistribute it and/or modify
  1322  // it under the terms of the GNU General Public License as published by
  1323  // the Free Software Foundation; either version 3, or (at your option)
  1324  // any later version.
  1325  //
  1326  // GCC is distributed in the hope that it will be useful,
  1327  // but WITHOUT ANY WARRANTY; without even the implied warranty of
  1328  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1329  // GNU General Public License for more details.
  1330  //
  1331  // Under Section 7 of GPL version 3, you are granted additional
  1332  // permissions described in the GCC Runtime Library Exception, version
  1333  // 3.1, as published by the Free Software Foundation.
  1334  //
  1335  // You should have received a copy of the GNU General Public License and
  1336  // a copy of the GCC Runtime Library Exception along with this program;
  1337  // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
  1338  // <http://www.gnu.org/licenses/>.
  1339  
  1340  // ISO C Standard:  7.17  Common definitions  <stddef.h>
  1341  
  1342  // Any one of these symbols __need_* means that GNU libc
  1343  //    wants us just to define one data type.  So don't define
  1344  //    the symbols that indicate this file's entire job has been done.
  1345  
  1346  // This avoids lossage on SunOS but only if stdtypes.h comes first.
  1347  //    There's no way to win with the other order!  Sun lossage.
  1348  
  1349  // Sequent's header files use _PTRDIFF_T_ in some conflicting way.
  1350  //    Just ignore it.
  1351  
  1352  // On VxWorks, <type/vxTypesBase.h> may have defined macros like
  1353  //    _TYPE_size_t which will typedef size_t.  fixincludes patched the
  1354  //    vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
  1355  //    not defined, and so that defining this macro defines _GCC_SIZE_T.
  1356  //    If we find that the macros are still defined at this point, we must
  1357  //    invoke them so that the type is defined as expected.
  1358  
  1359  // In case nobody has defined these types, but we aren't running under
  1360  //    GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
  1361  //    __WCHAR_TYPE__ have reasonable values.  This can happen if the
  1362  //    parts of GCC is compiled by an older compiler, that actually
  1363  //    include gstddef.h, such as collect2.
  1364  
  1365  // Signed type of difference of two pointers.
  1366  
  1367  // Define this type if we are doing the whole job,
  1368  //    or if we want this type in particular.
  1369  
  1370  // Unsigned type of `sizeof' something.
  1371  
  1372  // Define this type if we are doing the whole job,
  1373  //    or if we want this type in particular.
  1374  
  1375  // Wide character type.
  1376  //    Locale-writers should change this as necessary to
  1377  //    be big enough to hold unique values not between 0 and 127,
  1378  //    and not (wchar_t) -1, for each defined multibyte character.
  1379  
  1380  // Define this type if we are doing the whole job,
  1381  //    or if we want this type in particular.
  1382  
  1383  // A null pointer constant.
  1384  
  1385  // This defines CLOCKS_PER_SEC, which is the number of processor clock
  1386  //    ticks per second, and possibly a number of other constants.
  1387  // System-dependent timing definitions.  Linux version.
  1388  //    Copyright (C) 1996-2021 Free Software Foundation, Inc.
  1389  //    This file is part of the GNU C Library.
  1390  //
  1391  //    The GNU C Library is free software; you can redistribute it and/or
  1392  //    modify it under the terms of the GNU Lesser General Public
  1393  //    License as published by the Free Software Foundation; either
  1394  //    version 2.1 of the License, or (at your option) any later version.
  1395  //
  1396  //    The GNU C Library is distributed in the hope that it will be useful,
  1397  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1398  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1399  //    Lesser General Public License for more details.
  1400  //
  1401  //    You should have received a copy of the GNU Lesser General Public
  1402  //    License along with the GNU C Library; if not, see
  1403  //    <https://www.gnu.org/licenses/>.
  1404  
  1405  // Never include this file directly; use <time.h> instead.
  1406  
  1407  // bits/types.h -- definitions of __*_t types underlying *_t types.
  1408  //    Copyright (C) 2002-2021 Free Software Foundation, Inc.
  1409  //    This file is part of the GNU C Library.
  1410  //
  1411  //    The GNU C Library is free software; you can redistribute it and/or
  1412  //    modify it under the terms of the GNU Lesser General Public
  1413  //    License as published by the Free Software Foundation; either
  1414  //    version 2.1 of the License, or (at your option) any later version.
  1415  //
  1416  //    The GNU C Library is distributed in the hope that it will be useful,
  1417  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1418  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1419  //    Lesser General Public License for more details.
  1420  //
  1421  //    You should have received a copy of the GNU Lesser General Public
  1422  //    License along with the GNU C Library; if not, see
  1423  //    <https://www.gnu.org/licenses/>.
  1424  
  1425  // Never include this file directly; use <sys/types.h> instead.
  1426  
  1427  // ISO/IEC 9899:1999 7.23.1: Components of time
  1428  //    The macro `CLOCKS_PER_SEC' is an expression with type `clock_t' that is
  1429  //    the number per second of the value returned by the `clock' function.
  1430  // CAE XSH, Issue 4, Version 2: <time.h>
  1431  //    The value of CLOCKS_PER_SEC is required to be 1 million on all
  1432  //    XSI-conformant systems.
  1433  
  1434  // Identifier for system-wide realtime clock.
  1435  // Monotonic system-wide clock.
  1436  // High-resolution timer from the CPU.
  1437  // Thread-specific CPU-time clock.
  1438  // Monotonic system-wide clock, not adjusted for frequency scaling.
  1439  // Identifier for system-wide realtime clock, updated only on ticks.
  1440  // Monotonic system-wide clock, updated only on ticks.
  1441  // Monotonic system-wide clock that includes time spent in suspension.
  1442  // Like CLOCK_REALTIME but also wakes suspended system.
  1443  // Like CLOCK_BOOTTIME but also wakes suspended system.
  1444  // Like CLOCK_REALTIME but in International Atomic Time.
  1445  
  1446  // Flag to indicate time is absolute.
  1447  
  1448  // Many of the typedefs and structs whose official home is this header
  1449  //    may also need to be defined by other headers.
  1450  
  1451  // bits/types.h -- definitions of __*_t types underlying *_t types.
  1452  //    Copyright (C) 2002-2021 Free Software Foundation, Inc.
  1453  //    This file is part of the GNU C Library.
  1454  //
  1455  //    The GNU C Library is free software; you can redistribute it and/or
  1456  //    modify it under the terms of the GNU Lesser General Public
  1457  //    License as published by the Free Software Foundation; either
  1458  //    version 2.1 of the License, or (at your option) any later version.
  1459  //
  1460  //    The GNU C Library is distributed in the hope that it will be useful,
  1461  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1462  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1463  //    Lesser General Public License for more details.
  1464  //
  1465  //    You should have received a copy of the GNU Lesser General Public
  1466  //    License along with the GNU C Library; if not, see
  1467  //    <https://www.gnu.org/licenses/>.
  1468  
  1469  // Never include this file directly; use <sys/types.h> instead.
  1470  
  1471  // Returned by `clock'.
  1472  type Clock_t = X__clock_t /* clock_t.h:7:19 */
  1473  
  1474  // bits/types.h -- definitions of __*_t types underlying *_t types.
  1475  //    Copyright (C) 2002-2021 Free Software Foundation, Inc.
  1476  //    This file is part of the GNU C Library.
  1477  //
  1478  //    The GNU C Library is free software; you can redistribute it and/or
  1479  //    modify it under the terms of the GNU Lesser General Public
  1480  //    License as published by the Free Software Foundation; either
  1481  //    version 2.1 of the License, or (at your option) any later version.
  1482  //
  1483  //    The GNU C Library is distributed in the hope that it will be useful,
  1484  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1485  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1486  //    Lesser General Public License for more details.
  1487  //
  1488  //    You should have received a copy of the GNU Lesser General Public
  1489  //    License along with the GNU C Library; if not, see
  1490  //    <https://www.gnu.org/licenses/>.
  1491  
  1492  // Never include this file directly; use <sys/types.h> instead.
  1493  
  1494  // ISO C `broken-down time' structure.
  1495  type Tm = struct {
  1496  	Ftm_sec      int32
  1497  	Ftm_min      int32
  1498  	Ftm_hour     int32
  1499  	Ftm_mday     int32
  1500  	Ftm_mon      int32
  1501  	Ftm_year     int32
  1502  	Ftm_wday     int32
  1503  	Ftm_yday     int32
  1504  	Ftm_isdst    int32
  1505  	F__ccgo_pad1 [4]byte
  1506  	Ftm_gmtoff   int64
  1507  	Ftm_zone     uintptr
  1508  } /* struct_tm.h:7:1 */
  1509  
  1510  // NB: Include guard matches what <linux/time.h> uses.
  1511  
  1512  // bits/types.h -- definitions of __*_t types underlying *_t types.
  1513  //    Copyright (C) 2002-2021 Free Software Foundation, Inc.
  1514  //    This file is part of the GNU C Library.
  1515  //
  1516  //    The GNU C Library is free software; you can redistribute it and/or
  1517  //    modify it under the terms of the GNU Lesser General Public
  1518  //    License as published by the Free Software Foundation; either
  1519  //    version 2.1 of the License, or (at your option) any later version.
  1520  //
  1521  //    The GNU C Library is distributed in the hope that it will be useful,
  1522  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1523  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1524  //    Lesser General Public License for more details.
  1525  //
  1526  //    You should have received a copy of the GNU Lesser General Public
  1527  //    License along with the GNU C Library; if not, see
  1528  //    <https://www.gnu.org/licenses/>.
  1529  
  1530  // Never include this file directly; use <sys/types.h> instead.
  1531  
  1532  // Clock ID used in clock and timer functions.
  1533  type Clockid_t = X__clockid_t /* clockid_t.h:7:21 */
  1534  
  1535  // bits/types.h -- definitions of __*_t types underlying *_t types.
  1536  //    Copyright (C) 2002-2021 Free Software Foundation, Inc.
  1537  //    This file is part of the GNU C Library.
  1538  //
  1539  //    The GNU C Library is free software; you can redistribute it and/or
  1540  //    modify it under the terms of the GNU Lesser General Public
  1541  //    License as published by the Free Software Foundation; either
  1542  //    version 2.1 of the License, or (at your option) any later version.
  1543  //
  1544  //    The GNU C Library is distributed in the hope that it will be useful,
  1545  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1546  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1547  //    Lesser General Public License for more details.
  1548  //
  1549  //    You should have received a copy of the GNU Lesser General Public
  1550  //    License along with the GNU C Library; if not, see
  1551  //    <https://www.gnu.org/licenses/>.
  1552  
  1553  // Never include this file directly; use <sys/types.h> instead.
  1554  
  1555  // Timer ID returned by `timer_create'.
  1556  type Timer_t = X__timer_t /* timer_t.h:7:19 */
  1557  
  1558  // bits/types.h -- definitions of __*_t types underlying *_t types.
  1559  //    Copyright (C) 2002-2021 Free Software Foundation, Inc.
  1560  //    This file is part of the GNU C Library.
  1561  //
  1562  //    The GNU C Library is free software; you can redistribute it and/or
  1563  //    modify it under the terms of the GNU Lesser General Public
  1564  //    License as published by the Free Software Foundation; either
  1565  //    version 2.1 of the License, or (at your option) any later version.
  1566  //
  1567  //    The GNU C Library is distributed in the hope that it will be useful,
  1568  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1569  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1570  //    Lesser General Public License for more details.
  1571  //
  1572  //    You should have received a copy of the GNU Lesser General Public
  1573  //    License along with the GNU C Library; if not, see
  1574  //    <https://www.gnu.org/licenses/>.
  1575  
  1576  // Never include this file directly; use <sys/types.h> instead.
  1577  
  1578  // NB: Include guard matches what <linux/time.h> uses.
  1579  
  1580  // POSIX.1b structure for timer start values and intervals.
  1581  type Itimerspec = struct {
  1582  	Fit_interval struct {
  1583  		Ftv_sec  X__time_t
  1584  		Ftv_nsec X__syscall_slong_t
  1585  	}
  1586  	Fit_value struct {
  1587  		Ftv_sec  X__time_t
  1588  		Ftv_nsec X__syscall_slong_t
  1589  	}
  1590  } /* struct_itimerspec.h:8:1 */
  1591  
  1592  // Definition of locale_t.
  1593  //    Copyright (C) 2017-2021 Free Software Foundation, Inc.
  1594  //    This file is part of the GNU C Library.
  1595  //
  1596  //    The GNU C Library is free software; you can redistribute it and/or
  1597  //    modify it under the terms of the GNU Lesser General Public
  1598  //    License as published by the Free Software Foundation; either
  1599  //    version 2.1 of the License, or (at your option) any later version.
  1600  //
  1601  //    The GNU C Library is distributed in the hope that it will be useful,
  1602  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1603  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1604  //    Lesser General Public License for more details.
  1605  //
  1606  //    You should have received a copy of the GNU Lesser General Public
  1607  //    License along with the GNU C Library; if not, see
  1608  //    <https://www.gnu.org/licenses/>.
  1609  
  1610  // Definition of struct __locale_struct and __locale_t.
  1611  //    Copyright (C) 1997-2021 Free Software Foundation, Inc.
  1612  //    This file is part of the GNU C Library.
  1613  //    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
  1614  //
  1615  //    The GNU C Library is free software; you can redistribute it and/or
  1616  //    modify it under the terms of the GNU Lesser General Public
  1617  //    License as published by the Free Software Foundation; either
  1618  //    version 2.1 of the License, or (at your option) any later version.
  1619  //
  1620  //    The GNU C Library is distributed in the hope that it will be useful,
  1621  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1622  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1623  //    Lesser General Public License for more details.
  1624  //
  1625  //    You should have received a copy of the GNU Lesser General Public
  1626  //    License along with the GNU C Library; if not, see
  1627  //    <https://www.gnu.org/licenses/>.
  1628  
  1629  // POSIX.1-2008: the locale_t type, representing a locale context
  1630  //    (implementation-namespace version).  This type should be treated
  1631  //    as opaque by applications; some details are exposed for the sake of
  1632  //    efficiency in e.g. ctype functions.
  1633  
  1634  type X__locale_struct = struct {
  1635  	F__locales       [13]uintptr
  1636  	F__ctype_b       uintptr
  1637  	F__ctype_tolower uintptr
  1638  	F__ctype_toupper uintptr
  1639  	F__names         [13]uintptr
  1640  } /* __locale_t.h:28:1 */
  1641  
  1642  type X__locale_t = uintptr /* __locale_t.h:42:32 */
  1643  
  1644  type Locale_t = X__locale_t /* locale_t.h:24:20 */
  1645  
  1646  // Endian macros for string.h functions
  1647  //    Copyright (C) 1992-2021 Free Software Foundation, Inc.
  1648  //    This file is part of the GNU C Library.
  1649  //
  1650  //    The GNU C Library is free software; you can redistribute it and/or
  1651  //    modify it under the terms of the GNU Lesser General Public
  1652  //    License as published by the Free Software Foundation; either
  1653  //    version 2.1 of the License, or (at your option) any later version.
  1654  //
  1655  //    The GNU C Library is distributed in the hope that it will be useful,
  1656  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1657  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1658  //    Lesser General Public License for more details.
  1659  //
  1660  //    You should have received a copy of the GNU Lesser General Public
  1661  //    License along with the GNU C Library; if not, see
  1662  //    <http://www.gnu.org/licenses/>.
  1663  
  1664  // Declaration of common pthread types for all architectures.
  1665  //    Copyright (C) 2017-2021 Free Software Foundation, Inc.
  1666  //    This file is part of the GNU C Library.
  1667  //
  1668  //    The GNU C Library is free software; you can redistribute it and/or
  1669  //    modify it under the terms of the GNU Lesser General Public
  1670  //    License as published by the Free Software Foundation; either
  1671  //    version 2.1 of the License, or (at your option) any later version.
  1672  //
  1673  //    The GNU C Library is distributed in the hope that it will be useful,
  1674  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1675  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1676  //    Lesser General Public License for more details.
  1677  //
  1678  //    You should have received a copy of the GNU Lesser General Public
  1679  //    License along with the GNU C Library; if not, see
  1680  //    <https://www.gnu.org/licenses/>.
  1681  
  1682  // For internal mutex and condition variable definitions.
  1683  // Common threading primitives definitions for both POSIX and C11.
  1684  //    Copyright (C) 2017-2021 Free Software Foundation, Inc.
  1685  //    This file is part of the GNU C Library.
  1686  //
  1687  //    The GNU C Library is free software; you can redistribute it and/or
  1688  //    modify it under the terms of the GNU Lesser General Public
  1689  //    License as published by the Free Software Foundation; either
  1690  //    version 2.1 of the License, or (at your option) any later version.
  1691  //
  1692  //    The GNU C Library is distributed in the hope that it will be useful,
  1693  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1694  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1695  //    Lesser General Public License for more details.
  1696  //
  1697  //    You should have received a copy of the GNU Lesser General Public
  1698  //    License along with the GNU C Library; if not, see
  1699  //    <https://www.gnu.org/licenses/>.
  1700  
  1701  // Arch-specific definitions.  Each architecture must define the following
  1702  //    macros to define the expected sizes of pthread data types:
  1703  //
  1704  //    __SIZEOF_PTHREAD_ATTR_T        - size of pthread_attr_t.
  1705  //    __SIZEOF_PTHREAD_MUTEX_T       - size of pthread_mutex_t.
  1706  //    __SIZEOF_PTHREAD_MUTEXATTR_T   - size of pthread_mutexattr_t.
  1707  //    __SIZEOF_PTHREAD_COND_T        - size of pthread_cond_t.
  1708  //    __SIZEOF_PTHREAD_CONDATTR_T    - size of pthread_condattr_t.
  1709  //    __SIZEOF_PTHREAD_RWLOCK_T      - size of pthread_rwlock_t.
  1710  //    __SIZEOF_PTHREAD_RWLOCKATTR_T  - size of pthread_rwlockattr_t.
  1711  //    __SIZEOF_PTHREAD_BARRIER_T     - size of pthread_barrier_t.
  1712  //    __SIZEOF_PTHREAD_BARRIERATTR_T - size of pthread_barrierattr_t.
  1713  //
  1714  //    The additional macro defines any constraint for the lock alignment
  1715  //    inside the thread structures:
  1716  //
  1717  //    __LOCK_ALIGNMENT - for internal lock/futex usage.
  1718  //
  1719  //    Same idea but for the once locking primitive:
  1720  //
  1721  //    __ONCE_ALIGNMENT - for pthread_once_t/once_flag definition.
  1722  
  1723  // Machine-specific pthread type layouts.  RISC-V version.
  1724  //    Copyright (C) 2011-2021 Free Software Foundation, Inc.
  1725  //    This file is part of the GNU C Library.
  1726  //
  1727  //    The GNU C Library is free software; you can redistribute it and/or
  1728  //    modify it under the terms of the GNU Lesser General Public
  1729  //    License as published by the Free Software Foundation; either
  1730  //    version 2.1 of the License, or (at your option) any later version.
  1731  //
  1732  //    The GNU C Library is distributed in the hope that it will be useful,
  1733  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1734  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1735  //    Lesser General Public License for more details.
  1736  //
  1737  //    You should have received a copy of the GNU Lesser General Public
  1738  //    License along with the GNU C Library.  If not, see
  1739  //    <https://www.gnu.org/licenses/>.
  1740  
  1741  // Endian macros for string.h functions
  1742  //    Copyright (C) 1992-2021 Free Software Foundation, Inc.
  1743  //    This file is part of the GNU C Library.
  1744  //
  1745  //    The GNU C Library is free software; you can redistribute it and/or
  1746  //    modify it under the terms of the GNU Lesser General Public
  1747  //    License as published by the Free Software Foundation; either
  1748  //    version 2.1 of the License, or (at your option) any later version.
  1749  //
  1750  //    The GNU C Library is distributed in the hope that it will be useful,
  1751  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1752  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1753  //    Lesser General Public License for more details.
  1754  //
  1755  //    You should have received a copy of the GNU Lesser General Public
  1756  //    License along with the GNU C Library; if not, see
  1757  //    <http://www.gnu.org/licenses/>.
  1758  
  1759  // Common definition of pthread_mutex_t.
  1760  
  1761  type X__pthread_internal_list = struct {
  1762  	F__prev uintptr
  1763  	F__next uintptr
  1764  } /* thread-shared-types.h:49:9 */
  1765  
  1766  // Endian macros for string.h functions
  1767  //    Copyright (C) 1992-2021 Free Software Foundation, Inc.
  1768  //    This file is part of the GNU C Library.
  1769  //
  1770  //    The GNU C Library is free software; you can redistribute it and/or
  1771  //    modify it under the terms of the GNU Lesser General Public
  1772  //    License as published by the Free Software Foundation; either
  1773  //    version 2.1 of the License, or (at your option) any later version.
  1774  //
  1775  //    The GNU C Library is distributed in the hope that it will be useful,
  1776  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1777  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1778  //    Lesser General Public License for more details.
  1779  //
  1780  //    You should have received a copy of the GNU Lesser General Public
  1781  //    License along with the GNU C Library; if not, see
  1782  //    <http://www.gnu.org/licenses/>.
  1783  
  1784  // Declaration of common pthread types for all architectures.
  1785  //    Copyright (C) 2017-2021 Free Software Foundation, Inc.
  1786  //    This file is part of the GNU C Library.
  1787  //
  1788  //    The GNU C Library is free software; you can redistribute it and/or
  1789  //    modify it under the terms of the GNU Lesser General Public
  1790  //    License as published by the Free Software Foundation; either
  1791  //    version 2.1 of the License, or (at your option) any later version.
  1792  //
  1793  //    The GNU C Library is distributed in the hope that it will be useful,
  1794  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1795  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1796  //    Lesser General Public License for more details.
  1797  //
  1798  //    You should have received a copy of the GNU Lesser General Public
  1799  //    License along with the GNU C Library; if not, see
  1800  //    <https://www.gnu.org/licenses/>.
  1801  
  1802  // For internal mutex and condition variable definitions.
  1803  // Common threading primitives definitions for both POSIX and C11.
  1804  //    Copyright (C) 2017-2021 Free Software Foundation, Inc.
  1805  //    This file is part of the GNU C Library.
  1806  //
  1807  //    The GNU C Library is free software; you can redistribute it and/or
  1808  //    modify it under the terms of the GNU Lesser General Public
  1809  //    License as published by the Free Software Foundation; either
  1810  //    version 2.1 of the License, or (at your option) any later version.
  1811  //
  1812  //    The GNU C Library is distributed in the hope that it will be useful,
  1813  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1814  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1815  //    Lesser General Public License for more details.
  1816  //
  1817  //    You should have received a copy of the GNU Lesser General Public
  1818  //    License along with the GNU C Library; if not, see
  1819  //    <https://www.gnu.org/licenses/>.
  1820  
  1821  // Arch-specific definitions.  Each architecture must define the following
  1822  //    macros to define the expected sizes of pthread data types:
  1823  //
  1824  //    __SIZEOF_PTHREAD_ATTR_T        - size of pthread_attr_t.
  1825  //    __SIZEOF_PTHREAD_MUTEX_T       - size of pthread_mutex_t.
  1826  //    __SIZEOF_PTHREAD_MUTEXATTR_T   - size of pthread_mutexattr_t.
  1827  //    __SIZEOF_PTHREAD_COND_T        - size of pthread_cond_t.
  1828  //    __SIZEOF_PTHREAD_CONDATTR_T    - size of pthread_condattr_t.
  1829  //    __SIZEOF_PTHREAD_RWLOCK_T      - size of pthread_rwlock_t.
  1830  //    __SIZEOF_PTHREAD_RWLOCKATTR_T  - size of pthread_rwlockattr_t.
  1831  //    __SIZEOF_PTHREAD_BARRIER_T     - size of pthread_barrier_t.
  1832  //    __SIZEOF_PTHREAD_BARRIERATTR_T - size of pthread_barrierattr_t.
  1833  //
  1834  //    The additional macro defines any constraint for the lock alignment
  1835  //    inside the thread structures:
  1836  //
  1837  //    __LOCK_ALIGNMENT - for internal lock/futex usage.
  1838  //
  1839  //    Same idea but for the once locking primitive:
  1840  //
  1841  //    __ONCE_ALIGNMENT - for pthread_once_t/once_flag definition.
  1842  
  1843  // Machine-specific pthread type layouts.  RISC-V version.
  1844  //    Copyright (C) 2011-2021 Free Software Foundation, Inc.
  1845  //    This file is part of the GNU C Library.
  1846  //
  1847  //    The GNU C Library is free software; you can redistribute it and/or
  1848  //    modify it under the terms of the GNU Lesser General Public
  1849  //    License as published by the Free Software Foundation; either
  1850  //    version 2.1 of the License, or (at your option) any later version.
  1851  //
  1852  //    The GNU C Library is distributed in the hope that it will be useful,
  1853  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1854  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1855  //    Lesser General Public License for more details.
  1856  //
  1857  //    You should have received a copy of the GNU Lesser General Public
  1858  //    License along with the GNU C Library.  If not, see
  1859  //    <https://www.gnu.org/licenses/>.
  1860  
  1861  // Endian macros for string.h functions
  1862  //    Copyright (C) 1992-2021 Free Software Foundation, Inc.
  1863  //    This file is part of the GNU C Library.
  1864  //
  1865  //    The GNU C Library is free software; you can redistribute it and/or
  1866  //    modify it under the terms of the GNU Lesser General Public
  1867  //    License as published by the Free Software Foundation; either
  1868  //    version 2.1 of the License, or (at your option) any later version.
  1869  //
  1870  //    The GNU C Library is distributed in the hope that it will be useful,
  1871  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1872  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1873  //    Lesser General Public License for more details.
  1874  //
  1875  //    You should have received a copy of the GNU Lesser General Public
  1876  //    License along with the GNU C Library; if not, see
  1877  //    <http://www.gnu.org/licenses/>.
  1878  
  1879  // Common definition of pthread_mutex_t.
  1880  
  1881  type X__pthread_list_t = X__pthread_internal_list /* thread-shared-types.h:53:3 */
  1882  
  1883  type X__pthread_internal_slist = struct{ F__next uintptr } /* thread-shared-types.h:55:9 */
  1884  
  1885  type X__pthread_slist_t = X__pthread_internal_slist /* thread-shared-types.h:58:3 */
  1886  
  1887  // Arch-specific mutex definitions.  A generic implementation is provided
  1888  //    by sysdeps/nptl/bits/struct_mutex.h.  If required, an architecture
  1889  //    can override it by defining:
  1890  //
  1891  //    1. struct __pthread_mutex_s (used on both pthread_mutex_t and mtx_t
  1892  //       definition).  It should contains at least the internal members
  1893  //       defined in the generic version.
  1894  //
  1895  //    2. __LOCK_ALIGNMENT for any extra attribute for internal lock used with
  1896  //       atomic operations.
  1897  //
  1898  //    3. The macro __PTHREAD_MUTEX_INITIALIZER used for static initialization.
  1899  //       It should initialize the mutex internal flag.
  1900  
  1901  // Default mutex implementation struct definitions.
  1902  //    Copyright (C) 2019-2021 Free Software Foundation, Inc.
  1903  //    This file is part of the GNU C Library.
  1904  //
  1905  //    The GNU C Library is free software; you can redistribute it and/or
  1906  //    modify it under the terms of the GNU Lesser General Public
  1907  //    License as published by the Free Software Foundation; either
  1908  //    version 2.1 of the License, or (at your option) any later version.
  1909  //
  1910  //    The GNU C Library is distributed in the hope that it will be useful,
  1911  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1912  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1913  //    Lesser General Public License for more details.
  1914  //
  1915  //    You should have received a copy of the GNU Lesser General Public
  1916  //    License along with the GNU C Library; if not, see
  1917  //    <http://www.gnu.org/licenses/>.
  1918  
  1919  // Generic struct for both POSIX and C11 mutexes.  New ports are expected
  1920  //    to use the default layout, however architecture can redefine it to
  1921  //    add arch-specific extension (such as lock-elision).  The struct have
  1922  //    a size of 32 bytes on LP32 and 40 bytes on LP64 architectures.
  1923  
  1924  type X__pthread_mutex_s = struct {
  1925  	F__lock   int32
  1926  	F__count  uint32
  1927  	F__owner  int32
  1928  	F__nusers uint32
  1929  	F__kind   int32
  1930  	F__spins  int32
  1931  	F__list   X__pthread_list_t
  1932  } /* struct_mutex.h:27:1 */
  1933  
  1934  // Arch-sepecific read-write lock definitions.  A generic implementation is
  1935  //    provided by struct_rwlock.h.  If required, an architecture can override it
  1936  //    by defining:
  1937  //
  1938  //    1. struct __pthread_rwlock_arch_t (used on pthread_rwlock_t definition).
  1939  //       It should contain at least the internal members defined in the
  1940  //       generic version.
  1941  //
  1942  //    2. The macro __PTHREAD_RWLOCK_INITIALIZER used for static initialization.
  1943  //       It should initialize the rwlock internal type.
  1944  
  1945  // RISC-V internal rwlock struct definitions.
  1946  //    Copyright (C) 2019-2021 Free Software Foundation, Inc.
  1947  //
  1948  //    This file is part of the GNU C Library.
  1949  //
  1950  //    The GNU C Library is free software; you can redistribute it and/or
  1951  //    modify it under the terms of the GNU Lesser General Public
  1952  //    License as published by the Free Software Foundation; either
  1953  //    version 2.1 of the License, or (at your option) any later version.
  1954  //
  1955  //    The GNU C Library is distributed in the hope that it will be useful,
  1956  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1957  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1958  //    Lesser General Public License for more details.
  1959  //
  1960  //    You should have received a copy of the GNU Lesser General Public
  1961  //    License along with the GNU C Library; if not, see
  1962  //    <https://www.gnu.org/licenses/>.
  1963  
  1964  // There is a lot of padding in this structure.  While it's not strictly
  1965  //
  1966  //	necessary on RISC-V, we're going to leave it in to be on the safe side in
  1967  //	case it's needed in the future.  Most other architectures have the padding,
  1968  //	so this gives us the same extensibility as everyone else has.
  1969  type X__pthread_rwlock_arch_t = struct {
  1970  	F__readers       uint32
  1971  	F__writers       uint32
  1972  	F__wrphase_futex uint32
  1973  	F__writers_futex uint32
  1974  	F__pad3          uint32
  1975  	F__pad4          uint32
  1976  	F__cur_writer    int32
  1977  	F__shared        int32
  1978  	F__pad1          uint64
  1979  	F__pad2          uint64
  1980  	F__flags         uint32
  1981  	F__ccgo_pad1     [4]byte
  1982  } /* struct_rwlock.h:27:1 */
  1983  
  1984  // Common definition of pthread_cond_t.
  1985  
  1986  type X__pthread_cond_s = struct {
  1987  	F__0            struct{ F__wseq uint64 }
  1988  	F__8            struct{ F__g1_start uint64 }
  1989  	F__g_refs       [2]uint32
  1990  	F__g_size       [2]uint32
  1991  	F__g1_orig_size uint32
  1992  	F__wrefs        uint32
  1993  	F__g_signals    [2]uint32
  1994  } /* thread-shared-types.h:92:1 */
  1995  
  1996  type X__tss_t = uint32  /* thread-shared-types.h:119:22 */
  1997  type X__thrd_t = uint64 /* thread-shared-types.h:120:27 */
  1998  
  1999  type X__once_flag = struct{ F__data int32 } /* thread-shared-types.h:125:3 */
  2000  
  2001  // Thread identifiers.  The structure of the attribute type is not
  2002  //
  2003  //	exposed on purpose.
  2004  type Pthread_t = uint64 /* pthreadtypes.h:27:27 */
  2005  
  2006  // Data structures for mutex handling.  The structure of the attribute
  2007  //
  2008  //	type is not exposed on purpose.
  2009  type Pthread_mutexattr_t = struct {
  2010  	F__ccgo_pad1 [0]uint32
  2011  	F__size      [4]uint8
  2012  } /* pthreadtypes.h:36:3 */
  2013  
  2014  // Data structure for condition variable handling.  The structure of
  2015  //
  2016  //	the attribute type is not exposed on purpose.
  2017  type Pthread_condattr_t = struct {
  2018  	F__ccgo_pad1 [0]uint32
  2019  	F__size      [4]uint8
  2020  } /* pthreadtypes.h:45:3 */
  2021  
  2022  // Keys for thread-specific data
  2023  type Pthread_key_t = uint32 /* pthreadtypes.h:49:22 */
  2024  
  2025  // Once-only execution
  2026  type Pthread_once_t = int32 /* pthreadtypes.h:53:30 */
  2027  
  2028  type Pthread_attr_t1 = struct {
  2029  	F__ccgo_pad1 [0]uint64
  2030  	F__size      [56]uint8
  2031  } /* pthreadtypes.h:56:1 */
  2032  
  2033  type Pthread_attr_t = Pthread_attr_t1 /* pthreadtypes.h:62:30 */
  2034  
  2035  type Pthread_mutex_t = struct{ F__data X__pthread_mutex_s } /* pthreadtypes.h:72:3 */
  2036  
  2037  type Pthread_cond_t = struct{ F__data X__pthread_cond_s } /* pthreadtypes.h:80:3 */
  2038  
  2039  // Data structure for reader-writer lock variable handling.  The
  2040  //
  2041  //	structure of the attribute type is deliberately not exposed.
  2042  type Pthread_rwlock_t = struct{ F__data X__pthread_rwlock_arch_t } /* pthreadtypes.h:91:3 */
  2043  
  2044  type Pthread_rwlockattr_t = struct {
  2045  	F__ccgo_pad1 [0]uint64
  2046  	F__size      [8]uint8
  2047  } /* pthreadtypes.h:97:3 */
  2048  
  2049  // POSIX spinlock data type.
  2050  type Pthread_spinlock_t = int32 /* pthreadtypes.h:103:22 */
  2051  
  2052  // POSIX barriers data type.  The structure of the type is
  2053  //
  2054  //	deliberately not exposed.
  2055  type Pthread_barrier_t = struct {
  2056  	F__ccgo_pad1 [0]uint64
  2057  	F__size      [32]uint8
  2058  } /* pthreadtypes.h:112:3 */
  2059  
  2060  type Pthread_barrierattr_t = struct {
  2061  	F__ccgo_pad1 [0]uint32
  2062  	F__size      [4]uint8
  2063  } /* pthreadtypes.h:118:3 */
  2064  
  2065  // Define the machine-dependent type `jmp_buf'.  RISC-V version.
  2066  //    Copyright (C) 2011-2021 Free Software Foundation, Inc.
  2067  //    This file is part of the GNU C Library.
  2068  //
  2069  //    The GNU C Library is free software; you can redistribute it and/or
  2070  //    modify it under the terms of the GNU Lesser General Public
  2071  //    License as published by the Free Software Foundation; either
  2072  //    version 2.1 of the License, or (at your option) any later version.
  2073  //
  2074  //    The GNU C Library is distributed in the hope that it will be useful,
  2075  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  2076  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  2077  //    Lesser General Public License for more details.
  2078  //
  2079  //    You should have received a copy of the GNU Lesser General Public
  2080  //    License along with the GNU C Library.  If not, see
  2081  //    <https://www.gnu.org/licenses/>.
  2082  
  2083  type X__jmp_buf_internal_tag = struct {
  2084  	F__pc     int64
  2085  	F__regs   [12]int64
  2086  	F__sp     int64
  2087  	F__fpregs [12]float64
  2088  } /* setjmp.h:22:9 */
  2089  
  2090  // Define the machine-dependent type `jmp_buf'.  RISC-V version.
  2091  //    Copyright (C) 2011-2021 Free Software Foundation, Inc.
  2092  //    This file is part of the GNU C Library.
  2093  //
  2094  //    The GNU C Library is free software; you can redistribute it and/or
  2095  //    modify it under the terms of the GNU Lesser General Public
  2096  //    License as published by the Free Software Foundation; either
  2097  //    version 2.1 of the License, or (at your option) any later version.
  2098  //
  2099  //    The GNU C Library is distributed in the hope that it will be useful,
  2100  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  2101  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  2102  //    Lesser General Public License for more details.
  2103  //
  2104  //    You should have received a copy of the GNU Lesser General Public
  2105  //    License along with the GNU C Library.  If not, see
  2106  //    <https://www.gnu.org/licenses/>.
  2107  
  2108  type X__jmp_buf = [1]X__jmp_buf_internal_tag /* setjmp.h:37:5 */
  2109  
  2110  // Determine the wordsize from the preprocessor defines.  RISC-V version.
  2111  //    Copyright (C) 2002-2021 Free Software Foundation, Inc.
  2112  //    This file is part of the GNU C Library.
  2113  //
  2114  //    The GNU C Library is free software; you can redistribute it and/or
  2115  //    modify it under the terms of the GNU Lesser General Public
  2116  //    License as published by the Free Software Foundation; either
  2117  //    version 2.1 of the License, or (at your option) any later version.
  2118  //
  2119  //    The GNU C Library is distributed in the hope that it will be useful,
  2120  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  2121  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  2122  //    Lesser General Public License for more details.
  2123  //
  2124  //    You should have received a copy of the GNU Lesser General Public
  2125  //    License along with the GNU C Library.  If not, see
  2126  //    <https://www.gnu.org/licenses/>.
  2127  
  2128  // NB: Include guard matches what <linux/time.h> uses.
  2129  
  2130  type X__sigset_t = struct{ F__val [16]uint64 } /* __sigset_t.h:8:3 */
  2131  
  2132  // Define struct __jmp_buf_tag.
  2133  //    Copyright (C) 1991-2021 Free Software Foundation, Inc.
  2134  //    This file is part of the GNU C Library.
  2135  //
  2136  //    The GNU C Library is free software; you can redistribute it and/or
  2137  //    modify it under the terms of the GNU Lesser General Public
  2138  //    License as published by the Free Software Foundation; either
  2139  //    version 2.1 of the License, or (at your option) any later version.
  2140  //
  2141  //    The GNU C Library is distributed in the hope that it will be useful,
  2142  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  2143  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  2144  //    Lesser General Public License for more details.
  2145  //
  2146  //    You should have received a copy of the GNU Lesser General Public
  2147  //    License along with the GNU C Library; if not, see
  2148  //    <https://www.gnu.org/licenses/>.
  2149  
  2150  // Define the machine-dependent type `jmp_buf'.  RISC-V version.
  2151  //    Copyright (C) 2011-2021 Free Software Foundation, Inc.
  2152  //    This file is part of the GNU C Library.
  2153  //
  2154  //    The GNU C Library is free software; you can redistribute it and/or
  2155  //    modify it under the terms of the GNU Lesser General Public
  2156  //    License as published by the Free Software Foundation; either
  2157  //    version 2.1 of the License, or (at your option) any later version.
  2158  //
  2159  //    The GNU C Library is distributed in the hope that it will be useful,
  2160  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  2161  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  2162  //    Lesser General Public License for more details.
  2163  //
  2164  //    You should have received a copy of the GNU Lesser General Public
  2165  //    License along with the GNU C Library.  If not, see
  2166  //    <https://www.gnu.org/licenses/>.
  2167  
  2168  // Calling environment, plus possibly a saved signal mask.
  2169  type X__jmp_buf_tag = struct {
  2170  	F__jmpbuf         X__jmp_buf
  2171  	F__mask_was_saved int32
  2172  	F__ccgo_pad1      [4]byte
  2173  	F__saved_mask     X__sigset_t
  2174  } /* struct___jmp_buf_tag.h:26:1 */
  2175  
  2176  // Conditional variable handling.
  2177  
  2178  // Cleanup buffers
  2179  type X_pthread_cleanup_buffer = struct {
  2180  	F__routine    uintptr
  2181  	F__arg        uintptr
  2182  	F__canceltype int32
  2183  	F__ccgo_pad1  [4]byte
  2184  	F__prev       uintptr
  2185  } /* pthread.h:159:1 */
  2186  
  2187  // Cancellation handling with integration into exception handling.
  2188  
  2189  type X__cancel_jmp_buf_tag = struct {
  2190  	F__cancel_jmp_buf X__jmp_buf
  2191  	F__mask_was_saved int32
  2192  	F__ccgo_pad1      [4]byte
  2193  } /* pthread.h:538:1 */
  2194  
  2195  type X__pthread_unwind_buf_t = struct {
  2196  	F__cancel_jmp_buf [1]X__cancel_jmp_buf_tag
  2197  	F__pad            [4]uintptr
  2198  } /* pthread.h:548:3 */
  2199  
  2200  // No special attributes by default.
  2201  
  2202  // Structure to hold the cleanup handler information.
  2203  type X__pthread_cleanup_frame = struct {
  2204  	F__cancel_routine uintptr
  2205  	F__cancel_arg     uintptr
  2206  	F__do_it          int32
  2207  	F__cancel_type    int32
  2208  } /* pthread.h:557:1 */
  2209  
  2210  var _ uint8 /* gen.c:2:13: */