github.com/afumu/libc@v0.0.6/sys/socket/socket_linux_arm.go (about)

     1  // Code generated by 'ccgo sys/socket/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 sys/socket/socket_linux_arm.go -pkgname socket', DO NOT EDIT.
     2  
     3  package socket
     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  	AF_ALG                           = 38
    19  	AF_APPLETALK                     = 5
    20  	AF_ASH                           = 18
    21  	AF_ATMPVC                        = 8
    22  	AF_ATMSVC                        = 20
    23  	AF_AX25                          = 3
    24  	AF_BLUETOOTH                     = 31
    25  	AF_BRIDGE                        = 7
    26  	AF_CAIF                          = 37
    27  	AF_CAN                           = 29
    28  	AF_DECnet                        = 12
    29  	AF_ECONET                        = 19
    30  	AF_FILE                          = 1
    31  	AF_IB                            = 27
    32  	AF_IEEE802154                    = 36
    33  	AF_INET                          = 2
    34  	AF_INET6                         = 10
    35  	AF_IPX                           = 4
    36  	AF_IRDA                          = 23
    37  	AF_ISDN                          = 34
    38  	AF_IUCV                          = 32
    39  	AF_KCM                           = 41
    40  	AF_KEY                           = 15
    41  	AF_LLC                           = 26
    42  	AF_LOCAL                         = 1
    43  	AF_MAX                           = 45
    44  	AF_MPLS                          = 28
    45  	AF_NETBEUI                       = 13
    46  	AF_NETLINK                       = 16
    47  	AF_NETROM                        = 6
    48  	AF_NFC                           = 39
    49  	AF_PACKET                        = 17
    50  	AF_PHONET                        = 35
    51  	AF_PPPOX                         = 24
    52  	AF_QIPCRTR                       = 42
    53  	AF_RDS                           = 21
    54  	AF_ROSE                          = 11
    55  	AF_ROUTE                         = 16
    56  	AF_RXRPC                         = 33
    57  	AF_SECURITY                      = 14
    58  	AF_SMC                           = 43
    59  	AF_SNA                           = 22
    60  	AF_TIPC                          = 30
    61  	AF_UNIX                          = 1
    62  	AF_UNSPEC                        = 0
    63  	AF_VSOCK                         = 40
    64  	AF_WANPIPE                       = 25
    65  	AF_X25                           = 9
    66  	AF_XDP                           = 44
    67  	BIG_ENDIAN                       = 4321
    68  	BYTE_ORDER                       = 1234
    69  	FD_SETSIZE                       = 1024
    70  	FIOGETOWN                        = 0x8903
    71  	FIOSETOWN                        = 0x8901
    72  	LITTLE_ENDIAN                    = 1234
    73  	PDP_ENDIAN                       = 3412
    74  	PF_ALG                           = 38
    75  	PF_APPLETALK                     = 5
    76  	PF_ASH                           = 18
    77  	PF_ATMPVC                        = 8
    78  	PF_ATMSVC                        = 20
    79  	PF_AX25                          = 3
    80  	PF_BLUETOOTH                     = 31
    81  	PF_BRIDGE                        = 7
    82  	PF_CAIF                          = 37
    83  	PF_CAN                           = 29
    84  	PF_DECnet                        = 12
    85  	PF_ECONET                        = 19
    86  	PF_FILE                          = 1
    87  	PF_IB                            = 27
    88  	PF_IEEE802154                    = 36
    89  	PF_INET                          = 2
    90  	PF_INET6                         = 10
    91  	PF_IPX                           = 4
    92  	PF_IRDA                          = 23
    93  	PF_ISDN                          = 34
    94  	PF_IUCV                          = 32
    95  	PF_KCM                           = 41
    96  	PF_KEY                           = 15
    97  	PF_LLC                           = 26
    98  	PF_LOCAL                         = 1
    99  	PF_MAX                           = 45
   100  	PF_MPLS                          = 28
   101  	PF_NETBEUI                       = 13
   102  	PF_NETLINK                       = 16
   103  	PF_NETROM                        = 6
   104  	PF_NFC                           = 39
   105  	PF_PACKET                        = 17
   106  	PF_PHONET                        = 35
   107  	PF_PPPOX                         = 24
   108  	PF_QIPCRTR                       = 42
   109  	PF_RDS                           = 21
   110  	PF_ROSE                          = 11
   111  	PF_ROUTE                         = 16
   112  	PF_RXRPC                         = 33
   113  	PF_SECURITY                      = 14
   114  	PF_SMC                           = 43
   115  	PF_SNA                           = 22
   116  	PF_TIPC                          = 30
   117  	PF_UNIX                          = 1
   118  	PF_UNSPEC                        = 0
   119  	PF_VSOCK                         = 40
   120  	PF_WANPIPE                       = 25
   121  	PF_X25                           = 9
   122  	PF_XDP                           = 44
   123  	SCM_TIMESTAMPING_OPT_STATS       = 54
   124  	SCM_TIMESTAMPING_PKTINFO         = 58
   125  	SCM_TXTIME                       = 61
   126  	SCM_WIFI_STATUS                  = 41
   127  	SIOCATMARK                       = 0x8905
   128  	SIOCGPGRP                        = 0x8904
   129  	SIOCGSTAMP                       = 0x8906
   130  	SIOCGSTAMPNS                     = 0x8907
   131  	SIOCSPGRP                        = 0x8902
   132  	SOL_AAL                          = 265
   133  	SOL_ALG                          = 279
   134  	SOL_ATM                          = 264
   135  	SOL_BLUETOOTH                    = 274
   136  	SOL_CAIF                         = 278
   137  	SOL_DCCP                         = 269
   138  	SOL_DECNET                       = 261
   139  	SOL_IRDA                         = 266
   140  	SOL_IUCV                         = 277
   141  	SOL_KCM                          = 281
   142  	SOL_LLC                          = 268
   143  	SOL_NETBEUI                      = 267
   144  	SOL_NETLINK                      = 270
   145  	SOL_NFC                          = 280
   146  	SOL_PACKET                       = 263
   147  	SOL_PNPIPE                       = 275
   148  	SOL_PPPOL2TP                     = 273
   149  	SOL_RAW                          = 255
   150  	SOL_RDS                          = 276
   151  	SOL_RXRPC                        = 272
   152  	SOL_SOCKET                       = 1
   153  	SOL_TIPC                         = 271
   154  	SOL_TLS                          = 282
   155  	SOL_X25                          = 262
   156  	SOL_XDP                          = 283
   157  	SOMAXCONN                        = 4096
   158  	SO_ACCEPTCONN                    = 30
   159  	SO_ATTACH_BPF                    = 50
   160  	SO_ATTACH_FILTER                 = 26
   161  	SO_ATTACH_REUSEPORT_CBPF         = 51
   162  	SO_ATTACH_REUSEPORT_EBPF         = 52
   163  	SO_BINDTODEVICE                  = 25
   164  	SO_BINDTOIFINDEX                 = 62
   165  	SO_BPF_EXTENSIONS                = 48
   166  	SO_BROADCAST                     = 6
   167  	SO_BSDCOMPAT                     = 14
   168  	SO_BUSY_POLL                     = 46
   169  	SO_CNX_ADVICE                    = 53
   170  	SO_COOKIE                        = 57
   171  	SO_DEBUG                         = 1
   172  	SO_DETACH_BPF                    = 27
   173  	SO_DETACH_FILTER                 = 27
   174  	SO_DETACH_REUSEPORT_BPF          = 68
   175  	SO_DOMAIN                        = 39
   176  	SO_DONTROUTE                     = 5
   177  	SO_ERROR                         = 4
   178  	SO_GET_FILTER                    = 26
   179  	SO_INCOMING_CPU                  = 49
   180  	SO_INCOMING_NAPI_ID              = 56
   181  	SO_KEEPALIVE                     = 9
   182  	SO_LINGER                        = 13
   183  	SO_LOCK_FILTER                   = 44
   184  	SO_MARK                          = 36
   185  	SO_MAX_PACING_RATE               = 47
   186  	SO_MEMINFO                       = 55
   187  	SO_NOFCS                         = 43
   188  	SO_NO_CHECK                      = 11
   189  	SO_OOBINLINE                     = 10
   190  	SO_PASSCRED                      = 16
   191  	SO_PASSSEC                       = 34
   192  	SO_PEEK_OFF                      = 42
   193  	SO_PEERCRED                      = 17
   194  	SO_PEERGROUPS                    = 59
   195  	SO_PEERNAME                      = 28
   196  	SO_PEERSEC                       = 31
   197  	SO_PRIORITY                      = 12
   198  	SO_PROTOCOL                      = 38
   199  	SO_RCVBUF                        = 8
   200  	SO_RCVBUFFORCE                   = 33
   201  	SO_RCVLOWAT                      = 18
   202  	SO_RCVTIMEO_NEW                  = 66
   203  	SO_RCVTIMEO_OLD                  = 20
   204  	SO_REUSEADDR                     = 2
   205  	SO_REUSEPORT                     = 15
   206  	SO_RXQ_OVFL                      = 40
   207  	SO_SECURITY_AUTHENTICATION       = 22
   208  	SO_SECURITY_ENCRYPTION_NETWORK   = 24
   209  	SO_SECURITY_ENCRYPTION_TRANSPORT = 23
   210  	SO_SELECT_ERR_QUEUE              = 45
   211  	SO_SNDBUF                        = 7
   212  	SO_SNDBUFFORCE                   = 32
   213  	SO_SNDLOWAT                      = 19
   214  	SO_SNDTIMEO_NEW                  = 67
   215  	SO_SNDTIMEO_OLD                  = 21
   216  	SO_TIMESTAMPING_NEW              = 65
   217  	SO_TIMESTAMPING_OLD              = 37
   218  	SO_TIMESTAMPNS_NEW               = 64
   219  	SO_TIMESTAMPNS_OLD               = 35
   220  	SO_TIMESTAMP_NEW                 = 63
   221  	SO_TIMESTAMP_OLD                 = 29
   222  	SO_TXTIME                        = 61
   223  	SO_TYPE                          = 3
   224  	SO_WIFI_STATUS                   = 41
   225  	SO_ZEROCOPY                      = 60
   226  	X_ATFILE_SOURCE                  = 1
   227  	X_BITS_BYTESWAP_H                = 1
   228  	X_BITS_ENDIANNESS_H              = 1
   229  	X_BITS_ENDIAN_H                  = 1
   230  	X_BITS_PTHREADTYPES_ARCH_H       = 1
   231  	X_BITS_PTHREADTYPES_COMMON_H     = 1
   232  	X_BITS_SOCKADDR_H                = 1
   233  	X_BITS_STDINT_INTN_H             = 1
   234  	X_BITS_TIME64_H                  = 1
   235  	X_BITS_TYPESIZES_H               = 1
   236  	X_BITS_TYPES_H                   = 1
   237  	X_BITS_UINTN_IDENTITY_H          = 1
   238  	X_BSD_SIZE_T_                    = 0
   239  	X_BSD_SIZE_T_DEFINED_            = 0
   240  	X_DEFAULT_SOURCE                 = 1
   241  	X_ENDIAN_H                       = 1
   242  	X_FEATURES_H                     = 1
   243  	X_FILE_OFFSET_BITS               = 64
   244  	X_GCC_SIZE_T                     = 0
   245  	X_LINUX_POSIX_TYPES_H            = 0
   246  	X_POSIX_C_SOURCE                 = 200809
   247  	X_POSIX_SOURCE                   = 1
   248  	X_SIZET_                         = 0
   249  	X_SIZE_T                         = 0
   250  	X_SIZE_T_                        = 0
   251  	X_SIZE_T_DECLARED                = 0
   252  	X_SIZE_T_DEFINED                 = 0
   253  	X_SIZE_T_DEFINED_                = 0
   254  	X_SS_SIZE                        = 128
   255  	X_STDC_PREDEF_H                  = 1
   256  	X_STRUCT_TIMESPEC                = 1
   257  	X_SYS_CDEFS_H                    = 1
   258  	X_SYS_SELECT_H                   = 1
   259  	X_SYS_SIZE_T_H                   = 0
   260  	X_SYS_SOCKET_H                   = 1
   261  	X_SYS_TYPES_H                    = 1
   262  	X_THREAD_MUTEX_INTERNAL_H        = 1
   263  	X_THREAD_SHARED_TYPES_H          = 1
   264  	X_T_SIZE                         = 0
   265  	X_T_SIZE_                        = 0
   266  	Linux                            = 1
   267  	Unix                             = 1
   268  )
   269  
   270  // Bits in the FLAGS argument to `send', `recv', et al.
   271  const ( /* socket.h:200:1: */
   272  	MSG_OOB        = 1  // Process out-of-band data.
   273  	MSG_PEEK       = 2  // Peek at incoming messages.
   274  	MSG_DONTROUTE  = 4  // Don't use local routing.
   275  	MSG_CTRUNC     = 8  // Control data lost before delivery.
   276  	MSG_PROXY      = 16 // Supply or ask second address.
   277  	MSG_TRUNC      = 32
   278  	MSG_DONTWAIT   = 64  // Nonblocking IO.
   279  	MSG_EOR        = 128 // End of record.
   280  	MSG_WAITALL    = 256 // Wait for a full request.
   281  	MSG_FIN        = 512
   282  	MSG_SYN        = 1024
   283  	MSG_CONFIRM    = 2048 // Confirm path validity.
   284  	MSG_RST        = 4096
   285  	MSG_ERRQUEUE   = 8192      // Fetch message from error queue.
   286  	MSG_NOSIGNAL   = 16384     // Do not generate SIGPIPE.
   287  	MSG_MORE       = 32768     // Sender will send more.
   288  	MSG_WAITFORONE = 65536     // Wait for at least one packet to return.
   289  	MSG_BATCH      = 262144    // sendmmsg: more messages coming.
   290  	MSG_ZEROCOPY   = 67108864  // Use user data in kernel path.
   291  	MSG_FASTOPEN   = 536870912 // Send data in TCP SYN.
   292  
   293  	MSG_CMSG_CLOEXEC = 1073741824
   294  )
   295  
   296  // Socket level message types.  This must match the definitions in
   297  //
   298  //	<linux/socket.h>.
   299  const ( /* socket.h:332:1: */
   300  	SCM_RIGHTS = 1
   301  )
   302  
   303  // Get the architecture-dependent definition of enum __socket_type.
   304  // Define enum __socket_type for generic Linux.
   305  //    Copyright (C) 1991-2020 Free Software Foundation, Inc.
   306  //    This file is part of the GNU C Library.
   307  //
   308  //    The GNU C Library is free software; you can redistribute it and/or
   309  //    modify it under the terms of the GNU Lesser General Public
   310  //    License as published by the Free Software Foundation; either
   311  //    version 2.1 of the License, or (at your option) any later version.
   312  //
   313  //    The GNU C Library is distributed in the hope that it will be useful,
   314  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   315  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   316  //    Lesser General Public License for more details.
   317  //
   318  //    You should have received a copy of the GNU Lesser General Public
   319  //    License along with the GNU C Library; if not, see
   320  //    <https://www.gnu.org/licenses/>.
   321  
   322  // Types of sockets.
   323  const ( /* socket_type.h:24:1: */
   324  	SOCK_STREAM = 1 // Sequenced, reliable, connection-based
   325  	// 				   byte streams.
   326  	SOCK_DGRAM = 2 // Connectionless, unreliable datagrams
   327  	// 				   of fixed maximum length.
   328  	SOCK_RAW       = 3 // Raw protocol interface.
   329  	SOCK_RDM       = 4 // Reliably-delivered messages.
   330  	SOCK_SEQPACKET = 5 // Sequenced, reliable, connection-based,
   331  	// 				   datagrams of fixed maximum length.
   332  	SOCK_DCCP   = 6  // Datagram Congestion Control Protocol.
   333  	SOCK_PACKET = 10 // Linux specific way of getting packets
   334  	// 				   at the dev level.  For writing rarp and
   335  	// 				   other similar things on the user level.
   336  
   337  	// Flags to be ORed into the type parameter of socket and socketpair and
   338  	//      used for the flags parameter of paccept.
   339  
   340  	SOCK_CLOEXEC = 524288 // Atomically set close-on-exec flag for the
   341  	// 				   new descriptor(s).
   342  	SOCK_NONBLOCK = 2048
   343  )
   344  
   345  // The following constants should be used for the second parameter of
   346  //
   347  //	`shutdown'.
   348  const ( /* socket.h:41:1: */
   349  	SHUT_RD   = 0 // No more receptions.
   350  	SHUT_WR   = 1 // No more transmissions.
   351  	SHUT_RDWR = 2
   352  )
   353  
   354  type Ptrdiff_t = int32 /* <builtin>:3:26 */
   355  
   356  type Size_t = uint32 /* <builtin>:9:23 */
   357  
   358  type Wchar_t = uint32 /* <builtin>:15:24 */
   359  
   360  type X__builtin_va_list = uintptr /* <builtin>:46:14 */
   361  type X__float128 = float64        /* <builtin>:47:21 */
   362  
   363  // Wide character type.
   364  //    Locale-writers should change this as necessary to
   365  //    be big enough to hold unique values not between 0 and 127,
   366  //    and not (wchar_t) -1, for each defined multibyte character.
   367  
   368  // Define this type if we are doing the whole job,
   369  //    or if we want this type in particular.
   370  
   371  // A null pointer constant.
   372  
   373  // Structure for scatter/gather I/O.
   374  type Iovec = struct {
   375  	Fiov_base uintptr
   376  	Fiov_len  Size_t
   377  } /* struct_iovec.h:26:1 */
   378  
   379  // Copyright (C) 1989-2020 Free Software Foundation, Inc.
   380  //
   381  // This file is part of GCC.
   382  //
   383  // GCC is free software; you can redistribute it and/or modify
   384  // it under the terms of the GNU General Public License as published by
   385  // the Free Software Foundation; either version 3, or (at your option)
   386  // any later version.
   387  //
   388  // GCC is distributed in the hope that it will be useful,
   389  // but WITHOUT ANY WARRANTY; without even the implied warranty of
   390  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   391  // GNU General Public License for more details.
   392  //
   393  // Under Section 7 of GPL version 3, you are granted additional
   394  // permissions described in the GCC Runtime Library Exception, version
   395  // 3.1, as published by the Free Software Foundation.
   396  //
   397  // You should have received a copy of the GNU General Public License and
   398  // a copy of the GCC Runtime Library Exception along with this program;
   399  // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
   400  // <http://www.gnu.org/licenses/>.
   401  
   402  // ISO C Standard:  7.17  Common definitions  <stddef.h>
   403  
   404  // Any one of these symbols __need_* means that GNU libc
   405  //    wants us just to define one data type.  So don't define
   406  //    the symbols that indicate this file's entire job has been done.
   407  
   408  // This avoids lossage on SunOS but only if stdtypes.h comes first.
   409  //    There's no way to win with the other order!  Sun lossage.
   410  
   411  // Sequent's header files use _PTRDIFF_T_ in some conflicting way.
   412  //    Just ignore it.
   413  
   414  // On VxWorks, <type/vxTypesBase.h> may have defined macros like
   415  //    _TYPE_size_t which will typedef size_t.  fixincludes patched the
   416  //    vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
   417  //    not defined, and so that defining this macro defines _GCC_SIZE_T.
   418  //    If we find that the macros are still defined at this point, we must
   419  //    invoke them so that the type is defined as expected.
   420  
   421  // In case nobody has defined these types, but we aren't running under
   422  //    GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
   423  //    __WCHAR_TYPE__ have reasonable values.  This can happen if the
   424  //    parts of GCC is compiled by an older compiler, that actually
   425  //    include gstddef.h, such as collect2.
   426  
   427  // Signed type of difference of two pointers.
   428  
   429  // Define this type if we are doing the whole job,
   430  //    or if we want this type in particular.
   431  
   432  // Unsigned type of `sizeof' something.
   433  
   434  // Define this type if we are doing the whole job,
   435  //    or if we want this type in particular.
   436  
   437  // Wide character type.
   438  //    Locale-writers should change this as necessary to
   439  //    be big enough to hold unique values not between 0 and 127,
   440  //    and not (wchar_t) -1, for each defined multibyte character.
   441  
   442  // Define this type if we are doing the whole job,
   443  //    or if we want this type in particular.
   444  
   445  // A null pointer constant.
   446  
   447  // This operating system-specific header file defines the SOCK_*, PF_*,
   448  //    AF_*, MSG_*, SOL_*, and SO_* constants, and the `struct sockaddr',
   449  //    `struct msghdr', and `struct linger' types.
   450  // System-specific socket constants and types.  Linux version.
   451  //    Copyright (C) 1991-2020 Free Software Foundation, Inc.
   452  //    This file is part of the GNU C Library.
   453  //
   454  //    The GNU C Library is free software; you can redistribute it and/or
   455  //    modify it under the terms of the GNU Lesser General Public
   456  //    License as published by the Free Software Foundation; either
   457  //    version 2.1 of the License, or (at your option) any later version.
   458  //
   459  //    The GNU C Library is distributed in the hope that it will be useful,
   460  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   461  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   462  //    Lesser General Public License for more details.
   463  //
   464  //    You should have received a copy of the GNU Lesser General Public
   465  //    License along with the GNU C Library; if not, see
   466  //    <https://www.gnu.org/licenses/>.
   467  
   468  // Copyright (C) 1989-2020 Free Software Foundation, Inc.
   469  //
   470  // This file is part of GCC.
   471  //
   472  // GCC is free software; you can redistribute it and/or modify
   473  // it under the terms of the GNU General Public License as published by
   474  // the Free Software Foundation; either version 3, or (at your option)
   475  // any later version.
   476  //
   477  // GCC is distributed in the hope that it will be useful,
   478  // but WITHOUT ANY WARRANTY; without even the implied warranty of
   479  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   480  // GNU General Public License for more details.
   481  //
   482  // Under Section 7 of GPL version 3, you are granted additional
   483  // permissions described in the GCC Runtime Library Exception, version
   484  // 3.1, as published by the Free Software Foundation.
   485  //
   486  // You should have received a copy of the GNU General Public License and
   487  // a copy of the GCC Runtime Library Exception along with this program;
   488  // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
   489  // <http://www.gnu.org/licenses/>.
   490  
   491  // ISO C Standard:  7.17  Common definitions  <stddef.h>
   492  
   493  // Any one of these symbols __need_* means that GNU libc
   494  //    wants us just to define one data type.  So don't define
   495  //    the symbols that indicate this file's entire job has been done.
   496  
   497  // This avoids lossage on SunOS but only if stdtypes.h comes first.
   498  //    There's no way to win with the other order!  Sun lossage.
   499  
   500  // Sequent's header files use _PTRDIFF_T_ in some conflicting way.
   501  //    Just ignore it.
   502  
   503  // On VxWorks, <type/vxTypesBase.h> may have defined macros like
   504  //    _TYPE_size_t which will typedef size_t.  fixincludes patched the
   505  //    vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
   506  //    not defined, and so that defining this macro defines _GCC_SIZE_T.
   507  //    If we find that the macros are still defined at this point, we must
   508  //    invoke them so that the type is defined as expected.
   509  
   510  // In case nobody has defined these types, but we aren't running under
   511  //    GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
   512  //    __WCHAR_TYPE__ have reasonable values.  This can happen if the
   513  //    parts of GCC is compiled by an older compiler, that actually
   514  //    include gstddef.h, such as collect2.
   515  
   516  // Signed type of difference of two pointers.
   517  
   518  // Define this type if we are doing the whole job,
   519  //    or if we want this type in particular.
   520  
   521  // Unsigned type of `sizeof' something.
   522  
   523  // Define this type if we are doing the whole job,
   524  //    or if we want this type in particular.
   525  
   526  // Wide character type.
   527  //    Locale-writers should change this as necessary to
   528  //    be big enough to hold unique values not between 0 and 127,
   529  //    and not (wchar_t) -1, for each defined multibyte character.
   530  
   531  // Define this type if we are doing the whole job,
   532  //    or if we want this type in particular.
   533  
   534  // A null pointer constant.
   535  
   536  // Copyright (C) 1991-2020 Free Software Foundation, Inc.
   537  //    This file is part of the GNU C Library.
   538  //
   539  //    The GNU C Library is free software; you can redistribute it and/or
   540  //    modify it under the terms of the GNU Lesser General Public
   541  //    License as published by the Free Software Foundation; either
   542  //    version 2.1 of the License, or (at your option) any later version.
   543  //
   544  //    The GNU C Library is distributed in the hope that it will be useful,
   545  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   546  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   547  //    Lesser General Public License for more details.
   548  //
   549  //    You should have received a copy of the GNU Lesser General Public
   550  //    License along with the GNU C Library; if not, see
   551  //    <https://www.gnu.org/licenses/>.
   552  
   553  //	POSIX Standard: 2.6 Primitive System Data Types	<sys/types.h>
   554  
   555  // Copyright (C) 1991-2020 Free Software Foundation, Inc.
   556  //    This file is part of the GNU C Library.
   557  //
   558  //    The GNU C Library is free software; you can redistribute it and/or
   559  //    modify it under the terms of the GNU Lesser General Public
   560  //    License as published by the Free Software Foundation; either
   561  //    version 2.1 of the License, or (at your option) any later version.
   562  //
   563  //    The GNU C Library is distributed in the hope that it will be useful,
   564  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   565  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   566  //    Lesser General Public License for more details.
   567  //
   568  //    You should have received a copy of the GNU Lesser General Public
   569  //    License along with the GNU C Library; if not, see
   570  //    <https://www.gnu.org/licenses/>.
   571  
   572  // bits/types.h -- definitions of __*_t types underlying *_t types.
   573  //    Copyright (C) 2002-2020 Free Software Foundation, Inc.
   574  //    This file is part of the GNU C Library.
   575  //
   576  //    The GNU C Library is free software; you can redistribute it and/or
   577  //    modify it under the terms of the GNU Lesser General Public
   578  //    License as published by the Free Software Foundation; either
   579  //    version 2.1 of the License, or (at your option) any later version.
   580  //
   581  //    The GNU C Library is distributed in the hope that it will be useful,
   582  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   583  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   584  //    Lesser General Public License for more details.
   585  //
   586  //    You should have received a copy of the GNU Lesser General Public
   587  //    License along with the GNU C Library; if not, see
   588  //    <https://www.gnu.org/licenses/>.
   589  
   590  // Never include this file directly; use <sys/types.h> instead.
   591  
   592  // Copyright (C) 1991-2020 Free Software Foundation, Inc.
   593  //    This file is part of the GNU C Library.
   594  //
   595  //    The GNU C Library is free software; you can redistribute it and/or
   596  //    modify it under the terms of the GNU Lesser General Public
   597  //    License as published by the Free Software Foundation; either
   598  //    version 2.1 of the License, or (at your option) any later version.
   599  //
   600  //    The GNU C Library is distributed in the hope that it will be useful,
   601  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   602  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   603  //    Lesser General Public License for more details.
   604  //
   605  //    You should have received a copy of the GNU Lesser General Public
   606  //    License along with the GNU C Library; if not, see
   607  //    <https://www.gnu.org/licenses/>.
   608  
   609  // Copyright (C) 1999-2020 Free Software Foundation, Inc.
   610  //    This file is part of the GNU C Library.
   611  //
   612  //    The GNU C Library is free software; you can redistribute it and/or
   613  //    modify it under the terms of the GNU Lesser General Public
   614  //    License as published by the Free Software Foundation; either
   615  //    version 2.1 of the License, or (at your option) any later version.
   616  //
   617  //    The GNU C Library is distributed in the hope that it will be useful,
   618  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   619  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   620  //    Lesser General Public License for more details.
   621  //
   622  //    You should have received a copy of the GNU Lesser General Public
   623  //    License along with the GNU C Library; if not, see
   624  //    <https://www.gnu.org/licenses/>.
   625  
   626  // Bit size of the time_t type at glibc build time, general case.
   627  //    Copyright (C) 2018-2020 Free Software Foundation, Inc.
   628  //    This file is part of the GNU C Library.
   629  //
   630  //    The GNU C Library is free software; you can redistribute it and/or
   631  //    modify it under the terms of the GNU Lesser General Public
   632  //    License as published by the Free Software Foundation; either
   633  //    version 2.1 of the License, or (at your option) any later version.
   634  //
   635  //    The GNU C Library is distributed in the hope that it will be useful,
   636  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   637  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   638  //    Lesser General Public License for more details.
   639  //
   640  //    You should have received a copy of the GNU Lesser General Public
   641  //    License along with the GNU C Library; if not, see
   642  //    <https://www.gnu.org/licenses/>.
   643  
   644  // Copyright (C) 1999-2020 Free Software Foundation, Inc.
   645  //    This file is part of the GNU C Library.
   646  //
   647  //    The GNU C Library is free software; you can redistribute it and/or
   648  //    modify it under the terms of the GNU Lesser General Public
   649  //    License as published by the Free Software Foundation; either
   650  //    version 2.1 of the License, or (at your option) any later version.
   651  //
   652  //    The GNU C Library is distributed in the hope that it will be useful,
   653  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   654  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   655  //    Lesser General Public License for more details.
   656  //
   657  //    You should have received a copy of the GNU Lesser General Public
   658  //    License along with the GNU C Library; if not, see
   659  //    <https://www.gnu.org/licenses/>.
   660  
   661  // Size in bits of the 'time_t' type of the default ABI.
   662  
   663  // Convenience types.
   664  type X__u_char = uint8   /* types.h:31:23 */
   665  type X__u_short = uint16 /* types.h:32:28 */
   666  type X__u_int = uint32   /* types.h:33:22 */
   667  type X__u_long = uint32  /* types.h:34:27 */
   668  
   669  // Fixed-size types, underlying types depend on word size and compiler.
   670  type X__int8_t = int8     /* types.h:37:21 */
   671  type X__uint8_t = uint8   /* types.h:38:23 */
   672  type X__int16_t = int16   /* types.h:39:26 */
   673  type X__uint16_t = uint16 /* types.h:40:28 */
   674  type X__int32_t = int32   /* types.h:41:20 */
   675  type X__uint32_t = uint32 /* types.h:42:22 */
   676  type X__int64_t = int64   /* types.h:47:44 */
   677  type X__uint64_t = uint64 /* types.h:48:46 */
   678  
   679  // Smallest types with at least a given width.
   680  type X__int_least8_t = X__int8_t     /* types.h:52:18 */
   681  type X__uint_least8_t = X__uint8_t   /* types.h:53:19 */
   682  type X__int_least16_t = X__int16_t   /* types.h:54:19 */
   683  type X__uint_least16_t = X__uint16_t /* types.h:55:20 */
   684  type X__int_least32_t = X__int32_t   /* types.h:56:19 */
   685  type X__uint_least32_t = X__uint32_t /* types.h:57:20 */
   686  type X__int_least64_t = X__int64_t   /* types.h:58:19 */
   687  type X__uint_least64_t = X__uint64_t /* types.h:59:20 */
   688  
   689  // quad_t is also 64 bits.
   690  type X__quad_t = int64    /* types.h:66:37 */
   691  type X__u_quad_t = uint64 /* types.h:67:46 */
   692  
   693  // Largest integral types.
   694  type X__intmax_t = int64   /* types.h:75:37 */
   695  type X__uintmax_t = uint64 /* types.h:76:46 */
   696  
   697  // The machine-dependent file <bits/typesizes.h> defines __*_T_TYPE
   698  //    macros for each of the OS types we define below.  The definitions
   699  //    of those macros must use the following macros for underlying types.
   700  //    We define __S<SIZE>_TYPE and __U<SIZE>_TYPE for the signed and unsigned
   701  //    variants of each of the following integer types on this machine.
   702  //
   703  // 	16		-- "natural" 16-bit type (always short)
   704  // 	32		-- "natural" 32-bit type (always int)
   705  // 	64		-- "natural" 64-bit type (long or long long)
   706  // 	LONG32		-- 32-bit type, traditionally long
   707  // 	QUAD		-- 64-bit type, traditionally long long
   708  // 	WORD		-- natural type of __WORDSIZE bits (int or long)
   709  // 	LONGWORD	-- type of __WORDSIZE bits, traditionally long
   710  //
   711  //    We distinguish WORD/LONGWORD, 32/LONG32, and 64/QUAD so that the
   712  //    conventional uses of `long' or `long long' type modifiers match the
   713  //    types we define, even when a less-adorned type would be the same size.
   714  //    This matters for (somewhat) portably writing printf/scanf formats for
   715  //    these types, where using the appropriate l or ll format modifiers can
   716  //    make the typedefs and the formats match up across all GNU platforms.  If
   717  //    we used `long' when it's 64 bits where `long long' is expected, then the
   718  //    compiler would warn about the formats not matching the argument types,
   719  //    and the programmer changing them to shut up the compiler would break the
   720  //    program's portability.
   721  //
   722  //    Here we assume what is presently the case in all the GCC configurations
   723  //    we support: long long is always 64 bits, long is always word/address size,
   724  //    and int is always 32 bits.
   725  
   726  // We want __extension__ before typedef's that use nonstandard base types
   727  //    such as `long long' in C89 mode.
   728  // bits/typesizes.h -- underlying types for *_t.  Generic version.
   729  //    Copyright (C) 2002-2020 Free Software Foundation, Inc.
   730  //    This file is part of the GNU C Library.
   731  //
   732  //    The GNU C Library is free software; you can redistribute it and/or
   733  //    modify it under the terms of the GNU Lesser General Public
   734  //    License as published by the Free Software Foundation; either
   735  //    version 2.1 of the License, or (at your option) any later version.
   736  //
   737  //    The GNU C Library is distributed in the hope that it will be useful,
   738  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   739  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   740  //    Lesser General Public License for more details.
   741  //
   742  //    You should have received a copy of the GNU Lesser General Public
   743  //    License along with the GNU C Library; if not, see
   744  //    <https://www.gnu.org/licenses/>.
   745  
   746  // See <bits/types.h> for the meaning of these macros.  This file exists so
   747  //    that <bits/types.h> need not vary across different GNU platforms.
   748  
   749  // Number of descriptors that can fit in an `fd_set'.
   750  
   751  // bits/time64.h -- underlying types for __time64_t.  Generic version.
   752  //    Copyright (C) 2018-2020 Free Software Foundation, Inc.
   753  //    This file is part of the GNU C Library.
   754  //
   755  //    The GNU C Library is free software; you can redistribute it and/or
   756  //    modify it under the terms of the GNU Lesser General Public
   757  //    License as published by the Free Software Foundation; either
   758  //    version 2.1 of the License, or (at your option) any later version.
   759  //
   760  //    The GNU C Library is distributed in the hope that it will be useful,
   761  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   762  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   763  //    Lesser General Public License for more details.
   764  //
   765  //    You should have received a copy of the GNU Lesser General Public
   766  //    License along with the GNU C Library; if not, see
   767  //    <https://www.gnu.org/licenses/>.
   768  
   769  // Define __TIME64_T_TYPE so that it is always a 64-bit type.
   770  
   771  // Define a 64-bit time type alongsize the 32-bit one.
   772  
   773  type X__dev_t = X__uint64_t                /* types.h:145:25 */ // Type of device numbers.
   774  type X__uid_t = uint32                     /* types.h:146:25 */ // Type of user identifications.
   775  type X__gid_t = uint32                     /* types.h:147:25 */ // Type of group identifications.
   776  type X__ino_t = uint32                     /* types.h:148:25 */ // Type of file serial numbers.
   777  type X__ino64_t = X__uint64_t              /* types.h:149:27 */ // Type of file serial numbers (LFS).
   778  type X__mode_t = uint32                    /* types.h:150:26 */ // Type of file attribute bitmasks.
   779  type X__nlink_t = uint32                   /* types.h:151:27 */ // Type of file link counts.
   780  type X__off_t = int32                      /* types.h:152:25 */ // Type of file sizes and offsets.
   781  type X__off64_t = X__int64_t               /* types.h:153:27 */ // Type of file sizes and offsets (LFS).
   782  type X__pid_t = int32                      /* types.h:154:25 */ // Type of process identifications.
   783  type X__fsid_t = struct{ F__val [2]int32 } /* types.h:155:26 */ // Type of file system IDs.
   784  type X__clock_t = int32                    /* types.h:156:27 */ // Type of CPU usage counts.
   785  type X__rlim_t = uint32                    /* types.h:157:26 */ // Type for resource measurement.
   786  type X__rlim64_t = X__uint64_t             /* types.h:158:28 */ // Type for resource measurement (LFS).
   787  type X__id_t = uint32                      /* types.h:159:24 */ // General type for IDs.
   788  type X__time_t = int32                     /* types.h:160:26 */ // Seconds since the Epoch.
   789  type X__useconds_t = uint32                /* types.h:161:30 */ // Count of microseconds.
   790  type X__suseconds_t = int32                /* types.h:162:31 */ // Signed count of microseconds.
   791  
   792  type X__daddr_t = int32 /* types.h:164:27 */ // The type of a disk address.
   793  type X__key_t = int32   /* types.h:165:25 */ // Type of an IPC key.
   794  
   795  // Clock ID used in clock and timer functions.
   796  type X__clockid_t = int32 /* types.h:168:29 */
   797  
   798  // Timer ID returned by `timer_create'.
   799  type X__timer_t = uintptr /* types.h:171:12 */
   800  
   801  // Type to represent block size.
   802  type X__blksize_t = int32 /* types.h:174:29 */
   803  
   804  // Types from the Large File Support interface.
   805  
   806  // Type to count number of disk blocks.
   807  type X__blkcnt_t = int32        /* types.h:179:28 */
   808  type X__blkcnt64_t = X__int64_t /* types.h:180:30 */
   809  
   810  // Type to count file system blocks.
   811  type X__fsblkcnt_t = uint32        /* types.h:183:30 */
   812  type X__fsblkcnt64_t = X__uint64_t /* types.h:184:32 */
   813  
   814  // Type to count file system nodes.
   815  type X__fsfilcnt_t = uint32        /* types.h:187:30 */
   816  type X__fsfilcnt64_t = X__uint64_t /* types.h:188:32 */
   817  
   818  // Type of miscellaneous file system fields.
   819  type X__fsword_t = int32 /* types.h:191:28 */
   820  
   821  type X__ssize_t = int32 /* types.h:193:27 */ // Type of a byte count, or error.
   822  
   823  // Signed long type used in system calls.
   824  type X__syscall_slong_t = int32 /* types.h:196:33 */
   825  // Unsigned long type used in system calls.
   826  type X__syscall_ulong_t = uint32 /* types.h:198:33 */
   827  
   828  // These few don't really vary by system, they always correspond
   829  //
   830  //	to one of the other defined types.
   831  type X__loff_t = X__off64_t /* types.h:202:19 */ // Type of file sizes and offsets (LFS).
   832  type X__caddr_t = uintptr   /* types.h:203:14 */
   833  
   834  // Duplicates info from stdint.h but this is used in unistd.h.
   835  type X__intptr_t = int32 /* types.h:206:25 */
   836  
   837  // Duplicate info from sys/socket.h.
   838  type X__socklen_t = uint32 /* types.h:209:23 */
   839  
   840  // C99: An integer type that can be accessed as an atomic entity,
   841  //
   842  //	even in the presence of asynchronous interrupts.
   843  //	It is not currently necessary for this to be machine-specific.
   844  type X__sig_atomic_t = int32 /* types.h:214:13 */
   845  
   846  // Seconds since the Epoch, visible to user code when time_t is too
   847  //
   848  //	narrow only for consistency with the old way of widening too-narrow
   849  //	types.  User code should never use __time64_t.
   850  type X__time64_t = X__int64_t /* types.h:222:28 */
   851  
   852  type U_char = X__u_char     /* types.h:33:18 */
   853  type U_short = X__u_short   /* types.h:34:19 */
   854  type U_int = X__u_int       /* types.h:35:17 */
   855  type U_long = X__u_long     /* types.h:36:18 */
   856  type Quad_t = X__quad_t     /* types.h:37:18 */
   857  type U_quad_t = X__u_quad_t /* types.h:38:20 */
   858  type Fsid_t = X__fsid_t     /* types.h:39:18 */
   859  type Loff_t = X__loff_t     /* types.h:42:18 */
   860  
   861  type Ino_t = X__ino64_t /* types.h:49:19 */
   862  
   863  type Dev_t = X__dev_t /* types.h:59:17 */
   864  
   865  type Gid_t = X__gid_t /* types.h:64:17 */
   866  
   867  type Mode_t = X__mode_t /* types.h:69:18 */
   868  
   869  type Nlink_t = X__nlink_t /* types.h:74:19 */
   870  
   871  type Uid_t = X__uid_t /* types.h:79:17 */
   872  
   873  type Off_t = X__off64_t /* types.h:87:19 */
   874  
   875  type Pid_t = X__pid_t /* types.h:97:17 */
   876  
   877  type Id_t = X__id_t /* types.h:103:16 */
   878  
   879  type Ssize_t = X__ssize_t /* types.h:108:19 */
   880  
   881  type Daddr_t = X__daddr_t /* types.h:114:19 */
   882  type Caddr_t = X__caddr_t /* types.h:115:19 */
   883  
   884  type Key_t = X__key_t /* types.h:121:17 */
   885  
   886  // bits/types.h -- definitions of __*_t types underlying *_t types.
   887  //    Copyright (C) 2002-2020 Free Software Foundation, Inc.
   888  //    This file is part of the GNU C Library.
   889  //
   890  //    The GNU C Library is free software; you can redistribute it and/or
   891  //    modify it under the terms of the GNU Lesser General Public
   892  //    License as published by the Free Software Foundation; either
   893  //    version 2.1 of the License, or (at your option) any later version.
   894  //
   895  //    The GNU C Library is distributed in the hope that it will be useful,
   896  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   897  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   898  //    Lesser General Public License for more details.
   899  //
   900  //    You should have received a copy of the GNU Lesser General Public
   901  //    License along with the GNU C Library; if not, see
   902  //    <https://www.gnu.org/licenses/>.
   903  
   904  // Never include this file directly; use <sys/types.h> instead.
   905  
   906  // Returned by `clock'.
   907  type Clock_t = X__clock_t /* clock_t.h:7:19 */
   908  
   909  // bits/types.h -- definitions of __*_t types underlying *_t types.
   910  //    Copyright (C) 2002-2020 Free Software Foundation, Inc.
   911  //    This file is part of the GNU C Library.
   912  //
   913  //    The GNU C Library is free software; you can redistribute it and/or
   914  //    modify it under the terms of the GNU Lesser General Public
   915  //    License as published by the Free Software Foundation; either
   916  //    version 2.1 of the License, or (at your option) any later version.
   917  //
   918  //    The GNU C Library is distributed in the hope that it will be useful,
   919  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   920  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   921  //    Lesser General Public License for more details.
   922  //
   923  //    You should have received a copy of the GNU Lesser General Public
   924  //    License along with the GNU C Library; if not, see
   925  //    <https://www.gnu.org/licenses/>.
   926  
   927  // Never include this file directly; use <sys/types.h> instead.
   928  
   929  // Clock ID used in clock and timer functions.
   930  type Clockid_t = X__clockid_t /* clockid_t.h:7:21 */
   931  
   932  // bits/types.h -- definitions of __*_t types underlying *_t types.
   933  //    Copyright (C) 2002-2020 Free Software Foundation, Inc.
   934  //    This file is part of the GNU C Library.
   935  //
   936  //    The GNU C Library is free software; you can redistribute it and/or
   937  //    modify it under the terms of the GNU Lesser General Public
   938  //    License as published by the Free Software Foundation; either
   939  //    version 2.1 of the License, or (at your option) any later version.
   940  //
   941  //    The GNU C Library is distributed in the hope that it will be useful,
   942  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   943  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   944  //    Lesser General Public License for more details.
   945  //
   946  //    You should have received a copy of the GNU Lesser General Public
   947  //    License along with the GNU C Library; if not, see
   948  //    <https://www.gnu.org/licenses/>.
   949  
   950  // Never include this file directly; use <sys/types.h> instead.
   951  
   952  // Returned by `time'.
   953  type Time_t = X__time_t /* time_t.h:7:18 */
   954  
   955  // bits/types.h -- definitions of __*_t types underlying *_t types.
   956  //    Copyright (C) 2002-2020 Free Software Foundation, Inc.
   957  //    This file is part of the GNU C Library.
   958  //
   959  //    The GNU C Library is free software; you can redistribute it and/or
   960  //    modify it under the terms of the GNU Lesser General Public
   961  //    License as published by the Free Software Foundation; either
   962  //    version 2.1 of the License, or (at your option) any later version.
   963  //
   964  //    The GNU C Library is distributed in the hope that it will be useful,
   965  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
   966  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   967  //    Lesser General Public License for more details.
   968  //
   969  //    You should have received a copy of the GNU Lesser General Public
   970  //    License along with the GNU C Library; if not, see
   971  //    <https://www.gnu.org/licenses/>.
   972  
   973  // Never include this file directly; use <sys/types.h> instead.
   974  
   975  // Timer ID returned by `timer_create'.
   976  type Timer_t = X__timer_t /* timer_t.h:7:19 */
   977  
   978  // Copyright (C) 1989-2020 Free Software Foundation, Inc.
   979  //
   980  // This file is part of GCC.
   981  //
   982  // GCC is free software; you can redistribute it and/or modify
   983  // it under the terms of the GNU General Public License as published by
   984  // the Free Software Foundation; either version 3, or (at your option)
   985  // any later version.
   986  //
   987  // GCC is distributed in the hope that it will be useful,
   988  // but WITHOUT ANY WARRANTY; without even the implied warranty of
   989  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   990  // GNU General Public License for more details.
   991  //
   992  // Under Section 7 of GPL version 3, you are granted additional
   993  // permissions described in the GCC Runtime Library Exception, version
   994  // 3.1, as published by the Free Software Foundation.
   995  //
   996  // You should have received a copy of the GNU General Public License and
   997  // a copy of the GCC Runtime Library Exception along with this program;
   998  // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
   999  // <http://www.gnu.org/licenses/>.
  1000  
  1001  // ISO C Standard:  7.17  Common definitions  <stddef.h>
  1002  
  1003  // Any one of these symbols __need_* means that GNU libc
  1004  //    wants us just to define one data type.  So don't define
  1005  //    the symbols that indicate this file's entire job has been done.
  1006  
  1007  // This avoids lossage on SunOS but only if stdtypes.h comes first.
  1008  //    There's no way to win with the other order!  Sun lossage.
  1009  
  1010  // Sequent's header files use _PTRDIFF_T_ in some conflicting way.
  1011  //    Just ignore it.
  1012  
  1013  // On VxWorks, <type/vxTypesBase.h> may have defined macros like
  1014  //    _TYPE_size_t which will typedef size_t.  fixincludes patched the
  1015  //    vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
  1016  //    not defined, and so that defining this macro defines _GCC_SIZE_T.
  1017  //    If we find that the macros are still defined at this point, we must
  1018  //    invoke them so that the type is defined as expected.
  1019  
  1020  // In case nobody has defined these types, but we aren't running under
  1021  //    GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
  1022  //    __WCHAR_TYPE__ have reasonable values.  This can happen if the
  1023  //    parts of GCC is compiled by an older compiler, that actually
  1024  //    include gstddef.h, such as collect2.
  1025  
  1026  // Signed type of difference of two pointers.
  1027  
  1028  // Define this type if we are doing the whole job,
  1029  //    or if we want this type in particular.
  1030  
  1031  // Unsigned type of `sizeof' something.
  1032  
  1033  // Define this type if we are doing the whole job,
  1034  //    or if we want this type in particular.
  1035  
  1036  // Wide character type.
  1037  //    Locale-writers should change this as necessary to
  1038  //    be big enough to hold unique values not between 0 and 127,
  1039  //    and not (wchar_t) -1, for each defined multibyte character.
  1040  
  1041  // Define this type if we are doing the whole job,
  1042  //    or if we want this type in particular.
  1043  
  1044  // A null pointer constant.
  1045  
  1046  // Old compatibility names for C types.
  1047  type Ulong = uint32  /* types.h:148:27 */
  1048  type Ushort = uint16 /* types.h:149:28 */
  1049  type Uint = uint32   /* types.h:150:22 */
  1050  
  1051  // These size-specific names are used by some of the inet code.
  1052  
  1053  // Define intN_t types.
  1054  //    Copyright (C) 2017-2020 Free Software Foundation, Inc.
  1055  //    This file is part of the GNU C Library.
  1056  //
  1057  //    The GNU C Library is free software; you can redistribute it and/or
  1058  //    modify it under the terms of the GNU Lesser General Public
  1059  //    License as published by the Free Software Foundation; either
  1060  //    version 2.1 of the License, or (at your option) any later version.
  1061  //
  1062  //    The GNU C Library is distributed in the hope that it will be useful,
  1063  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1064  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1065  //    Lesser General Public License for more details.
  1066  //
  1067  //    You should have received a copy of the GNU Lesser General Public
  1068  //    License along with the GNU C Library; if not, see
  1069  //    <https://www.gnu.org/licenses/>.
  1070  
  1071  // bits/types.h -- definitions of __*_t types underlying *_t types.
  1072  //    Copyright (C) 2002-2020 Free Software Foundation, Inc.
  1073  //    This file is part of the GNU C Library.
  1074  //
  1075  //    The GNU C Library is free software; you can redistribute it and/or
  1076  //    modify it under the terms of the GNU Lesser General Public
  1077  //    License as published by the Free Software Foundation; either
  1078  //    version 2.1 of the License, or (at your option) any later version.
  1079  //
  1080  //    The GNU C Library is distributed in the hope that it will be useful,
  1081  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1082  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1083  //    Lesser General Public License for more details.
  1084  //
  1085  //    You should have received a copy of the GNU Lesser General Public
  1086  //    License along with the GNU C Library; if not, see
  1087  //    <https://www.gnu.org/licenses/>.
  1088  
  1089  // Never include this file directly; use <sys/types.h> instead.
  1090  
  1091  type Int8_t = X__int8_t   /* stdint-intn.h:24:18 */
  1092  type Int16_t = X__int16_t /* stdint-intn.h:25:19 */
  1093  type Int32_t = X__int32_t /* stdint-intn.h:26:19 */
  1094  type Int64_t = X__int64_t /* stdint-intn.h:27:19 */
  1095  
  1096  // These were defined by ISO C without the first `_'.
  1097  type U_int8_t = X__uint8_t   /* types.h:158:19 */
  1098  type U_int16_t = X__uint16_t /* types.h:159:20 */
  1099  type U_int32_t = X__uint32_t /* types.h:160:20 */
  1100  type U_int64_t = X__uint64_t /* types.h:161:20 */
  1101  
  1102  type Register_t = int32 /* types.h:164:13 */
  1103  
  1104  // It also defines `fd_set' and the FD_* macros for `select'.
  1105  // `fd_set' type and related macros, and `select'/`pselect' declarations.
  1106  //    Copyright (C) 1996-2020 Free Software Foundation, Inc.
  1107  //    This file is part of the GNU C Library.
  1108  //
  1109  //    The GNU C Library is free software; you can redistribute it and/or
  1110  //    modify it under the terms of the GNU Lesser General Public
  1111  //    License as published by the Free Software Foundation; either
  1112  //    version 2.1 of the License, or (at your option) any later version.
  1113  //
  1114  //    The GNU C Library is distributed in the hope that it will be useful,
  1115  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1116  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1117  //    Lesser General Public License for more details.
  1118  //
  1119  //    You should have received a copy of the GNU Lesser General Public
  1120  //    License along with the GNU C Library; if not, see
  1121  //    <https://www.gnu.org/licenses/>.
  1122  
  1123  //	POSIX 1003.1g: 6.2 Select from File Descriptor Sets <sys/select.h>
  1124  
  1125  // Copyright (C) 1991-2020 Free Software Foundation, Inc.
  1126  //    This file is part of the GNU C Library.
  1127  //
  1128  //    The GNU C Library is free software; you can redistribute it and/or
  1129  //    modify it under the terms of the GNU Lesser General Public
  1130  //    License as published by the Free Software Foundation; either
  1131  //    version 2.1 of the License, or (at your option) any later version.
  1132  //
  1133  //    The GNU C Library is distributed in the hope that it will be useful,
  1134  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1135  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1136  //    Lesser General Public License for more details.
  1137  //
  1138  //    You should have received a copy of the GNU Lesser General Public
  1139  //    License along with the GNU C Library; if not, see
  1140  //    <https://www.gnu.org/licenses/>.
  1141  
  1142  // Get definition of needed basic types.
  1143  // bits/types.h -- definitions of __*_t types underlying *_t types.
  1144  //    Copyright (C) 2002-2020 Free Software Foundation, Inc.
  1145  //    This file is part of the GNU C Library.
  1146  //
  1147  //    The GNU C Library is free software; you can redistribute it and/or
  1148  //    modify it under the terms of the GNU Lesser General Public
  1149  //    License as published by the Free Software Foundation; either
  1150  //    version 2.1 of the License, or (at your option) any later version.
  1151  //
  1152  //    The GNU C Library is distributed in the hope that it will be useful,
  1153  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1154  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1155  //    Lesser General Public License for more details.
  1156  //
  1157  //    You should have received a copy of the GNU Lesser General Public
  1158  //    License along with the GNU C Library; if not, see
  1159  //    <https://www.gnu.org/licenses/>.
  1160  
  1161  // Never include this file directly; use <sys/types.h> instead.
  1162  
  1163  // Get __FD_* definitions.
  1164  // Copyright (C) 1997-2020 Free Software Foundation, Inc.
  1165  //    This file is part of the GNU C Library.
  1166  //
  1167  //    The GNU C Library is free software; you can redistribute it and/or
  1168  //    modify it under the terms of the GNU Lesser General Public
  1169  //    License as published by the Free Software Foundation; either
  1170  //    version 2.1 of the License, or (at your option) any later version.
  1171  //
  1172  //    The GNU C Library is distributed in the hope that it will be useful,
  1173  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1174  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1175  //    Lesser General Public License for more details.
  1176  //
  1177  //    You should have received a copy of the GNU Lesser General Public
  1178  //    License along with the GNU C Library; if not, see
  1179  //    <https://www.gnu.org/licenses/>.
  1180  
  1181  // We don't use `memset' because this would require a prototype and
  1182  //    the array isn't too big.
  1183  
  1184  // Get sigset_t.
  1185  
  1186  type X__sigset_t = struct{ F__val [32]uint32 } /* __sigset_t.h:8:3 */
  1187  
  1188  // A set of signals to be blocked, unblocked, or waited for.
  1189  type Sigset_t = X__sigset_t /* sigset_t.h:7:20 */
  1190  
  1191  // Get definition of timer specification structures.
  1192  
  1193  // bits/types.h -- definitions of __*_t types underlying *_t types.
  1194  //    Copyright (C) 2002-2020 Free Software Foundation, Inc.
  1195  //    This file is part of the GNU C Library.
  1196  //
  1197  //    The GNU C Library is free software; you can redistribute it and/or
  1198  //    modify it under the terms of the GNU Lesser General Public
  1199  //    License as published by the Free Software Foundation; either
  1200  //    version 2.1 of the License, or (at your option) any later version.
  1201  //
  1202  //    The GNU C Library is distributed in the hope that it will be useful,
  1203  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1204  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1205  //    Lesser General Public License for more details.
  1206  //
  1207  //    You should have received a copy of the GNU Lesser General Public
  1208  //    License along with the GNU C Library; if not, see
  1209  //    <https://www.gnu.org/licenses/>.
  1210  
  1211  // Never include this file directly; use <sys/types.h> instead.
  1212  
  1213  // A time value that is accurate to the nearest
  1214  //
  1215  //	microsecond but also has a range of years.
  1216  type Timeval = struct {
  1217  	Ftv_sec  X__time_t
  1218  	Ftv_usec X__suseconds_t
  1219  } /* struct_timeval.h:8:1 */
  1220  
  1221  // NB: Include guard matches what <linux/time.h> uses.
  1222  
  1223  // bits/types.h -- definitions of __*_t types underlying *_t types.
  1224  //    Copyright (C) 2002-2020 Free Software Foundation, Inc.
  1225  //    This file is part of the GNU C Library.
  1226  //
  1227  //    The GNU C Library is free software; you can redistribute it and/or
  1228  //    modify it under the terms of the GNU Lesser General Public
  1229  //    License as published by the Free Software Foundation; either
  1230  //    version 2.1 of the License, or (at your option) any later version.
  1231  //
  1232  //    The GNU C Library is distributed in the hope that it will be useful,
  1233  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1234  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1235  //    Lesser General Public License for more details.
  1236  //
  1237  //    You should have received a copy of the GNU Lesser General Public
  1238  //    License along with the GNU C Library; if not, see
  1239  //    <https://www.gnu.org/licenses/>.
  1240  
  1241  // Never include this file directly; use <sys/types.h> instead.
  1242  
  1243  // Endian macros for string.h functions
  1244  //    Copyright (C) 1992-2020 Free Software Foundation, Inc.
  1245  //    This file is part of the GNU C Library.
  1246  //
  1247  //    The GNU C Library is free software; you can redistribute it and/or
  1248  //    modify it under the terms of the GNU Lesser General Public
  1249  //    License as published by the Free Software Foundation; either
  1250  //    version 2.1 of the License, or (at your option) any later version.
  1251  //
  1252  //    The GNU C Library is distributed in the hope that it will be useful,
  1253  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1254  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1255  //    Lesser General Public License for more details.
  1256  //
  1257  //    You should have received a copy of the GNU Lesser General Public
  1258  //    License along with the GNU C Library; if not, see
  1259  //    <http://www.gnu.org/licenses/>.
  1260  
  1261  // POSIX.1b structure for a time value.  This is like a `struct timeval' but
  1262  //
  1263  //	has nanoseconds instead of microseconds.
  1264  type Timespec = struct {
  1265  	Ftv_sec  X__time_t
  1266  	Ftv_nsec X__syscall_slong_t
  1267  } /* struct_timespec.h:10:1 */
  1268  
  1269  type Suseconds_t = X__suseconds_t /* select.h:43:23 */
  1270  
  1271  // The fd_set member is required to be an array of longs.
  1272  type X__fd_mask = int32 /* select.h:49:18 */
  1273  
  1274  // Some versions of <linux/posix_types.h> define this macros.
  1275  // It's easier to assume 8-bit bytes than to get CHAR_BIT.
  1276  
  1277  // fd_set for select and pselect.
  1278  type Fd_set = struct{ F__fds_bits [32]X__fd_mask } /* select.h:70:5 */
  1279  
  1280  // Maximum number of file descriptors in `fd_set'.
  1281  
  1282  // Sometimes the fd_set member is assumed to have this type.
  1283  type Fd_mask = X__fd_mask /* select.h:77:19 */
  1284  
  1285  // Define some inlines helping to catch common problems.
  1286  
  1287  type Blksize_t = X__blksize_t /* types.h:185:21 */
  1288  
  1289  // Types from the Large File Support interface.
  1290  type Blkcnt_t = X__blkcnt64_t     /* types.h:205:22 */ // Type to count number of disk blocks.
  1291  type Fsblkcnt_t = X__fsblkcnt64_t /* types.h:209:24 */ // Type to count file system blocks.
  1292  type Fsfilcnt_t = X__fsfilcnt64_t /* types.h:213:24 */ // Type to count file system inodes.
  1293  
  1294  // Now add the thread types.
  1295  // Declaration of common pthread types for all architectures.
  1296  //    Copyright (C) 2017-2020 Free Software Foundation, Inc.
  1297  //    This file is part of the GNU C Library.
  1298  //
  1299  //    The GNU C Library is free software; you can redistribute it and/or
  1300  //    modify it under the terms of the GNU Lesser General Public
  1301  //    License as published by the Free Software Foundation; either
  1302  //    version 2.1 of the License, or (at your option) any later version.
  1303  //
  1304  //    The GNU C Library is distributed in the hope that it will be useful,
  1305  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1306  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1307  //    Lesser General Public License for more details.
  1308  //
  1309  //    You should have received a copy of the GNU Lesser General Public
  1310  //    License along with the GNU C Library; if not, see
  1311  //    <https://www.gnu.org/licenses/>.
  1312  
  1313  // For internal mutex and condition variable definitions.
  1314  // Common threading primitives definitions for both POSIX and C11.
  1315  //    Copyright (C) 2017-2020 Free Software Foundation, Inc.
  1316  //    This file is part of the GNU C Library.
  1317  //
  1318  //    The GNU C Library is free software; you can redistribute it and/or
  1319  //    modify it under the terms of the GNU Lesser General Public
  1320  //    License as published by the Free Software Foundation; either
  1321  //    version 2.1 of the License, or (at your option) any later version.
  1322  //
  1323  //    The GNU C Library is distributed in the hope that it will be useful,
  1324  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1325  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1326  //    Lesser General Public License for more details.
  1327  //
  1328  //    You should have received a copy of the GNU Lesser General Public
  1329  //    License along with the GNU C Library; if not, see
  1330  //    <https://www.gnu.org/licenses/>.
  1331  
  1332  // Arch-specific definitions.  Each architecture must define the following
  1333  //    macros to define the expected sizes of pthread data types:
  1334  //
  1335  //    __SIZEOF_PTHREAD_ATTR_T        - size of pthread_attr_t.
  1336  //    __SIZEOF_PTHREAD_MUTEX_T       - size of pthread_mutex_t.
  1337  //    __SIZEOF_PTHREAD_MUTEXATTR_T   - size of pthread_mutexattr_t.
  1338  //    __SIZEOF_PTHREAD_COND_T        - size of pthread_cond_t.
  1339  //    __SIZEOF_PTHREAD_CONDATTR_T    - size of pthread_condattr_t.
  1340  //    __SIZEOF_PTHREAD_RWLOCK_T      - size of pthread_rwlock_t.
  1341  //    __SIZEOF_PTHREAD_RWLOCKATTR_T  - size of pthread_rwlockattr_t.
  1342  //    __SIZEOF_PTHREAD_BARRIER_T     - size of pthread_barrier_t.
  1343  //    __SIZEOF_PTHREAD_BARRIERATTR_T - size of pthread_barrierattr_t.
  1344  //
  1345  //    The additional macro defines any constraint for the lock alignment
  1346  //    inside the thread structures:
  1347  //
  1348  //    __LOCK_ALIGNMENT - for internal lock/futex usage.
  1349  //
  1350  //    Same idea but for the once locking primitive:
  1351  //
  1352  //    __ONCE_ALIGNMENT - for pthread_once_t/once_flag definition.
  1353  
  1354  // Machine-specific pthread type layouts.  Generic version.
  1355  //    Copyright (C) 2019-2020 Free Software Foundation, Inc.
  1356  //
  1357  //    This file is part of the GNU C Library.
  1358  //
  1359  //    The GNU C Library is free software; you can redistribute it and/or
  1360  //    modify it under the terms of the GNU Lesser General Public
  1361  //    License as published by the Free Software Foundation; either
  1362  //    version 2.1 of the License, or (at your option) any later version.
  1363  //
  1364  //    The GNU C Library is distributed in the hope that it will be useful,
  1365  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1366  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1367  //    Lesser General Public License for more details.
  1368  //
  1369  //    You should have received a copy of the GNU Lesser General Public
  1370  //    License along with the GNU C Library; if not, see
  1371  //    <http://www.gnu.org/licenses/>.
  1372  
  1373  // Copyright (C) 1999-2020 Free Software Foundation, Inc.
  1374  //    This file is part of the GNU C Library.
  1375  //
  1376  //    The GNU C Library is free software; you can redistribute it and/or
  1377  //    modify it under the terms of the GNU Lesser General Public
  1378  //    License as published by the Free Software Foundation; either
  1379  //    version 2.1 of the License, or (at your option) any later version.
  1380  //
  1381  //    The GNU C Library is distributed in the hope that it will be useful,
  1382  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1383  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1384  //    Lesser General Public License for more details.
  1385  //
  1386  //    You should have received a copy of the GNU Lesser General Public
  1387  //    License along with the GNU C Library; if not, see
  1388  //    <https://www.gnu.org/licenses/>.
  1389  
  1390  // Common definition of pthread_mutex_t.
  1391  
  1392  type X__pthread_internal_list = struct {
  1393  	F__prev uintptr
  1394  	F__next uintptr
  1395  } /* thread-shared-types.h:49:9 */
  1396  
  1397  // Type to count file system inodes.
  1398  
  1399  // Now add the thread types.
  1400  // Declaration of common pthread types for all architectures.
  1401  //    Copyright (C) 2017-2020 Free Software Foundation, Inc.
  1402  //    This file is part of the GNU C Library.
  1403  //
  1404  //    The GNU C Library is free software; you can redistribute it and/or
  1405  //    modify it under the terms of the GNU Lesser General Public
  1406  //    License as published by the Free Software Foundation; either
  1407  //    version 2.1 of the License, or (at your option) any later version.
  1408  //
  1409  //    The GNU C Library is distributed in the hope that it will be useful,
  1410  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1411  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1412  //    Lesser General Public License for more details.
  1413  //
  1414  //    You should have received a copy of the GNU Lesser General Public
  1415  //    License along with the GNU C Library; if not, see
  1416  //    <https://www.gnu.org/licenses/>.
  1417  
  1418  // For internal mutex and condition variable definitions.
  1419  // Common threading primitives definitions for both POSIX and C11.
  1420  //    Copyright (C) 2017-2020 Free Software Foundation, Inc.
  1421  //    This file is part of the GNU C Library.
  1422  //
  1423  //    The GNU C Library is free software; you can redistribute it and/or
  1424  //    modify it under the terms of the GNU Lesser General Public
  1425  //    License as published by the Free Software Foundation; either
  1426  //    version 2.1 of the License, or (at your option) any later version.
  1427  //
  1428  //    The GNU C Library is distributed in the hope that it will be useful,
  1429  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1430  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1431  //    Lesser General Public License for more details.
  1432  //
  1433  //    You should have received a copy of the GNU Lesser General Public
  1434  //    License along with the GNU C Library; if not, see
  1435  //    <https://www.gnu.org/licenses/>.
  1436  
  1437  // Arch-specific definitions.  Each architecture must define the following
  1438  //    macros to define the expected sizes of pthread data types:
  1439  //
  1440  //    __SIZEOF_PTHREAD_ATTR_T        - size of pthread_attr_t.
  1441  //    __SIZEOF_PTHREAD_MUTEX_T       - size of pthread_mutex_t.
  1442  //    __SIZEOF_PTHREAD_MUTEXATTR_T   - size of pthread_mutexattr_t.
  1443  //    __SIZEOF_PTHREAD_COND_T        - size of pthread_cond_t.
  1444  //    __SIZEOF_PTHREAD_CONDATTR_T    - size of pthread_condattr_t.
  1445  //    __SIZEOF_PTHREAD_RWLOCK_T      - size of pthread_rwlock_t.
  1446  //    __SIZEOF_PTHREAD_RWLOCKATTR_T  - size of pthread_rwlockattr_t.
  1447  //    __SIZEOF_PTHREAD_BARRIER_T     - size of pthread_barrier_t.
  1448  //    __SIZEOF_PTHREAD_BARRIERATTR_T - size of pthread_barrierattr_t.
  1449  //
  1450  //    The additional macro defines any constraint for the lock alignment
  1451  //    inside the thread structures:
  1452  //
  1453  //    __LOCK_ALIGNMENT - for internal lock/futex usage.
  1454  //
  1455  //    Same idea but for the once locking primitive:
  1456  //
  1457  //    __ONCE_ALIGNMENT - for pthread_once_t/once_flag definition.
  1458  
  1459  // Machine-specific pthread type layouts.  Generic version.
  1460  //    Copyright (C) 2019-2020 Free Software Foundation, Inc.
  1461  //
  1462  //    This file is part of the GNU C Library.
  1463  //
  1464  //    The GNU C Library is free software; you can redistribute it and/or
  1465  //    modify it under the terms of the GNU Lesser General Public
  1466  //    License as published by the Free Software Foundation; either
  1467  //    version 2.1 of the License, or (at your option) any later version.
  1468  //
  1469  //    The GNU C Library is distributed in the hope that it will be useful,
  1470  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1471  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1472  //    Lesser General Public License for more details.
  1473  //
  1474  //    You should have received a copy of the GNU Lesser General Public
  1475  //    License along with the GNU C Library; if not, see
  1476  //    <http://www.gnu.org/licenses/>.
  1477  
  1478  // Copyright (C) 1999-2020 Free Software Foundation, Inc.
  1479  //    This file is part of the GNU C Library.
  1480  //
  1481  //    The GNU C Library is free software; you can redistribute it and/or
  1482  //    modify it under the terms of the GNU Lesser General Public
  1483  //    License as published by the Free Software Foundation; either
  1484  //    version 2.1 of the License, or (at your option) any later version.
  1485  //
  1486  //    The GNU C Library is distributed in the hope that it will be useful,
  1487  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1488  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1489  //    Lesser General Public License for more details.
  1490  //
  1491  //    You should have received a copy of the GNU Lesser General Public
  1492  //    License along with the GNU C Library; if not, see
  1493  //    <https://www.gnu.org/licenses/>.
  1494  
  1495  // Common definition of pthread_mutex_t.
  1496  
  1497  type X__pthread_list_t = X__pthread_internal_list /* thread-shared-types.h:53:3 */
  1498  
  1499  type X__pthread_internal_slist = struct{ F__next uintptr } /* thread-shared-types.h:55:9 */
  1500  
  1501  type X__pthread_slist_t = X__pthread_internal_slist /* thread-shared-types.h:58:3 */
  1502  
  1503  // Arch-specific mutex definitions.  A generic implementation is provided
  1504  //    by sysdeps/nptl/bits/struct_mutex.h.  If required, an architecture
  1505  //    can override it by defining:
  1506  //
  1507  //    1. struct __pthread_mutex_s (used on both pthread_mutex_t and mtx_t
  1508  //       definition).  It should contains at least the internal members
  1509  //       defined in the generic version.
  1510  //
  1511  //    2. __LOCK_ALIGNMENT for any extra attribute for internal lock used with
  1512  //       atomic operations.
  1513  //
  1514  //    3. The macro __PTHREAD_MUTEX_INITIALIZER used for static initialization.
  1515  //       It should initialize the mutex internal flag.
  1516  
  1517  // Default mutex implementation struct definitions.
  1518  //    Copyright (C) 2019-2020 Free Software Foundation, Inc.
  1519  //    This file is part of the GNU C Library.
  1520  //
  1521  //    The GNU C Library is free software; you can redistribute it and/or
  1522  //    modify it under the terms of the GNU Lesser General Public
  1523  //    License as published by the Free Software Foundation; either
  1524  //    version 2.1 of the License, or (at your option) any later version.
  1525  //
  1526  //    The GNU C Library is distributed in the hope that it will be useful,
  1527  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1528  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1529  //    Lesser General Public License for more details.
  1530  //
  1531  //    You should have received a copy of the GNU Lesser General Public
  1532  //    License along with the GNU C Library; if not, see
  1533  //    <http://www.gnu.org/licenses/>.
  1534  
  1535  // Generic struct for both POSIX and C11 mutexes.  New ports are expected
  1536  //    to use the default layout, however architecture can redefine it to
  1537  //    add arch-specific extension (such as lock-elision).  The struct have
  1538  //    a size of 32 bytes on LP32 and 40 bytes on LP64 architectures.
  1539  
  1540  type X__pthread_mutex_s = struct {
  1541  	F__lock   int32
  1542  	F__count  uint32
  1543  	F__owner  int32
  1544  	F__kind   int32
  1545  	F__nusers uint32
  1546  	F__20     struct{ F__spins int32 }
  1547  } /* struct_mutex.h:27:1 */
  1548  
  1549  // Arch-sepecific read-write lock definitions.  A generic implementation is
  1550  //    provided by struct_rwlock.h.  If required, an architecture can override it
  1551  //    by defining:
  1552  //
  1553  //    1. struct __pthread_rwlock_arch_t (used on pthread_rwlock_t definition).
  1554  //       It should contain at least the internal members defined in the
  1555  //       generic version.
  1556  //
  1557  //    2. The macro __PTHREAD_RWLOCK_INITIALIZER used for static initialization.
  1558  //       It should initialize the rwlock internal type.
  1559  
  1560  // Default read-write lock implementation struct definitions.
  1561  //    Copyright (C) 2019-2020 Free Software Foundation, Inc.
  1562  //    This file is part of the GNU C Library.
  1563  //
  1564  //    The GNU C Library is free software; you can redistribute it and/or
  1565  //    modify it under the terms of the GNU Lesser General Public
  1566  //    License as published by the Free Software Foundation; either
  1567  //    version 2.1 of the License, or (at your option) any later version.
  1568  //
  1569  //    The GNU C Library is distributed in the hope that it will be useful,
  1570  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1571  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1572  //    Lesser General Public License for more details.
  1573  //
  1574  //    You should have received a copy of the GNU Lesser General Public
  1575  //    License along with the GNU C Library; if not, see
  1576  //    <http://www.gnu.org/licenses/>.
  1577  
  1578  // Endian macros for string.h functions
  1579  //    Copyright (C) 1992-2020 Free Software Foundation, Inc.
  1580  //    This file is part of the GNU C Library.
  1581  //
  1582  //    The GNU C Library is free software; you can redistribute it and/or
  1583  //    modify it under the terms of the GNU Lesser General Public
  1584  //    License as published by the Free Software Foundation; either
  1585  //    version 2.1 of the License, or (at your option) any later version.
  1586  //
  1587  //    The GNU C Library is distributed in the hope that it will be useful,
  1588  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1589  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1590  //    Lesser General Public License for more details.
  1591  //
  1592  //    You should have received a copy of the GNU Lesser General Public
  1593  //    License along with the GNU C Library; if not, see
  1594  //    <http://www.gnu.org/licenses/>.
  1595  
  1596  // Generic struct for both POSIX read-write lock.  New ports are expected
  1597  //    to use the default layout, however archictetures can redefine it to add
  1598  //    arch-specific extensions (such as lock-elision).  The struct have a size
  1599  //    of 32 bytes on both LP32 and LP64 architectures.
  1600  
  1601  type X__pthread_rwlock_arch_t = struct {
  1602  	F__readers       uint32
  1603  	F__writers       uint32
  1604  	F__wrphase_futex uint32
  1605  	F__writers_futex uint32
  1606  	F__pad3          uint32
  1607  	F__pad4          uint32
  1608  	F__flags         uint8
  1609  	F__shared        uint8
  1610  	F__pad1          uint8
  1611  	F__pad2          uint8
  1612  	F__cur_writer    int32
  1613  } /* struct_rwlock.h:29:1 */
  1614  
  1615  // Common definition of pthread_cond_t.
  1616  
  1617  type X__pthread_cond_s = struct {
  1618  	F__0            struct{ F__wseq uint64 }
  1619  	F__8            struct{ F__g1_start uint64 }
  1620  	F__g_refs       [2]uint32
  1621  	F__g_size       [2]uint32
  1622  	F__g1_orig_size uint32
  1623  	F__wrefs        uint32
  1624  	F__g_signals    [2]uint32
  1625  } /* thread-shared-types.h:92:1 */
  1626  
  1627  // Thread identifiers.  The structure of the attribute type is not
  1628  //
  1629  //	exposed on purpose.
  1630  type Pthread_t = uint32 /* pthreadtypes.h:27:27 */
  1631  
  1632  // Data structures for mutex handling.  The structure of the attribute
  1633  //
  1634  //	type is not exposed on purpose.
  1635  type Pthread_mutexattr_t = struct {
  1636  	F__ccgo_pad1 [0]uint32
  1637  	F__size      [4]uint8
  1638  } /* pthreadtypes.h:36:3 */
  1639  
  1640  // Data structure for condition variable handling.  The structure of
  1641  //
  1642  //	the attribute type is not exposed on purpose.
  1643  type Pthread_condattr_t = struct {
  1644  	F__ccgo_pad1 [0]uint32
  1645  	F__size      [4]uint8
  1646  } /* pthreadtypes.h:45:3 */
  1647  
  1648  // Keys for thread-specific data
  1649  type Pthread_key_t = uint32 /* pthreadtypes.h:49:22 */
  1650  
  1651  // Once-only execution
  1652  type Pthread_once_t = int32 /* pthreadtypes.h:53:30 */
  1653  
  1654  type Pthread_attr_t1 = struct {
  1655  	F__ccgo_pad1 [0]uint32
  1656  	F__size      [36]uint8
  1657  } /* pthreadtypes.h:56:1 */
  1658  
  1659  type Pthread_attr_t = Pthread_attr_t1 /* pthreadtypes.h:62:30 */
  1660  
  1661  type Pthread_mutex_t = struct{ F__data X__pthread_mutex_s } /* pthreadtypes.h:72:3 */
  1662  
  1663  type Pthread_cond_t = struct{ F__data X__pthread_cond_s } /* pthreadtypes.h:80:3 */
  1664  
  1665  // Data structure for reader-writer lock variable handling.  The
  1666  //
  1667  //	structure of the attribute type is deliberately not exposed.
  1668  type Pthread_rwlock_t = struct{ F__data X__pthread_rwlock_arch_t } /* pthreadtypes.h:91:3 */
  1669  
  1670  type Pthread_rwlockattr_t = struct {
  1671  	F__ccgo_pad1 [0]uint32
  1672  	F__size      [8]uint8
  1673  } /* pthreadtypes.h:97:3 */
  1674  
  1675  // POSIX spinlock data type.
  1676  type Pthread_spinlock_t = int32 /* pthreadtypes.h:103:22 */
  1677  
  1678  // POSIX barriers data type.  The structure of the type is
  1679  //
  1680  //	deliberately not exposed.
  1681  type Pthread_barrier_t = struct {
  1682  	F__ccgo_pad1 [0]uint32
  1683  	F__size      [20]uint8
  1684  } /* pthreadtypes.h:112:3 */
  1685  
  1686  type Pthread_barrierattr_t = struct {
  1687  	F__ccgo_pad1 [0]uint32
  1688  	F__size      [4]uint8
  1689  } /* pthreadtypes.h:118:3 */
  1690  
  1691  // Type for length arguments in socket calls.
  1692  type Socklen_t = X__socklen_t /* socket.h:33:21 */
  1693  
  1694  // Protocol families.
  1695  
  1696  // Address families.
  1697  
  1698  // Socket level values.  Others are defined in the appropriate headers.
  1699  //
  1700  //    XXX These definitions also should go into the appropriate headers as
  1701  //    far as they are available.
  1702  
  1703  // Maximum queue length specifiable by listen.
  1704  
  1705  // Get the definition of the macro to define the common sockaddr members.
  1706  // Definition of struct sockaddr_* common members and sizes, generic version.
  1707  //    Copyright (C) 1995-2020 Free Software Foundation, Inc.
  1708  //    This file is part of the GNU C Library.
  1709  //
  1710  //    The GNU C Library is free software; you can redistribute it and/or
  1711  //    modify it under the terms of the GNU Lesser General Public
  1712  //    License as published by the Free Software Foundation; either
  1713  //    version 2.1 of the License, or (at your option) any later version.
  1714  //
  1715  //    The GNU C Library is distributed in the hope that it will be useful,
  1716  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1717  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1718  //    Lesser General Public License for more details.
  1719  //
  1720  //    You should have received a copy of the GNU Lesser General Public
  1721  //    License along with the GNU C Library; if not, see
  1722  //    <https://www.gnu.org/licenses/>.
  1723  
  1724  // Never include this file directly; use <sys/socket.h> instead.
  1725  
  1726  // POSIX.1g specifies this type name for the `sa_family' member.
  1727  type Sa_family_t = uint16 /* sockaddr.h:28:28 */
  1728  
  1729  // This macro is used to declare the initial common members
  1730  //    of the data types used for socket addresses, `struct sockaddr',
  1731  //    `struct sockaddr_in', `struct sockaddr_un', etc.
  1732  
  1733  // Size of struct sockaddr_storage.
  1734  
  1735  // Structure describing a generic socket address.
  1736  type Sockaddr = struct {
  1737  	Fsa_family Sa_family_t
  1738  	Fsa_data   [14]uint8
  1739  } /* socket.h:178:1 */
  1740  
  1741  // Structure large enough to hold any socket address (with the historical
  1742  //    exception of AF_UNIX).
  1743  
  1744  type Sockaddr_storage = struct {
  1745  	Fss_family    Sa_family_t
  1746  	F__ss_padding [122]uint8
  1747  	F__ss_align   uint32
  1748  } /* socket.h:191:1 */
  1749  
  1750  // Structure describing messages sent by
  1751  //
  1752  //	`sendmsg' and received by `recvmsg'.
  1753  type Msghdr = struct {
  1754  	Fmsg_name       uintptr
  1755  	Fmsg_namelen    Socklen_t
  1756  	Fmsg_iov        uintptr
  1757  	Fmsg_iovlen     Size_t
  1758  	Fmsg_control    uintptr
  1759  	Fmsg_controllen Size_t
  1760  	Fmsg_flags      int32
  1761  } /* socket.h:257:1 */
  1762  
  1763  // Structure used for storage of ancillary data object information.
  1764  type Cmsghdr = struct {
  1765  	F__ccgo_pad1 [0]uint32
  1766  	Fcmsg_len    Size_t
  1767  	Fcmsg_level  int32
  1768  	Fcmsg_type   int32
  1769  } /* socket.h:275:1 */
  1770  
  1771  // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
  1772  
  1773  // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
  1774  
  1775  // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
  1776  
  1777  // This allows for 1024 file descriptors: if NR_OPEN is ever grown
  1778  // beyond that you'll have to change this too. But 1024 fd's seem to be
  1779  // enough even for such "real" unices like OSF/1, so hopefully this is
  1780  // one limit that doesn't have to be changed [again].
  1781  //
  1782  // Note that POSIX wants the FD_CLEAR(fd,fdsetp) defines to be in
  1783  // <sys/time.h> (and thus <linux/time.h>) - but this is a more logical
  1784  // place for them. Solved by having dummy defines in <sys/time.h>.
  1785  
  1786  // This macro may have been defined in <gnu/types.h>. But we always
  1787  // use the one here.
  1788  
  1789  type X__kernel_fd_set = struct{ Ffds_bits [32]uint32 } /* posix_types.h:27:3 */
  1790  
  1791  // Type of a signal handler.
  1792  type X__kernel_sighandler_t = uintptr /* posix_types.h:30:14 */
  1793  
  1794  // Type of a SYSV IPC key.
  1795  type X__kernel_key_t = int32 /* posix_types.h:33:13 */
  1796  type X__kernel_mqd_t = int32 /* posix_types.h:34:13 */
  1797  
  1798  // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
  1799  //  arch/arm/include/asm/posix_types.h
  1800  //
  1801  //  Copyright (C) 1996-1998 Russell King.
  1802  //
  1803  // This program is free software; you can redistribute it and/or modify
  1804  // it under the terms of the GNU General Public License version 2 as
  1805  // published by the Free Software Foundation.
  1806  //
  1807  //  Changelog:
  1808  //   27-06-1996	RMK	Created
  1809  
  1810  // This file is generally used by user-level software, so you need to
  1811  // be a little careful about namespace pollution etc.  Also, we cannot
  1812  // assume GCC is being used.
  1813  
  1814  type X__kernel_mode_t = uint16 /* posix_types.h:23:25 */
  1815  
  1816  type X__kernel_ipc_pid_t = uint16 /* posix_types.h:26:25 */
  1817  
  1818  type X__kernel_uid_t = uint16 /* posix_types.h:29:25 */
  1819  type X__kernel_gid_t = uint16 /* posix_types.h:30:25 */
  1820  
  1821  type X__kernel_old_dev_t = uint16 /* posix_types.h:33:25 */
  1822  
  1823  // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
  1824  
  1825  // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
  1826  
  1827  // There seems to be no way of detecting this automatically from user
  1828  // space, so 64 bit architectures should override this in their
  1829  // bitsperlong.h. In particular, an architecture that supports
  1830  // both 32 and 64 bit user space must not rely on CONFIG_64BIT
  1831  // to decide it, but rather check a compiler provided macro.
  1832  
  1833  // This file is generally used by user-level software, so you need to
  1834  // be a little careful about namespace pollution etc.
  1835  //
  1836  // First the types that are often defined in different ways across
  1837  // architectures, so that you can override them.
  1838  
  1839  type X__kernel_long_t = int32   /* posix_types.h:15:15 */
  1840  type X__kernel_ulong_t = uint32 /* posix_types.h:16:23 */
  1841  
  1842  type X__kernel_ino_t = X__kernel_ulong_t /* posix_types.h:20:26 */
  1843  
  1844  type X__kernel_pid_t = int32 /* posix_types.h:28:14 */
  1845  
  1846  type X__kernel_suseconds_t = X__kernel_long_t /* posix_types.h:41:26 */
  1847  
  1848  type X__kernel_daddr_t = int32 /* posix_types.h:45:14 */
  1849  
  1850  type X__kernel_uid32_t = uint32 /* posix_types.h:49:22 */
  1851  type X__kernel_gid32_t = uint32 /* posix_types.h:50:22 */
  1852  
  1853  type X__kernel_old_uid_t = X__kernel_uid_t /* posix_types.h:54:24 */
  1854  type X__kernel_old_gid_t = X__kernel_gid_t /* posix_types.h:55:24 */
  1855  
  1856  // Most 32 bit architectures use "unsigned int" size_t,
  1857  // and all 64 bit architectures use "unsigned long" size_t.
  1858  type X__kernel_size_t = uint32   /* posix_types.h:68:22 */
  1859  type X__kernel_ssize_t = int32   /* posix_types.h:69:14 */
  1860  type X__kernel_ptrdiff_t = int32 /* posix_types.h:70:14 */
  1861  
  1862  type X__kernel_fsid_t = struct{ Fval [2]int32 } /* posix_types.h:81:3 */
  1863  
  1864  // anything below here should be completely generic
  1865  type X__kernel_off_t = X__kernel_long_t      /* posix_types.h:87:25 */
  1866  type X__kernel_loff_t = int64                /* posix_types.h:88:19 */
  1867  type X__kernel_old_time_t = X__kernel_long_t /* posix_types.h:89:25 */
  1868  type X__kernel_time_t = X__kernel_long_t     /* posix_types.h:90:25 */
  1869  type X__kernel_time64_t = int64              /* posix_types.h:91:19 */
  1870  type X__kernel_clock_t = X__kernel_long_t    /* posix_types.h:92:25 */
  1871  type X__kernel_timer_t = int32               /* posix_types.h:93:14 */
  1872  type X__kernel_clockid_t = int32             /* posix_types.h:94:14 */
  1873  type X__kernel_caddr_t = uintptr             /* posix_types.h:95:14 */
  1874  type X__kernel_uid16_t = uint16              /* posix_types.h:96:24 */
  1875  type X__kernel_gid16_t = uint16              /* posix_types.h:97:24 */
  1876  
  1877  // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
  1878  
  1879  // Socket-level I/O control calls.
  1880  
  1881  // For setsockopt(2)
  1882  
  1883  // Security levels - as per NRL IPv6 - don't actually do anything
  1884  
  1885  // Socket filtering
  1886  
  1887  // Instruct lower device to use last 4-bytes of skb data as FCS
  1888  
  1889  // Structure used to manipulate the SO_LINGER option.
  1890  type Linger = struct {
  1891  	Fl_onoff  int32
  1892  	Fl_linger int32
  1893  } /* socket.h:361:1 */
  1894  
  1895  // This is the 4.3 BSD `struct sockaddr' format, which is used as wire
  1896  //
  1897  //	format in the grotty old 4.3 `talk' protocol.
  1898  type Osockaddr = struct {
  1899  	Fsa_family uint16
  1900  	Fsa_data   [14]uint8
  1901  } /* struct_osockaddr.h:6:1 */
  1902  
  1903  // Define some macros helping to catch buffer overflows.
  1904  
  1905  var _ uint8 /* gen.c:2:13: */