diff options
Diffstat (limited to 'vendor/modernc.org/libc')
75 files changed, 32790 insertions, 597 deletions
diff --git a/vendor/modernc.org/libc/AUTHORS b/vendor/modernc.org/libc/AUTHORS index d0dd42a1d..932a584e4 100644 --- a/vendor/modernc.org/libc/AUTHORS +++ b/vendor/modernc.org/libc/AUTHORS @@ -11,5 +11,6 @@ Dan Kortschak <dan@kortschak.io> Dan Peterson <danp@danp.net> Jan Mercl <0xjnml@gmail.com> +Jason DeBettencourt <jasond17@gmail.com> +Koichi Shiraishi <zchee.io@gmail.com> Steffen Butzer <steffen(dot)butzer@outlook.com> -Jason DeBettencourt <jasond17@gmail.com>
\ No newline at end of file diff --git a/vendor/modernc.org/libc/CONTRIBUTORS b/vendor/modernc.org/libc/CONTRIBUTORS index a4234ab64..9efa6ea60 100644 --- a/vendor/modernc.org/libc/CONTRIBUTORS +++ b/vendor/modernc.org/libc/CONTRIBUTORS @@ -10,5 +10,6 @@ Dan Kortschak <dan@kortschak.io> Dan Peterson <danp@danp.net> Jaap Aarts <jaap.aarts1@gmail.com> Jan Mercl <0xjnml@gmail.com> -Steffen Butzer <steffen(dot)butzer@outlook.com> Jason DeBettencourt <jasond17@gmail.com> +Koichi Shiraishi <zchee.io@gmail.com> +Steffen Butzer <steffen(dot)butzer@outlook.com> diff --git a/vendor/modernc.org/libc/HACKING b/vendor/modernc.org/libc/HACKING index cbd0e8308..c76a6ce43 100644 --- a/vendor/modernc.org/libc/HACKING +++ b/vendor/modernc.org/libc/HACKING @@ -1,10 +1,3 @@ -Version 3 notes - Install: - $ go get modernc.org/crt/v3 - -Version 3 is the transition from "all scalars are signed integers" (the QBE -model) to the more traditional "integers have signedness and pointers are not -exactly the same as integers" that is used by modernc.org/ccgo/v3. However, all -C pointers are of the same Go type: uintptr. + $ go get modernc.org/libc diff --git a/vendor/modernc.org/libc/LICENSE b/vendor/modernc.org/libc/LICENSE index 29e1443dd..0c6500bc3 100644 --- a/vendor/modernc.org/libc/LICENSE +++ b/vendor/modernc.org/libc/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2017 The CRT Authors. All rights reserved. +Copyright (c) 2017 The Libc Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are diff --git a/vendor/modernc.org/libc/Makefile b/vendor/modernc.org/libc/Makefile index 3166cfd13..f94ffbe3d 100644 --- a/vendor/modernc.org/libc/Makefile +++ b/vendor/modernc.org/libc/Makefile @@ -50,6 +50,11 @@ darwin_arm64: TARGET_GOOS=darwin TARGET_GOARCH=arm64 go generate GOOS=darwin GOARCH=arm64 go build -v ./... +# only on freebsd/amd64 +freebsd_amd64: + TARGET_GOOS=freebsd TARGET_GOARCH=amd64 go generate + GOOS=freebsd GOARCH=amd64 go build -v ./... + linux_amd64: TARGET_GOOS=linux TARGET_GOARCH=amd64 go generate GOOS=linux GOARCH=amd64 go build -v ./... @@ -84,6 +89,7 @@ all_targets: linux_amd64 linux_386 linux_arm linux_arm64 windows_amd64 windows_3 build_all_targets: GOOS=darwin GOARCH=amd64 go build -v ./... GOOS=darwin GOARCH=arm64 go build -v ./... + GOOS=freebsd GOARCH=amd64 go build -v ./... GOOS=linux GOARCH=386 go build -v ./... GOOS=linux GOARCH=amd64 go build -v ./... GOOS=linux GOARCH=arm go build -v ./... diff --git a/vendor/modernc.org/libc/capi_freebsd_amd64.go b/vendor/modernc.org/libc/capi_freebsd_amd64.go new file mode 100644 index 000000000..8009a6a9f --- /dev/null +++ b/vendor/modernc.org/libc/capi_freebsd_amd64.go @@ -0,0 +1,421 @@ +// Code generated by 'go generate' - DO NOT EDIT. + +package libc // import "modernc.org/libc" + +var CAPI = map[string]struct{}{ + "_CurrentRuneLocale": {}, + "_DefaultRuneLocale": {}, + "_IO_putc": {}, + "_ThreadRuneLocale": {}, + "___errno_location": {}, + "___runetype": {}, + "__assert": {}, + "__assert_fail": {}, + "__builtin___memcpy_chk": {}, + "__builtin___memmove_chk": {}, + "__builtin___memset_chk": {}, + "__builtin___snprintf_chk": {}, + "__builtin___sprintf_chk": {}, + "__builtin___strcat_chk": {}, + "__builtin___strcpy_chk": {}, + "__builtin___strncpy_chk": {}, + "__builtin___vsnprintf_chk": {}, + "__builtin_abort": {}, + "__builtin_abs": {}, + "__builtin_add_overflowInt64": {}, + "__builtin_add_overflowUint32": {}, + "__builtin_add_overflowUint64": {}, + "__builtin_bswap16": {}, + "__builtin_bswap32": {}, + "__builtin_bswap64": {}, + "__builtin_clzll": {}, + "__builtin_constant_p_impl": {}, + "__builtin_copysign": {}, + "__builtin_copysignf": {}, + "__builtin_exit": {}, + "__builtin_expect": {}, + "__builtin_fabs": {}, + "__builtin_free": {}, + "__builtin_huge_val": {}, + "__builtin_huge_valf": {}, + "__builtin_inf": {}, + "__builtin_inff": {}, + "__builtin_isnan": {}, + "__builtin_malloc": {}, + "__builtin_memcmp": {}, + "__builtin_memcpy": {}, + "__builtin_memset": {}, + "__builtin_mmap": {}, + "__builtin_mul_overflowInt64": {}, + "__builtin_mul_overflowUint128": {}, + "__builtin_mul_overflowUint64": {}, + "__builtin_nanf": {}, + "__builtin_object_size": {}, + "__builtin_popcount": {}, + "__builtin_prefetch": {}, + "__builtin_printf": {}, + "__builtin_snprintf": {}, + "__builtin_sprintf": {}, + "__builtin_strchr": {}, + "__builtin_strcmp": {}, + "__builtin_strcpy": {}, + "__builtin_strlen": {}, + "__builtin_sub_overflowInt64": {}, + "__builtin_trap": {}, + "__builtin_unreachable": {}, + "__ccgo_in6addr_anyp": {}, + "__ccgo_sqlite3_log": {}, + "__cmsg_nxthdr": {}, + "__ctype_b_loc": {}, + "__ctype_get_mb_cur_max": {}, + "__errno_location": {}, + "__error": {}, + "__floatscan": {}, + "__h_errno_location": {}, + "__inet_aton": {}, + "__inet_ntoa": {}, + "__intscan": {}, + "__isalnum_l": {}, + "__isalpha_l": {}, + "__isdigit_l": {}, + "__isnan": {}, + "__isnanf": {}, + "__isnanl": {}, + "__isoc99_sscanf": {}, + "__isthreaded": {}, + "__lookup_ipliteral": {}, + "__lookup_name": {}, + "__lookup_serv": {}, + "__mb_sb_limit": {}, + "__runes_for_locale": {}, + "__shgetc": {}, + "__shlim": {}, + "__stderrp": {}, + "__stdinp": {}, + "__stdoutp": {}, + "__swbuf": {}, + "__syscall1": {}, + "__syscall3": {}, + "__syscall4": {}, + "__toread": {}, + "__toread_needs_stdio_exit": {}, + "__uflow": {}, + "__xuname": {}, + "_exit": {}, + "_obstack_begin": {}, + "_obstack_newchunk": {}, + "abort": {}, + "abs": {}, + "accept": {}, + "access": {}, + "acos": {}, + "acosh": {}, + "alarm": {}, + "asin": {}, + "asinh": {}, + "atan": {}, + "atan2": {}, + "atanh": {}, + "atexit": {}, + "atof": {}, + "atoi": {}, + "atol": {}, + "backtrace": {}, + "backtrace_symbols_fd": {}, + "bind": {}, + "calloc": {}, + "ceil": {}, + "ceilf": {}, + "cfgetospeed": {}, + "cfsetispeed": {}, + "cfsetospeed": {}, + "chdir": {}, + "chflags": {}, + "chmod": {}, + "chown": {}, + "clock_gettime": {}, + "close": {}, + "closedir": {}, + "confstr": {}, + "connect": {}, + "copysign": {}, + "copysignf": {}, + "copysignl": {}, + "cos": {}, + "cosf": {}, + "cosh": {}, + "ctime": {}, + "ctime_r": {}, + "dlclose": {}, + "dlerror": {}, + "dlopen": {}, + "dlsym": {}, + "dup2": {}, + "endpwent": {}, + "environ": {}, + "execvp": {}, + "exit": {}, + "exp": {}, + "fabs": {}, + "fabsf": {}, + "fabsl": {}, + "fchmod": {}, + "fchown": {}, + "fclose": {}, + "fcntl": {}, + "fcntl64": {}, + "fdopen": {}, + "ferror": {}, + "fflush": {}, + "fgetc": {}, + "fgets": {}, + "fileno": {}, + "floor": {}, + "fmod": {}, + "fmodl": {}, + "fopen": {}, + "fopen64": {}, + "fork": {}, + "fprintf": {}, + "fputc": {}, + "fputs": {}, + "fread": {}, + "free": {}, + "freeaddrinfo": {}, + "frexp": {}, + "fscanf": {}, + "fseek": {}, + "fstat": {}, + "fstat64": {}, + "fsync": {}, + "ftell": {}, + "ftruncate": {}, + "fts64_close": {}, + "fts64_open": {}, + "fts64_read": {}, + "fts_close": {}, + "fts_open": {}, + "fts_read": {}, + "fwrite": {}, + "gai_strerror": {}, + "getaddrinfo": {}, + "getc": {}, + "getcwd": {}, + "getegid": {}, + "getenv": {}, + "geteuid": {}, + "getgid": {}, + "getgrgid": {}, + "getgrgid_r": {}, + "getgrnam": {}, + "getgrnam_r": {}, + "gethostbyaddr": {}, + "gethostbyaddr_r": {}, + "gethostbyname": {}, + "gethostbyname2": {}, + "gethostbyname2_r": {}, + "gethostname": {}, + "getnameinfo": {}, + "getpeername": {}, + "getpid": {}, + "getpwnam": {}, + "getpwnam_r": {}, + "getpwuid": {}, + "getpwuid_r": {}, + "getresgid": {}, + "getresuid": {}, + "getrlimit": {}, + "getrlimit64": {}, + "getrusage": {}, + "getservbyname": {}, + "getsockname": {}, + "getsockopt": {}, + "gettimeofday": {}, + "getuid": {}, + "gmtime_r": {}, + "h_errno": {}, + "htonl": {}, + "htons": {}, + "hypot": {}, + "inet_ntoa": {}, + "inet_ntop": {}, + "inet_pton": {}, + "initstate_r": {}, + "ioctl": {}, + "isalnum": {}, + "isalpha": {}, + "isatty": {}, + "isdigit": {}, + "isnan": {}, + "isnanf": {}, + "isnanl": {}, + "kill": {}, + "ldexp": {}, + "link": {}, + "listen": {}, + "localtime": {}, + "localtime_r": {}, + "log": {}, + "log10": {}, + "lrand48": {}, + "lseek": {}, + "lseek64": {}, + "lstat": {}, + "lstat64": {}, + "malloc": {}, + "mblen": {}, + "mbstowcs": {}, + "mbtowc": {}, + "memchr": {}, + "memcmp": {}, + "memcpy": {}, + "memmove": {}, + "memset": {}, + "mkdir": {}, + "mkfifo": {}, + "mknod": {}, + "mkstemp": {}, + "mkstemp64": {}, + "mkstemps": {}, + "mkstemps64": {}, + "mktime": {}, + "mmap": {}, + "modf": {}, + "munmap": {}, + "nl_langinfo": {}, + "ntohs": {}, + "obstack_free": {}, + "obstack_vprintf": {}, + "open": {}, + "open64": {}, + "opendir": {}, + "openpty": {}, + "pathconf": {}, + "pause": {}, + "pclose": {}, + "perror": {}, + "pipe": {}, + "poll": {}, + "popen": {}, + "posix_fadvise": {}, + "pow": {}, + "printf": {}, + "pselect": {}, + "putc": {}, + "putchar": {}, + "puts": {}, + "qsort": {}, + "raise": {}, + "rand": {}, + "random": {}, + "random_r": {}, + "read": {}, + "readdir": {}, + "readdir64": {}, + "readlink": {}, + "readv": {}, + "realloc": {}, + "realpath": {}, + "recv": {}, + "recvfrom": {}, + "recvmsg": {}, + "remove": {}, + "rename": {}, + "rewind": {}, + "rmdir": {}, + "round": {}, + "scalbn": {}, + "scalbnl": {}, + "sched_yield": {}, + "select": {}, + "send": {}, + "sendmsg": {}, + "sendto": {}, + "setbuf": {}, + "setenv": {}, + "setlocale": {}, + "setrlimit": {}, + "setrlimit64": {}, + "setsid": {}, + "setsockopt": {}, + "setvbuf": {}, + "shmat": {}, + "shmctl": {}, + "shmdt": {}, + "shutdown": {}, + "sigaction": {}, + "signal": {}, + "sin": {}, + "sinf": {}, + "sinh": {}, + "sleep": {}, + "snprintf": {}, + "socket": {}, + "sprintf": {}, + "sqrt": {}, + "srand48": {}, + "sscanf": {}, + "stat": {}, + "stat64": {}, + "stderr": {}, + "stdin": {}, + "stdout": {}, + "strcasecmp": {}, + "strcat": {}, + "strchr": {}, + "strcmp": {}, + "strcpy": {}, + "strcspn": {}, + "strdup": {}, + "strerror": {}, + "strlen": {}, + "strncmp": {}, + "strncpy": {}, + "strnlen": {}, + "strpbrk": {}, + "strrchr": {}, + "strspn": {}, + "strstr": {}, + "strtod": {}, + "strtof": {}, + "strtoimax": {}, + "strtol": {}, + "strtold": {}, + "strtoll": {}, + "strtoul": {}, + "strtoull": {}, + "strtoumax": {}, + "symlink": {}, + "sysconf": {}, + "system": {}, + "tan": {}, + "tanh": {}, + "tcgetattr": {}, + "tcsendbreak": {}, + "tcsetattr": {}, + "time": {}, + "tolower": {}, + "toupper": {}, + "trunc": {}, + "tzset": {}, + "umask": {}, + "uname": {}, + "ungetc": {}, + "unlink": {}, + "unsetenv": {}, + "usleep": {}, + "utime": {}, + "utimes": {}, + "vasprintf": {}, + "vfprintf": {}, + "vprintf": {}, + "vsnprintf": {}, + "vsprintf": {}, + "waitpid": {}, + "wcschr": {}, + "wctomb": {}, + "wcwidth": {}, + "write": {}, + "writev": {}, + "zero_struct_address": {}, +} diff --git a/vendor/modernc.org/libc/capi_linux_386.go b/vendor/modernc.org/libc/capi_linux_386.go index 6ebc35b33..555153e77 100644 --- a/vendor/modernc.org/libc/capi_linux_386.go +++ b/vendor/modernc.org/libc/capi_linux_386.go @@ -310,36 +310,11 @@ var CAPI = map[string]struct{}{ "pow": {}, "printf": {}, "pselect": {}, - "pthread_attr_destroy": {}, "pthread_attr_getdetachstate": {}, - "pthread_attr_init": {}, "pthread_attr_setdetachstate": {}, - "pthread_attr_setscope": {}, - "pthread_attr_setstacksize": {}, - "pthread_cond_broadcast": {}, - "pthread_cond_destroy": {}, - "pthread_cond_init": {}, - "pthread_cond_signal": {}, - "pthread_cond_timedwait": {}, - "pthread_cond_wait": {}, - "pthread_create": {}, - "pthread_detach": {}, - "pthread_equal": {}, - "pthread_exit": {}, - "pthread_getspecific": {}, - "pthread_join": {}, - "pthread_key_create": {}, - "pthread_key_delete": {}, - "pthread_mutex_destroy": {}, - "pthread_mutex_init": {}, - "pthread_mutex_lock": {}, - "pthread_mutex_trylock": {}, - "pthread_mutex_unlock": {}, "pthread_mutexattr_destroy": {}, "pthread_mutexattr_init": {}, "pthread_mutexattr_settype": {}, - "pthread_self": {}, - "pthread_setspecific": {}, "putc": {}, "putchar": {}, "puts": {}, diff --git a/vendor/modernc.org/libc/capi_linux_arm.go b/vendor/modernc.org/libc/capi_linux_arm.go index 23fe92c9b..555153e77 100644 --- a/vendor/modernc.org/libc/capi_linux_arm.go +++ b/vendor/modernc.org/libc/capi_linux_arm.go @@ -3,420 +3,441 @@ package libc // import "modernc.org/libc" var CAPI = map[string]struct{}{ - "_IO_putc": {}, - "___errno_location": {}, - "__assert_fail": {}, - "__builtin___memcpy_chk": {}, - "__builtin___memmove_chk": {}, - "__builtin___memset_chk": {}, - "__builtin___snprintf_chk": {}, - "__builtin___sprintf_chk": {}, - "__builtin___strcat_chk": {}, - "__builtin___strcpy_chk": {}, - "__builtin___strncpy_chk": {}, - "__builtin___vsnprintf_chk": {}, - "__builtin_abort": {}, - "__builtin_abs": {}, - "__builtin_add_overflowInt64": {}, - "__builtin_add_overflowUint32": {}, - "__builtin_add_overflowUint64": {}, - "__builtin_bswap16": {}, - "__builtin_bswap32": {}, - "__builtin_bswap64": {}, - "__builtin_clzll": {}, - "__builtin_constant_p_impl": {}, - "__builtin_copysign": {}, - "__builtin_copysignf": {}, - "__builtin_exit": {}, - "__builtin_expect": {}, - "__builtin_fabs": {}, - "__builtin_free": {}, - "__builtin_huge_val": {}, - "__builtin_huge_valf": {}, - "__builtin_inf": {}, - "__builtin_inff": {}, - "__builtin_isnan": {}, - "__builtin_malloc": {}, - "__builtin_memcmp": {}, - "__builtin_memcpy": {}, - "__builtin_memset": {}, - "__builtin_mmap": {}, - "__builtin_mul_overflowInt64": {}, - "__builtin_mul_overflowUint128": {}, - "__builtin_mul_overflowUint64": {}, - "__builtin_nanf": {}, - "__builtin_object_size": {}, - "__builtin_popcount": {}, - "__builtin_prefetch": {}, - "__builtin_printf": {}, - "__builtin_snprintf": {}, - "__builtin_sprintf": {}, - "__builtin_strchr": {}, - "__builtin_strcmp": {}, - "__builtin_strcpy": {}, - "__builtin_strlen": {}, - "__builtin_sub_overflowInt64": {}, - "__builtin_trap": {}, - "__builtin_unreachable": {}, - "__ccgo_in6addr_anyp": {}, - "__ccgo_sqlite3_log": {}, - "__cmsg_nxthdr": {}, - "__ctype_b_loc": {}, - "__ctype_get_mb_cur_max": {}, - "__errno_location": {}, - "__floatscan": {}, - "__fpclassify": {}, - "__fpclassifyf": {}, - "__fpclassifyl": {}, - "__h_errno_location": {}, - "__inet_aton": {}, - "__intscan": {}, - "__isalnum_l": {}, - "__isalpha_l": {}, - "__isdigit_l": {}, - "__islower_l": {}, - "__isnan": {}, - "__isnanf": {}, - "__isnanl": {}, - "__isoc99_sscanf": {}, - "__isprint_l": {}, - "__isupper_l": {}, - "__isxdigit_l": {}, - "__lookup_ipliteral": {}, - "__lookup_name": {}, - "__lookup_serv": {}, - "__shgetc": {}, - "__shlim": {}, - "__strncasecmp_l": {}, - "__syscall1": {}, - "__syscall3": {}, - "__toread": {}, - "__toread_needs_stdio_exit": {}, - "__uflow": {}, - "_exit": {}, - "_obstack_begin": {}, - "_obstack_newchunk": {}, - "abort": {}, - "abs": {}, - "accept": {}, - "access": {}, - "acos": {}, - "acosh": {}, - "alarm": {}, - "asin": {}, - "asinh": {}, - "atan": {}, - "atan2": {}, - "atanh": {}, - "atexit": {}, - "atof": {}, - "atoi": {}, - "atol": {}, - "backtrace": {}, - "backtrace_symbols_fd": {}, - "bind": {}, - "calloc": {}, - "ceil": {}, - "ceilf": {}, - "cfgetospeed": {}, - "cfsetispeed": {}, - "cfsetospeed": {}, - "chdir": {}, - "chmod": {}, - "chown": {}, - "clock_gettime": {}, - "close": {}, - "closedir": {}, - "confstr": {}, - "connect": {}, - "copysign": {}, - "copysignf": {}, - "copysignl": {}, - "cos": {}, - "cosf": {}, - "cosh": {}, - "ctime": {}, - "dlclose": {}, - "dlerror": {}, - "dlopen": {}, - "dlsym": {}, - "dup2": {}, - "endpwent": {}, - "environ": {}, - "execvp": {}, - "exit": {}, - "exp": {}, - "fabs": {}, - "fabsf": {}, - "fabsl": {}, - "fchmod": {}, - "fchown": {}, - "fclose": {}, - "fcntl": {}, - "fcntl64": {}, - "fdopen": {}, - "ferror": {}, - "fflush": {}, - "fgetc": {}, - "fgets": {}, - "fileno": {}, - "floor": {}, - "fmod": {}, - "fmodl": {}, - "fopen": {}, - "fopen64": {}, - "fork": {}, - "fprintf": {}, - "fputc": {}, - "fputs": {}, - "fread": {}, - "free": {}, - "freeaddrinfo": {}, - "frexp": {}, - "fscanf": {}, - "fseek": {}, - "fstat": {}, - "fstat64": {}, - "fsync": {}, - "ftell": {}, - "ftruncate": {}, - "ftruncate64": {}, - "fts64_close": {}, - "fts64_open": {}, - "fts64_read": {}, - "fts_close": {}, - "fts_open": {}, - "fts_read": {}, - "fwrite": {}, - "gai_strerror": {}, - "getaddrinfo": {}, - "getc": {}, - "getcwd": {}, - "getegid": {}, - "getenv": {}, - "geteuid": {}, - "getgid": {}, - "getgrgid": {}, - "getgrnam": {}, - "gethostbyaddr": {}, - "gethostbyaddr_r": {}, - "gethostbyname": {}, - "gethostbyname2": {}, - "gethostbyname2_r": {}, - "gethostname": {}, - "getnameinfo": {}, - "getpeername": {}, - "getpid": {}, - "getpwnam": {}, - "getpwnam_r": {}, - "getpwuid": {}, - "getpwuid_r": {}, - "getresgid": {}, - "getresuid": {}, - "getrlimit": {}, - "getrlimit64": {}, - "getrusage": {}, - "getservbyname": {}, - "getsockname": {}, - "getsockopt": {}, - "gettimeofday": {}, - "getuid": {}, - "gmtime_r": {}, - "h_errno": {}, - "htonl": {}, - "htons": {}, - "hypot": {}, - "inet_ntoa": {}, - "inet_ntop": {}, - "inet_pton": {}, - "initstate_r": {}, - "ioctl": {}, - "isalnum": {}, - "isalpha": {}, - "isatty": {}, - "isdigit": {}, - "islower": {}, - "isnan": {}, - "isnanf": {}, - "isnanl": {}, - "isprint": {}, - "isupper": {}, - "isxdigit": {}, - "kill": {}, - "ldexp": {}, - "link": {}, - "listen": {}, - "localtime": {}, - "localtime_r": {}, - "log": {}, - "log10": {}, - "lrand48": {}, - "lseek": {}, - "lseek64": {}, - "lstat": {}, - "lstat64": {}, - "malloc": {}, - "mblen": {}, - "mbstowcs": {}, - "mbtowc": {}, - "memchr": {}, - "memcmp": {}, - "memcpy": {}, - "memmove": {}, - "memset": {}, - "mkdir": {}, - "mkfifo": {}, - "mknod": {}, - "mkstemp": {}, - "mkstemp64": {}, - "mkstemps": {}, - "mkstemps64": {}, - "mktime": {}, - "mmap": {}, - "mmap64": {}, - "modf": {}, - "mremap": {}, - "munmap": {}, - "nanf": {}, - "nl_langinfo": {}, - "ntohs": {}, - "obstack_free": {}, - "obstack_vprintf": {}, - "open": {}, - "open64": {}, - "opendir": {}, - "openpty": {}, - "pathconf": {}, - "pause": {}, - "pclose": {}, - "perror": {}, - "pipe": {}, - "poll": {}, - "popen": {}, - "posix_fadvise": {}, - "pow": {}, - "printf": {}, - "pselect": {}, - "putc": {}, - "putchar": {}, - "puts": {}, - "qsort": {}, - "raise": {}, - "rand": {}, - "rand_r": {}, - "random": {}, - "random_r": {}, - "read": {}, - "readdir": {}, - "readdir64": {}, - "readlink": {}, - "readv": {}, - "realloc": {}, - "realpath": {}, - "recv": {}, - "recvfrom": {}, - "recvmsg": {}, - "remove": {}, - "rename": {}, - "rewind": {}, - "rmdir": {}, - "round": {}, - "scalbn": {}, - "scalbnl": {}, - "select": {}, - "send": {}, - "sendmsg": {}, - "sendto": {}, - "setbuf": {}, - "setenv": {}, - "setlocale": {}, - "setrlimit": {}, - "setrlimit64": {}, - "setsid": {}, - "setsockopt": {}, - "setvbuf": {}, - "shmat": {}, - "shmctl": {}, - "shmdt": {}, - "shutdown": {}, - "sigaction": {}, - "signal": {}, - "sin": {}, - "sinf": {}, - "sinh": {}, - "sleep": {}, - "snprintf": {}, - "socket": {}, - "sprintf": {}, - "sqrt": {}, - "srand48": {}, - "sscanf": {}, - "stat": {}, - "stat64": {}, - "stderr": {}, - "stdin": {}, - "stdout": {}, - "strcasecmp": {}, - "strcat": {}, - "strchr": {}, - "strcmp": {}, - "strcpy": {}, - "strcspn": {}, - "strdup": {}, - "strerror": {}, - "strlcat": {}, - "strlcpy": {}, - "strlen": {}, - "strncasecmp": {}, - "strncat": {}, - "strncmp": {}, - "strncpy": {}, - "strnlen": {}, - "strpbrk": {}, - "strrchr": {}, - "strspn": {}, - "strstr": {}, - "strtod": {}, - "strtof": {}, - "strtoimax": {}, - "strtok": {}, - "strtol": {}, - "strtold": {}, - "strtoll": {}, - "strtoul": {}, - "strtoull": {}, - "strtoumax": {}, - "symlink": {}, - "sysconf": {}, - "system": {}, - "tan": {}, - "tanh": {}, - "tcgetattr": {}, - "tcsendbreak": {}, - "tcsetattr": {}, - "time": {}, - "tolower": {}, - "toupper": {}, - "trunc": {}, - "tzset": {}, - "umask": {}, - "uname": {}, - "ungetc": {}, - "unlink": {}, - "unsetenv": {}, - "usleep": {}, - "utime": {}, - "utimes": {}, - "vasprintf": {}, - "vfprintf": {}, - "vprintf": {}, - "vsnprintf": {}, - "vsprintf": {}, - "waitpid": {}, - "wcschr": {}, - "wctomb": {}, - "wcwidth": {}, - "write": {}, - "writev": {}, - "zero_struct_address": {}, + "_IO_putc": {}, + "___errno_location": {}, + "__assert_fail": {}, + "__builtin___memcpy_chk": {}, + "__builtin___memmove_chk": {}, + "__builtin___memset_chk": {}, + "__builtin___snprintf_chk": {}, + "__builtin___sprintf_chk": {}, + "__builtin___strcat_chk": {}, + "__builtin___strcpy_chk": {}, + "__builtin___strncpy_chk": {}, + "__builtin___vsnprintf_chk": {}, + "__builtin_abort": {}, + "__builtin_abs": {}, + "__builtin_add_overflowInt64": {}, + "__builtin_add_overflowUint32": {}, + "__builtin_add_overflowUint64": {}, + "__builtin_bswap16": {}, + "__builtin_bswap32": {}, + "__builtin_bswap64": {}, + "__builtin_clzll": {}, + "__builtin_constant_p_impl": {}, + "__builtin_copysign": {}, + "__builtin_copysignf": {}, + "__builtin_exit": {}, + "__builtin_expect": {}, + "__builtin_fabs": {}, + "__builtin_free": {}, + "__builtin_huge_val": {}, + "__builtin_huge_valf": {}, + "__builtin_inf": {}, + "__builtin_inff": {}, + "__builtin_isnan": {}, + "__builtin_malloc": {}, + "__builtin_memcmp": {}, + "__builtin_memcpy": {}, + "__builtin_memset": {}, + "__builtin_mmap": {}, + "__builtin_mul_overflowInt64": {}, + "__builtin_mul_overflowUint128": {}, + "__builtin_mul_overflowUint64": {}, + "__builtin_nanf": {}, + "__builtin_object_size": {}, + "__builtin_popcount": {}, + "__builtin_prefetch": {}, + "__builtin_printf": {}, + "__builtin_snprintf": {}, + "__builtin_sprintf": {}, + "__builtin_strchr": {}, + "__builtin_strcmp": {}, + "__builtin_strcpy": {}, + "__builtin_strlen": {}, + "__builtin_sub_overflowInt64": {}, + "__builtin_trap": {}, + "__builtin_unreachable": {}, + "__ccgo_getMutexType": {}, + "__ccgo_in6addr_anyp": {}, + "__ccgo_pthreadAttrGetDetachState": {}, + "__ccgo_pthreadMutexattrGettype": {}, + "__ccgo_sqlite3_log": {}, + "__cmsg_nxthdr": {}, + "__ctype_b_loc": {}, + "__ctype_get_mb_cur_max": {}, + "__errno_location": {}, + "__floatscan": {}, + "__fpclassify": {}, + "__fpclassifyf": {}, + "__fpclassifyl": {}, + "__fsmu8": {}, + "__h_errno_location": {}, + "__inet_aton": {}, + "__intscan": {}, + "__isalnum_l": {}, + "__isalpha_l": {}, + "__isdigit_l": {}, + "__islower_l": {}, + "__isnan": {}, + "__isnanf": {}, + "__isnanl": {}, + "__isoc99_sscanf": {}, + "__isprint_l": {}, + "__isupper_l": {}, + "__isxdigit_l": {}, + "__lockfile": {}, + "__lookup_ipliteral": {}, + "__lookup_name": {}, + "__lookup_serv": {}, + "__shgetc": {}, + "__shlim": {}, + "__strncasecmp_l": {}, + "__syscall1": {}, + "__syscall3": {}, + "__syscall4": {}, + "__toread": {}, + "__toread_needs_stdio_exit": {}, + "__uflow": {}, + "__unlockfile": {}, + "_exit": {}, + "_obstack_begin": {}, + "_obstack_newchunk": {}, + "abort": {}, + "abs": {}, + "accept": {}, + "access": {}, + "acos": {}, + "acosh": {}, + "alarm": {}, + "asin": {}, + "asinh": {}, + "atan": {}, + "atan2": {}, + "atanh": {}, + "atexit": {}, + "atof": {}, + "atoi": {}, + "atol": {}, + "backtrace": {}, + "backtrace_symbols_fd": {}, + "bind": {}, + "calloc": {}, + "ceil": {}, + "ceilf": {}, + "cfgetospeed": {}, + "cfsetispeed": {}, + "cfsetospeed": {}, + "chdir": {}, + "chmod": {}, + "chown": {}, + "clock_gettime": {}, + "close": {}, + "closedir": {}, + "confstr": {}, + "connect": {}, + "copysign": {}, + "copysignf": {}, + "copysignl": {}, + "cos": {}, + "cosf": {}, + "cosh": {}, + "ctime": {}, + "ctime_r": {}, + "dlclose": {}, + "dlerror": {}, + "dlopen": {}, + "dlsym": {}, + "dup2": {}, + "endpwent": {}, + "environ": {}, + "execvp": {}, + "exit": {}, + "exp": {}, + "fabs": {}, + "fabsf": {}, + "fabsl": {}, + "fchmod": {}, + "fchown": {}, + "fclose": {}, + "fcntl": {}, + "fcntl64": {}, + "fdopen": {}, + "ferror": {}, + "fflush": {}, + "fgetc": {}, + "fgets": {}, + "fileno": {}, + "floor": {}, + "fmod": {}, + "fmodl": {}, + "fopen": {}, + "fopen64": {}, + "fork": {}, + "fprintf": {}, + "fputc": {}, + "fputs": {}, + "fread": {}, + "free": {}, + "freeaddrinfo": {}, + "frexp": {}, + "fscanf": {}, + "fseek": {}, + "fstat": {}, + "fstat64": {}, + "fsync": {}, + "ftell": {}, + "ftruncate": {}, + "ftruncate64": {}, + "fts64_close": {}, + "fts64_open": {}, + "fts64_read": {}, + "fts_close": {}, + "fts_open": {}, + "fts_read": {}, + "fwrite": {}, + "gai_strerror": {}, + "getaddrinfo": {}, + "getc": {}, + "getcwd": {}, + "getegid": {}, + "getenv": {}, + "geteuid": {}, + "getgid": {}, + "getgrgid": {}, + "getgrgid_r": {}, + "getgrnam": {}, + "getgrnam_r": {}, + "gethostbyaddr": {}, + "gethostbyaddr_r": {}, + "gethostbyname": {}, + "gethostbyname2": {}, + "gethostbyname2_r": {}, + "gethostbyname_r": {}, + "gethostname": {}, + "getnameinfo": {}, + "getpeername": {}, + "getpid": {}, + "getpwnam": {}, + "getpwnam_r": {}, + "getpwuid": {}, + "getpwuid_r": {}, + "getresgid": {}, + "getresuid": {}, + "getrlimit": {}, + "getrlimit64": {}, + "getrusage": {}, + "getservbyname": {}, + "getsockname": {}, + "getsockopt": {}, + "gettimeofday": {}, + "getuid": {}, + "gmtime_r": {}, + "h_errno": {}, + "htonl": {}, + "htons": {}, + "hypot": {}, + "inet_ntoa": {}, + "inet_ntop": {}, + "inet_pton": {}, + "initstate_r": {}, + "ioctl": {}, + "isalnum": {}, + "isalpha": {}, + "isatty": {}, + "isdigit": {}, + "islower": {}, + "isnan": {}, + "isnanf": {}, + "isnanl": {}, + "isprint": {}, + "isupper": {}, + "isxdigit": {}, + "kill": {}, + "ldexp": {}, + "link": {}, + "listen": {}, + "localtime": {}, + "localtime_r": {}, + "log": {}, + "log10": {}, + "lrand48": {}, + "lseek": {}, + "lseek64": {}, + "lstat": {}, + "lstat64": {}, + "malloc": {}, + "mblen": {}, + "mbrtowc": {}, + "mbsinit": {}, + "mbstowcs": {}, + "mbtowc": {}, + "memchr": {}, + "memcmp": {}, + "memcpy": {}, + "memmove": {}, + "memset": {}, + "mkdir": {}, + "mkfifo": {}, + "mknod": {}, + "mkstemp": {}, + "mkstemp64": {}, + "mkstemps": {}, + "mkstemps64": {}, + "mktime": {}, + "mmap": {}, + "mmap64": {}, + "modf": {}, + "mremap": {}, + "munmap": {}, + "nanf": {}, + "nl_langinfo": {}, + "ntohs": {}, + "obstack_free": {}, + "obstack_vprintf": {}, + "open": {}, + "open64": {}, + "opendir": {}, + "openpty": {}, + "pathconf": {}, + "pause": {}, + "pclose": {}, + "perror": {}, + "pipe": {}, + "poll": {}, + "popen": {}, + "posix_fadvise": {}, + "pow": {}, + "printf": {}, + "pselect": {}, + "pthread_attr_getdetachstate": {}, + "pthread_attr_setdetachstate": {}, + "pthread_mutexattr_destroy": {}, + "pthread_mutexattr_init": {}, + "pthread_mutexattr_settype": {}, + "putc": {}, + "putchar": {}, + "puts": {}, + "qsort": {}, + "raise": {}, + "rand": {}, + "rand_r": {}, + "random": {}, + "random_r": {}, + "read": {}, + "readdir": {}, + "readdir64": {}, + "readlink": {}, + "readv": {}, + "realloc": {}, + "realpath": {}, + "recv": {}, + "recvfrom": {}, + "recvmsg": {}, + "remove": {}, + "rename": {}, + "rewind": {}, + "rmdir": {}, + "round": {}, + "scalbn": {}, + "scalbnl": {}, + "sched_yield": {}, + "select": {}, + "send": {}, + "sendmsg": {}, + "sendto": {}, + "setbuf": {}, + "setenv": {}, + "setlocale": {}, + "setrlimit": {}, + "setrlimit64": {}, + "setsid": {}, + "setsockopt": {}, + "setvbuf": {}, + "shmat": {}, + "shmctl": {}, + "shmdt": {}, + "shutdown": {}, + "sigaction": {}, + "signal": {}, + "sin": {}, + "sinf": {}, + "sinh": {}, + "sleep": {}, + "snprintf": {}, + "socket": {}, + "sprintf": {}, + "sqrt": {}, + "srand48": {}, + "sscanf": {}, + "stat": {}, + "stat64": {}, + "stderr": {}, + "stdin": {}, + "stdout": {}, + "strcasecmp": {}, + "strcat": {}, + "strchr": {}, + "strcmp": {}, + "strcpy": {}, + "strcspn": {}, + "strdup": {}, + "strerror": {}, + "strlcat": {}, + "strlcpy": {}, + "strlen": {}, + "strncasecmp": {}, + "strncat": {}, + "strncmp": {}, + "strncpy": {}, + "strnlen": {}, + "strpbrk": {}, + "strrchr": {}, + "strspn": {}, + "strstr": {}, + "strtod": {}, + "strtof": {}, + "strtoimax": {}, + "strtok": {}, + "strtol": {}, + "strtold": {}, + "strtoll": {}, + "strtoul": {}, + "strtoull": {}, + "strtoumax": {}, + "symlink": {}, + "sysconf": {}, + "system": {}, + "tan": {}, + "tanh": {}, + "tcgetattr": {}, + "tcsendbreak": {}, + "tcsetattr": {}, + "time": {}, + "tolower": {}, + "toupper": {}, + "trunc": {}, + "tzset": {}, + "umask": {}, + "uname": {}, + "ungetc": {}, + "unlink": {}, + "unsetenv": {}, + "usleep": {}, + "utime": {}, + "utimes": {}, + "vasprintf": {}, + "vfprintf": {}, + "vfscanf": {}, + "vprintf": {}, + "vsnprintf": {}, + "vsprintf": {}, + "vsscanf": {}, + "waitpid": {}, + "wcschr": {}, + "wctomb": {}, + "wcwidth": {}, + "write": {}, + "writev": {}, + "zero_struct_address": {}, } diff --git a/vendor/modernc.org/libc/capi_linux_arm64.go b/vendor/modernc.org/libc/capi_linux_arm64.go index 6ebc35b33..555153e77 100644 --- a/vendor/modernc.org/libc/capi_linux_arm64.go +++ b/vendor/modernc.org/libc/capi_linux_arm64.go @@ -310,36 +310,11 @@ var CAPI = map[string]struct{}{ "pow": {}, "printf": {}, "pselect": {}, - "pthread_attr_destroy": {}, "pthread_attr_getdetachstate": {}, - "pthread_attr_init": {}, "pthread_attr_setdetachstate": {}, - "pthread_attr_setscope": {}, - "pthread_attr_setstacksize": {}, - "pthread_cond_broadcast": {}, - "pthread_cond_destroy": {}, - "pthread_cond_init": {}, - "pthread_cond_signal": {}, - "pthread_cond_timedwait": {}, - "pthread_cond_wait": {}, - "pthread_create": {}, - "pthread_detach": {}, - "pthread_equal": {}, - "pthread_exit": {}, - "pthread_getspecific": {}, - "pthread_join": {}, - "pthread_key_create": {}, - "pthread_key_delete": {}, - "pthread_mutex_destroy": {}, - "pthread_mutex_init": {}, - "pthread_mutex_lock": {}, - "pthread_mutex_trylock": {}, - "pthread_mutex_unlock": {}, "pthread_mutexattr_destroy": {}, "pthread_mutexattr_init": {}, "pthread_mutexattr_settype": {}, - "pthread_self": {}, - "pthread_setspecific": {}, "putc": {}, "putchar": {}, "puts": {}, diff --git a/vendor/modernc.org/libc/dmesg.go b/vendor/modernc.org/libc/dmesg.go index df3d20968..4ddc3ecae 100644 --- a/vendor/modernc.org/libc/dmesg.go +++ b/vendor/modernc.org/libc/dmesg.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build libc.dmesg // +build libc.dmesg package libc // import "modernc.org/libc" diff --git a/vendor/modernc.org/libc/errno/capi_freebsd_amd64.go b/vendor/modernc.org/libc/errno/capi_freebsd_amd64.go new file mode 100644 index 000000000..adbe5b151 --- /dev/null +++ b/vendor/modernc.org/libc/errno/capi_freebsd_amd64.go @@ -0,0 +1,5 @@ +// Code generated by 'ccgo errno/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 errno/errno_freebsd_amd64.go -pkgname errno', DO NOT EDIT. + +package errno + +var CAPI = map[string]struct{}{} diff --git a/vendor/modernc.org/libc/errno/errno_freebsd_amd64.go b/vendor/modernc.org/libc/errno/errno_freebsd_amd64.go new file mode 100644 index 000000000..5e68eb3a2 --- /dev/null +++ b/vendor/modernc.org/libc/errno/errno_freebsd_amd64.go @@ -0,0 +1,166 @@ +// Code generated by 'ccgo errno/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 errno/errno_freebsd_amd64.go -pkgname errno', DO NOT EDIT. + +package errno + +import ( + "math" + "reflect" + "sync/atomic" + "unsafe" +) + +var _ = math.Pi +var _ reflect.Kind +var _ atomic.Value +var _ unsafe.Pointer + +const ( + E2BIG = 7 + EACCES = 13 + EADDRINUSE = 48 + EADDRNOTAVAIL = 49 + EAFNOSUPPORT = 47 + EAGAIN = 35 + EALREADY = 37 + EAUTH = 80 + EBADF = 9 + EBADMSG = 89 + EBADRPC = 72 + EBUSY = 16 + ECANCELED = 85 + ECAPMODE = 94 + ECHILD = 10 + ECONNABORTED = 53 + ECONNREFUSED = 61 + ECONNRESET = 54 + EDEADLK = 11 + EDESTADDRREQ = 39 + EDOM = 33 + EDOOFUS = 88 + EDQUOT = 69 + EEXIST = 17 + EFAULT = 14 + EFBIG = 27 + EFTYPE = 79 + EHOSTDOWN = 64 + EHOSTUNREACH = 65 + EIDRM = 82 + EILSEQ = 86 + EINPROGRESS = 36 + EINTEGRITY = 97 + EINTR = 4 + EINVAL = 22 + EIO = 5 + EISCONN = 56 + EISDIR = 21 + ELAST = 97 + ELOOP = 62 + EMFILE = 24 + EMLINK = 31 + EMSGSIZE = 40 + EMULTIHOP = 90 + ENAMETOOLONG = 63 + ENEEDAUTH = 81 + ENETDOWN = 50 + ENETRESET = 52 + ENETUNREACH = 51 + ENFILE = 23 + ENOATTR = 87 + ENOBUFS = 55 + ENODEV = 19 + ENOENT = 2 + ENOEXEC = 8 + ENOLCK = 77 + ENOLINK = 91 + ENOMEM = 12 + ENOMSG = 83 + ENOPROTOOPT = 42 + ENOSPC = 28 + ENOSYS = 78 + ENOTBLK = 15 + ENOTCAPABLE = 93 + ENOTCONN = 57 + ENOTDIR = 20 + ENOTEMPTY = 66 + ENOTRECOVERABLE = 95 + ENOTSOCK = 38 + ENOTSUP = 45 + ENOTTY = 25 + ENXIO = 6 + EOPNOTSUPP = 45 + EOVERFLOW = 84 + EOWNERDEAD = 96 + EPERM = 1 + EPFNOSUPPORT = 46 + EPIPE = 32 + EPROCLIM = 67 + EPROCUNAVAIL = 76 + EPROGMISMATCH = 75 + EPROGUNAVAIL = 74 + EPROTO = 92 + EPROTONOSUPPORT = 43 + EPROTOTYPE = 41 + ERANGE = 34 + EREMOTE = 71 + EROFS = 30 + ERPCMISMATCH = 73 + ESHUTDOWN = 58 + ESOCKTNOSUPPORT = 44 + ESPIPE = 29 + ESRCH = 3 + ESTALE = 70 + ETIMEDOUT = 60 + ETOOMANYREFS = 59 + ETXTBSY = 26 + EUSERS = 68 + EWOULDBLOCK = 35 + EXDEV = 18 + X_ERRNO_T_DEFINED = 0 + X_FILE_OFFSET_BITS = 64 + X_LP64 = 1 + X_Nonnull = 0 + X_Null_unspecified = 0 + X_Nullable = 0 + X_SYS_CDEFS_H_ = 0 + X_SYS_ERRNO_H_ = 0 + Unix = 1 +) + +type Ptrdiff_t = int64 /* <builtin>:3:26 */ + +type Size_t = uint64 /* <builtin>:9:23 */ + +type Wchar_t = int32 /* <builtin>:15:24 */ + +type X__int128_t = struct { + Flo int64 + Fhi int64 +} /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128 +type X__uint128_t = struct { + Flo uint64 + Fhi uint64 +} /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128 + +type X__builtin_va_list = uintptr /* <builtin>:46:14 */ +type X__float128 = float64 /* <builtin>:47:21 */ + +// 11 was EAGAIN + +// math software + +// non-blocking and interrupt i/o + +// ipc/network software -- argument errors + +// ipc/network software -- operational errors + +// should be rearranged + +// quotas & mush + +// Network File System + +// ISO/IEC 9899:2011 K.3.2.2 +type Errno_t = int32 /* errno.h:204:13 */ + +var _ int8 /* gen.c:2:13: */ diff --git a/vendor/modernc.org/libc/fcntl/capi_freebsd_amd64.go b/vendor/modernc.org/libc/fcntl/capi_freebsd_amd64.go new file mode 100644 index 000000000..d29a45579 --- /dev/null +++ b/vendor/modernc.org/libc/fcntl/capi_freebsd_amd64.go @@ -0,0 +1,5 @@ +// Code generated by 'ccgo fcntl/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 fcntl/fcntl_freebsd_amd64.go -pkgname fcntl', DO NOT EDIT. + +package fcntl + +var CAPI = map[string]struct{}{} diff --git a/vendor/modernc.org/libc/fcntl/fcntl_freebsd_amd64.go b/vendor/modernc.org/libc/fcntl/fcntl_freebsd_amd64.go new file mode 100644 index 000000000..d24cc9eed --- /dev/null +++ b/vendor/modernc.org/libc/fcntl/fcntl_freebsd_amd64.go @@ -0,0 +1,770 @@ +// Code generated by 'ccgo fcntl/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 fcntl/fcntl_freebsd_amd64.go -pkgname fcntl', DO NOT EDIT. + +package fcntl + +import ( + "math" + "reflect" + "sync/atomic" + "unsafe" +) + +var _ = math.Pi +var _ reflect.Kind +var _ atomic.Value +var _ unsafe.Pointer + +const ( + AT_EACCESS = 0x0100 + AT_FDCWD = -100 + AT_REMOVEDIR = 0x0800 + AT_RESOLVE_BENEATH = 0x2000 + AT_SYMLINK_FOLLOW = 0x0400 + AT_SYMLINK_NOFOLLOW = 0x0200 + FAPPEND = 8 + FASYNC = 64 + FDSYNC = 16777216 + FD_CLOEXEC = 1 + FD_NONE = -200 + FFSYNC = 128 + FNDELAY = 4 + FNONBLOCK = 4 + FRDAHEAD = 512 + FREAD = 0x0001 + FWRITE = 0x0002 + F_ADD_SEALS = 19 + F_CANCEL = 5 + F_DUP2FD = 10 + F_DUP2FD_CLOEXEC = 18 + F_DUPFD = 0 + F_DUPFD_CLOEXEC = 17 + F_GETFD = 1 + F_GETFL = 3 + F_GETLK = 11 + F_GETOWN = 5 + F_GET_SEALS = 20 + F_ISUNIONSTACK = 21 + F_OGETLK = 7 + F_OSETLK = 8 + F_OSETLKW = 9 + F_RDAHEAD = 16 + F_RDLCK = 1 + F_READAHEAD = 15 + F_SEAL_GROW = 0x0004 + F_SEAL_SEAL = 0x0001 + F_SEAL_SHRINK = 0x0002 + F_SEAL_WRITE = 0x0008 + F_SETFD = 2 + F_SETFL = 4 + F_SETLK = 12 + F_SETLKW = 13 + F_SETLK_REMOTE = 14 + F_SETOWN = 6 + F_UNLCK = 2 + F_UNLCKSYS = 4 + F_WRLCK = 3 + LOCK_EX = 0x02 + LOCK_NB = 0x04 + LOCK_SH = 0x01 + LOCK_UN = 0x08 + O_ACCMODE = 0x0003 + O_APPEND = 0x0008 + O_ASYNC = 0x0040 + O_CLOEXEC = 0x00100000 + O_CREAT = 0x0200 + O_DIRECT = 0x00010000 + O_DIRECTORY = 0x00020000 + O_DSYNC = 0x01000000 + O_EXCL = 0x0800 + O_EXEC = 0x00040000 + O_EXLOCK = 0x0020 + O_FSYNC = 0x0080 + O_NDELAY = 4 + O_NOCTTY = 0x8000 + O_NOFOLLOW = 0x0100 + O_NONBLOCK = 0x0004 + O_RDONLY = 0x0000 + O_RDWR = 0x0002 + O_RESOLVE_BENEATH = 0x00800000 + O_SEARCH = 262144 + O_SHLOCK = 0x0010 + O_SYNC = 0x0080 + O_TRUNC = 0x0400 + O_TTY_INIT = 0x00080000 + O_VERIFY = 0x00200000 + O_WRONLY = 0x0001 + POSIX_FADV_DONTNEED = 4 + POSIX_FADV_NOREUSE = 5 + POSIX_FADV_NORMAL = 0 + POSIX_FADV_RANDOM = 1 + POSIX_FADV_SEQUENTIAL = 2 + POSIX_FADV_WILLNEED = 3 + X_FILE_OFFSET_BITS = 64 + X_LP64 = 1 + X_MACHINE__LIMITS_H_ = 0 + X_MACHINE__TYPES_H_ = 0 + X_MODE_T_DECLARED = 0 + X_Nonnull = 0 + X_Null_unspecified = 0 + X_Nullable = 0 + X_OFF_T_DECLARED = 0 + X_PID_T_DECLARED = 0 + X_SYS_CDEFS_H_ = 0 + X_SYS_FCNTL_H_ = 0 + X_SYS__TYPES_H_ = 0 + Unix = 1 +) + +type Ptrdiff_t = int64 /* <builtin>:3:26 */ + +type Size_t = uint64 /* <builtin>:9:23 */ + +type Wchar_t = int32 /* <builtin>:15:24 */ + +type X__int128_t = struct { + Flo int64 + Fhi int64 +} /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128 +type X__uint128_t = struct { + Flo uint64 + Fhi uint64 +} /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128 + +type X__builtin_va_list = uintptr /* <builtin>:46:14 */ +type X__float128 = float64 /* <builtin>:47:21 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1983, 1990, 1993 +// The Regents of the University of California. All rights reserved. +// (c) UNIX System Laboratories, Inc. +// All or some portions of this file are derived from material licensed +// to the University of California by American Telephone and Telegraph +// Co. or Unix System Laboratories, Inc. and are reproduced herein with +// the permission of UNIX System Laboratories, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)fcntl.h 8.3 (Berkeley) 1/21/94 +// $FreeBSD$ + +// This file includes the definitions for open and fcntl +// described by POSIX for <fcntl.h>; it also includes +// related kernel definitions. + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// Testing against Clang-specific extensions. + +// This code has been put in place to help reduce the addition of +// compiler specific defines in FreeBSD code. It helps to aid in +// having a compiler-agnostic source tree. + +// Compiler memory barriers, specific to gcc and clang. + +// XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced + +// Macro to test if we're using a specific version of gcc or later. + +// The __CONCAT macro is used to concatenate parts of symbol names, e.g. +// with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. +// The __CONCAT macro is a bit tricky to use if it must work in non-ANSI +// mode -- there must be no spaces between its arguments, and for nested +// __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also +// concatenate double-quoted strings produced by the __STRING macro, but +// this only works with ANSI C. +// +// __XSTRING is like __STRING, but it expands any macros in its argument +// first. It is only available with ANSI C. + +// Compiler-dependent macros to help declare dead (non-returning) and +// pure (no side effects) functions, and unused variables. They are +// null except for versions of gcc that are known to support the features +// properly (old versions of gcc-2 supported the dead and pure features +// in a different (wrong) way). If we do not provide an implementation +// for a given compiler, let the compile fail if it is told to use +// a feature that we cannot live without. + +// Keywords added in C11. + +// Emulation of C11 _Generic(). Unlike the previously defined C11 +// keywords, it is not possible to implement this using exactly the same +// syntax. Therefore implement something similar under the name +// __generic(). Unlike _Generic(), this macro can only distinguish +// between a single type, so it requires nested invocations to +// distinguish multiple cases. + +// C99 Static array indices in function parameter declarations. Syntax such as: +// void bar(int myArray[static 10]); +// is allowed in C99 but not in C++. Define __min_size appropriately so +// headers using it can be compiled in either language. Use like this: +// void bar(int myArray[__min_size(10)]); + +// XXX: should use `#if __STDC_VERSION__ < 199901'. + +// C++11 exposes a load of C99 stuff + +// GCC 2.95 provides `__restrict' as an extension to C90 to support the +// C99-specific `restrict' type qualifier. We happen to use `__restrict' as +// a way to define the `restrict' type qualifier without disturbing older +// software that is unaware of C99 keywords. + +// GNU C version 2.96 adds explicit branch prediction so that +// the CPU back-end can hint the processor and also so that +// code blocks can be reordered such that the predicted path +// sees a more linear flow, thus improving cache behavior, etc. +// +// The following two macros provide us with a way to utilize this +// compiler feature. Use __predict_true() if you expect the expression +// to evaluate to true, and __predict_false() if you expect the +// expression to evaluate to false. +// +// A few notes about usage: +// +// * Generally, __predict_false() error condition checks (unless +// you have some _strong_ reason to do otherwise, in which case +// document it), and/or __predict_true() `no-error' condition +// checks, assuming you want to optimize for the no-error case. +// +// * Other than that, if you don't know the likelihood of a test +// succeeding from empirical or other `hard' evidence, don't +// make predictions. +// +// * These are meant to be used in places that are run `a lot'. +// It is wasteful to make predictions in code that is run +// seldomly (e.g. at subsystem initialization time) as the +// basic block reordering that this affects can often generate +// larger code. + +// We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h> +// require it. + +// Given the pointer x to the member m of the struct s, return +// a pointer to the containing structure. When using GCC, we first +// assign pointer x to a local variable, to check that its type is +// compatible with member m. + +// Compiler-dependent macros to declare that functions take printf-like +// or scanf-like arguments. They are null except for versions of gcc +// that are known to support the features properly (old versions of gcc-2 +// didn't permit keeping the keywords out of the application namespace). + +// Compiler-dependent macros that rely on FreeBSD-specific extensions. + +// Embed the rcs id of a source file in the resulting library. Note that in +// more recent ELF binutils, we use .ident allowing the ID to be stripped. +// Usage: +// __FBSDID("$FreeBSD$"); + +// - +// The following definitions are an extension of the behavior originally +// implemented in <sys/_posix.h>, but with a different level of granularity. +// POSIX.1 requires that the macros we test be defined before any standard +// header file is included. +// +// Here's a quick run-down of the versions: +// defined(_POSIX_SOURCE) 1003.1-1988 +// _POSIX_C_SOURCE == 1 1003.1-1990 +// _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option +// _POSIX_C_SOURCE == 199309 1003.1b-1993 +// _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, +// and the omnibus ISO/IEC 9945-1: 1996 +// _POSIX_C_SOURCE == 200112 1003.1-2001 +// _POSIX_C_SOURCE == 200809 1003.1-2008 +// +// In addition, the X/Open Portability Guide, which is now the Single UNIX +// Specification, defines a feature-test macro which indicates the version of +// that specification, and which subsumes _POSIX_C_SOURCE. +// +// Our macros begin with two underscores to avoid namespace screwage. + +// Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. + +// Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. + +// Deal with various X/Open Portability Guides and Single UNIX Spec. + +// Deal with all versions of POSIX. The ordering relative to the tests above is +// important. +// - +// Deal with _ANSI_SOURCE: +// If it is defined, and no other compilation environment is explicitly +// requested, then define our internal feature-test macros to zero. This +// makes no difference to the preprocessor (undefined symbols in preprocessing +// expressions are defined to have value zero), but makes it more convenient for +// a test program to print out the values. +// +// If a program mistakenly defines _ANSI_SOURCE and some other macro such as +// _POSIX_C_SOURCE, we will assume that it wants the broader compilation +// environment (and in fact we will never get here). + +// User override __EXT1_VISIBLE + +// Old versions of GCC use non-standard ARM arch symbols; acle-compat.h +// translates them to __ARM_ARCH and the modern feature symbols defined by ARM. + +// Nullability qualifiers: currently only supported by Clang. + +// Type Safety Checking +// +// Clang provides additional attributes to enable checking type safety +// properties that cannot be enforced by the C type system. + +// Lock annotations. +// +// Clang provides support for doing basic thread-safety tests at +// compile-time, by marking which locks will/should be held when +// entering/leaving a functions. +// +// Furthermore, it is also possible to annotate variables and structure +// members to enforce that they are only accessed when certain locks are +// held. + +// Structure implements a lock. + +// Function acquires an exclusive or shared lock. + +// Function attempts to acquire an exclusive or shared lock. + +// Function releases a lock. + +// Function asserts that an exclusive or shared lock is held. + +// Function requires that an exclusive or shared lock is or is not held. + +// Function should not be analyzed. + +// Function or variable should not be sanitized, i.e. by AddressSanitizer. +// GCC has the nosanitize attribute, but as a function attribute only, and +// warns on use as a variable attribute. + +// Guard variables and structure members by lock. + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-4-Clause +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// Copyright (c) 1990, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. All advertising materials mentioning features or use of this software +// must display the following acknowledgement: +// This product includes software developed by the University of +// California, Berkeley and its contributors. +// 4. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 +// From: @(#)types.h 8.3 (Berkeley) 1/5/94 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1988, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)limits.h 8.3 (Berkeley) 1/4/94 +// $FreeBSD$ + +// According to ANSI (section 2.2.4.2), the values below must be usable by +// #if preprocessing directives. Additionally, the expression must have the +// same type as would an expression that is an object of the corresponding +// type converted according to the integral promotions. The subtraction for +// INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an +// unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). + +// max value for an unsigned long long + +// Quads and longs are the same on the amd64. Ensure they stay in sync. + +// Minimum signal stack size. + +// Basic types upon which most other types are built. +type X__int8_t = int8 /* _types.h:55:22 */ +type X__uint8_t = uint8 /* _types.h:56:24 */ +type X__int16_t = int16 /* _types.h:57:17 */ +type X__uint16_t = uint16 /* _types.h:58:25 */ +type X__int32_t = int32 /* _types.h:59:15 */ +type X__uint32_t = uint32 /* _types.h:60:23 */ +type X__int64_t = int64 /* _types.h:62:16 */ +type X__uint64_t = uint64 /* _types.h:63:24 */ + +// Standard type definitions. +type X__clock_t = X__int32_t /* _types.h:75:19 */ // clock()... +type X__critical_t = X__int64_t /* _types.h:76:19 */ +type X__double_t = float64 /* _types.h:78:17 */ +type X__float_t = float32 /* _types.h:79:16 */ +type X__intfptr_t = X__int64_t /* _types.h:81:19 */ +type X__intptr_t = X__int64_t /* _types.h:82:19 */ +type X__intmax_t = X__int64_t /* _types.h:93:19 */ +type X__int_fast8_t = X__int32_t /* _types.h:94:19 */ +type X__int_fast16_t = X__int32_t /* _types.h:95:19 */ +type X__int_fast32_t = X__int32_t /* _types.h:96:19 */ +type X__int_fast64_t = X__int64_t /* _types.h:97:19 */ +type X__int_least8_t = X__int8_t /* _types.h:98:18 */ +type X__int_least16_t = X__int16_t /* _types.h:99:19 */ +type X__int_least32_t = X__int32_t /* _types.h:100:19 */ +type X__int_least64_t = X__int64_t /* _types.h:101:19 */ +type X__ptrdiff_t = X__int64_t /* _types.h:103:19 */ // ptr1 - ptr2 +type X__register_t = X__int64_t /* _types.h:104:19 */ +type X__segsz_t = X__int64_t /* _types.h:105:19 */ // segment size (in pages) +type X__size_t = X__uint64_t /* _types.h:106:20 */ // sizeof() +type X__ssize_t = X__int64_t /* _types.h:107:19 */ // byte count or error +type X__time_t = X__int64_t /* _types.h:108:19 */ // time()... +type X__uintfptr_t = X__uint64_t /* _types.h:109:20 */ +type X__uintptr_t = X__uint64_t /* _types.h:110:20 */ +type X__uintmax_t = X__uint64_t /* _types.h:121:20 */ +type X__uint_fast8_t = X__uint32_t /* _types.h:122:20 */ +type X__uint_fast16_t = X__uint32_t /* _types.h:123:20 */ +type X__uint_fast32_t = X__uint32_t /* _types.h:124:20 */ +type X__uint_fast64_t = X__uint64_t /* _types.h:125:20 */ +type X__uint_least8_t = X__uint8_t /* _types.h:126:19 */ +type X__uint_least16_t = X__uint16_t /* _types.h:127:20 */ +type X__uint_least32_t = X__uint32_t /* _types.h:128:20 */ +type X__uint_least64_t = X__uint64_t /* _types.h:129:20 */ +type X__u_register_t = X__uint64_t /* _types.h:131:20 */ +type X__vm_offset_t = X__uint64_t /* _types.h:132:20 */ +type X__vm_paddr_t = X__uint64_t /* _types.h:133:20 */ +type X__vm_size_t = X__uint64_t /* _types.h:134:20 */ +type X___wchar_t = int32 /* _types.h:141:14 */ + +// Standard type definitions. +type X__blksize_t = X__int32_t /* _types.h:40:19 */ // file block size +type X__blkcnt_t = X__int64_t /* _types.h:41:19 */ // file block count +type X__clockid_t = X__int32_t /* _types.h:42:19 */ // clock_gettime()... +type X__fflags_t = X__uint32_t /* _types.h:43:20 */ // file flags +type X__fsblkcnt_t = X__uint64_t /* _types.h:44:20 */ +type X__fsfilcnt_t = X__uint64_t /* _types.h:45:20 */ +type X__gid_t = X__uint32_t /* _types.h:46:20 */ +type X__id_t = X__int64_t /* _types.h:47:19 */ // can hold a gid_t, pid_t, or uid_t +type X__ino_t = X__uint64_t /* _types.h:48:20 */ // inode number +type X__key_t = int64 /* _types.h:49:15 */ // IPC key (for Sys V IPC) +type X__lwpid_t = X__int32_t /* _types.h:50:19 */ // Thread ID (a.k.a. LWP) +type X__mode_t = X__uint16_t /* _types.h:51:20 */ // permissions +type X__accmode_t = int32 /* _types.h:52:14 */ // access permissions +type X__nl_item = int32 /* _types.h:53:14 */ +type X__nlink_t = X__uint64_t /* _types.h:54:20 */ // link count +type X__off_t = X__int64_t /* _types.h:55:19 */ // file offset +type X__off64_t = X__int64_t /* _types.h:56:19 */ // file offset (alias) +type X__pid_t = X__int32_t /* _types.h:57:19 */ // process [group] +type X__rlim_t = X__int64_t /* _types.h:58:19 */ // resource limit - intentionally +// signed, because of legacy code +// that uses -1 for RLIM_INFINITY +type X__sa_family_t = X__uint8_t /* _types.h:61:19 */ +type X__socklen_t = X__uint32_t /* _types.h:62:20 */ +type X__suseconds_t = int64 /* _types.h:63:15 */ // microseconds (signed) +type X__timer_t = uintptr /* _types.h:64:24 */ // timer_gettime()... +type X__mqd_t = uintptr /* _types.h:65:21 */ // mq_open()... +type X__uid_t = X__uint32_t /* _types.h:66:20 */ +type X__useconds_t = uint32 /* _types.h:67:22 */ // microseconds (unsigned) +type X__cpuwhich_t = int32 /* _types.h:68:14 */ // which parameter for cpuset. +type X__cpulevel_t = int32 /* _types.h:69:14 */ // level parameter for cpuset. +type X__cpusetid_t = int32 /* _types.h:70:14 */ // cpuset identifier. +type X__daddr_t = X__int64_t /* _types.h:71:19 */ // bwrite(3), FIOBMAP2, etc + +// Unusual type definitions. +// rune_t is declared to be an ``int'' instead of the more natural +// ``unsigned long'' or ``long''. Two things are happening here. It is not +// unsigned so that EOF (-1) can be naturally assigned to it and used. Also, +// it looks like 10646 will be a 31 bit standard. This means that if your +// ints cannot hold 32 bits, you will be in trouble. The reason an int was +// chosen over a long is that the is*() and to*() routines take ints (says +// ANSI C), but they use __ct_rune_t instead of int. +// +// NOTE: rune_t is not covered by ANSI nor other standards, and should not +// be instantiated outside of lib/libc/locale. Use wchar_t. wint_t and +// rune_t must be the same type. Also, wint_t should be able to hold all +// members of the largest character set plus one extra value (WEOF), and +// must be at least 16 bits. +type X__ct_rune_t = int32 /* _types.h:91:14 */ // arg type for ctype funcs +type X__rune_t = X__ct_rune_t /* _types.h:92:21 */ // rune_t (see above) +type X__wint_t = X__ct_rune_t /* _types.h:93:21 */ // wint_t (see above) + +// Clang already provides these types as built-ins, but only in C++ mode. +type X__char16_t = X__uint_least16_t /* _types.h:97:26 */ +type X__char32_t = X__uint_least32_t /* _types.h:98:26 */ +// In C++11, char16_t and char32_t are built-in types. + +type X__max_align_t = struct { + F__max_align1 int64 + F__max_align2 float64 +} /* _types.h:111:3 */ + +type X__dev_t = X__uint64_t /* _types.h:113:20 */ // device number + +type X__fixpt_t = X__uint32_t /* _types.h:115:20 */ // fixed point number + +// mbstate_t is an opaque object to keep conversion state during multibyte +// stream conversions. +type X__mbstate_t = struct { + _ [0]uint64 + F__mbstate8 [128]int8 +} /* _types.h:124:3 */ + +type X__rman_res_t = X__uintmax_t /* _types.h:126:25 */ + +// Types for varargs. These are all provided by builtin types these +// days, so centralize their definition. +type X__va_list = X__builtin_va_list /* _types.h:133:27 */ // internally known to gcc +type X__gnuc_va_list = X__va_list /* _types.h:140:20 */ // compatibility w/GNU headers + +// When the following macro is defined, the system uses 64-bit inode numbers. +// Programs can use this to avoid including <sys/param.h>, with its associated +// namespace pollution. + +type Mode_t = X__mode_t /* fcntl.h:53:18 */ + +type Off_t = X__off_t /* fcntl.h:58:18 */ + +type Pid_t = X__pid_t /* fcntl.h:63:18 */ + +// File status flags: these are used by open(2), fcntl(2). +// They are also used (indirectly) in the kernel file structure f_flags, +// which is a superset of the open/fcntl flags. Open flags and f_flags +// are inter-convertible using OFLAGS(fflags) and FFLAGS(oflags). +// Open/fcntl flags begin with O_; kernel-internal flags begin with F. +// open-only flags + +// Kernel encoding of open mode; separate read and write bits that are +// independently testable: 1 greater than the above. +// +// XXX +// FREAD and FWRITE are excluded from the #ifdef _KERNEL so that TIOCFLUSH, +// which was documented to use FREAD/FWRITE, continues to work. + +// Defined by POSIX 1003.1; BSD default, but must be distinct from O_RDONLY. + +// Attempt to bypass buffer cache + +// Defined by POSIX 1003.1-2008; BSD default, but reserve for future use. + +/* #define O_UNUSED1 0x00400000 */ // Was O_BENEATH + +// XXX missing O_RSYNC. + +// The O_* flags used to have only F* names, which were used in the kernel +// and by fcntl. We retain the F* names for the kernel f_flag field +// and for backward compatibility for fcntl. These flags are deprecated. + +// Historically, we ran out of bits in f_flag (which was once a short). +// However, the flag bits not set in FMASK are only meaningful in the +// initial open syscall. Those bits were thus given a +// different meaning for fcntl(2). +// Read ahead + +// Magic value that specify the use of the current working directory +// to determine the target of relative file paths in the openat() and +// similar syscalls. + +// Miscellaneous flags for the *at() syscalls. +/* #define AT_UNUSED1 0x1000 */ // Was AT_BENEATH + +// Constants used for fcntl(2) + +// command values + +// Seals (F_ADD_SEALS, F_GET_SEALS). + +// file descriptor flags (F_GETFD, F_SETFD) + +// record locking flags (F_GETLK, F_SETLK, F_SETLKW) + +// Advisory file segment locking data type - +// information passed to system by user +type Flock = struct { + Fl_start Off_t + Fl_len Off_t + Fl_pid Pid_t + Fl_type int16 + Fl_whence int16 + Fl_sysid int32 + _ [4]byte +} /* fcntl.h:294:1 */ + +// Old advisory file segment locking data type, +// before adding l_sysid. +type X__oflock = struct { + Fl_start Off_t + Fl_len Off_t + Fl_pid Pid_t + Fl_type int16 + Fl_whence int16 +} /* fcntl.h:308:1 */ + +var _ int8 /* gen.c:2:13: */ diff --git a/vendor/modernc.org/libc/fsync.go b/vendor/modernc.org/libc/fsync.go index c128fbab0..dacf2528e 100644 --- a/vendor/modernc.org/libc/fsync.go +++ b/vendor/modernc.org/libc/fsync.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !libc.nofsync // +build !libc.nofsync package libc // import "modernc.org/libc" diff --git a/vendor/modernc.org/libc/fts/capi_freebsd_amd64.go b/vendor/modernc.org/libc/fts/capi_freebsd_amd64.go new file mode 100644 index 000000000..b5b97ba46 --- /dev/null +++ b/vendor/modernc.org/libc/fts/capi_freebsd_amd64.go @@ -0,0 +1,5 @@ +// Code generated by 'ccgo fts/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 fts/fts_freebsd_amd64.go -pkgname fts', DO NOT EDIT. + +package fts + +var CAPI = map[string]struct{}{} diff --git a/vendor/modernc.org/libc/fts/fts_freebsd_amd64.go b/vendor/modernc.org/libc/fts/fts_freebsd_amd64.go new file mode 100644 index 000000000..5e562f48f --- /dev/null +++ b/vendor/modernc.org/libc/fts/fts_freebsd_amd64.go @@ -0,0 +1,642 @@ +// Code generated by 'ccgo fts/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 fts/fts_freebsd_amd64.go -pkgname fts', DO NOT EDIT. + +package fts + +import ( + "math" + "reflect" + "sync/atomic" + "unsafe" +) + +var _ = math.Pi +var _ reflect.Kind +var _ atomic.Value +var _ unsafe.Pointer + +const ( + FTS_AGAIN = 1 + FTS_COMFOLLOW = 0x001 + FTS_D = 1 + FTS_DC = 2 + FTS_DEFAULT = 3 + FTS_DNR = 4 + FTS_DONTCHDIR = 0x01 + FTS_DOT = 5 + FTS_DP = 6 + FTS_ERR = 7 + FTS_F = 8 + FTS_FOLLOW = 2 + FTS_INIT = 9 + FTS_ISW = 0x04 + FTS_LOGICAL = 0x002 + FTS_NAMEONLY = 0x100 + FTS_NOCHDIR = 0x004 + FTS_NOINSTR = 3 + FTS_NOSTAT = 0x008 + FTS_NS = 10 + FTS_NSOK = 11 + FTS_OPTIONMASK = 0x0ff + FTS_PHYSICAL = 0x010 + FTS_ROOTLEVEL = 0 + FTS_ROOTPARENTLEVEL = -1 + FTS_SEEDOT = 0x020 + FTS_SKIP = 4 + FTS_SL = 12 + FTS_SLNONE = 13 + FTS_STOP = 0x200 + FTS_SYMFOLLOW = 0x02 + FTS_W = 14 + FTS_WHITEOUT = 0x080 + FTS_XDEV = 0x040 + X_FILE_OFFSET_BITS = 64 + X_FTS_H_ = 0 + X_LP64 = 1 + X_MACHINE__LIMITS_H_ = 0 + X_MACHINE__TYPES_H_ = 0 + X_Nonnull = 0 + X_Null_unspecified = 0 + X_Nullable = 0 + X_SYS_CDEFS_H_ = 0 + X_SYS__TYPES_H_ = 0 + Unix = 1 +) + +type Ptrdiff_t = int64 /* <builtin>:3:26 */ + +type Size_t = uint64 /* <builtin>:9:23 */ + +type Wchar_t = int32 /* <builtin>:15:24 */ + +type X__int128_t = struct { + Flo int64 + Fhi int64 +} /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128 +type X__uint128_t = struct { + Flo uint64 + Fhi uint64 +} /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128 + +type X__builtin_va_list = uintptr /* <builtin>:46:14 */ +type X__float128 = float64 /* <builtin>:47:21 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1989, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)fts.h 8.3 (Berkeley) 8/14/94 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// Testing against Clang-specific extensions. + +// This code has been put in place to help reduce the addition of +// compiler specific defines in FreeBSD code. It helps to aid in +// having a compiler-agnostic source tree. + +// Compiler memory barriers, specific to gcc and clang. + +// XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced + +// Macro to test if we're using a specific version of gcc or later. + +// The __CONCAT macro is used to concatenate parts of symbol names, e.g. +// with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. +// The __CONCAT macro is a bit tricky to use if it must work in non-ANSI +// mode -- there must be no spaces between its arguments, and for nested +// __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also +// concatenate double-quoted strings produced by the __STRING macro, but +// this only works with ANSI C. +// +// __XSTRING is like __STRING, but it expands any macros in its argument +// first. It is only available with ANSI C. + +// Compiler-dependent macros to help declare dead (non-returning) and +// pure (no side effects) functions, and unused variables. They are +// null except for versions of gcc that are known to support the features +// properly (old versions of gcc-2 supported the dead and pure features +// in a different (wrong) way). If we do not provide an implementation +// for a given compiler, let the compile fail if it is told to use +// a feature that we cannot live without. + +// Keywords added in C11. + +// Emulation of C11 _Generic(). Unlike the previously defined C11 +// keywords, it is not possible to implement this using exactly the same +// syntax. Therefore implement something similar under the name +// __generic(). Unlike _Generic(), this macro can only distinguish +// between a single type, so it requires nested invocations to +// distinguish multiple cases. + +// C99 Static array indices in function parameter declarations. Syntax such as: +// void bar(int myArray[static 10]); +// is allowed in C99 but not in C++. Define __min_size appropriately so +// headers using it can be compiled in either language. Use like this: +// void bar(int myArray[__min_size(10)]); + +// XXX: should use `#if __STDC_VERSION__ < 199901'. + +// C++11 exposes a load of C99 stuff + +// GCC 2.95 provides `__restrict' as an extension to C90 to support the +// C99-specific `restrict' type qualifier. We happen to use `__restrict' as +// a way to define the `restrict' type qualifier without disturbing older +// software that is unaware of C99 keywords. + +// GNU C version 2.96 adds explicit branch prediction so that +// the CPU back-end can hint the processor and also so that +// code blocks can be reordered such that the predicted path +// sees a more linear flow, thus improving cache behavior, etc. +// +// The following two macros provide us with a way to utilize this +// compiler feature. Use __predict_true() if you expect the expression +// to evaluate to true, and __predict_false() if you expect the +// expression to evaluate to false. +// +// A few notes about usage: +// +// * Generally, __predict_false() error condition checks (unless +// you have some _strong_ reason to do otherwise, in which case +// document it), and/or __predict_true() `no-error' condition +// checks, assuming you want to optimize for the no-error case. +// +// * Other than that, if you don't know the likelihood of a test +// succeeding from empirical or other `hard' evidence, don't +// make predictions. +// +// * These are meant to be used in places that are run `a lot'. +// It is wasteful to make predictions in code that is run +// seldomly (e.g. at subsystem initialization time) as the +// basic block reordering that this affects can often generate +// larger code. + +// We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h> +// require it. + +// Given the pointer x to the member m of the struct s, return +// a pointer to the containing structure. When using GCC, we first +// assign pointer x to a local variable, to check that its type is +// compatible with member m. + +// Compiler-dependent macros to declare that functions take printf-like +// or scanf-like arguments. They are null except for versions of gcc +// that are known to support the features properly (old versions of gcc-2 +// didn't permit keeping the keywords out of the application namespace). + +// Compiler-dependent macros that rely on FreeBSD-specific extensions. + +// Embed the rcs id of a source file in the resulting library. Note that in +// more recent ELF binutils, we use .ident allowing the ID to be stripped. +// Usage: +// __FBSDID("$FreeBSD$"); + +// - +// The following definitions are an extension of the behavior originally +// implemented in <sys/_posix.h>, but with a different level of granularity. +// POSIX.1 requires that the macros we test be defined before any standard +// header file is included. +// +// Here's a quick run-down of the versions: +// defined(_POSIX_SOURCE) 1003.1-1988 +// _POSIX_C_SOURCE == 1 1003.1-1990 +// _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option +// _POSIX_C_SOURCE == 199309 1003.1b-1993 +// _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, +// and the omnibus ISO/IEC 9945-1: 1996 +// _POSIX_C_SOURCE == 200112 1003.1-2001 +// _POSIX_C_SOURCE == 200809 1003.1-2008 +// +// In addition, the X/Open Portability Guide, which is now the Single UNIX +// Specification, defines a feature-test macro which indicates the version of +// that specification, and which subsumes _POSIX_C_SOURCE. +// +// Our macros begin with two underscores to avoid namespace screwage. + +// Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. + +// Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. + +// Deal with various X/Open Portability Guides and Single UNIX Spec. + +// Deal with all versions of POSIX. The ordering relative to the tests above is +// important. +// - +// Deal with _ANSI_SOURCE: +// If it is defined, and no other compilation environment is explicitly +// requested, then define our internal feature-test macros to zero. This +// makes no difference to the preprocessor (undefined symbols in preprocessing +// expressions are defined to have value zero), but makes it more convenient for +// a test program to print out the values. +// +// If a program mistakenly defines _ANSI_SOURCE and some other macro such as +// _POSIX_C_SOURCE, we will assume that it wants the broader compilation +// environment (and in fact we will never get here). + +// User override __EXT1_VISIBLE + +// Old versions of GCC use non-standard ARM arch symbols; acle-compat.h +// translates them to __ARM_ARCH and the modern feature symbols defined by ARM. + +// Nullability qualifiers: currently only supported by Clang. + +// Type Safety Checking +// +// Clang provides additional attributes to enable checking type safety +// properties that cannot be enforced by the C type system. + +// Lock annotations. +// +// Clang provides support for doing basic thread-safety tests at +// compile-time, by marking which locks will/should be held when +// entering/leaving a functions. +// +// Furthermore, it is also possible to annotate variables and structure +// members to enforce that they are only accessed when certain locks are +// held. + +// Structure implements a lock. + +// Function acquires an exclusive or shared lock. + +// Function attempts to acquire an exclusive or shared lock. + +// Function releases a lock. + +// Function asserts that an exclusive or shared lock is held. + +// Function requires that an exclusive or shared lock is or is not held. + +// Function should not be analyzed. + +// Function or variable should not be sanitized, i.e. by AddressSanitizer. +// GCC has the nosanitize attribute, but as a function attribute only, and +// warns on use as a variable attribute. + +// Guard variables and structure members by lock. + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-4-Clause +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// Copyright (c) 1990, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. All advertising materials mentioning features or use of this software +// must display the following acknowledgement: +// This product includes software developed by the University of +// California, Berkeley and its contributors. +// 4. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 +// From: @(#)types.h 8.3 (Berkeley) 1/5/94 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1988, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)limits.h 8.3 (Berkeley) 1/4/94 +// $FreeBSD$ + +// According to ANSI (section 2.2.4.2), the values below must be usable by +// #if preprocessing directives. Additionally, the expression must have the +// same type as would an expression that is an object of the corresponding +// type converted according to the integral promotions. The subtraction for +// INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an +// unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). + +// max value for an unsigned long long + +// Quads and longs are the same on the amd64. Ensure they stay in sync. + +// Minimum signal stack size. + +// Basic types upon which most other types are built. +type X__int8_t = int8 /* _types.h:55:22 */ +type X__uint8_t = uint8 /* _types.h:56:24 */ +type X__int16_t = int16 /* _types.h:57:17 */ +type X__uint16_t = uint16 /* _types.h:58:25 */ +type X__int32_t = int32 /* _types.h:59:15 */ +type X__uint32_t = uint32 /* _types.h:60:23 */ +type X__int64_t = int64 /* _types.h:62:16 */ +type X__uint64_t = uint64 /* _types.h:63:24 */ + +// Standard type definitions. +type X__clock_t = X__int32_t /* _types.h:75:19 */ // clock()... +type X__critical_t = X__int64_t /* _types.h:76:19 */ +type X__double_t = float64 /* _types.h:78:17 */ +type X__float_t = float32 /* _types.h:79:16 */ +type X__intfptr_t = X__int64_t /* _types.h:81:19 */ +type X__intptr_t = X__int64_t /* _types.h:82:19 */ +type X__intmax_t = X__int64_t /* _types.h:93:19 */ +type X__int_fast8_t = X__int32_t /* _types.h:94:19 */ +type X__int_fast16_t = X__int32_t /* _types.h:95:19 */ +type X__int_fast32_t = X__int32_t /* _types.h:96:19 */ +type X__int_fast64_t = X__int64_t /* _types.h:97:19 */ +type X__int_least8_t = X__int8_t /* _types.h:98:18 */ +type X__int_least16_t = X__int16_t /* _types.h:99:19 */ +type X__int_least32_t = X__int32_t /* _types.h:100:19 */ +type X__int_least64_t = X__int64_t /* _types.h:101:19 */ +type X__ptrdiff_t = X__int64_t /* _types.h:103:19 */ // ptr1 - ptr2 +type X__register_t = X__int64_t /* _types.h:104:19 */ +type X__segsz_t = X__int64_t /* _types.h:105:19 */ // segment size (in pages) +type X__size_t = X__uint64_t /* _types.h:106:20 */ // sizeof() +type X__ssize_t = X__int64_t /* _types.h:107:19 */ // byte count or error +type X__time_t = X__int64_t /* _types.h:108:19 */ // time()... +type X__uintfptr_t = X__uint64_t /* _types.h:109:20 */ +type X__uintptr_t = X__uint64_t /* _types.h:110:20 */ +type X__uintmax_t = X__uint64_t /* _types.h:121:20 */ +type X__uint_fast8_t = X__uint32_t /* _types.h:122:20 */ +type X__uint_fast16_t = X__uint32_t /* _types.h:123:20 */ +type X__uint_fast32_t = X__uint32_t /* _types.h:124:20 */ +type X__uint_fast64_t = X__uint64_t /* _types.h:125:20 */ +type X__uint_least8_t = X__uint8_t /* _types.h:126:19 */ +type X__uint_least16_t = X__uint16_t /* _types.h:127:20 */ +type X__uint_least32_t = X__uint32_t /* _types.h:128:20 */ +type X__uint_least64_t = X__uint64_t /* _types.h:129:20 */ +type X__u_register_t = X__uint64_t /* _types.h:131:20 */ +type X__vm_offset_t = X__uint64_t /* _types.h:132:20 */ +type X__vm_paddr_t = X__uint64_t /* _types.h:133:20 */ +type X__vm_size_t = X__uint64_t /* _types.h:134:20 */ +type X___wchar_t = int32 /* _types.h:141:14 */ + +// Standard type definitions. +type X__blksize_t = X__int32_t /* _types.h:40:19 */ // file block size +type X__blkcnt_t = X__int64_t /* _types.h:41:19 */ // file block count +type X__clockid_t = X__int32_t /* _types.h:42:19 */ // clock_gettime()... +type X__fflags_t = X__uint32_t /* _types.h:43:20 */ // file flags +type X__fsblkcnt_t = X__uint64_t /* _types.h:44:20 */ +type X__fsfilcnt_t = X__uint64_t /* _types.h:45:20 */ +type X__gid_t = X__uint32_t /* _types.h:46:20 */ +type X__id_t = X__int64_t /* _types.h:47:19 */ // can hold a gid_t, pid_t, or uid_t +type X__ino_t = X__uint64_t /* _types.h:48:20 */ // inode number +type X__key_t = int64 /* _types.h:49:15 */ // IPC key (for Sys V IPC) +type X__lwpid_t = X__int32_t /* _types.h:50:19 */ // Thread ID (a.k.a. LWP) +type X__mode_t = X__uint16_t /* _types.h:51:20 */ // permissions +type X__accmode_t = int32 /* _types.h:52:14 */ // access permissions +type X__nl_item = int32 /* _types.h:53:14 */ +type X__nlink_t = X__uint64_t /* _types.h:54:20 */ // link count +type X__off_t = X__int64_t /* _types.h:55:19 */ // file offset +type X__off64_t = X__int64_t /* _types.h:56:19 */ // file offset (alias) +type X__pid_t = X__int32_t /* _types.h:57:19 */ // process [group] +type X__rlim_t = X__int64_t /* _types.h:58:19 */ // resource limit - intentionally +// signed, because of legacy code +// that uses -1 for RLIM_INFINITY +type X__sa_family_t = X__uint8_t /* _types.h:61:19 */ +type X__socklen_t = X__uint32_t /* _types.h:62:20 */ +type X__suseconds_t = int64 /* _types.h:63:15 */ // microseconds (signed) +type X__timer_t = uintptr /* _types.h:64:24 */ // timer_gettime()... +type X__mqd_t = uintptr /* _types.h:65:21 */ // mq_open()... +type X__uid_t = X__uint32_t /* _types.h:66:20 */ +type X__useconds_t = uint32 /* _types.h:67:22 */ // microseconds (unsigned) +type X__cpuwhich_t = int32 /* _types.h:68:14 */ // which parameter for cpuset. +type X__cpulevel_t = int32 /* _types.h:69:14 */ // level parameter for cpuset. +type X__cpusetid_t = int32 /* _types.h:70:14 */ // cpuset identifier. +type X__daddr_t = X__int64_t /* _types.h:71:19 */ // bwrite(3), FIOBMAP2, etc + +// Unusual type definitions. +// rune_t is declared to be an ``int'' instead of the more natural +// ``unsigned long'' or ``long''. Two things are happening here. It is not +// unsigned so that EOF (-1) can be naturally assigned to it and used. Also, +// it looks like 10646 will be a 31 bit standard. This means that if your +// ints cannot hold 32 bits, you will be in trouble. The reason an int was +// chosen over a long is that the is*() and to*() routines take ints (says +// ANSI C), but they use __ct_rune_t instead of int. +// +// NOTE: rune_t is not covered by ANSI nor other standards, and should not +// be instantiated outside of lib/libc/locale. Use wchar_t. wint_t and +// rune_t must be the same type. Also, wint_t should be able to hold all +// members of the largest character set plus one extra value (WEOF), and +// must be at least 16 bits. +type X__ct_rune_t = int32 /* _types.h:91:14 */ // arg type for ctype funcs +type X__rune_t = X__ct_rune_t /* _types.h:92:21 */ // rune_t (see above) +type X__wint_t = X__ct_rune_t /* _types.h:93:21 */ // wint_t (see above) + +// Clang already provides these types as built-ins, but only in C++ mode. +type X__char16_t = X__uint_least16_t /* _types.h:97:26 */ +type X__char32_t = X__uint_least32_t /* _types.h:98:26 */ +// In C++11, char16_t and char32_t are built-in types. + +type X__max_align_t = struct { + F__max_align1 int64 + F__max_align2 float64 +} /* _types.h:111:3 */ + +type X__dev_t = X__uint64_t /* _types.h:113:20 */ // device number + +type X__fixpt_t = X__uint32_t /* _types.h:115:20 */ // fixed point number + +// mbstate_t is an opaque object to keep conversion state during multibyte +// stream conversions. +type X__mbstate_t = struct { + _ [0]uint64 + F__mbstate8 [128]int8 +} /* _types.h:124:3 */ + +type X__rman_res_t = X__uintmax_t /* _types.h:126:25 */ + +// Types for varargs. These are all provided by builtin types these +// days, so centralize their definition. +type X__va_list = X__builtin_va_list /* _types.h:133:27 */ // internally known to gcc +type X__gnuc_va_list = X__va_list /* _types.h:140:20 */ // compatibility w/GNU headers + +// When the following macro is defined, the system uses 64-bit inode numbers. +// Programs can use this to avoid including <sys/param.h>, with its associated +// namespace pollution. + +type X_ftsent = struct { + Ffts_cycle uintptr + Ffts_parent uintptr + Ffts_link uintptr + Ffts_number int64 + Ffts_pointer uintptr + Ffts_accpath uintptr + Ffts_path uintptr + Ffts_errno int32 + Ffts_symfd int32 + Ffts_pathlen X__size_t + Ffts_namelen X__size_t + Ffts_ino X__ino_t + Ffts_dev X__dev_t + Ffts_nlink X__nlink_t + Ffts_level int64 + Ffts_info int32 + Ffts_flags uint32 + Ffts_instr int32 + _ [4]byte + Ffts_statp uintptr + Ffts_name uintptr + Ffts_fts uintptr +} /* fts.h:41:2 */ + +// compatibility w/GNU headers + +// When the following macro is defined, the system uses 64-bit inode numbers. +// Programs can use this to avoid including <sys/param.h>, with its associated +// namespace pollution. + +type FTS = struct { + Ffts_cur uintptr + Ffts_child uintptr + Ffts_array uintptr + Ffts_dev X__dev_t + Ffts_path uintptr + Ffts_rfd int32 + _ [4]byte + Ffts_pathlen X__size_t + Ffts_nitems X__size_t + Ffts_compar uintptr + Ffts_options int32 + _ [4]byte + Ffts_clientptr uintptr +} /* fts.h:66:3 */ + +type FTSENT = X_ftsent /* fts.h:120:3 */ + +var _ int8 /* gen.c:2:13: */ diff --git a/vendor/modernc.org/libc/go.mod b/vendor/modernc.org/libc/go.mod index d44244c80..fe8c69a1e 100644 --- a/vendor/modernc.org/libc/go.mod +++ b/vendor/modernc.org/libc/go.mod @@ -4,9 +4,9 @@ go 1.15 require ( github.com/mattn/go-isatty v0.0.12 - golang.org/x/sys v0.0.0-20201126233918-771906719818 - modernc.org/cc/v3 v3.33.11 // indirect - modernc.org/ccgo/v3 v3.10.0 // indirect + golang.org/x/sys v0.0.0-20210902050250-f475640dd07b + modernc.org/cc/v3 v3.34.0 // indirect + modernc.org/ccgo/v3 v3.11.1 // indirect modernc.org/mathutil v1.4.1 modernc.org/memory v1.0.5 ) diff --git a/vendor/modernc.org/libc/go.sum b/vendor/modernc.org/libc/go.sum index dedc57740..07a9284df 100644 --- a/vendor/modernc.org/libc/go.sum +++ b/vendor/modernc.org/libc/go.sum @@ -21,8 +21,9 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201126233918-771906719818 h1:f1CIuDlJhwANEC2MM87MBEVMr3jl5bifgsfj90XAF9c= golang.org/x/sys v0.0.0-20201126233918-771906719818/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210902050250-f475640dd07b h1:S7hKs0Flbq0bbc9xgYt4stIEG1zNDFqyrPwAX2Wj/sE= +golang.org/x/sys v0.0.0-20210902050250-f475640dd07b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -38,13 +39,18 @@ lukechampine.com/uint128 v1.1.1 h1:pnxCASz787iMf+02ssImqk6OLt+Z5QHMoZyUXR4z6JU= lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= modernc.org/cc/v3 v3.33.6/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= modernc.org/cc/v3 v3.33.9/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/cc/v3 v3.33.11 h1:Fc7goiKCzfHvGR4WZbVLWIh/4VhJE2Z31Jkg36Ezp7Q= modernc.org/cc/v3 v3.33.11/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= +modernc.org/cc/v3 v3.34.0 h1:dFhZc/HKR3qp92sYQxKRRaDMz+sr1bwcFD+m7LSCrAs= +modernc.org/cc/v3 v3.34.0/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= modernc.org/ccgo/v3 v3.9.5/go.mod h1:umuo2EP2oDSBnD3ckjaVUXMrmeAw8C8OSICVa0iFf60= -modernc.org/ccgo/v3 v3.10.0 h1:aHbPfX9EIwax9IqqMErOtMS+MgRLCr67Id/VPPQUg5E= modernc.org/ccgo/v3 v3.10.0/go.mod h1:c0yBmkRFi7uW4J7fwx/JiijwOjeAeR2NoSaRVFPmjMw= +modernc.org/ccgo/v3 v3.11.0/go.mod h1:dGNposbDp9TOZ/1KBxghxtUp/bzErD0/0QW4hhSaBMI= +modernc.org/ccgo/v3 v3.11.1 h1:ofHyxpKFARlebn+Vt2K9hpWEtbV9xRcOQVa1/vHfLws= +modernc.org/ccgo/v3 v3.11.1/go.mod h1:lWHxfsn13L3f7hgGsGlU28D9eUOf6y3ZYHKoPaKU0ag= modernc.org/libc v1.9.8/go.mod h1:U1eq8YWr/Kc1RWCMFUWEdkTg8OTcfLw2kY8EDwl039w= modernc.org/libc v1.9.11/go.mod h1:NyF3tsA5ArIjJ83XB0JlqhjTabTCHm9aX4XMPHyQn0Q= +modernc.org/libc v1.11.0/go.mod h1:2lOfPmj7cz+g1MrPNmX65QCzVxgNq2C5o0jdLY2gAYg= +modernc.org/libc v1.11.2/go.mod h1:ioIyrl3ETkugDO3SGZ+6EOKvlP3zSOycUETe4XM4n8M= modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/mathutil v1.4.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= diff --git a/vendor/modernc.org/libc/grp/capi_freebsd_amd64.go b/vendor/modernc.org/libc/grp/capi_freebsd_amd64.go new file mode 100644 index 000000000..497b372f2 --- /dev/null +++ b/vendor/modernc.org/libc/grp/capi_freebsd_amd64.go @@ -0,0 +1,5 @@ +// Code generated by 'ccgo grp/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 grp/grp_freebsd_amd64.go -pkgname grp', DO NOT EDIT. + +package grp + +var CAPI = map[string]struct{}{} diff --git a/vendor/modernc.org/libc/grp/grp_freebsd_amd64.go b/vendor/modernc.org/libc/grp/grp_freebsd_amd64.go new file mode 100644 index 000000000..f46ebabd3 --- /dev/null +++ b/vendor/modernc.org/libc/grp/grp_freebsd_amd64.go @@ -0,0 +1,613 @@ +// Code generated by 'ccgo grp/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 grp/grp_freebsd_amd64.go -pkgname grp', DO NOT EDIT. + +package grp + +import ( + "math" + "reflect" + "sync/atomic" + "unsafe" +) + +var _ = math.Pi +var _ reflect.Kind +var _ atomic.Value +var _ unsafe.Pointer + +const ( + X_FILE_OFFSET_BITS = 64 + X_GID_T_DECLARED = 0 + X_GRP_H_ = 0 + X_LP64 = 1 + X_MACHINE__LIMITS_H_ = 0 + X_MACHINE__TYPES_H_ = 0 + X_Nonnull = 0 + X_Null_unspecified = 0 + X_Nullable = 0 + X_PATH_GROUP = "/etc/group" + X_SIZE_T_DECLARED = 0 + X_SYS_CDEFS_H_ = 0 + X_SYS__TYPES_H_ = 0 + Unix = 1 +) + +type Ptrdiff_t = int64 /* <builtin>:3:26 */ + +type Size_t = uint64 /* <builtin>:9:23 */ + +type Wchar_t = int32 /* <builtin>:15:24 */ + +type X__int128_t = struct { + Flo int64 + Fhi int64 +} /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128 +type X__uint128_t = struct { + Flo uint64 + Fhi uint64 +} /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128 + +type X__builtin_va_list = uintptr /* <builtin>:46:14 */ +type X__float128 = float64 /* <builtin>:47:21 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1989, 1993 +// The Regents of the University of California. All rights reserved. +// (c) UNIX System Laboratories, Inc. +// All or some portions of this file are derived from material licensed +// to the University of California by American Telephone and Telegraph +// Co. or Unix System Laboratories, Inc. and are reproduced herein with +// the permission of UNIX System Laboratories, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)grp.h 8.2 (Berkeley) 1/21/94 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// Testing against Clang-specific extensions. + +// This code has been put in place to help reduce the addition of +// compiler specific defines in FreeBSD code. It helps to aid in +// having a compiler-agnostic source tree. + +// Compiler memory barriers, specific to gcc and clang. + +// XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced + +// Macro to test if we're using a specific version of gcc or later. + +// The __CONCAT macro is used to concatenate parts of symbol names, e.g. +// with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. +// The __CONCAT macro is a bit tricky to use if it must work in non-ANSI +// mode -- there must be no spaces between its arguments, and for nested +// __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also +// concatenate double-quoted strings produced by the __STRING macro, but +// this only works with ANSI C. +// +// __XSTRING is like __STRING, but it expands any macros in its argument +// first. It is only available with ANSI C. + +// Compiler-dependent macros to help declare dead (non-returning) and +// pure (no side effects) functions, and unused variables. They are +// null except for versions of gcc that are known to support the features +// properly (old versions of gcc-2 supported the dead and pure features +// in a different (wrong) way). If we do not provide an implementation +// for a given compiler, let the compile fail if it is told to use +// a feature that we cannot live without. + +// Keywords added in C11. + +// Emulation of C11 _Generic(). Unlike the previously defined C11 +// keywords, it is not possible to implement this using exactly the same +// syntax. Therefore implement something similar under the name +// __generic(). Unlike _Generic(), this macro can only distinguish +// between a single type, so it requires nested invocations to +// distinguish multiple cases. + +// C99 Static array indices in function parameter declarations. Syntax such as: +// void bar(int myArray[static 10]); +// is allowed in C99 but not in C++. Define __min_size appropriately so +// headers using it can be compiled in either language. Use like this: +// void bar(int myArray[__min_size(10)]); + +// XXX: should use `#if __STDC_VERSION__ < 199901'. + +// C++11 exposes a load of C99 stuff + +// GCC 2.95 provides `__restrict' as an extension to C90 to support the +// C99-specific `restrict' type qualifier. We happen to use `__restrict' as +// a way to define the `restrict' type qualifier without disturbing older +// software that is unaware of C99 keywords. + +// GNU C version 2.96 adds explicit branch prediction so that +// the CPU back-end can hint the processor and also so that +// code blocks can be reordered such that the predicted path +// sees a more linear flow, thus improving cache behavior, etc. +// +// The following two macros provide us with a way to utilize this +// compiler feature. Use __predict_true() if you expect the expression +// to evaluate to true, and __predict_false() if you expect the +// expression to evaluate to false. +// +// A few notes about usage: +// +// * Generally, __predict_false() error condition checks (unless +// you have some _strong_ reason to do otherwise, in which case +// document it), and/or __predict_true() `no-error' condition +// checks, assuming you want to optimize for the no-error case. +// +// * Other than that, if you don't know the likelihood of a test +// succeeding from empirical or other `hard' evidence, don't +// make predictions. +// +// * These are meant to be used in places that are run `a lot'. +// It is wasteful to make predictions in code that is run +// seldomly (e.g. at subsystem initialization time) as the +// basic block reordering that this affects can often generate +// larger code. + +// We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h> +// require it. + +// Given the pointer x to the member m of the struct s, return +// a pointer to the containing structure. When using GCC, we first +// assign pointer x to a local variable, to check that its type is +// compatible with member m. + +// Compiler-dependent macros to declare that functions take printf-like +// or scanf-like arguments. They are null except for versions of gcc +// that are known to support the features properly (old versions of gcc-2 +// didn't permit keeping the keywords out of the application namespace). + +// Compiler-dependent macros that rely on FreeBSD-specific extensions. + +// Embed the rcs id of a source file in the resulting library. Note that in +// more recent ELF binutils, we use .ident allowing the ID to be stripped. +// Usage: +// __FBSDID("$FreeBSD$"); + +// - +// The following definitions are an extension of the behavior originally +// implemented in <sys/_posix.h>, but with a different level of granularity. +// POSIX.1 requires that the macros we test be defined before any standard +// header file is included. +// +// Here's a quick run-down of the versions: +// defined(_POSIX_SOURCE) 1003.1-1988 +// _POSIX_C_SOURCE == 1 1003.1-1990 +// _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option +// _POSIX_C_SOURCE == 199309 1003.1b-1993 +// _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, +// and the omnibus ISO/IEC 9945-1: 1996 +// _POSIX_C_SOURCE == 200112 1003.1-2001 +// _POSIX_C_SOURCE == 200809 1003.1-2008 +// +// In addition, the X/Open Portability Guide, which is now the Single UNIX +// Specification, defines a feature-test macro which indicates the version of +// that specification, and which subsumes _POSIX_C_SOURCE. +// +// Our macros begin with two underscores to avoid namespace screwage. + +// Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. + +// Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. + +// Deal with various X/Open Portability Guides and Single UNIX Spec. + +// Deal with all versions of POSIX. The ordering relative to the tests above is +// important. +// - +// Deal with _ANSI_SOURCE: +// If it is defined, and no other compilation environment is explicitly +// requested, then define our internal feature-test macros to zero. This +// makes no difference to the preprocessor (undefined symbols in preprocessing +// expressions are defined to have value zero), but makes it more convenient for +// a test program to print out the values. +// +// If a program mistakenly defines _ANSI_SOURCE and some other macro such as +// _POSIX_C_SOURCE, we will assume that it wants the broader compilation +// environment (and in fact we will never get here). + +// User override __EXT1_VISIBLE + +// Old versions of GCC use non-standard ARM arch symbols; acle-compat.h +// translates them to __ARM_ARCH and the modern feature symbols defined by ARM. + +// Nullability qualifiers: currently only supported by Clang. + +// Type Safety Checking +// +// Clang provides additional attributes to enable checking type safety +// properties that cannot be enforced by the C type system. + +// Lock annotations. +// +// Clang provides support for doing basic thread-safety tests at +// compile-time, by marking which locks will/should be held when +// entering/leaving a functions. +// +// Furthermore, it is also possible to annotate variables and structure +// members to enforce that they are only accessed when certain locks are +// held. + +// Structure implements a lock. + +// Function acquires an exclusive or shared lock. + +// Function attempts to acquire an exclusive or shared lock. + +// Function releases a lock. + +// Function asserts that an exclusive or shared lock is held. + +// Function requires that an exclusive or shared lock is or is not held. + +// Function should not be analyzed. + +// Function or variable should not be sanitized, i.e. by AddressSanitizer. +// GCC has the nosanitize attribute, but as a function attribute only, and +// warns on use as a variable attribute. + +// Guard variables and structure members by lock. + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-4-Clause +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// Copyright (c) 1990, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. All advertising materials mentioning features or use of this software +// must display the following acknowledgement: +// This product includes software developed by the University of +// California, Berkeley and its contributors. +// 4. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 +// From: @(#)types.h 8.3 (Berkeley) 1/5/94 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1988, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)limits.h 8.3 (Berkeley) 1/4/94 +// $FreeBSD$ + +// According to ANSI (section 2.2.4.2), the values below must be usable by +// #if preprocessing directives. Additionally, the expression must have the +// same type as would an expression that is an object of the corresponding +// type converted according to the integral promotions. The subtraction for +// INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an +// unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). + +// max value for an unsigned long long + +// Quads and longs are the same on the amd64. Ensure they stay in sync. + +// Minimum signal stack size. + +// Basic types upon which most other types are built. +type X__int8_t = int8 /* _types.h:55:22 */ +type X__uint8_t = uint8 /* _types.h:56:24 */ +type X__int16_t = int16 /* _types.h:57:17 */ +type X__uint16_t = uint16 /* _types.h:58:25 */ +type X__int32_t = int32 /* _types.h:59:15 */ +type X__uint32_t = uint32 /* _types.h:60:23 */ +type X__int64_t = int64 /* _types.h:62:16 */ +type X__uint64_t = uint64 /* _types.h:63:24 */ + +// Standard type definitions. +type X__clock_t = X__int32_t /* _types.h:75:19 */ // clock()... +type X__critical_t = X__int64_t /* _types.h:76:19 */ +type X__double_t = float64 /* _types.h:78:17 */ +type X__float_t = float32 /* _types.h:79:16 */ +type X__intfptr_t = X__int64_t /* _types.h:81:19 */ +type X__intptr_t = X__int64_t /* _types.h:82:19 */ +type X__intmax_t = X__int64_t /* _types.h:93:19 */ +type X__int_fast8_t = X__int32_t /* _types.h:94:19 */ +type X__int_fast16_t = X__int32_t /* _types.h:95:19 */ +type X__int_fast32_t = X__int32_t /* _types.h:96:19 */ +type X__int_fast64_t = X__int64_t /* _types.h:97:19 */ +type X__int_least8_t = X__int8_t /* _types.h:98:18 */ +type X__int_least16_t = X__int16_t /* _types.h:99:19 */ +type X__int_least32_t = X__int32_t /* _types.h:100:19 */ +type X__int_least64_t = X__int64_t /* _types.h:101:19 */ +type X__ptrdiff_t = X__int64_t /* _types.h:103:19 */ // ptr1 - ptr2 +type X__register_t = X__int64_t /* _types.h:104:19 */ +type X__segsz_t = X__int64_t /* _types.h:105:19 */ // segment size (in pages) +type X__size_t = X__uint64_t /* _types.h:106:20 */ // sizeof() +type X__ssize_t = X__int64_t /* _types.h:107:19 */ // byte count or error +type X__time_t = X__int64_t /* _types.h:108:19 */ // time()... +type X__uintfptr_t = X__uint64_t /* _types.h:109:20 */ +type X__uintptr_t = X__uint64_t /* _types.h:110:20 */ +type X__uintmax_t = X__uint64_t /* _types.h:121:20 */ +type X__uint_fast8_t = X__uint32_t /* _types.h:122:20 */ +type X__uint_fast16_t = X__uint32_t /* _types.h:123:20 */ +type X__uint_fast32_t = X__uint32_t /* _types.h:124:20 */ +type X__uint_fast64_t = X__uint64_t /* _types.h:125:20 */ +type X__uint_least8_t = X__uint8_t /* _types.h:126:19 */ +type X__uint_least16_t = X__uint16_t /* _types.h:127:20 */ +type X__uint_least32_t = X__uint32_t /* _types.h:128:20 */ +type X__uint_least64_t = X__uint64_t /* _types.h:129:20 */ +type X__u_register_t = X__uint64_t /* _types.h:131:20 */ +type X__vm_offset_t = X__uint64_t /* _types.h:132:20 */ +type X__vm_paddr_t = X__uint64_t /* _types.h:133:20 */ +type X__vm_size_t = X__uint64_t /* _types.h:134:20 */ +type X___wchar_t = int32 /* _types.h:141:14 */ + +// Standard type definitions. +type X__blksize_t = X__int32_t /* _types.h:40:19 */ // file block size +type X__blkcnt_t = X__int64_t /* _types.h:41:19 */ // file block count +type X__clockid_t = X__int32_t /* _types.h:42:19 */ // clock_gettime()... +type X__fflags_t = X__uint32_t /* _types.h:43:20 */ // file flags +type X__fsblkcnt_t = X__uint64_t /* _types.h:44:20 */ +type X__fsfilcnt_t = X__uint64_t /* _types.h:45:20 */ +type X__gid_t = X__uint32_t /* _types.h:46:20 */ +type X__id_t = X__int64_t /* _types.h:47:19 */ // can hold a gid_t, pid_t, or uid_t +type X__ino_t = X__uint64_t /* _types.h:48:20 */ // inode number +type X__key_t = int64 /* _types.h:49:15 */ // IPC key (for Sys V IPC) +type X__lwpid_t = X__int32_t /* _types.h:50:19 */ // Thread ID (a.k.a. LWP) +type X__mode_t = X__uint16_t /* _types.h:51:20 */ // permissions +type X__accmode_t = int32 /* _types.h:52:14 */ // access permissions +type X__nl_item = int32 /* _types.h:53:14 */ +type X__nlink_t = X__uint64_t /* _types.h:54:20 */ // link count +type X__off_t = X__int64_t /* _types.h:55:19 */ // file offset +type X__off64_t = X__int64_t /* _types.h:56:19 */ // file offset (alias) +type X__pid_t = X__int32_t /* _types.h:57:19 */ // process [group] +type X__rlim_t = X__int64_t /* _types.h:58:19 */ // resource limit - intentionally +// signed, because of legacy code +// that uses -1 for RLIM_INFINITY +type X__sa_family_t = X__uint8_t /* _types.h:61:19 */ +type X__socklen_t = X__uint32_t /* _types.h:62:20 */ +type X__suseconds_t = int64 /* _types.h:63:15 */ // microseconds (signed) +type X__timer_t = uintptr /* _types.h:64:24 */ // timer_gettime()... +type X__mqd_t = uintptr /* _types.h:65:21 */ // mq_open()... +type X__uid_t = X__uint32_t /* _types.h:66:20 */ +type X__useconds_t = uint32 /* _types.h:67:22 */ // microseconds (unsigned) +type X__cpuwhich_t = int32 /* _types.h:68:14 */ // which parameter for cpuset. +type X__cpulevel_t = int32 /* _types.h:69:14 */ // level parameter for cpuset. +type X__cpusetid_t = int32 /* _types.h:70:14 */ // cpuset identifier. +type X__daddr_t = X__int64_t /* _types.h:71:19 */ // bwrite(3), FIOBMAP2, etc + +// Unusual type definitions. +// rune_t is declared to be an ``int'' instead of the more natural +// ``unsigned long'' or ``long''. Two things are happening here. It is not +// unsigned so that EOF (-1) can be naturally assigned to it and used. Also, +// it looks like 10646 will be a 31 bit standard. This means that if your +// ints cannot hold 32 bits, you will be in trouble. The reason an int was +// chosen over a long is that the is*() and to*() routines take ints (says +// ANSI C), but they use __ct_rune_t instead of int. +// +// NOTE: rune_t is not covered by ANSI nor other standards, and should not +// be instantiated outside of lib/libc/locale. Use wchar_t. wint_t and +// rune_t must be the same type. Also, wint_t should be able to hold all +// members of the largest character set plus one extra value (WEOF), and +// must be at least 16 bits. +type X__ct_rune_t = int32 /* _types.h:91:14 */ // arg type for ctype funcs +type X__rune_t = X__ct_rune_t /* _types.h:92:21 */ // rune_t (see above) +type X__wint_t = X__ct_rune_t /* _types.h:93:21 */ // wint_t (see above) + +// Clang already provides these types as built-ins, but only in C++ mode. +type X__char16_t = X__uint_least16_t /* _types.h:97:26 */ +type X__char32_t = X__uint_least32_t /* _types.h:98:26 */ +// In C++11, char16_t and char32_t are built-in types. + +type X__max_align_t = struct { + F__max_align1 int64 + F__max_align2 float64 +} /* _types.h:111:3 */ + +type X__dev_t = X__uint64_t /* _types.h:113:20 */ // device number + +type X__fixpt_t = X__uint32_t /* _types.h:115:20 */ // fixed point number + +// mbstate_t is an opaque object to keep conversion state during multibyte +// stream conversions. +type X__mbstate_t = struct { + _ [0]uint64 + F__mbstate8 [128]int8 +} /* _types.h:124:3 */ + +type X__rman_res_t = X__uintmax_t /* _types.h:126:25 */ + +// Types for varargs. These are all provided by builtin types these +// days, so centralize their definition. +type X__va_list = X__builtin_va_list /* _types.h:133:27 */ // internally known to gcc +type X__gnuc_va_list = X__va_list /* _types.h:140:20 */ // compatibility w/GNU headers + +// When the following macro is defined, the system uses 64-bit inode numbers. +// Programs can use this to avoid including <sys/param.h>, with its associated +// namespace pollution. + +type Gid_t = X__gid_t /* grp.h:49:18 */ + +type Group = struct { + Fgr_name uintptr + Fgr_passwd uintptr + Fgr_gid Gid_t + _ [4]byte + Fgr_mem uintptr +} /* grp.h:58:1 */ + +var _ int8 /* gen.c:2:13: */ diff --git a/vendor/modernc.org/libc/ioutil_freebsd.go b/vendor/modernc.org/libc/ioutil_freebsd.go new file mode 100644 index 000000000..1628bfa3c --- /dev/null +++ b/vendor/modernc.org/libc/ioutil_freebsd.go @@ -0,0 +1,65 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE-GO file. + +// Modifications Copyright 2020 The Libc Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package libc // import "modernc.org/libc" + +import ( + "fmt" + "os" + "sync" + "time" + "unsafe" + + "golang.org/x/sys/unix" +) + +// Random number state. +// We generate random temporary file names so that there's a good +// chance the file doesn't exist yet - keeps the number of tries in +// TempFile to a minimum. +var randState uint32 +var randStateMu sync.Mutex + +func reseed() uint32 { + return uint32(time.Now().UnixNano() + int64(os.Getpid())) +} + +func nextRandom(x uintptr) { + randStateMu.Lock() + r := randState + if r == 0 { + r = reseed() + } + r = r*1664525 + 1013904223 // constants from Numerical Recipes + randState = r + randStateMu.Unlock() + copy((*RawMem)(unsafe.Pointer(x))[:6:6], fmt.Sprintf("%06d", int(1e9+r%1e9)%1e6)) +} + +func tempFile(s, x uintptr) (fd int, err error) { + const maxTry = 10000 + nconflict := 0 + for i := 0; i < maxTry; i++ { + nextRandom(x) + if fd, err = unix.Open(GoString(s), os.O_RDWR|os.O_CREATE|os.O_EXCL, 0600); err == nil { + return fd, nil + } + + if !os.IsExist(err) { + return -1, err + } + + if nconflict++; nconflict > 10 { + randStateMu.Lock() + randState = reseed() + nconflict = 0 + randStateMu.Unlock() + } + } + return -1, err +} diff --git a/vendor/modernc.org/libc/langinfo/capi_freebsd_amd64.go b/vendor/modernc.org/libc/langinfo/capi_freebsd_amd64.go new file mode 100644 index 000000000..c20d84c62 --- /dev/null +++ b/vendor/modernc.org/libc/langinfo/capi_freebsd_amd64.go @@ -0,0 +1,5 @@ +// Code generated by 'ccgo langinfo/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 langinfo/langinfo_freebsd_amd64.go -pkgname langinfo', DO NOT EDIT. + +package langinfo + +var CAPI = map[string]struct{}{} diff --git a/vendor/modernc.org/libc/langinfo/langinfo_freebsd_amd64.go b/vendor/modernc.org/libc/langinfo/langinfo_freebsd_amd64.go new file mode 100644 index 000000000..5c2d0c628 --- /dev/null +++ b/vendor/modernc.org/libc/langinfo/langinfo_freebsd_amd64.go @@ -0,0 +1,700 @@ +// Code generated by 'ccgo langinfo/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 langinfo/langinfo_freebsd_amd64.go -pkgname langinfo', DO NOT EDIT. + +package langinfo + +import ( + "math" + "reflect" + "sync/atomic" + "unsafe" +) + +var _ = math.Pi +var _ reflect.Kind +var _ atomic.Value +var _ unsafe.Pointer + +const ( + ABDAY_1 = 14 + ABDAY_2 = 15 + ABDAY_3 = 16 + ABDAY_4 = 17 + ABDAY_5 = 18 + ABDAY_6 = 19 + ABDAY_7 = 20 + ABMON_1 = 33 + ABMON_10 = 42 + ABMON_11 = 43 + ABMON_12 = 44 + ABMON_2 = 34 + ABMON_3 = 35 + ABMON_4 = 36 + ABMON_5 = 37 + ABMON_6 = 38 + ABMON_7 = 39 + ABMON_8 = 40 + ABMON_9 = 41 + ALTMON_1 = 58 + ALTMON_10 = 67 + ALTMON_11 = 68 + ALTMON_12 = 69 + ALTMON_2 = 59 + ALTMON_3 = 60 + ALTMON_4 = 61 + ALTMON_5 = 62 + ALTMON_6 = 63 + ALTMON_7 = 64 + ALTMON_8 = 65 + ALTMON_9 = 66 + ALT_DIGITS = 49 + AM_STR = 5 + CODESET = 0 + CRNCYSTR = 56 + DAY_1 = 7 + DAY_2 = 8 + DAY_3 = 9 + DAY_4 = 10 + DAY_5 = 11 + DAY_6 = 12 + DAY_7 = 13 + D_FMT = 2 + D_MD_ORDER = 57 + D_T_FMT = 1 + ERA = 45 + ERA_D_FMT = 46 + ERA_D_T_FMT = 47 + ERA_T_FMT = 48 + MON_1 = 21 + MON_10 = 30 + MON_11 = 31 + MON_12 = 32 + MON_2 = 22 + MON_3 = 23 + MON_4 = 24 + MON_5 = 25 + MON_6 = 26 + MON_7 = 27 + MON_8 = 28 + MON_9 = 29 + NOEXPR = 53 + NOSTR = 55 + PM_STR = 6 + RADIXCHAR = 50 + THOUSEP = 51 + T_FMT = 3 + T_FMT_AMPM = 4 + YESEXPR = 52 + YESSTR = 54 + X_FILE_OFFSET_BITS = 64 + X_LANGINFO_H_ = 0 + X_LOCALE_T_DEFINED = 0 + X_LP64 = 1 + X_MACHINE__LIMITS_H_ = 0 + X_MACHINE__TYPES_H_ = 0 + X_NL_ITEM_DECLARED = 0 + X_Nonnull = 0 + X_Null_unspecified = 0 + X_Nullable = 0 + X_SYS_CDEFS_H_ = 0 + X_SYS__TYPES_H_ = 0 + X_XLOCALE_LANGINFO_H = 0 + Unix = 1 +) + +type Ptrdiff_t = int64 /* <builtin>:3:26 */ + +type Size_t = uint64 /* <builtin>:9:23 */ + +type Wchar_t = int32 /* <builtin>:15:24 */ + +type X__int128_t = struct { + Flo int64 + Fhi int64 +} /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128 +type X__uint128_t = struct { + Flo uint64 + Fhi uint64 +} /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128 + +type X__builtin_va_list = uintptr /* <builtin>:46:14 */ +type X__float128 = float64 /* <builtin>:47:21 */ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2001 Alexey Zelkin <phantom@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// Testing against Clang-specific extensions. + +// This code has been put in place to help reduce the addition of +// compiler specific defines in FreeBSD code. It helps to aid in +// having a compiler-agnostic source tree. + +// Compiler memory barriers, specific to gcc and clang. + +// XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced + +// Macro to test if we're using a specific version of gcc or later. + +// The __CONCAT macro is used to concatenate parts of symbol names, e.g. +// with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. +// The __CONCAT macro is a bit tricky to use if it must work in non-ANSI +// mode -- there must be no spaces between its arguments, and for nested +// __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also +// concatenate double-quoted strings produced by the __STRING macro, but +// this only works with ANSI C. +// +// __XSTRING is like __STRING, but it expands any macros in its argument +// first. It is only available with ANSI C. + +// Compiler-dependent macros to help declare dead (non-returning) and +// pure (no side effects) functions, and unused variables. They are +// null except for versions of gcc that are known to support the features +// properly (old versions of gcc-2 supported the dead and pure features +// in a different (wrong) way). If we do not provide an implementation +// for a given compiler, let the compile fail if it is told to use +// a feature that we cannot live without. + +// Keywords added in C11. + +// Emulation of C11 _Generic(). Unlike the previously defined C11 +// keywords, it is not possible to implement this using exactly the same +// syntax. Therefore implement something similar under the name +// __generic(). Unlike _Generic(), this macro can only distinguish +// between a single type, so it requires nested invocations to +// distinguish multiple cases. + +// C99 Static array indices in function parameter declarations. Syntax such as: +// void bar(int myArray[static 10]); +// is allowed in C99 but not in C++. Define __min_size appropriately so +// headers using it can be compiled in either language. Use like this: +// void bar(int myArray[__min_size(10)]); + +// XXX: should use `#if __STDC_VERSION__ < 199901'. + +// C++11 exposes a load of C99 stuff + +// GCC 2.95 provides `__restrict' as an extension to C90 to support the +// C99-specific `restrict' type qualifier. We happen to use `__restrict' as +// a way to define the `restrict' type qualifier without disturbing older +// software that is unaware of C99 keywords. + +// GNU C version 2.96 adds explicit branch prediction so that +// the CPU back-end can hint the processor and also so that +// code blocks can be reordered such that the predicted path +// sees a more linear flow, thus improving cache behavior, etc. +// +// The following two macros provide us with a way to utilize this +// compiler feature. Use __predict_true() if you expect the expression +// to evaluate to true, and __predict_false() if you expect the +// expression to evaluate to false. +// +// A few notes about usage: +// +// * Generally, __predict_false() error condition checks (unless +// you have some _strong_ reason to do otherwise, in which case +// document it), and/or __predict_true() `no-error' condition +// checks, assuming you want to optimize for the no-error case. +// +// * Other than that, if you don't know the likelihood of a test +// succeeding from empirical or other `hard' evidence, don't +// make predictions. +// +// * These are meant to be used in places that are run `a lot'. +// It is wasteful to make predictions in code that is run +// seldomly (e.g. at subsystem initialization time) as the +// basic block reordering that this affects can often generate +// larger code. + +// We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h> +// require it. + +// Given the pointer x to the member m of the struct s, return +// a pointer to the containing structure. When using GCC, we first +// assign pointer x to a local variable, to check that its type is +// compatible with member m. + +// Compiler-dependent macros to declare that functions take printf-like +// or scanf-like arguments. They are null except for versions of gcc +// that are known to support the features properly (old versions of gcc-2 +// didn't permit keeping the keywords out of the application namespace). + +// Compiler-dependent macros that rely on FreeBSD-specific extensions. + +// Embed the rcs id of a source file in the resulting library. Note that in +// more recent ELF binutils, we use .ident allowing the ID to be stripped. +// Usage: +// __FBSDID("$FreeBSD$"); + +// - +// The following definitions are an extension of the behavior originally +// implemented in <sys/_posix.h>, but with a different level of granularity. +// POSIX.1 requires that the macros we test be defined before any standard +// header file is included. +// +// Here's a quick run-down of the versions: +// defined(_POSIX_SOURCE) 1003.1-1988 +// _POSIX_C_SOURCE == 1 1003.1-1990 +// _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option +// _POSIX_C_SOURCE == 199309 1003.1b-1993 +// _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, +// and the omnibus ISO/IEC 9945-1: 1996 +// _POSIX_C_SOURCE == 200112 1003.1-2001 +// _POSIX_C_SOURCE == 200809 1003.1-2008 +// +// In addition, the X/Open Portability Guide, which is now the Single UNIX +// Specification, defines a feature-test macro which indicates the version of +// that specification, and which subsumes _POSIX_C_SOURCE. +// +// Our macros begin with two underscores to avoid namespace screwage. + +// Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. + +// Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. + +// Deal with various X/Open Portability Guides and Single UNIX Spec. + +// Deal with all versions of POSIX. The ordering relative to the tests above is +// important. +// - +// Deal with _ANSI_SOURCE: +// If it is defined, and no other compilation environment is explicitly +// requested, then define our internal feature-test macros to zero. This +// makes no difference to the preprocessor (undefined symbols in preprocessing +// expressions are defined to have value zero), but makes it more convenient for +// a test program to print out the values. +// +// If a program mistakenly defines _ANSI_SOURCE and some other macro such as +// _POSIX_C_SOURCE, we will assume that it wants the broader compilation +// environment (and in fact we will never get here). + +// User override __EXT1_VISIBLE + +// Old versions of GCC use non-standard ARM arch symbols; acle-compat.h +// translates them to __ARM_ARCH and the modern feature symbols defined by ARM. + +// Nullability qualifiers: currently only supported by Clang. + +// Type Safety Checking +// +// Clang provides additional attributes to enable checking type safety +// properties that cannot be enforced by the C type system. + +// Lock annotations. +// +// Clang provides support for doing basic thread-safety tests at +// compile-time, by marking which locks will/should be held when +// entering/leaving a functions. +// +// Furthermore, it is also possible to annotate variables and structure +// members to enforce that they are only accessed when certain locks are +// held. + +// Structure implements a lock. + +// Function acquires an exclusive or shared lock. + +// Function attempts to acquire an exclusive or shared lock. + +// Function releases a lock. + +// Function asserts that an exclusive or shared lock is held. + +// Function requires that an exclusive or shared lock is or is not held. + +// Function should not be analyzed. + +// Function or variable should not be sanitized, i.e. by AddressSanitizer. +// GCC has the nosanitize attribute, but as a function attribute only, and +// warns on use as a variable attribute. + +// Guard variables and structure members by lock. + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-4-Clause +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// Copyright (c) 1990, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. All advertising materials mentioning features or use of this software +// must display the following acknowledgement: +// This product includes software developed by the University of +// California, Berkeley and its contributors. +// 4. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 +// From: @(#)types.h 8.3 (Berkeley) 1/5/94 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1988, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)limits.h 8.3 (Berkeley) 1/4/94 +// $FreeBSD$ + +// According to ANSI (section 2.2.4.2), the values below must be usable by +// #if preprocessing directives. Additionally, the expression must have the +// same type as would an expression that is an object of the corresponding +// type converted according to the integral promotions. The subtraction for +// INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an +// unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). + +// max value for an unsigned long long + +// Quads and longs are the same on the amd64. Ensure they stay in sync. + +// Minimum signal stack size. + +// Basic types upon which most other types are built. +type X__int8_t = int8 /* _types.h:55:22 */ +type X__uint8_t = uint8 /* _types.h:56:24 */ +type X__int16_t = int16 /* _types.h:57:17 */ +type X__uint16_t = uint16 /* _types.h:58:25 */ +type X__int32_t = int32 /* _types.h:59:15 */ +type X__uint32_t = uint32 /* _types.h:60:23 */ +type X__int64_t = int64 /* _types.h:62:16 */ +type X__uint64_t = uint64 /* _types.h:63:24 */ + +// Standard type definitions. +type X__clock_t = X__int32_t /* _types.h:75:19 */ // clock()... +type X__critical_t = X__int64_t /* _types.h:76:19 */ +type X__double_t = float64 /* _types.h:78:17 */ +type X__float_t = float32 /* _types.h:79:16 */ +type X__intfptr_t = X__int64_t /* _types.h:81:19 */ +type X__intptr_t = X__int64_t /* _types.h:82:19 */ +type X__intmax_t = X__int64_t /* _types.h:93:19 */ +type X__int_fast8_t = X__int32_t /* _types.h:94:19 */ +type X__int_fast16_t = X__int32_t /* _types.h:95:19 */ +type X__int_fast32_t = X__int32_t /* _types.h:96:19 */ +type X__int_fast64_t = X__int64_t /* _types.h:97:19 */ +type X__int_least8_t = X__int8_t /* _types.h:98:18 */ +type X__int_least16_t = X__int16_t /* _types.h:99:19 */ +type X__int_least32_t = X__int32_t /* _types.h:100:19 */ +type X__int_least64_t = X__int64_t /* _types.h:101:19 */ +type X__ptrdiff_t = X__int64_t /* _types.h:103:19 */ // ptr1 - ptr2 +type X__register_t = X__int64_t /* _types.h:104:19 */ +type X__segsz_t = X__int64_t /* _types.h:105:19 */ // segment size (in pages) +type X__size_t = X__uint64_t /* _types.h:106:20 */ // sizeof() +type X__ssize_t = X__int64_t /* _types.h:107:19 */ // byte count or error +type X__time_t = X__int64_t /* _types.h:108:19 */ // time()... +type X__uintfptr_t = X__uint64_t /* _types.h:109:20 */ +type X__uintptr_t = X__uint64_t /* _types.h:110:20 */ +type X__uintmax_t = X__uint64_t /* _types.h:121:20 */ +type X__uint_fast8_t = X__uint32_t /* _types.h:122:20 */ +type X__uint_fast16_t = X__uint32_t /* _types.h:123:20 */ +type X__uint_fast32_t = X__uint32_t /* _types.h:124:20 */ +type X__uint_fast64_t = X__uint64_t /* _types.h:125:20 */ +type X__uint_least8_t = X__uint8_t /* _types.h:126:19 */ +type X__uint_least16_t = X__uint16_t /* _types.h:127:20 */ +type X__uint_least32_t = X__uint32_t /* _types.h:128:20 */ +type X__uint_least64_t = X__uint64_t /* _types.h:129:20 */ +type X__u_register_t = X__uint64_t /* _types.h:131:20 */ +type X__vm_offset_t = X__uint64_t /* _types.h:132:20 */ +type X__vm_paddr_t = X__uint64_t /* _types.h:133:20 */ +type X__vm_size_t = X__uint64_t /* _types.h:134:20 */ +type X___wchar_t = int32 /* _types.h:141:14 */ + +// Standard type definitions. +type X__blksize_t = X__int32_t /* _types.h:40:19 */ // file block size +type X__blkcnt_t = X__int64_t /* _types.h:41:19 */ // file block count +type X__clockid_t = X__int32_t /* _types.h:42:19 */ // clock_gettime()... +type X__fflags_t = X__uint32_t /* _types.h:43:20 */ // file flags +type X__fsblkcnt_t = X__uint64_t /* _types.h:44:20 */ +type X__fsfilcnt_t = X__uint64_t /* _types.h:45:20 */ +type X__gid_t = X__uint32_t /* _types.h:46:20 */ +type X__id_t = X__int64_t /* _types.h:47:19 */ // can hold a gid_t, pid_t, or uid_t +type X__ino_t = X__uint64_t /* _types.h:48:20 */ // inode number +type X__key_t = int64 /* _types.h:49:15 */ // IPC key (for Sys V IPC) +type X__lwpid_t = X__int32_t /* _types.h:50:19 */ // Thread ID (a.k.a. LWP) +type X__mode_t = X__uint16_t /* _types.h:51:20 */ // permissions +type X__accmode_t = int32 /* _types.h:52:14 */ // access permissions +type X__nl_item = int32 /* _types.h:53:14 */ +type X__nlink_t = X__uint64_t /* _types.h:54:20 */ // link count +type X__off_t = X__int64_t /* _types.h:55:19 */ // file offset +type X__off64_t = X__int64_t /* _types.h:56:19 */ // file offset (alias) +type X__pid_t = X__int32_t /* _types.h:57:19 */ // process [group] +type X__rlim_t = X__int64_t /* _types.h:58:19 */ // resource limit - intentionally +// signed, because of legacy code +// that uses -1 for RLIM_INFINITY +type X__sa_family_t = X__uint8_t /* _types.h:61:19 */ +type X__socklen_t = X__uint32_t /* _types.h:62:20 */ +type X__suseconds_t = int64 /* _types.h:63:15 */ // microseconds (signed) +type X__timer_t = uintptr /* _types.h:64:24 */ // timer_gettime()... +type X__mqd_t = uintptr /* _types.h:65:21 */ // mq_open()... +type X__uid_t = X__uint32_t /* _types.h:66:20 */ +type X__useconds_t = uint32 /* _types.h:67:22 */ // microseconds (unsigned) +type X__cpuwhich_t = int32 /* _types.h:68:14 */ // which parameter for cpuset. +type X__cpulevel_t = int32 /* _types.h:69:14 */ // level parameter for cpuset. +type X__cpusetid_t = int32 /* _types.h:70:14 */ // cpuset identifier. +type X__daddr_t = X__int64_t /* _types.h:71:19 */ // bwrite(3), FIOBMAP2, etc + +// Unusual type definitions. +// rune_t is declared to be an ``int'' instead of the more natural +// ``unsigned long'' or ``long''. Two things are happening here. It is not +// unsigned so that EOF (-1) can be naturally assigned to it and used. Also, +// it looks like 10646 will be a 31 bit standard. This means that if your +// ints cannot hold 32 bits, you will be in trouble. The reason an int was +// chosen over a long is that the is*() and to*() routines take ints (says +// ANSI C), but they use __ct_rune_t instead of int. +// +// NOTE: rune_t is not covered by ANSI nor other standards, and should not +// be instantiated outside of lib/libc/locale. Use wchar_t. wint_t and +// rune_t must be the same type. Also, wint_t should be able to hold all +// members of the largest character set plus one extra value (WEOF), and +// must be at least 16 bits. +type X__ct_rune_t = int32 /* _types.h:91:14 */ // arg type for ctype funcs +type X__rune_t = X__ct_rune_t /* _types.h:92:21 */ // rune_t (see above) +type X__wint_t = X__ct_rune_t /* _types.h:93:21 */ // wint_t (see above) + +// Clang already provides these types as built-ins, but only in C++ mode. +type X__char16_t = X__uint_least16_t /* _types.h:97:26 */ +type X__char32_t = X__uint_least32_t /* _types.h:98:26 */ +// In C++11, char16_t and char32_t are built-in types. + +type X__max_align_t = struct { + F__max_align1 int64 + F__max_align2 float64 +} /* _types.h:111:3 */ + +type X__dev_t = X__uint64_t /* _types.h:113:20 */ // device number + +type X__fixpt_t = X__uint32_t /* _types.h:115:20 */ // fixed point number + +// mbstate_t is an opaque object to keep conversion state during multibyte +// stream conversions. +type X__mbstate_t = struct { + _ [0]uint64 + F__mbstate8 [128]int8 +} /* _types.h:124:3 */ + +type X__rman_res_t = X__uintmax_t /* _types.h:126:25 */ + +// Types for varargs. These are all provided by builtin types these +// days, so centralize their definition. +type X__va_list = X__builtin_va_list /* _types.h:133:27 */ // internally known to gcc +type X__gnuc_va_list = X__va_list /* _types.h:140:20 */ // compatibility w/GNU headers + +// When the following macro is defined, the system uses 64-bit inode numbers. +// Programs can use this to avoid including <sys/param.h>, with its associated +// namespace pollution. + +type Nl_item = X__nl_item /* langinfo.h:38:19 */ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2011, 2012 The FreeBSD Foundation +// All rights reserved. +// +// This software was developed by David Chisnall under sponsorship from +// the FreeBSD Foundation. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +type Locale_t = uintptr /* _langinfo.h:39:25 */ + +var _ int8 /* gen.c:2:13: */ diff --git a/vendor/modernc.org/libc/libc32.go b/vendor/modernc.org/libc/libc32.go index e96cdd90d..6364e288b 100644 --- a/vendor/modernc.org/libc/libc32.go +++ b/vendor/modernc.org/libc/libc32.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build 386 || arm // +build 386 arm package libc // import "modernc.org/libc" diff --git a/vendor/modernc.org/libc/libc64.go b/vendor/modernc.org/libc/libc64.go index 6ca31aa7c..2108df070 100644 --- a/vendor/modernc.org/libc/libc64.go +++ b/vendor/modernc.org/libc/libc64.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build amd64 || arm64 || s390x // +build amd64 arm64 s390x package libc // import "modernc.org/libc" diff --git a/vendor/modernc.org/libc/libc_freebsd.go b/vendor/modernc.org/libc/libc_freebsd.go new file mode 100644 index 000000000..9f27366f8 --- /dev/null +++ b/vendor/modernc.org/libc/libc_freebsd.go @@ -0,0 +1,2120 @@ +// Copyright 2020 The Libc Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package libc // import "modernc.org/libc" + +import ( + "bufio" + "fmt" + "io" + "os" + "os/exec" + "path/filepath" + "runtime" + "runtime/debug" + "strconv" + "strings" + "syscall" + gotime "time" + "unsafe" + + "golang.org/x/sys/unix" + "modernc.org/libc/errno" + "modernc.org/libc/fcntl" + "modernc.org/libc/fts" + "modernc.org/libc/grp" + gonetdb "modernc.org/libc/honnef.co/go/netdb" + "modernc.org/libc/langinfo" + "modernc.org/libc/limits" + "modernc.org/libc/netdb" + "modernc.org/libc/netinet/in" + "modernc.org/libc/pwd" + "modernc.org/libc/signal" + "modernc.org/libc/stdio" + "modernc.org/libc/sys/socket" + "modernc.org/libc/sys/stat" + "modernc.org/libc/sys/types" + "modernc.org/libc/termios" + "modernc.org/libc/time" + "modernc.org/libc/unistd" +) + +var ( + in6_addr_any in.In6_addr +) + +type ( + long = int64 + ulong = uint64 +) + +// // Keep these outside of the var block otherwise go generate will miss them. +var X__stderrp = Xstdout +var X__stdinp = Xstdin +var X__stdoutp = Xstdout + +// include/stdio.h:486:extern int __isthreaded; +var X__isthreaded int32 + +// lib/libc/locale/mblocal.h:62: int __mb_sb_limit; +var X__mb_sb_limit int32 = 128 // UTF-8 + +// include/runetype.h:94:extern _Thread_local const _RuneLocale *_ThreadRuneLocale; +var X_ThreadRuneLocale uintptr //TODO initialize and implement _Thread_local semantics. + +// include/xlocale/_ctype.h:54:_RuneLocale *__runes_for_locale(locale_t, int*); +func X__runes_for_locale(t *TLS, l locale_t, p uintptr) uintptr { + panic(todo("")) +} + +type file uintptr + +func (f file) fd() int32 { return int32((*stdio.FILE)(unsafe.Pointer(f)).F_file) } +func (f file) setFd(fd int32) { (*stdio.FILE)(unsafe.Pointer(f)).F_file = int16(fd) } + +func (f file) err() bool { + return (*stdio.FILE)(unsafe.Pointer(f)).F_flags&1 != 0 +} + +func (f file) setErr() { + (*stdio.FILE)(unsafe.Pointer(f)).F_flags |= 1 +} + +func (f file) close(t *TLS) int32 { + r := Xclose(t, f.fd()) + Xfree(t, uintptr(f)) + if r < 0 { + return stdio.EOF + } + + return 0 +} + +func newFile(t *TLS, fd int32) uintptr { + p := Xcalloc(t, 1, types.Size_t(unsafe.Sizeof(stdio.FILE{}))) + if p == 0 { + return 0 + } + file(p).setFd(fd) + return p +} + +func fwrite(fd int32, b []byte) (int, error) { + if fd == unistd.STDOUT_FILENO { + return write(b) + } + + // if dmesgs { + // dmesg("%v: fd %v: %s", origin(1), fd, b) + // } + return unix.Write(int(fd), b) //TODO use Xwrite +} + +// unsigned long ___runetype(__ct_rune_t) __pure; +func X___runetype(t *TLS, x types.X__ct_rune_t) ulong { + panic(todo("")) +} + +// int fprintf(FILE *stream, const char *format, ...); +func Xfprintf(t *TLS, stream, format, args uintptr) int32 { + n, _ := fwrite(int32((*stdio.FILE)(unsafe.Pointer(stream)).F_file), printf(format, args)) + return int32(n) +} + +// int usleep(useconds_t usec); +func Xusleep(t *TLS, usec types.X__useconds_t) int32 { + gotime.Sleep(gotime.Microsecond * gotime.Duration(usec)) + return 0 +} + +// int getrusage(int who, struct rusage *usage); +func Xgetrusage(t *TLS, who int32, usage uintptr) int32 { + if _, _, err := unix.Syscall(unix.SYS_GETRUSAGE, uintptr(who), usage, 0); err != 0 { + t.setErrno(err) + return -1 + } + + return 0 +} + +// char *fgets(char *s, int size, FILE *stream); +func Xfgets(t *TLS, s uintptr, size int32, stream uintptr) uintptr { + fd := int((*stdio.FILE)(unsafe.Pointer(stream)).F_file) + var b []byte + buf := [1]byte{} + for ; size > 0; size-- { + n, err := unix.Read(fd, buf[:]) + if n != 0 { + b = append(b, buf[0]) + if buf[0] == '\n' { + b = append(b, 0) + copy((*RawMem)(unsafe.Pointer(s))[:len(b):len(b)], b) + return s + } + + continue + } + + switch { + case n == 0 && err == nil && len(b) == 0: + return 0 + default: + panic(todo("")) + } + + // if err == nil { + // panic("internal error") + // } + + // if len(b) != 0 { + // b = append(b, 0) + // copy((*RawMem)(unsafe.Pointer(s)[:len(b)]), b) + // return s + // } + + // t.setErrno(err) + } + panic(todo("")) +} + +// int lstat(const char *pathname, struct stat *statbuf); +func Xlstat(t *TLS, pathname, statbuf uintptr) int32 { + return Xlstat64(t, pathname, statbuf) +} + +// int stat(const char *pathname, struct stat *statbuf); +func Xstat(t *TLS, pathname, statbuf uintptr) int32 { + return Xstat64(t, pathname, statbuf) +} + +// int chdir(const char *path); +func Xchdir(t *TLS, path uintptr) int32 { + if _, _, err := unix.Syscall(unix.SYS_CHDIR, path, 0, 0); err != 0 { + t.setErrno(err) + return -1 + } + + // if dmesgs { + // dmesg("%v: %q: ok", origin(1), GoString(path)) + // } + return 0 +} + +var localtime time.Tm + +// struct tm *localtime(const time_t *timep); +func Xlocaltime(_ *TLS, timep uintptr) uintptr { + loc := gotime.Local + if r := getenv(Environ(), "TZ"); r != 0 { + zone, off := parseZone(GoString(r)) + loc = gotime.FixedZone(zone, -off) + } + ut := *(*time.Time_t)(unsafe.Pointer(timep)) + t := gotime.Unix(int64(ut), 0).In(loc) + localtime.Ftm_sec = int32(t.Second()) + localtime.Ftm_min = int32(t.Minute()) + localtime.Ftm_hour = int32(t.Hour()) + localtime.Ftm_mday = int32(t.Day()) + localtime.Ftm_mon = int32(t.Month() - 1) + localtime.Ftm_year = int32(t.Year() - 1900) + localtime.Ftm_wday = int32(t.Weekday()) + localtime.Ftm_yday = int32(t.YearDay()) + localtime.Ftm_isdst = Bool32(isTimeDST(t)) + return uintptr(unsafe.Pointer(&localtime)) +} + +// struct tm *localtime_r(const time_t *timep, struct tm *result); +func Xlocaltime_r(_ *TLS, timep, result uintptr) uintptr { + panic(todo("")) +} + +// int open(const char *pathname, int flags, ...); +func Xopen(t *TLS, pathname uintptr, flags int32, args uintptr) int32 { + return Xopen64(t, pathname, flags, args) +} + +// int open(const char *pathname, int flags, ...); +func Xopen64(t *TLS, pathname uintptr, flags int32, args uintptr) int32 { + var mode types.Mode_t + if args != 0 { + mode = *(*types.Mode_t)(unsafe.Pointer(args)) + } + fdcwd := fcntl.AT_FDCWD + n, _, err := unix.Syscall6(unix.SYS_OPENAT, uintptr(fdcwd), pathname, uintptr(flags), uintptr(mode), 0, 0) + if err != 0 { + // if dmesgs { + // dmesg("%v: %q %#x: %v", origin(1), GoString(pathname), flags, err) + // } + t.setErrno(err) + return -1 + } + + // if dmesgs { + // dmesg("%v: %q flags %#x mode %#o: fd %v", origin(1), GoString(pathname), flags, mode, n) + // } + return int32(n) +} + +// off_t lseek(int fd, off_t offset, int whence); +func Xlseek(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + return types.Off_t(Xlseek64(t, fd, offset, whence)) +} + +func whenceStr(whence int32) string { + panic(todo("")) +} + +var fsyncStatbuf stat.Stat + +// int fsync(int fd); +func Xfsync(t *TLS, fd int32) int32 { + if noFsync { + // Simulate -DSQLITE_NO_SYNC for sqlite3 testfixture, see function full_sync in sqlite3.c + return Xfstat(t, fd, uintptr(unsafe.Pointer(&fsyncStatbuf))) + } + + if _, _, err := unix.Syscall(unix.SYS_FSYNC, uintptr(fd), 0, 0); err != 0 { + t.setErrno(err) + return -1 + } + + // if dmesgs { + // dmesg("%v: %d: ok", origin(1), fd) + // } + return 0 +} + +// long sysconf(int name); +func Xsysconf(t *TLS, name int32) long { + switch name { + case unistd.X_SC_PAGESIZE: + return long(unix.Getpagesize()) + case unistd.X_SC_GETPW_R_SIZE_MAX: + return -1 + case unistd.X_SC_GETGR_R_SIZE_MAX: + return -1 + } + + panic(todo("", name)) +} + +// int close(int fd); +func Xclose(t *TLS, fd int32) int32 { + if _, _, err := unix.Syscall(unix.SYS_CLOSE, uintptr(fd), 0, 0); err != 0 { + t.setErrno(err) + return -1 + } + + // if dmesgs { + // dmesg("%v: %d: ok", origin(1), fd) + // } + return 0 +} + +// char *getcwd(char *buf, size_t size); +func Xgetcwd(t *TLS, buf uintptr, size types.Size_t) uintptr { + if _, err := unix.Getcwd((*RawMem)(unsafe.Pointer(buf))[:size:size]); err != nil { + if dmesgs { + dmesg("%v: %v FAIL", origin(1), err) + } + t.setErrno(err) + return 0 + } + + if dmesgs { + dmesg("%v: ok", origin(1)) + } + return buf +} + +// int fstat(int fd, struct stat *statbuf); +func Xfstat(t *TLS, fd int32, statbuf uintptr) int32 { + return Xfstat64(t, fd, statbuf) +} + +// int ftruncate(int fd, off_t length); +func Xftruncate(t *TLS, fd int32, length types.Off_t) int32 { + if err := unix.Ftruncate(int(fd), int64(length)); err != nil { + if dmesgs { + dmesg("%v: fd %d: %v FAIL", origin(1), fd, err) + } + t.setErrno(err) + return -1 + } + + if dmesgs { + dmesg("%v: %d %#x: ok", origin(1), fd, length) + } + return 0 +} + +// int fcntl(int fd, int cmd, ... /* arg */ ); +func Xfcntl(t *TLS, fd, cmd int32, args uintptr) int32 { + return Xfcntl64(t, fd, cmd, args) +} + +// ssize_t read(int fd, void *buf, size_t count); +func Xread(t *TLS, fd int32, buf uintptr, count types.Size_t) types.Ssize_t { + n, _, err := unix.Syscall(unix.SYS_READ, uintptr(fd), buf, uintptr(count)) + if err != 0 { + t.setErrno(err) + return -1 + } + + // if dmesgs { + // // dmesg("%v: %d %#x: %#x\n%s", origin(1), fd, count, n, hex.Dump(GoBytes(buf, int(n)))) + // dmesg("%v: %d %#x: %#x", origin(1), fd, count, n) + // } + return types.Ssize_t(n) +} + +// ssize_t write(int fd, const void *buf, size_t count); +func Xwrite(t *TLS, fd int32, buf uintptr, count types.Size_t) types.Ssize_t { + const retry = 5 + var err syscall.Errno + for i := 0; i < retry; i++ { + var n uintptr + switch n, _, err = unix.Syscall(unix.SYS_WRITE, uintptr(fd), buf, uintptr(count)); err { + case 0: + // if dmesgs { + // // dmesg("%v: %d %#x: %#x\n%s", origin(1), fd, count, n, hex.Dump(GoBytes(buf, int(n)))) + // dmesg("%v: %d %#x: %#x", origin(1), fd, count, n) + // } + return types.Ssize_t(n) + case errno.EAGAIN: + // nop + } + } + + // if dmesgs { + // dmesg("%v: fd %v, count %#x: %v", origin(1), fd, count, err) + // } + t.setErrno(err) + return -1 +} + +// int fchmod(int fd, mode_t mode); +func Xfchmod(t *TLS, fd int32, mode types.Mode_t) int32 { + if _, _, err := unix.Syscall(unix.SYS_FCHMOD, uintptr(fd), uintptr(mode), 0); err != 0 { + t.setErrno(err) + return -1 + } + + // if dmesgs { + // dmesg("%v: %d %#o: ok", origin(1), fd, mode) + // } + return 0 +} + +// int fchown(int fd, uid_t owner, gid_t group); +func Xfchown(t *TLS, fd int32, owner types.Uid_t, group types.Gid_t) int32 { + if _, _, err := unix.Syscall(unix.SYS_FCHOWN, uintptr(fd), uintptr(owner), uintptr(group)); err != 0 { + t.setErrno(err) + return -1 + } + + return 0 +} + +// uid_t geteuid(void); +func Xgeteuid(t *TLS) types.Uid_t { + n, _, _ := unix.Syscall(unix.SYS_GETEUID, 0, 0, 0) + return types.Uid_t(n) +} + +// int munmap(void *addr, size_t length); +func Xmunmap(t *TLS, addr uintptr, length types.Size_t) int32 { + if _, _, err := unix.Syscall(unix.SYS_MUNMAP, addr, uintptr(length), 0); err != 0 { + t.setErrno(err) + return -1 + } + + return 0 +} + +// int gettimeofday(struct timeval *tv, struct timezone *tz); +func Xgettimeofday(t *TLS, tv, tz uintptr) int32 { + if tz != 0 { + panic(todo("")) + } + + var tvs unix.Timeval + err := unix.Gettimeofday(&tvs) + if err != nil { + t.setErrno(err) + return -1 + } + + *(*unix.Timeval)(unsafe.Pointer(tv)) = tvs + return 0 +} + +// int getsockopt(int sockfd, int level, int optname, void *optval, socklen_t *optlen); +func Xgetsockopt(t *TLS, sockfd, level, optname int32, optval, optlen uintptr) int32 { + if _, _, err := unix.Syscall6(unix.SYS_GETSOCKOPT, uintptr(sockfd), uintptr(level), uintptr(optname), optval, optlen, 0); err != 0 { + t.setErrno(err) + return -1 + } + + return 0 +} + +// int setsockopt(int sockfd, int level, int optname, const void *optval, socklen_t optlen); +func Xsetsockopt(t *TLS, sockfd, level, optname int32, optval uintptr, optlen socket.Socklen_t) int32 { + if _, _, err := unix.Syscall6(unix.SYS_SETSOCKOPT, uintptr(sockfd), uintptr(level), uintptr(optname), optval, uintptr(optlen), 0); err != 0 { + t.setErrno(err) + return -1 + } + + return 0 +} + +// int ioctl(int fd, unsigned long request, ...); +func Xioctl(t *TLS, fd int32, request ulong, va uintptr) int32 { + var argp uintptr + if va != 0 { + argp = VaUintptr(&va) + } + n, _, err := unix.Syscall(unix.SYS_IOCTL, uintptr(fd), uintptr(request), argp) + if err != 0 { + t.setErrno(err) + return -1 + } + + return int32(n) +} + +// int getsockname(int sockfd, struct sockaddr *addr, socklen_t *addrlen); +func Xgetsockname(t *TLS, sockfd int32, addr, addrlen uintptr) int32 { + if _, _, err := unix.Syscall(unix.SYS_GETSOCKNAME, uintptr(sockfd), addr, addrlen); err != 0 { + // if dmesgs { + // dmesg("%v: fd %v: %v", origin(1), sockfd, err) + // } + t.setErrno(err) + return -1 + } + + return 0 +} + +// int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); +func Xselect(t *TLS, nfds int32, readfds, writefds, exceptfds, timeout uintptr) int32 { + n, err := unix.Select( + int(nfds), + (*unix.FdSet)(unsafe.Pointer(readfds)), + (*unix.FdSet)(unsafe.Pointer(writefds)), + (*unix.FdSet)(unsafe.Pointer(exceptfds)), + (*unix.Timeval)(unsafe.Pointer(timeout)), + ) + if err != nil { + t.setErrno(err) + return -1 + } + + return int32(n) +} + +// int mkfifo(const char *pathname, mode_t mode); +func Xmkfifo(t *TLS, pathname uintptr, mode types.Mode_t) int32 { + panic(todo("")) +} + +// mode_t umask(mode_t mask); +func Xumask(t *TLS, mask types.Mode_t) types.Mode_t { + n, _, _ := unix.Syscall(unix.SYS_UMASK, uintptr(mask), 0, 0) + return types.Mode_t(n) +} + +// int execvp(const char *file, char *const argv[]); +func Xexecvp(t *TLS, file, argv uintptr) int32 { + if _, _, err := unix.Syscall(unix.SYS_EXECVE, file, argv, Environ()); err != 0 { + t.setErrno(err) + return -1 + } + + return 0 +} + +// pid_t waitpid(pid_t pid, int *wstatus, int options); +func Xwaitpid(t *TLS, pid types.Pid_t, wstatus uintptr, optname int32) types.Pid_t { + n, _, err := unix.Syscall6(unix.SYS_WAIT4, uintptr(pid), wstatus, uintptr(optname), 0, 0, 0) + if err != 0 { + t.setErrno(err) + return -1 + } + + return types.Pid_t(n) +} + +// int uname(struct utsname *buf); +func Xuname(t *TLS, buf uintptr) int32 { + if err := unix.Uname((*unix.Utsname)(unsafe.Pointer(buf))); err != nil { + if dmesgs { + dmesg("%v: %v FAIL", origin(1), err) + } + t.setErrno(err) + return -1 + } + + if dmesgs { + dmesg("%v: ok", origin(1)) + } + return 0 +} + +// ssize_t recv(int sockfd, void *buf, size_t len, int flags); +func Xrecv(t *TLS, sockfd int32, buf uintptr, len types.Size_t, flags int32) types.Ssize_t { + n, _, err := unix.Syscall6(unix.SYS_RECVFROM, uintptr(sockfd), buf, uintptr(len), uintptr(flags), 0, 0) + if err != 0 { + t.setErrno(err) + return -1 + } + + return types.Ssize_t(n) +} + +// ssize_t send(int sockfd, const void *buf, size_t len, int flags); +func Xsend(t *TLS, sockfd int32, buf uintptr, len types.Size_t, flags int32) types.Ssize_t { + n, _, err := unix.Syscall6(unix.SYS_SENDTO, uintptr(sockfd), buf, uintptr(len), uintptr(flags), 0, 0) + if err != 0 { + t.setErrno(err) + return -1 + } + + return types.Ssize_t(n) +} + +// int shutdown(int sockfd, int how); +func Xshutdown(t *TLS, sockfd, how int32) int32 { + if _, _, err := unix.Syscall(unix.SYS_SHUTDOWN, uintptr(sockfd), uintptr(how), 0); err != 0 { + t.setErrno(err) + return -1 + } + + return 0 +} + +// int getpeername(int sockfd, struct sockaddr *addr, socklen_t *addrlen); +func Xgetpeername(t *TLS, sockfd int32, addr uintptr, addrlen uintptr) int32 { + if _, _, err := unix.Syscall(unix.SYS_GETPEERNAME, uintptr(sockfd), addr, uintptr(addrlen)); err != 0 { + t.setErrno(err) + return -1 + } + + return 0 +} + +// int socket(int domain, int type, int protocol); +func Xsocket(t *TLS, domain, type1, protocol int32) int32 { + n, _, err := unix.Syscall(unix.SYS_SOCKET, uintptr(domain), uintptr(type1), uintptr(protocol)) + if err != 0 { + t.setErrno(err) + return -1 + } + + return int32(n) +} + +// int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen); +func Xbind(t *TLS, sockfd int32, addr uintptr, addrlen uint32) int32 { + n, _, err := unix.Syscall(unix.SYS_BIND, uintptr(sockfd), addr, uintptr(addrlen)) + if err != 0 { + t.setErrno(err) + return -1 + } + + return int32(n) +} + +// int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen); +func Xconnect(t *TLS, sockfd int32, addr uintptr, addrlen uint32) int32 { + if _, _, err := unix.Syscall(unix.SYS_CONNECT, uintptr(sockfd), addr, uintptr(addrlen)); err != 0 { + t.setErrno(err) + return -1 + } + + return 0 +} + +// int listen(int sockfd, int backlog); +func Xlisten(t *TLS, sockfd, backlog int32) int32 { + if _, _, err := unix.Syscall(unix.SYS_LISTEN, uintptr(sockfd), uintptr(backlog), 0); err != 0 { + t.setErrno(err) + return -1 + } + + return 0 +} + +// int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen); +func Xaccept(t *TLS, sockfd int32, addr uintptr, addrlen uintptr) int32 { + n, _, err := unix.Syscall6(unix.SYS_ACCEPT4, uintptr(sockfd), addr, uintptr(addrlen), 0, 0, 0) + if err != 0 { + t.setErrno(err) + return -1 + } + + return int32(n) +} + +// int getrlimit(int resource, struct rlimit *rlim); +func Xgetrlimit(t *TLS, resource int32, rlim uintptr) int32 { + return Xgetrlimit64(t, resource, rlim) +} + +// int setrlimit(int resource, const struct rlimit *rlim); +func Xsetrlimit(t *TLS, resource int32, rlim uintptr) int32 { + return Xsetrlimit64(t, resource, rlim) +} + +// int setrlimit(int resource, const struct rlimit *rlim); +func Xsetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if _, _, err := unix.Syscall(unix.SYS_SETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { + t.setErrno(err) + return -1 + } + + return 0 +} + +// uid_t getuid(void); +func Xgetuid(t *TLS) types.Uid_t { + return types.Uid_t(os.Getuid()) +} + +// pid_t getpid(void); +func Xgetpid(t *TLS) int32 { + return int32(os.Getpid()) +} + +// int system(const char *command); +func Xsystem(t *TLS, command uintptr) int32 { + s := GoString(command) + if command == 0 { + panic(todo("")) + } + + cmd := exec.Command("sh", "-c", s) + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + err := cmd.Run() + if err != nil { + ps := err.(*exec.ExitError) + return int32(ps.ExitCode()) + } + + return 0 +} + +var staticGetpwuid pwd.Passwd + +func init() { + atExit = append(atExit, func() { closePasswd(&staticGetpwuid) }) +} + +func closePasswd(p *pwd.Passwd) { + Xfree(nil, p.Fpw_name) + Xfree(nil, p.Fpw_passwd) + Xfree(nil, p.Fpw_gecos) + Xfree(nil, p.Fpw_dir) + Xfree(nil, p.Fpw_shell) + *p = pwd.Passwd{} +} + +// struct passwd *getpwuid(uid_t uid); +func Xgetpwuid(t *TLS, uid uint32) uintptr { + f, err := os.Open("/etc/passwd") + if err != nil { + panic(todo("", err)) + } + + defer f.Close() + + sid := strconv.Itoa(int(uid)) + sc := bufio.NewScanner(f) + for sc.Scan() { + // eg. "root:x:0:0:root:/root:/bin/bash" + s := sc.Text() + if strings.HasPrefix(s, "#") { + continue + } + + a := strings.Split(s, ":") + if len(a) < 7 { + panic(todo("%q", s)) + } + + if a[2] == sid { + uid, err := strconv.Atoi(a[2]) + if err != nil { + panic(todo("")) + } + + gid, err := strconv.Atoi(a[3]) + if err != nil { + panic(todo("")) + } + + closePasswd(&staticGetpwuid) + gecos := a[4] + if strings.Contains(gecos, ",") { + a := strings.Split(gecos, ",") + gecos = a[0] + } + initPasswd(t, &staticGetpwuid, a[0], a[1], uint32(uid), uint32(gid), gecos, a[5], a[6]) + return uintptr(unsafe.Pointer(&staticGetpwuid)) + } + } + + if sc.Err() != nil { + panic(todo("")) + } + + return 0 +} + +func initPasswd(t *TLS, p *pwd.Passwd, name, pwd string, uid, gid uint32, gecos, dir, shell string) { + p.Fpw_name = cString(t, name) + p.Fpw_passwd = cString(t, pwd) + p.Fpw_uid = uid + p.Fpw_gid = gid + p.Fpw_gecos = cString(t, gecos) + p.Fpw_dir = cString(t, dir) + p.Fpw_shell = cString(t, shell) +} + +func initPasswd2(t *TLS, buf uintptr, buflen types.Size_t, p *pwd.Passwd, name, pwd string, uid, gid uint32, gecos, dir, shell string) bool { + p.Fpw_name, buf, buflen = bufString(buf, buflen, name) + if buf == 0 { + return false + } + + p.Fpw_passwd, buf, buflen = bufString(buf, buflen, pwd) + if buf == 0 { + return false + } + + p.Fpw_uid = uid + p.Fpw_gid = gid + if buf == 0 { + return false + } + + p.Fpw_gecos, buf, buflen = bufString(buf, buflen, gecos) + if buf == 0 { + return false + } + + p.Fpw_dir, buf, buflen = bufString(buf, buflen, dir) + if buf == 0 { + return false + } + + p.Fpw_shell, buf, buflen = bufString(buf, buflen, shell) + if buf == 0 { + return false + } + + return true +} + +func bufString(buf uintptr, buflen types.Size_t, s string) (uintptr, uintptr, types.Size_t) { + buf0 := buf + rq := len(s) + 1 + if rq > int(buflen) { + return 0, 0, 0 + } + + copy((*RawMem)(unsafe.Pointer(buf))[:len(s):len(s)], s) + buf += uintptr(len(s)) + *(*byte)(unsafe.Pointer(buf)) = 0 + return buf0, buf + 1, buflen - types.Size_t(rq) +} + +// int getpwuid_r(uid_t uid, struct passwd *pwd, char *buf, size_t buflen, struct passwd **result); +func Xgetpwuid_r(t *TLS, uid types.Uid_t, cpwd, buf uintptr, buflen types.Size_t, result uintptr) int32 { + f, err := os.Open("/etc/passwd") + if err != nil { + panic(todo("", err)) + } + + defer f.Close() + + sid := strconv.Itoa(int(uid)) + sc := bufio.NewScanner(f) + for sc.Scan() { + // eg. "root:x:0:0:root:/root:/bin/bash" + a := strings.Split(sc.Text(), ":") + if len(a) < 7 { + panic(todo("")) + } + + if a[2] == sid { + uid, err := strconv.Atoi(a[2]) + if err != nil { + panic(todo("")) + } + + gid, err := strconv.Atoi(a[3]) + if err != nil { + panic(todo("")) + } + + gecos := a[4] + if strings.Contains(gecos, ",") { + a := strings.Split(gecos, ",") + gecos = a[0] + } + var v pwd.Passwd + if initPasswd2(t, buf, buflen, &v, a[0], a[1], uint32(uid), uint32(gid), gecos, a[5], a[6]) { + *(*pwd.Passwd)(unsafe.Pointer(cpwd)) = v + *(*uintptr)(unsafe.Pointer(result)) = cpwd + return 0 + } + + *(*uintptr)(unsafe.Pointer(result)) = 0 + return errno.ERANGE + } + } + + if sc.Err() != nil { + panic(todo("")) + } + + *(*uintptr)(unsafe.Pointer(result)) = 0 + return 0 +} + +// struct passwd *getpwnam(const char *name); +func Xgetpwnam(t *TLS, name uintptr) uintptr { + f, err := os.Open("/etc/passwd") + if err != nil { + panic(todo("", err)) + } + + defer f.Close() + + sname := GoString(name) + sc := bufio.NewScanner(f) + for sc.Scan() { + // eg. "root:x:0:0:root:/root:/bin/bash" + a := strings.Split(sc.Text(), ":") + if len(a) < 7 { + panic(todo("")) + } + + if a[0] == sname { + uid, err := strconv.Atoi(a[2]) + if err != nil { + panic(todo("")) + } + + gid, err := strconv.Atoi(a[3]) + if err != nil { + panic(todo("")) + } + + closePasswd(&staticGetpwnam) + gecos := a[4] + if strings.Contains(gecos, ",") { + a := strings.Split(gecos, ",") + gecos = a[0] + } + initPasswd(t, &staticGetpwnam, a[0], a[1], uint32(uid), uint32(gid), gecos, a[5], a[6]) + return uintptr(unsafe.Pointer(&staticGetpwnam)) + } + } + + if sc.Err() != nil { + panic(todo("")) + } + + return 0 +} + +// int getpwnam_r(char *name, struct passwd *pwd, char *buf, size_t buflen, struct passwd **result); +func Xgetpwnam_r(t *TLS, name, cpwd, buf uintptr, buflen types.Size_t, result uintptr) int32 { + f, err := os.Open("/etc/passwd") + if err != nil { + panic(todo("", err)) + } + + defer f.Close() + + sname := GoString(name) + sc := bufio.NewScanner(f) + for sc.Scan() { + // eg. "root:x:0:0:root:/root:/bin/bash" + a := strings.Split(sc.Text(), ":") + if len(a) < 7 { + panic(todo("")) + } + + if a[0] == sname { + uid, err := strconv.Atoi(a[2]) + if err != nil { + panic(todo("")) + } + + gid, err := strconv.Atoi(a[3]) + if err != nil { + panic(todo("")) + } + + gecos := a[4] + if strings.Contains(gecos, ",") { + a := strings.Split(gecos, ",") + gecos = a[0] + } + var v pwd.Passwd + if initPasswd2(t, buf, buflen, &v, a[0], a[1], uint32(uid), uint32(gid), gecos, a[5], a[6]) { + *(*pwd.Passwd)(unsafe.Pointer(cpwd)) = v + *(*uintptr)(unsafe.Pointer(result)) = cpwd + return 0 + } + + *(*uintptr)(unsafe.Pointer(result)) = 0 + return errno.ERANGE + } + } + + if sc.Err() != nil { + panic(todo("")) + } + + *(*uintptr)(unsafe.Pointer(result)) = 0 + return 0 +} + +// int setvbuf(FILE *stream, char *buf, int mode, size_t size); +func Xsetvbuf(t *TLS, stream, buf uintptr, mode int32, size types.Size_t) int32 { + return 0 //TODO +} + +// int raise(int sig); +func Xraise(t *TLS, sig int32) int32 { + panic(todo("")) +} + +// int backtrace(void **buffer, int size); +func Xbacktrace(t *TLS, buf uintptr, size int32) int32 { + panic(todo("")) +} + +// void backtrace_symbols_fd(void *const *buffer, int size, int fd); +func Xbacktrace_symbols_fd(t *TLS, buffer uintptr, size, fd int32) { + panic(todo("")) +} + +// int fileno(FILE *stream); +func Xfileno(t *TLS, stream uintptr) int32 { + panic(todo("")) +} + +var staticGetpwnam pwd.Passwd + +func init() { + atExit = append(atExit, func() { closePasswd(&staticGetpwnam) }) +} + +var staticGetgrnam grp.Group + +func init() { + atExit = append(atExit, func() { closeGroup(&staticGetgrnam) }) +} + +// struct group *getgrnam(const char *name); +func Xgetgrnam(t *TLS, name uintptr) uintptr { + f, err := os.Open("/etc/group") + if err != nil { + panic(todo("")) + } + + defer f.Close() + + sname := GoString(name) + sc := bufio.NewScanner(f) + for sc.Scan() { + // eg. "root:x:0:" + a := strings.Split(sc.Text(), ":") + if len(a) < 4 { + panic(todo("")) + } + + if a[0] == sname { + closeGroup(&staticGetgrnam) + gid, err := strconv.Atoi(a[2]) + if err != nil { + panic(todo("")) + } + + var names []string + if a[3] != "" { + names = strings.Split(a[3], ",") + } + initGroup(t, &staticGetgrnam, a[0], a[1], uint32(gid), names) + return uintptr(unsafe.Pointer(&staticGetgrnam)) + } + } + + if sc.Err() != nil { + panic(todo("")) + } + + return 0 +} + +// int getgrnam_r(const char *name, struct group *grp, char *buf, size_t buflen, struct group **result); +func Xgetgrnam_r(t *TLS, name, pGrp, buf uintptr, buflen types.Size_t, result uintptr) int32 { + f, err := os.Open("/etc/group") + if err != nil { + panic(todo("")) + } + + defer f.Close() + + sname := GoString(name) + sc := bufio.NewScanner(f) + for sc.Scan() { + // eg. "root:x:0:" + a := strings.Split(sc.Text(), ":") + if len(a) < 4 { + panic(todo("")) + } + + if a[0] == sname { + gid, err := strconv.Atoi(a[2]) + if err != nil { + panic(todo("")) + } + + var names []string + if a[3] != "" { + names = strings.Split(a[3], ",") + } + var x grp.Group + if initGroup2(buf, buflen, &x, a[0], a[1], uint32(gid), names) { + *(*grp.Group)(unsafe.Pointer(pGrp)) = x + *(*uintptr)(unsafe.Pointer(result)) = pGrp + return 0 + } + + *(*uintptr)(unsafe.Pointer(result)) = 0 + return 0 + } + } + + if sc.Err() != nil { + panic(todo("")) + } + + *(*uintptr)(unsafe.Pointer(result)) = 0 + return 0 +} + +func closeGroup(p *grp.Group) { + Xfree(nil, p.Fgr_name) + Xfree(nil, p.Fgr_passwd) + if p := p.Fgr_mem; p != 0 { + for { + q := *(*uintptr)(unsafe.Pointer(p)) + if q == 0 { + break + } + + Xfree(nil, q) + p += unsafe.Sizeof(uintptr(0)) + } + } + *p = grp.Group{} +} + +func initGroup(t *TLS, p *grp.Group, name, pwd string, gid uint32, names []string) { + p.Fgr_name = cString(t, name) + p.Fgr_passwd = cString(t, pwd) + p.Fgr_gid = gid + a := Xcalloc(t, 1, types.Size_t(unsafe.Sizeof(uintptr(0)))*types.Size_t((len(names)+1))) + if a == 0 { + panic("OOM") + } + + for p := a; len(names) != 0; p += unsafe.Sizeof(uintptr(0)) { + *(*uintptr)(unsafe.Pointer(p)) = cString(t, names[0]) + names = names[1:] + } + p.Fgr_mem = a +} + +func initGroup2(buf uintptr, buflen types.Size_t, p *grp.Group, name, pwd string, gid uint32, names []string) bool { + p.Fgr_name, buf, buflen = bufString(buf, buflen, name) + if buf == 0 { + return false + } + + p.Fgr_passwd, buf, buflen = bufString(buf, buflen, pwd) + if buf == 0 { + return false + } + + p.Fgr_gid = gid + rq := unsafe.Sizeof(uintptr(0)) * uintptr(len(names)+1) + if rq > uintptr(buflen) { + return false + } + + a := buf + buf += rq + for ; len(names) != 0; buf += unsafe.Sizeof(uintptr(0)) { + if len(names[0])+1 > int(buflen) { + return false + } + + *(*uintptr)(unsafe.Pointer(buf)), buf, buflen = bufString(buf, buflen, names[0]) + names = names[1:] + } + *(*uintptr)(unsafe.Pointer(buf)) = 0 + p.Fgr_mem = a + return true +} + +func init() { + atExit = append(atExit, func() { closeGroup(&staticGetgrgid) }) +} + +var staticGetgrgid grp.Group + +// struct group *getgrgid(gid_t gid); +func Xgetgrgid(t *TLS, gid uint32) uintptr { + f, err := os.Open("/etc/group") + if err != nil { + panic(todo("")) + } + + defer f.Close() + + sid := strconv.Itoa(int(gid)) + sc := bufio.NewScanner(f) + for sc.Scan() { + // eg. "root:x:0:" + a := strings.Split(sc.Text(), ":") + if len(a) < 4 { + panic(todo("")) + } + + if a[2] == sid { + closeGroup(&staticGetgrgid) + var names []string + if a[3] != "" { + names = strings.Split(a[3], ",") + } + initGroup(t, &staticGetgrgid, a[0], a[1], gid, names) + return uintptr(unsafe.Pointer(&staticGetgrgid)) + } + } + + if sc.Err() != nil { + panic(todo("")) + } + + return 0 +} + +// int getgrgid_r(gid_t gid, struct group *grp, char *buf, size_t buflen, struct group **result); +func Xgetgrgid_r(t *TLS, gid uint32, pGrp, buf uintptr, buflen types.Size_t, result uintptr) int32 { + f, err := os.Open("/etc/group") + if err != nil { + panic(todo("")) + } + + defer f.Close() + + sid := strconv.Itoa(int(gid)) + sc := bufio.NewScanner(f) + for sc.Scan() { + // eg. "root:x:0:" + a := strings.Split(sc.Text(), ":") + if len(a) < 4 { + panic(todo("")) + } + + if a[2] == sid { + var names []string + if a[3] != "" { + names = strings.Split(a[3], ",") + } + var x grp.Group + if initGroup2(buf, buflen, &x, a[0], a[1], gid, names) { + *(*grp.Group)(unsafe.Pointer(pGrp)) = x + *(*uintptr)(unsafe.Pointer(result)) = pGrp + return 0 + } + + *(*uintptr)(unsafe.Pointer(result)) = 0 + return 0 + } + } + + if sc.Err() != nil { + panic(todo("")) + } + + *(*uintptr)(unsafe.Pointer(result)) = 0 + return 0 +} + +// int mkstemps(char *template, int suffixlen); +func Xmkstemps(t *TLS, template uintptr, suffixlen int32) int32 { + return Xmkstemps64(t, template, suffixlen) +} + +// int mkstemps(char *template, int suffixlen); +func Xmkstemps64(t *TLS, template uintptr, suffixlen int32) int32 { + len := uintptr(Xstrlen(t, template)) + x := template + uintptr(len-6) - uintptr(suffixlen) + for i := uintptr(0); i < 6; i++ { + if *(*byte)(unsafe.Pointer(x + i)) != 'X' { + if dmesgs { + dmesg("%v: FAIL", origin(1)) + } + t.setErrno(errno.EINVAL) + return -1 + } + } + + fd, err := tempFile(template, x) + if err != nil { + if dmesgs { + dmesg("%v: %v FAIL", origin(1), err) + } + t.setErrno(err) + return -1 + } + + return int32(fd) +} + +// int mkstemp(char *template); +func Xmkstemp(t *TLS, template uintptr) int32 { + return Xmkstemp64(t, template) +} + +// int mkstemp(char *template); +func Xmkstemp64(t *TLS, template uintptr) int32 { + return Xmkstemps64(t, template, 0) +} + +func newFtsent(t *TLS, info int, path string, stat *unix.Stat_t, err syscall.Errno) (r *fts.FTSENT) { + var statp uintptr + if stat != nil { + statp = Xmalloc(t, types.Size_t(unsafe.Sizeof(unix.Stat_t{}))) + if statp == 0 { + panic("OOM") + } + + *(*unix.Stat_t)(unsafe.Pointer(statp)) = *stat + } + csp, errx := CString(path) + if errx != nil { + panic("OOM") + } + + return &fts.FTSENT{ + Ffts_info: int32(info), + Ffts_path: csp, + Ffts_pathlen: uint64(len(path)), + Ffts_statp: statp, + Ffts_errno: int32(err), + } +} + +func newCFtsent(t *TLS, info int, path string, stat *unix.Stat_t, err syscall.Errno) uintptr { + p := Xcalloc(t, 1, types.Size_t(unsafe.Sizeof(fts.FTSENT{}))) + if p == 0 { + panic("OOM") + } + + *(*fts.FTSENT)(unsafe.Pointer(p)) = *newFtsent(t, info, path, stat, err) + return p +} + +func ftsentClose(t *TLS, p uintptr) { + Xfree(t, (*fts.FTSENT)(unsafe.Pointer(p)).Ffts_path) + Xfree(t, (*fts.FTSENT)(unsafe.Pointer(p)).Ffts_statp) +} + +type ftstream struct { + s []uintptr + x int +} + +func (f *ftstream) close(t *TLS) { + for _, p := range f.s { + ftsentClose(t, p) + Xfree(t, p) + } + *f = ftstream{} +} + +// FTS *fts_open(char * const *path_argv, int options, int (*compar)(const FTSENT **, const FTSENT **)); +func Xfts_open(t *TLS, path_argv uintptr, options int32, compar uintptr) uintptr { + return Xfts64_open(t, path_argv, options, compar) +} + +// FTS *fts_open(char * const *path_argv, int options, int (*compar)(const FTSENT **, const FTSENT **)); +func Xfts64_open(t *TLS, path_argv uintptr, options int32, compar uintptr) uintptr { + f := &ftstream{} + + var walk func(string) + walk = func(path string) { + var fi os.FileInfo + var err error + switch { + case options&fts.FTS_LOGICAL != 0: + fi, err = os.Stat(path) + case options&fts.FTS_PHYSICAL != 0: + fi, err = os.Lstat(path) + default: + panic(todo("")) + } + + if err != nil { + return + } + + var statp *unix.Stat_t + if options&fts.FTS_NOSTAT == 0 { + var stat unix.Stat_t + switch { + case options&fts.FTS_LOGICAL != 0: + if err := unix.Stat(path, &stat); err != nil { + panic(todo("")) + } + case options&fts.FTS_PHYSICAL != 0: + if err := unix.Lstat(path, &stat); err != nil { + panic(todo("")) + } + default: + panic(todo("")) + } + + statp = &stat + } + + out: + switch { + case fi.IsDir(): + f.s = append(f.s, newCFtsent(t, fts.FTS_D, path, statp, 0)) + g, err := os.Open(path) + switch x := err.(type) { + case nil: + // ok + case *os.PathError: + f.s = append(f.s, newCFtsent(t, fts.FTS_DNR, path, statp, errno.EACCES)) + break out + default: + panic(todo("%q: %v %T", path, x, x)) + } + + names, err := g.Readdirnames(-1) + g.Close() + if err != nil { + panic(todo("")) + } + + for _, name := range names { + walk(path + "/" + name) + if f == nil { + break out + } + } + + f.s = append(f.s, newCFtsent(t, fts.FTS_DP, path, statp, 0)) + default: + info := fts.FTS_F + if fi.Mode()&os.ModeSymlink != 0 { + info = fts.FTS_SL + } + switch { + case statp != nil: + f.s = append(f.s, newCFtsent(t, info, path, statp, 0)) + case options&fts.FTS_NOSTAT != 0: + f.s = append(f.s, newCFtsent(t, fts.FTS_NSOK, path, nil, 0)) + default: + panic(todo("")) + } + } + } + + for { + p := *(*uintptr)(unsafe.Pointer(path_argv)) + if p == 0 { + if f == nil { + return 0 + } + + if compar != 0 { + panic(todo("")) + } + + return addObject(f) + } + + walk(GoString(p)) + path_argv += unsafe.Sizeof(uintptr(0)) + } +} + +// FTSENT *fts_read(FTS *ftsp); +func Xfts_read(t *TLS, ftsp uintptr) uintptr { + return Xfts64_read(t, ftsp) +} + +// FTSENT *fts_read(FTS *ftsp); +func Xfts64_read(t *TLS, ftsp uintptr) uintptr { + f := getObject(ftsp).(*ftstream) + if f.x == len(f.s) { + t.setErrno(0) + return 0 + } + + r := f.s[f.x] + if e := (*fts.FTSENT)(unsafe.Pointer(r)).Ffts_errno; e != 0 { + t.setErrno(e) + } + f.x++ + return r +} + +// int fts_close(FTS *ftsp); +func Xfts_close(t *TLS, ftsp uintptr) int32 { + return Xfts64_close(t, ftsp) +} + +// int fts_close(FTS *ftsp); +func Xfts64_close(t *TLS, ftsp uintptr) int32 { + getObject(ftsp).(*ftstream).close(t) + removeObject(ftsp) + return 0 +} + +// void tzset (void); +func Xtzset(t *TLS) { + //TODO +} + +var strerrorBuf [100]byte + +// char *strerror(int errnum); +func Xstrerror(t *TLS, errnum int32) uintptr { + if dmesgs { + dmesg("%v: %v\n%s", origin(1), errnum, debug.Stack()) + } + copy(strerrorBuf[:], fmt.Sprintf("strerror(%d)\x00", errnum)) + return uintptr(unsafe.Pointer(&strerrorBuf[0])) +} + +// void *dlopen(const char *filename, int flags); +func Xdlopen(t *TLS, filename uintptr, flags int32) uintptr { + panic(todo("")) +} + +// char *dlerror(void); +func Xdlerror(t *TLS) uintptr { + panic(todo("")) +} + +// int dlclose(void *handle); +func Xdlclose(t *TLS, handle uintptr) int32 { + panic(todo("")) +} + +// void *dlsym(void *handle, const char *symbol); +func Xdlsym(t *TLS, handle, symbol uintptr) uintptr { + panic(todo("")) +} + +// void perror(const char *s); +func Xperror(t *TLS, s uintptr) { + panic(todo("")) +} + +// int pclose(FILE *stream); +func Xpclose(t *TLS, stream uintptr) int32 { + panic(todo("")) +} + +var gai_strerrorBuf [100]byte + +// const char *gai_strerror(int errcode); +func Xgai_strerror(t *TLS, errcode int32) uintptr { + copy(gai_strerrorBuf[:], fmt.Sprintf("gai error %d\x00", errcode)) + return uintptr(unsafe.Pointer(&gai_strerrorBuf)) +} + +// int tcgetattr(int fd, struct termios *termios_p); +func Xtcgetattr(t *TLS, fd int32, termios_p uintptr) int32 { + panic(todo("")) +} + +// int tcsetattr(int fd, int optional_actions, const struct termios *termios_p); +func Xtcsetattr(t *TLS, fd, optional_actions int32, termios_p uintptr) int32 { + panic(todo("")) +} + +// speed_t cfgetospeed(const struct termios *termios_p); +func Xcfgetospeed(t *TLS, termios_p uintptr) termios.Speed_t { + panic(todo("")) +} + +// int cfsetospeed(struct termios *termios_p, speed_t speed); +func Xcfsetospeed(t *TLS, termios_p uintptr, speed uint32) int32 { + panic(todo("")) +} + +// int cfsetispeed(struct termios *termios_p, speed_t speed); +func Xcfsetispeed(t *TLS, termios_p uintptr, speed uint32) int32 { + panic(todo("")) +} + +// pid_t fork(void); +func Xfork(t *TLS) int32 { + t.setErrno(errno.ENOSYS) + return -1 +} + +var emptyStr = [1]byte{} + +// char *setlocale(int category, const char *locale); +func Xsetlocale(t *TLS, category int32, locale uintptr) uintptr { + return uintptr(unsafe.Pointer(&emptyStr)) //TODO +} + +// char *nl_langinfo(nl_item item); +func Xnl_langinfo(t *TLS, item langinfo.Nl_item) uintptr { + return uintptr(unsafe.Pointer(&emptyStr)) //TODO +} + +// FILE *popen(const char *command, const char *type); +func Xpopen(t *TLS, command, type1 uintptr) uintptr { + panic(todo("")) +} + +// char *realpath(const char *path, char *resolved_path); +func Xrealpath(t *TLS, path, resolved_path uintptr) uintptr { + s, err := filepath.EvalSymlinks(GoString(path)) + if err != nil { + if os.IsNotExist(err) { + // if dmesgs { + // dmesg("%v: %q: %v", origin(1), GoString(path), err) + // } + t.setErrno(errno.ENOENT) + return 0 + } + + panic(todo("", err)) + } + + if resolved_path == 0 { + panic(todo("")) + } + + if len(s) >= limits.PATH_MAX { + s = s[:limits.PATH_MAX-1] + } + + copy((*RawMem)(unsafe.Pointer(resolved_path))[:len(s):len(s)], s) + (*RawMem)(unsafe.Pointer(resolved_path))[len(s)] = 0 + return resolved_path +} + +// struct tm *gmtime_r(const time_t *timep, struct tm *result); +func Xgmtime_r(t *TLS, timep, result uintptr) uintptr { + panic(todo("")) +} + +// char *inet_ntoa(struct in_addr in); +func Xinet_ntoa(t *TLS, in1 in.In_addr) uintptr { + panic(todo("")) +} + +func X__ccgo_in6addr_anyp(t *TLS) uintptr { + return uintptr(unsafe.Pointer(&in6_addr_any)) +} + +func Xabort(t *TLS) { + if dmesgs { + dmesg("%v:", origin(1)) + } + p := Xcalloc(t, 1, types.Size_t(unsafe.Sizeof(signal.Sigaction{}))) + if p == 0 { + panic("OOM") + } + + (*signal.Sigaction)(unsafe.Pointer(p)).F__sigaction_u.F__sa_handler = signal.SIG_DFL + Xsigaction(t, signal.SIGABRT, p, 0) + Xfree(t, p) + unix.Kill(unix.Getpid(), syscall.Signal(signal.SIGABRT)) + panic(todo("unrechable")) +} + +// int fflush(FILE *stream); +func Xfflush(t *TLS, stream uintptr) int32 { + return 0 //TODO +} + +// size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream); +func Xfread(t *TLS, ptr uintptr, size, nmemb types.Size_t, stream uintptr) types.Size_t { + m, _, err := unix.Syscall(unix.SYS_READ, uintptr(file(stream).fd()), ptr, uintptr(size*nmemb)) + if err != 0 { + file(stream).setErr() + return 0 + } + + // if dmesgs { + // // dmesg("%v: %d %#x x %#x: %#x\n%s", origin(1), file(stream).fd(), size, nmemb, types.Size_t(m)/size, hex.Dump(GoBytes(ptr, int(m)))) + // dmesg("%v: %d %#x x %#x: %#x", origin(1), file(stream).fd(), size, nmemb, types.Size_t(m)/size) + // } + return types.Size_t(m) / size +} + +// size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream); +func Xfwrite(t *TLS, ptr uintptr, size, nmemb types.Size_t, stream uintptr) types.Size_t { + m, _, err := unix.Syscall(unix.SYS_WRITE, uintptr(file(stream).fd()), ptr, uintptr(size*nmemb)) + if err != 0 { + file(stream).setErr() + return 0 + } + + // if dmesgs { + // // dmesg("%v: %d %#x x %#x: %#x\n%s", origin(1), file(stream).fd(), size, nmemb, types.Size_t(m)/size, hex.Dump(GoBytes(ptr, int(m)))) + // dmesg("%v: %d %#x x %#x: %#x", origin(1), file(stream).fd(), size, nmemb, types.Size_t(m)/size) + // } + return types.Size_t(m) / size +} + +// int fclose(FILE *stream); +func Xfclose(t *TLS, stream uintptr) int32 { + return file(stream).close(t) +} + +// int fputc(int c, FILE *stream); +func Xfputc(t *TLS, c int32, stream uintptr) int32 { + if _, err := fwrite(file(stream).fd(), []byte{byte(c)}); err != nil { + return stdio.EOF + } + + return int32(byte(c)) +} + +// int fseek(FILE *stream, long offset, int whence); +func Xfseek(t *TLS, stream uintptr, offset long, whence int32) int32 { + if n := Xlseek(t, int32(file(stream).fd()), types.Off_t(offset), whence); n < 0 { + // if dmesgs { + // dmesg("%v: fd %v, off %#x, whence %v: %v", origin(1), file(stream).fd(), offset, whenceStr(whence), n) + // } + file(stream).setErr() + return -1 + } + + // if dmesgs { + // dmesg("%v: fd %v, off %#x, whence %v: ok", origin(1), file(stream).fd(), offset, whenceStr(whence)) + // } + return 0 +} + +// long ftell(FILE *stream); +func Xftell(t *TLS, stream uintptr) long { + n := Xlseek(t, file(stream).fd(), 0, stdio.SEEK_CUR) + if n < 0 { + file(stream).setErr() + return -1 + } + + // if dmesgs { + // dmesg("%v: fd %v, n %#x: ok %#x", origin(1), file(stream).fd(), n, long(n)) + // } + return long(n) +} + +// int ferror(FILE *stream); +func Xferror(t *TLS, stream uintptr) int32 { + return Bool32(file(stream).err()) +} + +// int fgetc(FILE *stream); +func Xfgetc(t *TLS, stream uintptr) int32 { + panic(todo("")) +} + +// int getc(FILE *stream); +func Xgetc(t *TLS, stream uintptr) int32 { + return Xfgetc(t, stream) +} + +// int ungetc(int c, FILE *stream); +func Xungetc(t *TLS, c int32, stream uintptr) int32 { + panic(todo("")) +} + +// int fscanf(FILE *stream, const char *format, ...); +func Xfscanf(t *TLS, stream, format, va uintptr) int32 { + panic(todo("")) +} + +// FILE *fdopen(int fd, const char *mode); +func Xfdopen(t *TLS, fd int32, mode uintptr) uintptr { + panic(todo("")) +} + +// int fputs(const char *s, FILE *stream); +func Xfputs(t *TLS, s, stream uintptr) int32 { + if _, _, err := unix.Syscall(unix.SYS_WRITE, uintptr(file(stream).fd()), s, uintptr(Xstrlen(t, s))); err != 0 { + return -1 + } + + return 0 +} + +var getservbynameStaticResult netdb.Servent + +// struct servent *getservbyname(const char *name, const char *proto); +func Xgetservbyname(t *TLS, name, proto uintptr) uintptr { + var protoent *gonetdb.Protoent + if proto != 0 { + protoent = gonetdb.GetProtoByName(GoString(proto)) + } + servent := gonetdb.GetServByName(GoString(name), protoent) + if servent == nil { + // if dmesgs { + // dmesg("%q %q: nil (protoent %+v)", GoString(name), GoString(proto), protoent) + // } + return 0 + } + + Xfree(t, (*netdb.Servent)(unsafe.Pointer(&getservbynameStaticResult)).Fs_name) + if v := (*netdb.Servent)(unsafe.Pointer(&getservbynameStaticResult)).Fs_aliases; v != 0 { + for { + p := *(*uintptr)(unsafe.Pointer(v)) + if p == 0 { + break + } + + Xfree(t, p) + v += unsafe.Sizeof(uintptr(0)) + } + Xfree(t, v) + } + Xfree(t, (*netdb.Servent)(unsafe.Pointer(&getservbynameStaticResult)).Fs_proto) + cname, err := CString(servent.Name) + if err != nil { + getservbynameStaticResult = netdb.Servent{} + return 0 + } + + var protoname uintptr + if protoent != nil { + if protoname, err = CString(protoent.Name); err != nil { + Xfree(t, cname) + getservbynameStaticResult = netdb.Servent{} + return 0 + } + } + var a []uintptr + for _, v := range servent.Aliases { + cs, err := CString(v) + if err != nil { + for _, v := range a { + Xfree(t, v) + } + return 0 + } + + a = append(a, cs) + } + v := Xcalloc(t, types.Size_t(len(a)+1), types.Size_t(unsafe.Sizeof(uintptr(0)))) + if v == 0 { + Xfree(t, cname) + Xfree(t, protoname) + for _, v := range a { + Xfree(t, v) + } + getservbynameStaticResult = netdb.Servent{} + return 0 + } + for _, p := range a { + *(*uintptr)(unsafe.Pointer(v)) = p + v += unsafe.Sizeof(uintptr(0)) + } + + getservbynameStaticResult = netdb.Servent{ + Fs_name: cname, + Fs_aliases: v, + Fs_port: int32(servent.Port), + Fs_proto: protoname, + } + return uintptr(unsafe.Pointer(&getservbynameStaticResult)) +} + +func Xreaddir64(t *TLS, dir uintptr) uintptr { + return Xreaddir(t, dir) +} + +func __syscall(r, _ uintptr, errno syscall.Errno) long { + if errno != 0 { + return long(-errno) + } + + return long(r) +} + +func X__syscall1(t *TLS, trap, p1 long) long { + return __syscall(unix.Syscall(uintptr(trap), uintptr(p1), 0, 0)) +} + +func X__syscall3(t *TLS, trap, p1, p2, p3 long) long { + return __syscall(unix.Syscall(uintptr(trap), uintptr(p1), uintptr(p2), uintptr(p3))) +} + +func X__syscall4(t *TLS, trap, p1, p2, p3, p4 long) long { + return __syscall(unix.Syscall6(uintptr(trap), uintptr(p1), uintptr(p2), uintptr(p3), uintptr(p4), 0, 0)) +} + +func fcntlCmdStr(cmd int32) string { + switch cmd { + case fcntl.F_GETOWN: + return "F_GETOWN" + case fcntl.F_SETLK: + return "F_SETLK" + case fcntl.F_GETLK: + return "F_GETLK" + case fcntl.F_SETFD: + return "F_SETFD" + case fcntl.F_GETFD: + return "F_GETFD" + default: + return fmt.Sprintf("cmd(%d)", cmd) + } +} + +// int setenv(const char *name, const char *value, int overwrite); +func Xsetenv(t *TLS, name, value uintptr, overwrite int32) int32 { + panic(todo("")) +} + +// int unsetenv(const char *name); +func Xunsetenv(t *TLS, name uintptr) int32 { + panic(todo("")) +} + +// int pause(void); +func Xpause(t *TLS) int32 { + panic(todo("")) +} + +// ssize_t writev(int fd, const struct iovec *iov, int iovcnt); +func Xwritev(t *TLS, fd int32, iov uintptr, iovcnt int32) types.Ssize_t { + panic(todo("")) +} + +// void endpwent(void); +func Xendpwent(t *TLS) { + // nop +} + +// int __isoc99_sscanf(const char *str, const char *format, ...); +func X__isoc99_sscanf(t *TLS, str, format, va uintptr) int32 { + r := Xsscanf(t, str, format, va) + // if dmesgs { + // dmesg("%v: %q %q: %d", origin(1), GoString(str), GoString(format), r) + // } + return r +} + +// int sched_yield(void); +func Xsched_yield(t *TLS) { + runtime.Gosched() +} + +var ctimeStaticBuf [32]byte + +// char *ctime(const time_t *timep); +func Xctime(t *TLS, timep uintptr) uintptr { + return Xctime_r(t, timep, uintptr(unsafe.Pointer(&ctimeStaticBuf[0]))) +} + +// char *ctime_r(const time_t *timep, char *buf); +func Xctime_r(t *TLS, timep, buf uintptr) uintptr { + panic(todo("")) +} + +// void __assert(const char * func, const char * file, int line, const char *expr) __dead2; +func X__assert(t *TLS, fn, file uintptr, line int32, expr uintptr) { + X__assert_fail(t, expr, file, uint32(line), fn) +} + +// include/stdio.h:456:int __swbuf(int, FILE *); +func X__swbuf(t *TLS, n int32, file uintptr) int32 { + return Xfputc(t, n, file) //TODO improve performance, use a real buffer. +} + +// int rmdir(const char *pathname); +func Xrmdir(t *TLS, pathname uintptr) int32 { + if err := unix.Rmdir(GoString(pathname)); err != nil { + if dmesgs { + dmesg("%v: %v FAIL", origin(1), err) + } + t.setErrno(err) + return -1 + } + + if dmesgs { + dmesg("%v: ok", origin(1)) + } + return 0 +} + +// struct dirent *readdir(DIR *dirp); +func Xreaddir(t *TLS, dir uintptr) uintptr { + if (*darwinDir)(unsafe.Pointer(dir)).eof { + return 0 + } + + if (*darwinDir)(unsafe.Pointer(dir)).l == (*darwinDir)(unsafe.Pointer(dir)).h { + n, err := unix.Getdirentries((*darwinDir)(unsafe.Pointer(dir)).fd, (*darwinDir)(unsafe.Pointer(dir)).buf[:], nil) + // trc("must read: %v %v", n, err) + if n == 0 { + if err != nil && err != io.EOF { + if dmesgs { + dmesg("%v: %v FAIL", origin(1), err) + } + t.setErrno(err) + } + (*darwinDir)(unsafe.Pointer(dir)).eof = true + return 0 + } + + (*darwinDir)(unsafe.Pointer(dir)).l = 0 + (*darwinDir)(unsafe.Pointer(dir)).h = n + // trc("new l %v, h %v", (*darwinDir)(unsafe.Pointer(dir)).l, (*darwinDir)(unsafe.Pointer(dir)).h) + } + de := dir + unsafe.Offsetof(darwinDir{}.buf) + uintptr((*darwinDir)(unsafe.Pointer(dir)).l) + (*darwinDir)(unsafe.Pointer(dir)).l += int((*unix.Dirent)(unsafe.Pointer(de)).Reclen) + return de +} + +type darwinDir struct { + buf [4096]byte + fd int + h int + l int + + eof bool +} + +// int sscanf(const char *str, const char *format, ...); +func Xsscanf(t *TLS, str, format, va uintptr) int32 { + r := scanf(strings.NewReader(GoString(str)), format, va) + // if dmesgs { + // dmesg("%v: %q %q: %d", origin(1), GoString(str), GoString(format), r) + // } + return r +} + +// int * __error(void); +func X__error(t *TLS) uintptr { + return t.errnop +} + +func Xclosedir(t *TLS, dir uintptr) int32 { + r := Xclose(t, int32((*darwinDir)(unsafe.Pointer(dir)).fd)) + Xfree(t, dir) + return r +} + +// DIR *opendir(const char *name); +func Xopendir(t *TLS, name uintptr) uintptr { + p := Xmalloc(t, uint64(unsafe.Sizeof(darwinDir{}))) + if p == 0 { + panic("OOM") + } + + fd := int(Xopen(t, name, fcntl.O_RDONLY|fcntl.O_DIRECTORY|fcntl.O_CLOEXEC, 0)) + if fd < 0 { + if dmesgs { + dmesg("%v: FAIL %v", origin(1), (*darwinDir)(unsafe.Pointer(p)).fd) + } + Xfree(t, p) + return 0 + } + + if dmesgs { + dmesg("%v: ok", origin(1)) + } + (*darwinDir)(unsafe.Pointer(p)).fd = fd + (*darwinDir)(unsafe.Pointer(p)).h = 0 + (*darwinDir)(unsafe.Pointer(p)).l = 0 + (*darwinDir)(unsafe.Pointer(p)).eof = false + return p +} + +// int __xuname(int namesize, void *namebuf) +func X__xuname(t *TLS, namesize int32, namebuf uintptr) int32 { + return Xuname(t, namebuf) +} + +// int chflags(const char *path, u_int flags); +func Xchflags(t *TLS, path uintptr, flags uint64) int32 { + if err := unix.Chflags(GoString(path), int(flags)); err != nil { + if dmesgs { + dmesg("%v: %v FAIL", origin(1), err) + } + t.setErrno(err) + return -1 + } + + if dmesgs { + dmesg("%v: ok", origin(1)) + } + return 0 +} + +// int pipe(int pipefd[2]); +func Xpipe(t *TLS, pipefd uintptr) int32 { + var a [2]int + if err := syscall.Pipe(a[:]); err != nil { + if dmesgs { + dmesg("%v: %v FAIL", origin(1), err) + } + t.setErrno(err) + return -1 + } + + *(*[2]int32)(unsafe.Pointer(pipefd)) = [2]int32{int32(a[0]), int32(a[1])} + if dmesgs { + dmesg("%v: %v ok", origin(1), a) + } + return 0 +} + +// char *inet_ntoa(struct in_addr in); +func X__inet_ntoa(t *TLS, in1 in.In_addr) uintptr { + panic(todo("")) +} + +func Xmmap(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, offset types.Off_t) uintptr { + // Cannot avoid the syscall here, addr sometimes matter. + data, _, err := unix.Syscall6(unix.SYS_MMAP, addr, uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) + if err != 0 { + if dmesgs { + dmesg("%v: %v FAIL", origin(1), err) + } + t.setErrno(err) + return ^uintptr(0) // (void*)-1 + } + + if dmesgs { + dmesg("%v: %#x", origin(1), data) + } + return data +} diff --git a/vendor/modernc.org/libc/libc_freebsd_amd64.go b/vendor/modernc.org/libc/libc_freebsd_amd64.go new file mode 100644 index 000000000..54eb87f24 --- /dev/null +++ b/vendor/modernc.org/libc/libc_freebsd_amd64.go @@ -0,0 +1,575 @@ +// Copyright 2021 The Libc Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package libc // import "modernc.org/libc" + +import ( + "strings" + "unsafe" + + "golang.org/x/sys/unix" + "modernc.org/libc/fcntl" + "modernc.org/libc/sys/types" + "modernc.org/libc/time" + "modernc.org/libc/utime" +) + +// int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); +func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { + if _, _, err := unix.Syscall(unix.SYS_SIGACTION, uintptr(signum), act, oldact); err != 0 { + t.setErrno(err) + return -1 + } + + return 0 +} + +// FILE *fopen64(const char *pathname, const char *mode); +func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { + m := strings.ReplaceAll(GoString(mode), "b", "") + var flags int + switch m { + case "r": + flags = fcntl.O_RDONLY + case "r+": + flags = fcntl.O_RDWR + case "w": + flags = fcntl.O_WRONLY | fcntl.O_CREAT | fcntl.O_TRUNC + case "w+": + flags = fcntl.O_RDWR | fcntl.O_CREAT | fcntl.O_TRUNC + case "a": + flags = fcntl.O_WRONLY | fcntl.O_CREAT | fcntl.O_APPEND + case "a+": + flags = fcntl.O_RDWR | fcntl.O_CREAT | fcntl.O_APPEND + default: + panic(m) + } + fd, err := unix.Open(GoString(pathname), int(flags), 0666) + if err != nil { + if dmesgs { + dmesg("%v: %q %q: %v FAIL", origin(1), GoString(pathname), GoString(mode), err) + } + t.setErrno(err) + return 0 + } + + if dmesgs { + dmesg("%v: %q %q: fd %v", origin(1), GoString(pathname), GoString(mode), fd) + } + if p := newFile(t, int32(fd)); p != 0 { + return p + } + + panic("OOM") +} + +// int lstat(const char *pathname, struct stat *statbuf); +func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { + if err := unix.Lstat(GoString(pathname), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { + if dmesgs { + dmesg("%v: %q: %v FAIL", origin(1), GoString(pathname), err) + } + t.setErrno(err) + return -1 + } + + if dmesgs { + dmesg("%v: %q: ok", origin(1), GoString(pathname)) + } + return 0 +} + +// int stat(const char *pathname, struct stat *statbuf); +func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { + if err := unix.Stat(GoString(pathname), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { + if dmesgs { + dmesg("%v: %q: %v FAIL", origin(1), GoString(pathname), err) + } + t.setErrno(err) + return -1 + } + + if dmesgs { + dmesg("%v: %q: ok", origin(1), GoString(pathname)) + } + return 0 +} + +// int mkdir(const char *path, mode_t mode); +func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { + if err := unix.Mkdir(GoString(path), uint32(mode)); err != nil { + if dmesgs { + dmesg("%v: %q: %v FAIL", origin(1), GoString(path), err) + } + t.setErrno(err) + return -1 + } + + if dmesgs { + dmesg("%v: %q: ok", origin(1), GoString(path)) + } + return 0 +} + +// int access(const char *pathname, int mode); +func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { + if err := unix.Access(GoString(pathname), uint32(mode)); err != nil { + if dmesgs { + dmesg("%v: %q %#o: %v FAIL", origin(1), GoString(pathname), mode, err) + } + t.setErrno(err) + return -1 + } + + if dmesgs { + dmesg("%v: %q %#o: ok", origin(1), GoString(pathname), mode) + } + return 0 +} + +// int unlink(const char *pathname); +func Xunlink(t *TLS, pathname uintptr) int32 { + if err := unix.Unlink(GoString(pathname)); err != nil { + if dmesgs { + dmesg("%v: %q: %v", origin(1), GoString(pathname), err) + } + t.setErrno(err) + return -1 + } + + if dmesgs { + dmesg("%v: ok", origin(1)) + } + return 0 +} + +// ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize); +func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { + var n int + var err error + switch { + case buf == 0 || bufsize == 0: + n, err = unix.Readlink(GoString(path), nil) + default: + n, err = unix.Readlink(GoString(path), (*RawMem)(unsafe.Pointer(buf))[:bufsize:bufsize]) + } + if err != nil { + if dmesgs { + dmesg("%v: %v FAIL", err) + } + t.setErrno(err) + return -1 + } + + if dmesgs { + dmesg("%v: ok") + } + return types.Ssize_t(n) +} + +// int symlink(const char *target, const char *linkpath); +func Xsymlink(t *TLS, target, linkpath uintptr) int32 { + if err := unix.Symlink(GoString(target), GoString(linkpath)); err != nil { + if dmesgs { + dmesg("%v: %v FAIL", origin(1), err) + } + t.setErrno(err) + return -1 + } + + if dmesgs { + dmesg("%v: ok", origin(1)) + } + return 0 +} + +// int chmod(const char *pathname, mode_t mode) +func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { + if err := unix.Chmod(GoString(pathname), uint32(mode)); err != nil { + if dmesgs { + dmesg("%v: %q %#o: %v FAIL", origin(1), GoString(pathname), mode, err) + } + t.setErrno(err) + return -1 + } + + if dmesgs { + dmesg("%v: %q %#o: ok", origin(1), GoString(pathname), mode) + } + return 0 +} + +// time_t time(time_t *tloc); +func Xtime(t *TLS, tloc uintptr) time.Time_t { + panic(todo("")) + // n := time.Now().UTC().Unix() + // if tloc != 0 { + // *(*types.Time_t)(unsafe.Pointer(tloc)) = types.Time_t(n) + // } + // return types.Time_t(n) +} + +// int utimes(const char *filename, const struct timeval times[2]); +func Xutimes(t *TLS, filename, times uintptr) int32 { + var a []unix.Timeval + if times != 0 { + a = make([]unix.Timeval, 2) + a[0] = *(*unix.Timeval)(unsafe.Pointer(times)) + a[1] = *(*unix.Timeval)(unsafe.Pointer(times + unsafe.Sizeof(unix.Timeval{}))) + } + if err := unix.Utimes(GoString(filename), a); err != nil { + if dmesgs { + dmesg("%v: %v FAIL", origin(1), err) + } + t.setErrno(err) + return -1 + } + + if dmesgs { + dmesg("%v: ok", origin(1)) + } + return 0 +} + +// int fstat(int fd, struct stat *statbuf); +func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { + if err := unix.Fstat(int(fd), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { + if dmesgs { + dmesg("%v: fd %d: %v FAIL", origin(1), fd, err) + } + t.setErrno(err) + return -1 + } + + if dmesgs { + dmesg("%v: fd %d: ok", origin(1), fd) + } + return 0 +} + +// off64_t lseek64(int fd, off64_t offset, int whence); +func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + n, err := unix.Seek(int(fd), int64(offset), int(whence)) + if err != nil { + if dmesgs { + dmesg("%v: %v FAIL", origin(1), err) + } + t.setErrno(err) + return -1 + } + + if dmesgs { + dmesg("%v: ok", origin(1)) + } + return types.Off_t(n) +} + +func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { + var arg uintptr + if args != 0 { + arg = *(*uintptr)(unsafe.Pointer(args)) + } + n, _, err := unix.Syscall(unix.SYS_FCNTL, uintptr(fd), uintptr(cmd), arg) + if err != 0 { + if dmesgs { + dmesg("%v: fd %v cmd %v", origin(1), fcntlCmdStr(fd), cmd) + } + t.setErrno(err) + return -1 + } + + if dmesgs { + dmesg("%v: %d %s %#x: %d", origin(1), fd, fcntlCmdStr(cmd), arg, n) + } + return int32(n) +} + +// int rename(const char *oldpath, const char *newpath); +func Xrename(t *TLS, oldpath, newpath uintptr) int32 { + if err := unix.Rename(GoString(oldpath), GoString(newpath)); err != nil { + if dmesgs { + dmesg("%v: %v FAIL", origin(1), err) + } + t.setErrno(err) + return -1 + } + + if dmesgs { + dmesg("%v: ok", origin(1)) + } + return 0 +} + +// int mknod(const char *pathname, mode_t mode, dev_t dev); +func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 { + panic(todo("")) + // if _, _, err := unix.Syscall(unix.SYS_MKNOD, pathname, uintptr(mode), uintptr(dev)); err != 0 { + // t.setErrno(err) + // return -1 + // } + + // return 0 +} + +// int utime(const char *filename, const struct utimbuf *times); +func Xutime(t *TLS, filename, times uintptr) int32 { + var a []unix.Timeval + if times != 0 { + a = make([]unix.Timeval, 2) + a[0].Sec = (*utime.Utimbuf)(unsafe.Pointer(times)).Factime + a[1].Sec = (*utime.Utimbuf)(unsafe.Pointer(times)).Fmodtime + } + if err := unix.Utimes(GoString(filename), a); err != nil { + if dmesgs { + dmesg("%v: %v FAIL", origin(1), err) + } + t.setErrno(err) + return -1 + } + + if dmesgs { + dmesg("%v: ok", origin(1)) + } + return 0 +} + +// int chown(const char *pathname, uid_t owner, gid_t group); +func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int32 { + panic(todo("")) + // if _, _, err := unix.Syscall(unix.SYS_CHOWN, pathname, uintptr(owner), uintptr(group)); err != 0 { + // t.setErrno(err) + // return -1 + // } + + // return 0 +} + +// int link(const char *oldpath, const char *newpath); +func Xlink(t *TLS, oldpath, newpath uintptr) int32 { + panic(todo("")) + // if _, _, err := unix.Syscall(unix.SYS_LINK, oldpath, newpath, 0); err != 0 { + // t.setErrno(err) + // return -1 + // } + + // return 0 +} + +// int dup2(int oldfd, int newfd); +func Xdup2(t *TLS, oldfd, newfd int32) int32 { + panic(todo("")) + // n, _, err := unix.Syscall(unix.SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) + // if err != 0 { + // t.setErrno(err) + // return -1 + // } + + // return int32(n) +} + +// unsigned int alarm(unsigned int seconds); +func Xalarm(t *TLS, seconds uint32) uint32 { + panic(todo("")) + // n, _, err := unix.Syscall(unix.SYS_ALARM, uintptr(seconds), 0, 0) + // if err != 0 { + // panic(todo("")) + // } + + // return uint32(n) +} + +func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen size_t, serv uintptr, servlen size_t, flags int32) int32 { /* getnameinfo.c:125:5: */ + panic(todo("")) + //TODO bp := tls.Alloc(347) + //TODO defer tls.Free(347) + + //TODO // var ptr [78]int8 at bp, 78 + + //TODO // var buf [256]int8 at bp+78, 256 + + //TODO // var num [13]int8 at bp+334, 13 + + //TODO var af int32 = int32((*sockaddr)(unsafe.Pointer(sa1)).sa_family) + //TODO var a uintptr + //TODO var scopeid uint32 + + //TODO switch af { + //TODO case 2: + //TODO a = (sa1 + 4 /* &.sin_addr */) + //TODO if (uint64(sl) < uint64(unsafe.Sizeof(sockaddr_in{}))) { + //TODO return -6 + //TODO } + //TODO mkptr4(tls, bp /* &ptr[0] */, a) + //TODO scopeid = uint32(0) + //TODO break + //TODO case 10: + //TODO a = (sa1 + 8 /* &.sin6_addr */) + //TODO if (uint64(sl) < uint64(unsafe.Sizeof(sockaddr_in6{}))) { + //TODO return -6 + //TODO } + //TODO if Xmemcmp(tls, a, ts+88 /* "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff" */, uint64(12)) != 0 { + //TODO mkptr6(tls, bp /* &ptr[0] */, a) + //TODO } else { + //TODO mkptr4(tls, bp /* &ptr[0] */, (a + uintptr(12))) + //TODO } + //TODO scopeid = (*sockaddr_in6)(unsafe.Pointer(sa1)).sin6_scope_id + //TODO break + //TODO default: + //TODO return -6 + //TODO } + + //TODO if (node != 0) && (nodelen != 0) { + //TODO *(*int8)(unsafe.Pointer(bp + 78 /* &buf[0] */)) = int8(0) + //TODO if !((flags & 0x01) != 0) { + //TODO reverse_hosts(tls, bp+78 /* &buf[0] */, a, scopeid, af) + //TODO } + //TODO if !(int32(*(*int8)(unsafe.Pointer(bp + 78 /* buf */))) != 0) && !((flags & 0x01) != 0) { + //TODO Xabort(tls) //TODO- + //TODO // unsigned char query[18+PTR_MAX], reply[512]; + //TODO // int qlen = __res_mkquery(0, ptr, 1, RR_PTR, + //TODO // 0, 0, 0, query, sizeof query); + //TODO // query[3] = 0; /* don't need AD flag */ + //TODO // int rlen = __res_send(query, qlen, reply, sizeof reply); + //TODO // buf[0] = 0; + //TODO // if (rlen > 0) + //TODO // __dns_parse(reply, rlen, dns_parse_callback, buf); + //TODO } + //TODO if !(int32(*(*int8)(unsafe.Pointer(bp + 78 /* buf */))) != 0) { + //TODO if (flags & 0x08) != 0 { + //TODO return -2 + //TODO } + //TODO Xinet_ntop(tls, af, a, bp+78 /* &buf[0] */, uint32(unsafe.Sizeof([256]int8{}))) + //TODO if scopeid != 0 { + //TODO Xabort(tls) //TODO- + //TODO // char *p = 0, tmp[IF_NAMESIZE+1]; + //TODO // if (!(flags & NI_NUMERICSCOPE) && + //TODO // (IN6_IS_ADDR_LINKLOCAL(a) || + //TODO // IN6_IS_ADDR_MC_LINKLOCAL(a))) + //TODO // p = if_indextoname(scopeid, tmp+1); + //TODO // if (!p) + //TODO // p = itoa(num, scopeid); + //TODO // *--p = '%'; + //TODO // strcat(buf, p); + //TODO } + //TODO } + //TODO if Xstrlen(tls, bp+78 /* &buf[0] */) >= size_t(nodelen) { + //TODO return -12 + //TODO } + //TODO Xstrcpy(tls, node, bp+78 /* &buf[0] */) + //TODO } + + //TODO if (serv != 0) && (servlen != 0) { + //TODO var p uintptr = bp + 78 /* buf */ + //TODO var port int32 = int32(Xntohs(tls, (*sockaddr_in)(unsafe.Pointer(sa1)).sin_port)) + //TODO *(*int8)(unsafe.Pointer(bp + 78 /* &buf[0] */)) = int8(0) + //TODO if !((flags & 0x02) != 0) { + //TODO reverse_services(tls, bp+78 /* &buf[0] */, port, (flags & 0x10)) + //TODO } + //TODO if !(int32(*(*int8)(unsafe.Pointer(p))) != 0) { + //TODO p = itoa(tls, bp+334 /* &num[0] */, uint32(port)) + //TODO } + //TODO if Xstrlen(tls, p) >= size_t(servlen) { + //TODO return -12 + //TODO } + //TODO Xstrcpy(tls, serv, p) + //TODO } + + //TODO return 0 +} + +func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyaddr_r.c:10:5: */ + panic(todo("")) + //TODO bp := tls.Alloc(28) + //TODO defer tls.Free(28) + + //TODO //TODO union { + //TODO //TODO struct sockaddr_in sin; + //TODO //TODO struct sockaddr_in6 sin6; + //TODO //TODO } sa = { .sin.sin_family = af }; + //TODO *(*struct { + //TODO sin sockaddr_in + //TODO _ [12]byte + //TODO })(unsafe.Pointer(bp /* sa1 */)) = struct { + //TODO sin sockaddr_in + //TODO _ [12]byte + //TODO }{} //TODO- + //TODO (*sockaddr_in)(unsafe.Pointer(bp /* &sa1 */)).sin_family = sa_family_t(af) //TODO- + //TODO var sl socklen_t + //TODO if af == 10 { + //TODO sl = uint32(unsafe.Sizeof(sockaddr_in6{})) + //TODO } else { + //TODO sl = uint32(unsafe.Sizeof(sockaddr_in{})) + //TODO } + //TODO var i int32 + + //TODO *(*uintptr)(unsafe.Pointer(res)) = uintptr(0) + + //TODO // Load address argument into sockaddr structure + //TODO if (af == 10) && (l == socklen_t(16)) { + //TODO Xmemcpy(tls, (bp /* &sa1 */ /* &.sin6 */ + 8 /* &.sin6_addr */), a, uint64(16)) + //TODO } else if (af == 2) && (l == socklen_t(4)) { + //TODO Xmemcpy(tls, (bp /* &sa1 */ /* &.sin */ + 4 /* &.sin_addr */), a, uint64(4)) + //TODO } else { + //TODO *(*int32)(unsafe.Pointer(err)) = 3 + //TODO return 22 + //TODO } + + //TODO // Align buffer and check for space for pointers and ip address + //TODO i = (int32(uintptr_t(buf) & (uint64(unsafe.Sizeof(uintptr(0))) - uint64(1)))) + //TODO if !(i != 0) { + //TODO i = int32(unsafe.Sizeof(uintptr(0))) + //TODO } + //TODO if buflen <= (((uint64(5) * uint64(unsafe.Sizeof(uintptr(0)))) - uint64(i)) + uint64(l)) { + //TODO return 34 + //TODO } + //TODO buf += (uintptr(uint64(unsafe.Sizeof(uintptr(0))) - uint64(i))) + //TODO buflen = buflen - (((uint64(5) * uint64(unsafe.Sizeof(uintptr(0)))) - uint64(i)) + uint64(l)) + + //TODO (*hostent)(unsafe.Pointer(h)).h_addr_list = buf + //TODO buf += (uintptr(uint64(2) * uint64(unsafe.Sizeof(uintptr(0))))) + //TODO (*hostent)(unsafe.Pointer(h)).h_aliases = buf + //TODO buf += (uintptr(uint64(2) * uint64(unsafe.Sizeof(uintptr(0))))) + + //TODO *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_addr_list)) = buf + //TODO Xmemcpy(tls, *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_addr_list)), a, uint64(l)) + //TODO buf += uintptr(l) + //TODO *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_addr_list + 1*8)) = uintptr(0) + //TODO *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_aliases)) = buf + //TODO *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_aliases + 1*8)) = uintptr(0) + + //TODO switch Xgetnameinfo(tls, bp /* &sa1 */, sl, buf, uint32(buflen), uintptr(0), uint32(0), 0) { + //TODO case -3: + //TODO *(*int32)(unsafe.Pointer(err)) = 2 + //TODO return 11 + //TODO case -12: + //TODO return 34 + //TODO default: + //TODO fallthrough + //TODO case -10: + //TODO fallthrough + //TODO case -11: + //TODO fallthrough + //TODO case -4: + //TODO *(*int32)(unsafe.Pointer(err)) = 3 + //TODO return *(*int32)(unsafe.Pointer(X___errno_location(tls))) + //TODO case 0: + //TODO break + //TODO } + + //TODO (*hostent)(unsafe.Pointer(h)).h_addrtype = af + //TODO (*hostent)(unsafe.Pointer(h)).h_length = int32(l) + //TODO (*hostent)(unsafe.Pointer(h)).h_name = *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_aliases)) + //TODO *(*uintptr)(unsafe.Pointer(res)) = h + //TODO return 0 +} + +// int getrlimit(int resource, struct rlimit *rlim); +func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if _, _, err := unix.Syscall(unix.SYS_GETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { + t.setErrno(err) + return -1 + } + + return 0 +} diff --git a/vendor/modernc.org/libc/libc_linux_arm.go b/vendor/modernc.org/libc/libc_linux_arm.go index 72f3f129c..cfabe77f9 100644 --- a/vendor/modernc.org/libc/libc_linux_arm.go +++ b/vendor/modernc.org/libc/libc_linux_arm.go @@ -439,11 +439,11 @@ func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { return 0 } -// int sscanf(const char *str, const char *format, ...); -func Xsscanf(t *TLS, str, format, va uintptr) int32 { - r := scanf(strings.NewReader(GoString(str)), format, va) - // if dmesgs { - // dmesg("%v: %q %q: %d", origin(1), GoString(str), GoString(format), r) - // } - return r -} +//TODO- // int sscanf(const char *str, const char *format, ...); +//TODO- func Xsscanf(t *TLS, str, format, va uintptr) int32 { +//TODO- r := scanf(strings.NewReader(GoString(str)), format, va) +//TODO- // if dmesgs { +//TODO- // dmesg("%v: %q %q: %d", origin(1), GoString(str), GoString(format), r) +//TODO- // } +//TODO- return r +//TODO- } diff --git a/vendor/modernc.org/libc/libc_linux_s390x.go b/vendor/modernc.org/libc/libc_linux_s390x.go index c3ef6f28b..f2ea9e44f 100644 --- a/vendor/modernc.org/libc/libc_linux_s390x.go +++ b/vendor/modernc.org/libc/libc_linux_s390x.go @@ -465,3 +465,16 @@ func Xuuid_unparse(t *TLS, uu uuid.Uuid_t, out uintptr) { func Xuuid_parse(t *TLS, in uintptr, uu uuid.Uuid_t) int32 { panic(todo("")) } + +//TODO- +func __syscall1(t *TLS, trap, p1 long) long { + return __syscall(unix.Syscall(uintptr(trap), uintptr(p1), 0, 0)) +} + +func __syscall3(t *TLS, trap, p1, p2, p3 long) long { + return __syscall(unix.Syscall(uintptr(trap), uintptr(p1), uintptr(p2), uintptr(p3))) +} + +func __syscall4(t *TLS, trap, p1, p2, p3, p4 long) long { + return __syscall(unix.Syscall6(uintptr(trap), uintptr(p1), uintptr(p2), uintptr(p3), uintptr(p4), 0, 0)) +} diff --git a/vendor/modernc.org/libc/libc_unix.go b/vendor/modernc.org/libc/libc_unix.go index 01a9dc0d6..f311092e6 100644 --- a/vendor/modernc.org/libc/libc_unix.go +++ b/vendor/modernc.org/libc/libc_unix.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build linux darwin +//go:build linux || darwin || freebsd +// +build linux darwin freebsd package libc // import "modernc.org/libc" diff --git a/vendor/modernc.org/libc/libc_windows.go b/vendor/modernc.org/libc/libc_windows.go index f50f8c475..8959dab57 100644 --- a/vendor/modernc.org/libc/libc_windows.go +++ b/vendor/modernc.org/libc/libc_windows.go @@ -226,24 +226,21 @@ func newFile(t *TLS, fd int32) uintptr { if err != nil { panic("no console") } - f := addFile(h, fd) - return uintptr(unsafe.Pointer(f)) + return addFile(h, fd) } if fd == unistd.STDOUT_FILENO { h, err := syscall.GetStdHandle(syscall.STD_OUTPUT_HANDLE) if err != nil { panic("no console") } - f := addFile(h, fd) - return uintptr(unsafe.Pointer(f)) + return addFile(h, fd) } if fd == unistd.STDERR_FILENO { h, err := syscall.GetStdHandle(syscall.STD_ERROR_HANDLE) if err != nil { panic("no console") } - f := addFile(h, fd) - return uintptr(unsafe.Pointer(f)) + return addFile(h, fd) } // should not get here -- unless newFile diff --git a/vendor/modernc.org/libc/limits/capi_freebsd_amd64.go b/vendor/modernc.org/libc/limits/capi_freebsd_amd64.go new file mode 100644 index 000000000..59d869084 --- /dev/null +++ b/vendor/modernc.org/libc/limits/capi_freebsd_amd64.go @@ -0,0 +1,5 @@ +// Code generated by 'ccgo limits/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 limits/limits_freebsd_amd64.go -pkgname limits', DO NOT EDIT. + +package limits + +var CAPI = map[string]struct{}{} diff --git a/vendor/modernc.org/libc/limits/limits_freebsd_amd64.go b/vendor/modernc.org/libc/limits/limits_freebsd_amd64.go new file mode 100644 index 000000000..732fa2a91 --- /dev/null +++ b/vendor/modernc.org/libc/limits/limits_freebsd_amd64.go @@ -0,0 +1,574 @@ +// Code generated by 'ccgo limits/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 limits/limits_freebsd_amd64.go -pkgname limits', DO NOT EDIT. + +package limits + +import ( + "math" + "reflect" + "sync/atomic" + "unsafe" +) + +var _ = math.Pi +var _ reflect.Kind +var _ atomic.Value +var _ unsafe.Pointer + +const ( + ARG_MAX = 524288 + BC_BASE_MAX = 99 + BC_DIM_MAX = 2048 + BC_SCALE_MAX = 99 + BC_STRING_MAX = 1000 + CHARCLASS_NAME_MAX = 14 + CHAR_BIT = 8 + CHAR_MAX = 127 + CHAR_MIN = -128 + CHILD_MAX = 40 + COLL_WEIGHTS_MAX = 10 + EXPR_NEST_MAX = 32 + GID_MAX = 4294967295 + INT_MAX = 2147483647 + INT_MIN = -2147483648 + IOV_MAX = 1024 + LINE_MAX = 2048 + LLONG_MAX = 9223372036854775807 + LLONG_MIN = -9223372036854775808 + LONG_BIT = 64 + LONG_MAX = 9223372036854775807 + LONG_MIN = -9223372036854775808 + MAX_CANON = 255 + MAX_INPUT = 255 + MB_LEN_MAX = 6 + MQ_PRIO_MAX = 64 + NAME_MAX = 255 + NGROUPS_MAX = 1023 + NL_ARGMAX = 4096 + NL_LANGMAX = 31 + NL_MSGMAX = 32767 + NL_NMAX = 1 + NL_SETMAX = 255 + NL_TEXTMAX = 2048 + OFF_MAX = 9223372036854775807 + OFF_MIN = -9223372036854775808 + OPEN_MAX = 64 + PASS_MAX = 128 + PATH_MAX = 1024 + PIPE_BUF = 512 + QUAD_MAX = 9223372036854775807 + QUAD_MIN = -9223372036854775808 + RE_DUP_MAX = 255 + SCHAR_MAX = 127 + SCHAR_MIN = -128 + SHRT_MAX = 32767 + SHRT_MIN = -32768 + SIZE_T_MAX = 18446744073709551615 + SSIZE_MAX = 9223372036854775807 + UCHAR_MAX = 255 + UID_MAX = 4294967295 + UINT_MAX = 4294967295 + ULLONG_MAX = 18446744073709551615 + ULONG_MAX = 18446744073709551615 + UQUAD_MAX = 18446744073709551615 + USHRT_MAX = 65535 + WORD_BIT = 32 + X_FILE_OFFSET_BITS = 64 + X_LIMITS_H_ = 0 + X_LP64 = 1 + X_MACHINE__LIMITS_H_ = 0 + X_Nonnull = 0 + X_Null_unspecified = 0 + X_Nullable = 0 + X_POSIX2_BC_BASE_MAX = 99 + X_POSIX2_BC_DIM_MAX = 2048 + X_POSIX2_BC_SCALE_MAX = 99 + X_POSIX2_BC_STRING_MAX = 1000 + X_POSIX2_CHARCLASS_NAME_MAX = 14 + X_POSIX2_COLL_WEIGHTS_MAX = 2 + X_POSIX2_EQUIV_CLASS_MAX = 2 + X_POSIX2_EXPR_NEST_MAX = 32 + X_POSIX2_LINE_MAX = 2048 + X_POSIX2_RE_DUP_MAX = 255 + X_POSIX_AIO_LISTIO_MAX = 2 + X_POSIX_AIO_MAX = 1 + X_POSIX_ARG_MAX = 4096 + X_POSIX_CHILD_MAX = 25 + X_POSIX_CLOCKRES_MIN = 20000000 + X_POSIX_DELAYTIMER_MAX = 32 + X_POSIX_HOST_NAME_MAX = 255 + X_POSIX_LINK_MAX = 8 + X_POSIX_LOGIN_NAME_MAX = 9 + X_POSIX_MAX_CANON = 255 + X_POSIX_MAX_INPUT = 255 + X_POSIX_MQ_OPEN_MAX = 8 + X_POSIX_MQ_PRIO_MAX = 32 + X_POSIX_NAME_MAX = 14 + X_POSIX_NGROUPS_MAX = 8 + X_POSIX_OPEN_MAX = 20 + X_POSIX_PATH_MAX = 256 + X_POSIX_PIPE_BUF = 512 + X_POSIX_RE_DUP_MAX = 255 + X_POSIX_RTSIG_MAX = 8 + X_POSIX_SEM_NSEMS_MAX = 256 + X_POSIX_SEM_VALUE_MAX = 32767 + X_POSIX_SIGQUEUE_MAX = 32 + X_POSIX_SSIZE_MAX = 32767 + X_POSIX_SS_REPL_MAX = 4 + X_POSIX_STREAM_MAX = 8 + X_POSIX_SYMLINK_MAX = 255 + X_POSIX_SYMLOOP_MAX = 8 + X_POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4 + X_POSIX_THREAD_KEYS_MAX = 128 + X_POSIX_THREAD_THREADS_MAX = 64 + X_POSIX_TIMER_MAX = 32 + X_POSIX_TRACE_EVENT_NAME_MAX = 30 + X_POSIX_TRACE_NAME_MAX = 8 + X_POSIX_TRACE_SYS_MAX = 8 + X_POSIX_TRACE_USER_EVENT_MAX = 32 + X_POSIX_TTY_NAME_MAX = 9 + X_POSIX_TZNAME_MAX = 6 + X_SYS_CDEFS_H_ = 0 + X_SYS_LIMITS_H_ = 0 + X_SYS_SYSLIMITS_H_ = 0 + X_XOPEN_IOV_MAX = 16 + X_XOPEN_NAME_MAX = 255 + X_XOPEN_PATH_MAX = 1024 + Unix = 1 +) + +type Ptrdiff_t = int64 /* <builtin>:3:26 */ + +type Size_t = uint64 /* <builtin>:9:23 */ + +type Wchar_t = int32 /* <builtin>:15:24 */ + +type X__int128_t = struct { + Flo int64 + Fhi int64 +} /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128 +type X__uint128_t = struct { + Flo uint64 + Fhi uint64 +} /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128 + +type X__builtin_va_list = uintptr /* <builtin>:46:14 */ +type X__float128 = float64 /* <builtin>:47:21 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1988, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)limits.h 8.2 (Berkeley) 1/4/94 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// Testing against Clang-specific extensions. + +// This code has been put in place to help reduce the addition of +// compiler specific defines in FreeBSD code. It helps to aid in +// having a compiler-agnostic source tree. + +// Compiler memory barriers, specific to gcc and clang. + +// XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced + +// Macro to test if we're using a specific version of gcc or later. + +// The __CONCAT macro is used to concatenate parts of symbol names, e.g. +// with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. +// The __CONCAT macro is a bit tricky to use if it must work in non-ANSI +// mode -- there must be no spaces between its arguments, and for nested +// __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also +// concatenate double-quoted strings produced by the __STRING macro, but +// this only works with ANSI C. +// +// __XSTRING is like __STRING, but it expands any macros in its argument +// first. It is only available with ANSI C. + +// Compiler-dependent macros to help declare dead (non-returning) and +// pure (no side effects) functions, and unused variables. They are +// null except for versions of gcc that are known to support the features +// properly (old versions of gcc-2 supported the dead and pure features +// in a different (wrong) way). If we do not provide an implementation +// for a given compiler, let the compile fail if it is told to use +// a feature that we cannot live without. + +// Keywords added in C11. + +// Emulation of C11 _Generic(). Unlike the previously defined C11 +// keywords, it is not possible to implement this using exactly the same +// syntax. Therefore implement something similar under the name +// __generic(). Unlike _Generic(), this macro can only distinguish +// between a single type, so it requires nested invocations to +// distinguish multiple cases. + +// C99 Static array indices in function parameter declarations. Syntax such as: +// void bar(int myArray[static 10]); +// is allowed in C99 but not in C++. Define __min_size appropriately so +// headers using it can be compiled in either language. Use like this: +// void bar(int myArray[__min_size(10)]); + +// XXX: should use `#if __STDC_VERSION__ < 199901'. + +// C++11 exposes a load of C99 stuff + +// GCC 2.95 provides `__restrict' as an extension to C90 to support the +// C99-specific `restrict' type qualifier. We happen to use `__restrict' as +// a way to define the `restrict' type qualifier without disturbing older +// software that is unaware of C99 keywords. + +// GNU C version 2.96 adds explicit branch prediction so that +// the CPU back-end can hint the processor and also so that +// code blocks can be reordered such that the predicted path +// sees a more linear flow, thus improving cache behavior, etc. +// +// The following two macros provide us with a way to utilize this +// compiler feature. Use __predict_true() if you expect the expression +// to evaluate to true, and __predict_false() if you expect the +// expression to evaluate to false. +// +// A few notes about usage: +// +// * Generally, __predict_false() error condition checks (unless +// you have some _strong_ reason to do otherwise, in which case +// document it), and/or __predict_true() `no-error' condition +// checks, assuming you want to optimize for the no-error case. +// +// * Other than that, if you don't know the likelihood of a test +// succeeding from empirical or other `hard' evidence, don't +// make predictions. +// +// * These are meant to be used in places that are run `a lot'. +// It is wasteful to make predictions in code that is run +// seldomly (e.g. at subsystem initialization time) as the +// basic block reordering that this affects can often generate +// larger code. + +// We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h> +// require it. + +// Given the pointer x to the member m of the struct s, return +// a pointer to the containing structure. When using GCC, we first +// assign pointer x to a local variable, to check that its type is +// compatible with member m. + +// Compiler-dependent macros to declare that functions take printf-like +// or scanf-like arguments. They are null except for versions of gcc +// that are known to support the features properly (old versions of gcc-2 +// didn't permit keeping the keywords out of the application namespace). + +// Compiler-dependent macros that rely on FreeBSD-specific extensions. + +// Embed the rcs id of a source file in the resulting library. Note that in +// more recent ELF binutils, we use .ident allowing the ID to be stripped. +// Usage: +// __FBSDID("$FreeBSD$"); + +// - +// The following definitions are an extension of the behavior originally +// implemented in <sys/_posix.h>, but with a different level of granularity. +// POSIX.1 requires that the macros we test be defined before any standard +// header file is included. +// +// Here's a quick run-down of the versions: +// defined(_POSIX_SOURCE) 1003.1-1988 +// _POSIX_C_SOURCE == 1 1003.1-1990 +// _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option +// _POSIX_C_SOURCE == 199309 1003.1b-1993 +// _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, +// and the omnibus ISO/IEC 9945-1: 1996 +// _POSIX_C_SOURCE == 200112 1003.1-2001 +// _POSIX_C_SOURCE == 200809 1003.1-2008 +// +// In addition, the X/Open Portability Guide, which is now the Single UNIX +// Specification, defines a feature-test macro which indicates the version of +// that specification, and which subsumes _POSIX_C_SOURCE. +// +// Our macros begin with two underscores to avoid namespace screwage. + +// Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. + +// Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. + +// Deal with various X/Open Portability Guides and Single UNIX Spec. + +// Deal with all versions of POSIX. The ordering relative to the tests above is +// important. +// - +// Deal with _ANSI_SOURCE: +// If it is defined, and no other compilation environment is explicitly +// requested, then define our internal feature-test macros to zero. This +// makes no difference to the preprocessor (undefined symbols in preprocessing +// expressions are defined to have value zero), but makes it more convenient for +// a test program to print out the values. +// +// If a program mistakenly defines _ANSI_SOURCE and some other macro such as +// _POSIX_C_SOURCE, we will assume that it wants the broader compilation +// environment (and in fact we will never get here). + +// User override __EXT1_VISIBLE + +// Old versions of GCC use non-standard ARM arch symbols; acle-compat.h +// translates them to __ARM_ARCH and the modern feature symbols defined by ARM. + +// Nullability qualifiers: currently only supported by Clang. + +// Type Safety Checking +// +// Clang provides additional attributes to enable checking type safety +// properties that cannot be enforced by the C type system. + +// Lock annotations. +// +// Clang provides support for doing basic thread-safety tests at +// compile-time, by marking which locks will/should be held when +// entering/leaving a functions. +// +// Furthermore, it is also possible to annotate variables and structure +// members to enforce that they are only accessed when certain locks are +// held. + +// Structure implements a lock. + +// Function acquires an exclusive or shared lock. + +// Function attempts to acquire an exclusive or shared lock. + +// Function releases a lock. + +// Function asserts that an exclusive or shared lock is held. + +// Function requires that an exclusive or shared lock is or is not held. + +// Function should not be analyzed. + +// Function or variable should not be sanitized, i.e. by AddressSanitizer. +// GCC has the nosanitize attribute, but as a function attribute only, and +// warns on use as a variable attribute. + +// Guard variables and structure members by lock. + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1988, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1988, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)limits.h 8.3 (Berkeley) 1/4/94 +// $FreeBSD$ + +// According to ANSI (section 2.2.4.2), the values below must be usable by +// #if preprocessing directives. Additionally, the expression must have the +// same type as would an expression that is an object of the corresponding +// type converted according to the integral promotions. The subtraction for +// INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an +// unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). + +// max value for an unsigned long long + +// Quads and longs are the same on the amd64. Ensure they stay in sync. + +// Minimum signal stack size. + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1988, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)syslimits.h 8.1 (Berkeley) 6/2/93 +// $FreeBSD$ + +// Do not add any new variables here. (See the comment at the end of +// the file for why.) + +// We leave the following values undefined to force applications to either +// assume conservative values or call sysconf() to get the current value. +// +// HOST_NAME_MAX +// +// (We should do this for most of the values currently defined here, +// but many programs are not prepared to deal with this yet.) + +var _ int8 /* gen.c:2:13: */ diff --git a/vendor/modernc.org/libc/mem.go b/vendor/modernc.org/libc/mem.go index 23c2ec060..50056c75c 100644 --- a/vendor/modernc.org/libc/mem.go +++ b/vendor/modernc.org/libc/mem.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !libc.membrk && !libc.memgrind // +build !libc.membrk,!libc.memgrind package libc // import "modernc.org/libc" diff --git a/vendor/modernc.org/libc/mem_brk.go b/vendor/modernc.org/libc/mem_brk.go index a9728db5b..860a1a0a0 100644 --- a/vendor/modernc.org/libc/mem_brk.go +++ b/vendor/modernc.org/libc/mem_brk.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build libc.membrk && !libc.memgrind // +build libc.membrk,!libc.memgrind // This is a debug-only version of the memory handling functions. When a diff --git a/vendor/modernc.org/libc/memgrind.go b/vendor/modernc.org/libc/memgrind.go index 535c9fe3e..70044c070 100644 --- a/vendor/modernc.org/libc/memgrind.go +++ b/vendor/modernc.org/libc/memgrind.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !libc.membrk && libc.memgrind // +build !libc.membrk,libc.memgrind // This is a debug-only version of the memory handling functions. When a diff --git a/vendor/modernc.org/libc/musl_freebsd_amd64.go b/vendor/modernc.org/libc/musl_freebsd_amd64.go new file mode 100644 index 000000000..c9d1b7ce0 --- /dev/null +++ b/vendor/modernc.org/libc/musl_freebsd_amd64.go @@ -0,0 +1,6755 @@ +// Code generated by 'ccgo -export-externs X -hide __syscall0,__syscall1,__syscall2,__syscall3,__syscall4,__syscall5,__syscall6,getnameinfo,gethostbyaddr_r, -nostdinc -nostdlib -o ../musl_freebsd_amd64.go -pkgname libc -static-locals-prefix _s -Iarch/x86_64 -Iarch/generic -Iobj/src/internal -Isrc/include -Isrc/internal -Iobj/include -Iinclude copyright.c ../freebsd/table.cpp.c src/ctype/isalnum.c src/ctype/isalpha.c src/ctype/isdigit.c src/internal/floatscan.c src/internal/intscan.c src/internal/shgetc.c src/math/copysignl.c src/math/fabsl.c src/math/fmodl.c src/math/scalbn.c src/math/scalbnl.c src/network/freeaddrinfo.c src/network/getaddrinfo.c src/network/gethostbyaddr.c src/network/gethostbyaddr_r.c src/network/gethostbyname.c src/network/gethostbyname2.c src/network/gethostbyname2_r.c src/network/getnameinfo.c src/network/h_errno.c src/network/inet_aton.c src/network/inet_ntop.c src/network/inet_pton.c src/network/lookup_ipliteral.c src/network/lookup_name.c src/network/lookup_serv.c src/stdio/__toread.c src/stdio/__uflow.c src/stdlib/strtod.c src/stdlib/strtol.c src/string/strdup.c src/string/strnlen.c src/string/strspn.c', DO NOT EDIT. + +package libc + +import ( + "math" + "reflect" + "sync/atomic" + "unsafe" +) + +var _ = math.Pi +var _ reflect.Kind +var _ atomic.Value +var _ unsafe.Pointer + +// musl as a whole is licensed under the following standard MIT license: +// +// ---------------------------------------------------------------------- +// Copyright © 2005-2020 Rich Felker, et al. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// ---------------------------------------------------------------------- +// +// Authors/contributors include: +// +// A. Wilcox +// Ada Worcester +// Alex Dowad +// Alex Suykov +// Alexander Monakov +// Andre McCurdy +// Andrew Kelley +// Anthony G. Basile +// Aric Belsito +// Arvid Picciani +// Bartosz Brachaczek +// Benjamin Peterson +// Bobby Bingham +// Boris Brezillon +// Brent Cook +// Chris Spiegel +// Clément Vasseur +// Daniel Micay +// Daniel Sabogal +// Daurnimator +// David Carlier +// David Edelsohn +// Denys Vlasenko +// Dmitry Ivanov +// Dmitry V. Levin +// Drew DeVault +// Emil Renner Berthing +// Fangrui Song +// Felix Fietkau +// Felix Janda +// Gianluca Anzolin +// Hauke Mehrtens +// He X +// Hiltjo Posthuma +// Isaac Dunham +// Jaydeep Patil +// Jens Gustedt +// Jeremy Huntwork +// Jo-Philipp Wich +// Joakim Sindholt +// John Spencer +// Julien Ramseier +// Justin Cormack +// Kaarle Ritvanen +// Khem Raj +// Kylie McClain +// Leah Neukirchen +// Luca Barbato +// Luka Perkov +// M Farkas-Dyck (Strake) +// Mahesh Bodapati +// Markus Wichmann +// Masanori Ogino +// Michael Clark +// Michael Forney +// Mikhail Kremnyov +// Natanael Copa +// Nicholas J. Kain +// orc +// Pascal Cuoq +// Patrick Oppenlander +// Petr Hosek +// Petr Skocik +// Pierre Carrier +// Reini Urban +// Rich Felker +// Richard Pennington +// Ryan Fairfax +// Samuel Holland +// Segev Finer +// Shiz +// sin +// Solar Designer +// Stefan Kristiansson +// Stefan O'Rear +// Szabolcs Nagy +// Timo Teräs +// Trutz Behn +// Valentin Ochs +// Will Dietz +// William Haddon +// William Pitcock +// +// Portions of this software are derived from third-party works licensed +// under terms compatible with the above MIT license: +// +// The TRE regular expression implementation (src/regex/reg* and +// src/regex/tre*) is Copyright © 2001-2008 Ville Laurikari and licensed +// under a 2-clause BSD license (license text in the source files). The +// included version has been heavily modified by Rich Felker in 2012, in +// the interests of size, simplicity, and namespace cleanliness. +// +// Much of the math library code (src/math/* and src/complex/*) is +// Copyright © 1993,2004 Sun Microsystems or +// Copyright © 2003-2011 David Schultz or +// Copyright © 2003-2009 Steven G. Kargl or +// Copyright © 2003-2009 Bruce D. Evans or +// Copyright © 2008 Stephen L. Moshier or +// Copyright © 2017-2018 Arm Limited +// and labelled as such in comments in the individual source files. All +// have been licensed under extremely permissive terms. +// +// The ARM memcpy code (src/string/arm/memcpy.S) is Copyright © 2008 +// The Android Open Source Project and is licensed under a two-clause BSD +// license. It was taken from Bionic libc, used on Android. +// +// The AArch64 memcpy and memset code (src/string/aarch64/*) are +// Copyright © 1999-2019, Arm Limited. +// +// The implementation of DES for crypt (src/crypt/crypt_des.c) is +// Copyright © 1994 David Burren. It is licensed under a BSD license. +// +// The implementation of blowfish crypt (src/crypt/crypt_blowfish.c) was +// originally written by Solar Designer and placed into the public +// domain. The code also comes with a fallback permissive license for use +// in jurisdictions that may not recognize the public domain. +// +// The smoothsort implementation (src/stdlib/qsort.c) is Copyright © 2011 +// Valentin Ochs and is licensed under an MIT-style license. +// +// The x86_64 port was written by Nicholas J. Kain and is licensed under +// the standard MIT terms. +// +// The mips and microblaze ports were originally written by Richard +// Pennington for use in the ellcc project. The original code was adapted +// by Rich Felker for build system and code conventions during upstream +// integration. It is licensed under the standard MIT terms. +// +// The mips64 port was contributed by Imagination Technologies and is +// licensed under the standard MIT terms. +// +// The powerpc port was also originally written by Richard Pennington, +// and later supplemented and integrated by John Spencer. It is licensed +// under the standard MIT terms. +// +// All other files which have no copyright comments are original works +// produced specifically for use as part of this library, written either +// by Rich Felker, the main author of the library, or by one or more +// contibutors listed above. Details on authorship of individual files +// can be found in the git version control history of the project. The +// omission of copyright and license comments in each file is in the +// interest of source tree size. +// +// In addition, permission is hereby granted for all public header files +// (include/* and arch/*/bits/*) and crt files intended to be linked into +// applications (crt/*, ldso/dlstart.c, and arch/*/crt_arch.h) to omit +// the copyright notice and permission notice otherwise required by the +// license, and to use these files without any requirement of +// attribution. These files include substantial contributions from: +// +// Bobby Bingham +// John Spencer +// Nicholas J. Kain +// Rich Felker +// Richard Pennington +// Stefan Kristiansson +// Szabolcs Nagy +// +// all of whom have explicitly granted such permission. +// +// This file previously contained text expressing a belief that most of +// the files covered by the above exception were sufficiently trivial not +// to be subject to copyright, resulting in confusion over whether it +// negated the permissions granted in the license. In the spirit of +// permissive licensing, and of not having licensing issues being an +// obstacle to adoption, that text has been removed. +const ( /* copyright.c:194:1: */ + __musl__copyright__ = 0 +) + +const ( /* nameser.h:117:1: */ + ns_uop_delete = 0 + ns_uop_add = 1 + ns_uop_max = 2 +) + +const ( /* nameser.h:147:1: */ + ns_t_invalid = 0 + ns_t_a = 1 + ns_t_ns = 2 + ns_t_md = 3 + ns_t_mf = 4 + ns_t_cname = 5 + ns_t_soa = 6 + ns_t_mb = 7 + ns_t_mg = 8 + ns_t_mr = 9 + ns_t_null = 10 + ns_t_wks = 11 + ns_t_ptr = 12 + ns_t_hinfo = 13 + ns_t_minfo = 14 + ns_t_mx = 15 + ns_t_txt = 16 + ns_t_rp = 17 + ns_t_afsdb = 18 + ns_t_x25 = 19 + ns_t_isdn = 20 + ns_t_rt = 21 + ns_t_nsap = 22 + ns_t_nsap_ptr = 23 + ns_t_sig = 24 + ns_t_key = 25 + ns_t_px = 26 + ns_t_gpos = 27 + ns_t_aaaa = 28 + ns_t_loc = 29 + ns_t_nxt = 30 + ns_t_eid = 31 + ns_t_nimloc = 32 + ns_t_srv = 33 + ns_t_atma = 34 + ns_t_naptr = 35 + ns_t_kx = 36 + ns_t_cert = 37 + ns_t_a6 = 38 + ns_t_dname = 39 + ns_t_sink = 40 + ns_t_opt = 41 + ns_t_apl = 42 + ns_t_tkey = 249 + ns_t_tsig = 250 + ns_t_ixfr = 251 + ns_t_axfr = 252 + ns_t_mailb = 253 + ns_t_maila = 254 + ns_t_any = 255 + ns_t_zxfr = 256 + ns_t_max = 65536 +) + +const ( /* nameser.h:210:1: */ + ns_c_invalid = 0 + ns_c_in = 1 + ns_c_2 = 2 + ns_c_chaos = 3 + ns_c_hs = 4 + ns_c_none = 254 + ns_c_any = 255 + ns_c_max = 65536 +) + +const ( /* nameser.h:221:1: */ + ns_kt_rsa = 1 + ns_kt_dh = 2 + ns_kt_dsa = 3 + ns_kt_private = 254 +) + +const ( /* nameser.h:228:1: */ + cert_t_pkix = 1 + cert_t_spki = 2 + cert_t_pgp = 3 + cert_t_url = 253 + cert_t_oid = 254 +) + +const ( /* nameser.h:28:1: */ + ns_s_qd = 0 + ns_s_zn = 0 + ns_s_an = 1 + ns_s_pr = 1 + ns_s_ns = 2 + ns_s_ud = 2 + ns_s_ar = 3 + ns_s_max = 4 +) + +const ( /* nameser.h:75:1: */ + ns_f_qr = 0 + ns_f_opcode = 1 + ns_f_aa = 2 + ns_f_tc = 3 + ns_f_rd = 4 + ns_f_ra = 5 + ns_f_z = 6 + ns_f_ad = 7 + ns_f_cd = 8 + ns_f_rcode = 9 + ns_f_max = 10 +) + +const ( /* nameser.h:89:1: */ + ns_o_query = 0 + ns_o_iquery = 1 + ns_o_status = 2 + ns_o_notify = 4 + ns_o_update = 5 + ns_o_max = 6 +) + +const ( /* nameser.h:98:1: */ + ns_r_noerror = 0 + ns_r_formerr = 1 + ns_r_servfail = 2 + ns_r_nxdomain = 3 + ns_r_notimpl = 4 + ns_r_refused = 5 + ns_r_yxdomain = 6 + ns_r_yxrrset = 7 + ns_r_nxrrset = 8 + ns_r_notauth = 9 + ns_r_notzone = 10 + ns_r_max = 11 + ns_r_badvers = 16 + ns_r_badsig = 16 + ns_r_badkey = 17 + ns_r_badtime = 18 +) + +type ptrdiff_t = int64 /* <builtin>:3:26 */ + +type size_t = uint64 /* <builtin>:9:23 */ + +type wchar_t = int32 /* <builtin>:15:24 */ + +/// typedef __ct_rune_t __wint_t; +/// +/// +/// +/// typedef __uint_least16_t __char16_t; +/// typedef __uint_least32_t __char32_t; +/// +/// +/// +/// +/// +/// +/// +/// typedef struct { +/// long long __max_align1 __attribute__((__aligned__(_Alignof(long long)))); +/// +/// long double __max_align2 __attribute__((__aligned__(_Alignof(long double)))); +/// +/// } __max_align_t; +/// +/// typedef __uint64_t __dev_t; +/// +/// typedef __uint32_t __fixpt_t; +/// +/// +/// +/// +/// +/// typedef union { +/// char __mbstate8[128]; +/// __int64_t _mbstateL; +/// } __mbstate_t; +/// +/// typedef __uintmax_t __rman_res_t; +/// +/// +/// +/// +/// +/// +/// typedef __builtin_va_list __va_list; +/// +/// +/// +/// +/// +/// +/// typedef __va_list __gnuc_va_list; +/// +/// +/// +/// +/// unsigned long ___runetype(__ct_rune_t) __attribute__((__pure__)); +/// __ct_rune_t ___tolower(__ct_rune_t) __attribute__((__pure__)); +/// __ct_rune_t ___toupper(__ct_rune_t) __attribute__((__pure__)); +/// +/// +/// extern int __mb_sb_limit; + +type _RuneEntry = struct { + __min int32 + __max int32 + __map int32 + _ [4]byte + __types uintptr +} /* table.cpp.c:290:3 */ + +type _RuneRange = struct { + __nranges int32 + _ [4]byte + __ranges uintptr +} /* table.cpp.c:295:3 */ + +type _RuneLocale = struct { + __magic [8]int8 + __encoding [32]int8 + __sgetrune uintptr + __sputrune uintptr + __invalid_rune int32 + _ [4]byte + __runetype [256]uint64 + __maplower [256]int32 + __mapupper [256]int32 + __runetype_ext _RuneRange + __maplower_ext _RuneRange + __mapupper_ext _RuneRange + __variable uintptr + __variable_len int32 + _ [4]byte +} /* table.cpp.c:320:3 */ +/// +/// extern const _RuneLocale _DefaultRuneLocale; +/// extern const _RuneLocale *_CurrentRuneLocale; +/// +/// +/// +/// extern _Thread_local const _RuneLocale *_ThreadRuneLocale; +/// static __inline const _RuneLocale *__getCurrentRuneLocale(void) +/// { +/// +/// if (_ThreadRuneLocale) +/// return _ThreadRuneLocale; +/// return _CurrentRuneLocale; +/// } +/// +/// +/// +/// +/// +/// static __inline int +/// __maskrune(__ct_rune_t _c, unsigned long _f) +/// { +/// return ((_c < 0 || _c >= (1 <<8 )) ? ___runetype(_c) : +/// (__getCurrentRuneLocale())->__runetype[_c]) & _f; +/// } +/// +/// static __inline int +/// __sbmaskrune(__ct_rune_t _c, unsigned long _f) +/// { +/// return (_c < 0 || _c >= __mb_sb_limit) ? 0 : +/// (__getCurrentRuneLocale())->__runetype[_c] & _f; +/// } +/// +/// static __inline int +/// __istype(__ct_rune_t _c, unsigned long _f) +/// { +/// return (!!__maskrune(_c, _f)); +/// } +/// +/// static __inline int +/// __sbistype(__ct_rune_t _c, unsigned long _f) +/// { +/// return (!!__sbmaskrune(_c, _f)); +/// } +/// +/// static __inline int +/// __isctype(__ct_rune_t _c, unsigned long _f) +/// { +/// return (_c < 0 || _c >= 128) ? 0 : +/// !!(_DefaultRuneLocale.__runetype[_c] & _f); +/// } +/// +/// static __inline __ct_rune_t +/// __toupper(__ct_rune_t _c) +/// { +/// return (_c < 0 || _c >= (1 <<8 )) ? ___toupper(_c) : +/// (__getCurrentRuneLocale())->__mapupper[_c]; +/// } +/// +/// static __inline __ct_rune_t +/// __sbtoupper(__ct_rune_t _c) +/// { +/// return (_c < 0 || _c >= __mb_sb_limit) ? _c : +/// (__getCurrentRuneLocale())->__mapupper[_c]; +/// } +/// +/// static __inline __ct_rune_t +/// __tolower(__ct_rune_t _c) +/// { +/// return (_c < 0 || _c >= (1 <<8 )) ? ___tolower(_c) : +/// (__getCurrentRuneLocale())->__maplower[_c]; +/// } +/// +/// static __inline __ct_rune_t +/// __sbtolower(__ct_rune_t _c) +/// { +/// return (_c < 0 || _c >= __mb_sb_limit) ? _c : +/// (__getCurrentRuneLocale())->__maplower[_c]; +/// } +/// +/// static __inline int +/// __wcwidth(__ct_rune_t _c) +/// { +/// unsigned int _x; +/// +/// if (_c == 0) +/// return (0); +/// _x = (unsigned int)__maskrune(_c, 0xe0000000L|0x00040000L); +/// if ((_x & 0xe0000000L) != 0) +/// return ((_x & 0xe0000000L) >> 30); +/// return ((_x & 0x00040000L) != 0 ? 1 : -1); +/// } +/// +/// +/// +/// int isalnum(int); +/// int isalpha(int); +/// int iscntrl(int); +/// int isdigit(int); +/// int isgraph(int); +/// int islower(int); +/// int isprint(int); +/// int ispunct(int); +/// int isspace(int); +/// int isupper(int); +/// int isxdigit(int); +/// int tolower(int); +/// int toupper(int); +/// +/// +/// int isascii(int); +/// int toascii(int); +/// +/// +/// +/// int isblank(int); +/// +/// +/// +/// int digittoint(int); +/// int ishexnumber(int); +/// int isideogram(int); +/// int isnumber(int); +/// int isphonogram(int); +/// int isrune(int); +/// int isspecial(int); +/// +/// +/// +/// +/// +/// typedef struct _xlocale *locale_t; +/// +/// +/// +/// +/// unsigned long ___runetype_l(__ct_rune_t, locale_t) __attribute__((__pure__)); +/// __ct_rune_t ___tolower_l(__ct_rune_t, locale_t) __attribute__((__pure__)); +/// __ct_rune_t ___toupper_l(__ct_rune_t, locale_t) __attribute__((__pure__)); +/// _RuneLocale *__runes_for_locale(locale_t, int*); +/// +/// inline int +/// __sbmaskrune_l(__ct_rune_t __c, unsigned long __f, locale_t __loc); +/// inline int +/// __sbistype_l(__ct_rune_t __c, unsigned long __f, locale_t __loc); +/// +/// inline int +/// __sbmaskrune_l(__ct_rune_t __c, unsigned long __f, locale_t __loc) +/// { +/// int __limit; +/// _RuneLocale *runes = __runes_for_locale(__loc, &__limit); +/// return (__c < 0 || __c >= __limit) ? 0 : +/// runes->__runetype[__c] & __f; +/// } +/// +/// inline int +/// __sbistype_l(__ct_rune_t __c, unsigned long __f, locale_t __loc) +/// { +/// return (!!__sbmaskrune_l(__c, __f, __loc)); +/// } +/// +/// +/// +/// +/// +/// +/// +/// inline int isalnum_l(int, locale_t); inline int isalnum_l(int __c, locale_t __l) { return __sbistype_l(__c, 0x00000100L|0x00000400L|0x00400000L, __l); } +/// inline int isalpha_l(int, locale_t); inline int isalpha_l(int __c, locale_t __l) { return __sbistype_l(__c, 0x00000100L, __l); } +/// inline int isblank_l(int, locale_t); inline int isblank_l(int __c, locale_t __l) { return __sbistype_l(__c, 0x00020000L, __l); } +/// inline int iscntrl_l(int, locale_t); inline int iscntrl_l(int __c, locale_t __l) { return __sbistype_l(__c, 0x00000200L, __l); } +/// inline int isdigit_l(int, locale_t); inline int isdigit_l(int __c, locale_t __l) { return __sbistype_l(__c, 0x00000400L, __l); } +/// inline int isgraph_l(int, locale_t); inline int isgraph_l(int __c, locale_t __l) { return __sbistype_l(__c, 0x00000800L, __l); } +/// inline int ishexnumber_l(int, locale_t); inline int ishexnumber_l(int __c, locale_t __l) { return __sbistype_l(__c, 0x00010000L, __l); } +/// inline int isideogram_l(int, locale_t); inline int isideogram_l(int __c, locale_t __l) { return __sbistype_l(__c, 0x00080000L, __l); } +/// inline int islower_l(int, locale_t); inline int islower_l(int __c, locale_t __l) { return __sbistype_l(__c, 0x00001000L, __l); } +/// inline int isnumber_l(int, locale_t); inline int isnumber_l(int __c, locale_t __l) { return __sbistype_l(__c, 0x00000400L|0x00400000L, __l); } +/// inline int isphonogram_l(int, locale_t); inline int isphonogram_l(int __c, locale_t __l) { return __sbistype_l(__c, 0x00200000L, __l); } +/// inline int isprint_l(int, locale_t); inline int isprint_l(int __c, locale_t __l) { return __sbistype_l(__c, 0x00040000L, __l); } +/// inline int ispunct_l(int, locale_t); inline int ispunct_l(int __c, locale_t __l) { return __sbistype_l(__c, 0x00002000L, __l); } +/// inline int isrune_l(int, locale_t); inline int isrune_l(int __c, locale_t __l) { return __sbistype_l(__c, 0xFFFFFF00L, __l); } +/// inline int isspace_l(int, locale_t); inline int isspace_l(int __c, locale_t __l) { return __sbistype_l(__c, 0x00004000L, __l); } +/// inline int isspecial_l(int, locale_t); inline int isspecial_l(int __c, locale_t __l) { return __sbistype_l(__c, 0x00100000L, __l); } +/// inline int isupper_l(int, locale_t); inline int isupper_l(int __c, locale_t __l) { return __sbistype_l(__c, 0x00008000L, __l); } +/// inline int isxdigit_l(int, locale_t); inline int isxdigit_l(int __c, locale_t __l) { return __sbistype_l(__c, 0x00010000L, __l); } +/// +/// inline int digittoint_l(int, locale_t); +/// inline int tolower_l(int, locale_t); +/// inline int toupper_l(int, locale_t); +/// +/// inline int digittoint_l(int __c, locale_t __l) +/// { return __sbmaskrune_l((__c), 0xFF, __l); } +/// +/// inline int tolower_l(int __c, locale_t __l) +/// { +/// int __limit; +/// _RuneLocale *__runes = __runes_for_locale(__l, &__limit); +/// return (__c < 0 || __c >= __limit) ? __c : +/// __runes->__maplower[__c]; +/// } +/// inline int toupper_l(int __c, locale_t __l) +/// { +/// int __limit; +/// _RuneLocale *__runes = __runes_for_locale(__l, &__limit); +/// return (__c < 0 || __c >= __limit) ? __c : +/// __runes->__mapupper[__c]; +/// } +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// typedef __mbstate_t mbstate_t; +/// +/// +/// +/// +/// typedef __size_t size_t; +/// +/// +/// +/// +/// +/// typedef __va_list va_list; +/// +/// +/// +/// +/// +/// +/// typedef ___wchar_t wchar_t; +/// +/// +/// +/// +/// +/// typedef __wint_t wint_t; +/// +/// typedef struct __sFILE FILE; +/// +/// struct tm; +/// +/// +/// wint_t btowc(int); +/// wint_t fgetwc(FILE *); +/// wchar_t * +/// fgetws(wchar_t * restrict, int, FILE * restrict); +/// wint_t fputwc(wchar_t, FILE *); +/// int fputws(const wchar_t * restrict, FILE * restrict); +/// int fwide(FILE *, int); +/// int fwprintf(FILE * restrict, const wchar_t * restrict, ...); +/// int fwscanf(FILE * restrict, const wchar_t * restrict, ...); +/// wint_t getwc(FILE *); +/// wint_t getwchar(void); +/// size_t mbrlen(const char * restrict, size_t, mbstate_t * restrict); +/// size_t mbrtowc(wchar_t * restrict, const char * restrict, size_t, +/// mbstate_t * restrict); +/// int mbsinit(const mbstate_t *); +/// size_t mbsrtowcs(wchar_t * restrict, const char ** restrict, size_t, +/// mbstate_t * restrict); +/// wint_t putwc(wchar_t, FILE *); +/// wint_t putwchar(wchar_t); +/// int swprintf(wchar_t * restrict, size_t n, const wchar_t * restrict, +/// ...); +/// int swscanf(const wchar_t * restrict, const wchar_t * restrict, ...); +/// wint_t ungetwc(wint_t, FILE *); +/// int vfwprintf(FILE * restrict, const wchar_t * restrict, +/// __va_list); +/// int vswprintf(wchar_t * restrict, size_t n, const wchar_t * restrict, +/// __va_list); +/// int vwprintf(const wchar_t * restrict, __va_list); +/// size_t wcrtomb(char * restrict, wchar_t, mbstate_t * restrict); +/// wchar_t *wcscat(wchar_t * restrict, const wchar_t * restrict); +/// wchar_t *wcschr(const wchar_t *, wchar_t) __attribute__((__pure__)); +/// int wcscmp(const wchar_t *, const wchar_t *) __attribute__((__pure__)); +/// int wcscoll(const wchar_t *, const wchar_t *); +/// wchar_t *wcscpy(wchar_t * restrict, const wchar_t * restrict); +/// size_t wcscspn(const wchar_t *, const wchar_t *) __attribute__((__pure__)); +/// size_t wcsftime(wchar_t * restrict, size_t, const wchar_t * restrict, +/// const struct tm * restrict); +/// size_t wcslen(const wchar_t *) __attribute__((__pure__)); +/// wchar_t *wcsncat(wchar_t * restrict, const wchar_t * restrict, +/// size_t); +/// int wcsncmp(const wchar_t *, const wchar_t *, size_t) __attribute__((__pure__)); +/// wchar_t *wcsncpy(wchar_t * restrict , const wchar_t * restrict, size_t); +/// wchar_t *wcspbrk(const wchar_t *, const wchar_t *) __attribute__((__pure__)); +/// wchar_t *wcsrchr(const wchar_t *, wchar_t) __attribute__((__pure__)); +/// size_t wcsrtombs(char * restrict, const wchar_t ** restrict, size_t, +/// mbstate_t * restrict); +/// size_t wcsspn(const wchar_t *, const wchar_t *) __attribute__((__pure__)); +/// wchar_t *wcsstr(const wchar_t * restrict, const wchar_t * restrict) +/// __attribute__((__pure__)); +/// size_t wcsxfrm(wchar_t * restrict, const wchar_t * restrict, size_t); +/// int wctob(wint_t); +/// double wcstod(const wchar_t * restrict, wchar_t ** restrict); +/// wchar_t *wcstok(wchar_t * restrict, const wchar_t * restrict, +/// wchar_t ** restrict); +/// long wcstol(const wchar_t * restrict, wchar_t ** restrict, int); +/// unsigned long +/// wcstoul(const wchar_t * restrict, wchar_t ** restrict, int); +/// wchar_t *wmemchr(const wchar_t *, wchar_t, size_t) __attribute__((__pure__)); +/// int wmemcmp(const wchar_t *, const wchar_t *, size_t) __attribute__((__pure__)); +/// wchar_t *wmemcpy(wchar_t * restrict, const wchar_t * restrict, size_t); +/// wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t); +/// wchar_t *wmemset(wchar_t *, wchar_t, size_t); +/// int wprintf(const wchar_t * restrict, ...); +/// int wscanf(const wchar_t * restrict, ...); +/// +/// +/// extern FILE *__stdinp; +/// extern FILE *__stdoutp; +/// extern FILE *__stderrp; +/// +/// int vfwscanf(FILE * restrict, const wchar_t * restrict, +/// __va_list); +/// int vswscanf(const wchar_t * restrict, const wchar_t * restrict, +/// __va_list); +/// int vwscanf(const wchar_t * restrict, __va_list); +/// float wcstof(const wchar_t * restrict, wchar_t ** restrict); +/// long double +/// wcstold(const wchar_t * restrict, wchar_t ** restrict); +/// +/// +/// long long +/// wcstoll(const wchar_t * restrict, wchar_t ** restrict, int); +/// +/// unsigned long long +/// wcstoull(const wchar_t * restrict, wchar_t ** restrict, int); +/// +/// +/// +/// +/// int wcswidth(const wchar_t *, size_t); +/// int wcwidth(wchar_t); +/// +/// +/// +/// +/// size_t mbsnrtowcs(wchar_t * restrict, const char ** restrict, size_t, +/// size_t, mbstate_t * restrict); +/// FILE *open_wmemstream(wchar_t **, size_t *); +/// wchar_t *wcpcpy(wchar_t * restrict, const wchar_t * restrict); +/// wchar_t *wcpncpy(wchar_t * restrict, const wchar_t * restrict, size_t); +/// wchar_t *wcsdup(const wchar_t *) __attribute__((__malloc__)); +/// int wcscasecmp(const wchar_t *, const wchar_t *); +/// int wcsncasecmp(const wchar_t *, const wchar_t *, size_t n); +/// size_t wcsnlen(const wchar_t *, size_t) __attribute__((__pure__)); +/// size_t wcsnrtombs(char * restrict, const wchar_t ** restrict, size_t, +/// size_t, mbstate_t * restrict); +/// +/// +/// +/// wchar_t *fgetwln(FILE * restrict, size_t * restrict); +/// size_t wcslcat(wchar_t *, const wchar_t *, size_t); +/// size_t wcslcpy(wchar_t *, const wchar_t *, size_t); +/// +/// +/// +/// +/// +/// int wcscasecmp_l(const wchar_t *, const wchar_t *, +/// locale_t); +/// int wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t, +/// locale_t); +/// int wcscoll_l(const wchar_t *, const wchar_t *, locale_t); +/// size_t wcsxfrm_l(wchar_t * restrict, +/// const wchar_t * restrict, size_t, locale_t); +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// struct lconv { +/// char *decimal_point; +/// char *thousands_sep; +/// char *grouping; +/// char *int_curr_symbol; +/// char *currency_symbol; +/// char *mon_decimal_point; +/// char *mon_thousands_sep; +/// char *mon_grouping; +/// char *positive_sign; +/// char *negative_sign; +/// char int_frac_digits; +/// char frac_digits; +/// char p_cs_precedes; +/// char p_sep_by_space; +/// char n_cs_precedes; +/// char n_sep_by_space; +/// char p_sign_posn; +/// char n_sign_posn; +/// char int_p_cs_precedes; +/// char int_n_cs_precedes; +/// char int_p_sep_by_space; +/// char int_n_sep_by_space; +/// char int_p_sign_posn; +/// char int_n_sign_posn; +/// }; +/// +/// +/// struct lconv *localeconv(void); +/// char *setlocale(int, const char *); +/// +/// +/// +/// +/// locale_t duplocale(locale_t base); +/// void freelocale(locale_t loc); +/// locale_t newlocale(int mask, const char *locale, locale_t base); +/// const char *querylocale(int mask, locale_t loc); +/// locale_t uselocale(locale_t loc); +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// wint_t btowc_l(int, locale_t); +/// wint_t fgetwc_l(FILE *, locale_t); +/// wchar_t *fgetws_l(wchar_t * restrict, int, FILE * restrict, +/// locale_t); +/// wint_t fputwc_l(wchar_t, FILE *, locale_t); +/// int fputws_l(const wchar_t * restrict, FILE * restrict, +/// locale_t); +/// int fwprintf_l(FILE * restrict, locale_t, +/// const wchar_t * restrict, ...); +/// int fwscanf_l(FILE * restrict, locale_t, +/// const wchar_t * restrict, ...); +/// wint_t getwc_l(FILE *, locale_t); +/// wint_t getwchar_l(locale_t); +/// size_t mbrlen_l(const char * restrict, size_t, +/// mbstate_t * restrict, locale_t); +/// size_t mbrtowc_l(wchar_t * restrict, +/// const char * restrict, size_t, +/// mbstate_t * restrict, locale_t); +/// int mbsinit_l(const mbstate_t *, locale_t); +/// size_t mbsrtowcs_l(wchar_t * restrict, +/// const char ** restrict, size_t, +/// mbstate_t * restrict, locale_t); +/// wint_t putwc_l(wchar_t, FILE *, locale_t); +/// wint_t putwchar_l(wchar_t, locale_t); +/// int swprintf_l(wchar_t * restrict, size_t n, locale_t, +/// const wchar_t * restrict, ...); +/// int swscanf_l(const wchar_t * restrict, locale_t, +/// const wchar_t * restrict, ...); +/// wint_t ungetwc_l(wint_t, FILE *, locale_t); +/// int vfwprintf_l(FILE * restrict, locale_t, +/// const wchar_t * restrict, __va_list); +/// int vswprintf_l(wchar_t * restrict, size_t n, locale_t, +/// const wchar_t * restrict, __va_list); +/// int vwprintf_l(locale_t, const wchar_t * restrict, +/// __va_list); +/// size_t wcrtomb_l(char * restrict, wchar_t, +/// mbstate_t * restrict, locale_t); +/// size_t wcsftime_l(wchar_t * restrict, size_t, +/// const wchar_t * restrict, +/// const struct tm * restrict, locale_t); +/// size_t wcsrtombs_l(char * restrict, +/// const wchar_t ** restrict, size_t, +/// mbstate_t * restrict, locale_t); +/// double wcstod_l(const wchar_t * restrict, +/// wchar_t ** restrict, locale_t); +/// long wcstol_l(const wchar_t * restrict, +/// wchar_t ** restrict, int, locale_t); +/// unsigned long wcstoul_l(const wchar_t * restrict, +/// wchar_t ** restrict, int, locale_t); +/// int wcswidth_l(const wchar_t *, size_t, locale_t); +/// int wctob_l(wint_t, locale_t); +/// int wcwidth_l(wchar_t, locale_t); +/// int wprintf_l(locale_t, const wchar_t * restrict, ...); +/// int wscanf_l(locale_t, const wchar_t * restrict, ...); +/// int vfwscanf_l(FILE * restrict, locale_t, +/// const wchar_t * restrict, __va_list); +/// int vswscanf_l(const wchar_t * restrict, locale_t, +/// const wchar_t *restrict, __va_list); +/// int vwscanf_l(locale_t, const wchar_t * restrict, +/// __va_list); +/// float wcstof_l(const wchar_t * restrict, +/// wchar_t ** restrict, locale_t); +/// long double wcstold_l(const wchar_t * restrict, +/// wchar_t ** restrict, locale_t); +/// long long wcstoll_l(const wchar_t * restrict, +/// wchar_t ** restrict, int, locale_t); +/// unsigned long long wcstoull_l(const wchar_t * restrict, +/// wchar_t ** restrict, int, locale_t); +/// size_t mbsnrtowcs_l(wchar_t * restrict, +/// const char ** restrict, size_t, size_t, +/// mbstate_t * restrict, locale_t); +/// size_t wcsnrtombs_l(char * restrict, +/// const wchar_t ** restrict, size_t, size_t, +/// mbstate_t * restrict, locale_t); +/// +/// +/// +/// +/// +/// struct lconv *localeconv_l(locale_t); +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// typedef __rune_t rune_t; +/// +/// typedef struct { +/// int quot; +/// int rem; +/// } div_t; +/// +/// typedef struct { +/// long quot; +/// long rem; +/// } ldiv_t; +/// +/// +/// +/// +/// +/// double atof_l(const char *, locale_t); +/// int atoi_l(const char *, locale_t); +/// long atol_l(const char *, locale_t); +/// long long atoll_l(const char *, locale_t); +/// int mblen_l(const char *, size_t, locale_t); +/// size_t mbstowcs_l(wchar_t * restrict, +/// const char * restrict, size_t, locale_t); +/// int mbtowc_l(wchar_t * restrict, +/// const char * restrict, size_t, locale_t); +/// double strtod_l(const char *, char **, locale_t); +/// float strtof_l(const char *, char **, locale_t); +/// long strtol_l(const char *, char **, int, locale_t); +/// long double strtold_l(const char *, char **, locale_t); +/// long long strtoll_l(const char *, char **, int, locale_t); +/// unsigned long strtoul_l(const char *, char **, int, locale_t); +/// unsigned long long strtoull_l(const char *, char **, int, locale_t); +/// size_t wcstombs_l(char * restrict, +/// const wchar_t * restrict, size_t, locale_t); +/// int wctomb_l(char *, wchar_t, locale_t); +/// +/// int ___mb_cur_max_l(locale_t); +/// +/// +/// extern int __mb_cur_max; +/// extern int ___mb_cur_max(void); +/// +/// +/// _Noreturn void abort(void); +/// int abs(int) __attribute__((__const__)); +/// int atexit(void (* )(void)); +/// double atof(const char *); +/// int atoi(const char *); +/// long atol(const char *); +/// void *bsearch(const void *, const void *, size_t, +/// size_t, int (*)(const void * , const void *)); +/// void *calloc(size_t, size_t) __attribute__((__malloc__)) __attribute__((__warn_unused_result__)) +/// __attribute__((__alloc_size__(1, 2))); +/// div_t div(int, int) __attribute__((__const__)); +/// _Noreturn void exit(int); +/// void free(void *); +/// char *getenv(const char *); +/// long labs(long) __attribute__((__const__)); +/// ldiv_t ldiv(long, long) __attribute__((__const__)); +/// void *malloc(size_t) __attribute__((__malloc__)) __attribute__((__warn_unused_result__)) __attribute__((__alloc_size__(1))); +/// int mblen(const char *, size_t); +/// size_t mbstowcs(wchar_t * restrict , const char * restrict, size_t); +/// int mbtowc(wchar_t * restrict, const char * restrict, size_t); +/// void qsort(void *, size_t, size_t, +/// int (* )(const void *, const void *)); +/// int rand(void); +/// void *realloc(void *, size_t) __attribute__((__warn_unused_result__)) __attribute__((__alloc_size__(2))); +/// void srand(unsigned); +/// double strtod(const char * restrict, char ** restrict); +/// float strtof(const char * restrict, char ** restrict); +/// long strtol(const char * restrict, char ** restrict, int); +/// long double +/// strtold(const char * restrict, char ** restrict); +/// unsigned long +/// strtoul(const char * restrict, char ** restrict, int); +/// int system(const char *); +/// int wctomb(char *, wchar_t); +/// size_t wcstombs(char * restrict, const wchar_t * restrict, size_t); +/// +/// typedef struct { +/// long long quot; +/// long long rem; +/// } lldiv_t; +/// +/// +/// long long +/// atoll(const char *); +/// +/// long long +/// llabs(long long) __attribute__((__const__)); +/// +/// lldiv_t lldiv(long long, long long) __attribute__((__const__)); +/// +/// long long +/// strtoll(const char * restrict, char ** restrict, int); +/// +/// unsigned long long +/// strtoull(const char * restrict, char ** restrict, int); +/// +/// +/// _Noreturn void _Exit(int); +/// +/// +/// +/// +/// +/// +/// void * aligned_alloc(size_t, size_t) __attribute__((__malloc__)) __attribute__((__alloc_align__(1))) +/// __attribute__((__alloc_size__(2))); +/// int at_quick_exit(void (*)(void)); +/// _Noreturn void +/// quick_exit(int); +/// +/// +/// +/// +/// +/// char *realpath(const char * restrict, char * restrict); +/// +/// +/// int rand_r(unsigned *); +/// +/// +/// int posix_memalign(void **, size_t, size_t); +/// int setenv(const char *, const char *, int); +/// int unsetenv(const char *); +/// +/// +/// +/// int getsubopt(char **, char *const *, char **); +/// +/// char *mkdtemp(char *); +/// +/// +/// +/// int mkstemp(char *); +/// +/// long a64l(const char *); +/// double drand48(void); +/// +/// double erand48(unsigned short[3]); +/// +/// +/// char *initstate(unsigned int, char *, size_t); +/// long jrand48(unsigned short[3]); +/// char *l64a(long); +/// void lcong48(unsigned short[7]); +/// long lrand48(void); +/// +/// char *mktemp(char *); +/// +/// +/// long mrand48(void); +/// long nrand48(unsigned short[3]); +/// int putenv(char *); +/// long random(void); +/// unsigned short +/// *seed48(unsigned short[3]); +/// char *setstate( char *); +/// void srand48(long); +/// void srandom(unsigned int); +/// +/// +/// +/// int grantpt(int); +/// int posix_openpt(int); +/// char *ptsname(int); +/// int unlockpt(int); +/// +/// +/// +/// int ptsname_r(int, char *, size_t); +/// +/// +/// +/// extern const char *malloc_conf; +/// extern void (*malloc_message)(void *, const char *); +/// +/// void abort2(const char *, int, void **) __attribute__((__noreturn__)); +/// __uint32_t +/// arc4random(void); +/// void arc4random_buf(void *, size_t); +/// __uint32_t +/// arc4random_uniform(__uint32_t); +/// +/// +/// +/// +/// +/// +/// char *getbsize(int *, long *); +/// +/// char *cgetcap(char *, const char *, int); +/// int cgetclose(void); +/// int cgetent(char **, char **, const char *); +/// int cgetfirst(char **, char **); +/// int cgetmatch(const char *, const char *); +/// int cgetnext(char **, char **); +/// int cgetnum(char *, const char *, long *); +/// int cgetset(const char *); +/// int cgetstr(char *, const char *, char **); +/// int cgetustr(char *, const char *, char **); +/// +/// int daemon(int, int); +/// int daemonfd(int, int); +/// char *devname(__dev_t, __mode_t); +/// char *devname_r(__dev_t, __mode_t, char *, int); +/// char *fdevname(int); +/// char *fdevname_r(int, char *, int); +/// int getloadavg(double [], int); +/// const char * +/// getprogname(void); +/// +/// int heapsort(void *, size_t, size_t, +/// int (* )(const void *, const void *)); +/// +/// +/// +/// +/// +/// +/// int l64a_r(long, char *, int); +/// int mergesort(void *, size_t, size_t, int (*)(const void *, const void *)); +/// +/// +/// +/// int mkostemp(char *, int); +/// int mkostemps(char *, int, int); +/// int mkostempsat(int, char *, int, int); +/// void qsort_r(void *, size_t, size_t, void *, +/// int (*)(void *, const void *, const void *)); +/// int radixsort(const unsigned char **, int, const unsigned char *, +/// unsigned); +/// void *reallocarray(void *, size_t, size_t) __attribute__((__warn_unused_result__)) +/// __attribute__((__alloc_size__(2, 3))); +/// void *reallocf(void *, size_t) __attribute__((__warn_unused_result__)) __attribute__((__alloc_size__(2))); +/// int rpmatch(const char *); +/// void setprogname(const char *); +/// int sradixsort(const unsigned char **, int, const unsigned char *, +/// unsigned); +/// void srandomdev(void); +/// long long +/// strtonum(const char *, long long, long long, const char **); +/// +/// +/// __int64_t +/// strtoq(const char *, char **, int); +/// __uint64_t +/// strtouq(const char *, char **, int); +/// +/// extern char *suboptarg; +/// +/// +/// +/// +/// +/// +/// typedef size_t rsize_t; +/// +/// +/// +/// +/// typedef int errno_t; +/// +/// +/// +/// typedef void (*constraint_handler_t)(const char * restrict, +/// void * restrict, errno_t); +/// +/// constraint_handler_t set_constraint_handler_s(constraint_handler_t handler); +/// +/// _Noreturn void abort_handler_s(const char * restrict, void * restrict, +/// errno_t); +/// +/// void ignore_handler_s(const char * restrict, void * restrict, errno_t); +/// +/// errno_t qsort_s(void *, rsize_t, rsize_t, +/// int (*)(const void *, const void *, void *), void *); +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// typedef __int8_t int8_t; +/// +/// +/// +/// +/// typedef __int16_t int16_t; +/// +/// +/// +/// +/// typedef __int32_t int32_t; +/// +/// +/// +/// +/// typedef __int64_t int64_t; +/// +/// +/// +/// +/// typedef __uint8_t uint8_t; +/// +/// +/// +/// +/// typedef __uint16_t uint16_t; +/// +/// +/// +/// +/// typedef __uint32_t uint32_t; +/// +/// +/// +/// +/// typedef __uint64_t uint64_t; +/// +/// +/// +/// +/// typedef __intptr_t intptr_t; +/// +/// +/// +/// typedef __uintptr_t uintptr_t; +/// +/// +/// +/// typedef __intmax_t intmax_t; +/// +/// +/// +/// typedef __uintmax_t uintmax_t; +/// +/// +/// typedef __int_least8_t int_least8_t; +/// typedef __int_least16_t int_least16_t; +/// typedef __int_least32_t int_least32_t; +/// typedef __int_least64_t int_least64_t; +/// +/// typedef __uint_least8_t uint_least8_t; +/// typedef __uint_least16_t uint_least16_t; +/// typedef __uint_least32_t uint_least32_t; +/// typedef __uint_least64_t uint_least64_t; +/// +/// typedef __int_fast8_t int_fast8_t; +/// typedef __int_fast16_t int_fast16_t; +/// typedef __int_fast32_t int_fast32_t; +/// typedef __int_fast64_t int_fast64_t; +/// +/// typedef __uint_fast8_t uint_fast8_t; +/// typedef __uint_fast16_t uint_fast16_t; +/// typedef __uint_fast32_t uint_fast32_t; +/// typedef __uint_fast64_t uint_fast64_t; +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// struct pthread; +/// struct pthread_attr; +/// struct pthread_cond; +/// struct pthread_cond_attr; +/// struct pthread_mutex; +/// struct pthread_mutex_attr; +/// struct pthread_once; +/// struct pthread_rwlock; +/// struct pthread_rwlockattr; +/// struct pthread_barrier; +/// struct pthread_barrier_attr; +/// struct pthread_spinlock; +/// +/// typedef struct pthread *pthread_t; +/// +/// +/// typedef struct pthread_attr *pthread_attr_t; +/// typedef struct pthread_mutex *pthread_mutex_t; +/// typedef struct pthread_mutex_attr *pthread_mutexattr_t; +/// typedef struct pthread_cond *pthread_cond_t; +/// typedef struct pthread_cond_attr *pthread_condattr_t; +/// typedef int pthread_key_t; +/// typedef struct pthread_once pthread_once_t; +/// typedef struct pthread_rwlock *pthread_rwlock_t; +/// typedef struct pthread_rwlockattr *pthread_rwlockattr_t; +/// typedef struct pthread_barrier *pthread_barrier_t; +/// typedef struct pthread_barrierattr *pthread_barrierattr_t; +/// typedef struct pthread_spinlock *pthread_spinlock_t; +/// +/// +/// +/// +/// +/// +/// +/// typedef void *pthread_addr_t; +/// typedef void *(*pthread_startroutine_t)(void *); +/// +/// +/// +/// +/// struct pthread_once { +/// int state; +/// pthread_mutex_t mutex; +/// }; +/// +/// +/// +/// typedef unsigned char u_char; +/// typedef unsigned short u_short; +/// typedef unsigned int u_int; +/// typedef unsigned long u_long; +/// +/// typedef unsigned short ushort; +/// typedef unsigned int uint; +/// +/// typedef __uint8_t u_int8_t; +/// typedef __uint16_t u_int16_t; +/// typedef __uint32_t u_int32_t; +/// typedef __uint64_t u_int64_t; +/// +/// typedef __uint64_t u_quad_t; +/// typedef __int64_t quad_t; +/// typedef quad_t * qaddr_t; +/// +/// typedef char * caddr_t; +/// typedef const char * c_caddr_t; +/// +/// +/// typedef __blksize_t blksize_t; +/// +/// +/// +/// typedef __cpuwhich_t cpuwhich_t; +/// typedef __cpulevel_t cpulevel_t; +/// typedef __cpusetid_t cpusetid_t; +/// +/// +/// typedef __blkcnt_t blkcnt_t; +/// +/// +/// +/// +/// typedef __clock_t clock_t; +/// +/// +/// +/// +/// typedef __clockid_t clockid_t; +/// +/// +/// +/// typedef __critical_t critical_t; +/// typedef __daddr_t daddr_t; +/// +/// +/// typedef __dev_t dev_t; +/// +/// +/// +/// +/// typedef __fflags_t fflags_t; +/// +/// +/// +/// typedef __fixpt_t fixpt_t; +/// +/// +/// typedef __fsblkcnt_t fsblkcnt_t; +/// typedef __fsfilcnt_t fsfilcnt_t; +/// +/// +/// +/// +/// typedef __gid_t gid_t; +/// +/// +/// +/// +/// typedef __uint32_t in_addr_t; +/// +/// +/// +/// +/// typedef __uint16_t in_port_t; +/// +/// +/// +/// +/// typedef __id_t id_t; +/// +/// +/// +/// +/// typedef __ino_t ino_t; +/// +/// +/// +/// +/// typedef __key_t key_t; +/// +/// +/// +/// +/// typedef __lwpid_t lwpid_t; +/// +/// +/// +/// +/// typedef __mode_t mode_t; +/// +/// +/// +/// +/// typedef __accmode_t accmode_t; +/// +/// +/// +/// +/// typedef __nlink_t nlink_t; +/// +/// +/// +/// +/// typedef __off_t off_t; +/// +/// +/// +/// +/// typedef __off64_t off64_t; +/// +/// +/// +/// +/// typedef __pid_t pid_t; +/// +/// +/// +/// typedef __register_t register_t; +/// +/// +/// typedef __rlim_t rlim_t; +/// +/// +/// +/// typedef __int64_t sbintime_t; +/// +/// typedef __segsz_t segsz_t; +/// +/// +/// +/// +/// +/// +/// +/// typedef __ssize_t ssize_t; +/// +/// +/// +/// +/// typedef __suseconds_t suseconds_t; +/// +/// +/// +/// +/// typedef __time_t time_t; +/// +/// +/// +/// +/// typedef __timer_t timer_t; +/// +/// +/// +/// +/// typedef __mqd_t mqd_t; +/// +/// +/// +/// typedef __u_register_t u_register_t; +/// +/// +/// typedef __uid_t uid_t; +/// +/// +/// +/// +/// typedef __useconds_t useconds_t; +/// +/// +/// +/// +/// +/// typedef unsigned long cap_ioctl_t; +/// +/// +/// +/// +/// struct cap_rights; +/// +/// typedef struct cap_rights cap_rights_t; +/// +/// typedef __uint64_t kpaddr_t; +/// typedef __uint64_t kvaddr_t; +/// typedef __uint64_t ksize_t; +/// typedef __int64_t kssize_t; +/// +/// typedef __vm_offset_t vm_offset_t; +/// typedef __uint64_t vm_ooffset_t; +/// typedef __vm_paddr_t vm_paddr_t; +/// typedef __uint64_t vm_pindex_t; +/// typedef __vm_size_t vm_size_t; +/// +/// typedef __rman_res_t rman_res_t; +/// +/// static __inline __uint16_t +/// __bitcount16(__uint16_t _x) +/// { +/// +/// _x = (_x & 0x5555) + ((_x & 0xaaaa) >> 1); +/// _x = (_x & 0x3333) + ((_x & 0xcccc) >> 2); +/// _x = (_x + (_x >> 4)) & 0x0f0f; +/// _x = (_x + (_x >> 8)) & 0x00ff; +/// return (_x); +/// } +/// +/// static __inline __uint32_t +/// __bitcount32(__uint32_t _x) +/// { +/// +/// _x = (_x & 0x55555555) + ((_x & 0xaaaaaaaa) >> 1); +/// _x = (_x & 0x33333333) + ((_x & 0xcccccccc) >> 2); +/// _x = (_x + (_x >> 4)) & 0x0f0f0f0f; +/// _x = (_x + (_x >> 8)); +/// _x = (_x + (_x >> 16)) & 0x000000ff; +/// return (_x); +/// } +/// +/// +/// static __inline __uint64_t +/// __bitcount64(__uint64_t _x) +/// { +/// +/// _x = (_x & 0x5555555555555555) + ((_x & 0xaaaaaaaaaaaaaaaa) >> 1); +/// _x = (_x & 0x3333333333333333) + ((_x & 0xcccccccccccccccc) >> 2); +/// _x = (_x + (_x >> 4)) & 0x0f0f0f0f0f0f0f0f; +/// _x = (_x + (_x >> 8)); +/// _x = (_x + (_x >> 16)); +/// _x = (_x + (_x >> 32)) & 0x000000ff; +/// return (_x); +/// } +/// +/// +/// +/// +/// +/// typedef struct __sigset { +/// __uint32_t __bits[4]; +/// } __sigset_t; +/// +/// +/// +/// struct timeval { +/// time_t tv_sec; +/// suseconds_t tv_usec; +/// }; +/// +/// +/// +/// +/// +/// struct timespec { +/// time_t tv_sec; +/// long tv_nsec; +/// }; +/// +/// +/// struct itimerspec { +/// struct timespec it_interval; +/// struct timespec it_value; +/// }; +/// +/// +/// typedef unsigned long __fd_mask; +/// +/// typedef __fd_mask fd_mask; +/// +/// +/// +/// +/// typedef __sigset_t sigset_t; +/// +/// typedef struct fd_set { +/// __fd_mask __fds_bits[(((1024) + (((sizeof(__fd_mask) * 8)) - 1)) / ((sizeof(__fd_mask) * 8)))]; +/// } fd_set; +/// +/// +/// int pselect(int, fd_set *restrict, fd_set *restrict, fd_set *restrict, +/// const struct timespec *restrict, const sigset_t *restrict); +/// +/// +/// +/// int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); +/// +/// +/// +/// +/// static __inline int +/// __major(dev_t _d) +/// { +/// return (((_d >> 32) & 0xffffff00) | ((_d >> 8) & 0xff)); +/// } +/// +/// static __inline int +/// __minor(dev_t _d) +/// { +/// return (((_d >> 24) & 0xff00) | (_d & 0xffff00ff)); +/// } +/// +/// static __inline dev_t +/// __makedev(int _Major, int _Minor) +/// { +/// return (((dev_t)(_Major & 0xffffff00) << 32) | ((_Major & 0xff) << 8) | +/// ((dev_t)(_Minor & 0xff00) << 24) | (_Minor & 0xffff00ff)); +/// } +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// int ftruncate(int, off_t); +/// +/// +/// +/// off_t lseek(int, off_t, int); +/// +/// +/// +/// void * mmap(void *, size_t, int, int, int, off_t); +/// +/// +/// +/// int truncate(const char *, off_t); +/// +/// +/// +/// +/// +/// +/// +/// +/// static __inline int atomic_cmpset_char(volatile u_char *dst, u_char expect, u_char src) { u_char res; __asm volatile( " " "lock ; " " " " cmpxchg %3,%1 ; " "# atomic_cmpset_" "char" " " : "=@cce" (res), "+m" (*dst), "+a" (expect) : "r" (src) : "memory", "cc"); return (res); } static __inline int atomic_fcmpset_char(volatile u_char *dst, u_char *expect, u_char src) { u_char res; __asm volatile( " " "lock ; " " " " cmpxchg %3,%1 ; " "# atomic_fcmpset_" "char" " " : "=@cce" (res), "+m" (*dst), "+a" (*expect) : "r" (src) : "memory", "cc"); return (res); }; +/// static __inline int atomic_cmpset_short(volatile u_short *dst, u_short expect, u_short src) { u_char res; __asm volatile( " " "lock ; " " " " cmpxchg %3,%1 ; " "# atomic_cmpset_" "short" " " : "=@cce" (res), "+m" (*dst), "+a" (expect) : "r" (src) : "memory", "cc"); return (res); } static __inline int atomic_fcmpset_short(volatile u_short *dst, u_short *expect, u_short src) { u_char res; __asm volatile( " " "lock ; " " " " cmpxchg %3,%1 ; " "# atomic_fcmpset_" "short" " " : "=@cce" (res), "+m" (*dst), "+a" (*expect) : "r" (src) : "memory", "cc"); return (res); }; +/// static __inline int atomic_cmpset_int(volatile u_int *dst, u_int expect, u_int src) { u_char res; __asm volatile( " " "lock ; " " " " cmpxchg %3,%1 ; " "# atomic_cmpset_" "int" " " : "=@cce" (res), "+m" (*dst), "+a" (expect) : "r" (src) : "memory", "cc"); return (res); } static __inline int atomic_fcmpset_int(volatile u_int *dst, u_int *expect, u_int src) { u_char res; __asm volatile( " " "lock ; " " " " cmpxchg %3,%1 ; " "# atomic_fcmpset_" "int" " " : "=@cce" (res), "+m" (*dst), "+a" (*expect) : "r" (src) : "memory", "cc"); return (res); }; +/// static __inline int atomic_cmpset_long(volatile u_long *dst, u_long expect, u_long src) { u_char res; __asm volatile( " " "lock ; " " " " cmpxchg %3,%1 ; " "# atomic_cmpset_" "long" " " : "=@cce" (res), "+m" (*dst), "+a" (expect) : "r" (src) : "memory", "cc"); return (res); } static __inline int atomic_fcmpset_long(volatile u_long *dst, u_long *expect, u_long src) { u_char res; __asm volatile( " " "lock ; " " " " cmpxchg %3,%1 ; " "# atomic_fcmpset_" "long" " " : "=@cce" (res), "+m" (*dst), "+a" (*expect) : "r" (src) : "memory", "cc"); return (res); }; +/// +/// +/// +/// +/// +/// static __inline u_int +/// atomic_fetchadd_int(volatile u_int *p, u_int v) +/// { +/// +/// __asm volatile( +/// " " "lock ; " " " +/// " xaddl %0,%1 ; " +/// "# atomic_fetchadd_int" +/// : "+r" (v), +/// "+m" (*p) +/// : : "cc"); +/// return (v); +/// } +/// +/// +/// +/// +/// +/// static __inline u_long +/// atomic_fetchadd_long(volatile u_long *p, u_long v) +/// { +/// +/// __asm volatile( +/// " " "lock ; " " " +/// " xaddq %0,%1 ; " +/// "# atomic_fetchadd_long" +/// : "+r" (v), +/// "+m" (*p) +/// : : "cc"); +/// return (v); +/// } +/// +/// static __inline int +/// atomic_testandset_int(volatile u_int *p, u_int v) +/// { +/// u_char res; +/// +/// __asm volatile( +/// " " "lock ; " " " +/// " btsl %2,%1 ; " +/// "# atomic_testandset_int" +/// : "=@ccc" (res), +/// "+m" (*p) +/// : "Ir" (v & 0x1f) +/// : "cc"); +/// return (res); +/// } +/// +/// static __inline int +/// atomic_testandset_long(volatile u_long *p, u_int v) +/// { +/// u_char res; +/// +/// __asm volatile( +/// " " "lock ; " " " +/// " btsq %2,%1 ; " +/// "# atomic_testandset_long" +/// : "=@ccc" (res), +/// "+m" (*p) +/// : "Jr" ((u_long)(v & 0x3f)) +/// : "cc"); +/// return (res); +/// } +/// +/// static __inline int +/// atomic_testandclear_int(volatile u_int *p, u_int v) +/// { +/// u_char res; +/// +/// __asm volatile( +/// " " "lock ; " " " +/// " btrl %2,%1 ; " +/// "# atomic_testandclear_int" +/// : "=@ccc" (res), +/// "+m" (*p) +/// : "Ir" (v & 0x1f) +/// : "cc"); +/// return (res); +/// } +/// +/// static __inline int +/// atomic_testandclear_long(volatile u_long *p, u_int v) +/// { +/// u_char res; +/// +/// __asm volatile( +/// " " "lock ; " " " +/// " btrq %2,%1 ; " +/// "# atomic_testandclear_long" +/// : "=@ccc" (res), +/// "+m" (*p) +/// : "Jr" ((u_long)(v & 0x3f)) +/// : "cc"); +/// return (res); +/// } +/// +/// static __inline void +/// __storeload_barrier(void) +/// { +/// +/// __asm volatile("lock; addl $0,-8(%%rsp)" : : : "memory", "cc"); +/// } +/// +/// static __inline void +/// atomic_thread_fence_acq(void) +/// { +/// +/// __asm volatile(" " : : : "memory"); +/// } +/// +/// static __inline void +/// atomic_thread_fence_rel(void) +/// { +/// +/// __asm volatile(" " : : : "memory"); +/// } +/// +/// static __inline void +/// atomic_thread_fence_acq_rel(void) +/// { +/// +/// __asm volatile(" " : : : "memory"); +/// } +/// +/// static __inline void +/// atomic_thread_fence_seq_cst(void) +/// { +/// +/// __storeload_barrier(); +/// } +/// +/// +/// +/// static __inline void atomic_set_char(volatile u_char *p, u_char v){ __asm volatile("lock ; " "orb %b1,%0" : "+m" (*p) : "iq" (v) : "cc"); } static __inline void atomic_set_barr_char(volatile u_char *p, u_char v){ __asm volatile("lock ; " "orb %b1,%0" : "+m" (*p) : "iq" (v) : "memory", "cc"); } struct __hack; +/// static __inline void atomic_clear_char(volatile u_char *p, u_char v){ __asm volatile("lock ; " "andb %b1,%0" : "+m" (*p) : "iq" (~v) : "cc"); } static __inline void atomic_clear_barr_char(volatile u_char *p, u_char v){ __asm volatile("lock ; " "andb %b1,%0" : "+m" (*p) : "iq" (~v) : "memory", "cc"); } struct __hack; +/// static __inline void atomic_add_char(volatile u_char *p, u_char v){ __asm volatile("lock ; " "addb %b1,%0" : "+m" (*p) : "iq" (v) : "cc"); } static __inline void atomic_add_barr_char(volatile u_char *p, u_char v){ __asm volatile("lock ; " "addb %b1,%0" : "+m" (*p) : "iq" (v) : "memory", "cc"); } struct __hack; +/// static __inline void atomic_subtract_char(volatile u_char *p, u_char v){ __asm volatile("lock ; " "subb %b1,%0" : "+m" (*p) : "iq" (v) : "cc"); } static __inline void atomic_subtract_barr_char(volatile u_char *p, u_char v){ __asm volatile("lock ; " "subb %b1,%0" : "+m" (*p) : "iq" (v) : "memory", "cc"); } struct __hack; +/// +/// static __inline void atomic_set_short(volatile u_short *p, u_short v){ __asm volatile("lock ; " "orw %w1,%0" : "+m" (*p) : "ir" (v) : "cc"); } static __inline void atomic_set_barr_short(volatile u_short *p, u_short v){ __asm volatile("lock ; " "orw %w1,%0" : "+m" (*p) : "ir" (v) : "memory", "cc"); } struct __hack; +/// static __inline void atomic_clear_short(volatile u_short *p, u_short v){ __asm volatile("lock ; " "andw %w1,%0" : "+m" (*p) : "ir" (~v) : "cc"); } static __inline void atomic_clear_barr_short(volatile u_short *p, u_short v){ __asm volatile("lock ; " "andw %w1,%0" : "+m" (*p) : "ir" (~v) : "memory", "cc"); } struct __hack; +/// static __inline void atomic_add_short(volatile u_short *p, u_short v){ __asm volatile("lock ; " "addw %w1,%0" : "+m" (*p) : "ir" (v) : "cc"); } static __inline void atomic_add_barr_short(volatile u_short *p, u_short v){ __asm volatile("lock ; " "addw %w1,%0" : "+m" (*p) : "ir" (v) : "memory", "cc"); } struct __hack; +/// static __inline void atomic_subtract_short(volatile u_short *p, u_short v){ __asm volatile("lock ; " "subw %w1,%0" : "+m" (*p) : "ir" (v) : "cc"); } static __inline void atomic_subtract_barr_short(volatile u_short *p, u_short v){ __asm volatile("lock ; " "subw %w1,%0" : "+m" (*p) : "ir" (v) : "memory", "cc"); } struct __hack; +/// +/// static __inline void atomic_set_int(volatile u_int *p, u_int v){ __asm volatile("lock ; " "orl %1,%0" : "+m" (*p) : "ir" (v) : "cc"); } static __inline void atomic_set_barr_int(volatile u_int *p, u_int v){ __asm volatile("lock ; " "orl %1,%0" : "+m" (*p) : "ir" (v) : "memory", "cc"); } struct __hack; +/// static __inline void atomic_clear_int(volatile u_int *p, u_int v){ __asm volatile("lock ; " "andl %1,%0" : "+m" (*p) : "ir" (~v) : "cc"); } static __inline void atomic_clear_barr_int(volatile u_int *p, u_int v){ __asm volatile("lock ; " "andl %1,%0" : "+m" (*p) : "ir" (~v) : "memory", "cc"); } struct __hack; +/// static __inline void atomic_add_int(volatile u_int *p, u_int v){ __asm volatile("lock ; " "addl %1,%0" : "+m" (*p) : "ir" (v) : "cc"); } static __inline void atomic_add_barr_int(volatile u_int *p, u_int v){ __asm volatile("lock ; " "addl %1,%0" : "+m" (*p) : "ir" (v) : "memory", "cc"); } struct __hack; +/// static __inline void atomic_subtract_int(volatile u_int *p, u_int v){ __asm volatile("lock ; " "subl %1,%0" : "+m" (*p) : "ir" (v) : "cc"); } static __inline void atomic_subtract_barr_int(volatile u_int *p, u_int v){ __asm volatile("lock ; " "subl %1,%0" : "+m" (*p) : "ir" (v) : "memory", "cc"); } struct __hack; +/// +/// static __inline void atomic_set_long(volatile u_long *p, u_long v){ __asm volatile("lock ; " "orq %1,%0" : "+m" (*p) : "er" (v) : "cc"); } static __inline void atomic_set_barr_long(volatile u_long *p, u_long v){ __asm volatile("lock ; " "orq %1,%0" : "+m" (*p) : "er" (v) : "memory", "cc"); } struct __hack; +/// static __inline void atomic_clear_long(volatile u_long *p, u_long v){ __asm volatile("lock ; " "andq %1,%0" : "+m" (*p) : "er" (~v) : "cc"); } static __inline void atomic_clear_barr_long(volatile u_long *p, u_long v){ __asm volatile("lock ; " "andq %1,%0" : "+m" (*p) : "er" (~v) : "memory", "cc"); } struct __hack; +/// static __inline void atomic_add_long(volatile u_long *p, u_long v){ __asm volatile("lock ; " "addq %1,%0" : "+m" (*p) : "er" (v) : "cc"); } static __inline void atomic_add_barr_long(volatile u_long *p, u_long v){ __asm volatile("lock ; " "addq %1,%0" : "+m" (*p) : "er" (v) : "memory", "cc"); } struct __hack; +/// static __inline void atomic_subtract_long(volatile u_long *p, u_long v){ __asm volatile("lock ; " "subq %1,%0" : "+m" (*p) : "er" (v) : "cc"); } static __inline void atomic_subtract_barr_long(volatile u_long *p, u_long v){ __asm volatile("lock ; " "subq %1,%0" : "+m" (*p) : "er" (v) : "memory", "cc"); } struct __hack; +/// +/// +/// +/// +/// +/// static __inline u_char atomic_load_acq_char(volatile u_char *p) { u_char res; res = *p; __asm volatile(" " : : : "memory"); return (res); } struct __hack; static __inline void atomic_store_rel_char(volatile u_char *p, u_char v) { __asm volatile(" " : : : "memory"); *p = v; } struct __hack; +/// static __inline u_short atomic_load_acq_short(volatile u_short *p) { u_short res; res = *p; __asm volatile(" " : : : "memory"); return (res); } struct __hack; static __inline void atomic_store_rel_short(volatile u_short *p, u_short v) { __asm volatile(" " : : : "memory"); *p = v; } struct __hack; +/// static __inline u_int atomic_load_acq_int(volatile u_int *p) { u_int res; res = *p; __asm volatile(" " : : : "memory"); return (res); } struct __hack; static __inline void atomic_store_rel_int(volatile u_int *p, u_int v) { __asm volatile(" " : : : "memory"); *p = v; } struct __hack; +/// static __inline u_long atomic_load_acq_long(volatile u_long *p) { u_long res; res = *p; __asm volatile(" " : : : "memory"); return (res); } struct __hack; static __inline void atomic_store_rel_long(volatile u_long *p, u_long v) { __asm volatile(" " : : : "memory"); *p = v; } struct __hack; +/// +/// static __inline u_int +/// atomic_swap_int(volatile u_int *p, u_int v) +/// { +/// +/// __asm volatile( +/// " xchgl %1,%0 ; " +/// "# atomic_swap_int" +/// : "+r" (v), +/// "+m" (*p)); +/// return (v); +/// } +/// +/// static __inline u_long +/// atomic_swap_long(volatile u_long *p, u_long v) +/// { +/// +/// __asm volatile( +/// " xchgq %1,%0 ; " +/// "# atomic_swap_long" +/// : "+r" (v), +/// "+m" (*p)); +/// return (v); +/// } +/// +/// +/// +/// +/// +/// extern char *_PathLocale; +/// +/// int __detect_path_locale(void); +/// int __wrap_setrunelocale(const char *); +/// +/// +/// enum { +/// XLC_COLLATE = 0, +/// XLC_CTYPE, +/// XLC_MONETARY, +/// XLC_NUMERIC, +/// XLC_TIME, +/// XLC_MESSAGES, +/// XLC_LAST +/// }; +/// +/// _Static_assert(XLC_LAST - XLC_COLLATE == 6, "XLC values should be contiguous"); +/// _Static_assert(XLC_COLLATE == +/// +/// 1 +/// +/// - 1, +/// "XLC_COLLATE doesn't match the LC_COLLATE value."); +/// _Static_assert(XLC_CTYPE == +/// +/// 2 +/// +/// - 1, +/// "XLC_CTYPE doesn't match the LC_CTYPE value."); +/// _Static_assert(XLC_MONETARY == +/// +/// 3 +/// +/// - 1, +/// "XLC_MONETARY doesn't match the LC_MONETARY value."); +/// _Static_assert(XLC_NUMERIC == +/// +/// 4 +/// +/// - 1, +/// "XLC_NUMERIC doesn't match the LC_NUMERIC value."); +/// _Static_assert(XLC_TIME == +/// +/// 5 +/// +/// - 1, +/// "XLC_TIME doesn't match the LC_TIME value."); +/// _Static_assert(XLC_MESSAGES == +/// +/// 6 +/// +/// - 1, +/// "XLC_MESSAGES doesn't match the LC_MESSAGES value."); +/// +/// struct xlocale_refcounted { +/// +/// long retain_count; +/// +/// void(*destructor)(void*); +/// }; +/// +/// +/// +/// +/// +/// +/// +/// struct xlocale_component { +/// struct xlocale_refcounted header; +/// +/// char locale[31 +1]; +/// +/// char version[12]; +/// }; +/// +/// +/// +/// +/// struct _xlocale { +/// struct xlocale_refcounted header; +/// +/// struct xlocale_component *components[XLC_LAST]; +/// +/// +/// int monetary_locale_changed; +/// +/// +/// int using_monetary_locale; +/// +/// +/// int numeric_locale_changed; +/// +/// +/// int using_numeric_locale; +/// +/// +/// int using_time_locale; +/// +/// +/// int using_messages_locale; +/// +/// struct lconv lconv; +/// +/// char *csym; +/// }; +/// +/// +/// +/// +/// __attribute__((unused)) static void* +/// xlocale_retain(void *val) +/// { +/// struct xlocale_refcounted *obj = val; +/// atomic_add_long(&(obj->retain_count), 1); +/// return (val); +/// } +/// +/// +/// +/// +/// __attribute__((unused)) static void +/// xlocale_release(void *val) +/// { +/// struct xlocale_refcounted *obj = val; +/// long count; +/// +/// count = atomic_fetchadd_long(&(obj->retain_count), -1) - 1; +/// if (count < 0 && obj->destructor != +/// +/// ((void *)0) +/// +/// ) +/// obj->destructor(obj); +/// } +/// +/// +/// +/// +/// +/// extern void* __collate_load(const char*, locale_t); +/// extern void* __ctype_load(const char*, locale_t); +/// extern void* __messages_load(const char*, locale_t); +/// extern void* __monetary_load(const char*, locale_t); +/// extern void* __numeric_load(const char*, locale_t); +/// extern void* __time_load(const char*, locale_t); +/// +/// extern struct _xlocale __xlocale_global_locale; +/// extern struct _xlocale __xlocale_C_locale; +/// +/// +/// +/// +/// void __set_thread_rune_locale(locale_t loc); +/// +/// +/// +/// +/// extern int __has_thread_locale; +/// +/// +/// +/// +/// +/// extern _Thread_local locale_t __thread_locale; +/// +/// +/// +/// +/// +/// +/// +/// static inline locale_t __get_locale(void) +/// { +/// +/// if (!__has_thread_locale) { +/// return (&__xlocale_global_locale); +/// } +/// return (__thread_locale ? __thread_locale : &__xlocale_global_locale); +/// } +/// +/// +/// +/// +/// +/// static inline locale_t get_real_locale(locale_t locale) +/// { +/// switch ((intptr_t)locale) { +/// case 0: return (&__xlocale_C_locale); +/// case -1: return (&__xlocale_global_locale); +/// default: return (locale); +/// } +/// } +/// +/// +/// +/// +/// +/// +/// +/// +/// struct xlocale_ctype { +/// struct xlocale_component header; +/// _RuneLocale *runes; +/// size_t (*__mbrtowc)(wchar_t * +/// +/// restrict +/// +/// , const char * +/// +/// restrict +/// +/// , +/// size_t, mbstate_t * +/// +/// restrict +/// +/// ); +/// int (*__mbsinit)(const mbstate_t *); +/// size_t (*__mbsnrtowcs)(wchar_t * +/// +/// restrict +/// +/// , const char ** +/// +/// restrict +/// +/// , +/// size_t, size_t, mbstate_t * +/// +/// restrict +/// +/// ); +/// size_t (*__wcrtomb)(char * +/// +/// restrict +/// +/// , wchar_t, mbstate_t * +/// +/// restrict +/// +/// ); +/// size_t (*__wcsnrtombs)(char * +/// +/// restrict +/// +/// , const wchar_t ** +/// +/// restrict +/// +/// , +/// size_t, size_t, mbstate_t * +/// +/// restrict +/// +/// ); +/// int __mb_cur_max; +/// int __mb_sb_limit; +/// +/// __mbstate_t mblen; +/// +/// __mbstate_t mbrlen; +/// +/// __mbstate_t mbrtoc16; +/// +/// __mbstate_t mbrtoc32; +/// +/// __mbstate_t mbrtowc; +/// +/// __mbstate_t mbsnrtowcs; +/// +/// __mbstate_t mbsrtowcs; +/// +/// __mbstate_t mbtowc; +/// +/// __mbstate_t c16rtomb; +/// +/// __mbstate_t c32rtomb; +/// +/// __mbstate_t wcrtomb; +/// +/// __mbstate_t wcsnrtombs; +/// +/// __mbstate_t wcsrtombs; +/// +/// __mbstate_t wctomb; +/// }; +/// +/// extern struct xlocale_ctype __xlocale_global_ctype; +/// +/// +/// +/// +/// int _none_init(struct xlocale_ctype *, _RuneLocale *) +/// +/// __attribute__((__visibility__("hidden"))) +/// +/// ; +/// int _UTF8_init(struct xlocale_ctype *, _RuneLocale *) +/// +/// __attribute__((__visibility__("hidden"))) +/// +/// ; +/// int _EUC_CN_init(struct xlocale_ctype *, _RuneLocale *) +/// +/// __attribute__((__visibility__("hidden"))) +/// +/// ; +/// int _EUC_JP_init(struct xlocale_ctype *, _RuneLocale *) +/// +/// __attribute__((__visibility__("hidden"))) +/// +/// ; +/// int _EUC_KR_init(struct xlocale_ctype *, _RuneLocale *) +/// +/// __attribute__((__visibility__("hidden"))) +/// +/// ; +/// int _EUC_TW_init(struct xlocale_ctype *, _RuneLocale *) +/// +/// __attribute__((__visibility__("hidden"))) +/// +/// ; +/// int _GB18030_init(struct xlocale_ctype *, _RuneLocale *) +/// +/// __attribute__((__visibility__("hidden"))) +/// +/// ; +/// int _GB2312_init(struct xlocale_ctype *, _RuneLocale *) +/// +/// __attribute__((__visibility__("hidden"))) +/// +/// ; +/// int _GBK_init(struct xlocale_ctype *, _RuneLocale *) +/// +/// __attribute__((__visibility__("hidden"))) +/// +/// ; +/// int _BIG5_init(struct xlocale_ctype *, _RuneLocale *) +/// +/// __attribute__((__visibility__("hidden"))) +/// +/// ; +/// int _MSKanji_init(struct xlocale_ctype *, _RuneLocale *) +/// +/// __attribute__((__visibility__("hidden"))) +/// +/// ; +/// int _ascii_init(struct xlocale_ctype *, _RuneLocale *) +/// +/// __attribute__((__visibility__("hidden"))) +/// +/// ; +/// +/// typedef size_t (*mbrtowc_pfn_t)(wchar_t * +/// +/// restrict +/// +/// , +/// const char * +/// +/// restrict +/// +/// , size_t, mbstate_t * +/// +/// restrict +/// +/// ); +/// typedef size_t (*wcrtomb_pfn_t)(char * +/// +/// restrict +/// +/// , wchar_t, +/// mbstate_t * +/// +/// restrict +/// +/// ); +/// size_t __mbsnrtowcs_std(wchar_t * +/// +/// restrict +/// +/// , const char ** +/// +/// restrict +/// +/// , +/// size_t, size_t, mbstate_t * +/// +/// restrict +/// +/// , mbrtowc_pfn_t); +/// size_t __wcsnrtombs_std(char * +/// +/// restrict +/// +/// , const wchar_t ** +/// +/// restrict +/// +/// , +/// size_t, size_t, mbstate_t * +/// +/// restrict +/// +/// , wcrtomb_pfn_t); +/// + +var X_DefaultRuneLocale = _RuneLocale{ + + __magic: *(*[8]int8)(unsafe.Pointer(ts /* "RuneMagi" */)), + __encoding: *(*[32]int8)(unsafe.Pointer(ts + 9 /* "NONE\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00..." */)), + __invalid_rune: 0xFFFD, + + __runetype: [256]uint64{ + + 0: uint64(0x00000200), + + 1: uint64(0x00000200), + + 2: uint64(0x00000200), + + 3: uint64(0x00000200), + + 4: uint64(0x00000200), + + 5: uint64(0x00000200), + + 6: uint64(0x00000200), + + 7: uint64(0x00000200), + + 8: uint64(0x00000200), + + 9: (uint64((0x00000200 | + + 0x00004000) | + + 0x00020000)), + + 10: (uint64(0x00000200 | + + 0x00004000)), + + 11: (uint64(0x00000200 | + + 0x00004000)), + + 12: (uint64(0x00000200 | + + 0x00004000)), + + 13: (uint64(0x00000200 | + + 0x00004000)), + + 14: uint64(0x00000200), + + 15: uint64(0x00000200), + + 16: uint64(0x00000200), + + 17: uint64(0x00000200), + + 18: uint64(0x00000200), + + 19: uint64(0x00000200), + + 20: uint64(0x00000200), + + 21: uint64(0x00000200), + + 22: uint64(0x00000200), + + 23: uint64(0x00000200), + + 24: uint64(0x00000200), + + 25: uint64(0x00000200), + + 26: uint64(0x00000200), + + 27: uint64(0x00000200), + + 28: uint64(0x00000200), + + 29: uint64(0x00000200), + + 30: uint64(0x00000200), + + 31: uint64(0x00000200), + + 32: (uint64((0x00004000 | + + 0x00020000) | + + 0x00040000)), + + 33: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 34: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 35: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 36: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 37: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 38: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 39: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 40: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 41: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 42: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 43: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 44: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 45: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 46: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 47: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 48: (uint64(((((0x00000400 | + + 0x00040000) | + + 0x00000800) | + + 0x00010000) | + + 0x00400000) | + + int64(0))), + + 49: (uint64(((((0x00000400 | + + 0x00040000) | + + 0x00000800) | + + 0x00010000) | + + 0x00400000) | + + int64(1))), + + 50: (uint64(((((0x00000400 | + + 0x00040000) | + + 0x00000800) | + + 0x00010000) | + + 0x00400000) | + + int64(2))), + + 51: (uint64(((((0x00000400 | + + 0x00040000) | + + 0x00000800) | + + 0x00010000) | + + 0x00400000) | + + int64(3))), + + 52: (uint64(((((0x00000400 | + + 0x00040000) | + + 0x00000800) | + + 0x00010000) | + + 0x00400000) | + + int64(4))), + + 53: (uint64(((((0x00000400 | + + 0x00040000) | + + 0x00000800) | + + 0x00010000) | + + 0x00400000) | + + int64(5))), + + 54: (uint64(((((0x00000400 | + + 0x00040000) | + + 0x00000800) | + + 0x00010000) | + + 0x00400000) | + + int64(6))), + + 55: (uint64(((((0x00000400 | + + 0x00040000) | + + 0x00000800) | + + 0x00010000) | + + 0x00400000) | + + int64(7))), + + 56: (uint64(((((0x00000400 | + + 0x00040000) | + + 0x00000800) | + + 0x00010000) | + + 0x00400000) | + + int64(8))), + + 57: (uint64(((((0x00000400 | + + 0x00040000) | + + 0x00000800) | + + 0x00010000) | + + 0x00400000) | + + int64(9))), + + 58: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 59: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 60: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 61: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 62: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 63: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 64: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 65: (uint64(((((0x00008000 | + + 0x00010000) | + + 0x00040000) | + + 0x00000800) | + + 0x00000100) | + + int64(10))), + + 66: (uint64(((((0x00008000 | + + 0x00010000) | + + 0x00040000) | + + 0x00000800) | + + 0x00000100) | + + int64(11))), + + 67: (uint64(((((0x00008000 | + + 0x00010000) | + + 0x00040000) | + + 0x00000800) | + + 0x00000100) | + + int64(12))), + + 68: (uint64(((((0x00008000 | + + 0x00010000) | + + 0x00040000) | + + 0x00000800) | + + 0x00000100) | + + int64(13))), + + 69: (uint64(((((0x00008000 | + + 0x00010000) | + + 0x00040000) | + + 0x00000800) | + + 0x00000100) | + + int64(14))), + + 70: (uint64(((((0x00008000 | + + 0x00010000) | + + 0x00040000) | + + 0x00000800) | + + 0x00000100) | + + int64(15))), + + 71: (uint64(((0x00008000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 72: (uint64(((0x00008000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 73: (uint64(((0x00008000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 74: (uint64(((0x00008000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 75: (uint64(((0x00008000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 76: (uint64(((0x00008000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 77: (uint64(((0x00008000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 78: (uint64(((0x00008000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 79: (uint64(((0x00008000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 80: (uint64(((0x00008000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 81: (uint64(((0x00008000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 82: (uint64(((0x00008000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 83: (uint64(((0x00008000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 84: (uint64(((0x00008000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 85: (uint64(((0x00008000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 86: (uint64(((0x00008000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 87: (uint64(((0x00008000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 88: (uint64(((0x00008000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 89: (uint64(((0x00008000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 90: (uint64(((0x00008000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 91: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 92: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 93: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 94: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 95: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 96: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 97: (uint64(((((0x00001000 | + + 0x00010000) | + + 0x00040000) | + + 0x00000800) | + + 0x00000100) | + + int64(10))), + + 98: (uint64(((((0x00001000 | + + 0x00010000) | + + 0x00040000) | + + 0x00000800) | + + 0x00000100) | + + int64(11))), + + 99: (uint64(((((0x00001000 | + + 0x00010000) | + + 0x00040000) | + + 0x00000800) | + + 0x00000100) | + + int64(12))), + + 100: (uint64(((((0x00001000 | + + 0x00010000) | + + 0x00040000) | + + 0x00000800) | + + 0x00000100) | + + int64(13))), + + 101: (uint64(((((0x00001000 | + + 0x00010000) | + + 0x00040000) | + + 0x00000800) | + + 0x00000100) | + + int64(14))), + + 102: (uint64(((((0x00001000 | + + 0x00010000) | + + 0x00040000) | + + 0x00000800) | + + 0x00000100) | + + int64(15))), + + 103: (uint64(((0x00001000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 104: (uint64(((0x00001000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 105: (uint64(((0x00001000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 106: (uint64(((0x00001000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 107: (uint64(((0x00001000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 108: (uint64(((0x00001000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 109: (uint64(((0x00001000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 110: (uint64(((0x00001000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 111: (uint64(((0x00001000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 112: (uint64(((0x00001000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 113: (uint64(((0x00001000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 114: (uint64(((0x00001000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 115: (uint64(((0x00001000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 116: (uint64(((0x00001000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 117: (uint64(((0x00001000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 118: (uint64(((0x00001000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 119: (uint64(((0x00001000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 120: (uint64(((0x00001000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 121: (uint64(((0x00001000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 122: (uint64(((0x00001000 | + + 0x00040000) | + + 0x00000800) | + + 0x00000100)), + + 123: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 124: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 125: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 126: (uint64((0x00002000 | + + 0x00040000) | + + 0x00000800)), + + 127: uint64(0x00000200), + }, + __maplower: [256]int32{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, + }, + __mapupper: [256]int32{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, + }, +} /* table.cpp.c:2243:19 */ + +var X_CurrentRuneLocale uintptr = 0 /* table.cpp.c:4092:19 */ + +/// _RuneLocale * +/// __runes_for_locale(locale_t locale, int *mb_sb_limit) +/// { +/// (locale = get_real_locale(locale)); +/// struct xlocale_ctype *c = ((struct xlocale_ctype*)(locale)->components[XLC_CTYPE]); +/// *mb_sb_limit = c->__mb_sb_limit; +/// return c->runes; +/// } + +func __isspace(tls *TLS, _c int32) int32 { /* ctype.h:26:21: */ + return (Bool32((_c == ' ') || ((uint32(_c) - uint32('\t')) < uint32(5)))) +} + +type locale_t = uintptr /* alltypes.h:343:32 */ + +func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ + return (Bool32((func() int32 { + if 0 != 0 { + return Xisalpha(tls, c) + } + return (Bool32((((uint32(c)) | uint32(32)) - uint32('a')) < uint32(26))) + }() != 0) || (func() int32 { + if 0 != 0 { + return Xisdigit(tls, c) + } + return (Bool32(((uint32(c)) - uint32('0')) < uint32(10))) + }() != 0))) +} + +func X__isalnum_l(tls *TLS, c int32, l locale_t) int32 { /* isalnum.c:8:5: */ + return Xisalnum(tls, c) +} + +func Xisalpha(tls *TLS, c int32) int32 { /* isalpha.c:4:5: */ + return (Bool32(((uint32(c) | uint32(32)) - uint32('a')) < uint32(26))) +} + +func X__isalpha_l(tls *TLS, c int32, l locale_t) int32 { /* isalpha.c:9:5: */ + return Xisalpha(tls, c) +} + +func Xisdigit(tls *TLS, c int32) int32 { /* isdigit.c:4:5: */ + return (Bool32((uint32(c) - uint32('0')) < uint32(10))) +} + +func X__isdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isdigit.c:9:5: */ + return Xisdigit(tls, c) +} + +type uintptr_t = uint64 /* alltypes.h:55:24 */ + +type intptr_t = int64 /* alltypes.h:70:15 */ + +type int8_t = int8 /* alltypes.h:96:25 */ + +type int16_t = int16 /* alltypes.h:101:25 */ + +type int32_t = int32 /* alltypes.h:106:25 */ + +type int64_t = int64 /* alltypes.h:111:25 */ + +type intmax_t = int64 /* alltypes.h:116:25 */ + +type uint8_t = uint8 /* alltypes.h:121:25 */ + +type uint16_t = uint16 /* alltypes.h:126:25 */ + +type uint32_t = uint32 /* alltypes.h:131:25 */ + +type uint64_t = uint64 /* alltypes.h:136:25 */ + +type uintmax_t = uint64 /* alltypes.h:146:25 */ + +type int_fast8_t = int8_t /* stdint.h:22:16 */ +type int_fast64_t = int64_t /* stdint.h:23:17 */ + +type int_least8_t = int8_t /* stdint.h:25:17 */ +type int_least16_t = int16_t /* stdint.h:26:17 */ +type int_least32_t = int32_t /* stdint.h:27:17 */ +type int_least64_t = int64_t /* stdint.h:28:17 */ + +type uint_fast8_t = uint8_t /* stdint.h:30:17 */ +type uint_fast64_t = uint64_t /* stdint.h:31:18 */ + +type uint_least8_t = uint8_t /* stdint.h:33:18 */ +type uint_least16_t = uint16_t /* stdint.h:34:18 */ +type uint_least32_t = uint32_t /* stdint.h:35:18 */ +type uint_least64_t = uint64_t /* stdint.h:36:18 */ + +type int_fast16_t = int32_t /* stdint.h:1:17 */ +type int_fast32_t = int32_t /* stdint.h:2:17 */ +type uint_fast16_t = uint32_t /* stdint.h:3:18 */ +type uint_fast32_t = uint32_t /* stdint.h:4:18 */ + +type ssize_t = int64 /* alltypes.h:65:15 */ + +type off_t = int64 /* alltypes.h:162:16 */ + +type _IO_FILE = struct { + flags uint32 + _ [4]byte + rpos uintptr + rend uintptr + close uintptr + wend uintptr + wpos uintptr + mustbezero_1 uintptr + wbase uintptr + read uintptr + write uintptr + seek uintptr + buf uintptr + buf_size size_t + prev uintptr + next uintptr + fd int32 + pipe_pid int32 + lockcount int64 + mode int32 + lock int32 + lbf int32 + _ [4]byte + cookie uintptr + off off_t + getln_buf uintptr + mustbezero_2 uintptr + shend uintptr + shlim off_t + shcnt off_t + prev_locked uintptr + next_locked uintptr + locale uintptr +} /* alltypes.h:320:9 */ + +type FILE = _IO_FILE /* alltypes.h:320:25 */ + +type va_list = uintptr /* alltypes.h:326:27 */ + +type _G_fpos64_t = struct { + _ [0]uint64 + __opaque [16]int8 +} /* stdio.h:54:9 */ + +type fpos_t = _G_fpos64_t /* stdio.h:58:3 */ + +type float_t = float32 /* alltypes.h:29:15 */ + +type double_t = float64 /* alltypes.h:34:16 */ + +func __FLOAT_BITS(tls *TLS, __f float32) uint32 { /* math.h:55:26: */ + bp := tls.Alloc(4) + defer tls.Free(4) + + // var __u struct {__f float32;} at bp, 4 + + *(*float32)(unsafe.Pointer(bp /* &__u */)) = __f + return *(*uint32)(unsafe.Pointer(bp /* &__u */)) +} + +func __DOUBLE_BITS(tls *TLS, __f float64) uint64 { /* math.h:61:36: */ + bp := tls.Alloc(8) + defer tls.Free(8) + + // var __u struct {__f float64;} at bp, 8 + + *(*float64)(unsafe.Pointer(bp /* &__u */)) = __f + return *(*uint64)(unsafe.Pointer(bp /* &__u */)) +} + +type syscall_arg_t = int64 /* syscall.h:22:14 */ + +func scanexp(tls *TLS, f uintptr, pok int32) int64 { /* floatscan.c:37:18: */ + var c int32 + var x int32 + var y int64 + var neg int32 = 0 + + c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() + if (c == '+') || (c == '-') { + neg = (Bool32(c == '-')) + c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() + if ((uint32(c - '0')) >= 10) && (pok != 0) { + if (*FILE)(unsafe.Pointer((f))).shlim >= int64(0) { + (*FILE)(unsafe.Pointer(f)).rpos-- + } else { + } + } + } + if (uint32(c - '0')) >= 10 { + if (*FILE)(unsafe.Pointer((f))).shlim >= int64(0) { + (*FILE)(unsafe.Pointer(f)).rpos-- + } else { + } + return (-0x7fffffffffffffff - int64(1)) + } + for x = 0; ((uint32(c - '0')) < 10) && (x < (0x7fffffff / 10)); c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() { + x = (((10 * x) + c) - '0') + } + for y = int64(x); ((uint32(c - '0')) < 10) && (y < (0x7fffffffffffffff / int64(100))); c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() { + y = (((int64(10) * y) + int64(c)) - int64('0')) + } + for ; (uint32(c - '0')) < 10; c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() { + } + if (*FILE)(unsafe.Pointer((f))).shlim >= int64(0) { + (*FILE)(unsafe.Pointer(f)).rpos-- + } else { + } + if neg != 0 { + return -y + } + return y +} + +func decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, pok int32) float64 { /* floatscan.c:64:20: */ + bp := tls.Alloc(512) + defer tls.Free(512) + + // var x [128]uint32_t at bp, 512 + + var i int32 + var j int32 + var k int32 + var a int32 + var z int32 + var lrp int64 = int64(0) + var dc int64 = int64(0) + var e10 int64 = int64(0) + var lnz int32 = 0 + var gotdig int32 = 0 + var gotrad int32 = 0 + var rp int32 + var e2 int32 + var emax int32 = ((-emin - bits) + 3) + var denormal int32 = 0 + var y float64 + var frac float64 = float64(0) + var bias float64 = float64(0) + + j = 0 + k = 0 + + // Don't let leading zeros consume buffer space + for ; c == '0'; c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() { + gotdig = 1 + } + if c == '.' { + gotrad = 1 + for c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }(); c == '0'; c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() { + gotdig = 1 + lrp-- + } + } + + *(*uint32_t)(unsafe.Pointer(bp /* &x[0] */)) = uint32_t(0) + for ; ((uint32(c - '0')) < 10) || (c == '.'); c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() { + if c == '.' { + if gotrad != 0 { + break + } + gotrad = 1 + lrp = dc + } else if k < (128 - 3) { + dc++ + if c != '0' { + lnz = int32(dc) + } + if j != 0 { + *(*uint32_t)(unsafe.Pointer(bp /* &x[0] */ + uintptr(k)*4)) = (((*(*uint32_t)(unsafe.Pointer(bp /* &x[0] */ + uintptr(k)*4)) * uint32_t(10)) + uint32_t(c)) - uint32_t('0')) + } else { + *(*uint32_t)(unsafe.Pointer(bp /* &x[0] */ + uintptr(k)*4)) = (uint32_t(c - '0')) + } + if PreIncInt32(&j, 1) == 9 { + k++ + j = 0 + } + gotdig = 1 + } else { + dc++ + if c != '0' { + lnz = ((128 - 4) * 9) + *(*uint32_t)(unsafe.Pointer(bp /* &x */ + 124*4)) |= (uint32_t(1)) + } + } + } + if !(gotrad != 0) { + lrp = dc + } + + if (gotdig != 0) && ((c | 32) == 'e') { + e10 = scanexp(tls, f, pok) + if e10 == (-0x7fffffffffffffff - int64(1)) { + if pok != 0 { + if (*FILE)(unsafe.Pointer((f))).shlim >= int64(0) { + (*FILE)(unsafe.Pointer(f)).rpos-- + } else { + } + } else { + X__shlim(tls, f, int64(0)) + return float64(0) + } + e10 = int64(0) + } + lrp = lrp + (e10) + } else if c >= 0 { + if (*FILE)(unsafe.Pointer((f))).shlim >= int64(0) { + (*FILE)(unsafe.Pointer(f)).rpos-- + } else { + } + } + if !(gotdig != 0) { + (*(*int32)(unsafe.Pointer(X___errno_location(tls)))) = 22 + X__shlim(tls, f, int64(0)) + return float64(0) + } + + // Handle zero specially to avoid nasty special cases later + if !(int32(*(*uint32_t)(unsafe.Pointer(bp /* &x[0] */))) != 0) { + return (float64(sign) * 0.0) + } + + // Optimize small integers (w/no exponent) and over/under-flow + if ((lrp == dc) && (dc < int64(10))) && ((bits > 30) || ((*(*uint32_t)(unsafe.Pointer(bp /* &x[0] */)) >> bits) == uint32_t(0))) { + return (float64(sign) * float64(*(*uint32_t)(unsafe.Pointer(bp /* &x[0] */)))) + } + if lrp > (int64(-emin / 2)) { + (*(*int32)(unsafe.Pointer(X___errno_location(tls)))) = 34 + return ((float64(sign) * 1.79769313486231570815e+308) * 1.79769313486231570815e+308) + } + if lrp < (int64(emin - (2 * 53))) { + (*(*int32)(unsafe.Pointer(X___errno_location(tls)))) = 34 + return ((float64(sign) * 2.22507385850720138309e-308) * 2.22507385850720138309e-308) + } + + // Align incomplete final B1B digit + if j != 0 { + for ; j < 9; j++ { + *(*uint32_t)(unsafe.Pointer(bp /* &x */ + uintptr(k)*4)) *= (uint32_t(10)) + } + k++ + j = 0 + } + + a = 0 + z = k + e2 = 0 + rp = int32(lrp) + + // Optimize small to mid-size integers (even in exp. notation) + if ((lnz < 9) && (lnz <= rp)) && (rp < 18) { + if rp == 9 { + return (float64(sign) * float64(*(*uint32_t)(unsafe.Pointer(bp /* &x[0] */)))) + } + if rp < 9 { + return ((float64(sign) * float64(*(*uint32_t)(unsafe.Pointer(bp /* &x[0] */)))) / float64(_sp10s[(8-rp)])) + } + var bitlim int32 = (bits - (3 * (rp - 9))) + if (bitlim > 30) || ((*(*uint32_t)(unsafe.Pointer(bp /* &x[0] */)) >> bitlim) == uint32_t(0)) { + return ((float64(sign) * float64(*(*uint32_t)(unsafe.Pointer(bp /* &x[0] */)))) * float64(_sp10s[(rp-10)])) + } + } + + // Drop trailing zeros + for ; !(int32(*(*uint32_t)(unsafe.Pointer(bp /* &x[0] */ + uintptr((z-1))*4))) != 0); z-- { + } + + // Align radix point to B1B digit boundary + if (rp % 9) != 0 { + var rpm9 int32 + if rp >= 0 { + rpm9 = (rp % 9) + } else { + rpm9 = ((rp % 9) + 9) + } + var p10 int32 = _sp10s[(8 - rpm9)] + var carry uint32_t = uint32_t(0) + for k = a; k != z; k++ { + var tmp uint32_t = (*(*uint32_t)(unsafe.Pointer(bp /* &x[0] */ + uintptr(k)*4)) % uint32_t(p10)) + *(*uint32_t)(unsafe.Pointer(bp /* &x[0] */ + uintptr(k)*4)) = ((*(*uint32_t)(unsafe.Pointer(bp /* &x[0] */ + uintptr(k)*4)) / uint32_t(p10)) + carry) + carry = ((uint32_t(1000000000 / p10)) * tmp) + if (k == a) && !(int32(*(*uint32_t)(unsafe.Pointer(bp /* &x[0] */ + uintptr(k)*4))) != 0) { + a = ((a + 1) & (128 - 1)) + rp = rp - (9) + } + } + if carry != 0 { + *(*uint32_t)(unsafe.Pointer(bp /* &x[0] */ + uintptr(PostIncInt32(&z, 1))*4)) = carry + } + rp = rp + (9 - rpm9) + } + + // Upscale until desired number of bits are left of radix point + for (rp < (9 * 2)) || ((rp == (9 * 2)) && (*(*uint32_t)(unsafe.Pointer(bp /* &x[0] */ + uintptr(a)*4)) < _sth[0])) { + var carry uint32_t = uint32_t(0) + e2 = e2 - (29) + for k = ((z - 1) & (128 - 1)); ; k = ((k - 1) & (128 - 1)) { + var tmp uint64_t = ((uint64_t(*(*uint32_t)(unsafe.Pointer(bp /* &x[0] */ + uintptr(k)*4))) << 29) + uint64_t(carry)) + if tmp > uint64(1000000000) { + carry = (uint32_t(tmp / uint64(1000000000))) + *(*uint32_t)(unsafe.Pointer(bp /* &x[0] */ + uintptr(k)*4)) = (uint32_t(tmp % uint64(1000000000))) + } else { + carry = uint32_t(0) + *(*uint32_t)(unsafe.Pointer(bp /* &x[0] */ + uintptr(k)*4)) = uint32_t(tmp) + } + if ((k == ((z - 1) & (128 - 1))) && (k != a)) && !(int32(*(*uint32_t)(unsafe.Pointer(bp /* &x[0] */ + uintptr(k)*4))) != 0) { + z = k + } + if k == a { + break + } + } + if carry != 0 { + rp = rp + (9) + a = ((a - 1) & (128 - 1)) + if a == z { + z = ((z - 1) & (128 - 1)) + *(*uint32_t)(unsafe.Pointer(bp /* &x */ + uintptr(((z-1)&(128-1)))*4)) |= (*(*uint32_t)(unsafe.Pointer(bp /* &x[0] */ + uintptr(z)*4))) + } + *(*uint32_t)(unsafe.Pointer(bp /* &x[0] */ + uintptr(a)*4)) = carry + } + } + + // Downscale until exactly number of bits are left of radix point + for { + var carry uint32_t = uint32_t(0) + var sh int32 = 1 + for i = 0; i < 2; i++ { + k = ((a + i) & (128 - 1)) + if (k == z) || (*(*uint32_t)(unsafe.Pointer(bp /* &x[0] */ + uintptr(k)*4)) < _sth[i]) { + i = 2 + break + } + if *(*uint32_t)(unsafe.Pointer(bp /* &x[0] */ + uintptr(((a+i)&(128-1)))*4)) > _sth[i] { + break + } + } + if (i == 2) && (rp == (9 * 2)) { + break + } + // FIXME: find a way to compute optimal sh + if rp > (9 + (9 * 2)) { + sh = 9 + } + e2 = e2 + (sh) + for k = a; k != z; k = ((k + 1) & (128 - 1)) { + var tmp uint32_t = (*(*uint32_t)(unsafe.Pointer(bp /* &x[0] */ + uintptr(k)*4)) & (uint32_t((int32(1) << sh) - 1))) + *(*uint32_t)(unsafe.Pointer(bp /* &x[0] */ + uintptr(k)*4)) = ((*(*uint32_t)(unsafe.Pointer(bp /* &x[0] */ + uintptr(k)*4)) >> sh) + carry) + carry = ((uint32_t(int32(1000000000) >> sh)) * tmp) + if (k == a) && !(int32(*(*uint32_t)(unsafe.Pointer(bp /* &x[0] */ + uintptr(k)*4))) != 0) { + a = ((a + 1) & (128 - 1)) + i-- + rp = rp - (9) + } + } + if carry != 0 { + if ((z + 1) & (128 - 1)) != a { + *(*uint32_t)(unsafe.Pointer(bp /* &x[0] */ + uintptr(z)*4)) = carry + z = ((z + 1) & (128 - 1)) + } else { + *(*uint32_t)(unsafe.Pointer(bp /* &x */ + uintptr(((z-1)&(128-1)))*4)) |= (uint32_t(1)) + } + } + } + + // Assemble desired bits into floating point variable + for y = float64(AssignInt32(&i, 0)); i < 2; i++ { + if ((a + i) & (128 - 1)) == z { + *(*uint32_t)(unsafe.Pointer(bp /* &x[0] */ + uintptr(((AssignInt32(&z, ((z+1)&(128-1))))-1))*4)) = uint32_t(0) + } + y = ((1000000000.0 * y) + float64(*(*uint32_t)(unsafe.Pointer(bp /* &x[0] */ + uintptr(((a+i)&(128-1)))*4)))) + } + + y = y * (float64(sign)) + + // Limit precision for denormal results + if bits > ((53 + e2) - emin) { + bits = ((53 + e2) - emin) + if bits < 0 { + bits = 0 + } + denormal = 1 + } + + // Calculate bias term to force rounding, move out lower bits + if bits < 53 { + bias = Xcopysignl(tls, Xscalbn(tls, float64(1), (((2*53)-bits)-1)), y) + frac = Xfmodl(tls, y, Xscalbn(tls, float64(1), (53-bits))) + y = y - (frac) + y = y + (bias) + } + + // Process tail of decimal input so it can affect rounding + if ((a + i) & (128 - 1)) != z { + var t uint32_t = *(*uint32_t)(unsafe.Pointer(bp /* &x[0] */ + uintptr(((a+i)&(128-1)))*4)) + if (t < uint32_t(500000000)) && ((t != 0) || ((((a + i) + 1) & (128 - 1)) != z)) { + frac = frac + (0.25 * float64(sign)) + } else if t > uint32_t(500000000) { + frac = frac + (0.75 * float64(sign)) + } else if t == uint32_t(500000000) { + if (((a + i) + 1) & (128 - 1)) == z { + frac = frac + (0.5 * float64(sign)) + } else { + frac = frac + (0.75 * float64(sign)) + } + } + if ((53 - bits) >= 2) && !(Xfmodl(tls, frac, float64(1)) != 0) { + frac += 1 + } + } + + y = y + (frac) + y = y - (bias) + + if ((e2 + 53) & 0x7fffffff) > (emax - 5) { + if Xfabsl(tls, y) >= (float64(float64(2)) / 2.22044604925031308085e-16) { + if (denormal != 0) && (bits == ((53 + e2) - emin)) { + denormal = 0 + } + y = y * (0.5) + e2++ + } + if ((e2 + 53) > emax) || ((denormal != 0) && (frac != 0)) { + (*(*int32)(unsafe.Pointer(X___errno_location(tls)))) = 34 + } + } + + return Xscalbnl(tls, y, e2) +} + +var _sth = [2]uint32_t{uint32_t(9007199), uint32_t(254740991)} /* floatscan.c:67:24 */ +var _sp10s = [8]int32{10, 100, 1000, 10000, + 100000, 1000000, 10000000, 100000000} /* floatscan.c:80:19 */ + +func hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int32) float64 { /* floatscan.c:315:20: */ + var x uint32_t = uint32_t(0) + var y float64 = float64(0) + var scale float64 = float64(1) + var bias float64 = float64(0) + var gottail int32 = 0 + var gotrad int32 = 0 + var gotdig int32 = 0 + var rp int64 = int64(0) + var dc int64 = int64(0) + var e2 int64 = int64(0) + var d int32 + var c int32 + + c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() + + // Skip leading zeros + for ; c == '0'; c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() { + gotdig = 1 + } + + if c == '.' { + gotrad = 1 + c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() + // Count zeros after the radix point before significand + rp = int64(0) + __1: + if !(c == '0') { + goto __3 + } + gotdig = 1 + goto __2 + __2: + c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() + rp-- + goto __1 + goto __3 + __3: + } + + for ; (((uint32(c - '0')) < 10) || ((uint32((c | 32) - 'a')) < 6)) || (c == '.'); c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() { + if c == '.' { + if gotrad != 0 { + break + } + rp = dc + gotrad = 1 + } else { + gotdig = 1 + if c > '9' { + d = (((c | 32) + 10) - 'a') + } else { + d = (c - '0') + } + if dc < int64(8) { + x = ((x * uint32_t(16)) + uint32_t(d)) + } else if dc < (int64((53 / 4) + 1)) { + y = y + (float64(d) * (AssignDivFloat64(&scale, float64(16)))) + } else if (d != 0) && !(gottail != 0) { + y = y + (0.5 * scale) + gottail = 1 + } + dc++ + } + } + if !(gotdig != 0) { + if (*FILE)(unsafe.Pointer((f))).shlim >= int64(0) { + (*FILE)(unsafe.Pointer(f)).rpos-- + } else { + } + if pok != 0 { + if (*FILE)(unsafe.Pointer((f))).shlim >= int64(0) { + (*FILE)(unsafe.Pointer(f)).rpos-- + } else { + } + if gotrad != 0 { + if (*FILE)(unsafe.Pointer((f))).shlim >= int64(0) { + (*FILE)(unsafe.Pointer(f)).rpos-- + } else { + } + } + } else { + X__shlim(tls, f, int64(0)) + } + return (float64(sign) * 0.0) + } + if !(gotrad != 0) { + rp = dc + } + for dc < int64(8) { + x = x * (uint32_t(16)) + dc++ + } + if (c | 32) == 'p' { + e2 = scanexp(tls, f, pok) + if e2 == (-0x7fffffffffffffff - int64(1)) { + if pok != 0 { + if (*FILE)(unsafe.Pointer((f))).shlim >= int64(0) { + (*FILE)(unsafe.Pointer(f)).rpos-- + } else { + } + } else { + X__shlim(tls, f, int64(0)) + return float64(0) + } + e2 = int64(0) + } + } else { + if (*FILE)(unsafe.Pointer((f))).shlim >= int64(0) { + (*FILE)(unsafe.Pointer(f)).rpos-- + } else { + } + } + e2 = e2 + ((int64(4) * rp) - int64(32)) + + if !(x != 0) { + return (float64(sign) * 0.0) + } + if e2 > int64(-emin) { + (*(*int32)(unsafe.Pointer(X___errno_location(tls)))) = 34 + return ((float64(sign) * 1.79769313486231570815e+308) * 1.79769313486231570815e+308) + } + if e2 < (int64(emin - (2 * 53))) { + (*(*int32)(unsafe.Pointer(X___errno_location(tls)))) = 34 + return ((float64(sign) * 2.22507385850720138309e-308) * 2.22507385850720138309e-308) + } + + for x < 0x80000000 { + if y >= 0.5 { + x = x + (x + uint32_t(1)) + y = y + (y - float64(1)) + } else { + x = x + (x) + y = y + (y) + } + e2-- + } + + if int64(bits) > ((int64(32) + e2) - int64(emin)) { + bits = (int32((int64(32) + e2) - int64(emin))) + if bits < 0 { + bits = 0 + } + } + + if bits < 53 { + bias = Xcopysignl(tls, Xscalbn(tls, float64(1), (((32+53)-bits)-1)), float64(sign)) + } + + if ((bits < 32) && (y != 0)) && !((x & uint32_t(1)) != 0) { + x++ + y = float64(0) + } + + y = ((bias + (float64(sign) * float64(x))) + (float64(sign) * y)) + y = y - (bias) + + if !(y != 0) { + (*(*int32)(unsafe.Pointer(X___errno_location(tls)))) = 34 + } + + return Xscalbnl(tls, y, int32(e2)) +} + +func X__floatscan(tls *TLS, f uintptr, prec int32, pok int32) float64 { /* floatscan.c:427:13: */ + var sign int32 = 1 + var i size_t + var bits int32 + var emin int32 + var c int32 + + switch prec { + case 0: + bits = 24 + emin = ((-125) - bits) + break + case 1: + bits = 53 + emin = ((-1021) - bits) + break + case 2: + bits = 53 + emin = ((-1021) - bits) + break + default: + return float64(0) + } + + for __isspace(tls, AssignInt32(&c, func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }())) != 0 { + } + + if (c == '+') || (c == '-') { + sign = sign - (2 * (Bool32(c == '-'))) + c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() + } + + for i = uint64(0); (i < uint64(8)) && ((c | 32) == int32(*(*int8)(unsafe.Pointer(ts + 41 /* "infinity" */ + uintptr(i))))); i++ { + if i < uint64(7) { + c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() + } + } + if ((i == uint64(3)) || (i == uint64(8))) || ((i > uint64(3)) && (pok != 0)) { + if i != uint64(8) { + if (*FILE)(unsafe.Pointer((f))).shlim >= int64(0) { + (*FILE)(unsafe.Pointer(f)).rpos-- + } else { + } + if pok != 0 { + for ; i > uint64(3); i-- { + if (*FILE)(unsafe.Pointer((f))).shlim >= int64(0) { + (*FILE)(unsafe.Pointer(f)).rpos-- + } else { + } + } + } + } + return (float64(float32(sign) * X__builtin_inff(tls))) + } + if !(i != 0) { + for i = uint64(0); (i < uint64(3)) && ((c | 32) == int32(*(*int8)(unsafe.Pointer(ts + 50 /* "nan" */ + uintptr(i))))); i++ { + if i < uint64(2) { + c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() + } + } + } + if i == uint64(3) { + if (func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }()) != '(' { + if (*FILE)(unsafe.Pointer((f))).shlim >= int64(0) { + (*FILE)(unsafe.Pointer(f)).rpos-- + } else { + } + return float64(X__builtin_nanf(tls, ts+54 /* "" */)) + } + for i = uint64(1); ; i++ { + c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() + if ((((uint32(c - '0')) < 10) || ((uint32(c - 'A')) < 26)) || ((uint32(c - 'a')) < 26)) || (c == '_') { + continue + } + if c == ')' { + return float64(X__builtin_nanf(tls, ts+54 /* "" */)) + } + if (*FILE)(unsafe.Pointer((f))).shlim >= int64(0) { + (*FILE)(unsafe.Pointer(f)).rpos-- + } else { + } + if !(pok != 0) { + (*(*int32)(unsafe.Pointer(X___errno_location(tls)))) = 22 + X__shlim(tls, f, int64(0)) + return float64(0) + } + for PostDecUint64(&i, 1) != 0 { + if (*FILE)(unsafe.Pointer((f))).shlim >= int64(0) { + (*FILE)(unsafe.Pointer(f)).rpos-- + } else { + } + } + return float64(X__builtin_nanf(tls, ts+54 /* "" */)) + } + return float64(X__builtin_nanf(tls, ts+54 /* "" */)) + } + + if i != 0 { + if (*FILE)(unsafe.Pointer((f))).shlim >= int64(0) { + (*FILE)(unsafe.Pointer(f)).rpos-- + } else { + } + (*(*int32)(unsafe.Pointer(X___errno_location(tls)))) = 22 + X__shlim(tls, f, int64(0)) + return float64(0) + } + + if c == '0' { + c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() + if (c | 32) == 'x' { + return hexfloat(tls, f, bits, emin, sign, pok) + } + if (*FILE)(unsafe.Pointer((f))).shlim >= int64(0) { + (*FILE)(unsafe.Pointer(f)).rpos-- + } else { + } + c = '0' + } + + return decfloat(tls, f, c, bits, emin, sign, pok) +} + +// Lookup table for digit values. -1==255>=36 -> invalid +var table = [257]uint8{Uint8FromInt32(-1), + Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), + Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), + Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), + uint8(0), uint8(1), uint8(2), uint8(3), uint8(4), uint8(5), uint8(6), uint8(7), uint8(8), uint8(9), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), + Uint8FromInt32(-1), uint8(10), uint8(11), uint8(12), uint8(13), uint8(14), uint8(15), uint8(16), uint8(17), uint8(18), uint8(19), uint8(20), uint8(21), uint8(22), uint8(23), uint8(24), + uint8(25), uint8(26), uint8(27), uint8(28), uint8(29), uint8(30), uint8(31), uint8(32), uint8(33), uint8(34), uint8(35), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), + Uint8FromInt32(-1), uint8(10), uint8(11), uint8(12), uint8(13), uint8(14), uint8(15), uint8(16), uint8(17), uint8(18), uint8(19), uint8(20), uint8(21), uint8(22), uint8(23), uint8(24), + uint8(25), uint8(26), uint8(27), uint8(28), uint8(29), uint8(30), uint8(31), uint8(32), uint8(33), uint8(34), uint8(35), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), + Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), + Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), + Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), + Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), + Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), + Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), + Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), + Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), +} /* intscan.c:7:28 */ + +func X__intscan(tls *TLS, f uintptr, base uint32, pok int32, lim uint64) uint64 { /* intscan.c:26:20: */ + var val uintptr + var c int32 + var neg int32 + var x uint32 + var y uint64 + var bs int32 + val = (uintptr(unsafe.Pointer(&table)) + uintptr(1)) + neg = 0 + if !((base > uint32(36)) || (base == uint32(1))) { + goto __1 + } + (*(*int32)(unsafe.Pointer(X___errno_location(tls)))) = 22 + return uint64(0) +__1: + ; +__2: + if !(__isspace(tls, AssignInt32(&c, func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }())) != 0) { + goto __3 + } + goto __2 +__3: + ; + if !((c == '+') || (c == '-')) { + goto __4 + } + neg = -(Bool32(c == '-')) + c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() +__4: + ; + if !(((base == uint32(0)) || (base == uint32(16))) && (c == '0')) { + goto __5 + } + c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() + if !((c | 32) == 'x') { + goto __7 + } + c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() + if !(int32(*(*uint8)(unsafe.Pointer(val + uintptr(c)))) >= 16) { + goto __9 + } + if (*FILE)(unsafe.Pointer((f))).shlim >= int64(0) { + (*FILE)(unsafe.Pointer(f)).rpos-- + } else { + } + if !(pok != 0) { + goto __10 + } + if (*FILE)(unsafe.Pointer((f))).shlim >= int64(0) { + (*FILE)(unsafe.Pointer(f)).rpos-- + } else { + } + goto __11 +__10: + X__shlim(tls, f, int64(0)) +__11: + ; + return uint64(0) +__9: + ; + base = uint32(16) + goto __8 +__7: + if !(base == uint32(0)) { + goto __12 + } + base = uint32(8) +__12: + ; +__8: + ; + goto __6 +__5: + if !(base == uint32(0)) { + goto __13 + } + base = uint32(10) +__13: + ; + if !(uint32(*(*uint8)(unsafe.Pointer(val + uintptr(c)))) >= base) { + goto __14 + } + if (*FILE)(unsafe.Pointer((f))).shlim >= int64(0) { + (*FILE)(unsafe.Pointer(f)).rpos-- + } else { + } + X__shlim(tls, f, int64(0)) + (*(*int32)(unsafe.Pointer(X___errno_location(tls)))) = 22 + return uint64(0) +__14: + ; +__6: + ; + if !(base == uint32(10)) { + goto __15 + } + x = uint32(0) +__17: + if !(((uint32(c - '0')) < 10) && (x <= ((0xffffffff / uint32(10)) - uint32(1)))) { + goto __19 + } + x = ((x * uint32(10)) + (uint32(c - '0'))) + goto __18 +__18: + c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() + goto __17 + goto __19 +__19: + ; + y = uint64(x) +__20: + if !((((uint32(c - '0')) < 10) && (y <= (((2 * uint64(0x7fffffffffffffff)) + uint64(1)) / uint64(10)))) && ((uint64(10) * y) <= (((2 * uint64(0x7fffffffffffffff)) + uint64(1)) - (uint64(c - '0'))))) { + goto __22 + } + y = ((y * uint64(10)) + (uint64(c - '0'))) + goto __21 +__21: + c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() + goto __20 + goto __22 +__22: + ; + if !((uint32(c - '0')) >= 10) { + goto __23 + } + goto done +__23: + ; + goto __16 +__15: + if !(!((base & (base - uint32(1))) != 0)) { + goto __24 + } + bs = int32(*(*int8)(unsafe.Pointer(ts + 55 /* "\x00\x01\x02\x04\a\x03\x06\x05" */ + uintptr((((uint32(0x17) * base) >> 5) & uint32(7)))))) + x = uint32(0) +__26: + if !((uint32(*(*uint8)(unsafe.Pointer(val + uintptr(c)))) < base) && (x <= (0xffffffff / uint32(32)))) { + goto __28 + } + x = ((x << bs) | uint32(*(*uint8)(unsafe.Pointer(val + uintptr(c))))) + goto __27 +__27: + c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() + goto __26 + goto __28 +__28: + ; + y = uint64(x) +__29: + if !((uint32(*(*uint8)(unsafe.Pointer(val + uintptr(c)))) < base) && (y <= (uint64(((2 * uint64(0x7fffffffffffffff)) + uint64(1))) >> bs))) { + goto __31 + } + y = ((y << bs) | uint64(*(*uint8)(unsafe.Pointer(val + uintptr(c))))) + goto __30 +__30: + c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() + goto __29 + goto __31 +__31: + ; + goto __25 +__24: + x = uint32(0) +__32: + if !((uint32(*(*uint8)(unsafe.Pointer(val + uintptr(c)))) < base) && (x <= ((0xffffffff / uint32(36)) - uint32(1)))) { + goto __34 + } + x = ((x * base) + uint32(*(*uint8)(unsafe.Pointer(val + uintptr(c))))) + goto __33 +__33: + c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() + goto __32 + goto __34 +__34: + ; + y = uint64(x) +__35: + if !(((uint32(*(*uint8)(unsafe.Pointer(val + uintptr(c)))) < base) && (y <= (((2 * uint64(0x7fffffffffffffff)) + uint64(1)) / uint64(base)))) && ((uint64(base) * y) <= (((2 * uint64(0x7fffffffffffffff)) + uint64(1)) - uint64(*(*uint8)(unsafe.Pointer(val + uintptr(c))))))) { + goto __37 + } + y = ((y * uint64(base)) + uint64(*(*uint8)(unsafe.Pointer(val + uintptr(c))))) + goto __36 +__36: + c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() + goto __35 + goto __37 +__37: + ; +__25: + ; +__16: + ; + if !(uint32(*(*uint8)(unsafe.Pointer(val + uintptr(c)))) < base) { + goto __38 + } +__39: + if !(uint32(*(*uint8)(unsafe.Pointer(val + uintptr(c)))) < base) { + goto __41 + } + goto __40 +__40: + c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() + goto __39 + goto __41 +__41: + ; + (*(*int32)(unsafe.Pointer(X___errno_location(tls)))) = 34 + y = lim + if !((lim & uint64(1)) != 0) { + goto __42 + } + neg = 0 +__42: + ; +__38: + ; +done: + if (*FILE)(unsafe.Pointer((f))).shlim >= int64(0) { + (*FILE)(unsafe.Pointer(f)).rpos-- + } else { + } + if !(y >= lim) { + goto __43 + } + if !(!((lim & uint64(1)) != 0) && !(neg != 0)) { + goto __44 + } + (*(*int32)(unsafe.Pointer(X___errno_location(tls)))) = 34 + return (lim - uint64(1)) + goto __45 +__44: + if !(y > lim) { + goto __46 + } + (*(*int32)(unsafe.Pointer(X___errno_location(tls)))) = 34 + return lim +__46: + ; +__45: + ; +__43: + ; + return ((y ^ uint64(neg)) - uint64(neg)) +} + +// The shcnt field stores the number of bytes read so far, offset by +// the value of buf-rpos at the last function call (__shlim or __shgetc), +// so that between calls the inline shcnt macro can add rpos-buf to get +// the actual count. + +func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ + (*FILE)(unsafe.Pointer(f)).shlim = lim + (*FILE)(unsafe.Pointer(f)).shcnt = ((int64((*FILE)(unsafe.Pointer(f)).buf) - int64((*FILE)(unsafe.Pointer(f)).rpos)) / 1) + // If lim is nonzero, rend must be a valid pointer. + if (lim != 0) && (((int64((*FILE)(unsafe.Pointer(f)).rend) - int64((*FILE)(unsafe.Pointer(f)).rpos)) / 1) > lim) { + (*FILE)(unsafe.Pointer(f)).shend = ((*FILE)(unsafe.Pointer(f)).rpos + uintptr(lim)) + } else { + (*FILE)(unsafe.Pointer(f)).shend = (*FILE)(unsafe.Pointer(f)).rend + } +} + +func X__shgetc(tls *TLS, f uintptr) int32 { /* shgetc.c:19:5: */ + var c int32 + var cnt off_t = ((*FILE)(unsafe.Pointer((f))).shcnt + ((int64((*FILE)(unsafe.Pointer((f))).rpos) - int64((*FILE)(unsafe.Pointer((f))).buf)) / 1)) + if (((*FILE)(unsafe.Pointer(f)).shlim != 0) && (cnt >= (*FILE)(unsafe.Pointer(f)).shlim)) || ((AssignInt32(&c, X__uflow(tls, f))) < 0) { + (*FILE)(unsafe.Pointer(f)).shcnt = (((int64((*FILE)(unsafe.Pointer(f)).buf) - int64((*FILE)(unsafe.Pointer(f)).rpos)) / 1) + cnt) + (*FILE)(unsafe.Pointer(f)).shend = (*FILE)(unsafe.Pointer(f)).rpos + (*FILE)(unsafe.Pointer(f)).shlim = int64(-1) + return -1 + } + cnt++ + if ((*FILE)(unsafe.Pointer(f)).shlim != 0) && (((int64((*FILE)(unsafe.Pointer(f)).rend) - int64((*FILE)(unsafe.Pointer(f)).rpos)) / 1) > ((*FILE)(unsafe.Pointer(f)).shlim - cnt)) { + (*FILE)(unsafe.Pointer(f)).shend = ((*FILE)(unsafe.Pointer(f)).rpos + uintptr(((*FILE)(unsafe.Pointer(f)).shlim - cnt))) + } else { + (*FILE)(unsafe.Pointer(f)).shend = (*FILE)(unsafe.Pointer(f)).rend + } + (*FILE)(unsafe.Pointer(f)).shcnt = (((int64((*FILE)(unsafe.Pointer(f)).buf) - int64((*FILE)(unsafe.Pointer(f)).rpos)) / 1) + cnt) + if (*FILE)(unsafe.Pointer(f)).rpos <= (*FILE)(unsafe.Pointer(f)).buf { + *(*uint8)(unsafe.Pointer((*FILE)(unsafe.Pointer(f)).rpos + UintptrFromInt32(-1))) = uint8(c) + } + return c +} + +func __bswap32(tls *TLS, __x uint32_t) uint32_t { /* endian.h:24:26: */ + return ((((__x >> 24) | ((__x >> 8) & uint32_t(0xff00))) | ((__x << 8) & uint32_t(0xff0000))) | (__x << 24)) +} + +func Xcopysignl(tls *TLS, x float64, y float64) float64 { /* copysignl.c:4:13: */ + return Xcopysign(tls, x, y) +} + +func Xfabsl(tls *TLS, x float64) float64 { /* fabsl.c:3:13: */ + return Xfabs(tls, x) +} + +func Xfmodl(tls *TLS, x float64, y float64) float64 { /* fmodl.c:4:13: */ + return Xfmod(tls, x, y) +} + +func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ + bp := tls.Alloc(8) + defer tls.Free(8) + + // var u struct {f float64;} at bp, 8 + + var y double_t = x + + if n > 1023 { + y = y * (0x1p1023) + n = n - (1023) + if n > 1023 { + y = y * (0x1p1023) + n = n - (1023) + if n > 1023 { + n = 1023 + } + } + } else if n < -1022 { + // make sure final n < -53 to avoid double + // rounding in the subnormal range + y = y * (float64(0x1p-1022) * 0x1p53) + n = n + (1022 - 53) + if n < -1022 { + y = y * (float64(0x1p-1022) * 0x1p53) + n = n + (1022 - 53) + if n < -1022 { + n = -1022 + } + } + } + *(*uint64_t)(unsafe.Pointer(bp /* &u */)) = ((uint64_t(0x3ff + n)) << 52) + x = (y * *(*float64)(unsafe.Pointer(bp /* &u */))) + return x +} + +func Xscalbnl(tls *TLS, x float64, n int32) float64 { /* scalbnl.c:4:13: */ + return Xscalbn(tls, x, n) +} + +type div_t = struct { + quot int32 + rem int32 +} /* stdlib.h:62:35 */ +type ldiv_t = struct { + quot int64 + rem int64 +} /* stdlib.h:63:36 */ +type lldiv_t = struct { + quot int64 + rem int64 +} /* stdlib.h:64:41 */ + +type max_align_t = struct { + __ll int64 + __ld float64 +} /* alltypes.h:41:54 */ + +type imaxdiv_t = struct { + quot intmax_t + rem intmax_t +} /* inttypes.h:14:40 */ + +type pid_t = int32 /* alltypes.h:235:13 */ + +type uid_t = uint32 /* alltypes.h:245:18 */ + +type gid_t = uint32 /* alltypes.h:250:18 */ + +type iovec = struct { + iov_base uintptr + iov_len size_t +} /* alltypes.h:355:1 */ + +type socklen_t = uint32 /* alltypes.h:361:18 */ + +type sa_family_t = uint16 /* alltypes.h:366:24 */ + +type msghdr = struct { + msg_name uintptr + msg_namelen socklen_t + _ [4]byte + msg_iov uintptr + msg_iovlen int32 + __pad1 int32 + msg_control uintptr + msg_controllen socklen_t + __pad2 int32 + msg_flags int32 + _ [4]byte +} /* socket.h:22:1 */ + +type cmsghdr = struct { + cmsg_len socklen_t + __pad1 int32 + cmsg_level int32 + cmsg_type int32 +} /* socket.h:44:1 */ + +type linger = struct { + l_onoff int32 + l_linger int32 +} /* socket.h:74:1 */ + +type sockaddr = struct { + sa_family sa_family_t + sa_data [14]int8 +} /* socket.h:367:1 */ + +type sockaddr_storage = struct { + ss_family sa_family_t + __ss_padding [118]int8 + __ss_align uint64 +} /* socket.h:372:1 */ + +type in_port_t = uint16_t /* in.h:12:18 */ +type in_addr_t = uint32_t /* in.h:13:18 */ +type in_addr = struct{ s_addr in_addr_t } /* in.h:14:1 */ + +type sockaddr_in = struct { + sin_family sa_family_t + sin_port in_port_t + sin_addr struct{ s_addr in_addr_t } + sin_zero [8]uint8_t +} /* in.h:16:1 */ + +type in6_addr = struct { + __in6_union struct { + _ [0]uint32 + __s6_addr [16]uint8_t + } +} /* in.h:23:1 */ + +type sockaddr_in6 = struct { + sin6_family sa_family_t + sin6_port in_port_t + sin6_flowinfo uint32_t + sin6_addr struct { + __in6_union struct { + _ [0]uint32 + __s6_addr [16]uint8_t + } + } + sin6_scope_id uint32_t +} /* in.h:34:1 */ + +type ipv6_mreq = struct { + ipv6mr_multiaddr struct { + __in6_union struct { + _ [0]uint32 + __s6_addr [16]uint8_t + } + } + ipv6mr_interface uint32 +} /* in.h:42:1 */ + +type ip_opts = struct { + ip_dst struct{ s_addr in_addr_t } + ip_opts [40]int8 +} /* in.h:229:1 */ + +type ip_mreq = struct { + imr_multiaddr struct{ s_addr in_addr_t } + imr_interface struct{ s_addr in_addr_t } +} /* in.h:247:1 */ + +type ip_mreqn = struct { + imr_multiaddr struct{ s_addr in_addr_t } + imr_address struct{ s_addr in_addr_t } + imr_ifindex int32 +} /* in.h:252:1 */ + +type ip_mreq_source = struct { + imr_multiaddr struct{ s_addr in_addr_t } + imr_interface struct{ s_addr in_addr_t } + imr_sourceaddr struct{ s_addr in_addr_t } +} /* in.h:258:1 */ + +type ip_msfilter = struct { + imsf_multiaddr struct{ s_addr in_addr_t } + imsf_interface struct{ s_addr in_addr_t } + imsf_fmode uint32_t + imsf_numsrc uint32_t + imsf_slist [1]struct{ s_addr in_addr_t } +} /* in.h:264:1 */ + +type group_req = struct { + gr_interface uint32_t + _ [4]byte + gr_group struct { + ss_family sa_family_t + __ss_padding [118]int8 + __ss_align uint64 + } +} /* in.h:275:1 */ + +type group_source_req = struct { + gsr_interface uint32_t + _ [4]byte + gsr_group struct { + ss_family sa_family_t + __ss_padding [118]int8 + __ss_align uint64 + } + gsr_source struct { + ss_family sa_family_t + __ss_padding [118]int8 + __ss_align uint64 + } +} /* in.h:280:1 */ + +type group_filter = struct { + gf_interface uint32_t + _ [4]byte + gf_group struct { + ss_family sa_family_t + __ss_padding [118]int8 + __ss_align uint64 + } + gf_fmode uint32_t + gf_numsrc uint32_t + gf_slist [1]struct { + ss_family sa_family_t + __ss_padding [118]int8 + __ss_align uint64 + } +} /* in.h:286:1 */ + +type in_pktinfo = struct { + ipi_ifindex int32 + ipi_spec_dst struct{ s_addr in_addr_t } + ipi_addr struct{ s_addr in_addr_t } +} /* in.h:297:1 */ + +type in6_pktinfo = struct { + ipi6_addr struct { + __in6_union struct { + _ [0]uint32 + __s6_addr [16]uint8_t + } + } + ipi6_ifindex uint32 +} /* in.h:303:1 */ + +type ip6_mtuinfo = struct { + ip6m_addr struct { + sin6_family sa_family_t + sin6_port in_port_t + sin6_flowinfo uint32_t + sin6_addr struct { + __in6_union struct { + _ [0]uint32 + __s6_addr [16]uint8_t + } + } + sin6_scope_id uint32_t + } + ip6m_mtu uint32_t +} /* in.h:308:1 */ + +type addrinfo = struct { + ai_flags int32 + ai_family int32 + ai_socktype int32 + ai_protocol int32 + ai_addrlen socklen_t + _ [4]byte + ai_addr uintptr + ai_canonname uintptr + ai_next uintptr +} /* netdb.h:16:1 */ + +// Legacy functions follow (marked OBsolete in SUS) + +type netent = struct { + n_name uintptr + n_aliases uintptr + n_addrtype int32 + n_net uint32_t +} /* netdb.h:62:1 */ + +type hostent = struct { + h_name uintptr + h_aliases uintptr + h_addrtype int32 + h_length int32 + h_addr_list uintptr +} /* netdb.h:69:1 */ + +type servent = struct { + s_name uintptr + s_aliases uintptr + s_port int32 + _ [4]byte + s_proto uintptr +} /* netdb.h:78:1 */ + +type protoent = struct { + p_name uintptr + p_aliases uintptr + p_proto int32 + _ [4]byte +} /* netdb.h:85:1 */ + +type aibuf = struct { + ai struct { + ai_flags int32 + ai_family int32 + ai_socktype int32 + ai_protocol int32 + ai_addrlen socklen_t + _ [4]byte + ai_addr uintptr + ai_canonname uintptr + ai_next uintptr + } + sa struct { + sin struct { + sin_family sa_family_t + sin_port in_port_t + sin_addr struct{ s_addr in_addr_t } + sin_zero [8]uint8_t + } + _ [12]byte + } + lock [1]int32 + slot int16 + ref int16 + _ [4]byte +} /* lookup.h:10:1 */ + +type sa = struct { + sin struct { + sin_family sa_family_t + sin_port in_port_t + sin_addr struct{ s_addr in_addr_t } + sin_zero [8]uint8_t + } + _ [12]byte +} /* lookup.h:10:1 */ + +type address = struct { + family int32 + scopeid uint32 + addr [16]uint8_t + sortkey int32 +} /* lookup.h:20:1 */ + +type service = struct { + port uint16_t + proto uint8 + socktype uint8 +} /* lookup.h:27:1 */ + +type resolvconf = struct { + ns [3]struct { + family int32 + scopeid uint32 + addr [16]uint8_t + sortkey int32 + } + nns uint32 + attempts uint32 + ndots uint32 + timeout uint32 +} /* lookup.h:34:1 */ + +func Xfreeaddrinfo(tls *TLS, p uintptr) { /* freeaddrinfo.c:7:6: */ + var cnt size_t + cnt = uint64(1) +__1: + if !((*addrinfo)(unsafe.Pointer(p)).ai_next != 0) { + goto __3 + } + goto __2 +__2: + cnt++ + p = (*addrinfo)(unsafe.Pointer(p)).ai_next + goto __1 + goto __3 +__3: + ; + var b uintptr = (p - uintptr((uint64((uintptr(0) /* &.ai */))))) + b -= 88 * (uintptr((*aibuf)(unsafe.Pointer(b)).slot)) + //TODO LOCK(b->lock); + if !(int32(AssignSubPtrInt16(b+82 /* &.ref */, int16(cnt))) != 0) { + Xfree(tls, b) + } + //TODO else UNLOCK(b->lock); +} + +type time_t = int64 /* alltypes.h:85:16 */ + +type clockid_t = int32 /* alltypes.h:214:13 */ + +type timespec = struct { + tv_sec time_t + tv_nsec int64 +} /* alltypes.h:229:1 */ + +type pthread_t = uintptr /* alltypes.h:273:26 */ + +type pthread_once_t = int32 /* alltypes.h:279:13 */ + +type pthread_key_t = uint32 /* alltypes.h:284:18 */ + +type pthread_spinlock_t = int32 /* alltypes.h:289:13 */ + +type pthread_mutexattr_t = struct{ __attr uint32 } /* alltypes.h:294:37 */ + +type pthread_condattr_t = struct{ __attr uint32 } /* alltypes.h:299:37 */ + +type pthread_barrierattr_t = struct{ __attr uint32 } /* alltypes.h:304:37 */ + +type pthread_rwlockattr_t = struct{ __attr [2]uint32 } /* alltypes.h:309:40 */ + +type __sigset_t = struct{ __bits [16]uint64 } /* alltypes.h:349:9 */ + +type sigset_t = __sigset_t /* alltypes.h:349:71 */ + +type pthread_attr_t = struct { + __u struct { + _ [0]uint64 + __i [14]int32 + } +} /* alltypes.h:372:147 */ + +type pthread_mutex_t = struct { + __u struct { + _ [0]uint64 + __i [10]int32 + } +} /* alltypes.h:377:157 */ + +type pthread_cond_t = struct { + __u struct { + _ [0]uint64 + __i [12]int32 + } +} /* alltypes.h:387:112 */ + +type pthread_rwlock_t = struct { + __u struct { + _ [0]uint64 + __i [14]int32 + } +} /* alltypes.h:397:139 */ + +type pthread_barrier_t = struct { + __u struct { + _ [0]uint64 + __i [8]int32 + } +} /* alltypes.h:402:137 */ + +type sched_param = struct { + sched_priority int32 + __reserved1 int32 + __reserved2 [2]struct { + __reserved1 time_t + __reserved2 int64 + } + __reserved3 int32 + _ [4]byte +} /* sched.h:19:1 */ + +type timer_t = uintptr /* alltypes.h:209:14 */ + +type clock_t = int64 /* alltypes.h:219:14 */ + +type tm = struct { + tm_sec int32 + tm_min int32 + tm_hour int32 + tm_mday int32 + tm_mon int32 + tm_year int32 + tm_wday int32 + tm_yday int32 + tm_isdst int32 + _ [4]byte + tm_gmtoff int64 + tm_zone uintptr +} /* time.h:38:1 */ + +type itimerspec = struct { + it_interval struct { + tv_sec time_t + tv_nsec int64 + } + it_value struct { + tv_sec time_t + tv_nsec int64 + } +} /* time.h:80:1 */ + +type __ptcb = struct { + __f uintptr + __x uintptr + __next uintptr +} /* pthread.h:206:1 */ + +type useconds_t = uint32 /* alltypes.h:260:18 */ + +func Xgetaddrinfo(tls *TLS, host uintptr, serv uintptr, hint uintptr, res uintptr) int32 { /* getaddrinfo.c:12:5: */ + bp := tls.Alloc(1608) + defer tls.Free(1608) + + // var ports [2]service at bp, 8 + + // var addrs [48]address at bp+8, 1344 + + // var canon [256]int8 at bp+1352, 256 + + var outcanon uintptr + var nservs int32 + var naddrs int32 + var nais int32 + var canon_len int32 + var i int32 + var j int32 + var k int32 + var family int32 = 0 + var flags int32 = 0 + var proto int32 = 0 + var socktype int32 = 0 + var out uintptr + + if !(host != 0) && !(serv != 0) { + return -2 + } + + if hint != 0 { + family = (*addrinfo)(unsafe.Pointer(hint)).ai_family + flags = (*addrinfo)(unsafe.Pointer(hint)).ai_flags + proto = (*addrinfo)(unsafe.Pointer(hint)).ai_protocol + socktype = (*addrinfo)(unsafe.Pointer(hint)).ai_socktype + + var mask int32 = ((((((0x01 | 0x02) | 0x04) | 0x08) | 0x10) | 0x20) | 0x400) + if (flags & mask) != flags { + return -1 + } + + switch family { + case 2: + fallthrough + case 10: + fallthrough + case 0: + break + fallthrough + default: + return -6 + } + } + + if (flags & 0x20) != 0 { + Xabort(tls) //TODO- + // /* Define the "an address is configured" condition for address + // * families via ability to create a socket for the family plus + // * routability of the loopback address for the family. */ + // static const struct sockaddr_in lo4 = { + // .sin_family = AF_INET, .sin_port = 65535, + // .sin_addr.s_addr = __BYTE_ORDER == __BIG_ENDIAN + // ? 0x7f000001 : 0x0100007f + // }; + // static const struct sockaddr_in6 lo6 = { + // .sin6_family = AF_INET6, .sin6_port = 65535, + // .sin6_addr = IN6ADDR_LOOPBACK_INIT + // }; + // int tf[2] = { AF_INET, AF_INET6 }; + // const void *ta[2] = { &lo4, &lo6 }; + // socklen_t tl[2] = { sizeof lo4, sizeof lo6 }; + // for (i=0; i<2; i++) { + // if (family==tf[1-i]) continue; + // int s = socket(tf[i], SOCK_CLOEXEC|SOCK_DGRAM, + // IPPROTO_UDP); + // if (s>=0) { + // int cs; + // pthread_setcancelstate( + // PTHREAD_CANCEL_DISABLE, &cs); + // int r = connect(s, ta[i], tl[i]); + // pthread_setcancelstate(cs, 0); + // close(s); + // if (!r) continue; + // } + // switch (errno) { + // case EADDRNOTAVAIL: + // case EAFNOSUPPORT: + // case EHOSTUNREACH: + // case ENETDOWN: + // case ENETUNREACH: + // break; + // default: + // return EAI_SYSTEM; + // } + // if (family == tf[i]) return EAI_NONAME; + // family = tf[1-i]; + // } + } + + nservs = X__lookup_serv(tls, bp /* &ports[0] */, serv, proto, socktype, flags) + if nservs < 0 { + return nservs + } + + naddrs = X__lookup_name(tls, bp+8 /* &addrs[0] */, bp+1352 /* &canon[0] */, host, family, flags) + if naddrs < 0 { + return naddrs + } + + nais = (nservs * naddrs) + canon_len = int32(Xstrlen(tls, bp+1352 /* &canon[0] */)) + out = Xcalloc(tls, uint64(1), (((uint64(nais) * uint64(unsafe.Sizeof(aibuf{}))) + uint64(canon_len)) + uint64(1))) + if !(out != 0) { + return -10 + } + + if canon_len != 0 { + outcanon = (out + uintptr(nais)*88) + Xmemcpy(tls, outcanon, bp+1352 /* &canon[0] */, (uint64(canon_len + 1))) + } else { + outcanon = uintptr(0) + } + + for k = AssignInt32(&i, 0); i < naddrs; i++ { + j = 0 + __1: + if !(j < nservs) { + goto __3 + } + { + (*aibuf)(unsafe.Pointer(out + uintptr(k)*88)).slot = int16(k) + //TODO out[k].ai = (struct addrinfo){ + //TODO .ai_family = addrs[i].family, + //TODO .ai_socktype = ports[j].socktype, + //TODO .ai_protocol = ports[j].proto, + //TODO .ai_addrlen = addrs[i].family == AF_INET + //TODO ? sizeof(struct sockaddr_in) + //TODO : sizeof(struct sockaddr_in6), + //TODO .ai_addr = (void *)&out[k].sa, + //TODO .ai_canonname = outcanon }; + (*aibuf)(unsafe.Pointer(out + uintptr(k)*88)).ai.ai_family = (*address)(unsafe.Pointer(bp + 8 /* &addrs */ + uintptr(i)*28)).family + (*aibuf)(unsafe.Pointer(out + uintptr(k)*88)).ai.ai_socktype = int32((*service)(unsafe.Pointer(bp /* &ports */ + uintptr(j)*4)).socktype) + (*aibuf)(unsafe.Pointer(out + uintptr(k)*88)).ai.ai_protocol = int32((*service)(unsafe.Pointer(bp /* &ports */ + uintptr(j)*4)).proto) + (*aibuf)(unsafe.Pointer(out + uintptr(k)*88)).ai.ai_addrlen = func() uint32 { + if (*address)(unsafe.Pointer(bp+8 /* &addrs */ +uintptr(i)*28)).family == 2 { + return uint32(unsafe.Sizeof(sockaddr_in{})) + } + return uint32(unsafe.Sizeof(sockaddr_in6{})) + }() + (*aibuf)(unsafe.Pointer(out + uintptr(k)*88)).ai.ai_addr = (out + uintptr(k)*88 + 48 /* &.sa */) + (*aibuf)(unsafe.Pointer(out + uintptr(k)*88)).ai.ai_canonname = outcanon + if k != 0 { + (*aibuf)(unsafe.Pointer(out + uintptr((k-1))*88)).ai.ai_next = (out + uintptr(k)*88 /* &.ai */) + } + switch (*address)(unsafe.Pointer(bp + 8 /* &addrs */ + uintptr(i)*28)).family { + case 2: + (*sockaddr_in)(unsafe.Pointer(out + uintptr(k)*88 + 48 /* &.sa */)).sin_family = sa_family_t(2) + (*sockaddr_in)(unsafe.Pointer(out + uintptr(k)*88 + 48 /* &.sa */)).sin_port = Xhtons(tls, (*service)(unsafe.Pointer(bp /* &ports */ +uintptr(j)*4)).port) + Xmemcpy(tls, (out + uintptr(k)*88 + 48 /* &.sa */ /* &.sin */ + 4 /* &.sin_addr */), (bp + 8 /* &addrs */ + uintptr(i)*28 + 8 /* &.addr */), uint64(4)) + break + case 10: + (*sockaddr_in6)(unsafe.Pointer(out + uintptr(k)*88 + 48 /* &.sa */)).sin6_family = sa_family_t(10) + (*sockaddr_in6)(unsafe.Pointer(out + uintptr(k)*88 + 48 /* &.sa */)).sin6_port = Xhtons(tls, (*service)(unsafe.Pointer(bp /* &ports */ +uintptr(j)*4)).port) + (*sockaddr_in6)(unsafe.Pointer(out + uintptr(k)*88 + 48 /* &.sa */)).sin6_scope_id = (*address)(unsafe.Pointer(bp + 8 /* &addrs */ + uintptr(i)*28)).scopeid + Xmemcpy(tls, (out + uintptr(k)*88 + 48 /* &.sa */ /* &.sin6 */ + 8 /* &.sin6_addr */), (bp + 8 /* &addrs */ + uintptr(i)*28 + 8 /* &.addr */), uint64(16)) + break + } + + } + goto __2 + __2: + j++ + k++ + goto __1 + goto __3 + __3: + } + (*aibuf)(unsafe.Pointer(out)).ref = int16(nais) + *(*uintptr)(unsafe.Pointer(res)) = (out /* &.ai */) + return 0 +} + +type ucred = struct { + pid pid_t + uid uid_t + gid gid_t +} /* socket.h:57:1 */ + +type mmsghdr = struct { + msg_hdr struct { + msg_name uintptr + msg_namelen socklen_t + _ [4]byte + msg_iov uintptr + msg_iovlen int32 + __pad1 int32 + msg_control uintptr + msg_controllen socklen_t + __pad2 int32 + msg_flags int32 + _ [4]byte + } + msg_len uint32 + _ [4]byte +} /* socket.h:63:1 */ + +func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* gethostbyaddr.c:7:16: */ + bp := tls.Alloc(8) + defer tls.Free(8) + + var size size_t = uint64(63) + // var res uintptr at bp, 8 + + var err int32 + for ok := true; ok; ok = (err == 34) { + Xfree(tls, _sh) + _sh = Xmalloc(tls, AssignAddUint64(&size, (size+uint64(1)))) + if !(_sh != 0) { + (*(*int32)(unsafe.Pointer(X__h_errno_location(tls)))) = 3 + return uintptr(0) + } + err = Xgethostbyaddr_r(tls, a, l, af, _sh, + (_sh + uintptr(1)*32), (size - size_t(unsafe.Sizeof(hostent{}))), bp /* &res */, X__h_errno_location(tls)) + } + if err != 0 { + return uintptr(0) + } + return _sh +} + +var _sh uintptr /* gethostbyaddr.c:9:24: */ + +func Xgethostbyname(tls *TLS, name uintptr) uintptr { /* gethostbyname.c:8:16: */ + return Xgethostbyname2(tls, name, 2) +} + +func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbyname2.c:8:16: */ + bp := tls.Alloc(8) + defer tls.Free(8) + + var size size_t = uint64(63) + // var res uintptr at bp, 8 + + var err int32 + for ok := true; ok; ok = (err == 34) { + Xfree(tls, _sh1) + _sh1 = Xmalloc(tls, AssignAddUint64(&size, (size+uint64(1)))) + if !(_sh1 != 0) { + (*(*int32)(unsafe.Pointer(X__h_errno_location(tls)))) = 3 + return uintptr(0) + } + err = Xgethostbyname2_r(tls, name, af, _sh1, + (_sh1 + uintptr(1)*32), (size - size_t(unsafe.Sizeof(hostent{}))), bp /* &res */, X__h_errno_location(tls)) + } + if err != 0 { + return uintptr(0) + } + return _sh1 +} + +var _sh1 uintptr /* gethostbyname2.c:10:24: */ + +func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname2_r.c:11:5: */ + bp := tls.Alloc(1600) + defer tls.Free(1600) + + // var addrs [48]address at bp, 1344 + + // var canon [256]int8 at bp+1344, 256 + + var i int32 + var cnt int32 + var align size_t + var need size_t + + *(*uintptr)(unsafe.Pointer(res)) = uintptr(0) + cnt = X__lookup_name(tls, bp /* &addrs[0] */, bp+1344 /* &canon[0] */, name, af, 0x02) + if cnt < 0 { + switch cnt { + case -2: + *(*int32)(unsafe.Pointer(err)) = 1 + return 2 + fallthrough + case -3: + *(*int32)(unsafe.Pointer(err)) = 2 + return 11 + fallthrough + default: + fallthrough + case -4: + *(*int32)(unsafe.Pointer(err)) = 3 + return 74 + fallthrough + case -10: + fallthrough + case -11: + *(*int32)(unsafe.Pointer(err)) = 3 + return *(*int32)(unsafe.Pointer(X___errno_location(tls))) + } + } + + (*hostent)(unsafe.Pointer(h)).h_addrtype = af + (*hostent)(unsafe.Pointer(h)).h_length = func() int32 { + if af == 10 { + return 16 + } + return 4 + }() + + // Align buffer + align = (-uintptr_t(buf) & (uint64(unsafe.Sizeof(uintptr(0))) - uint64(1))) + + need = (uint64(4) * uint64(unsafe.Sizeof(uintptr(0)))) + need = need + ((uint64(cnt + 1)) * (uint64(unsafe.Sizeof(uintptr(0))) + uint64((*hostent)(unsafe.Pointer(h)).h_length))) + need = need + (Xstrlen(tls, name) + uint64(1)) + need = need + (Xstrlen(tls, bp+1344 /* &canon[0] */) + uint64(1)) + need = need + (align) + + if need > buflen { + return 34 + } + + buf += uintptr(align) + (*hostent)(unsafe.Pointer(h)).h_aliases = buf + buf += (uintptr(uint64(3) * uint64(unsafe.Sizeof(uintptr(0))))) + (*hostent)(unsafe.Pointer(h)).h_addr_list = buf + buf += (uintptr((uint64(cnt + 1)) * uint64(unsafe.Sizeof(uintptr(0))))) + + for i = 0; i < cnt; i++ { + *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_addr_list + uintptr(i)*8)) = buf + buf += uintptr((*hostent)(unsafe.Pointer(h)).h_length) + Xmemcpy(tls, *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_addr_list + uintptr(i)*8)), bp /* &addrs */ +uintptr(i)*28+8 /* &.addr */, uint64((*hostent)(unsafe.Pointer(h)).h_length)) + } + *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_addr_list + uintptr(i)*8)) = uintptr(0) + + (*hostent)(unsafe.Pointer(h)).h_name = AssignPtrUintptr((*hostent)(unsafe.Pointer(h)).h_aliases, buf) + Xstrcpy(tls, (*hostent)(unsafe.Pointer(h)).h_name, bp+1344 /* &canon[0] */) + buf += (uintptr(Xstrlen(tls, (*hostent)(unsafe.Pointer(h)).h_name) + uint64(1))) + + if Xstrcmp(tls, (*hostent)(unsafe.Pointer(h)).h_name, name) != 0 { + *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_aliases + 1*8)) = buf + Xstrcpy(tls, *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_aliases + 1*8)), name) + buf += (uintptr(Xstrlen(tls, *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_aliases + 1*8))) + uint64(1))) + } else { + *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_aliases + 1*8)) = uintptr(0) + } + + *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_aliases + 2*8)) = uintptr(0) + + *(*uintptr)(unsafe.Pointer(res)) = h + return 0 +} + +type if_nameindex = struct { + if_index uint32 + _ [4]byte + if_name uintptr +} /* if.h:12:1 */ + +type ifaddr = struct { + ifa_addr struct { + sa_family sa_family_t + sa_data [14]int8 + } + ifa_ifu struct { + ifu_broadaddr struct { + sa_family sa_family_t + sa_data [14]int8 + } + } + ifa_ifp uintptr + ifa_next uintptr +} /* if.h:51:1 */ + +type ifmap = struct { + mem_start uint64 + mem_end uint64 + base_addr uint16 + irq uint8 + dma uint8 + port uint8 + _ [3]byte +} /* if.h:64:1 */ + +type ifreq = struct { + ifr_ifrn struct{ ifrn_name [16]int8 } + ifr_ifru struct { + _ [0]uint64 + ifru_addr struct { + sa_family sa_family_t + sa_data [14]int8 + } + _ [8]byte + } +} /* if.h:76:1 */ + +type ifconf = struct { + ifc_len int32 + _ [4]byte + ifc_ifcu struct{ ifcu_buf uintptr } +} /* if.h:116:1 */ + +type ns_sect = uint32 /* nameser.h:37:3 */ + +type __ns_msg = struct { + _msg uintptr + _eom uintptr + _id uint16_t + _flags uint16_t + _counts [4]uint16_t + _ [4]byte + _sections [4]uintptr + _sect ns_sect + _rrnum int32 + _msg_ptr uintptr +} /* nameser.h:39:9 */ + +type ns_msg = __ns_msg /* nameser.h:46:3 */ + +type _ns_flagdata = struct { + mask int32 + shift int32 +} /* nameser.h:48:1 */ + +type __ns_rr = struct { + name [1025]int8 + _ [1]byte + __type uint16_t + rr_class uint16_t + _ [2]byte + ttl uint32_t + rdlength uint16_t + _ [2]byte + rdata uintptr +} /* nameser.h:59:9 */ + +type ns_rr = __ns_rr /* nameser.h:66:3 */ + +type ns_flag = uint32 /* nameser.h:87:3 */ + +type ns_opcode = uint32 /* nameser.h:96:3 */ + +type ns_rcode = uint32 /* nameser.h:115:3 */ + +type ns_update_operation = uint32 /* nameser.h:121:3 */ + +type ns_tsig_key1 = struct { + name [1025]int8 + alg [1025]int8 + _ [6]byte + data uintptr + len int32 + _ [4]byte +} /* nameser.h:123:1 */ + +type ns_tsig_key = ns_tsig_key1 /* nameser.h:128:28 */ + +type ns_tcp_tsig_state1 = struct { + counter int32 + _ [4]byte + key uintptr + ctx uintptr + sig [512]uint8 + siglen int32 + _ [4]byte +} /* nameser.h:130:1 */ + +type ns_tcp_tsig_state = ns_tcp_tsig_state1 /* nameser.h:137:34 */ + +type ns_type = uint32 /* nameser.h:200:3 */ + +type ns_class = uint32 /* nameser.h:219:3 */ + +type ns_key_types = uint32 /* nameser.h:226:3 */ + +type ns_cert_types = uint32 /* nameser.h:234:3 */ + +type HEADER = struct { + _ [0]uint32 + id uint32 /* unsigned id: 16, unsigned rd: 1, unsigned tc: 1, unsigned aa: 1, unsigned opcode: 4, unsigned qr: 1, unsigned rcode: 4, unsigned cd: 1, unsigned ad: 1, unsigned unused: 1, unsigned ra: 1 */ + qdcount uint32 /* unsigned qdcount: 16, unsigned ancount: 16 */ + nscount uint32 /* unsigned nscount: 16, unsigned arcount: 16 */ +} /* nameser.h:353:3 */ + +// unused; purely for broken apps +type __res_state = struct { + retrans int32 + retry int32 + options uint64 + nscount int32 + nsaddr_list [3]struct { + sin_family sa_family_t + sin_port in_port_t + sin_addr struct{ s_addr in_addr_t } + sin_zero [8]uint8_t + } + id uint16 + _ [2]byte + dnsrch [7]uintptr + defdname [256]int8 + pfcode uint64 + ndots uint32 /* unsigned ndots: 4, unsigned nsort: 4, unsigned ipv6_unavail: 1, unsigned unused: 23 */ + _ [4]byte + sort_list [10]struct { + addr struct{ s_addr in_addr_t } + mask uint32_t + } + qhook uintptr + rhook uintptr + res_h_errno int32 + _vcsock int32 + _flags uint32 + _ [4]byte + _u struct { + _ [0]uint64 + pad [52]int8 + _ [4]byte + } +} /* resolv.h:26:9 */ + +// unused; purely for broken apps +type res_state = uintptr /* resolv.h:62:3 */ + +type res_sym = struct { + number int32 + _ [4]byte + name uintptr + humanname uintptr +} /* resolv.h:70:1 */ + +func itoa(tls *TLS, p uintptr, x uint32) uintptr { /* getnameinfo.c:18:13: */ + p += (uintptr(uint64(3) * uint64(unsafe.Sizeof(int32(0))))) + *(*int8)(unsafe.Pointer(PreDecUintptr(&p, 1))) = int8(0) + for ok := true; ok; ok = x != 0 { + *(*int8)(unsafe.Pointer(PreDecUintptr(&p, 1))) = (int8(uint32('0') + (x % uint32(10)))) + x = x / (uint32(10)) + } + return p +} + +func mkptr4(tls *TLS, s uintptr, ip uintptr) { /* getnameinfo.c:28:13: */ + bp := tls.Alloc(32) + defer tls.Free(32) + + Xsprintf(tls, s, ts+64, /* "%d.%d.%d.%d.in-a..." */ + VaList(bp, int32(*(*uint8)(unsafe.Pointer(ip + 3))), int32(*(*uint8)(unsafe.Pointer(ip + 2))), int32(*(*uint8)(unsafe.Pointer(ip + 1))), int32(*(*uint8)(unsafe.Pointer(ip))))) +} + +func mkptr6(tls *TLS, s uintptr, ip uintptr) { /* getnameinfo.c:34:13: */ + var i int32 + for i = 15; i >= 0; i-- { + *(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = _sxdigits[(int32(*(*uint8)(unsafe.Pointer(ip + uintptr(i)))) & 15)] + *(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = int8('.') + *(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = _sxdigits[(int32(*(*uint8)(unsafe.Pointer(ip + uintptr(i)))) >> 4)] + *(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = int8('.') + } + Xstrcpy(tls, s, ts+89 /* "ip6.arpa" */) +} + +var _sxdigits = *(*[17]int8)(unsafe.Pointer(ts + 98 /* "0123456789abcdef" */)) /* getnameinfo.c:36:20 */ + +func reverse_hosts(tls *TLS, buf uintptr, a uintptr, scopeid uint32, family int32) { /* getnameinfo.c:45:13: */ + bp := tls.Alloc(556) + defer tls.Free(556) + + // var line [512]int8 at bp+16, 512 + + var p uintptr + var z uintptr + var _buf [1032]uint8 + _ = _buf + // var atmp [16]uint8 at bp, 16 + + // var iplit address at bp+528, 28 + + //TODO FILE _f, *f = __fopen_rb_ca("/etc/hosts", &_f, _buf, sizeof _buf); + var f uintptr = Xfopen(tls, ts+115 /* "/etc/hosts" */, ts+126 /* "rb" */) + if !(f != 0) { + return + } + if family == 2 { + Xmemcpy(tls, (bp /* &atmp[0] */ + uintptr(12)), a, uint64(4)) + Xmemcpy(tls, bp /* &atmp[0] */, ts+129 /* "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff" */, uint64(12)) + a = bp /* &atmp[0] */ + } + for Xfgets(tls, bp+16 /* &line[0] */, int32(unsafe.Sizeof([512]int8{})), f) != 0 { + if AssignUintptr(&p, Xstrchr(tls, bp+16 /* &line[0] */, '#')) != 0 { + *(*int8)(unsafe.Pointer(PostIncUintptr(&p, 1))) = int8('\n') + *(*int8)(unsafe.Pointer(p)) = int8(0) + } + + for p = bp + 16; /* &line[0] */ (*(*int8)(unsafe.Pointer(p)) != 0) && !(__isspace(tls, int32(*(*int8)(unsafe.Pointer(p)))) != 0); p++ { + } + *(*int8)(unsafe.Pointer(PostIncUintptr(&p, 1))) = int8(0) + if X__lookup_ipliteral(tls, bp+528 /* &iplit */, bp+16 /* &line[0] */, 0) <= 0 { + continue + } + + if (*address)(unsafe.Pointer(bp+528 /* &iplit */)).family == 2 { + Xmemcpy(tls, ((bp + 528 /* &iplit */ + 8 /* &.addr */) + uintptr(12)), bp+528 /* &iplit */ +8 /* &.addr */, uint64(4)) + Xmemcpy(tls, bp+528 /* &iplit */ +8 /* &.addr */, ts+129 /* "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff" */, uint64(12)) + (*address)(unsafe.Pointer(bp + 528 /* &iplit */)).scopeid = uint32(0) + } + + if (Xmemcmp(tls, a, bp+528 /* &iplit */ +8 /* &.addr */, uint64(16)) != 0) || ((*address)(unsafe.Pointer(bp+528 /* &iplit */)).scopeid != scopeid) { + continue + } + + for ; (*(*int8)(unsafe.Pointer(p)) != 0) && (__isspace(tls, int32(*(*int8)(unsafe.Pointer(p)))) != 0); p++ { + } + for z = p; (*(*int8)(unsafe.Pointer(z)) != 0) && !(__isspace(tls, int32(*(*int8)(unsafe.Pointer(z)))) != 0); z++ { + } + *(*int8)(unsafe.Pointer(z)) = int8(0) + if ((int64(z) - int64(p)) / 1) < int64(256) { + Xmemcpy(tls, buf, p, (uint64(((int64(z) - int64(p)) / 1) + int64(1)))) + break + } + } + //TODO __fclose_ca(f); + Xfclose(tls, f) +} + +func reverse_services(tls *TLS, buf uintptr, port int32, dgram int32) { /* getnameinfo.c:87:13: */ + Xabort(tls) //TODO- + // unsigned long svport; + // char line[128], *p, *z; + // unsigned char _buf[1032]; + // FILE _f, *f = __fopen_rb_ca("/etc/services", &_f, _buf, sizeof _buf); + // if (!f) return; + // while (fgets(line, sizeof line, f)) { + // if ((p=strchr(line, '#'))) *p++='\n', *p=0; + + // for (p=line; *p && !isspace(*p); p++); + // if (!*p) continue; + // *p++ = 0; + // svport = strtoul(p, &z, 10); + + // if (svport != port || z==p) continue; + // if (dgram && strncmp(z, "/udp", 4)) continue; + // if (!dgram && strncmp(z, "/tcp", 4)) continue; + // if (p-line > 32) continue; + + // memcpy(buf, line, p-line); + // break; + // } + // __fclose_ca(f); +} + +var Xh_errno int32 /* h_errno.c:4:5: */ + +func X__h_errno_location(tls *TLS) uintptr { /* h_errno.c:6:5: */ + return uintptr(unsafe.Pointer(&Xh_errno)) +} + +func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5: */ + bp := tls.Alloc(40) + defer tls.Free(40) + + var s uintptr = s0 + var d uintptr = dest + *(*[4]uint64)(unsafe.Pointer(bp /* a */)) = [4]uint64{0: uint64(0)} + // var z uintptr at bp+32, 8 + + var i int32 + + for i = 0; i < 4; i++ { + *(*uint64)(unsafe.Pointer(bp /* &a[0] */ + uintptr(i)*8)) = Xstrtoul(tls, s, bp+32 /* &z */, 0) + if ((*(*uintptr)(unsafe.Pointer(bp + 32 /* z */)) == s) || ((*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* z */)))) != 0) && (int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* z */))))) != '.'))) || !(func() int32 { + if 0 != 0 { + return Xisdigit(tls, int32(*(*int8)(unsafe.Pointer(s)))) + } + return (Bool32(((uint32(*(*int8)(unsafe.Pointer(s)))) - uint32('0')) < uint32(10))) + }() != 0) { + return 0 + } + if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* z */))))) != 0) { + break + } + s = (*(*uintptr)(unsafe.Pointer(bp + 32 /* z */)) + uintptr(1)) + } + if i == 4 { + return 0 + } + switch i { + case 0: + *(*uint64)(unsafe.Pointer(bp /* &a[0] */ + 1*8)) = (*(*uint64)(unsafe.Pointer(bp /* &a[0] */)) & uint64(0xffffff)) + AssignShrPtrUint64(bp /* &a */, int(24)) + fallthrough + case 1: + *(*uint64)(unsafe.Pointer(bp /* &a[0] */ + 2*8)) = (*(*uint64)(unsafe.Pointer(bp /* &a[0] */ + 1*8)) & uint64(0xffff)) + AssignShrPtrUint64(bp /* &a */ +1*8, int(16)) + fallthrough + case 2: + *(*uint64)(unsafe.Pointer(bp /* &a[0] */ + 3*8)) = (*(*uint64)(unsafe.Pointer(bp /* &a[0] */ + 2*8)) & uint64(0xff)) + AssignShrPtrUint64(bp /* &a */ +2*8, int(8)) + } + for i = 0; i < 4; i++ { + if *(*uint64)(unsafe.Pointer(bp /* &a[0] */ + uintptr(i)*8)) > uint64(255) { + return 0 + } + *(*uint8)(unsafe.Pointer(d + uintptr(i))) = uint8(*(*uint64)(unsafe.Pointer(bp /* &a[0] */ + uintptr(i)*8))) + } + return 1 +} + +func Xinet_ntop(tls *TLS, af int32, a0 uintptr, s uintptr, l socklen_t) uintptr { /* inet_ntop.c:7:12: */ + bp := tls.Alloc(276) + defer tls.Free(276) + + var a uintptr = a0 + var i int32 + var j int32 + var max int32 + var best int32 + // var buf [100]int8 at bp+176, 100 + + switch af { + case 2: + if socklen_t(Xsnprintf(tls, s, uint64(l), ts+142 /* "%d.%d.%d.%d" */, VaList(bp, int32(*(*uint8)(unsafe.Pointer(a))), int32(*(*uint8)(unsafe.Pointer(a + 1))), int32(*(*uint8)(unsafe.Pointer(a + 2))), int32(*(*uint8)(unsafe.Pointer(a + 3)))))) < l { + return s + } + break + case 10: + if Xmemcmp(tls, a, ts+129 /* "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff" */, uint64(12)) != 0 { + Xsnprintf(tls, bp+176 /* &buf[0] */, uint64(unsafe.Sizeof([100]int8{})), + ts+154, /* "%x:%x:%x:%x:%x:%..." */ + VaList(bp+32, ((256*int32(*(*uint8)(unsafe.Pointer(a))))+int32(*(*uint8)(unsafe.Pointer(a + 1)))), ((256*int32(*(*uint8)(unsafe.Pointer(a + 2))))+int32(*(*uint8)(unsafe.Pointer(a + 3)))), + ((256*int32(*(*uint8)(unsafe.Pointer(a + 4))))+int32(*(*uint8)(unsafe.Pointer(a + 5)))), ((256*int32(*(*uint8)(unsafe.Pointer(a + 6))))+int32(*(*uint8)(unsafe.Pointer(a + 7)))), + ((256*int32(*(*uint8)(unsafe.Pointer(a + 8))))+int32(*(*uint8)(unsafe.Pointer(a + 9)))), ((256*int32(*(*uint8)(unsafe.Pointer(a + 10))))+int32(*(*uint8)(unsafe.Pointer(a + 11)))), + ((256*int32(*(*uint8)(unsafe.Pointer(a + 12))))+int32(*(*uint8)(unsafe.Pointer(a + 13)))), ((256*int32(*(*uint8)(unsafe.Pointer(a + 14))))+int32(*(*uint8)(unsafe.Pointer(a + 15)))))) + } else { + Xsnprintf(tls, bp+176 /* &buf[0] */, uint64(unsafe.Sizeof([100]int8{})), + ts+178, /* "%x:%x:%x:%x:%x:%..." */ + VaList(bp+96, ((256*int32(*(*uint8)(unsafe.Pointer(a))))+int32(*(*uint8)(unsafe.Pointer(a + 1)))), ((256*int32(*(*uint8)(unsafe.Pointer(a + 2))))+int32(*(*uint8)(unsafe.Pointer(a + 3)))), + ((256*int32(*(*uint8)(unsafe.Pointer(a + 4))))+int32(*(*uint8)(unsafe.Pointer(a + 5)))), ((256*int32(*(*uint8)(unsafe.Pointer(a + 6))))+int32(*(*uint8)(unsafe.Pointer(a + 7)))), + ((256*int32(*(*uint8)(unsafe.Pointer(a + 8))))+int32(*(*uint8)(unsafe.Pointer(a + 9)))), ((256*int32(*(*uint8)(unsafe.Pointer(a + 10))))+int32(*(*uint8)(unsafe.Pointer(a + 11)))), + int32(*(*uint8)(unsafe.Pointer(a + 12))), int32(*(*uint8)(unsafe.Pointer(a + 13))), int32(*(*uint8)(unsafe.Pointer(a + 14))), int32(*(*uint8)(unsafe.Pointer(a + 15))))) + } + // Replace longest /(^0|:)[:0]{2,}/ with "::" + i = AssignInt32(&best, 0) + max = 2 + for ; *(*int8)(unsafe.Pointer(bp + 176 /* &buf[0] */ + uintptr(i))) != 0; i++ { + if (i != 0) && (int32(*(*int8)(unsafe.Pointer(bp + 176 /* &buf[0] */ + uintptr(i)))) != ':') { + continue + } + j = int32(Xstrspn(tls, (bp + 176 /* &buf[0] */ + uintptr(i)), ts+208 /* ":0" */)) + if j > max { + best = i + max = j + } + } + if max > 3 { + *(*int8)(unsafe.Pointer(bp + 176 /* &buf[0] */ + uintptr(best))) = AssignPtrInt8(bp+176 /* &buf */ +uintptr((best+1)), int8(':')) + Xmemmove(tls, ((bp + 176 /* &buf[0] */ + uintptr(best)) + uintptr(2)), ((bp + 176 /* &buf[0] */ + uintptr(best)) + uintptr(max)), (uint64(((i - best) - max) + 1))) + } + if Xstrlen(tls, bp+176 /* &buf[0] */) < size_t(l) { + Xstrcpy(tls, s, bp+176 /* &buf[0] */) + return s + } + break + default: + (*(*int32)(unsafe.Pointer(X___errno_location(tls)))) = 97 + return uintptr(0) + } + (*(*int32)(unsafe.Pointer(X___errno_location(tls)))) = 28 + return uintptr(0) +} + +func hexval(tls *TLS, c uint32) int32 { /* inet_pton.c:7:12: */ + if (c - uint32('0')) < uint32(10) { + return (int32(c - uint32('0'))) + } + c = c | (uint32(32)) + if (c - uint32('a')) < uint32(6) { + return (int32((c - uint32('a')) + uint32(10))) + } + return -1 +} + +func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton.c:15:5: */ + bp := tls.Alloc(16) + defer tls.Free(16) + + // var ip [8]uint16_t at bp, 16 + + var a uintptr = a0 + var i int32 + var j int32 + var v int32 + var d int32 + var brk int32 = -1 + var need_v4 int32 = 0 + + if af == 2 { + for i = 0; i < 4; i++ { + for v = AssignInt32(&j, 0); (j < 3) && (func() int32 { + if 0 != 0 { + return Xisdigit(tls, int32(*(*int8)(unsafe.Pointer(s + uintptr(j))))) + } + return (Bool32(((uint32(*(*int8)(unsafe.Pointer(s + uintptr(j))))) - uint32('0')) < uint32(10))) + }() != 0); j++ { + v = (((10 * v) + int32(*(*int8)(unsafe.Pointer(s + uintptr(j))))) - '0') + } + if ((j == 0) || ((j > 1) && (int32(*(*int8)(unsafe.Pointer(s))) == '0'))) || (v > 255) { + return 0 + } + *(*uint8)(unsafe.Pointer(a + uintptr(i))) = uint8(v) + if (int32(*(*int8)(unsafe.Pointer(s + uintptr(j)))) == 0) && (i == 3) { + return 1 + } + if int32(*(*int8)(unsafe.Pointer(s + uintptr(j)))) != '.' { + return 0 + } + s += (uintptr(j + 1)) + } + return 0 + } else if af != 10 { + (*(*int32)(unsafe.Pointer(X___errno_location(tls)))) = 97 + return -1 + } + + if (int32(*(*int8)(unsafe.Pointer(s))) == ':') && (int32(*(*int8)(unsafe.Pointer(PreIncUintptr(&s, 1)))) != ':') { + return 0 + } + + for i = 0; ; i++ { + if (int32(*(*int8)(unsafe.Pointer(s))) == ':') && (brk < 0) { + brk = i + *(*uint16_t)(unsafe.Pointer(bp /* &ip[0] */ + uintptr((i&7))*2)) = uint16_t(0) + if !(int32(*(*int8)(unsafe.Pointer(PreIncUintptr(&s, 1)))) != 0) { + break + } + if i == 7 { + return 0 + } + continue + } + for v = AssignInt32(&j, 0); (j < 4) && ((AssignInt32(&d, hexval(tls, uint32(*(*int8)(unsafe.Pointer(s + uintptr(j))))))) >= 0); j++ { + v = ((16 * v) + d) + } + if j == 0 { + return 0 + } + *(*uint16_t)(unsafe.Pointer(bp /* &ip[0] */ + uintptr((i&7))*2)) = uint16_t(v) + if !(int32(*(*int8)(unsafe.Pointer(s + uintptr(j)))) != 0) && ((brk >= 0) || (i == 7)) { + break + } + if i == 7 { + return 0 + } + if int32(*(*int8)(unsafe.Pointer(s + uintptr(j)))) != ':' { + if (int32(*(*int8)(unsafe.Pointer(s + uintptr(j)))) != '.') || ((i < 6) && (brk < 0)) { + return 0 + } + need_v4 = 1 + i++ + break + } + s += (uintptr(j + 1)) + } + if brk >= 0 { + Xmemmove(tls, (((bp /* &ip[0] */ + uintptr(brk)*2) + uintptr(7)*2) - uintptr(i)*2), (bp /* &ip[0] */ + uintptr(brk)*2), (uint64(2 * ((i + 1) - brk)))) + for j = 0; j < (7 - i); j++ { + *(*uint16_t)(unsafe.Pointer(bp /* &ip[0] */ + uintptr((brk+j))*2)) = uint16_t(0) + } + } + for j = 0; j < 8; j++ { + *(*uint8)(unsafe.Pointer(PostIncUintptr(&a, 1))) = (uint8(int32(*(*uint16_t)(unsafe.Pointer(bp /* &ip[0] */ + uintptr(j)*2))) >> 8)) + *(*uint8)(unsafe.Pointer(PostIncUintptr(&a, 1))) = uint8(*(*uint16_t)(unsafe.Pointer(bp /* &ip[0] */ + uintptr(j)*2))) + } + if (need_v4 != 0) && (Xinet_pton(tls, 2, s, (a-uintptr(4))) <= 0) { + return 0 + } + return 1 +} + +func X__lookup_ipliteral(tls *TLS, buf uintptr, name uintptr, family int32) int32 { /* lookup_ipliteral.c:12:5: */ + bp := tls.Alloc(96) + defer tls.Free(96) + + // var a4 in_addr at bp, 4 + + // var a6 in6_addr at bp+68, 16 + + if X__inet_aton(tls, name, bp /* &a4 */) > 0 { + if family == 10 { // wrong family + return -2 + } + Xmemcpy(tls, (buf + 8 /* &.addr */), bp /* &a4 */, uint64(unsafe.Sizeof(in_addr{}))) + (*address)(unsafe.Pointer(buf)).family = 2 + (*address)(unsafe.Pointer(buf)).scopeid = uint32(0) + return 1 + } + // var tmp [64]int8 at bp+4, 64 + + var p uintptr = Xstrchr(tls, name, '%') + // var z uintptr at bp+88, 8 + + var scopeid uint64 = uint64(0) + if (p != 0) && (((int64(p) - int64(name)) / 1) < int64(64)) { + Xmemcpy(tls, bp+4 /* &tmp[0] */, name, (uint64((int64(p) - int64(name)) / 1))) + *(*int8)(unsafe.Pointer(bp + 4 /* &tmp[0] */ + uintptr(((int64(p) - int64(name)) / 1)))) = int8(0) + name = bp + 4 /* &tmp[0] */ + } + + if Xinet_pton(tls, 10, name, bp+68 /* &a6 */) <= 0 { + return 0 + } + if family == 2 { // wrong family + return -2 + } + + Xmemcpy(tls, (buf + 8 /* &.addr */), bp+68 /* &a6 */, uint64(unsafe.Sizeof(in6_addr{}))) + (*address)(unsafe.Pointer(buf)).family = 10 + if p != 0 { + if func() int32 { + if 0 != 0 { + return Xisdigit(tls, int32(*(*int8)(unsafe.Pointer(PreIncUintptr(&p, 1))))) + } + return (Bool32(((uint32(*(*int8)(unsafe.Pointer(PreIncUintptr(&p, 1))))) - uint32('0')) < uint32(10))) + }() != 0 { + scopeid = Xstrtoull(tls, p, bp+88 /* &z */, 10) + } else { + *(*uintptr)(unsafe.Pointer(bp + 88 /* z */)) = (p - uintptr(1)) + } + if *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88 /* z */)))) != 0 { + Xabort(tls) //TODO- + // if (!IN6_IS_ADDR_LINKLOCAL(&a6) && + // !IN6_IS_ADDR_MC_LINKLOCAL(&a6)) + // return EAI_NONAME; + // scopeid = if_nametoindex(p); + // if (!scopeid) return EAI_NONAME; + } + if scopeid > uint64(0xffffffff) { + return -2 + } + } + (*address)(unsafe.Pointer(buf)).scopeid = uint32(scopeid) + return 1 +} + +type mode_t = uint32 /* alltypes.h:152:18 */ + +type flock = struct { + l_type int16 + l_whence int16 + _ [4]byte + l_start off_t + l_len off_t + l_pid pid_t + _ [4]byte +} /* fcntl.h:24:1 */ + +func is_valid_hostname(tls *TLS, host uintptr) int32 { /* lookup_name.c:18:12: */ + var s uintptr + //TODO if (strnlen(host, 255)-1 >= 254 || mbstowcs(0, host, 0) == -1) return 0; + if (Xstrnlen(tls, host, uint64(255)) - uint64(1)) >= uint64(254) { + return 0 + } + for s = host; (((int32(*(*uint8)(unsafe.Pointer(s))) >= 0x80) || (int32(*(*uint8)(unsafe.Pointer(s))) == '.')) || (int32(*(*uint8)(unsafe.Pointer(s))) == '-')) || (Xisalnum(tls, int32(*(*uint8)(unsafe.Pointer(s)))) != 0); s++ { + } + return BoolInt32(!(*(*uint8)(unsafe.Pointer(s)) != 0)) +} + +var Xzero_struct_address address /* lookup_name.c:27:16: */ + +func name_from_null(tls *TLS, buf uintptr, name uintptr, family int32, flags int32) int32 { /* lookup_name.c:29:12: */ + var cnt int32 = 0 + if name != 0 { + return 0 + } + if (flags & 0x01) != 0 { + //TODO if (family != AF_INET6) + //TODO buf[cnt++] = (struct address){ .family = AF_INET }; + if family != 10 { + var x = Xzero_struct_address + x.family = 2 + *(*address)(unsafe.Pointer(buf + uintptr(PostIncInt32(&cnt, 1))*28)) = x + } + //TODO if (family != AF_INET) + //TODO buf[cnt++] = (struct address){ .family = AF_INET6 }; + if family != 2 { + var x = Xzero_struct_address + x.family = 10 + *(*address)(unsafe.Pointer(buf + uintptr(PostIncInt32(&cnt, 1))*28)) = x + } + } else { + Xabort(tls) //TODO- + // if (family != AF_INET6) + // buf[cnt++] = (struct address){ .family = AF_INET, .addr = { 127,0,0,1 } }; + // if (family != AF_INET) + // buf[cnt++] = (struct address){ .family = AF_INET6, .addr = { [15] = 1 } }; + } + return cnt +} + +func name_from_numeric(tls *TLS, buf uintptr, name uintptr, family int32) int32 { /* lookup_name.c:58:12: */ + return X__lookup_ipliteral(tls, buf, name, family) +} + +func name_from_hosts(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32) int32 { /* lookup_name.c:63:12: */ + bp := tls.Alloc(512) + defer tls.Free(512) + + // var line [512]int8 at bp, 512 + + var l size_t = Xstrlen(tls, name) + var cnt int32 = 0 + var badfam int32 = 0 + var _buf [1032]uint8 + _ = _buf + //TODO FILE _f, *f = __fopen_rb_ca("/etc/hosts", &_f, _buf, sizeof _buf); + var _f FILE + _ = _f + var f uintptr = Xfopen(tls, ts+115 /* "/etc/hosts" */, ts+126 /* "rb" */) + if !(f != 0) { + switch *(*int32)(unsafe.Pointer(X___errno_location(tls))) { + case 2: + fallthrough + case 20: + fallthrough + case 13: + return 0 + fallthrough + default: + return -11 + } + } + for (Xfgets(tls, bp /* &line[0] */, int32(unsafe.Sizeof([512]int8{})), f) != 0) && (cnt < 48) { + var p uintptr + var z uintptr + + if AssignUintptr(&p, Xstrchr(tls, bp /* &line[0] */, '#')) != 0 { + *(*int8)(unsafe.Pointer(PostIncUintptr(&p, 1))) = int8('\n') + *(*int8)(unsafe.Pointer(p)) = int8(0) + } + for p = (bp /* &line[0] */ + uintptr(1)); (AssignUintptr(&p, Xstrstr(tls, p, name)) != 0) && (!(__isspace(tls, int32(*(*int8)(unsafe.Pointer(p + UintptrFromInt32(-1))))) != 0) || !(__isspace(tls, int32(*(*int8)(unsafe.Pointer(p + uintptr(l))))) != 0)); p++ { + } + if !(p != 0) { + continue + } + + // Isolate IP address to parse + for p = bp; /* &line[0] */ (*(*int8)(unsafe.Pointer(p)) != 0) && !(__isspace(tls, int32(*(*int8)(unsafe.Pointer(p)))) != 0); p++ { + } + *(*int8)(unsafe.Pointer(PostIncUintptr(&p, 1))) = int8(0) + switch name_from_numeric(tls, (buf + uintptr(cnt)*28), bp /* &line[0] */, family) { + case 1: + cnt++ + break + case 0: + continue + default: + badfam = -2 + continue + } + + // Extract first name as canonical name + for ; (*(*int8)(unsafe.Pointer(p)) != 0) && (__isspace(tls, int32(*(*int8)(unsafe.Pointer(p)))) != 0); p++ { + } + for z = p; (*(*int8)(unsafe.Pointer(z)) != 0) && !(__isspace(tls, int32(*(*int8)(unsafe.Pointer(z)))) != 0); z++ { + } + *(*int8)(unsafe.Pointer(z)) = int8(0) + if is_valid_hostname(tls, p) != 0 { + Xmemcpy(tls, canon, p, (uint64(((int64(z) - int64(p)) / 1) + int64(1)))) + } + } + //TODO __fclose_ca(f); + Xfclose(tls, f) + if cnt != 0 { + return cnt + } + return badfam +} + +type dpc_ctx = struct { + addrs uintptr + canon uintptr + cnt int32 + _ [4]byte +} /* lookup_name.c:112:1 */ + +func name_from_dns_search(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32) int32 { /* lookup_name.c:191:12: */ + return -1 //TODO- + Xabort(tls) + return int32(0) //TODO- + // char search[256]; + // struct resolvconf conf; + // size_t l, dots; + // char *p, *z; + + // if (__get_resolv_conf(&conf, search, sizeof search) < 0) return -1; + + // /* Count dots, suppress search when >=ndots or name ends in + // * a dot, which is an explicit request for global scope. */ + // for (dots=l=0; name[l]; l++) if (name[l]=='.') dots++; + // if (dots >= conf.ndots || name[l-1]=='.') *search = 0; + + // /* Strip final dot for canon, fail if multiple trailing dots. */ + // if (name[l-1]=='.') l--; + // if (!l || name[l-1]=='.') return EAI_NONAME; + + // /* This can never happen; the caller already checked length. */ + // if (l >= 256) return EAI_NONAME; + + // /* Name with search domain appended is setup in canon[]. This both + // * provides the desired default canonical name (if the requested + // * name is not a CNAME record) and serves as a buffer for passing + // * the full requested name to name_from_dns. */ + // memcpy(canon, name, l); + // canon[l] = '.'; + + // for (p=search; *p; p=z) { + // for (; isspace(*p); p++); + // for (z=p; *z && !isspace(*z); z++); + // if (z==p) break; + // if (z-p < 256 - l - 1) { + // memcpy(canon+l+1, p, z-p); + // canon[z-p+1+l] = 0; + // int cnt = name_from_dns(buf, canon, canon, family, &conf); + // if (cnt) return cnt; + // } + // } + + // canon[l] = 0; + // return name_from_dns(buf, canon, name, family, &conf); +} + +type policy = struct { + addr [16]uint8 + len uint8 + mask uint8 + prec uint8 + label uint8 +} /* lookup_name.c:237:14 */ + +var defpolicy = [6]policy{ + {addr: *(*[16]uint8)(unsafe.Pointer(ts + 211 /* "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01" */)), len: uint8(15), mask: uint8(0xff), prec: uint8(50)}, + {addr: *(*[16]uint8)(unsafe.Pointer(ts + 228 /* "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\x00\x00" */)), len: uint8(11), mask: uint8(0xff), prec: uint8(35), label: uint8(4)}, + {addr: *(*[16]uint8)(unsafe.Pointer(ts + 244 /* " \x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" */)), len: uint8(1), mask: uint8(0xff), prec: uint8(30), label: uint8(2)}, + {addr: *(*[16]uint8)(unsafe.Pointer(ts + 260 /* " \x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" */)), len: uint8(3), mask: uint8(0xff), prec: uint8(5), label: uint8(5)}, + {addr: *(*[16]uint8)(unsafe.Pointer(ts + 276 /* "\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" */)), mask: uint8(0xfe), prec: uint8(3), label: uint8(13)}, + // Last rule must match all addresses to stop loop. + {addr: *(*[16]uint8)(unsafe.Pointer(ts + 292 /* "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" */)), prec: uint8(40), label: uint8(1)}, +} /* lookup_name.c:241:3 */ + +func policyof(tls *TLS, a uintptr) uintptr { /* lookup_name.c:259:28: */ + var i int32 + for i = 0; ; i++ { + if Xmemcmp(tls, a /* &.__in6_union */ /* &.__s6_addr */, uintptr(unsafe.Pointer(&defpolicy))+uintptr(i)*20 /* &.addr */, uint64(defpolicy[i].len)) != 0 { + continue + } + if (int32(*(*uint8_t)(unsafe.Pointer((a /* &.__in6_union */ /* &.__s6_addr */) + uintptr(defpolicy[i].len)))) & int32(defpolicy[i].mask)) != + int32(*(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&defpolicy)) + uintptr(i)*20 /* &.addr */) + uintptr(defpolicy[i].len)))) { + continue + } + return (uintptr(unsafe.Pointer(&defpolicy)) + uintptr(i)*20) + } + return uintptr(0) +} + +func labelof(tls *TLS, a uintptr) int32 { /* lookup_name.c:272:12: */ + return int32((*policy)(unsafe.Pointer(policyof(tls, a))).label) +} + +func scopeof(tls *TLS, a uintptr) int32 { /* lookup_name.c:277:12: */ + if int32(*(*uint8_t)(unsafe.Pointer((a)))) == 0xff { + return (int32(*(*uint8_t)(unsafe.Pointer((a /* &.__in6_union */ /* &.__s6_addr */) + 1))) & 15) + } + if ((int32(*(*uint8_t)(unsafe.Pointer((a))))) == 0xfe) && ((int32(*(*uint8_t)(unsafe.Pointer((a) + 1))) & 0xc0) == 0x80) { + return 2 + } + if ((((((*(*uint32_t)(unsafe.Pointer((a))) == uint32_t(0)) && (*(*uint32_t)(unsafe.Pointer((a) + 1*4)) == uint32_t(0))) && (*(*uint32_t)(unsafe.Pointer((a) + 2*4)) == uint32_t(0))) && (int32(*(*uint8_t)(unsafe.Pointer((a) + 12))) == 0)) && (int32(*(*uint8_t)(unsafe.Pointer((a) + 13))) == 0)) && (int32(*(*uint8_t)(unsafe.Pointer((a) + 14))) == 0)) && (int32(*(*uint8_t)(unsafe.Pointer((a) + 15))) == 1) { + return 2 + } + if ((int32(*(*uint8_t)(unsafe.Pointer((a))))) == 0xfe) && ((int32(*(*uint8_t)(unsafe.Pointer((a) + 1))) & 0xc0) == 0xc0) { + return 5 + } + return 14 +} + +func prefixmatch(tls *TLS, s uintptr, d uintptr) int32 { /* lookup_name.c:286:12: */ + // FIXME: The common prefix length should be limited to no greater + // than the nominal length of the prefix portion of the source + // address. However the definition of the source prefix length is + // not clear and thus this limiting is not yet implemented. + var i uint32 + for i = uint32(0); (i < uint32(128)) && !(((int32(*(*uint8_t)(unsafe.Pointer((s /* &.__in6_union */ /* &.__s6_addr */) + uintptr((i / uint32(8)))))) ^ int32(*(*uint8_t)(unsafe.Pointer((d /* &.__in6_union */ /* &.__s6_addr */) + uintptr((i / uint32(8))))))) & (int32(128) >> (i % uint32(8)))) != 0); i++ { + } + return int32(i) +} + +func addrcmp(tls *TLS, _a uintptr, _b uintptr) int32 { /* lookup_name.c:305:12: */ + var a uintptr = _a + var b uintptr = _b + return ((*address)(unsafe.Pointer(b)).sortkey - (*address)(unsafe.Pointer(a)).sortkey) +} + +func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32, flags int32) int32 { /* lookup_name.c:311:5: */ + bp := tls.Alloc(92) + defer tls.Free(92) + + var cnt int32 = 0 + var i int32 + var j int32 + _ = j + + *(*int8)(unsafe.Pointer(canon)) = int8(0) + if name != 0 { + // reject empty name and check len so it fits into temp bufs + var l size_t = Xstrnlen(tls, name, uint64(255)) + if (l - uint64(1)) >= uint64(254) { + return -2 + } + Xmemcpy(tls, canon, name, (l + uint64(1))) + } + + // Procedurally, a request for v6 addresses with the v4-mapped + // flag set is like a request for unspecified family, followed + // by filtering of the results. + if (flags & 0x08) != 0 { + if family == 10 { + family = 0 + } else { + flags = flags - (0x08) + } + } + + // Try each backend until there's at least one result. + cnt = name_from_null(tls, buf, name, family, flags) + if !(cnt != 0) { + cnt = name_from_numeric(tls, buf, name, family) + } + if !(cnt != 0) && !((flags & 0x04) != 0) { + cnt = name_from_hosts(tls, buf, canon, name, family) + if !(cnt != 0) { + cnt = name_from_dns_search(tls, buf, canon, name, family) + } + } + if cnt <= 0 { + if cnt != 0 { + return cnt + } + return -2 + } + + // Filter/transform results for v4-mapped lookup, if requested. + if (flags & 0x08) != 0 { + Xabort(tls) //TODO- + // if (!(flags & AI_ALL)) { + // /* If any v6 results exist, remove v4 results. */ + // for (i=0; i<cnt && buf[i].family != AF_INET6; i++); + // if (i<cnt) { + // for (j=0; i<cnt; i++) { + // if (buf[i].family == AF_INET6) + // buf[j++] = buf[i]; + // } + // cnt = i = j; + // } + // } + // /* Translate any remaining v4 results to v6 */ + // for (i=0; i<cnt; i++) { + // if (buf[i].family != AF_INET) continue; + // memcpy(buf[i].addr+12, buf[i].addr, 4); + // memcpy(buf[i].addr, "\0\0\0\0\0\0\0\0\0\0\xff\xff", 12); + // buf[i].family = AF_INET6; + // } + } + + // No further processing is needed if there are fewer than 2 + // results or if there are only IPv4 results. + if (cnt < 2) || (family == 2) { + return cnt + } + for i = 0; i < cnt; i++ { + if (*address)(unsafe.Pointer(buf+uintptr(i)*28)).family != 2 { + break + } + } + if i == cnt { + return cnt + } + var cs int32 + _ = cs + //TODO pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs); + + // The following implements a subset of RFC 3484/6724 destination + // address selection by generating a single 31-bit sort key for + // each address. Rules 3, 4, and 7 are omitted for having + // excessive runtime and code size cost and dubious benefit. + // So far the label/precedence table cannot be customized. + for i = 0; i < cnt; i++ { + var family int32 = (*address)(unsafe.Pointer(buf + uintptr(i)*28)).family + var key int32 = 0 + *(*sockaddr_in6)(unsafe.Pointer(bp + 28 /* sa6 */)) = sockaddr_in6{} + *(*sockaddr_in6)(unsafe.Pointer(bp /* da6 */)) = sockaddr_in6{sin6_family: sa_family_t(10), sin6_port: in_port_t(65535), sin6_scope_id: (*address)(unsafe.Pointer(buf + uintptr(i)*28)).scopeid} + *(*sockaddr_in)(unsafe.Pointer(bp + 72 /* sa4 */)) = sockaddr_in{} + *(*sockaddr_in)(unsafe.Pointer(bp + 56 /* da4 */)) = sockaddr_in{sin_family: sa_family_t(2), sin_port: in_port_t(65535)} + var sa1 uintptr + var da uintptr + // var salen socklen_t at bp+88, 4 + + var dalen socklen_t + if family == 10 { + Xmemcpy(tls, bp /* &da6 */ +8 /* &.sin6_addr */ /* &.__in6_union */ /* &.__s6_addr */, buf+uintptr(i)*28+8 /* &.addr */, uint64(16)) + da = bp /* &da6 */ + dalen = socklen_t(unsafe.Sizeof(sockaddr_in6{})) + sa1 = bp + 28 /* &sa6 */ + *(*socklen_t)(unsafe.Pointer(bp + 88 /* salen */)) = socklen_t(unsafe.Sizeof(sockaddr_in6{})) + } else { + Xmemcpy(tls, bp+28 /* &sa6 */ +8, /* &.sin6_addr */ /* &.__in6_union */ /* &.__s6_addr */ + ts+129 /* "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff" */, uint64(12)) + Xmemcpy(tls, ((bp /* &da6 */ + 8 /* &.sin6_addr */ /* &.__in6_union */ /* &.__s6_addr */) + uintptr(12)), buf+uintptr(i)*28+8 /* &.addr */, uint64(4)) + Xmemcpy(tls, bp /* &da6 */ +8, /* &.sin6_addr */ /* &.__in6_union */ /* &.__s6_addr */ + ts+129 /* "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff" */, uint64(12)) + Xmemcpy(tls, ((bp /* &da6 */ + 8 /* &.sin6_addr */ /* &.__in6_union */ /* &.__s6_addr */) + uintptr(12)), buf+uintptr(i)*28+8 /* &.addr */, uint64(4)) + Xmemcpy(tls, (bp + 56 /* &da4 */ + 4 /* &.sin_addr */), buf+uintptr(i)*28+8 /* &.addr */, uint64(4)) + da = bp + 56 /* &da4 */ + dalen = socklen_t(unsafe.Sizeof(sockaddr_in{})) + sa1 = bp + 72 /* &sa4 */ + *(*socklen_t)(unsafe.Pointer(bp + 88 /* salen */)) = socklen_t(unsafe.Sizeof(sockaddr_in{})) + } + var dpolicy uintptr = policyof(tls, (bp /* &da6 */ + 8 /* &.sin6_addr */)) + var dscope int32 = scopeof(tls, (bp /* &da6 */ + 8 /* &.sin6_addr */)) + var dlabel int32 = int32((*policy)(unsafe.Pointer(dpolicy)).label) + var dprec int32 = int32((*policy)(unsafe.Pointer(dpolicy)).prec) + var prefixlen int32 = 0 + var fd int32 = Xsocket(tls, family, (2 | 02000000), 17) + if fd >= 0 { + if !(Xconnect(tls, fd, da, dalen) != 0) { + key = key | (0x40000000) + if !(Xgetsockname(tls, fd, sa1, bp+88 /* &salen */) != 0) { + if family == 2 { + Xmemcpy(tls, + ((bp + 28 /* &sa6 */ + 8 /* &.sin6_addr */ /* &.__in6_union */ /* &.__s6_addr */) + uintptr(12)), + (bp + 72 /* &sa4 */ + 4 /* &.sin_addr */), uint64(4)) + } + if dscope == scopeof(tls, (bp+28 /* &sa6 */ +8 /* &.sin6_addr */)) { + key = key | (0x20000000) + } + if dlabel == labelof(tls, (bp+28 /* &sa6 */ +8 /* &.sin6_addr */)) { + key = key | (0x10000000) + } + prefixlen = prefixmatch(tls, (bp + 28 /* &sa6 */ + 8 /* &.sin6_addr */), + (bp /* &da6 */ + 8 /* &.sin6_addr */)) + } + } + Xclose(tls, fd) + } + key = key | (dprec << 20) + key = key | ((15 - dscope) << 16) + key = key | (prefixlen << 8) + key = key | ((48 - i) << 0) + (*address)(unsafe.Pointer(buf + uintptr(i)*28)).sortkey = key + } + Xqsort(tls, buf, uint64(cnt), uint64(unsafe.Sizeof(address{})), *(*uintptr)(unsafe.Pointer(&struct { + f func(*TLS, uintptr, uintptr) int32 + }{addrcmp}))) + + //TODO pthread_setcancelstate(cs, 0); + + return cnt +} + +func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype int32, flags int32) int32 { /* lookup_serv.c:12:5: */ + bp := tls.Alloc(8) + defer tls.Free(8) + + var line [128]int8 + _ = line + var cnt int32 = 0 + var p uintptr + _ = p + *(*uintptr)(unsafe.Pointer(bp /* z */)) = ts + 54 /* "" */ + var port uint64 = uint64(0) + + switch socktype { + case 1: + switch proto { + case 0: + proto = 6 + fallthrough + case 6: + break + default: + return -8 + } + break + case 2: + switch proto { + case 0: + proto = 17 + fallthrough + case 17: + break + default: + return -8 + } + fallthrough + case 0: + break + default: + if name != 0 { + return -8 + } + (*service)(unsafe.Pointer(buf)).port = uint16_t(0) + (*service)(unsafe.Pointer(buf)).proto = uint8(proto) + (*service)(unsafe.Pointer(buf)).socktype = uint8(socktype) + return 1 + } + + if name != 0 { + if !(int32(*(*int8)(unsafe.Pointer(name))) != 0) { + return -8 + } + port = Xstrtoul(tls, name, bp /* &z */, 10) + } + if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* z */))))) != 0) { + if port > uint64(65535) { + return -8 + } + if proto != 17 { + (*service)(unsafe.Pointer(buf + uintptr(cnt)*4)).port = uint16_t(port) + (*service)(unsafe.Pointer(buf + uintptr(cnt)*4)).socktype = uint8(1) + (*service)(unsafe.Pointer(buf + uintptr(PostIncInt32(&cnt, 1))*4)).proto = uint8(6) + } + if proto != 6 { + (*service)(unsafe.Pointer(buf + uintptr(cnt)*4)).port = uint16_t(port) + (*service)(unsafe.Pointer(buf + uintptr(cnt)*4)).socktype = uint8(2) + (*service)(unsafe.Pointer(buf + uintptr(PostIncInt32(&cnt, 1))*4)).proto = uint8(17) + } + return cnt + } + + if (flags & 0x400) != 0 { + return -2 + } + + var l size_t = Xstrlen(tls, name) + _ = l + + Xabort(tls) //TODO- + // unsigned char _buf[1032]; + // FILE _f, *f = __fopen_rb_ca("/etc/services", &_f, _buf, sizeof _buf); + // if (!f) switch (errno) { + // case ENOENT: + // case ENOTDIR: + // case EACCES: + // return EAI_SERVICE; + // default: + // return EAI_SYSTEM; + // } + + Xabort(tls) //TODO- + // while (fgets(line, sizeof line, f) && cnt < MAXSERVS) { + // if ((p=strchr(line, '#'))) *p++='\n', *p=0; + + // /* Find service name */ + // for(p=line; (p=strstr(p, name)); p++) { + // if (p>line && !isspace(p[-1])) continue; + // if (p[l] && !isspace(p[l])) continue; + // break; + // } + // if (!p) continue; + + // /* Skip past canonical name at beginning of line */ + // for (p=line; *p && !isspace(*p); p++); + + // port = strtoul(p, &z, 10); + // if (port > 65535 || z==p) continue; + // if (!strncmp(z, "/udp", 4)) { + // if (proto == IPPROTO_TCP) continue; + // buf[cnt].port = port; + // buf[cnt].socktype = SOCK_DGRAM; + // buf[cnt++].proto = IPPROTO_UDP; + // } + // if (!strncmp(z, "/tcp", 4)) { + // if (proto == IPPROTO_UDP) continue; + // buf[cnt].port = port; + // buf[cnt].socktype = SOCK_STREAM; + // buf[cnt++].proto = IPPROTO_TCP; + // } + // } + // __fclose_ca(f); + // return cnt > 0 ? cnt : EAI_SERVICE; + Xabort(tls) + return int32(0) //TODO- +} + +func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ + *(*int32)(unsafe.Pointer(f + 136 /* &.mode */)) |= ((*FILE)(unsafe.Pointer(f)).mode - 1) + if (*FILE)(unsafe.Pointer(f)).wpos != (*FILE)(unsafe.Pointer(f)).wbase { + (*(*func(*TLS, uintptr, uintptr, size_t) size_t)(unsafe.Pointer((f + 72 /* &.write */))))(tls, f, uintptr(0), uint64(0)) + } + (*FILE)(unsafe.Pointer(f)).wpos = AssignPtrUintptr(f+56 /* &.wbase */, AssignPtrUintptr(f+32 /* &.wend */, uintptr(0))) + if ((*FILE)(unsafe.Pointer(f)).flags & uint32(4)) != 0 { + *(*uint32)(unsafe.Pointer(f /* &.flags */)) |= (uint32(32)) + return -1 + } + (*FILE)(unsafe.Pointer(f)).rpos = AssignPtrUintptr(f+16 /* &.rend */, ((*FILE)(unsafe.Pointer(f)).buf + uintptr((*FILE)(unsafe.Pointer(f)).buf_size))) + if ((*FILE)(unsafe.Pointer(f)).flags & uint32(16)) != 0 { + return -1 + } + return 0 +} + +func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ + X__builtin_abort(tls) //TODO- + // __stdio_exit_needed(); +} + +// This function assumes it will never be called if there is already +// data buffered for reading. + +func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ + bp := tls.Alloc(1) + defer tls.Free(1) + + // var c uint8 at bp, 1 + + if !(X__toread(tls, f) != 0) && ((*(*func(*TLS, uintptr, uintptr, size_t) size_t)(unsafe.Pointer((f + 64 /* &.read */))))(tls, f, bp /* &c */, uint64(1)) == uint64(1)) { + return int32(*(*uint8)(unsafe.Pointer(bp /* c */))) + } + return -1 +} + +func strtox(tls *TLS, s uintptr, p uintptr, prec int32) float64 { /* strtod.c:6:20: */ + bp := tls.Alloc(232) + defer tls.Free(232) + + // var f FILE at bp, 232 + + (*FILE)(unsafe.Pointer(bp /* &f */)).buf = AssignPtrUintptr(bp /* &f */ +8 /* &.rpos */, s) + (*FILE)(unsafe.Pointer(bp /* &f */)).rend = UintptrFromInt32(-1) + X__shlim(tls, bp /* &f */, int64(0)) + var y float64 = X__floatscan(tls, bp /* &f */, prec, 1) + var cnt off_t = ((*FILE)(unsafe.Pointer((bp /* &f */))).shcnt + ((int64((*FILE)(unsafe.Pointer((bp /* &f */))).rpos) - int64((*FILE)(unsafe.Pointer((bp /* &f */))).buf)) / 1)) + if p != 0 { + *(*uintptr)(unsafe.Pointer(p)) = func() uintptr { + if cnt != 0 { + return (s + uintptr(cnt)) + } + return s + }() + } + return y +} + +func Xstrtof(tls *TLS, s uintptr, p uintptr) float32 { /* strtod.c:17:7: */ + return float32(strtox(tls, s, p, 0)) +} + +func Xstrtod(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:22:8: */ + return strtox(tls, s, p, 1) +} + +func Xstrtold(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:27:13: */ + return strtox(tls, s, p, 2) +} + +func strtox1(tls *TLS, s uintptr, p uintptr, base int32, lim uint64) uint64 { /* strtol.c:8:27: */ + bp := tls.Alloc(232) + defer tls.Free(232) + + // var f FILE at bp, 232 + + (*FILE)(unsafe.Pointer(bp /* &f */)).buf = AssignPtrUintptr(bp /* &f */ +8 /* &.rpos */, s) + (*FILE)(unsafe.Pointer(bp /* &f */)).rend = UintptrFromInt32(-1) + X__shlim(tls, bp /* &f */, int64(0)) + var y uint64 = X__intscan(tls, bp /* &f */, uint32(base), 1, lim) + if p != 0 { + var cnt size_t = (size_t((*FILE)(unsafe.Pointer((bp /* &f */))).shcnt + ((int64((*FILE)(unsafe.Pointer((bp /* &f */))).rpos) - int64((*FILE)(unsafe.Pointer((bp /* &f */))).buf)) / 1))) + *(*uintptr)(unsafe.Pointer(p)) = (s + uintptr(cnt)) + } + return y +} + +func Xstrtoull(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:21:20: */ + return strtox1(tls, s, p, base, ((2 * uint64(0x7fffffffffffffff)) + uint64(1))) +} + +func Xstrtoll(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:26:11: */ + return int64(strtox1(tls, s, p, base, (Uint64FromInt64(-0x7fffffffffffffff - int64(1))))) +} + +func Xstrtoul(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:31:15: */ + return uint64(strtox1(tls, s, p, base, ((2 * uint64(0x7fffffffffffffff)) + uint64(1)))) +} + +func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:36:6: */ + return int64(strtox1(tls, s, p, base, (0 + (Uint64FromInt64(Int64(-Int64(0x7fffffffffffffff)) - Int64FromInt32(1)))))) +} + +func Xstrtoimax(tls *TLS, s uintptr, p uintptr, base int32) intmax_t { /* strtol.c:41:10: */ + return intmax_t(Xstrtoll(tls, s, p, base)) +} + +func Xstrtoumax(tls *TLS, s uintptr, p uintptr, base int32) uintmax_t { /* strtol.c:46:11: */ + return uintmax_t(Xstrtoull(tls, s, p, base)) +} + +func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ + var l size_t = Xstrlen(tls, s) + var d uintptr = Xmalloc(tls, (l + uint64(1))) + if !(d != 0) { + return uintptr(0) + } + return Xmemcpy(tls, d, s, (l + uint64(1))) +} + +func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ + var p uintptr = Xmemchr(tls, s, 0, n) + if p != 0 { + return (uint64((int64(p) - int64(s)) / 1)) + } + return n +} + +func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ + bp := tls.Alloc(32) + defer tls.Free(32) + + var a uintptr = s + *(*[4]size_t)(unsafe.Pointer(bp /* byteset */)) = [4]size_t{0: uint64(0)} + + if !(int32(*(*int8)(unsafe.Pointer(c))) != 0) { + return uint64(0) + } + if !(int32(*(*int8)(unsafe.Pointer(c + 1))) != 0) { + for ; int32(*(*int8)(unsafe.Pointer(s))) == int32(*(*int8)(unsafe.Pointer(c))); s++ { + } + return (size_t((int64(s) - int64(a)) / 1)) + } + + for ; (*(*int8)(unsafe.Pointer(c)) != 0) && (AssignOrPtrUint64(bp /* &byteset */ +uintptr(((size_t(*(*uint8)(unsafe.Pointer(c))))/(uint64(8)*uint64(unsafe.Sizeof(size_t(0))))))*8, (size_t(uint64(1))<<((size_t(*(*uint8)(unsafe.Pointer(c))))%(uint64(8)*uint64(unsafe.Sizeof(size_t(0))))))) != 0); c++ { + } + for ; (*(*int8)(unsafe.Pointer(s)) != 0) && ((*(*size_t)(unsafe.Pointer(bp /* &byteset[0] */ + uintptr(((size_t(*(*uint8)(unsafe.Pointer(s))))/(uint64(8)*uint64(unsafe.Sizeof(size_t(0))))))*8)) & (size_t(uint64(1)) << ((size_t(*(*uint8)(unsafe.Pointer(s)))) % (uint64(8) * uint64(unsafe.Sizeof(size_t(0))))))) != 0); s++ { + } + return (size_t((int64(s) - int64(a)) / 1)) +} + +func init() { + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&X_CurrentRuneLocale)) + 0)) = uintptr(unsafe.Pointer(&X_DefaultRuneLocale)) // table.cpp.c:4092:41: +} + +var ts1 = "RuneMagi\x00NONE\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00infinity\x00nan\x00\x00\x00\x01\x02\x04\a\x03\x06\x05\x00%d.%d.%d.%d.in-addr.arpa\x00ip6.arpa\x000123456789abcdef\x00/etc/hosts\x00rb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00%d.%d.%d.%d\x00%x:%x:%x:%x:%x:%x:%x:%x\x00%x:%x:%x:%x:%x:%x:%d.%d.%d.%d\x00:0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\x00\x00\x00 \x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" +var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data diff --git a/vendor/modernc.org/libc/musl_linux_arm.go b/vendor/modernc.org/libc/musl_linux_arm.go index dfd805a9b..e73f2ca39 100644 --- a/vendor/modernc.org/libc/musl_linux_arm.go +++ b/vendor/modernc.org/libc/musl_linux_arm.go @@ -1,4 +1,4 @@ -// Code generated by 'ccgo -export-externs X -hide __syscall0,__syscall1,__syscall2,__syscall3,__syscall4,__syscall5,__syscall6 -nostdinc -nostdlib -o ../musl_linux_arm.go -pkgname libc -static-locals-prefix _s -Iarch/arm -Iarch/generic -Iobj/src/internal -Isrc/include -Isrc/internal -Iobj/include -Iinclude copyright.c src/ctype/isalnum.c src/ctype/isalpha.c src/ctype/isdigit.c src/ctype/islower.c src/ctype/isprint.c src/ctype/isupper.c src/ctype/isxdigit.c src/dirent/closedir.c src/dirent/opendir.c src/dirent/readdir.c src/internal/floatscan.c src/internal/intscan.c src/internal/shgetc.c src/math/__fpclassify.c src/math/__fpclassifyf.c src/math/__fpclassifyl.c src/math/copysignl.c src/math/fabsl.c src/math/fmodl.c src/math/nanf.c src/math/scalbn.c src/math/scalbnl.c src/network/freeaddrinfo.c src/network/getaddrinfo.c src/network/gethostbyaddr.c src/network/gethostbyaddr_r.c src/network/gethostbyname.c src/network/gethostbyname2.c src/network/gethostbyname2_r.c src/network/getnameinfo.c src/network/h_errno.c src/network/inet_aton.c src/network/inet_ntop.c src/network/inet_pton.c src/network/lookup_ipliteral.c src/network/lookup_name.c src/network/lookup_serv.c src/prng/rand_r.c src/stdio/__toread.c src/stdio/__uflow.c src/stdlib/strtod.c src/stdlib/strtol.c src/string/strdup.c src/string/strlcat.c src/string/strlcpy.c src/string/strncasecmp.c src/string/strncat.c src/string/strnlen.c src/string/strspn.c src/string/strtok.c', DO NOT EDIT. +// Code generated by 'ccgo -export-externs X -hide __syscall0,__syscall1,__syscall2,__syscall3,__syscall4,__syscall5,__syscall6 -nostdinc -nostdlib -o ../musl_linux_arm.go -pkgname libc -static-locals-prefix _s -Iarch/arm -Iarch/generic -Iobj/src/internal -Isrc/include -Isrc/internal -Iobj/include -Iinclude copyright.c src/ctype/isalnum.c src/ctype/isalpha.c src/ctype/isdigit.c src/ctype/islower.c src/ctype/isprint.c src/ctype/isupper.c src/ctype/isxdigit.c src/dirent/closedir.c src/dirent/opendir.c src/dirent/readdir.c src/internal/floatscan.c src/internal/intscan.c src/internal/shgetc.c src/math/__fpclassify.c src/math/__fpclassifyf.c src/math/__fpclassifyl.c src/math/copysignl.c src/math/fabsl.c src/math/fmodl.c src/math/nanf.c src/math/scalbn.c src/math/scalbnl.c src/multibyte/internal.c src/multibyte/mbrtowc.c src/multibyte/mbsinit.c src/network/freeaddrinfo.c src/network/getaddrinfo.c src/network/gethostbyaddr.c src/network/gethostbyaddr_r.c src/network/gethostbyname.c src/network/gethostbyname2.c src/network/gethostbyname2_r.c src/network/gethostbyname_r.c src/network/getnameinfo.c src/network/h_errno.c src/network/inet_aton.c src/network/inet_ntop.c src/network/inet_pton.c src/network/lookup_ipliteral.c src/network/lookup_name.c src/network/lookup_serv.c src/prng/rand_r.c src/stdio/__lockfile.c src/stdio/__toread.c src/stdio/__uflow.c src/stdio/sscanf.c src/stdio/vfscanf.c src/stdio/vsscanf.c src/stdlib/strtod.c src/stdlib/strtol.c src/string/strdup.c src/string/strlcat.c src/string/strlcpy.c src/string/strncasecmp.c src/string/strncat.c src/string/strnlen.c src/string/strspn.c src/string/strtok.c src/thread/pthread_attr_get.c src/thread/pthread_attr_setdetachstate.c src/thread/pthread_mutex_lock.c src/thread/pthread_mutexattr_destroy.c src/thread/pthread_mutexattr_init.c src/thread/pthread_mutexattr_settype.c', DO NOT EDIT. package libc @@ -351,6 +351,12 @@ const ( /* nameser.h:98:1: */ ns_r_badtime = 18 ) +const ( /* pthread_impl.h:58:1: */ + DT_EXITING = 0 + DT_JOINABLE = 1 + DT_DETACHED = 2 +) + type ptrdiff_t = int32 /* <builtin>:3:26 */ type size_t = uint32 /* <builtin>:9:23 */ @@ -361,6 +367,8 @@ func __isspace(tls *TLS, _c int32) int32 { /* ctype.h:26:21: */ return (Bool32((_c == ' ') || ((uint32(_c) - uint32('\t')) < uint32(5)))) } +type __locale_struct = struct{ cat [6]uintptr } /* alltypes.h:336:9 */ + type locale_t = uintptr /* alltypes.h:336:32 */ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ @@ -675,6 +683,44 @@ func __DOUBLE_BITS(tls *TLS, __f float64) uint64 { /* math.h:61:36: */ return *(*uint64)(unsafe.Pointer(bp /* &__u */)) } +type __pthread = struct { + self uintptr + dtv uintptr + prev uintptr + next uintptr + sysinfo uintptr_t + canary uintptr_t + canary2 uintptr_t + tid int32 + errno_val int32 + detach_state int32 + cancel int32 + canceldisable uint8 + cancelasync uint8 + tsd_used uint8 /* unsigned char tsd_used: 1, unsigned char dlerror_flag: 1 */ + _ [1]byte + map_base uintptr + map_size size_t + stack uintptr + stack_size size_t + guard_size size_t + result uintptr + cancelbuf uintptr + tsd uintptr + robust_list struct { + head uintptr + off int32 + pending uintptr + } + timer_id int32 + locale locale_t + killlock [1]int32 + dlerror_buf uintptr + stdio_locks uintptr + canary_at_end uintptr_t + dtv_copy uintptr +} /* alltypes.h:266:9 */ + func scanexp(tls *TLS, f uintptr, pok int32) int64 { /* floatscan.c:37:18: */ var c int32 var x int32 @@ -1891,6 +1937,1509 @@ func Xscalbnl(tls *TLS, x float64, n int32) float64 { /* scalbnl.c:4:13: */ return Xscalbn(tls, x, n) } +// Upper 6 state bits are a negative integer offset to bound-check next byte +// equivalent to: ( (b-0x80) | (b+offset) ) & ~0x3f + +// Interval [a,b). Either a must be 80 or b must be c0, lower 3 bits clear. + +// Arbitrary encoding for representing code units instead of characters. + +// Get inline definition of MB_CUR_MAX. + +type lconv = struct { + decimal_point uintptr + thousands_sep uintptr + grouping uintptr + int_curr_symbol uintptr + currency_symbol uintptr + mon_decimal_point uintptr + mon_thousands_sep uintptr + mon_grouping uintptr + positive_sign uintptr + negative_sign uintptr + int_frac_digits int8 + frac_digits int8 + p_cs_precedes int8 + p_sep_by_space int8 + n_cs_precedes int8 + n_sep_by_space int8 + p_sign_posn int8 + n_sign_posn int8 + int_p_cs_precedes int8 + int_p_sep_by_space int8 + int_n_cs_precedes int8 + int_n_sep_by_space int8 + int_p_sign_posn int8 + int_n_sign_posn int8 + _ [2]byte +} /* locale.h:24:1 */ + +// Support signed or unsigned plain-char + +// Implementation choices... + +// Arbitrary numbers... + +// POSIX/SUS requirements follow. These numbers come directly +// from SUS and have nothing to do with the host system. + +type __locale_map = struct { + __map uintptr + map_size size_t + name [24]int8 + next uintptr +} /* alltypes.h:336:9 */ + +type tls_module = struct { + next uintptr + image uintptr + len size_t + size size_t + align size_t + offset size_t +} /* libc.h:14:1 */ + +type __libc = struct { + can_do_threads int8 + threaded int8 + secure int8 + need_locks int8 + threads_minus_1 int32 + auxv uintptr + tls_head uintptr + tls_size size_t + tls_align size_t + tls_cnt size_t + page_size size_t + global_locale struct{ cat [6]uintptr } +} /* libc.h:20:1 */ + +type time_t = int64 /* alltypes.h:78:16 */ + +type clockid_t = int32 /* alltypes.h:207:13 */ + +type timespec = struct { + tv_sec time_t + tv_nsec int32 + __12 uint32 /* int : 32 */ +} /* alltypes.h:222:1 */ + +type pthread_t = uintptr /* alltypes.h:266:26 */ + +type pthread_once_t = int32 /* alltypes.h:272:13 */ + +type pthread_key_t = uint32 /* alltypes.h:277:18 */ + +type pthread_spinlock_t = int32 /* alltypes.h:282:13 */ + +type pthread_mutexattr_t = struct{ __attr uint32 } /* alltypes.h:287:37 */ + +type pthread_condattr_t = struct{ __attr uint32 } /* alltypes.h:292:37 */ + +type pthread_barrierattr_t = struct{ __attr uint32 } /* alltypes.h:297:37 */ + +type pthread_rwlockattr_t = struct{ __attr [2]uint32 } /* alltypes.h:302:40 */ + +type __sigset_t = struct{ __bits [32]uint32 } /* alltypes.h:342:9 */ + +type sigset_t = __sigset_t /* alltypes.h:342:71 */ + +type pthread_attr_t = struct{ __u struct{ __i [9]int32 } } /* alltypes.h:365:147 */ + +type pthread_mutex_t = struct{ __u struct{ __i [6]int32 } } /* alltypes.h:370:157 */ + +type pthread_cond_t = struct{ __u struct{ __i [12]int32 } } /* alltypes.h:380:112 */ + +type pthread_rwlock_t = struct{ __u struct{ __i [8]int32 } } /* alltypes.h:390:139 */ + +type pthread_barrier_t = struct{ __u struct{ __i [5]int32 } } /* alltypes.h:395:137 */ + +type sched_param = struct { + sched_priority int32 + __reserved1 int32 + __reserved2 [4]int32 + __reserved3 int32 +} /* sched.h:19:1 */ + +type timer_t = uintptr /* alltypes.h:202:14 */ + +type clock_t = int32 /* alltypes.h:212:14 */ + +type tm = struct { + tm_sec int32 + tm_min int32 + tm_hour int32 + tm_mday int32 + tm_mon int32 + tm_year int32 + tm_wday int32 + tm_yday int32 + tm_isdst int32 + tm_gmtoff int32 + tm_zone uintptr +} /* time.h:38:1 */ + +type itimerspec = struct { + it_interval struct { + tv_sec time_t + tv_nsec int32 + __12 uint32 /* int : 32 */ + } + it_value struct { + tv_sec time_t + tv_nsec int32 + __12 uint32 /* int : 32 */ + } +} /* time.h:80:1 */ + +type sigevent = struct { + sigev_value struct{ sival_int int32 } + sigev_signo int32 + sigev_notify int32 + sigev_notify_function uintptr + sigev_notify_attributes uintptr + __pad [44]int8 +} /* time.h:107:1 */ + +type __ptcb = struct { + __f uintptr + __x uintptr + __next uintptr +} /* alltypes.h:266:9 */ + +type sigaltstack = struct { + ss_sp uintptr + ss_flags int32 + ss_size size_t +} /* signal.h:44:9 */ + +type stack_t = sigaltstack /* signal.h:44:28 */ + +type greg_t = int32 /* signal.h:10:13 */ +type gregset_t = [18]int32 /* signal.h:10:21 */ +type sigcontext = struct { + trap_no uint32 + error_code uint32 + oldmask uint32 + arm_r0 uint32 + arm_r1 uint32 + arm_r2 uint32 + arm_r3 uint32 + arm_r4 uint32 + arm_r5 uint32 + arm_r6 uint32 + arm_r7 uint32 + arm_r8 uint32 + arm_r9 uint32 + arm_r10 uint32 + arm_fp uint32 + arm_ip uint32 + arm_sp uint32 + arm_lr uint32 + arm_pc uint32 + arm_cpsr uint32 + fault_address uint32 +} /* signal.h:11:9 */ + +type mcontext_t = sigcontext /* signal.h:18:3 */ + +type __ucontext = struct { + uc_flags uint32 + uc_link uintptr + uc_stack stack_t + uc_mcontext mcontext_t + uc_sigmask sigset_t + uc_regspace [64]uint64 +} /* signal.h:31:9 */ + +type ucontext_t = __ucontext /* signal.h:38:3 */ + +type sigval = struct{ sival_int int32 } /* time.h:107:1 */ + +type siginfo_t = struct { + si_signo int32 + si_errno int32 + si_code int32 + __si_fields struct { + _ [0]uint32 + __pad [116]int8 + } +} /* signal.h:145:3 */ + +type sigaction = struct { + __sa_handler struct{ sa_handler uintptr } + sa_mask sigset_t + sa_flags int32 + sa_restorer uintptr +} /* signal.h:167:1 */ + +type sig_t = uintptr /* signal.h:251:14 */ + +type sig_atomic_t = int32 /* signal.h:269:13 */ + +func a_cas(tls *TLS, p uintptr, t int32, s int32) int32 { /* atomic_arch.h:46:19: */ + panic(`arch/arm/atomic_arch.h:48:2: assembler statements not supported`) + return int32(0) + //TODO for (;;) { + //TODO register int r0 __asm__("r0") = t; + //TODO register int r1 __asm__("r1") = s; + //TODO register volatile int *r2 __asm__("r2") = p; + //TODO register uintptr_t r3 __asm__("r3") = __a_cas_ptr; + //TODO int old; + //TODO __asm__ __volatile__ ( + //TODO BLX " r3" + //TODO : "+r"(r0), "+r"(r3) : "r"(r1), "r"(r2) + //TODO : "memory", "lr", "ip", "cc" ); + //TODO if (!r0) return t; + //TODO if ((old=*p)!=t) return old; + //TODO } +} + +func a_barrier(tls *TLS) { /* atomic_arch.h:68:20: */ + panic(`arch/arm/atomic_arch.h:70:2: assembler statements not supported`) + //TODO register uintptr_t ip __asm__("ip") = __a_barrier_ptr; + //TODO __asm__ __volatile__( BLX " ip" : "+r"(ip) : : "memory", "cc", "lr" ); +} + +func a_clz_32(tls *TLS, x uint32_t) int32 { /* atomic_arch.h:91:19: */ + panic(`arch/arm/atomic_arch.h:93:2: assembler statements not supported`) + return int32(x) +} + +func a_swap(tls *TLS, p uintptr, v int32) int32 { /* atomic.h:108:19: */ + var old int32 + for ok := true; ok; ok = (a_cas(tls, AtomicLoadUintptr(&p), old, v) != old) { + old = *(*int32)(unsafe.Pointer(AtomicLoadUintptr(&p))) + } + return old +} + +func a_fetch_add(tls *TLS, p uintptr, v int32) int32 { /* atomic.h:119:19: */ + var old int32 + for ok := true; ok; ok = (a_cas(tls, AtomicLoadUintptr(&p), old, (int32(uint32(old)+uint32(v)))) != old) { + old = *(*int32)(unsafe.Pointer(AtomicLoadUintptr(&p))) + } + return old +} + +func a_fetch_and(tls *TLS, p uintptr, v int32) int32 { /* atomic.h:130:19: */ + var old int32 + for ok := true; ok; ok = (a_cas(tls, AtomicLoadUintptr(&p), old, (old&v)) != old) { + old = *(*int32)(unsafe.Pointer(AtomicLoadUintptr(&p))) + } + return old +} + +func a_fetch_or(tls *TLS, p uintptr, v int32) int32 { /* atomic.h:140:19: */ + var old int32 + for ok := true; ok; ok = (a_cas(tls, AtomicLoadUintptr(&p), old, (old|v)) != old) { + old = *(*int32)(unsafe.Pointer(AtomicLoadUintptr(&p))) + } + return old +} + +func a_and(tls *TLS, p uintptr, v int32) { /* atomic.h:151:20: */ + a_fetch_and(tls, AtomicLoadUintptr(&p), v) +} + +func a_or(tls *TLS, p uintptr, v int32) { /* atomic.h:159:20: */ + a_fetch_or(tls, AtomicLoadUintptr(&p), v) +} + +func a_or_64(tls *TLS, p uintptr, v uint64_t) { /* atomic.h:220:20: */ + bp := tls.Alloc(8) + defer tls.Free(8) + + *(*struct{ v uint64_t })(unsafe.Pointer(bp /* u */)) = struct{ v uint64_t }{v: v} + if *(*uint32_t)(unsafe.Pointer((bp /* &u */ /* &.r */))) != 0 { + a_or(tls, AtomicLoadUintptr(&p), int32(*(*uint32_t)(unsafe.Pointer((bp /* &u */ /* &.r */))))) + } + if *(*uint32_t)(unsafe.Pointer((bp /* &u */ /* &.r */) + 1*4)) != 0 { + a_or(tls, (AtomicLoadUintptr(&p) + uintptr(1)*4), int32(*(*uint32_t)(unsafe.Pointer((bp /* &u */ /* &.r */) + 1*4)))) + } +} + +type a_cas_p_undefined_but_pointer_not_32bit = [1]int8 /* atomic.h:229:14 */ + +func a_ctz_32(tls *TLS, x uint32_t) int32 { /* atomic.h:256:19: */ + return (31 - a_clz_32(tls, (x&-x))) +} + +func a_ctz_64(tls *TLS, x uint64_t) int32 { /* atomic.h:272:19: */ + if uint32(unsafe.Sizeof(int32(0))) < uint32(8) { + var y uint32_t = uint32_t(x) + if !(y != 0) { + y = (uint32_t(x >> 32)) + return (32 + a_ctz_32(tls, y)) + } + return a_ctz_32(tls, y) + } + return int32(_sdebruijn648[(((x & -x) * 0x022fdd63cc95386d) >> 58)]) +} + +var _sdebruijn648 = [64]int8{ + int8(0), int8(1), int8(2), int8(53), int8(3), int8(7), int8(54), int8(27), int8(4), int8(38), int8(41), int8(8), int8(34), int8(55), int8(48), int8(28), + int8(62), int8(5), int8(39), int8(46), int8(44), int8(42), int8(22), int8(9), int8(24), int8(35), int8(59), int8(56), int8(49), int8(18), int8(29), int8(11), + int8(63), int8(52), int8(6), int8(26), int8(37), int8(40), int8(33), int8(47), int8(61), int8(45), int8(43), int8(21), int8(23), int8(58), int8(17), int8(10), + int8(51), int8(25), int8(36), int8(32), int8(60), int8(20), int8(57), int8(16), int8(50), int8(31), int8(19), int8(15), int8(30), int8(14), int8(13), int8(12), +} /* atomic.h:274:20 */ + +type __timer = struct { + timerid int32 + thread pthread_t +} /* pthread_impl.h:64:1 */ + +func __pthread_self(tls *TLS) pthread_t { /* pthread_arch.h:19:25: */ + var p uintptr_t + panic(`arch/arm/pthread_arch.h:23:2: assembler statements not supported`) + return (uintptr(p - uintptr_t(unsafe.Sizeof(__pthread{})))) +} + +func __wake(tls *TLS, addr uintptr, cnt int32, priv int32) { /* pthread_impl.h:155:20: */ + if priv != 0 { + priv = 128 + } + if cnt < 0 { + cnt = 0x7fffffff + } + _ = (Bool32((X__syscall3(tls, 240, int32(AtomicLoadUintptr(&addr)), (int32(1|priv)), int32(cnt)) != -38) || (X__syscall3(tls, 240, int32(AtomicLoadUintptr(&addr)), 1, int32(cnt)) != 0))) +} + +func __futexwait(tls *TLS, addr uintptr, val int32, priv int32) { /* pthread_impl.h:162:20: */ + if priv != 0 { + priv = 128 + } + _ = (Bool32((X__syscall4(tls, 240, int32(AtomicLoadUintptr(&addr)), (int32(0|priv)), int32(val), 0) != -38) || (X__syscall4(tls, 240, int32(AtomicLoadUintptr(&addr)), 0, int32(val), 0) != 0))) +} + +var X__fsmu8 = [51]uint32_t{ + func() uint32 { + if 0x2 < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | uint32_t(0x2)) + }(), func() uint32 { + if 0x3 < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | uint32_t(0x3)) + }(), func() uint32 { + if 0x4 < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | uint32_t(0x4)) + }(), func() uint32 { + if 0x5 < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | uint32_t(0x5)) + }(), func() uint32 { + if 0x6 < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | uint32_t(0x6)) + }(), func() uint32 { + if 0x7 < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | uint32_t(0x7)) + }(), + func() uint32 { + if 0x8 < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | uint32_t(0x8)) + }(), func() uint32 { + if 0x9 < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | uint32_t(0x9)) + }(), func() uint32 { + if 0xa < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | uint32_t(0xa)) + }(), func() uint32 { + if 0xb < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | uint32_t(0xb)) + }(), func() uint32 { + if 0xc < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | uint32_t(0xc)) + }(), func() uint32 { + if 0xd < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | uint32_t(0xd)) + }(), func() uint32 { + if 0xe < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | uint32_t(0xe)) + }(), func() uint32 { + if 0xf < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | uint32_t(0xf)) + }(), + func() uint32 { + if (0x0 + 16) < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | (uint32_t(0x0 + 16))) + }(), func() uint32 { + if (0x1 + 16) < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | (uint32_t(0x1 + 16))) + }(), func() uint32 { + if (0x2 + 16) < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | (uint32_t(0x2 + 16))) + }(), func() uint32 { + if (0x3 + 16) < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | (uint32_t(0x3 + 16))) + }(), func() uint32 { + if (0x4 + 16) < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | (uint32_t(0x4 + 16))) + }(), func() uint32 { + if (0x5 + 16) < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | (uint32_t(0x5 + 16))) + }(), func() uint32 { + if (0x6 + 16) < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | (uint32_t(0x6 + 16))) + }(), func() uint32 { + if (0x7 + 16) < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | (uint32_t(0x7 + 16))) + }(), + func() uint32 { + if (0x8 + 16) < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | (uint32_t(0x8 + 16))) + }(), func() uint32 { + if (0x9 + 16) < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | (uint32_t(0x9 + 16))) + }(), func() uint32 { + if (0xa + 16) < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | (uint32_t(0xa + 16))) + }(), func() uint32 { + if (0xb + 16) < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | (uint32_t(0xb + 16))) + }(), func() uint32 { + if (0xc + 16) < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | (uint32_t(0xc + 16))) + }(), func() uint32 { + if (0xd + 16) < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | (uint32_t(0xd + 16))) + }(), func() uint32 { + if (0xe + 16) < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | (uint32_t(0xe + 16))) + }(), func() uint32 { + if (0xf + 16) < 2 { + return Uint32FromInt32(-1) + } + return (((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) | (uint32_t(0xf + 16))) + }(), + (((func() uint32 { + if 0x0 == 0 { + return ((func() uint32 { + if Int32(0xa0) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0xa0))) + }()) << 23) + } + return func() uint32 { + if 0x0 == 0xd { + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + } + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + }() + }()) | (uint32_t(((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23)) >> 6)) | uint32_t(0x0)), (((func() uint32 { + if 0x1 == 0 { + return ((func() uint32 { + if Int32(0xa0) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0xa0))) + }()) << 23) + } + return func() uint32 { + if 0x1 == 0xd { + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + } + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + }() + }()) | (uint32_t(((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23)) >> 6)) | uint32_t(0x1)), (((func() uint32 { + if 0x2 == 0 { + return ((func() uint32 { + if Int32(0xa0) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0xa0))) + }()) << 23) + } + return func() uint32 { + if 0x2 == 0xd { + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + } + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + }() + }()) | (uint32_t(((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23)) >> 6)) | uint32_t(0x2)), (((func() uint32 { + if 0x3 == 0 { + return ((func() uint32 { + if Int32(0xa0) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0xa0))) + }()) << 23) + } + return func() uint32 { + if 0x3 == 0xd { + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + } + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + }() + }()) | (uint32_t(((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23)) >> 6)) | uint32_t(0x3)), (((func() uint32 { + if 0x4 == 0 { + return ((func() uint32 { + if Int32(0xa0) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0xa0))) + }()) << 23) + } + return func() uint32 { + if 0x4 == 0xd { + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + } + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + }() + }()) | (uint32_t(((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23)) >> 6)) | uint32_t(0x4)), (((func() uint32 { + if 0x5 == 0 { + return ((func() uint32 { + if Int32(0xa0) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0xa0))) + }()) << 23) + } + return func() uint32 { + if 0x5 == 0xd { + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + } + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + }() + }()) | (uint32_t(((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23)) >> 6)) | uint32_t(0x5)), (((func() uint32 { + if 0x6 == 0 { + return ((func() uint32 { + if Int32(0xa0) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0xa0))) + }()) << 23) + } + return func() uint32 { + if 0x6 == 0xd { + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + } + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + }() + }()) | (uint32_t(((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23)) >> 6)) | uint32_t(0x6)), (((func() uint32 { + if 0x7 == 0 { + return ((func() uint32 { + if Int32(0xa0) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0xa0))) + }()) << 23) + } + return func() uint32 { + if 0x7 == 0xd { + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + } + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + }() + }()) | (uint32_t(((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23)) >> 6)) | uint32_t(0x7)), + (((func() uint32 { + if 0x8 == 0 { + return ((func() uint32 { + if Int32(0xa0) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0xa0))) + }()) << 23) + } + return func() uint32 { + if 0x8 == 0xd { + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + } + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + }() + }()) | (uint32_t(((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23)) >> 6)) | uint32_t(0x8)), (((func() uint32 { + if 0x9 == 0 { + return ((func() uint32 { + if Int32(0xa0) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0xa0))) + }()) << 23) + } + return func() uint32 { + if 0x9 == 0xd { + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + } + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + }() + }()) | (uint32_t(((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23)) >> 6)) | uint32_t(0x9)), (((func() uint32 { + if 0xa == 0 { + return ((func() uint32 { + if Int32(0xa0) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0xa0))) + }()) << 23) + } + return func() uint32 { + if 0xa == 0xd { + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + } + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + }() + }()) | (uint32_t(((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23)) >> 6)) | uint32_t(0xa)), (((func() uint32 { + if 0xb == 0 { + return ((func() uint32 { + if Int32(0xa0) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0xa0))) + }()) << 23) + } + return func() uint32 { + if 0xb == 0xd { + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + } + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + }() + }()) | (uint32_t(((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23)) >> 6)) | uint32_t(0xb)), (((func() uint32 { + if 0xc == 0 { + return ((func() uint32 { + if Int32(0xa0) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0xa0))) + }()) << 23) + } + return func() uint32 { + if 0xc == 0xd { + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + } + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + }() + }()) | (uint32_t(((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23)) >> 6)) | uint32_t(0xc)), (((func() uint32 { + if 0xd == 0 { + return ((func() uint32 { + if Int32(0xa0) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0xa0))) + }()) << 23) + } + return func() uint32 { + if 0xd == 0xd { + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + } + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + }() + }()) | (uint32_t(((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23)) >> 6)) | uint32_t(0xd)), (((func() uint32 { + if 0xe == 0 { + return ((func() uint32 { + if Int32(0xa0) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0xa0))) + }()) << 23) + } + return func() uint32 { + if 0xe == 0xd { + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + } + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + }() + }()) | (uint32_t(((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23)) >> 6)) | uint32_t(0xe)), (((func() uint32 { + if 0xf == 0 { + return ((func() uint32 { + if Int32(0xa0) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0xa0))) + }()) << 23) + } + return func() uint32 { + if 0xf == 0xd { + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xa0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + } + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + }() + }()) | (uint32_t(((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23)) >> 6)) | uint32_t(0xf)), + ((((func() uint32 { + if 0x0 >= 5 { + return uint32(0) + } + return func() uint32 { + if 0x0 == 0 { + return ((func() uint32 { + if Int32(0x90) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x90))) + }()) << 23) + } + return func() uint32 { + if 0x0 == 4 { + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0x90))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + } + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + }() + }() + }()) | (uint32_t(((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23)) >> 6)) | (uint32_t(((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23)) >> 12)) | uint32_t(0x0)), ((((func() uint32 { + if 0x1 >= 5 { + return uint32(0) + } + return func() uint32 { + if 0x1 == 0 { + return ((func() uint32 { + if Int32(0x90) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x90))) + }()) << 23) + } + return func() uint32 { + if 0x1 == 4 { + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0x90))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + } + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + }() + }() + }()) | (uint32_t(((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23)) >> 6)) | (uint32_t(((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23)) >> 12)) | uint32_t(0x1)), ((((func() uint32 { + if 0x2 >= 5 { + return uint32(0) + } + return func() uint32 { + if 0x2 == 0 { + return ((func() uint32 { + if Int32(0x90) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x90))) + }()) << 23) + } + return func() uint32 { + if 0x2 == 4 { + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0x90))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + } + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + }() + }() + }()) | (uint32_t(((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23)) >> 6)) | (uint32_t(((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23)) >> 12)) | uint32_t(0x2)), ((((func() uint32 { + if 0x3 >= 5 { + return uint32(0) + } + return func() uint32 { + if 0x3 == 0 { + return ((func() uint32 { + if Int32(0x90) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x90))) + }()) << 23) + } + return func() uint32 { + if 0x3 == 4 { + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0x90))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + } + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + }() + }() + }()) | (uint32_t(((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23)) >> 6)) | (uint32_t(((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23)) >> 12)) | uint32_t(0x3)), ((((func() uint32 { + if 0x4 >= 5 { + return uint32(0) + } + return func() uint32 { + if 0x4 == 0 { + return ((func() uint32 { + if Int32(0x90) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x90))) + }()) << 23) + } + return func() uint32 { + if 0x4 == 4 { + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0x90))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + } + return ((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23) + }() + }() + }()) | (uint32_t(((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23)) >> 6)) | (uint32_t(((func() uint32 { + if Int32(0x80) == Int32(0x80) { + return (Uint32(Uint32(0x40) - Uint32FromInt32(0xc0))) + } + return (Uint32(Uint32(0) - Uint32FromInt32(0x80))) + }()) << 23)) >> 12)) | uint32_t(0x4)), +} /* internal.c:18:16 */ + +type wint_t = uint32 /* alltypes.h:191:18 */ + +type wctype_t = uint32 /* alltypes.h:196:23 */ + +type __mbstate_t = struct { + __opaque1 uint32 + __opaque2 uint32 +} /* alltypes.h:330:9 */ + +type mbstate_t = __mbstate_t /* alltypes.h:330:63 */ + +func Xmbrtowc(tls *TLS, wc uintptr, src uintptr, n size_t, st uintptr) size_t { /* mbrtowc.c:6:8: */ + bp := tls.Alloc(4) + defer tls.Free(4) + + var c uint32 + var s uintptr + var N uint32 + // var dummy wchar_t at bp, 4 + s = src + N = n + + if !(!(st != 0)) { + goto __1 + } + st = uintptr(unsafe.Pointer(&_sinternal_state)) +__1: + ; + c = *(*uint32)(unsafe.Pointer(st)) + + if !(!(s != 0)) { + goto __2 + } + if !(c != 0) { + goto __4 + } + goto ilseq +__4: + ; + return size_t(0) + goto __3 +__2: + if !(!(wc != 0)) { + goto __5 + } + wc = bp /* &dummy */ +__5: + ; +__3: + ; + + if !(!(n != 0)) { + goto __6 + } + return Uint32FromInt32(-2) +__6: + ; + if !(!(c != 0)) { + goto __7 + } + if !(int32(*(*uint8)(unsafe.Pointer(s))) < 0x80) { + goto __8 + } + return BoolUint32(!(!(int32(AssignPtrUint32(wc, wchar_t(*(*uint8)(unsafe.Pointer(s))))) != 0))) +__8: + ; + if !((func() int32 { + if !(!(int32(*(*uintptr)(unsafe.Pointer(((*__pthread)(unsafe.Pointer(__pthread_self(tls))).locale /* &.cat */)))) != 0)) { + return 4 + } + return 1 + }()) == 1) { + goto __9 + } + *(*wchar_t)(unsafe.Pointer(wc)) = (wchar_t(0xdfff & int32((int8(*(*uint8)(unsafe.Pointer(s))))))) + return 1 +__9: + ; + if !((uint32(*(*uint8)(unsafe.Pointer(s))) - 0xc2) > (0xf4 - 0xc2)) { + goto __10 + } + goto ilseq +__10: + ; + c = X__fsmu8[(uint32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&s, 1)))) - 0xc2)] + n-- +__7: + ; + + if !(n != 0) { + goto __11 + } + if !((((((int32(*(*uint8)(unsafe.Pointer(s)))) >> 3) - 0x10) | (((int32(*(*uint8)(unsafe.Pointer(s)))) >> 3) + ((int32_t(c)) >> 26))) & CplInt32(7)) != 0) { + goto __12 + } + goto ilseq +__12: + ; +loop: + c = ((c << 6) | (uint32(int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&s, 1)))) - 0x80))) + n-- + if !(!((c & (uint32(1) << 31)) != 0)) { + goto __13 + } + *(*uint32)(unsafe.Pointer(st)) = uint32(0) + *(*wchar_t)(unsafe.Pointer(wc)) = c + return (N - n) +__13: + ; + if !(n != 0) { + goto __14 + } + if !((uint32(*(*uint8)(unsafe.Pointer(s))) - 0x80) >= uint32(0x40)) { + goto __15 + } + goto ilseq +__15: + ; + goto loop +__14: + ; +__11: + ; + + *(*uint32)(unsafe.Pointer(st)) = c + return Uint32FromInt32(-2) +ilseq: + *(*uint32)(unsafe.Pointer(st)) = uint32(0) + (*(*int32)(unsafe.Pointer(X___errno_location(tls)))) = 84 + return Uint32FromInt32(-1) +} + +var _sinternal_state uint32 /* mbrtowc.c:8:18: */ + +func Xmbsinit(tls *TLS, st uintptr) int32 { /* mbsinit.c:3:5: */ + return (Bool32(!(st != 0) || !(int32(*(*uint32)(unsafe.Pointer(st))) != 0))) +} + type imaxdiv_t = struct { quot intmax_t rem intmax_t @@ -2200,90 +3749,6 @@ __3: //TODO else UNLOCK(b->lock); } -type time_t = int64 /* alltypes.h:78:16 */ - -type clockid_t = int32 /* alltypes.h:207:13 */ - -type timespec = struct { - tv_sec time_t - tv_nsec int32 - __12 uint32 /* int : 32 */ -} /* alltypes.h:222:1 */ - -type pthread_t = uintptr /* alltypes.h:266:26 */ - -type pthread_once_t = int32 /* alltypes.h:272:13 */ - -type pthread_key_t = uint32 /* alltypes.h:277:18 */ - -type pthread_spinlock_t = int32 /* alltypes.h:282:13 */ - -type pthread_mutexattr_t = struct{ __attr uint32 } /* alltypes.h:287:37 */ - -type pthread_condattr_t = struct{ __attr uint32 } /* alltypes.h:292:37 */ - -type pthread_barrierattr_t = struct{ __attr uint32 } /* alltypes.h:297:37 */ - -type pthread_rwlockattr_t = struct{ __attr [2]uint32 } /* alltypes.h:302:40 */ - -type __sigset_t = struct{ __bits [32]uint32 } /* alltypes.h:342:9 */ - -type sigset_t = __sigset_t /* alltypes.h:342:71 */ - -type pthread_attr_t = struct{ __u struct{ __i [9]int32 } } /* alltypes.h:365:147 */ - -type pthread_mutex_t = struct{ __u struct{ __i [6]int32 } } /* alltypes.h:370:157 */ - -type pthread_cond_t = struct{ __u struct{ __i [12]int32 } } /* alltypes.h:380:112 */ - -type pthread_rwlock_t = struct{ __u struct{ __i [8]int32 } } /* alltypes.h:390:139 */ - -type pthread_barrier_t = struct{ __u struct{ __i [5]int32 } } /* alltypes.h:395:137 */ - -type sched_param = struct { - sched_priority int32 - __reserved1 int32 - __reserved2 [4]int32 - __reserved3 int32 -} /* sched.h:19:1 */ - -type timer_t = uintptr /* alltypes.h:202:14 */ - -type clock_t = int32 /* alltypes.h:212:14 */ - -type tm = struct { - tm_sec int32 - tm_min int32 - tm_hour int32 - tm_mday int32 - tm_mon int32 - tm_year int32 - tm_wday int32 - tm_yday int32 - tm_isdst int32 - tm_gmtoff int32 - tm_zone uintptr -} /* time.h:38:1 */ - -type itimerspec = struct { - it_interval struct { - tv_sec time_t - tv_nsec int32 - __12 uint32 /* int : 32 */ - } - it_value struct { - tv_sec time_t - tv_nsec int32 - __12 uint32 /* int : 32 */ - } -} /* time.h:80:1 */ - -type __ptcb = struct { - __f uintptr - __x uintptr - __next uintptr -} /* pthread.h:206:1 */ - func Xgetaddrinfo(tls *TLS, host uintptr, serv uintptr, hint uintptr, res uintptr) int32 { /* getaddrinfo.c:12:5: */ bp := tls.Alloc(1608) defer tls.Free(1608) @@ -2715,6 +4180,10 @@ func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, return 0 } +func Xgethostbyname_r(tls *TLS, name uintptr, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname_r.c:6:5: */ + return Xgethostbyname2_r(tls, name, 2, h, buf, buflen, res, err) +} + type if_nameindex = struct { if_index uint32 if_name uintptr @@ -2857,6 +4326,7 @@ type __res_state = struct { defdname [256]int8 pfcode uint32 ndots uint32 /* unsigned ndots: 4, unsigned nsort: 4, unsigned ipv6_unavail: 1, unsigned unused: 23 */ + _ [4]byte sort_list [10]struct { addr struct{ s_addr in_addr_t } mask uint32_t @@ -3135,15 +4605,15 @@ func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5 switch i { case 0: *(*uint32)(unsafe.Pointer(bp /* &a[0] */ + 1*4)) = (*(*uint32)(unsafe.Pointer(bp /* &a[0] */)) & uint32(0xffffff)) - AssignShrPtrUint32(bp /* &a */, int(uint32(24))) + AssignShrPtrUint32(bp /* &a */, int(24)) fallthrough case 1: *(*uint32)(unsafe.Pointer(bp /* &a[0] */ + 2*4)) = (*(*uint32)(unsafe.Pointer(bp /* &a[0] */ + 1*4)) & uint32(0xffff)) - AssignShrPtrUint32(bp /* &a */ +1*4, int(uint32(16))) + AssignShrPtrUint32(bp /* &a */ +1*4, int(16)) fallthrough case 2: *(*uint32)(unsafe.Pointer(bp /* &a[0] */ + 3*4)) = (*(*uint32)(unsafe.Pointer(bp /* &a[0] */ + 2*4)) & uint32(0xff)) - AssignShrPtrUint32(bp /* &a */ +2*4, int(uint32(8))) + AssignShrPtrUint32(bp /* &a */ +2*4, int(8)) } for i = 0; i < 4; i++ { if *(*uint32)(unsafe.Pointer(bp /* &a[0] */ + uintptr(i)*4)) > uint32(255) { @@ -3937,6 +5407,30 @@ func Xrand_r(tls *TLS, seed uintptr) int32 { /* rand_r.c:12:5: */ return (int32(temper(tls, AssignPtrUint32(seed, ((*(*uint32)(unsafe.Pointer(seed))*uint32(1103515245))+uint32(12345)))) / uint32(2))) } +func X__lockfile(tls *TLS, f uintptr) int32 { /* __lockfile.c:4:5: */ + var owner int32 = (*FILE)(unsafe.Pointer(f)).lock + var tid int32 = (*__pthread)(unsafe.Pointer(__pthread_self(tls))).tid + if (owner & CplInt32(0x40000000)) == tid { + return 0 + } + owner = a_cas(tls, (f + 76 /* &.lock */), 0, tid) + if !(owner != 0) { + return 1 + } + for AssignInt32(&owner, a_cas(tls, (f+76 /* &.lock */), 0, (tid|0x40000000))) != 0 { + if ((owner & 0x40000000) != 0) || (a_cas(tls, (f+76 /* &.lock */), owner, (owner|0x40000000)) == owner) { + __futexwait(tls, (f + 76 /* &.lock */), (owner | 0x40000000), 1) + } + } + return 1 +} + +func X__unlockfile(tls *TLS, f uintptr) { /* __lockfile.c:19:6: */ + if (a_swap(tls, (f+76 /* &.lock */), 0) & 0x40000000) != 0 { + __wake(tls, (f + 76 /* &.lock */), 1, 1) + } +} + func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ *(*int32)(unsafe.Pointer(f + 72 /* &.mode */)) |= ((*FILE)(unsafe.Pointer(f)).mode - 1) if (*FILE)(unsafe.Pointer(f)).wpos != (*FILE)(unsafe.Pointer(f)).wbase { @@ -3974,6 +5468,940 @@ func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ return -1 } +func Xsscanf(tls *TLS, s uintptr, fmt uintptr, va uintptr) int32 { /* sscanf.c:4:5: */ + var ret int32 + var ap va_list + _ = ap + ap = va + ret = Xvsscanf(tls, s, fmt, ap) + _ = ap + return ret +} + +type wctrans_t = uintptr /* wctype.h:20:19 */ + +func store_int(tls *TLS, dest uintptr, size int32, i uint64) { /* vfscanf.c:22:13: */ + if !(dest != 0) { + return + } + switch size { + case -2: + *(*int8)(unsafe.Pointer(dest)) = int8(i) + break + case -1: + *(*int16)(unsafe.Pointer(dest)) = int16(i) + break + case 0: + *(*int32)(unsafe.Pointer(dest)) = int32(i) + break + case 1: + *(*int32)(unsafe.Pointer(dest)) = int32(i) + break + case 3: + *(*int64)(unsafe.Pointer(dest)) = int64(i) + break + } +} + +func arg_n(tls *TLS, ap va_list, n uint32) uintptr { /* vfscanf.c:44:13: */ + var p uintptr + var i uint32 + var ap2 va_list + _ = ap2 + ap2 = ap + for i = n; i > uint32(1); i-- { + VaUintptr(&ap2) + } + p = VaUintptr(&ap2) + _ = ap2 + return p +} + +func Xvfscanf(tls *TLS, f uintptr, fmt uintptr, ap va_list) int32 { /* vfscanf.c:56:5: */ + bp := tls.Alloc(276) + defer tls.Free(276) + + var width int32 + var size int32 + var alloc int32 + var base int32 + var p uintptr + var c int32 + var t int32 + var s uintptr + var wcs uintptr + // var st mbstate_t at bp+268, 8 + + var dest uintptr + var invert int32 + var matches int32 + var x uint64 + var y float64 + var pos off_t + // var scanset [257]uint8 at bp, 257 + + var i size_t + var k size_t + // var wc wchar_t at bp+260, 4 + + var __need_unlock int32 + var tmp uintptr + var tmp1 uintptr + alloc = 0 + dest = uintptr(0) + matches = 0 + pos = int64(0) + __need_unlock = func() int32 { + if (*FILE)(unsafe.Pointer((f))).lock >= 0 { + return X__lockfile(tls, f) + } + return 0 + }() + + if !(!(int32((*FILE)(unsafe.Pointer(f)).rpos) != 0)) { + goto __1 + } + X__toread(tls, f) +__1: + ; + if !(!(int32((*FILE)(unsafe.Pointer(f)).rpos) != 0)) { + goto __2 + } + goto input_fail +__2: + ; + + p = fmt +__3: + if !(*(*uint8)(unsafe.Pointer(p)) != 0) { + goto __5 + } + + alloc = 0 + + if !(__isspace(tls, int32(*(*uint8)(unsafe.Pointer(p)))) != 0) { + goto __6 + } +__7: + if !(__isspace(tls, int32(*(*uint8)(unsafe.Pointer(p + 1)))) != 0) { + goto __8 + } + p++ + goto __7 +__8: + ; + X__shlim(tls, f, int64(0)) +__9: + if !(__isspace(tls, func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }()) != 0) { + goto __10 + } + goto __9 +__10: + ; + if (*FILE)(unsafe.Pointer((f))).shlim >= int64(0) { + (*FILE)(unsafe.Pointer(f)).rpos-- + } else { + } + pos = pos + ((*FILE)(unsafe.Pointer((f))).shcnt + (off_t((int32((*FILE)(unsafe.Pointer((f))).rpos) - int32((*FILE)(unsafe.Pointer((f))).buf)) / 1))) + goto __4 +__6: + ; + if !((int32(*(*uint8)(unsafe.Pointer(p))) != '%') || (int32(*(*uint8)(unsafe.Pointer(p + 1))) == '%')) { + goto __11 + } + X__shlim(tls, f, int64(0)) + if !(int32(*(*uint8)(unsafe.Pointer(p))) == '%') { + goto __12 + } + p++ +__14: + if !(__isspace(tls, AssignInt32(&c, func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }())) != 0) { + goto __15 + } + goto __14 +__15: + ; + goto __13 +__12: + c = func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }() +__13: + ; + if !(c != int32(*(*uint8)(unsafe.Pointer(p)))) { + goto __16 + } + if (*FILE)(unsafe.Pointer((f))).shlim >= int64(0) { + (*FILE)(unsafe.Pointer(f)).rpos-- + } else { + } + if !(c < 0) { + goto __17 + } + goto input_fail +__17: + ; + goto match_fail +__16: + ; + pos = pos + ((*FILE)(unsafe.Pointer((f))).shcnt + (off_t((int32((*FILE)(unsafe.Pointer((f))).rpos) - int32((*FILE)(unsafe.Pointer((f))).buf)) / 1))) + goto __4 +__11: + ; + + p++ + if !(int32(*(*uint8)(unsafe.Pointer(p))) == '*') { + goto __18 + } + dest = uintptr(0) + p++ + goto __19 +__18: + if !((func() int32 { + if 0 != 0 { + return Xisdigit(tls, int32(*(*uint8)(unsafe.Pointer(p)))) + } + return (Bool32(((uint32(*(*uint8)(unsafe.Pointer(p)))) - uint32('0')) < uint32(10))) + }() != 0) && (int32(*(*uint8)(unsafe.Pointer(p + 1))) == '$')) { + goto __20 + } + dest = arg_n(tls, ap, (uint32(int32(*(*uint8)(unsafe.Pointer(p))) - '0'))) + p += uintptr(2) + goto __21 +__20: + dest = VaUintptr(&ap) +__21: + ; +__19: + ; + + width = 0 +__22: + if !(func() int32 { + if 0 != 0 { + return Xisdigit(tls, int32(*(*uint8)(unsafe.Pointer(p)))) + } + return (Bool32(((uint32(*(*uint8)(unsafe.Pointer(p)))) - uint32('0')) < uint32(10))) + }() != 0) { + goto __24 + } + width = (((10 * width) + int32(*(*uint8)(unsafe.Pointer(p)))) - '0') + goto __23 +__23: + p++ + goto __22 + goto __24 +__24: + ; + + if !(int32(*(*uint8)(unsafe.Pointer(p))) == 'm') { + goto __25 + } + wcs = uintptr(0) + s = uintptr(0) + alloc = BoolInt32(!(!(dest != 0))) + p++ + goto __26 +__25: + alloc = 0 +__26: + ; + + size = 0 + switch int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&p, 1)))) { + case 'h': + goto __28 + case 'l': + goto __29 + case 'j': + goto __30 + case 'z': + goto __31 + case 't': + goto __32 + case 'L': + goto __33 + case 'd': + goto __34 + case 'i': + goto __35 + case 'o': + goto __36 + case 'u': + goto __37 + case 'x': + goto __38 + case 'a': + goto __39 + case 'e': + goto __40 + case 'f': + goto __41 + case 'g': + goto __42 + case 'A': + goto __43 + case 'E': + goto __44 + case 'F': + goto __45 + case 'G': + goto __46 + case 'X': + goto __47 + case 's': + goto __48 + case 'c': + goto __49 + case '[': + goto __50 + case 'S': + goto __51 + case 'C': + goto __52 + case 'p': + goto __53 + case 'n': + goto __54 + default: + goto __55 + } + goto __27 +__28: + if !(int32(*(*uint8)(unsafe.Pointer(p))) == 'h') { + goto __56 + } + p++ + size = -2 + goto __57 +__56: + size = -1 +__57: + ; + goto __27 +__29: + if !(int32(*(*uint8)(unsafe.Pointer(p))) == 'l') { + goto __58 + } + p++ + size = 3 + goto __59 +__58: + size = 1 +__59: + ; + goto __27 +__30: + size = 3 + goto __27 +__31: +__32: + size = 1 + goto __27 +__33: + size = 2 + goto __27 +__34: +__35: +__36: +__37: +__38: +__39: +__40: +__41: +__42: +__43: +__44: +__45: +__46: +__47: +__48: +__49: +__50: +__51: +__52: +__53: +__54: + p-- + goto __27 +__55: + goto fmt_fail +__27: + ; + + t = int32(*(*uint8)(unsafe.Pointer(p))) + + // C or S + if !((t & 0x2f) == 3) { + goto __60 + } + t = t | (32) + size = 1 +__60: + ; + + switch t { + case 'c': + goto __62 + case '[': + goto __63 + case 'n': + goto __64 + default: + goto __65 + } + goto __61 +__62: + if !(width < 1) { + goto __66 + } + width = 1 +__66: + ; +__63: + goto __61 +__64: + store_int(tls, dest, size, uint64(pos)) + // do not increment match count, etc! + goto __4 +__65: + X__shlim(tls, f, int64(0)) +__67: + if !(__isspace(tls, func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }()) != 0) { + goto __68 + } + goto __67 +__68: + ; + if (*FILE)(unsafe.Pointer((f))).shlim >= int64(0) { + (*FILE)(unsafe.Pointer(f)).rpos-- + } else { + } + pos = pos + ((*FILE)(unsafe.Pointer((f))).shcnt + (off_t((int32((*FILE)(unsafe.Pointer((f))).rpos) - int32((*FILE)(unsafe.Pointer((f))).buf)) / 1))) +__61: + ; + + X__shlim(tls, f, int64(width)) + if !((func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }()) < 0) { + goto __69 + } + goto input_fail +__69: + ; + if (*FILE)(unsafe.Pointer((f))).shlim >= int64(0) { + (*FILE)(unsafe.Pointer(f)).rpos-- + } else { + } + + switch t { + case 's': + goto __71 + case 'c': + goto __72 + case '[': + goto __73 + case 'p': + goto __74 + case 'X': + goto __75 + case 'x': + goto __76 + case 'o': + goto __77 + case 'd': + goto __78 + case 'u': + goto __79 + case 'i': + goto __80 + case 'a': + goto __81 + case 'A': + goto __82 + case 'e': + goto __83 + case 'E': + goto __84 + case 'f': + goto __85 + case 'F': + goto __86 + case 'g': + goto __87 + case 'G': + goto __88 + } + goto __70 +__71: +__72: +__73: + if !((t == 'c') || (t == 's')) { + goto __89 + } + Xmemset(tls, bp /* &scanset[0] */, -1, uint32(unsafe.Sizeof([257]uint8{}))) + *(*uint8)(unsafe.Pointer(bp /* &scanset[0] */)) = uint8(0) + if !(t == 's') { + goto __91 + } + *(*uint8)(unsafe.Pointer(bp /* &scanset[0] */ + 10)) = uint8(0) + *(*uint8)(unsafe.Pointer(bp /* &scanset[0] */ + 11)) = uint8(0) + *(*uint8)(unsafe.Pointer(bp /* &scanset[0] */ + 12)) = uint8(0) + *(*uint8)(unsafe.Pointer(bp /* &scanset[0] */ + 13)) = uint8(0) + *(*uint8)(unsafe.Pointer(bp /* &scanset[0] */ + 14)) = uint8(0) + *(*uint8)(unsafe.Pointer(bp /* &scanset[0] */ + 33)) = uint8(0) +__91: + ; + goto __90 +__89: + if !(int32(*(*uint8)(unsafe.Pointer(PreIncUintptr(&p, 1)))) == '^') { + goto __92 + } + p++ + invert = 1 + goto __93 +__92: + invert = 0 +__93: + ; + Xmemset(tls, bp /* &scanset[0] */, invert, uint32(unsafe.Sizeof([257]uint8{}))) + *(*uint8)(unsafe.Pointer(bp /* &scanset[0] */)) = uint8(0) + if !(int32(*(*uint8)(unsafe.Pointer(p))) == '-') { + goto __94 + } + p++ + *(*uint8)(unsafe.Pointer(bp /* &scanset[0] */ + 46)) = (uint8(1 - invert)) + goto __95 +__94: + if !(int32(*(*uint8)(unsafe.Pointer(p))) == ']') { + goto __96 + } + p++ + *(*uint8)(unsafe.Pointer(bp /* &scanset[0] */ + 94)) = (uint8(1 - invert)) +__96: + ; +__95: + ; +__97: + if !(int32(*(*uint8)(unsafe.Pointer(p))) != ']') { + goto __99 + } + if !(!(int32(*(*uint8)(unsafe.Pointer(p))) != 0)) { + goto __100 + } + goto fmt_fail +__100: + ; + if !(((int32(*(*uint8)(unsafe.Pointer(p))) == '-') && (*(*uint8)(unsafe.Pointer(p + 1)) != 0)) && (int32(*(*uint8)(unsafe.Pointer(p + 1))) != ']')) { + goto __101 + } + c = int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&p, 1) + UintptrFromInt32(-1)))) +__102: + if !(c < int32(*(*uint8)(unsafe.Pointer(p)))) { + goto __104 + } + *(*uint8)(unsafe.Pointer(bp /* &scanset[0] */ + uintptr((1 + c)))) = (uint8(1 - invert)) + goto __103 +__103: + c++ + goto __102 + goto __104 +__104: + ; +__101: + ; + *(*uint8)(unsafe.Pointer(bp /* &scanset[0] */ + uintptr((1 + int32(*(*uint8)(unsafe.Pointer(p))))))) = (uint8(1 - invert)) + goto __98 +__98: + p++ + goto __97 + goto __99 +__99: + ; +__90: + ; + wcs = uintptr(0) + s = uintptr(0) + i = size_t(0) + if t == 'c' { + k = (uint32(width) + 1) + } else { + k = uint32(31) + } + if !(size == 1) { + goto __105 + } + if !(alloc != 0) { + goto __107 + } + wcs = Xmalloc(tls, (k * size_t(unsafe.Sizeof(wchar_t(0))))) + if !(!(wcs != 0)) { + goto __109 + } + goto alloc_fail +__109: + ; + goto __108 +__107: + wcs = dest +__108: + ; + *(*mbstate_t)(unsafe.Pointer(bp + 268 /* st */)) = mbstate_t{} +__110: + if !(*(*uint8)(unsafe.Pointer(bp /* &scanset[0] */ + uintptr(((AssignInt32(&c, func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }())) + 1)))) != 0) { + goto __111 + } + switch Xmbrtowc(tls, bp+260 /* &wc */, func() uintptr { *(*int8)(unsafe.Pointer(bp + 264)) = int8(c); return bp + 264 }(), uint32(1), bp+268 /* &st */) { + case Uint32FromInt32(-1): + goto __113 + case Uint32FromInt32(-2): + goto __114 + } + goto __112 +__113: + goto input_fail +__114: + goto __110 +__112: + ; + if !(wcs != 0) { + goto __115 + } + *(*wchar_t)(unsafe.Pointer(wcs + uintptr(PostIncUint32(&i, 1))*4)) = *(*wchar_t)(unsafe.Pointer(bp + 260 /* wc */)) +__115: + ; + if !((alloc != 0) && (i == k)) { + goto __116 + } + k = k + (k + size_t(1)) + tmp = Xrealloc(tls, wcs, (k * size_t(unsafe.Sizeof(wchar_t(0))))) + if !(!(tmp != 0)) { + goto __117 + } + goto alloc_fail +__117: + ; + wcs = tmp +__116: + ; + goto __110 +__111: + ; + if !(!(Xmbsinit(tls, bp+268 /* &st */) != 0)) { + goto __118 + } + goto input_fail +__118: + ; + goto __106 +__105: + if !(alloc != 0) { + goto __119 + } + s = Xmalloc(tls, k) + if !(!(s != 0)) { + goto __121 + } + goto alloc_fail +__121: + ; +__122: + if !(*(*uint8)(unsafe.Pointer(bp /* &scanset[0] */ + uintptr(((AssignInt32(&c, func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }())) + 1)))) != 0) { + goto __123 + } + *(*int8)(unsafe.Pointer(s + uintptr(PostIncUint32(&i, 1)))) = int8(c) + if !(i == k) { + goto __124 + } + k = k + (k + size_t(1)) + tmp1 = Xrealloc(tls, s, k) + if !(!(tmp1 != 0)) { + goto __125 + } + goto alloc_fail +__125: + ; + s = tmp1 +__124: + ; + goto __122 +__123: + ; + goto __120 +__119: + if !(AssignUintptr(&s, dest) != 0) { + goto __126 + } +__128: + if !(*(*uint8)(unsafe.Pointer(bp /* &scanset[0] */ + uintptr(((AssignInt32(&c, func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }())) + 1)))) != 0) { + goto __129 + } + *(*int8)(unsafe.Pointer(s + uintptr(PostIncUint32(&i, 1)))) = int8(c) + goto __128 +__129: + ; + goto __127 +__126: +__130: + if !(*(*uint8)(unsafe.Pointer(bp /* &scanset[0] */ + uintptr(((AssignInt32(&c, func() int32 { + if (*FILE)(unsafe.Pointer((f))).rpos != (*FILE)(unsafe.Pointer((f))).shend { + return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) + } + return X__shgetc(tls, f) + }())) + 1)))) != 0) { + goto __131 + } + goto __130 +__131: + ; +__127: + ; +__120: + ; +__106: + ; + if (*FILE)(unsafe.Pointer((f))).shlim >= int64(0) { + (*FILE)(unsafe.Pointer(f)).rpos-- + } else { + } + if !(!(((*FILE)(unsafe.Pointer((f))).shcnt + (off_t((int32((*FILE)(unsafe.Pointer((f))).rpos) - int32((*FILE)(unsafe.Pointer((f))).buf)) / 1))) != 0)) { + goto __132 + } + goto match_fail +__132: + ; + if !((t == 'c') && (((*FILE)(unsafe.Pointer((f))).shcnt + (off_t((int32((*FILE)(unsafe.Pointer((f))).rpos) - int32((*FILE)(unsafe.Pointer((f))).buf)) / 1))) != off_t(width))) { + goto __133 + } + goto match_fail +__133: + ; + if !(alloc != 0) { + goto __134 + } + if !(size == 1) { + goto __135 + } + *(*uintptr)(unsafe.Pointer(dest)) = wcs + goto __136 +__135: + *(*uintptr)(unsafe.Pointer(dest)) = s +__136: + ; +__134: + ; + if !(t != 'c') { + goto __137 + } + if !(wcs != 0) { + goto __138 + } + *(*wchar_t)(unsafe.Pointer(wcs + uintptr(i)*4)) = wchar_t(0) +__138: + ; + if !(s != 0) { + goto __139 + } + *(*int8)(unsafe.Pointer(s + uintptr(i))) = int8(0) +__139: + ; +__137: + ; + goto __70 +__74: +__75: +__76: + base = 16 + goto int_common +__77: + base = 8 + goto int_common +__78: +__79: + base = 10 + goto int_common +__80: + base = 0 +int_common: + x = X__intscan(tls, f, uint32(base), 0, ((2 * uint64(0x7fffffffffffffff)) + uint64(1))) + if !(!(((*FILE)(unsafe.Pointer((f))).shcnt + (off_t((int32((*FILE)(unsafe.Pointer((f))).rpos) - int32((*FILE)(unsafe.Pointer((f))).buf)) / 1))) != 0)) { + goto __140 + } + goto match_fail +__140: + ; + if !((t == 'p') && (dest != 0)) { + goto __141 + } + *(*uintptr)(unsafe.Pointer(dest)) = uintptr(uintptr_t(x)) + goto __142 +__141: + store_int(tls, dest, size, x) +__142: + ; + goto __70 +__81: +__82: +__83: +__84: +__85: +__86: +__87: +__88: + y = X__floatscan(tls, f, size, 0) + if !(!(((*FILE)(unsafe.Pointer((f))).shcnt + (off_t((int32((*FILE)(unsafe.Pointer((f))).rpos) - int32((*FILE)(unsafe.Pointer((f))).buf)) / 1))) != 0)) { + goto __143 + } + goto match_fail +__143: + ; + if !(dest != 0) { + goto __144 + } + switch size { + case 0: + goto __146 + case 1: + goto __147 + case 2: + goto __148 + } + goto __145 +__146: + *(*float32)(unsafe.Pointer(dest)) = float32(y) + goto __145 +__147: + *(*float64)(unsafe.Pointer(dest)) = y + goto __145 +__148: + *(*float64)(unsafe.Pointer(dest)) = y + goto __145 +__145: + ; +__144: + ; + goto __70 +__70: + ; + + pos = pos + ((*FILE)(unsafe.Pointer((f))).shcnt + (off_t((int32((*FILE)(unsafe.Pointer((f))).rpos) - int32((*FILE)(unsafe.Pointer((f))).buf)) / 1))) + if !(dest != 0) { + goto __149 + } + matches++ +__149: + ; + goto __4 +__4: + p++ + goto __3 + goto __5 +__5: + ; + if !(0 != 0) { + goto __150 + } +fmt_fail: +alloc_fail: +input_fail: + if !(!(matches != 0)) { + goto __151 + } + matches-- +__151: + ; +match_fail: + if !(alloc != 0) { + goto __152 + } + Xfree(tls, s) + Xfree(tls, wcs) +__152: + ; +__150: + ; +__153: + if !(__need_unlock != 0) { + goto __156 + } + X__unlockfile(tls, f) +__156: + ; + goto __154 +__154: + if 0 != 0 { + goto __153 + } + goto __155 +__155: + ; + return matches +} + +func string_read(tls *TLS, f uintptr, buf uintptr, len size_t) size_t { /* vsscanf.c:4:15: */ + var src uintptr = (*FILE)(unsafe.Pointer(f)).cookie + var k size_t = (len + size_t(256)) + var end uintptr = Xmemchr(tls, src, 0, k) + if end != 0 { + k = (size_t((int32(end) - int32(src)) / 1)) + } + if k < len { + len = k + } + Xmemcpy(tls, buf, src, len) + (*FILE)(unsafe.Pointer(f)).rpos = (src + uintptr(len)) + (*FILE)(unsafe.Pointer(f)).rend = (src + uintptr(k)) + (*FILE)(unsafe.Pointer(f)).cookie = (src + uintptr(k)) + return len +} + +func Xvsscanf(tls *TLS, s uintptr, fmt uintptr, ap va_list) int32 { /* vsscanf.c:18:5: */ + bp := tls.Alloc(144) + defer tls.Free(144) + + *(*FILE)(unsafe.Pointer(bp /* f */)) = FILE{read: *(*uintptr)(unsafe.Pointer(&struct { + f func(*TLS, uintptr, uintptr, size_t) size_t + }{string_read})), buf: s, lock: -1, cookie: s} + return Xvfscanf(tls, bp /* &f */, fmt, ap) +} + func strtox(tls *TLS, s uintptr, p uintptr, prec int32) float64 { /* strtod.c:6:20: */ bp := tls.Alloc(144) defer tls.Free(144) @@ -4233,5 +6661,151 @@ func Xstrtok(tls *TLS, s uintptr, sep uintptr) uintptr { /* strtok.c:3:6: */ var _sp uintptr /* strtok.c:5:14: */ +func X__ccgo_pthreadAttrGetDetachState(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:3:5: */ + return *(*int32)(unsafe.Pointer((a /* &.__u */ /* &.__i */) + 3*4)) +} + +func Xpthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) int32 { /* pthread_attr_get.c:7:5: */ + *(*int32)(unsafe.Pointer(state)) = *(*int32)(unsafe.Pointer((a /* &.__u */ /* &.__i */) + 3*4)) + return 0 +} + +// +// int pthread_attr_getguardsize(const pthread_attr_t *restrict a, size_t *restrict size) +// { +// *size = a->_a_guardsize; +// return 0; +// } +// +// int pthread_attr_getinheritsched(const pthread_attr_t *restrict a, int *restrict inherit) +// { +// *inherit = a->_a_sched; +// return 0; +// } +// +// int pthread_attr_getschedparam(const pthread_attr_t *restrict a, struct sched_param *restrict param) +// { +// param->sched_priority = a->_a_prio; +// return 0; +// } +// +// int pthread_attr_getschedpolicy(const pthread_attr_t *restrict a, int *restrict policy) +// { +// *policy = a->_a_policy; +// return 0; +// } +// +// int pthread_attr_getscope(const pthread_attr_t *restrict a, int *restrict scope) +// { +// *scope = PTHREAD_SCOPE_SYSTEM; +// return 0; +// } +// +// int pthread_attr_getstack(const pthread_attr_t *restrict a, void **restrict addr, size_t *restrict size) +// { +// if (!a->_a_stackaddr) +// return EINVAL; +// *size = a->_a_stacksize; +// *addr = (void *)(a->_a_stackaddr - *size); +// return 0; +// } +// +// int pthread_attr_getstacksize(const pthread_attr_t *restrict a, size_t *restrict size) +// { +// *size = a->_a_stacksize; +// return 0; +// } +// +// int pthread_barrierattr_getpshared(const pthread_barrierattr_t *restrict a, int *restrict pshared) +// { +// *pshared = !!a->__attr; +// return 0; +// } +// +// int pthread_condattr_getclock(const pthread_condattr_t *restrict a, clockid_t *restrict clk) +// { +// *clk = a->__attr & 0x7fffffff; +// return 0; +// } +// +// int pthread_condattr_getpshared(const pthread_condattr_t *restrict a, int *restrict pshared) +// { +// *pshared = a->__attr>>31; +// return 0; +// } +// +// int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *restrict a, int *restrict protocol) +// { +// *protocol = PTHREAD_PRIO_NONE; +// return 0; +// } +// int pthread_mutexattr_getpshared(const pthread_mutexattr_t *restrict a, int *restrict pshared) +// { +// *pshared = a->__attr / 128U % 2; +// return 0; +// } +// +// int pthread_mutexattr_getrobust(const pthread_mutexattr_t *restrict a, int *restrict robust) +// { +// *robust = a->__attr / 4U % 2; +// return 0; +// } + +func X__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:93:5: */ + return (int32((*pthread_mutexattr_t)(unsafe.Pointer(a)).__attr & uint32(3))) +} + +// int pthread_mutexattr_gettype(const pthread_mutexattr_t *restrict a, int *restrict type) +// { +// *type = a->__attr & 3; +// return 0; +// } +// +// int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *restrict a, int *restrict pshared) +// { +// *pshared = a->__attr[0]; +// return 0; +// } + +func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 { /* pthread_attr_setdetachstate.c:3:5: */ + if uint32(state) > 1 { + return 22 + } + *(*int32)(unsafe.Pointer((a /* &.__u */ /* &.__i */) + 3*4)) = state + return 0 +} + +func X__ccgo_getMutexType(tls *TLS, m uintptr) int32 { /* pthread_mutex_lock.c:3:5: */ + return (*(*int32)(unsafe.Pointer((m /* &.__u */ /* &.__i */))) & 15) +} + +// int __pthread_mutex_lock(pthread_mutex_t *m) +// { +// if ((m->_m_type&15) == PTHREAD_MUTEX_NORMAL +// && !a_cas(&m->_m_lock, 0, EBUSY)) +// return 0; +// +// return __pthread_mutex_timedlock(m, 0); +// } +// +// weak_alias(__pthread_mutex_lock, pthread_mutex_lock); + +func Xpthread_mutexattr_destroy(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_destroy.c:3:5: */ + return 0 +} + +func Xpthread_mutexattr_init(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_init.c:3:5: */ + *(*pthread_mutexattr_t)(unsafe.Pointer(a)) = pthread_mutexattr_t{} + return 0 +} + +func Xpthread_mutexattr_settype(tls *TLS, a uintptr, type1 int32) int32 { /* pthread_mutexattr_settype.c:3:5: */ + if uint32(type1) > uint32(2) { + return 22 + } + (*pthread_mutexattr_t)(unsafe.Pointer(a)).__attr = (((*pthread_mutexattr_t)(unsafe.Pointer(a)).__attr & Uint32FromInt32(CplInt32(3))) | uint32(type1)) + return 0 +} + var ts1 = "infinity\x00nan\x00\x00\x00\x01\x02\x04\a\x03\x06\x05\x00%d.%d.%d.%d.in-addr.arpa\x00ip6.arpa\x000123456789abcdef\x00/etc/hosts\x00rb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00%d.%d.%d.%d\x00%x:%x:%x:%x:%x:%x:%x:%x\x00%x:%x:%x:%x:%x:%x:%d.%d.%d.%d\x00:0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\x00\x00\x00 \x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data diff --git a/vendor/modernc.org/libc/musl_linux_s390x.go b/vendor/modernc.org/libc/musl_linux_s390x.go index 17a928106..48621b3bb 100644 --- a/vendor/modernc.org/libc/musl_linux_s390x.go +++ b/vendor/modernc.org/libc/musl_linux_s390x.go @@ -535,7 +535,7 @@ func Xopendir(tls *TLS, name uintptr) uintptr { /* opendir.c:8:5: */ return uintptr(0) } if !(int32(AssignUintptr(&dir, Xcalloc(tls, uint64(1), uint64(unsafe.Sizeof(DIR{}))))) != 0) { - X__syscall1(tls, int64(6), int64(fd)) + __syscall1(tls, int64(6), int64(fd)) return uintptr(0) } (*DIR)(unsafe.Pointer(dir)).fd = fd @@ -553,7 +553,7 @@ func Xreaddir(tls *TLS, dir uintptr) uintptr { /* readdir.c:10:15: */ var de uintptr if (*DIR)(unsafe.Pointer(dir)).buf_pos >= (*DIR)(unsafe.Pointer(dir)).buf_end { - var len int32 = int32(X__syscall3(tls, int64(220), int64((*DIR)(unsafe.Pointer(dir)).fd), int64(dir+24 /* &.buf */), int64(unsafe.Sizeof([2048]int8{})))) + var len int32 = int32(__syscall3(tls, int64(220), int64((*DIR)(unsafe.Pointer(dir)).fd), int64(dir+24 /* &.buf */), int64(unsafe.Sizeof([2048]int8{})))) if len <= 0 { if (len < 0) && (len != -2) { (*(*int32)(unsafe.Pointer(X___errno_location(tls)))) = -len @@ -2323,14 +2323,14 @@ func __wake(tls *TLS, addr uintptr, cnt int32, priv int32) { /* pthread_impl.h:1 if cnt < 0 { cnt = 0x7fffffff } - _ = (Bool32((X__syscall3(tls, int64(238), int64(AtomicLoadUintptr(&addr)), (int64(1|priv)), int64(cnt)) != int64(-38)) || (X__syscall3(tls, int64(238), int64(AtomicLoadUintptr(&addr)), int64(1), int64(cnt)) != 0))) + _ = (Bool32((__syscall3(tls, int64(238), int64(AtomicLoadUintptr(&addr)), (int64(1|priv)), int64(cnt)) != int64(-38)) || (__syscall3(tls, int64(238), int64(AtomicLoadUintptr(&addr)), int64(1), int64(cnt)) != 0))) } func __futexwait(tls *TLS, addr uintptr, val int32, priv int32) { /* pthread_impl.h:162:20: */ if priv != 0 { priv = 128 } - _ = (Bool32((X__syscall4(tls, int64(238), int64(AtomicLoadUintptr(&addr)), (int64(0|priv)), int64(val), int64(0)) != int64(-38)) || (X__syscall4(tls, int64(238), int64(AtomicLoadUintptr(&addr)), int64(0), int64(val), int64(0)) != 0))) + _ = (Bool32((__syscall4(tls, int64(238), int64(AtomicLoadUintptr(&addr)), (int64(0|priv)), int64(val), int64(0)) != int64(-38)) || (__syscall4(tls, int64(238), int64(AtomicLoadUintptr(&addr)), int64(0), int64(val), int64(0)) != 0))) } var X__fsmu8 = [51]uint32_t{ diff --git a/vendor/modernc.org/libc/netdb/capi_freebsd_amd64.go b/vendor/modernc.org/libc/netdb/capi_freebsd_amd64.go new file mode 100644 index 000000000..842c76a49 --- /dev/null +++ b/vendor/modernc.org/libc/netdb/capi_freebsd_amd64.go @@ -0,0 +1,5 @@ +// Code generated by 'ccgo netdb/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 netdb/netdb_freebsd_amd64.go -pkgname netdb', DO NOT EDIT. + +package netdb + +var CAPI = map[string]struct{}{} diff --git a/vendor/modernc.org/libc/netdb/netdb_freebsd_amd64.go b/vendor/modernc.org/libc/netdb/netdb_freebsd_amd64.go new file mode 100644 index 000000000..ce87b6868 --- /dev/null +++ b/vendor/modernc.org/libc/netdb/netdb_freebsd_amd64.go @@ -0,0 +1,721 @@ +// Code generated by 'ccgo netdb/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 netdb/netdb_freebsd_amd64.go -pkgname netdb', DO NOT EDIT. + +package netdb + +import ( + "math" + "reflect" + "sync/atomic" + "unsafe" +) + +var _ = math.Pi +var _ reflect.Kind +var _ atomic.Value +var _ unsafe.Pointer + +const ( + AI_ADDRCONFIG = 0x00000400 + AI_ALL = 0x00000100 + AI_CANONNAME = 0x00000002 + AI_DEFAULT = 1536 + AI_MASK = 3343 + AI_NUMERICHOST = 0x00000004 + AI_NUMERICSERV = 0x00000008 + AI_PASSIVE = 0x00000001 + AI_V4MAPPED = 0x00000800 + AI_V4MAPPED_CFG = 0x00000200 + EAI_AGAIN = 2 + EAI_BADFLAGS = 3 + EAI_BADHINTS = 12 + EAI_FAIL = 4 + EAI_FAMILY = 5 + EAI_MAX = 15 + EAI_MEMORY = 6 + EAI_NONAME = 8 + EAI_OVERFLOW = 14 + EAI_PROTOCOL = 13 + EAI_SERVICE = 9 + EAI_SOCKTYPE = 10 + EAI_SYSTEM = 11 + HOST_NOT_FOUND = 1 + IPPORT_RESERVED = 1024 + NETDB_INTERNAL = -1 + NETDB_SUCCESS = 0 + NI_DGRAM = 0x00000010 + NI_MAXHOST = 1025 + NI_MAXSERV = 32 + NI_NAMEREQD = 0x00000004 + NI_NOFQDN = 0x00000001 + NI_NUMERICHOST = 0x00000002 + NI_NUMERICSCOPE = 0x00000020 + NI_NUMERICSERV = 0x00000008 + NO_ADDRESS = 4 + NO_DATA = 4 + NO_RECOVERY = 3 + SCOPE_DELIMITER = 37 + TRY_AGAIN = 2 + X_FILE_OFFSET_BITS = 64 + X_IN_ADDR_T_DECLARED = 0 + X_IN_PORT_T_DECLARED = 0 + X_LP64 = 1 + X_MACHINE__LIMITS_H_ = 0 + X_MACHINE__TYPES_H_ = 0 + X_NETDB_H_ = 0 + X_Nonnull = 0 + X_Null_unspecified = 0 + X_Nullable = 0 + X_PATH_HEQUIV = "/etc/hosts.equiv" + X_PATH_HOSTS = "/etc/hosts" + X_PATH_NETWORKS = "/etc/networks" + X_PATH_PROTOCOLS = "/etc/protocols" + X_PATH_SERVICES = "/etc/services" + X_PATH_SERVICES_DB = "/var/db/services.db" + X_SIZE_T_DECLARED = 0 + X_SOCKLEN_T_DECLARED = 0 + X_SYS_CDEFS_H_ = 0 + X_SYS__TYPES_H_ = 0 + X_UINT32_T_DECLARED = 0 + Unix = 1 +) + +type Ptrdiff_t = int64 /* <builtin>:3:26 */ + +type Size_t = uint64 /* <builtin>:9:23 */ + +type Wchar_t = int32 /* <builtin>:15:24 */ + +type X__int128_t = struct { + Flo int64 + Fhi int64 +} /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128 +type X__uint128_t = struct { + Flo uint64 + Fhi uint64 +} /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128 + +type X__builtin_va_list = uintptr /* <builtin>:46:14 */ +type X__float128 = float64 /* <builtin>:47:21 */ + +// - +// SPDX-License-Identifier: (BSD-3-Clause AND ISC) +// +// Copyright (c) 1980, 1983, 1988, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// - +// Portions Copyright (c) 1993 by Digital Equipment Corporation. +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies, and that +// the name of Digital Equipment Corporation not be used in advertising or +// publicity pertaining to distribution of the document or software without +// specific, written prior permission. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL +// WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT +// CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL +// DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR +// PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS +// ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +// SOFTWARE. +// - +// --Copyright-- + +// @(#)netdb.h 8.1 (Berkeley) 6/2/93 +// From: Id: netdb.h,v 8.9 1996/11/19 08:39:29 vixie Exp $ +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// Testing against Clang-specific extensions. + +// This code has been put in place to help reduce the addition of +// compiler specific defines in FreeBSD code. It helps to aid in +// having a compiler-agnostic source tree. + +// Compiler memory barriers, specific to gcc and clang. + +// XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced + +// Macro to test if we're using a specific version of gcc or later. + +// The __CONCAT macro is used to concatenate parts of symbol names, e.g. +// with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. +// The __CONCAT macro is a bit tricky to use if it must work in non-ANSI +// mode -- there must be no spaces between its arguments, and for nested +// __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also +// concatenate double-quoted strings produced by the __STRING macro, but +// this only works with ANSI C. +// +// __XSTRING is like __STRING, but it expands any macros in its argument +// first. It is only available with ANSI C. + +// Compiler-dependent macros to help declare dead (non-returning) and +// pure (no side effects) functions, and unused variables. They are +// null except for versions of gcc that are known to support the features +// properly (old versions of gcc-2 supported the dead and pure features +// in a different (wrong) way). If we do not provide an implementation +// for a given compiler, let the compile fail if it is told to use +// a feature that we cannot live without. + +// Keywords added in C11. + +// Emulation of C11 _Generic(). Unlike the previously defined C11 +// keywords, it is not possible to implement this using exactly the same +// syntax. Therefore implement something similar under the name +// __generic(). Unlike _Generic(), this macro can only distinguish +// between a single type, so it requires nested invocations to +// distinguish multiple cases. + +// C99 Static array indices in function parameter declarations. Syntax such as: +// void bar(int myArray[static 10]); +// is allowed in C99 but not in C++. Define __min_size appropriately so +// headers using it can be compiled in either language. Use like this: +// void bar(int myArray[__min_size(10)]); + +// XXX: should use `#if __STDC_VERSION__ < 199901'. + +// C++11 exposes a load of C99 stuff + +// GCC 2.95 provides `__restrict' as an extension to C90 to support the +// C99-specific `restrict' type qualifier. We happen to use `__restrict' as +// a way to define the `restrict' type qualifier without disturbing older +// software that is unaware of C99 keywords. + +// GNU C version 2.96 adds explicit branch prediction so that +// the CPU back-end can hint the processor and also so that +// code blocks can be reordered such that the predicted path +// sees a more linear flow, thus improving cache behavior, etc. +// +// The following two macros provide us with a way to utilize this +// compiler feature. Use __predict_true() if you expect the expression +// to evaluate to true, and __predict_false() if you expect the +// expression to evaluate to false. +// +// A few notes about usage: +// +// * Generally, __predict_false() error condition checks (unless +// you have some _strong_ reason to do otherwise, in which case +// document it), and/or __predict_true() `no-error' condition +// checks, assuming you want to optimize for the no-error case. +// +// * Other than that, if you don't know the likelihood of a test +// succeeding from empirical or other `hard' evidence, don't +// make predictions. +// +// * These are meant to be used in places that are run `a lot'. +// It is wasteful to make predictions in code that is run +// seldomly (e.g. at subsystem initialization time) as the +// basic block reordering that this affects can often generate +// larger code. + +// We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h> +// require it. + +// Given the pointer x to the member m of the struct s, return +// a pointer to the containing structure. When using GCC, we first +// assign pointer x to a local variable, to check that its type is +// compatible with member m. + +// Compiler-dependent macros to declare that functions take printf-like +// or scanf-like arguments. They are null except for versions of gcc +// that are known to support the features properly (old versions of gcc-2 +// didn't permit keeping the keywords out of the application namespace). + +// Compiler-dependent macros that rely on FreeBSD-specific extensions. + +// Embed the rcs id of a source file in the resulting library. Note that in +// more recent ELF binutils, we use .ident allowing the ID to be stripped. +// Usage: +// __FBSDID("$FreeBSD$"); + +// - +// The following definitions are an extension of the behavior originally +// implemented in <sys/_posix.h>, but with a different level of granularity. +// POSIX.1 requires that the macros we test be defined before any standard +// header file is included. +// +// Here's a quick run-down of the versions: +// defined(_POSIX_SOURCE) 1003.1-1988 +// _POSIX_C_SOURCE == 1 1003.1-1990 +// _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option +// _POSIX_C_SOURCE == 199309 1003.1b-1993 +// _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, +// and the omnibus ISO/IEC 9945-1: 1996 +// _POSIX_C_SOURCE == 200112 1003.1-2001 +// _POSIX_C_SOURCE == 200809 1003.1-2008 +// +// In addition, the X/Open Portability Guide, which is now the Single UNIX +// Specification, defines a feature-test macro which indicates the version of +// that specification, and which subsumes _POSIX_C_SOURCE. +// +// Our macros begin with two underscores to avoid namespace screwage. + +// Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. + +// Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. + +// Deal with various X/Open Portability Guides and Single UNIX Spec. + +// Deal with all versions of POSIX. The ordering relative to the tests above is +// important. +// - +// Deal with _ANSI_SOURCE: +// If it is defined, and no other compilation environment is explicitly +// requested, then define our internal feature-test macros to zero. This +// makes no difference to the preprocessor (undefined symbols in preprocessing +// expressions are defined to have value zero), but makes it more convenient for +// a test program to print out the values. +// +// If a program mistakenly defines _ANSI_SOURCE and some other macro such as +// _POSIX_C_SOURCE, we will assume that it wants the broader compilation +// environment (and in fact we will never get here). + +// User override __EXT1_VISIBLE + +// Old versions of GCC use non-standard ARM arch symbols; acle-compat.h +// translates them to __ARM_ARCH and the modern feature symbols defined by ARM. + +// Nullability qualifiers: currently only supported by Clang. + +// Type Safety Checking +// +// Clang provides additional attributes to enable checking type safety +// properties that cannot be enforced by the C type system. + +// Lock annotations. +// +// Clang provides support for doing basic thread-safety tests at +// compile-time, by marking which locks will/should be held when +// entering/leaving a functions. +// +// Furthermore, it is also possible to annotate variables and structure +// members to enforce that they are only accessed when certain locks are +// held. + +// Structure implements a lock. + +// Function acquires an exclusive or shared lock. + +// Function attempts to acquire an exclusive or shared lock. + +// Function releases a lock. + +// Function asserts that an exclusive or shared lock is held. + +// Function requires that an exclusive or shared lock is or is not held. + +// Function should not be analyzed. + +// Function or variable should not be sanitized, i.e. by AddressSanitizer. +// GCC has the nosanitize attribute, but as a function attribute only, and +// warns on use as a variable attribute. + +// Guard variables and structure members by lock. + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-4-Clause +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// Copyright (c) 1990, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. All advertising materials mentioning features or use of this software +// must display the following acknowledgement: +// This product includes software developed by the University of +// California, Berkeley and its contributors. +// 4. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 +// From: @(#)types.h 8.3 (Berkeley) 1/5/94 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1988, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)limits.h 8.3 (Berkeley) 1/4/94 +// $FreeBSD$ + +// According to ANSI (section 2.2.4.2), the values below must be usable by +// #if preprocessing directives. Additionally, the expression must have the +// same type as would an expression that is an object of the corresponding +// type converted according to the integral promotions. The subtraction for +// INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an +// unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). + +// max value for an unsigned long long + +// Quads and longs are the same on the amd64. Ensure they stay in sync. + +// Minimum signal stack size. + +// Basic types upon which most other types are built. +type X__int8_t = int8 /* _types.h:55:22 */ +type X__uint8_t = uint8 /* _types.h:56:24 */ +type X__int16_t = int16 /* _types.h:57:17 */ +type X__uint16_t = uint16 /* _types.h:58:25 */ +type X__int32_t = int32 /* _types.h:59:15 */ +type X__uint32_t = uint32 /* _types.h:60:23 */ +type X__int64_t = int64 /* _types.h:62:16 */ +type X__uint64_t = uint64 /* _types.h:63:24 */ + +// Standard type definitions. +type X__clock_t = X__int32_t /* _types.h:75:19 */ // clock()... +type X__critical_t = X__int64_t /* _types.h:76:19 */ +type X__double_t = float64 /* _types.h:78:17 */ +type X__float_t = float32 /* _types.h:79:16 */ +type X__intfptr_t = X__int64_t /* _types.h:81:19 */ +type X__intptr_t = X__int64_t /* _types.h:82:19 */ +type X__intmax_t = X__int64_t /* _types.h:93:19 */ +type X__int_fast8_t = X__int32_t /* _types.h:94:19 */ +type X__int_fast16_t = X__int32_t /* _types.h:95:19 */ +type X__int_fast32_t = X__int32_t /* _types.h:96:19 */ +type X__int_fast64_t = X__int64_t /* _types.h:97:19 */ +type X__int_least8_t = X__int8_t /* _types.h:98:18 */ +type X__int_least16_t = X__int16_t /* _types.h:99:19 */ +type X__int_least32_t = X__int32_t /* _types.h:100:19 */ +type X__int_least64_t = X__int64_t /* _types.h:101:19 */ +type X__ptrdiff_t = X__int64_t /* _types.h:103:19 */ // ptr1 - ptr2 +type X__register_t = X__int64_t /* _types.h:104:19 */ +type X__segsz_t = X__int64_t /* _types.h:105:19 */ // segment size (in pages) +type X__size_t = X__uint64_t /* _types.h:106:20 */ // sizeof() +type X__ssize_t = X__int64_t /* _types.h:107:19 */ // byte count or error +type X__time_t = X__int64_t /* _types.h:108:19 */ // time()... +type X__uintfptr_t = X__uint64_t /* _types.h:109:20 */ +type X__uintptr_t = X__uint64_t /* _types.h:110:20 */ +type X__uintmax_t = X__uint64_t /* _types.h:121:20 */ +type X__uint_fast8_t = X__uint32_t /* _types.h:122:20 */ +type X__uint_fast16_t = X__uint32_t /* _types.h:123:20 */ +type X__uint_fast32_t = X__uint32_t /* _types.h:124:20 */ +type X__uint_fast64_t = X__uint64_t /* _types.h:125:20 */ +type X__uint_least8_t = X__uint8_t /* _types.h:126:19 */ +type X__uint_least16_t = X__uint16_t /* _types.h:127:20 */ +type X__uint_least32_t = X__uint32_t /* _types.h:128:20 */ +type X__uint_least64_t = X__uint64_t /* _types.h:129:20 */ +type X__u_register_t = X__uint64_t /* _types.h:131:20 */ +type X__vm_offset_t = X__uint64_t /* _types.h:132:20 */ +type X__vm_paddr_t = X__uint64_t /* _types.h:133:20 */ +type X__vm_size_t = X__uint64_t /* _types.h:134:20 */ +type X___wchar_t = int32 /* _types.h:141:14 */ + +// Standard type definitions. +type X__blksize_t = X__int32_t /* _types.h:40:19 */ // file block size +type X__blkcnt_t = X__int64_t /* _types.h:41:19 */ // file block count +type X__clockid_t = X__int32_t /* _types.h:42:19 */ // clock_gettime()... +type X__fflags_t = X__uint32_t /* _types.h:43:20 */ // file flags +type X__fsblkcnt_t = X__uint64_t /* _types.h:44:20 */ +type X__fsfilcnt_t = X__uint64_t /* _types.h:45:20 */ +type X__gid_t = X__uint32_t /* _types.h:46:20 */ +type X__id_t = X__int64_t /* _types.h:47:19 */ // can hold a gid_t, pid_t, or uid_t +type X__ino_t = X__uint64_t /* _types.h:48:20 */ // inode number +type X__key_t = int64 /* _types.h:49:15 */ // IPC key (for Sys V IPC) +type X__lwpid_t = X__int32_t /* _types.h:50:19 */ // Thread ID (a.k.a. LWP) +type X__mode_t = X__uint16_t /* _types.h:51:20 */ // permissions +type X__accmode_t = int32 /* _types.h:52:14 */ // access permissions +type X__nl_item = int32 /* _types.h:53:14 */ +type X__nlink_t = X__uint64_t /* _types.h:54:20 */ // link count +type X__off_t = X__int64_t /* _types.h:55:19 */ // file offset +type X__off64_t = X__int64_t /* _types.h:56:19 */ // file offset (alias) +type X__pid_t = X__int32_t /* _types.h:57:19 */ // process [group] +type X__rlim_t = X__int64_t /* _types.h:58:19 */ // resource limit - intentionally +// signed, because of legacy code +// that uses -1 for RLIM_INFINITY +type X__sa_family_t = X__uint8_t /* _types.h:61:19 */ +type X__socklen_t = X__uint32_t /* _types.h:62:20 */ +type X__suseconds_t = int64 /* _types.h:63:15 */ // microseconds (signed) +type X__timer_t = uintptr /* _types.h:64:24 */ // timer_gettime()... +type X__mqd_t = uintptr /* _types.h:65:21 */ // mq_open()... +type X__uid_t = X__uint32_t /* _types.h:66:20 */ +type X__useconds_t = uint32 /* _types.h:67:22 */ // microseconds (unsigned) +type X__cpuwhich_t = int32 /* _types.h:68:14 */ // which parameter for cpuset. +type X__cpulevel_t = int32 /* _types.h:69:14 */ // level parameter for cpuset. +type X__cpusetid_t = int32 /* _types.h:70:14 */ // cpuset identifier. +type X__daddr_t = X__int64_t /* _types.h:71:19 */ // bwrite(3), FIOBMAP2, etc + +// Unusual type definitions. +// rune_t is declared to be an ``int'' instead of the more natural +// ``unsigned long'' or ``long''. Two things are happening here. It is not +// unsigned so that EOF (-1) can be naturally assigned to it and used. Also, +// it looks like 10646 will be a 31 bit standard. This means that if your +// ints cannot hold 32 bits, you will be in trouble. The reason an int was +// chosen over a long is that the is*() and to*() routines take ints (says +// ANSI C), but they use __ct_rune_t instead of int. +// +// NOTE: rune_t is not covered by ANSI nor other standards, and should not +// be instantiated outside of lib/libc/locale. Use wchar_t. wint_t and +// rune_t must be the same type. Also, wint_t should be able to hold all +// members of the largest character set plus one extra value (WEOF), and +// must be at least 16 bits. +type X__ct_rune_t = int32 /* _types.h:91:14 */ // arg type for ctype funcs +type X__rune_t = X__ct_rune_t /* _types.h:92:21 */ // rune_t (see above) +type X__wint_t = X__ct_rune_t /* _types.h:93:21 */ // wint_t (see above) + +// Clang already provides these types as built-ins, but only in C++ mode. +type X__char16_t = X__uint_least16_t /* _types.h:97:26 */ +type X__char32_t = X__uint_least32_t /* _types.h:98:26 */ +// In C++11, char16_t and char32_t are built-in types. + +type X__max_align_t = struct { + F__max_align1 int64 + F__max_align2 float64 +} /* _types.h:111:3 */ + +type X__dev_t = X__uint64_t /* _types.h:113:20 */ // device number + +type X__fixpt_t = X__uint32_t /* _types.h:115:20 */ // fixed point number + +// mbstate_t is an opaque object to keep conversion state during multibyte +// stream conversions. +type X__mbstate_t = struct { + _ [0]uint64 + F__mbstate8 [128]int8 +} /* _types.h:124:3 */ + +type X__rman_res_t = X__uintmax_t /* _types.h:126:25 */ + +// Types for varargs. These are all provided by builtin types these +// days, so centralize their definition. +type X__va_list = X__builtin_va_list /* _types.h:133:27 */ // internally known to gcc +type X__gnuc_va_list = X__va_list /* _types.h:140:20 */ // compatibility w/GNU headers + +// When the following macro is defined, the system uses 64-bit inode numbers. +// Programs can use this to avoid including <sys/param.h>, with its associated +// namespace pollution. + +type In_addr_t = X__uint32_t /* netdb.h:66:20 */ + +type In_port_t = X__uint16_t /* netdb.h:71:20 */ + +type Socklen_t = X__socklen_t /* netdb.h:81:21 */ + +type Uint32_t = X__uint32_t /* netdb.h:86:20 */ + +// Structures returned by network data base library. All addresses are +// supplied in host order, and returned in network order (suitable for +// use in system calls). +type Hostent = struct { + Fh_name uintptr + Fh_aliases uintptr + Fh_addrtype int32 + Fh_length int32 + Fh_addr_list uintptr +} /* netdb.h:106:1 */ + +type Netent = struct { + Fn_name uintptr + Fn_aliases uintptr + Fn_addrtype int32 + Fn_net Uint32_t +} /* netdb.h:115:1 */ + +type Servent = struct { + Fs_name uintptr + Fs_aliases uintptr + Fs_port int32 + _ [4]byte + Fs_proto uintptr +} /* netdb.h:122:1 */ + +type Protoent = struct { + Fp_name uintptr + Fp_aliases uintptr + Fp_proto int32 + _ [4]byte +} /* netdb.h:129:1 */ + +type Addrinfo = struct { + Fai_flags int32 + Fai_family int32 + Fai_socktype int32 + Fai_protocol int32 + Fai_addrlen Socklen_t + _ [4]byte + Fai_canonname uintptr + Fai_addr uintptr + Fai_next uintptr +} /* netdb.h:135:1 */ + +var _ int8 /* gen.c:2:13: */ diff --git a/vendor/modernc.org/libc/netinet/in/capi_freebsd_amd64.go b/vendor/modernc.org/libc/netinet/in/capi_freebsd_amd64.go new file mode 100644 index 000000000..722fc683b --- /dev/null +++ b/vendor/modernc.org/libc/netinet/in/capi_freebsd_amd64.go @@ -0,0 +1,5 @@ +// Code generated by 'ccgo netinet/in/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 netinet/in/in_freebsd_amd64.go -pkgname in', DO NOT EDIT. + +package in + +var CAPI = map[string]struct{}{} diff --git a/vendor/modernc.org/libc/netinet/in/in_freebsd_amd64.go b/vendor/modernc.org/libc/netinet/in/in_freebsd_amd64.go new file mode 100644 index 000000000..f7df467cd --- /dev/null +++ b/vendor/modernc.org/libc/netinet/in/in_freebsd_amd64.go @@ -0,0 +1,1524 @@ +// Code generated by 'ccgo netinet/in/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 netinet/in/in_freebsd_amd64.go -pkgname in', DO NOT EDIT. + +package in + +import ( + "math" + "reflect" + "sync/atomic" + "unsafe" +) + +var _ = math.Pi +var _ reflect.Kind +var _ atomic.Value +var _ unsafe.Pointer + +const ( + BIG_ENDIAN = 4321 + BYTE_ORDER = 1234 + ICMP6_FILTER = 18 + ICMPV6CTL_ND6_ONLINKNSRFC4861 = 47 + INET6_ADDRSTRLEN = 46 + INET_ADDRSTRLEN = 16 + IN_CLASSA_HOST = 0x00ffffff + IN_CLASSA_MAX = 128 + IN_CLASSA_NET = 0xff000000 + IN_CLASSA_NSHIFT = 24 + IN_CLASSB_HOST = 0x0000ffff + IN_CLASSB_MAX = 65536 + IN_CLASSB_NET = 0xffff0000 + IN_CLASSB_NSHIFT = 16 + IN_CLASSC_HOST = 0x000000ff + IN_CLASSC_NET = 0xffffff00 + IN_CLASSC_NSHIFT = 8 + IN_CLASSD_HOST = 0x0fffffff + IN_CLASSD_NET = 0xf0000000 + IN_CLASSD_NSHIFT = 28 + IN_LOOPBACKNET = 127 + IPCTL_ACCEPTSOURCEROUTE = 13 + IPCTL_DEFTTL = 3 + IPCTL_DIRECTEDBROADCAST = 9 + IPCTL_FASTFORWARDING = 14 + IPCTL_FORWARDING = 1 + IPCTL_GIF_TTL = 16 + IPCTL_INTRDQDROPS = 18 + IPCTL_INTRDQMAXLEN = 17 + IPCTL_INTRQDROPS = 11 + IPCTL_INTRQMAXLEN = 10 + IPCTL_SENDREDIRECTS = 2 + IPCTL_SOURCEROUTE = 8 + IPCTL_STATS = 12 + IPPORT_EPHEMERALFIRST = 10000 + IPPORT_EPHEMERALLAST = 65535 + IPPORT_HIFIRSTAUTO = 49152 + IPPORT_HILASTAUTO = 65535 + IPPORT_MAX = 65535 + IPPORT_RESERVED = 1024 + IPPORT_RESERVEDSTART = 600 + IPPROTO_3PC = 34 + IPPROTO_ADFS = 68 + IPPROTO_AH = 51 + IPPROTO_AHIP = 61 + IPPROTO_APES = 99 + IPPROTO_ARGUS = 13 + IPPROTO_AX25 = 93 + IPPROTO_BHA = 49 + IPPROTO_BLT = 30 + IPPROTO_BRSATMON = 76 + IPPROTO_CARP = 112 + IPPROTO_CFTP = 62 + IPPROTO_CHAOS = 16 + IPPROTO_CMTP = 38 + IPPROTO_CPHB = 73 + IPPROTO_CPNX = 72 + IPPROTO_DCCP = 33 + IPPROTO_DDP = 37 + IPPROTO_DGP = 86 + IPPROTO_DIVERT = 258 + IPPROTO_DONE = 257 + IPPROTO_DSTOPTS = 60 + IPPROTO_EGP = 8 + IPPROTO_EMCON = 14 + IPPROTO_ENCAP = 98 + IPPROTO_EON = 80 + IPPROTO_ESP = 50 + IPPROTO_ETHERIP = 97 + IPPROTO_FRAGMENT = 44 + IPPROTO_GGP = 3 + IPPROTO_GMTP = 100 + IPPROTO_GRE = 47 + IPPROTO_HELLO = 63 + IPPROTO_HIP = 139 + IPPROTO_HMP = 20 + IPPROTO_HOPOPTS = 0 + IPPROTO_ICMP = 1 + IPPROTO_ICMPV6 = 58 + IPPROTO_IDP = 22 + IPPROTO_IDPR = 35 + IPPROTO_IDRP = 45 + IPPROTO_IGMP = 2 + IPPROTO_IGP = 85 + IPPROTO_IGRP = 88 + IPPROTO_IL = 40 + IPPROTO_INLSP = 52 + IPPROTO_INP = 32 + IPPROTO_IP = 0 + IPPROTO_IPCOMP = 108 + IPPROTO_IPCV = 71 + IPPROTO_IPEIP = 94 + IPPROTO_IPIP = 4 + IPPROTO_IPPC = 67 + IPPROTO_IPV4 = 4 + IPPROTO_IPV6 = 41 + IPPROTO_IRTP = 28 + IPPROTO_KRYPTOLAN = 65 + IPPROTO_LARP = 91 + IPPROTO_LEAF1 = 25 + IPPROTO_LEAF2 = 26 + IPPROTO_MAX = 256 + IPPROTO_MEAS = 19 + IPPROTO_MH = 135 + IPPROTO_MHRP = 48 + IPPROTO_MICP = 95 + IPPROTO_MOBILE = 55 + IPPROTO_MPLS = 137 + IPPROTO_MTP = 92 + IPPROTO_MUX = 18 + IPPROTO_ND = 77 + IPPROTO_NHRP = 54 + IPPROTO_NONE = 59 + IPPROTO_NSP = 31 + IPPROTO_NVPII = 11 + IPPROTO_OLD_DIVERT = 254 + IPPROTO_OSPFIGP = 89 + IPPROTO_PFSYNC = 240 + IPPROTO_PGM = 113 + IPPROTO_PIGP = 9 + IPPROTO_PIM = 103 + IPPROTO_PRM = 21 + IPPROTO_PUP = 12 + IPPROTO_PVP = 75 + IPPROTO_RAW = 255 + IPPROTO_RCCMON = 10 + IPPROTO_RDP = 27 + IPPROTO_RESERVED_253 = 253 + IPPROTO_RESERVED_254 = 254 + IPPROTO_ROUTING = 43 + IPPROTO_RSVP = 46 + IPPROTO_RVD = 66 + IPPROTO_SATEXPAK = 64 + IPPROTO_SATMON = 69 + IPPROTO_SCCSP = 96 + IPPROTO_SCTP = 132 + IPPROTO_SDRP = 42 + IPPROTO_SEND = 259 + IPPROTO_SHIM6 = 140 + IPPROTO_SKIP = 57 + IPPROTO_SPACER = 32767 + IPPROTO_SRPC = 90 + IPPROTO_ST = 7 + IPPROTO_SVMTP = 82 + IPPROTO_SWIPE = 53 + IPPROTO_TCF = 87 + IPPROTO_TCP = 6 + IPPROTO_TLSP = 56 + IPPROTO_TP = 29 + IPPROTO_TPXX = 39 + IPPROTO_TRUNK1 = 23 + IPPROTO_TRUNK2 = 24 + IPPROTO_TTP = 84 + IPPROTO_UDP = 17 + IPPROTO_UDPLITE = 136 + IPPROTO_VINES = 83 + IPPROTO_VISA = 70 + IPPROTO_VMTP = 81 + IPPROTO_WBEXPAK = 79 + IPPROTO_WBMON = 78 + IPPROTO_WSN = 74 + IPPROTO_XNET = 15 + IPPROTO_XTP = 36 + IPV6CTL_ACCEPT_RTADV = 12 + IPV6CTL_ADDRCTLPOLICY = 38 + IPV6CTL_AUTO_FLOWLABEL = 17 + IPV6CTL_AUTO_LINKLOCAL = 35 + IPV6CTL_DAD_COUNT = 16 + IPV6CTL_DEFHLIM = 3 + IPV6CTL_DEFMCASTHLIM = 18 + IPV6CTL_FORWARDING = 1 + IPV6CTL_FORWSRCRT = 5 + IPV6CTL_GIF_HLIM = 19 + IPV6CTL_HDRNESTLIMIT = 15 + IPV6CTL_INTRDQMAXLEN = 52 + IPV6CTL_INTRQMAXLEN = 51 + IPV6CTL_KAME_VERSION = 20 + IPV6CTL_LOG_INTERVAL = 14 + IPV6CTL_MAXFRAGBUCKETSIZE = 54 + IPV6CTL_MAXFRAGPACKETS = 9 + IPV6CTL_MAXFRAGS = 41 + IPV6CTL_MAXFRAGSPERPACKET = 53 + IPV6CTL_MAXID = 55 + IPV6CTL_MCAST_PMTU = 44 + IPV6CTL_MRTPROTO = 8 + IPV6CTL_MRTSTATS = 7 + IPV6CTL_NORBIT_RAIF = 49 + IPV6CTL_NO_RADR = 48 + IPV6CTL_PREFER_TEMPADDR = 37 + IPV6CTL_RFC6204W3 = 50 + IPV6CTL_RIP6STATS = 36 + IPV6CTL_RR_PRUNE = 22 + IPV6CTL_SENDREDIRECTS = 2 + IPV6CTL_SOURCECHECK = 10 + IPV6CTL_SOURCECHECK_LOGINT = 11 + IPV6CTL_STATS = 6 + IPV6CTL_STEALTH = 45 + IPV6CTL_TEMPPLTIME = 33 + IPV6CTL_TEMPVLTIME = 34 + IPV6CTL_USETEMPADDR = 32 + IPV6CTL_USE_DEFAULTZONE = 39 + IPV6CTL_USE_DEPRECATED = 21 + IPV6CTL_V6ONLY = 24 + IPV6PORT_ANONMAX = 65535 + IPV6PORT_ANONMIN = 49152 + IPV6PORT_RESERVED = 1024 + IPV6PORT_RESERVEDMAX = 1023 + IPV6PORT_RESERVEDMIN = 600 + IPV6PROTO_MAXID = 104 + IPV6_AUTOFLOWLABEL = 59 + IPV6_BINDANY = 64 + IPV6_BINDMULTI = 65 + IPV6_BINDV6ONLY = 27 + IPV6_CHECKSUM = 26 + IPV6_DEFAULT_MULTICAST_HOPS = 1 + IPV6_DEFAULT_MULTICAST_LOOP = 1 + IPV6_DONTFRAG = 62 + IPV6_DSTOPTS = 50 + IPV6_FLOWID = 67 + IPV6_FLOWTYPE = 68 + IPV6_FW_ADD = 30 + IPV6_FW_DEL = 31 + IPV6_FW_FLUSH = 32 + IPV6_FW_GET = 34 + IPV6_FW_ZERO = 33 + IPV6_HOPLIMIT = 47 + IPV6_HOPOPTS = 49 + IPV6_IPSEC_POLICY = 28 + IPV6_JOIN_GROUP = 12 + IPV6_LEAVE_GROUP = 13 + IPV6_MAX_GROUP_SRC_FILTER = 512 + IPV6_MAX_MEMBERSHIPS = 4095 + IPV6_MAX_SOCK_SRC_FILTER = 128 + IPV6_MSFILTER = 74 + IPV6_MULTICAST_HOPS = 10 + IPV6_MULTICAST_IF = 9 + IPV6_MULTICAST_LOOP = 11 + IPV6_NEXTHOP = 48 + IPV6_ORIGDSTADDR = 72 + IPV6_PATHMTU = 44 + IPV6_PKTINFO = 46 + IPV6_PORTRANGE = 14 + IPV6_PORTRANGE_DEFAULT = 0 + IPV6_PORTRANGE_HIGH = 1 + IPV6_PORTRANGE_LOW = 2 + IPV6_PREFER_TEMPADDR = 63 + IPV6_RECVDSTOPTS = 40 + IPV6_RECVFLOWID = 70 + IPV6_RECVHOPLIMIT = 37 + IPV6_RECVHOPOPTS = 39 + IPV6_RECVORIGDSTADDR = 72 + IPV6_RECVPATHMTU = 43 + IPV6_RECVPKTINFO = 36 + IPV6_RECVRSSBUCKETID = 71 + IPV6_RECVRTHDR = 38 + IPV6_RECVTCLASS = 57 + IPV6_RSSBUCKETID = 69 + IPV6_RSS_LISTEN_BUCKET = 66 + IPV6_RTHDR = 51 + IPV6_RTHDRDSTOPTS = 35 + IPV6_RTHDR_LOOSE = 0 + IPV6_RTHDR_STRICT = 1 + IPV6_RTHDR_TYPE_0 = 0 + IPV6_SOCKOPT_RESERVED1 = 3 + IPV6_TCLASS = 61 + IPV6_UNICAST_HOPS = 4 + IPV6_USE_MIN_MTU = 42 + IPV6_V6ONLY = 27 + IPV6_VLAN_PCP = 75 + IP_ADD_MEMBERSHIP = 12 + IP_ADD_SOURCE_MEMBERSHIP = 70 + IP_BINDANY = 24 + IP_BINDMULTI = 25 + IP_BLOCK_SOURCE = 72 + IP_DEFAULT_MULTICAST_LOOP = 1 + IP_DEFAULT_MULTICAST_TTL = 1 + IP_DONTFRAG = 67 + IP_DROP_MEMBERSHIP = 13 + IP_DROP_SOURCE_MEMBERSHIP = 71 + IP_DUMMYNET3 = 49 + IP_DUMMYNET_CONFIGURE = 60 + IP_DUMMYNET_DEL = 61 + IP_DUMMYNET_FLUSH = 62 + IP_DUMMYNET_GET = 64 + IP_FLOWID = 90 + IP_FLOWTYPE = 91 + IP_FW3 = 48 + IP_FW_ADD = 50 + IP_FW_DEL = 51 + IP_FW_FLUSH = 52 + IP_FW_GET = 54 + IP_FW_NAT_CFG = 56 + IP_FW_NAT_DEL = 57 + IP_FW_NAT_GET_CONFIG = 58 + IP_FW_NAT_GET_LOG = 59 + IP_FW_RESETLOG = 55 + IP_FW_TABLE_ADD = 40 + IP_FW_TABLE_DEL = 41 + IP_FW_TABLE_FLUSH = 42 + IP_FW_TABLE_GETSIZE = 43 + IP_FW_TABLE_LIST = 44 + IP_FW_ZERO = 53 + IP_HDRINCL = 2 + IP_IPSEC_POLICY = 21 + IP_MAX_GROUP_SRC_FILTER = 512 + IP_MAX_MEMBERSHIPS = 4095 + IP_MAX_SOCK_MUTE_FILTER = 128 + IP_MAX_SOCK_SRC_FILTER = 128 + IP_MINTTL = 66 + IP_MSFILTER = 74 + IP_MULTICAST_IF = 9 + IP_MULTICAST_LOOP = 11 + IP_MULTICAST_TTL = 10 + IP_MULTICAST_VIF = 14 + IP_ONESBCAST = 23 + IP_OPTIONS = 1 + IP_ORIGDSTADDR = 27 + IP_PORTRANGE = 19 + IP_PORTRANGE_DEFAULT = 0 + IP_PORTRANGE_HIGH = 1 + IP_PORTRANGE_LOW = 2 + IP_RECVDSTADDR = 7 + IP_RECVFLOWID = 93 + IP_RECVIF = 20 + IP_RECVOPTS = 5 + IP_RECVORIGDSTADDR = 27 + IP_RECVRETOPTS = 6 + IP_RECVRSSBUCKETID = 94 + IP_RECVTOS = 68 + IP_RECVTTL = 65 + IP_RETOPTS = 8 + IP_RSSBUCKETID = 92 + IP_RSS_LISTEN_BUCKET = 26 + IP_RSVP_OFF = 16 + IP_RSVP_ON = 15 + IP_RSVP_VIF_OFF = 18 + IP_RSVP_VIF_ON = 17 + IP_SENDSRCADDR = 7 + IP_TOS = 3 + IP_TTL = 4 + IP_UNBLOCK_SOURCE = 73 + IP_VLAN_PCP = 75 + LITTLE_ENDIAN = 1234 + MCAST_BLOCK_SOURCE = 84 + MCAST_EXCLUDE = 2 + MCAST_INCLUDE = 1 + MCAST_JOIN_GROUP = 80 + MCAST_JOIN_SOURCE_GROUP = 82 + MCAST_LEAVE_GROUP = 81 + MCAST_LEAVE_SOURCE_GROUP = 83 + MCAST_UNBLOCK_SOURCE = 85 + MCAST_UNDEFINED = 0 + PDP_ENDIAN = 3412 + SIN6_LEN = 0 + X_BIG_ENDIAN = 4321 + X_BYTEORDER_FUNC_DEFINED = 0 + X_BYTEORDER_PROTOTYPED = 0 + X_BYTE_ORDER = 1234 + X_FILE_OFFSET_BITS = 64 + X_IN_ADDR_T_DECLARED = 0 + X_IN_PORT_T_DECLARED = 0 + X_LITTLE_ENDIAN = 1234 + X_LP64 = 1 + X_MACHINE_ENDIAN_H_ = 0 + X_MACHINE__LIMITS_H_ = 0 + X_MACHINE__TYPES_H_ = 0 + X_NETINET6_IN6_H_ = 0 + X_NETINET_IN_H_ = 0 + X_Nonnull = 0 + X_Null_unspecified = 0 + X_Nullable = 0 + X_PDP_ENDIAN = 3412 + X_QUAD_HIGHWORD = 1 + X_QUAD_LOWWORD = 0 + X_SA_FAMILY_T_DECLARED = 0 + X_SIZE_T_DECLARED = 0 + X_SOCKLEN_T_DECLARED = 0 + X_SS_MAXSIZE = 128 + X_STRUCT_IN_ADDR_DECLARED = 0 + X_SYS_CDEFS_H_ = 0 + X_SYS__SOCKADDR_STORAGE_H_ = 0 + X_SYS__TYPES_H_ = 0 + X_UINT16_T_DECLARED = 0 + X_UINT32_T_DECLARED = 0 + X_UINT8_T_DECLARED = 0 + Unix = 1 +) + +type Ptrdiff_t = int64 /* <builtin>:3:26 */ + +type Size_t = uint64 /* <builtin>:9:23 */ + +type Wchar_t = int32 /* <builtin>:15:24 */ + +type X__int128_t = struct { + Flo int64 + Fhi int64 +} /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128 +type X__uint128_t = struct { + Flo uint64 + Fhi uint64 +} /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128 + +type X__builtin_va_list = uintptr /* <builtin>:46:14 */ +type X__float128 = float64 /* <builtin>:47:21 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1990, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)in.h 8.3 (Berkeley) 1/3/94 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// Testing against Clang-specific extensions. + +// This code has been put in place to help reduce the addition of +// compiler specific defines in FreeBSD code. It helps to aid in +// having a compiler-agnostic source tree. + +// Compiler memory barriers, specific to gcc and clang. + +// XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced + +// Macro to test if we're using a specific version of gcc or later. + +// The __CONCAT macro is used to concatenate parts of symbol names, e.g. +// with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. +// The __CONCAT macro is a bit tricky to use if it must work in non-ANSI +// mode -- there must be no spaces between its arguments, and for nested +// __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also +// concatenate double-quoted strings produced by the __STRING macro, but +// this only works with ANSI C. +// +// __XSTRING is like __STRING, but it expands any macros in its argument +// first. It is only available with ANSI C. + +// Compiler-dependent macros to help declare dead (non-returning) and +// pure (no side effects) functions, and unused variables. They are +// null except for versions of gcc that are known to support the features +// properly (old versions of gcc-2 supported the dead and pure features +// in a different (wrong) way). If we do not provide an implementation +// for a given compiler, let the compile fail if it is told to use +// a feature that we cannot live without. + +// Keywords added in C11. + +// Emulation of C11 _Generic(). Unlike the previously defined C11 +// keywords, it is not possible to implement this using exactly the same +// syntax. Therefore implement something similar under the name +// __generic(). Unlike _Generic(), this macro can only distinguish +// between a single type, so it requires nested invocations to +// distinguish multiple cases. + +// C99 Static array indices in function parameter declarations. Syntax such as: +// void bar(int myArray[static 10]); +// is allowed in C99 but not in C++. Define __min_size appropriately so +// headers using it can be compiled in either language. Use like this: +// void bar(int myArray[__min_size(10)]); + +// XXX: should use `#if __STDC_VERSION__ < 199901'. + +// C++11 exposes a load of C99 stuff + +// GCC 2.95 provides `__restrict' as an extension to C90 to support the +// C99-specific `restrict' type qualifier. We happen to use `__restrict' as +// a way to define the `restrict' type qualifier without disturbing older +// software that is unaware of C99 keywords. + +// GNU C version 2.96 adds explicit branch prediction so that +// the CPU back-end can hint the processor and also so that +// code blocks can be reordered such that the predicted path +// sees a more linear flow, thus improving cache behavior, etc. +// +// The following two macros provide us with a way to utilize this +// compiler feature. Use __predict_true() if you expect the expression +// to evaluate to true, and __predict_false() if you expect the +// expression to evaluate to false. +// +// A few notes about usage: +// +// * Generally, __predict_false() error condition checks (unless +// you have some _strong_ reason to do otherwise, in which case +// document it), and/or __predict_true() `no-error' condition +// checks, assuming you want to optimize for the no-error case. +// +// * Other than that, if you don't know the likelihood of a test +// succeeding from empirical or other `hard' evidence, don't +// make predictions. +// +// * These are meant to be used in places that are run `a lot'. +// It is wasteful to make predictions in code that is run +// seldomly (e.g. at subsystem initialization time) as the +// basic block reordering that this affects can often generate +// larger code. + +// We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h> +// require it. + +// Given the pointer x to the member m of the struct s, return +// a pointer to the containing structure. When using GCC, we first +// assign pointer x to a local variable, to check that its type is +// compatible with member m. + +// Compiler-dependent macros to declare that functions take printf-like +// or scanf-like arguments. They are null except for versions of gcc +// that are known to support the features properly (old versions of gcc-2 +// didn't permit keeping the keywords out of the application namespace). + +// Compiler-dependent macros that rely on FreeBSD-specific extensions. + +// Embed the rcs id of a source file in the resulting library. Note that in +// more recent ELF binutils, we use .ident allowing the ID to be stripped. +// Usage: +// __FBSDID("$FreeBSD$"); + +// - +// The following definitions are an extension of the behavior originally +// implemented in <sys/_posix.h>, but with a different level of granularity. +// POSIX.1 requires that the macros we test be defined before any standard +// header file is included. +// +// Here's a quick run-down of the versions: +// defined(_POSIX_SOURCE) 1003.1-1988 +// _POSIX_C_SOURCE == 1 1003.1-1990 +// _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option +// _POSIX_C_SOURCE == 199309 1003.1b-1993 +// _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, +// and the omnibus ISO/IEC 9945-1: 1996 +// _POSIX_C_SOURCE == 200112 1003.1-2001 +// _POSIX_C_SOURCE == 200809 1003.1-2008 +// +// In addition, the X/Open Portability Guide, which is now the Single UNIX +// Specification, defines a feature-test macro which indicates the version of +// that specification, and which subsumes _POSIX_C_SOURCE. +// +// Our macros begin with two underscores to avoid namespace screwage. + +// Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. + +// Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. + +// Deal with various X/Open Portability Guides and Single UNIX Spec. + +// Deal with all versions of POSIX. The ordering relative to the tests above is +// important. +// - +// Deal with _ANSI_SOURCE: +// If it is defined, and no other compilation environment is explicitly +// requested, then define our internal feature-test macros to zero. This +// makes no difference to the preprocessor (undefined symbols in preprocessing +// expressions are defined to have value zero), but makes it more convenient for +// a test program to print out the values. +// +// If a program mistakenly defines _ANSI_SOURCE and some other macro such as +// _POSIX_C_SOURCE, we will assume that it wants the broader compilation +// environment (and in fact we will never get here). + +// User override __EXT1_VISIBLE + +// Old versions of GCC use non-standard ARM arch symbols; acle-compat.h +// translates them to __ARM_ARCH and the modern feature symbols defined by ARM. + +// Nullability qualifiers: currently only supported by Clang. + +// Type Safety Checking +// +// Clang provides additional attributes to enable checking type safety +// properties that cannot be enforced by the C type system. + +// Lock annotations. +// +// Clang provides support for doing basic thread-safety tests at +// compile-time, by marking which locks will/should be held when +// entering/leaving a functions. +// +// Furthermore, it is also possible to annotate variables and structure +// members to enforce that they are only accessed when certain locks are +// held. + +// Structure implements a lock. + +// Function acquires an exclusive or shared lock. + +// Function attempts to acquire an exclusive or shared lock. + +// Function releases a lock. + +// Function asserts that an exclusive or shared lock is held. + +// Function requires that an exclusive or shared lock is or is not held. + +// Function should not be analyzed. + +// Function or variable should not be sanitized, i.e. by AddressSanitizer. +// GCC has the nosanitize attribute, but as a function attribute only, and +// warns on use as a variable attribute. + +// Guard variables and structure members by lock. + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-4-Clause +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// Copyright (c) 1990, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. All advertising materials mentioning features or use of this software +// must display the following acknowledgement: +// This product includes software developed by the University of +// California, Berkeley and its contributors. +// 4. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 +// From: @(#)types.h 8.3 (Berkeley) 1/5/94 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1988, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)limits.h 8.3 (Berkeley) 1/4/94 +// $FreeBSD$ + +// According to ANSI (section 2.2.4.2), the values below must be usable by +// #if preprocessing directives. Additionally, the expression must have the +// same type as would an expression that is an object of the corresponding +// type converted according to the integral promotions. The subtraction for +// INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an +// unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). + +// max value for an unsigned long long + +// Quads and longs are the same on the amd64. Ensure they stay in sync. + +// Minimum signal stack size. + +// Basic types upon which most other types are built. +type X__int8_t = int8 /* _types.h:55:22 */ +type X__uint8_t = uint8 /* _types.h:56:24 */ +type X__int16_t = int16 /* _types.h:57:17 */ +type X__uint16_t = uint16 /* _types.h:58:25 */ +type X__int32_t = int32 /* _types.h:59:15 */ +type X__uint32_t = uint32 /* _types.h:60:23 */ +type X__int64_t = int64 /* _types.h:62:16 */ +type X__uint64_t = uint64 /* _types.h:63:24 */ + +// Standard type definitions. +type X__clock_t = X__int32_t /* _types.h:75:19 */ // clock()... +type X__critical_t = X__int64_t /* _types.h:76:19 */ +type X__double_t = float64 /* _types.h:78:17 */ +type X__float_t = float32 /* _types.h:79:16 */ +type X__intfptr_t = X__int64_t /* _types.h:81:19 */ +type X__intptr_t = X__int64_t /* _types.h:82:19 */ +type X__intmax_t = X__int64_t /* _types.h:93:19 */ +type X__int_fast8_t = X__int32_t /* _types.h:94:19 */ +type X__int_fast16_t = X__int32_t /* _types.h:95:19 */ +type X__int_fast32_t = X__int32_t /* _types.h:96:19 */ +type X__int_fast64_t = X__int64_t /* _types.h:97:19 */ +type X__int_least8_t = X__int8_t /* _types.h:98:18 */ +type X__int_least16_t = X__int16_t /* _types.h:99:19 */ +type X__int_least32_t = X__int32_t /* _types.h:100:19 */ +type X__int_least64_t = X__int64_t /* _types.h:101:19 */ +type X__ptrdiff_t = X__int64_t /* _types.h:103:19 */ // ptr1 - ptr2 +type X__register_t = X__int64_t /* _types.h:104:19 */ +type X__segsz_t = X__int64_t /* _types.h:105:19 */ // segment size (in pages) +type X__size_t = X__uint64_t /* _types.h:106:20 */ // sizeof() +type X__ssize_t = X__int64_t /* _types.h:107:19 */ // byte count or error +type X__time_t = X__int64_t /* _types.h:108:19 */ // time()... +type X__uintfptr_t = X__uint64_t /* _types.h:109:20 */ +type X__uintptr_t = X__uint64_t /* _types.h:110:20 */ +type X__uintmax_t = X__uint64_t /* _types.h:121:20 */ +type X__uint_fast8_t = X__uint32_t /* _types.h:122:20 */ +type X__uint_fast16_t = X__uint32_t /* _types.h:123:20 */ +type X__uint_fast32_t = X__uint32_t /* _types.h:124:20 */ +type X__uint_fast64_t = X__uint64_t /* _types.h:125:20 */ +type X__uint_least8_t = X__uint8_t /* _types.h:126:19 */ +type X__uint_least16_t = X__uint16_t /* _types.h:127:20 */ +type X__uint_least32_t = X__uint32_t /* _types.h:128:20 */ +type X__uint_least64_t = X__uint64_t /* _types.h:129:20 */ +type X__u_register_t = X__uint64_t /* _types.h:131:20 */ +type X__vm_offset_t = X__uint64_t /* _types.h:132:20 */ +type X__vm_paddr_t = X__uint64_t /* _types.h:133:20 */ +type X__vm_size_t = X__uint64_t /* _types.h:134:20 */ +type X___wchar_t = int32 /* _types.h:141:14 */ + +// Standard type definitions. +type X__blksize_t = X__int32_t /* _types.h:40:19 */ // file block size +type X__blkcnt_t = X__int64_t /* _types.h:41:19 */ // file block count +type X__clockid_t = X__int32_t /* _types.h:42:19 */ // clock_gettime()... +type X__fflags_t = X__uint32_t /* _types.h:43:20 */ // file flags +type X__fsblkcnt_t = X__uint64_t /* _types.h:44:20 */ +type X__fsfilcnt_t = X__uint64_t /* _types.h:45:20 */ +type X__gid_t = X__uint32_t /* _types.h:46:20 */ +type X__id_t = X__int64_t /* _types.h:47:19 */ // can hold a gid_t, pid_t, or uid_t +type X__ino_t = X__uint64_t /* _types.h:48:20 */ // inode number +type X__key_t = int64 /* _types.h:49:15 */ // IPC key (for Sys V IPC) +type X__lwpid_t = X__int32_t /* _types.h:50:19 */ // Thread ID (a.k.a. LWP) +type X__mode_t = X__uint16_t /* _types.h:51:20 */ // permissions +type X__accmode_t = int32 /* _types.h:52:14 */ // access permissions +type X__nl_item = int32 /* _types.h:53:14 */ +type X__nlink_t = X__uint64_t /* _types.h:54:20 */ // link count +type X__off_t = X__int64_t /* _types.h:55:19 */ // file offset +type X__off64_t = X__int64_t /* _types.h:56:19 */ // file offset (alias) +type X__pid_t = X__int32_t /* _types.h:57:19 */ // process [group] +type X__rlim_t = X__int64_t /* _types.h:58:19 */ // resource limit - intentionally +// signed, because of legacy code +// that uses -1 for RLIM_INFINITY +type X__sa_family_t = X__uint8_t /* _types.h:61:19 */ +type X__socklen_t = X__uint32_t /* _types.h:62:20 */ +type X__suseconds_t = int64 /* _types.h:63:15 */ // microseconds (signed) +type X__timer_t = uintptr /* _types.h:64:24 */ // timer_gettime()... +type X__mqd_t = uintptr /* _types.h:65:21 */ // mq_open()... +type X__uid_t = X__uint32_t /* _types.h:66:20 */ +type X__useconds_t = uint32 /* _types.h:67:22 */ // microseconds (unsigned) +type X__cpuwhich_t = int32 /* _types.h:68:14 */ // which parameter for cpuset. +type X__cpulevel_t = int32 /* _types.h:69:14 */ // level parameter for cpuset. +type X__cpusetid_t = int32 /* _types.h:70:14 */ // cpuset identifier. +type X__daddr_t = X__int64_t /* _types.h:71:19 */ // bwrite(3), FIOBMAP2, etc + +// Unusual type definitions. +// rune_t is declared to be an ``int'' instead of the more natural +// ``unsigned long'' or ``long''. Two things are happening here. It is not +// unsigned so that EOF (-1) can be naturally assigned to it and used. Also, +// it looks like 10646 will be a 31 bit standard. This means that if your +// ints cannot hold 32 bits, you will be in trouble. The reason an int was +// chosen over a long is that the is*() and to*() routines take ints (says +// ANSI C), but they use __ct_rune_t instead of int. +// +// NOTE: rune_t is not covered by ANSI nor other standards, and should not +// be instantiated outside of lib/libc/locale. Use wchar_t. wint_t and +// rune_t must be the same type. Also, wint_t should be able to hold all +// members of the largest character set plus one extra value (WEOF), and +// must be at least 16 bits. +type X__ct_rune_t = int32 /* _types.h:91:14 */ // arg type for ctype funcs +type X__rune_t = X__ct_rune_t /* _types.h:92:21 */ // rune_t (see above) +type X__wint_t = X__ct_rune_t /* _types.h:93:21 */ // wint_t (see above) + +// Clang already provides these types as built-ins, but only in C++ mode. +type X__char16_t = X__uint_least16_t /* _types.h:97:26 */ +type X__char32_t = X__uint_least32_t /* _types.h:98:26 */ +// In C++11, char16_t and char32_t are built-in types. + +type X__max_align_t = struct { + F__max_align1 int64 + F__max_align2 float64 +} /* _types.h:111:3 */ + +type X__dev_t = X__uint64_t /* _types.h:113:20 */ // device number + +type X__fixpt_t = X__uint32_t /* _types.h:115:20 */ // fixed point number + +// mbstate_t is an opaque object to keep conversion state during multibyte +// stream conversions. +type X__mbstate_t = struct { + _ [0]uint64 + F__mbstate8 [128]int8 +} /* _types.h:124:3 */ + +type X__rman_res_t = X__uintmax_t /* _types.h:126:25 */ + +// Types for varargs. These are all provided by builtin types these +// days, so centralize their definition. +type X__va_list = X__builtin_va_list /* _types.h:133:27 */ // internally known to gcc +type X__gnuc_va_list = X__va_list /* _types.h:140:20 */ // compatibility w/GNU headers + +// When the following macro is defined, the system uses 64-bit inode numbers. +// Programs can use this to avoid including <sys/param.h>, with its associated +// namespace pollution. + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1987, 1991 Regents of the University of California. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)endian.h 7.8 (Berkeley) 4/3/91 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// Define the order of 32-bit words in 64-bit words. + +// Definitions for byte order, according to byte significance from low +// address to high. + +// Deprecated variants that don't have enough underscores to be useful in more +// strict namespaces. + +// Protocols common to RFC 1700, POSIX, and X/Open. + +type Uint8_t = X__uint8_t /* in.h:52:20 */ + +type Uint16_t = X__uint16_t /* in.h:57:21 */ + +type Uint32_t = X__uint32_t /* in.h:62:21 */ + +type In_addr_t = Uint32_t /* in.h:67:19 */ + +type In_port_t = Uint16_t /* in.h:72:19 */ + +type Sa_family_t = X__sa_family_t /* in.h:77:24 */ + +// Internet address (a structure for historical reasons). +type In_addr = struct{ Fs_addr In_addr_t } /* in.h:83:1 */ + +type Socklen_t = X__socklen_t /* in.h:90:21 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)socket.h 8.4 (Berkeley) 2/21/94 +// $FreeBSD$ + +// RFC 2553: protocol-independent placeholder for socket addresses + +type Sockaddr_storage = struct { + Fss_len uint8 + Fss_family Sa_family_t + F__ss_pad1 [6]int8 + F__ss_align X__int64_t + F__ss_pad2 [112]int8 +} /* _sockaddr_storage.h:48:1 */ + +// Socket address, internet style. +type Sockaddr_in = struct { + Fsin_len Uint8_t + Fsin_family Sa_family_t + Fsin_port In_port_t + Fsin_addr struct{ Fs_addr In_addr_t } + Fsin_zero [8]int8 +} /* in.h:97:1 */ + +// Constants and structures defined by the internet system, +// Per RFC 790, September 1981, and numerous additions. + +// Protocols (RFC 1700) +// 101-254: Partly Unassigned +// 255: Reserved +// BSD Private, local use, namespace incursion, no longer used + +// last return value of *_input(), meaning "all job for this pkt is done". + +// Only used internally, so can be outside the range of valid IP protocols. + +// Defined to avoid confusion. The master value is defined by +// PROTO_SPACER in sys/protosw.h. + +// Local port number conventions: +// +// When a user does a bind(2) or connect(2) with a port number of zero, +// a non-conflicting local port address is chosen. +// The default range is IPPORT_HIFIRSTAUTO through +// IPPORT_HILASTAUTO, although that is settable by sysctl. +// +// A user may set the IPPROTO_IP option IP_PORTRANGE to change this +// default assignment range. +// +// The value IP_PORTRANGE_DEFAULT causes the default behavior. +// +// The value IP_PORTRANGE_HIGH changes the range of candidate port numbers +// into the "high" range. These are reserved for client outbound connections +// which do not want to be filtered by any firewalls. +// +// The value IP_PORTRANGE_LOW changes the range to the "low" are +// that is (by convention) restricted to privileged processes. This +// convention is based on "vouchsafe" principles only. It is only secure +// if you trust the remote host to restrict these ports. +// +// The default range of ports and the high range can be changed by +// sysctl(3). (net.inet.ip.portrange.{hi,low,}{first,last}) +// +// Changing those values has bad security implications if you are +// using a stateless firewall that is allowing packets outside of that +// range in order to allow transparent outgoing connections. +// +// Such a firewall configuration will generally depend on the use of these +// default values. If you change them, you may find your Security +// Administrator looking for you with a heavy object. +// +// For a slightly more orthodox text view on this: +// +// ftp://ftp.isi.edu/in-notes/iana/assignments/port-numbers +// +// port numbers are divided into three ranges: +// +// 0 - 1023 Well Known Ports +// 1024 - 49151 Registered Ports +// 49152 - 65535 Dynamic and/or Private Ports +// + +// Ports < IPPORT_RESERVED are reserved for +// privileged processes (e.g. root). (IP_PORTRANGE_LOW) + +// Default local port range, used by IP_PORTRANGE_DEFAULT + +// Dynamic port range, used by IP_PORTRANGE_HIGH. + +// Scanning for a free reserved port return a value below IPPORT_RESERVED, +// but higher than IPPORT_RESERVEDSTART. Traditionally the start value was +// 512, but that conflicts with some well-known-services that firewalls may +// have a fit if we use. + +// Definitions of bits in internet address integers. +// On subnets, the decomposition of addresses to host and net parts +// is done according to subnet mask, not the masks here. + +// Options for use with [gs]etsockopt at the IP level. +// First word of comment is data type; bool is stored in int. +// for IPSEC +// unused; was IP_FAITH + +// Options for controlling the firewall and dummynet. +// Historical options (from 40 to 64) will eventually be +// replaced by only two options, IP_FW3 and IP_DUMMYNET3. + +// IPv4 Source Filter Multicast API [RFC3678] + +// The following option is private; do not use it from user applications. + +// The following option deals with the 802.1Q Ethernet Priority Code Point +// -1 use interface default + +// Protocol Independent Multicast API [RFC3678] + +// Flow and RSS definitions + +// Defaults and limits for options + +// Limit for IPv4 multicast memberships + +// Default resource limits for IPv4 multicast source filtering. +// These may be modified by sysctl. + +// Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP. +type Ip_mreq = struct { + Fimr_multiaddr struct{ Fs_addr In_addr_t } + Fimr_interface struct{ Fs_addr In_addr_t } +} /* in.h:527:1 */ + +// Modified argument structure for IP_MULTICAST_IF, obtained from Linux. +// This is used to specify an interface index for multicast sends, as +// the IPv4 legacy APIs do not support this (unless IP_SENDIF is available). +type Ip_mreqn = struct { + Fimr_multiaddr struct{ Fs_addr In_addr_t } + Fimr_address struct{ Fs_addr In_addr_t } + Fimr_ifindex int32 +} /* in.h:537:1 */ + +// Argument structure for IPv4 Multicast Source Filter APIs. [RFC3678] +type Ip_mreq_source = struct { + Fimr_multiaddr struct{ Fs_addr In_addr_t } + Fimr_sourceaddr struct{ Fs_addr In_addr_t } + Fimr_interface struct{ Fs_addr In_addr_t } +} /* in.h:546:1 */ + +// Argument structures for Protocol-Independent Multicast Source +// Filter APIs. [RFC3678] +type Group_req = struct { + Fgr_interface Uint32_t + _ [4]byte + Fgr_group struct { + Fss_len uint8 + Fss_family Sa_family_t + F__ss_pad1 [6]int8 + F__ss_align X__int64_t + F__ss_pad2 [112]int8 + } +} /* in.h:556:1 */ + +type Group_source_req = struct { + Fgsr_interface Uint32_t + _ [4]byte + Fgsr_group struct { + Fss_len uint8 + Fss_family Sa_family_t + F__ss_pad1 [6]int8 + F__ss_align X__int64_t + F__ss_pad2 [112]int8 + } + Fgsr_source struct { + Fss_len uint8 + Fss_family Sa_family_t + F__ss_pad1 [6]int8 + F__ss_align X__int64_t + F__ss_pad2 [112]int8 + } +} /* in.h:561:1 */ + +// The following structure is private; do not use it from user applications. +// It is used to communicate IP_MSFILTER/IPV6_MSFILTER information between +// the RFC 3678 libc functions and the kernel. +type X__msfilterreq = struct { + Fmsfr_ifindex Uint32_t + Fmsfr_fmode Uint32_t + Fmsfr_nsrcs Uint32_t + _ [4]byte + Fmsfr_group struct { + Fss_len uint8 + Fss_family Sa_family_t + F__ss_pad1 [6]int8 + F__ss_align X__int64_t + F__ss_pad2 [112]int8 + } + Fmsfr_srcs uintptr +} /* in.h:574:1 */ + +// Filter modes; also used to represent per-socket filter mode internally. + +// Argument for IP_PORTRANGE: +// - which range to search when port is unspecified at bind() or connect() + +// Identifiers for IP sysctl nodes +// IPCTL_RTEXPIRE 5 deprecated +// IPCTL_RTMINEXPIRE 6 deprecated +// IPCTL_RTMAXCACHE 7 deprecated +// 15, unused, was: IPCTL_KEEPFAITH + +// INET6 stuff +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the project nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $KAME: in6.h,v 1.89 2001/05/27 13:28:35 itojun Exp $ + +// - +// Copyright (c) 1982, 1986, 1990, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)in.h 8.3 (Berkeley) 1/3/94 +// $FreeBSD$ + +// Identification of the network protocol stack +// for *BSD-current/release: http://www.kame.net/dev/cvsweb.cgi/kame/COVERAGE +// has the table of implementation/integration differences. + +// IPv6 port allocation rules should mirror the IPv4 rules and are controlled +// by the net.inet.ip.portrange sysctl tree. The following defines exist +// for compatibility with userland applications that need them. + +// IPv6 address +type In6_addr = struct { + F__u6_addr struct { + _ [0]uint32 + F__u6_addr8 [16]Uint8_t + } +} /* in6.h:97:1 */ + +// XXX missing POSIX.1-2001 macro IPPROTO_IPV6. + +// Socket address for IPv6 + +type Sockaddr_in6 = struct { + Fsin6_len Uint8_t + Fsin6_family Sa_family_t + Fsin6_port In_port_t + Fsin6_flowinfo Uint32_t + Fsin6_addr struct { + F__u6_addr struct { + _ [0]uint32 + F__u6_addr8 [16]Uint8_t + } + } + Fsin6_scope_id Uint32_t +} /* in6.h:125:1 */ + +type Route_in6 = struct { + Fro_nh uintptr + Fro_lle uintptr + Fro_prepend uintptr + Fro_plen Uint16_t + Fro_flags Uint16_t + Fro_mtu Uint16_t + Fspare Uint16_t + Fro_dst struct { + Fsin6_len Uint8_t + Fsin6_family Sa_family_t + Fsin6_port In_port_t + Fsin6_flowinfo Uint32_t + Fsin6_addr struct { + F__u6_addr struct { + _ [0]uint32 + F__u6_addr8 [16]Uint8_t + } + } + Fsin6_scope_id Uint32_t + } + _ [4]byte +} /* in6.h:379:1 */ + +// Options for use with [gs]etsockopt at the IPV6 level. +// First word of comment is data type; bool is stored in int. +// no hdrincl +// RFC2292 options + +// 29; unused; was IPV6_FAITH + +// new socket options introduced in RFC3542 + +// more new socket options introduced in RFC3542 + +// The following option is private; do not use it from user applications. +// It is deliberately defined to the same value as IP_MSFILTER. + +// The following option deals with the 802.1Q Ethernet Priority Code Point +// -1 use interface default + +// to define items, should talk with KAME guys first, for *BSD compatibility + +// Defaults and limits for options + +// Limit for IPv6 multicast memberships + +// Default resource limits for IPv6 multicast source filtering. +// These may be modified by sysctl. + +// Argument structure for IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP. +type Ipv6_mreq = struct { + Fipv6mr_multiaddr struct { + F__u6_addr struct { + _ [0]uint32 + F__u6_addr8 [16]Uint8_t + } + } + Fipv6mr_interface uint32 +} /* in6.h:545:1 */ + +// IPV6_PKTINFO: Packet information(RFC2292 sec 5) +type In6_pktinfo = struct { + Fipi6_addr struct { + F__u6_addr struct { + _ [0]uint32 + F__u6_addr8 [16]Uint8_t + } + } + Fipi6_ifindex uint32 +} /* in6.h:553:1 */ + +// Control structure for IPV6_RECVPATHMTU socket option. +type Ip6_mtuinfo = struct { + Fip6m_addr struct { + Fsin6_len Uint8_t + Fsin6_family Sa_family_t + Fsin6_port In_port_t + Fsin6_flowinfo Uint32_t + Fsin6_addr struct { + F__u6_addr struct { + _ [0]uint32 + F__u6_addr8 [16]Uint8_t + } + } + Fsin6_scope_id Uint32_t + } + Fip6m_mtu Uint32_t +} /* in6.h:561:1 */ + +var _ int8 /* gen.c:2:13: */ diff --git a/vendor/modernc.org/libc/nodmesg.go b/vendor/modernc.org/libc/nodmesg.go index d4524f52a..92e494b2e 100644 --- a/vendor/modernc.org/libc/nodmesg.go +++ b/vendor/modernc.org/libc/nodmesg.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !libc.dmesg // +build !libc.dmesg package libc // import "modernc.org/libc" diff --git a/vendor/modernc.org/libc/nofsync.go b/vendor/modernc.org/libc/nofsync.go index 37d1db58f..205c2af0b 100644 --- a/vendor/modernc.org/libc/nofsync.go +++ b/vendor/modernc.org/libc/nofsync.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build libc.nofsync // +build libc.nofsync package libc // import "modernc.org/libc" diff --git a/vendor/modernc.org/libc/nopthreads.go b/vendor/modernc.org/libc/nopthreads.go index b3862ea2f..80ca4ccc0 100644 --- a/vendor/modernc.org/libc/nopthreads.go +++ b/vendor/modernc.org/libc/nopthreads.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build windows darwin linux,arm linux,s390x +//go:build windows || darwin || (linux && arm) || (linux && s390x) || (linux && 386) || (linux && arm) || (linux && arm64) || (freebsd && amd64) +// +build windows darwin linux,arm linux,s390x linux,386 linux,arm linux,arm64 freebsd,amd64 package libc // import "modernc.org/libc" diff --git a/vendor/modernc.org/libc/poll/capi_freebsd_amd64.go b/vendor/modernc.org/libc/poll/capi_freebsd_amd64.go new file mode 100644 index 000000000..38c70d4f8 --- /dev/null +++ b/vendor/modernc.org/libc/poll/capi_freebsd_amd64.go @@ -0,0 +1,5 @@ +// Code generated by 'ccgo poll/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 poll/poll_freebsd_amd64.go -pkgname poll', DO NOT EDIT. + +package poll + +var CAPI = map[string]struct{}{} diff --git a/vendor/modernc.org/libc/poll/poll_freebsd_amd64.go b/vendor/modernc.org/libc/poll/poll_freebsd_amd64.go new file mode 100644 index 000000000..ab3cd770e --- /dev/null +++ b/vendor/modernc.org/libc/poll/poll_freebsd_amd64.go @@ -0,0 +1,887 @@ +// Code generated by 'ccgo poll/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 poll/poll_freebsd_amd64.go -pkgname poll', DO NOT EDIT. + +package poll + +import ( + "math" + "reflect" + "sync/atomic" + "unsafe" +) + +var _ = math.Pi +var _ reflect.Kind +var _ atomic.Value +var _ unsafe.Pointer + +const ( + INFTIM = -1 + POLLERR = 0x0008 + POLLHUP = 0x0010 + POLLIN = 0x0001 + POLLINIGNEOF = 0x2000 + POLLNVAL = 0x0020 + POLLOUT = 0x0004 + POLLPRI = 0x0002 + POLLRDBAND = 0x0080 + POLLRDNORM = 0x0040 + POLLSTANDARD = 511 + POLLWRBAND = 0x0100 + POLLWRNORM = 4 + X_FILE_OFFSET_BITS = 64 + X_LP64 = 1 + X_MACHINE__LIMITS_H_ = 0 + X_MACHINE__TYPES_H_ = 0 + X_Nonnull = 0 + X_Null_unspecified = 0 + X_Nullable = 0 + X_SIGSET_T_DECLARED = 0 + X_SIG_MAXSIG = 128 + X_SIG_WORDS = 4 + X_SYS_CDEFS_H_ = 0 + X_SYS_POLL_H_ = 0 + X_SYS_TIMESPEC_H_ = 0 + X_SYS__SIGSET_H_ = 0 + X_SYS__TIMESPEC_H_ = 0 + X_SYS__TYPES_H_ = 0 + X_TIME_T_DECLARED = 0 + Unix = 1 +) + +type Ptrdiff_t = int64 /* <builtin>:3:26 */ + +type Size_t = uint64 /* <builtin>:9:23 */ + +type Wchar_t = int32 /* <builtin>:15:24 */ + +type X__int128_t = struct { + Flo int64 + Fhi int64 +} /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128 +type X__uint128_t = struct { + Flo uint64 + Fhi uint64 +} /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128 + +type X__builtin_va_list = uintptr /* <builtin>:46:14 */ +type X__float128 = float64 /* <builtin>:47:21 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1997 Peter Wemm <peter@freebsd.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// Testing against Clang-specific extensions. + +// This code has been put in place to help reduce the addition of +// compiler specific defines in FreeBSD code. It helps to aid in +// having a compiler-agnostic source tree. + +// Compiler memory barriers, specific to gcc and clang. + +// XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced + +// Macro to test if we're using a specific version of gcc or later. + +// The __CONCAT macro is used to concatenate parts of symbol names, e.g. +// with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. +// The __CONCAT macro is a bit tricky to use if it must work in non-ANSI +// mode -- there must be no spaces between its arguments, and for nested +// __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also +// concatenate double-quoted strings produced by the __STRING macro, but +// this only works with ANSI C. +// +// __XSTRING is like __STRING, but it expands any macros in its argument +// first. It is only available with ANSI C. + +// Compiler-dependent macros to help declare dead (non-returning) and +// pure (no side effects) functions, and unused variables. They are +// null except for versions of gcc that are known to support the features +// properly (old versions of gcc-2 supported the dead and pure features +// in a different (wrong) way). If we do not provide an implementation +// for a given compiler, let the compile fail if it is told to use +// a feature that we cannot live without. + +// Keywords added in C11. + +// Emulation of C11 _Generic(). Unlike the previously defined C11 +// keywords, it is not possible to implement this using exactly the same +// syntax. Therefore implement something similar under the name +// __generic(). Unlike _Generic(), this macro can only distinguish +// between a single type, so it requires nested invocations to +// distinguish multiple cases. + +// C99 Static array indices in function parameter declarations. Syntax such as: +// void bar(int myArray[static 10]); +// is allowed in C99 but not in C++. Define __min_size appropriately so +// headers using it can be compiled in either language. Use like this: +// void bar(int myArray[__min_size(10)]); + +// XXX: should use `#if __STDC_VERSION__ < 199901'. + +// C++11 exposes a load of C99 stuff + +// GCC 2.95 provides `__restrict' as an extension to C90 to support the +// C99-specific `restrict' type qualifier. We happen to use `__restrict' as +// a way to define the `restrict' type qualifier without disturbing older +// software that is unaware of C99 keywords. + +// GNU C version 2.96 adds explicit branch prediction so that +// the CPU back-end can hint the processor and also so that +// code blocks can be reordered such that the predicted path +// sees a more linear flow, thus improving cache behavior, etc. +// +// The following two macros provide us with a way to utilize this +// compiler feature. Use __predict_true() if you expect the expression +// to evaluate to true, and __predict_false() if you expect the +// expression to evaluate to false. +// +// A few notes about usage: +// +// * Generally, __predict_false() error condition checks (unless +// you have some _strong_ reason to do otherwise, in which case +// document it), and/or __predict_true() `no-error' condition +// checks, assuming you want to optimize for the no-error case. +// +// * Other than that, if you don't know the likelihood of a test +// succeeding from empirical or other `hard' evidence, don't +// make predictions. +// +// * These are meant to be used in places that are run `a lot'. +// It is wasteful to make predictions in code that is run +// seldomly (e.g. at subsystem initialization time) as the +// basic block reordering that this affects can often generate +// larger code. + +// We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h> +// require it. + +// Given the pointer x to the member m of the struct s, return +// a pointer to the containing structure. When using GCC, we first +// assign pointer x to a local variable, to check that its type is +// compatible with member m. + +// Compiler-dependent macros to declare that functions take printf-like +// or scanf-like arguments. They are null except for versions of gcc +// that are known to support the features properly (old versions of gcc-2 +// didn't permit keeping the keywords out of the application namespace). + +// Compiler-dependent macros that rely on FreeBSD-specific extensions. + +// Embed the rcs id of a source file in the resulting library. Note that in +// more recent ELF binutils, we use .ident allowing the ID to be stripped. +// Usage: +// __FBSDID("$FreeBSD$"); + +// - +// The following definitions are an extension of the behavior originally +// implemented in <sys/_posix.h>, but with a different level of granularity. +// POSIX.1 requires that the macros we test be defined before any standard +// header file is included. +// +// Here's a quick run-down of the versions: +// defined(_POSIX_SOURCE) 1003.1-1988 +// _POSIX_C_SOURCE == 1 1003.1-1990 +// _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option +// _POSIX_C_SOURCE == 199309 1003.1b-1993 +// _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, +// and the omnibus ISO/IEC 9945-1: 1996 +// _POSIX_C_SOURCE == 200112 1003.1-2001 +// _POSIX_C_SOURCE == 200809 1003.1-2008 +// +// In addition, the X/Open Portability Guide, which is now the Single UNIX +// Specification, defines a feature-test macro which indicates the version of +// that specification, and which subsumes _POSIX_C_SOURCE. +// +// Our macros begin with two underscores to avoid namespace screwage. + +// Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. + +// Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. + +// Deal with various X/Open Portability Guides and Single UNIX Spec. + +// Deal with all versions of POSIX. The ordering relative to the tests above is +// important. +// - +// Deal with _ANSI_SOURCE: +// If it is defined, and no other compilation environment is explicitly +// requested, then define our internal feature-test macros to zero. This +// makes no difference to the preprocessor (undefined symbols in preprocessing +// expressions are defined to have value zero), but makes it more convenient for +// a test program to print out the values. +// +// If a program mistakenly defines _ANSI_SOURCE and some other macro such as +// _POSIX_C_SOURCE, we will assume that it wants the broader compilation +// environment (and in fact we will never get here). + +// User override __EXT1_VISIBLE + +// Old versions of GCC use non-standard ARM arch symbols; acle-compat.h +// translates them to __ARM_ARCH and the modern feature symbols defined by ARM. + +// Nullability qualifiers: currently only supported by Clang. + +// Type Safety Checking +// +// Clang provides additional attributes to enable checking type safety +// properties that cannot be enforced by the C type system. + +// Lock annotations. +// +// Clang provides support for doing basic thread-safety tests at +// compile-time, by marking which locks will/should be held when +// entering/leaving a functions. +// +// Furthermore, it is also possible to annotate variables and structure +// members to enforce that they are only accessed when certain locks are +// held. + +// Structure implements a lock. + +// Function acquires an exclusive or shared lock. + +// Function attempts to acquire an exclusive or shared lock. + +// Function releases a lock. + +// Function asserts that an exclusive or shared lock is held. + +// Function requires that an exclusive or shared lock is or is not held. + +// Function should not be analyzed. + +// Function or variable should not be sanitized, i.e. by AddressSanitizer. +// GCC has the nosanitize attribute, but as a function attribute only, and +// warns on use as a variable attribute. + +// Guard variables and structure members by lock. + +// This file is intended to be compatible with the traditional poll.h. + +type Nfds_t = uint32 /* poll.h:42:22 */ + +// This structure is passed as an array to poll(2). +type Pollfd = struct { + Ffd int32 + Fevents int16 + Frevents int16 +} /* poll.h:47:1 */ + +// Requestable events. If poll(2) finds any of these set, they are +// copied to revents on return. +// XXX Note that FreeBSD doesn't make much distinction between POLLPRI +// and POLLRDBAND since none of the file types have distinct priority +// bands - and only some have an urgent "mode". +// XXX Note POLLIN isn't really supported in true SVSV terms. Under SYSV +// POLLIN includes all of normal, band and urgent data. Most poll handlers +// on FreeBSD only treat it as "normal" data. + +// General FreeBSD extension (currently only supported for sockets): + +// These events are set if they occur regardless of whether they were +// requested. + +// Request that poll() wait forever. +// XXX in SYSV, this is defined in stropts.h, which is not included +// by poll.h. + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-4-Clause +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// Copyright (c) 1990, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. All advertising materials mentioning features or use of this software +// must display the following acknowledgement: +// This product includes software developed by the University of +// California, Berkeley and its contributors. +// 4. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 +// From: @(#)types.h 8.3 (Berkeley) 1/5/94 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1988, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)limits.h 8.3 (Berkeley) 1/4/94 +// $FreeBSD$ + +// According to ANSI (section 2.2.4.2), the values below must be usable by +// #if preprocessing directives. Additionally, the expression must have the +// same type as would an expression that is an object of the corresponding +// type converted according to the integral promotions. The subtraction for +// INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an +// unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). + +// max value for an unsigned long long + +// Quads and longs are the same on the amd64. Ensure they stay in sync. + +// Minimum signal stack size. + +// Basic types upon which most other types are built. +type X__int8_t = int8 /* _types.h:55:22 */ +type X__uint8_t = uint8 /* _types.h:56:24 */ +type X__int16_t = int16 /* _types.h:57:17 */ +type X__uint16_t = uint16 /* _types.h:58:25 */ +type X__int32_t = int32 /* _types.h:59:15 */ +type X__uint32_t = uint32 /* _types.h:60:23 */ +type X__int64_t = int64 /* _types.h:62:16 */ +type X__uint64_t = uint64 /* _types.h:63:24 */ + +// Standard type definitions. +type X__clock_t = X__int32_t /* _types.h:75:19 */ // clock()... +type X__critical_t = X__int64_t /* _types.h:76:19 */ +type X__double_t = float64 /* _types.h:78:17 */ +type X__float_t = float32 /* _types.h:79:16 */ +type X__intfptr_t = X__int64_t /* _types.h:81:19 */ +type X__intptr_t = X__int64_t /* _types.h:82:19 */ +type X__intmax_t = X__int64_t /* _types.h:93:19 */ +type X__int_fast8_t = X__int32_t /* _types.h:94:19 */ +type X__int_fast16_t = X__int32_t /* _types.h:95:19 */ +type X__int_fast32_t = X__int32_t /* _types.h:96:19 */ +type X__int_fast64_t = X__int64_t /* _types.h:97:19 */ +type X__int_least8_t = X__int8_t /* _types.h:98:18 */ +type X__int_least16_t = X__int16_t /* _types.h:99:19 */ +type X__int_least32_t = X__int32_t /* _types.h:100:19 */ +type X__int_least64_t = X__int64_t /* _types.h:101:19 */ +type X__ptrdiff_t = X__int64_t /* _types.h:103:19 */ // ptr1 - ptr2 +type X__register_t = X__int64_t /* _types.h:104:19 */ +type X__segsz_t = X__int64_t /* _types.h:105:19 */ // segment size (in pages) +type X__size_t = X__uint64_t /* _types.h:106:20 */ // sizeof() +type X__ssize_t = X__int64_t /* _types.h:107:19 */ // byte count or error +type X__time_t = X__int64_t /* _types.h:108:19 */ // time()... +type X__uintfptr_t = X__uint64_t /* _types.h:109:20 */ +type X__uintptr_t = X__uint64_t /* _types.h:110:20 */ +type X__uintmax_t = X__uint64_t /* _types.h:121:20 */ +type X__uint_fast8_t = X__uint32_t /* _types.h:122:20 */ +type X__uint_fast16_t = X__uint32_t /* _types.h:123:20 */ +type X__uint_fast32_t = X__uint32_t /* _types.h:124:20 */ +type X__uint_fast64_t = X__uint64_t /* _types.h:125:20 */ +type X__uint_least8_t = X__uint8_t /* _types.h:126:19 */ +type X__uint_least16_t = X__uint16_t /* _types.h:127:20 */ +type X__uint_least32_t = X__uint32_t /* _types.h:128:20 */ +type X__uint_least64_t = X__uint64_t /* _types.h:129:20 */ +type X__u_register_t = X__uint64_t /* _types.h:131:20 */ +type X__vm_offset_t = X__uint64_t /* _types.h:132:20 */ +type X__vm_paddr_t = X__uint64_t /* _types.h:133:20 */ +type X__vm_size_t = X__uint64_t /* _types.h:134:20 */ +type X___wchar_t = int32 /* _types.h:141:14 */ + +// Standard type definitions. +type X__blksize_t = X__int32_t /* _types.h:40:19 */ // file block size +type X__blkcnt_t = X__int64_t /* _types.h:41:19 */ // file block count +type X__clockid_t = X__int32_t /* _types.h:42:19 */ // clock_gettime()... +type X__fflags_t = X__uint32_t /* _types.h:43:20 */ // file flags +type X__fsblkcnt_t = X__uint64_t /* _types.h:44:20 */ +type X__fsfilcnt_t = X__uint64_t /* _types.h:45:20 */ +type X__gid_t = X__uint32_t /* _types.h:46:20 */ +type X__id_t = X__int64_t /* _types.h:47:19 */ // can hold a gid_t, pid_t, or uid_t +type X__ino_t = X__uint64_t /* _types.h:48:20 */ // inode number +type X__key_t = int64 /* _types.h:49:15 */ // IPC key (for Sys V IPC) +type X__lwpid_t = X__int32_t /* _types.h:50:19 */ // Thread ID (a.k.a. LWP) +type X__mode_t = X__uint16_t /* _types.h:51:20 */ // permissions +type X__accmode_t = int32 /* _types.h:52:14 */ // access permissions +type X__nl_item = int32 /* _types.h:53:14 */ +type X__nlink_t = X__uint64_t /* _types.h:54:20 */ // link count +type X__off_t = X__int64_t /* _types.h:55:19 */ // file offset +type X__off64_t = X__int64_t /* _types.h:56:19 */ // file offset (alias) +type X__pid_t = X__int32_t /* _types.h:57:19 */ // process [group] +type X__rlim_t = X__int64_t /* _types.h:58:19 */ // resource limit - intentionally +// signed, because of legacy code +// that uses -1 for RLIM_INFINITY +type X__sa_family_t = X__uint8_t /* _types.h:61:19 */ +type X__socklen_t = X__uint32_t /* _types.h:62:20 */ +type X__suseconds_t = int64 /* _types.h:63:15 */ // microseconds (signed) +type X__timer_t = uintptr /* _types.h:64:24 */ // timer_gettime()... +type X__mqd_t = uintptr /* _types.h:65:21 */ // mq_open()... +type X__uid_t = X__uint32_t /* _types.h:66:20 */ +type X__useconds_t = uint32 /* _types.h:67:22 */ // microseconds (unsigned) +type X__cpuwhich_t = int32 /* _types.h:68:14 */ // which parameter for cpuset. +type X__cpulevel_t = int32 /* _types.h:69:14 */ // level parameter for cpuset. +type X__cpusetid_t = int32 /* _types.h:70:14 */ // cpuset identifier. +type X__daddr_t = X__int64_t /* _types.h:71:19 */ // bwrite(3), FIOBMAP2, etc + +// Unusual type definitions. +// rune_t is declared to be an ``int'' instead of the more natural +// ``unsigned long'' or ``long''. Two things are happening here. It is not +// unsigned so that EOF (-1) can be naturally assigned to it and used. Also, +// it looks like 10646 will be a 31 bit standard. This means that if your +// ints cannot hold 32 bits, you will be in trouble. The reason an int was +// chosen over a long is that the is*() and to*() routines take ints (says +// ANSI C), but they use __ct_rune_t instead of int. +// +// NOTE: rune_t is not covered by ANSI nor other standards, and should not +// be instantiated outside of lib/libc/locale. Use wchar_t. wint_t and +// rune_t must be the same type. Also, wint_t should be able to hold all +// members of the largest character set plus one extra value (WEOF), and +// must be at least 16 bits. +type X__ct_rune_t = int32 /* _types.h:91:14 */ // arg type for ctype funcs +type X__rune_t = X__ct_rune_t /* _types.h:92:21 */ // rune_t (see above) +type X__wint_t = X__ct_rune_t /* _types.h:93:21 */ // wint_t (see above) + +// Clang already provides these types as built-ins, but only in C++ mode. +type X__char16_t = X__uint_least16_t /* _types.h:97:26 */ +type X__char32_t = X__uint_least32_t /* _types.h:98:26 */ +// In C++11, char16_t and char32_t are built-in types. + +type X__max_align_t = struct { + F__max_align1 int64 + F__max_align2 float64 +} /* _types.h:111:3 */ + +type X__dev_t = X__uint64_t /* _types.h:113:20 */ // device number + +type X__fixpt_t = X__uint32_t /* _types.h:115:20 */ // fixed point number + +// mbstate_t is an opaque object to keep conversion state during multibyte +// stream conversions. +type X__mbstate_t = struct { + _ [0]uint64 + F__mbstate8 [128]int8 +} /* _types.h:124:3 */ + +type X__rman_res_t = X__uintmax_t /* _types.h:126:25 */ + +// Types for varargs. These are all provided by builtin types these +// days, so centralize their definition. +type X__va_list = X__builtin_va_list /* _types.h:133:27 */ // internally known to gcc +type X__gnuc_va_list = X__va_list /* _types.h:140:20 */ // compatibility w/GNU headers + +// When the following macro is defined, the system uses 64-bit inode numbers. +// Programs can use this to avoid including <sys/param.h>, with its associated +// namespace pollution. + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1989, 1991, 1993 +// The Regents of the University of California. All rights reserved. +// (c) UNIX System Laboratories, Inc. +// All or some portions of this file are derived from material licensed +// to the University of California by American Telephone and Telegraph +// Co. or Unix System Laboratories, Inc. and are reproduced herein with +// the permission of UNIX System Laboratories, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)signal.h 8.4 (Berkeley) 5/4/95 +// $FreeBSD$ + +// sigset_t macros. + +type X__sigset = struct{ F__bits [4]X__uint32_t } /* _sigset.h:53:9 */ + +// compatibility w/GNU headers + +// When the following macro is defined, the system uses 64-bit inode numbers. +// Programs can use this to avoid including <sys/param.h>, with its associated +// namespace pollution. + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1989, 1991, 1993 +// The Regents of the University of California. All rights reserved. +// (c) UNIX System Laboratories, Inc. +// All or some portions of this file are derived from material licensed +// to the University of California by American Telephone and Telegraph +// Co. or Unix System Laboratories, Inc. and are reproduced herein with +// the permission of UNIX System Laboratories, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)signal.h 8.4 (Berkeley) 5/4/95 +// $FreeBSD$ + +// sigset_t macros. + +type X__sigset_t = X__sigset /* _sigset.h:55:3 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)time.h 8.5 (Berkeley) 5/4/95 +// from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)time.h 8.5 (Berkeley) 5/4/95 +// from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +type Time_t = X__time_t /* _timespec.h:42:18 */ + +type Timespec = struct { + Ftv_sec Time_t + Ftv_nsec int64 +} /* _timespec.h:46:1 */ + +// Structure defined by POSIX.1b to be like a itimerval, but with +// timespecs. Used in the timer_*() system calls. +type Itimerspec = struct { + Fit_interval struct { + Ftv_sec Time_t + Ftv_nsec int64 + } + Fit_value struct { + Ftv_sec Time_t + Ftv_nsec int64 + } +} /* timespec.h:60:1 */ + +type Sigset_t = X__sigset_t /* poll.h:108:20 */ + +var _ int8 /* gen.c:2:13: */ diff --git a/vendor/modernc.org/libc/printf.go b/vendor/modernc.org/libc/printf.go index c755a5375..fe67c7472 100644 --- a/vendor/modernc.org/libc/printf.go +++ b/vendor/modernc.org/libc/printf.go @@ -42,9 +42,9 @@ func printf(format, args uintptr) []byte { case '%': format = printfConversion(buf, format, &args) case 0: - // if dmesgs { - // dmesg("%v: %q", origin(1), buf.Bytes()) - // } + if dmesgs { + dmesg("%v: %q", origin(1), buf.Bytes()) + } return buf.Bytes() default: format++ diff --git a/vendor/modernc.org/libc/pthread/capi_freebsd_amd64.go b/vendor/modernc.org/libc/pthread/capi_freebsd_amd64.go new file mode 100644 index 000000000..6a08c0d4f --- /dev/null +++ b/vendor/modernc.org/libc/pthread/capi_freebsd_amd64.go @@ -0,0 +1,5 @@ +// Code generated by 'ccgo pthread/gen.c -crt-import-path -export-defines -export-enums -export-externs X -export-fields F -export-structs -export-typedefs -header -hide _OSSwapInt16,_OSSwapInt32,_OSSwapInt64 -o pthread/pthread_freebsd_amd64.go -pkgname pthread', DO NOT EDIT. + +package pthread + +var CAPI = map[string]struct{}{} diff --git a/vendor/modernc.org/libc/pthread/pthread_freebsd_amd64.go b/vendor/modernc.org/libc/pthread/pthread_freebsd_amd64.go new file mode 100644 index 000000000..cb4f7633b --- /dev/null +++ b/vendor/modernc.org/libc/pthread/pthread_freebsd_amd64.go @@ -0,0 +1,1123 @@ +// Code generated by 'ccgo pthread/gen.c -crt-import-path "" -export-defines "" -export-enums "" -export-externs X -export-fields F -export-structs "" -export-typedefs "" -header -hide _OSSwapInt16,_OSSwapInt32,_OSSwapInt64 -o pthread/pthread_freebsd_amd64.go -pkgname pthread', DO NOT EDIT. + +package pthread + +import ( + "math" + "reflect" + "sync/atomic" + "unsafe" +) + +var _ = math.Pi +var _ reflect.Kind +var _ atomic.Value +var _ unsafe.Pointer + +const ( + CLK_TCK = 128 + CLOCKS_PER_SEC = 128 + CLOCK_MONOTONIC = 4 + CLOCK_MONOTONIC_FAST = 12 + CLOCK_MONOTONIC_PRECISE = 11 + CLOCK_PROCESS_CPUTIME_ID = 15 + CLOCK_PROF = 2 + CLOCK_REALTIME = 0 + CLOCK_REALTIME_FAST = 10 + CLOCK_REALTIME_PRECISE = 9 + CLOCK_SECOND = 13 + CLOCK_THREAD_CPUTIME_ID = 14 + CLOCK_UPTIME = 5 + CLOCK_UPTIME_FAST = 8 + CLOCK_UPTIME_PRECISE = 7 + CLOCK_VIRTUAL = 1 + PTHREAD_BARRIER_SERIAL_THREAD = -1 + PTHREAD_CANCEL_ASYNCHRONOUS = 2 + PTHREAD_CANCEL_DEFERRED = 0 + PTHREAD_CANCEL_DISABLE = 1 + PTHREAD_CANCEL_ENABLE = 0 + PTHREAD_CREATE_DETACHED = 1 + PTHREAD_CREATE_JOINABLE = 0 + PTHREAD_DESTRUCTOR_ITERATIONS = 4 + PTHREAD_DETACHED = 0x1 + PTHREAD_DONE_INIT = 1 + PTHREAD_EXPLICIT_SCHED = 0 + PTHREAD_INHERIT_SCHED = 0x4 + PTHREAD_KEYS_MAX = 256 + PTHREAD_MUTEX_ROBUST = 1 + PTHREAD_MUTEX_STALLED = 0 + PTHREAD_NEEDS_INIT = 0 + PTHREAD_NOFLOAT = 0x8 + PTHREAD_PRIO_INHERIT = 1 + PTHREAD_PRIO_NONE = 0 + PTHREAD_PRIO_PROTECT = 2 + PTHREAD_PROCESS_PRIVATE = 0 + PTHREAD_PROCESS_SHARED = 1 + PTHREAD_SCOPE_PROCESS = 0 + PTHREAD_SCOPE_SYSTEM = 0x2 + PTHREAD_STACK_MIN = 2048 + PTHREAD_THREADS_MAX = 18446744073709551615 + SCHED_FIFO = 1 + SCHED_OTHER = 2 + SCHED_RR = 3 + TIMER_ABSTIME = 0x1 + TIMER_RELTIME = 0x0 + TIME_UTC = 1 + X_CLOCKID_T_DECLARED = 0 + X_CLOCK_T_DECLARED = 0 + X_FILE_OFFSET_BITS = 64 + X_LOCALE_T_DEFINED = 0 + X_LP64 = 1 + X_MACHINE__LIMITS_H_ = 0 + X_MACHINE__TYPES_H_ = 0 + X_Nonnull = 0 + X_Null_unspecified = 0 + X_Nullable = 0 + X_PID_T_DECLARED = 0 + X_PTHREAD_H_ = 0 + X_PTHREAD_T_DECLARED = 0 + X_SCHED_H_ = 0 + X_SIG_MAXSIG = 128 + X_SIG_WORDS = 4 + X_SIZE_T_DECLARED = 0 + X_SYS_CDEFS_H_ = 0 + X_SYS_TIMESPEC_H_ = 0 + X_SYS__PTHREADTYPES_H_ = 0 + X_SYS__SIGSET_H_ = 0 + X_SYS__TIMESPEC_H_ = 0 + X_SYS__TYPES_H_ = 0 + X_TIMER_T_DECLARED = 0 + X_TIME_H_ = 0 + X_TIME_T_DECLARED = 0 + X_XLOCALE_LOCALE1_H = 0 + Unix = 1 +) + +// Run-time invariant values: + +// Flags for threads and thread attributes. + +// Values for process shared/private attributes. + +// Flags for cancelling threads + +// Flags for once initialization. + +// Static once initialization values. + +// Static initialization values. + +// Default attribute arguments (draft 4, deprecated). + +// Mutex types (Single UNIX Specification, Version 2, 1997). +// +// Note that a mutex attribute with one of the following types: +// +// PTHREAD_MUTEX_NORMAL +// PTHREAD_MUTEX_RECURSIVE +// +// will deviate from POSIX specified semantics. +const ( /* pthread.h:130:1: */ + PTHREAD_MUTEX_ERRORCHECK = 1 // Default POSIX mutex + PTHREAD_MUTEX_RECURSIVE = 2 // Recursive mutex + PTHREAD_MUTEX_NORMAL = 3 // No error checking + PTHREAD_MUTEX_ADAPTIVE_NP = 4 // Adaptive mutex, spins briefly before blocking on lock + PTHREAD_MUTEX_TYPE_MAX = 5 +) + +type Ptrdiff_t = int64 /* <builtin>:3:26 */ + +type Size_t = uint64 /* <builtin>:9:23 */ + +type Wchar_t = int32 /* <builtin>:15:24 */ + +type X__int128_t = struct { + Flo int64 + Fhi int64 +} /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128 +type X__uint128_t = struct { + Flo uint64 + Fhi uint64 +} /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128 + +type X__builtin_va_list = uintptr /* <builtin>:46:14 */ +type X__float128 = float64 /* <builtin>:47:21 */ +type Pthread_once = struct { + Fstate int32 + _ [4]byte + Fmutex Pthread_mutex_t +} /* _pthreadtypes.h:52:1 */ + +// Primitive system data type definitions required by P1003.1c. +// +// Note that P1003.1c specifies that there are no defined comparison +// or assignment operators for the types pthread_attr_t, pthread_cond_t, +// pthread_condattr_t, pthread_mutex_t, pthread_mutexattr_t. +type Pthread_t = uintptr /* _pthreadtypes.h:67:26 */ +type Pthread_attr_t = uintptr /* _pthreadtypes.h:70:30 */ +type Pthread_mutex_t = uintptr /* _pthreadtypes.h:71:31 */ +type Pthread_mutexattr_t = uintptr /* _pthreadtypes.h:72:35 */ +type Pthread_cond_t = uintptr /* _pthreadtypes.h:73:30 */ +type Pthread_condattr_t = uintptr /* _pthreadtypes.h:74:34 */ +type Pthread_key_t = int32 /* _pthreadtypes.h:75:20 */ +type Pthread_once_t = Pthread_once /* _pthreadtypes.h:76:30 */ +type Pthread_rwlock_t = uintptr /* _pthreadtypes.h:77:32 */ +type Pthread_rwlockattr_t = uintptr /* _pthreadtypes.h:78:35 */ +type Pthread_barrier_t = uintptr /* _pthreadtypes.h:79:33 */ +type Pthread_barrierattr_t = uintptr /* _pthreadtypes.h:80:36 */ +type Pthread_spinlock_t = uintptr /* _pthreadtypes.h:81:33 */ + +// Additional type definitions: +// +// Note that P1003.1c reserves the prefixes pthread_ and PTHREAD_ for +// use in header symbols. +type Pthread_addr_t = uintptr /* _pthreadtypes.h:89:14 */ +type Pthread_startroutine_t = uintptr /* _pthreadtypes.h:90:14 */ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1988, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)limits.h 8.3 (Berkeley) 1/4/94 +// $FreeBSD$ + +// According to ANSI (section 2.2.4.2), the values below must be usable by +// #if preprocessing directives. Additionally, the expression must have the +// same type as would an expression that is an object of the corresponding +// type converted according to the integral promotions. The subtraction for +// INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an +// unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). + +// max value for an unsigned long long + +// Quads and longs are the same on the amd64. Ensure they stay in sync. + +// Minimum signal stack size. + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-4-Clause +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// Copyright (c) 1990, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. All advertising materials mentioning features or use of this software +// must display the following acknowledgement: +// This product includes software developed by the University of +// California, Berkeley and its contributors. +// 4. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 +// From: @(#)types.h 8.3 (Berkeley) 1/5/94 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1988, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)limits.h 8.3 (Berkeley) 1/4/94 +// $FreeBSD$ + +// Basic types upon which most other types are built. +type X__int8_t = int8 /* _types.h:55:22 */ +type X__uint8_t = uint8 /* _types.h:56:24 */ +type X__int16_t = int16 /* _types.h:57:17 */ +type X__uint16_t = uint16 /* _types.h:58:25 */ +type X__int32_t = int32 /* _types.h:59:15 */ +type X__uint32_t = uint32 /* _types.h:60:23 */ +type X__int64_t = int64 /* _types.h:62:16 */ +type X__uint64_t = uint64 /* _types.h:63:24 */ + +// Standard type definitions. +type X__clock_t = X__int32_t /* _types.h:75:19 */ // clock()... +type X__critical_t = X__int64_t /* _types.h:76:19 */ +type X__double_t = float64 /* _types.h:78:17 */ +type X__float_t = float32 /* _types.h:79:16 */ +type X__intfptr_t = X__int64_t /* _types.h:81:19 */ +type X__intptr_t = X__int64_t /* _types.h:82:19 */ +type X__intmax_t = X__int64_t /* _types.h:93:19 */ +type X__int_fast8_t = X__int32_t /* _types.h:94:19 */ +type X__int_fast16_t = X__int32_t /* _types.h:95:19 */ +type X__int_fast32_t = X__int32_t /* _types.h:96:19 */ +type X__int_fast64_t = X__int64_t /* _types.h:97:19 */ +type X__int_least8_t = X__int8_t /* _types.h:98:18 */ +type X__int_least16_t = X__int16_t /* _types.h:99:19 */ +type X__int_least32_t = X__int32_t /* _types.h:100:19 */ +type X__int_least64_t = X__int64_t /* _types.h:101:19 */ +type X__ptrdiff_t = X__int64_t /* _types.h:103:19 */ // ptr1 - ptr2 +type X__register_t = X__int64_t /* _types.h:104:19 */ +type X__segsz_t = X__int64_t /* _types.h:105:19 */ // segment size (in pages) +type X__size_t = X__uint64_t /* _types.h:106:20 */ // sizeof() +type X__ssize_t = X__int64_t /* _types.h:107:19 */ // byte count or error +type X__time_t = X__int64_t /* _types.h:108:19 */ // time()... +type X__uintfptr_t = X__uint64_t /* _types.h:109:20 */ +type X__uintptr_t = X__uint64_t /* _types.h:110:20 */ +type X__uintmax_t = X__uint64_t /* _types.h:121:20 */ +type X__uint_fast8_t = X__uint32_t /* _types.h:122:20 */ +type X__uint_fast16_t = X__uint32_t /* _types.h:123:20 */ +type X__uint_fast32_t = X__uint32_t /* _types.h:124:20 */ +type X__uint_fast64_t = X__uint64_t /* _types.h:125:20 */ +type X__uint_least8_t = X__uint8_t /* _types.h:126:19 */ +type X__uint_least16_t = X__uint16_t /* _types.h:127:20 */ +type X__uint_least32_t = X__uint32_t /* _types.h:128:20 */ +type X__uint_least64_t = X__uint64_t /* _types.h:129:20 */ +type X__u_register_t = X__uint64_t /* _types.h:131:20 */ +type X__vm_offset_t = X__uint64_t /* _types.h:132:20 */ +type X__vm_paddr_t = X__uint64_t /* _types.h:133:20 */ +type X__vm_size_t = X__uint64_t /* _types.h:134:20 */ +type X___wchar_t = int32 /* _types.h:141:14 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1989, 1991, 1993 +// The Regents of the University of California. All rights reserved. +// (c) UNIX System Laboratories, Inc. +// All or some portions of this file are derived from material licensed +// to the University of California by American Telephone and Telegraph +// Co. or Unix System Laboratories, Inc. and are reproduced herein with +// the permission of UNIX System Laboratories, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)signal.h 8.4 (Berkeley) 5/4/95 +// $FreeBSD$ + +// sigset_t macros. + +type X__sigset = struct{ F__bits [4]X__uint32_t } /* _sigset.h:53:9 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1989, 1991, 1993 +// The Regents of the University of California. All rights reserved. +// (c) UNIX System Laboratories, Inc. +// All or some portions of this file are derived from material licensed +// to the University of California by American Telephone and Telegraph +// Co. or Unix System Laboratories, Inc. and are reproduced herein with +// the permission of UNIX System Laboratories, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)signal.h 8.4 (Berkeley) 5/4/95 +// $FreeBSD$ + +// sigset_t macros. + +type X__sigset_t = X__sigset /* _sigset.h:55:3 */ + +// - +// SPDX-License-Identifier: (BSD-4-Clause AND BSD-2-Clause-FreeBSD) +// +// Copyright (c) 1996, 1997 +// HD Associates, Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. All advertising materials mentioning features or use of this software +// must display the following acknowledgement: +// This product includes software developed by HD Associates, Inc +// and Jukka Antero Ukkonen. +// 4. Neither the name of the author nor the names of any co-contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY HD ASSOCIATES AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL HD ASSOCIATES OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. + +// - +// Copyright (c) 2002-2008, Jeffrey Roberson <jeff@freebsd.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice unmodified, this list of conditions, and the following +// disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// $FreeBSD$ + +// POSIX 1003.1b Process Scheduling + +// POSIX scheduling policies + +type Sched_param = struct{ Fsched_priority int32 } /* sched.h:240:1 */ + +// POSIX scheduling declarations for userland. +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)time.h 8.5 (Berkeley) 5/4/95 +// from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-4-Clause +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// Copyright (c) 1990, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. All advertising materials mentioning features or use of this software +// must display the following acknowledgement: +// This product includes software developed by the University of +// California, Berkeley and its contributors. +// 4. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 +// From: @(#)types.h 8.3 (Berkeley) 1/5/94 +// $FreeBSD$ + +// Standard type definitions. +type X__blksize_t = X__int32_t /* _types.h:40:19 */ // file block size +type X__blkcnt_t = X__int64_t /* _types.h:41:19 */ // file block count +type X__clockid_t = X__int32_t /* _types.h:42:19 */ // clock_gettime()... +type X__fflags_t = X__uint32_t /* _types.h:43:20 */ // file flags +type X__fsblkcnt_t = X__uint64_t /* _types.h:44:20 */ +type X__fsfilcnt_t = X__uint64_t /* _types.h:45:20 */ +type X__gid_t = X__uint32_t /* _types.h:46:20 */ +type X__id_t = X__int64_t /* _types.h:47:19 */ // can hold a gid_t, pid_t, or uid_t +type X__ino_t = X__uint64_t /* _types.h:48:20 */ // inode number +type X__key_t = int64 /* _types.h:49:15 */ // IPC key (for Sys V IPC) +type X__lwpid_t = X__int32_t /* _types.h:50:19 */ // Thread ID (a.k.a. LWP) +type X__mode_t = X__uint16_t /* _types.h:51:20 */ // permissions +type X__accmode_t = int32 /* _types.h:52:14 */ // access permissions +type X__nl_item = int32 /* _types.h:53:14 */ +type X__nlink_t = X__uint64_t /* _types.h:54:20 */ // link count +type X__off_t = X__int64_t /* _types.h:55:19 */ // file offset +type X__off64_t = X__int64_t /* _types.h:56:19 */ // file offset (alias) +type X__pid_t = X__int32_t /* _types.h:57:19 */ // process [group] +type X__rlim_t = X__int64_t /* _types.h:58:19 */ // resource limit - intentionally +// signed, because of legacy code +// that uses -1 for RLIM_INFINITY +type X__sa_family_t = X__uint8_t /* _types.h:61:19 */ +type X__socklen_t = X__uint32_t /* _types.h:62:20 */ +type X__suseconds_t = int64 /* _types.h:63:15 */ // microseconds (signed) +type X__timer_t = uintptr /* _types.h:64:24 */ // timer_gettime()... +type X__mqd_t = uintptr /* _types.h:65:21 */ // mq_open()... +type X__uid_t = X__uint32_t /* _types.h:66:20 */ +type X__useconds_t = uint32 /* _types.h:67:22 */ // microseconds (unsigned) +type X__cpuwhich_t = int32 /* _types.h:68:14 */ // which parameter for cpuset. +type X__cpulevel_t = int32 /* _types.h:69:14 */ // level parameter for cpuset. +type X__cpusetid_t = int32 /* _types.h:70:14 */ // cpuset identifier. +type X__daddr_t = X__int64_t /* _types.h:71:19 */ // bwrite(3), FIOBMAP2, etc + +// Unusual type definitions. +// rune_t is declared to be an ``int'' instead of the more natural +// ``unsigned long'' or ``long''. Two things are happening here. It is not +// unsigned so that EOF (-1) can be naturally assigned to it and used. Also, +// it looks like 10646 will be a 31 bit standard. This means that if your +// ints cannot hold 32 bits, you will be in trouble. The reason an int was +// chosen over a long is that the is*() and to*() routines take ints (says +// ANSI C), but they use __ct_rune_t instead of int. +// +// NOTE: rune_t is not covered by ANSI nor other standards, and should not +// be instantiated outside of lib/libc/locale. Use wchar_t. wint_t and +// rune_t must be the same type. Also, wint_t should be able to hold all +// members of the largest character set plus one extra value (WEOF), and +// must be at least 16 bits. +type X__ct_rune_t = int32 /* _types.h:91:14 */ // arg type for ctype funcs +type X__rune_t = X__ct_rune_t /* _types.h:92:21 */ // rune_t (see above) +type X__wint_t = X__ct_rune_t /* _types.h:93:21 */ // wint_t (see above) + +// Clang already provides these types as built-ins, but only in C++ mode. +type X__char16_t = X__uint_least16_t /* _types.h:97:26 */ +type X__char32_t = X__uint_least32_t /* _types.h:98:26 */ +// In C++11, char16_t and char32_t are built-in types. + +type X__max_align_t = struct { + F__max_align1 int64 + F__max_align2 float64 +} /* _types.h:111:3 */ + +type X__dev_t = X__uint64_t /* _types.h:113:20 */ // device number + +type X__fixpt_t = X__uint32_t /* _types.h:115:20 */ // fixed point number + +// mbstate_t is an opaque object to keep conversion state during multibyte +// stream conversions. +type X__mbstate_t = struct { + _ [0]uint64 + F__mbstate8 [128]int8 +} /* _types.h:124:3 */ + +type X__rman_res_t = X__uintmax_t /* _types.h:126:25 */ + +// Types for varargs. These are all provided by builtin types these +// days, so centralize their definition. +type X__va_list = X__builtin_va_list /* _types.h:133:27 */ // internally known to gcc +type X__gnuc_va_list = X__va_list /* _types.h:140:20 */ // compatibility w/GNU headers + +// When the following macro is defined, the system uses 64-bit inode numbers. +// Programs can use this to avoid including <sys/param.h>, with its associated +// namespace pollution. + +type Time_t = X__time_t /* _timespec.h:42:18 */ + +type Timespec = struct { + Ftv_sec Time_t + Ftv_nsec int64 +} /* _timespec.h:46:1 */ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +type Pid_t = X__pid_t /* sched.h:253:25 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1989, 1993 +// The Regents of the University of California. All rights reserved. +// (c) UNIX System Laboratories, Inc. +// All or some portions of this file are derived from material licensed +// to the University of California by American Telephone and Telegraph +// Co. or Unix System Laboratories, Inc. and are reproduced herein with +// the permission of UNIX System Laboratories, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)time.h 8.3 (Berkeley) 1/21/94 + +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2003 Marcel Moolenaar +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// Frequency of the clock ticks reported by times(). Deprecated - use +// sysconf(_SC_CLK_TCK) instead. (Removed in 1003.1-2001.) + +// Frequency of the clock ticks reported by clock(). + +type Clock_t = X__clock_t /* time.h:62:19 */ + +// New in POSIX 1003.1b-1993. +type Clockid_t = X__clockid_t /* time.h:81:21 */ + +type Timer_t = X__timer_t /* time.h:86:19 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)time.h 8.5 (Berkeley) 5/4/95 +// from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)time.h 8.5 (Berkeley) 5/4/95 +// from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp +// $FreeBSD$ + +// Structure defined by POSIX.1b to be like a itimerval, but with +// timespecs. Used in the timer_*() system calls. +type Itimerspec = struct { + Fit_interval struct { + Ftv_sec Time_t + Ftv_nsec int64 + } + Fit_value struct { + Ftv_sec Time_t + Ftv_nsec int64 + } +} /* timespec.h:60:1 */ + +// These macros are also in sys/time.h. + +type Tm = struct { + Ftm_sec int32 + Ftm_min int32 + Ftm_hour int32 + Ftm_mday int32 + Ftm_mon int32 + Ftm_year int32 + Ftm_wday int32 + Ftm_yday int32 + Ftm_isdst int32 + _ [4]byte + Ftm_gmtoff int64 + Ftm_zone uintptr +} /* time.h:129:1 */ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2011, 2012 The FreeBSD Foundation +// All rights reserved. +// +// This software was developed by David Chisnall under sponsorship from +// the FreeBSD Foundation. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +type Locale_t = uintptr /* _time.h:36:25 */ + +type X_pthread_cleanup_info = struct{ Fpthread_cleanup_pad [8]X__uintptr_t } /* pthread.h:143:1 */ + +var _ int8 /* gen.c:2:13: */ diff --git a/vendor/modernc.org/libc/pthreads.go b/vendor/modernc.org/libc/pthreads.go index 680e10ead..9f4db4dbb 100644 --- a/vendor/modernc.org/libc/pthreads.go +++ b/vendor/modernc.org/libc/pthreads.go @@ -4,9 +4,14 @@ //TODO darwin,amd64 //TODO darwin,arm64 +//TODO freebsd,amd64 +//TODO linux,386 +//TODO linux,arm +//TODO linux,arm64 //TODO linux,s390x -// +build linux,amd64 linux,386 linux,arm64 +//go:build linux && amd64 +// +build linux,amd64 package libc // import "modernc.org/libc" diff --git a/vendor/modernc.org/libc/pwd/capi_freebsd_amd64.go b/vendor/modernc.org/libc/pwd/capi_freebsd_amd64.go new file mode 100644 index 000000000..d488fcf5c --- /dev/null +++ b/vendor/modernc.org/libc/pwd/capi_freebsd_amd64.go @@ -0,0 +1,5 @@ +// Code generated by 'ccgo pwd/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 pwd/pwd_freebsd_amd64.go -pkgname pwd', DO NOT EDIT. + +package pwd + +var CAPI = map[string]struct{}{} diff --git a/vendor/modernc.org/libc/pwd/pwd_freebsd_amd64.go b/vendor/modernc.org/libc/pwd/pwd_freebsd_amd64.go new file mode 100644 index 000000000..2fee7aa6e --- /dev/null +++ b/vendor/modernc.org/libc/pwd/pwd_freebsd_amd64.go @@ -0,0 +1,676 @@ +// Code generated by 'ccgo pwd/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 pwd/pwd_freebsd_amd64.go -pkgname pwd', DO NOT EDIT. + +package pwd + +import ( + "math" + "reflect" + "sync/atomic" + "unsafe" +) + +var _ = math.Pi +var _ reflect.Kind +var _ atomic.Value +var _ unsafe.Pointer + +const ( + X_FILE_OFFSET_BITS = 64 + X_GID_T_DECLARED = 0 + X_LP64 = 1 + X_MACHINE__LIMITS_H_ = 0 + X_MACHINE__TYPES_H_ = 0 + X_MASTERPASSWD = "master.passwd" + X_MP_DB = "pwd.db" + X_Nonnull = 0 + X_Null_unspecified = 0 + X_Nullable = 0 + X_PASSWD = "passwd" + X_PASSWORD_EFMT1 = 95 + X_PASSWORD_LEN = 128 + X_PATH_MASTERPASSWD = "/etc/master.passwd" + X_PATH_MP_DB = "/etc/pwd.db" + X_PATH_PASSWD = "/etc/passwd" + X_PATH_PWD = "/etc" + X_PATH_PWD_MKDB = "/usr/sbin/pwd_mkdb" + X_PATH_SMP_DB = "/etc/spwd.db" + X_PWD_CURRENT_VERSION = 4 + X_PWD_H_ = 0 + X_PWF_CHANGE = 16 + X_PWF_CLASS = 32 + X_PWF_DIR = 128 + X_PWF_EXPIRE = 512 + X_PWF_FILES = 0x1000 + X_PWF_GECOS = 64 + X_PWF_GID = 8 + X_PWF_HESIOD = 0x3000 + X_PWF_NAME = 1 + X_PWF_NIS = 0x2000 + X_PWF_PASSWD = 2 + X_PWF_SHELL = 256 + X_PWF_SOURCE = 0x3000 + X_PWF_UID = 4 + X_PW_KEYBYNAME = 49 + X_PW_KEYBYNUM = 50 + X_PW_KEYBYUID = 51 + X_PW_KEYYPBYNUM = 53 + X_PW_KEYYPENABLED = 52 + X_PW_VERSION_MASK = 240 + X_SIZE_T_DECLARED = 0 + X_SMP_DB = "spwd.db" + X_SYS_CDEFS_H_ = 0 + X_SYS__TYPES_H_ = 0 + X_TIME_T_DECLARED = 0 + X_UID_T_DECLARED = 0 + Unix = 1 +) + +type Ptrdiff_t = int64 /* <builtin>:3:26 */ + +type Size_t = uint64 /* <builtin>:9:23 */ + +type Wchar_t = int32 /* <builtin>:15:24 */ + +type X__int128_t = struct { + Flo int64 + Fhi int64 +} /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128 +type X__uint128_t = struct { + Flo uint64 + Fhi uint64 +} /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128 + +type X__builtin_va_list = uintptr /* <builtin>:46:14 */ +type X__float128 = float64 /* <builtin>:47:21 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1989, 1993 +// The Regents of the University of California. All rights reserved. +// (c) UNIX System Laboratories, Inc. +// All or some portions of this file are derived from material licensed +// to the University of California by American Telephone and Telegraph +// Co. or Unix System Laboratories, Inc. and are reproduced herein with +// the permission of UNIX System Laboratories, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)pwd.h 8.2 (Berkeley) 1/21/94 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// Testing against Clang-specific extensions. + +// This code has been put in place to help reduce the addition of +// compiler specific defines in FreeBSD code. It helps to aid in +// having a compiler-agnostic source tree. + +// Compiler memory barriers, specific to gcc and clang. + +// XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced + +// Macro to test if we're using a specific version of gcc or later. + +// The __CONCAT macro is used to concatenate parts of symbol names, e.g. +// with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. +// The __CONCAT macro is a bit tricky to use if it must work in non-ANSI +// mode -- there must be no spaces between its arguments, and for nested +// __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also +// concatenate double-quoted strings produced by the __STRING macro, but +// this only works with ANSI C. +// +// __XSTRING is like __STRING, but it expands any macros in its argument +// first. It is only available with ANSI C. + +// Compiler-dependent macros to help declare dead (non-returning) and +// pure (no side effects) functions, and unused variables. They are +// null except for versions of gcc that are known to support the features +// properly (old versions of gcc-2 supported the dead and pure features +// in a different (wrong) way). If we do not provide an implementation +// for a given compiler, let the compile fail if it is told to use +// a feature that we cannot live without. + +// Keywords added in C11. + +// Emulation of C11 _Generic(). Unlike the previously defined C11 +// keywords, it is not possible to implement this using exactly the same +// syntax. Therefore implement something similar under the name +// __generic(). Unlike _Generic(), this macro can only distinguish +// between a single type, so it requires nested invocations to +// distinguish multiple cases. + +// C99 Static array indices in function parameter declarations. Syntax such as: +// void bar(int myArray[static 10]); +// is allowed in C99 but not in C++. Define __min_size appropriately so +// headers using it can be compiled in either language. Use like this: +// void bar(int myArray[__min_size(10)]); + +// XXX: should use `#if __STDC_VERSION__ < 199901'. + +// C++11 exposes a load of C99 stuff + +// GCC 2.95 provides `__restrict' as an extension to C90 to support the +// C99-specific `restrict' type qualifier. We happen to use `__restrict' as +// a way to define the `restrict' type qualifier without disturbing older +// software that is unaware of C99 keywords. + +// GNU C version 2.96 adds explicit branch prediction so that +// the CPU back-end can hint the processor and also so that +// code blocks can be reordered such that the predicted path +// sees a more linear flow, thus improving cache behavior, etc. +// +// The following two macros provide us with a way to utilize this +// compiler feature. Use __predict_true() if you expect the expression +// to evaluate to true, and __predict_false() if you expect the +// expression to evaluate to false. +// +// A few notes about usage: +// +// * Generally, __predict_false() error condition checks (unless +// you have some _strong_ reason to do otherwise, in which case +// document it), and/or __predict_true() `no-error' condition +// checks, assuming you want to optimize for the no-error case. +// +// * Other than that, if you don't know the likelihood of a test +// succeeding from empirical or other `hard' evidence, don't +// make predictions. +// +// * These are meant to be used in places that are run `a lot'. +// It is wasteful to make predictions in code that is run +// seldomly (e.g. at subsystem initialization time) as the +// basic block reordering that this affects can often generate +// larger code. + +// We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h> +// require it. + +// Given the pointer x to the member m of the struct s, return +// a pointer to the containing structure. When using GCC, we first +// assign pointer x to a local variable, to check that its type is +// compatible with member m. + +// Compiler-dependent macros to declare that functions take printf-like +// or scanf-like arguments. They are null except for versions of gcc +// that are known to support the features properly (old versions of gcc-2 +// didn't permit keeping the keywords out of the application namespace). + +// Compiler-dependent macros that rely on FreeBSD-specific extensions. + +// Embed the rcs id of a source file in the resulting library. Note that in +// more recent ELF binutils, we use .ident allowing the ID to be stripped. +// Usage: +// __FBSDID("$FreeBSD$"); + +// - +// The following definitions are an extension of the behavior originally +// implemented in <sys/_posix.h>, but with a different level of granularity. +// POSIX.1 requires that the macros we test be defined before any standard +// header file is included. +// +// Here's a quick run-down of the versions: +// defined(_POSIX_SOURCE) 1003.1-1988 +// _POSIX_C_SOURCE == 1 1003.1-1990 +// _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option +// _POSIX_C_SOURCE == 199309 1003.1b-1993 +// _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, +// and the omnibus ISO/IEC 9945-1: 1996 +// _POSIX_C_SOURCE == 200112 1003.1-2001 +// _POSIX_C_SOURCE == 200809 1003.1-2008 +// +// In addition, the X/Open Portability Guide, which is now the Single UNIX +// Specification, defines a feature-test macro which indicates the version of +// that specification, and which subsumes _POSIX_C_SOURCE. +// +// Our macros begin with two underscores to avoid namespace screwage. + +// Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. + +// Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. + +// Deal with various X/Open Portability Guides and Single UNIX Spec. + +// Deal with all versions of POSIX. The ordering relative to the tests above is +// important. +// - +// Deal with _ANSI_SOURCE: +// If it is defined, and no other compilation environment is explicitly +// requested, then define our internal feature-test macros to zero. This +// makes no difference to the preprocessor (undefined symbols in preprocessing +// expressions are defined to have value zero), but makes it more convenient for +// a test program to print out the values. +// +// If a program mistakenly defines _ANSI_SOURCE and some other macro such as +// _POSIX_C_SOURCE, we will assume that it wants the broader compilation +// environment (and in fact we will never get here). + +// User override __EXT1_VISIBLE + +// Old versions of GCC use non-standard ARM arch symbols; acle-compat.h +// translates them to __ARM_ARCH and the modern feature symbols defined by ARM. + +// Nullability qualifiers: currently only supported by Clang. + +// Type Safety Checking +// +// Clang provides additional attributes to enable checking type safety +// properties that cannot be enforced by the C type system. + +// Lock annotations. +// +// Clang provides support for doing basic thread-safety tests at +// compile-time, by marking which locks will/should be held when +// entering/leaving a functions. +// +// Furthermore, it is also possible to annotate variables and structure +// members to enforce that they are only accessed when certain locks are +// held. + +// Structure implements a lock. + +// Function acquires an exclusive or shared lock. + +// Function attempts to acquire an exclusive or shared lock. + +// Function releases a lock. + +// Function asserts that an exclusive or shared lock is held. + +// Function requires that an exclusive or shared lock is or is not held. + +// Function should not be analyzed. + +// Function or variable should not be sanitized, i.e. by AddressSanitizer. +// GCC has the nosanitize attribute, but as a function attribute only, and +// warns on use as a variable attribute. + +// Guard variables and structure members by lock. + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-4-Clause +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// Copyright (c) 1990, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. All advertising materials mentioning features or use of this software +// must display the following acknowledgement: +// This product includes software developed by the University of +// California, Berkeley and its contributors. +// 4. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 +// From: @(#)types.h 8.3 (Berkeley) 1/5/94 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1988, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)limits.h 8.3 (Berkeley) 1/4/94 +// $FreeBSD$ + +// According to ANSI (section 2.2.4.2), the values below must be usable by +// #if preprocessing directives. Additionally, the expression must have the +// same type as would an expression that is an object of the corresponding +// type converted according to the integral promotions. The subtraction for +// INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an +// unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). + +// max value for an unsigned long long + +// Quads and longs are the same on the amd64. Ensure they stay in sync. + +// Minimum signal stack size. + +// Basic types upon which most other types are built. +type X__int8_t = int8 /* _types.h:55:22 */ +type X__uint8_t = uint8 /* _types.h:56:24 */ +type X__int16_t = int16 /* _types.h:57:17 */ +type X__uint16_t = uint16 /* _types.h:58:25 */ +type X__int32_t = int32 /* _types.h:59:15 */ +type X__uint32_t = uint32 /* _types.h:60:23 */ +type X__int64_t = int64 /* _types.h:62:16 */ +type X__uint64_t = uint64 /* _types.h:63:24 */ + +// Standard type definitions. +type X__clock_t = X__int32_t /* _types.h:75:19 */ // clock()... +type X__critical_t = X__int64_t /* _types.h:76:19 */ +type X__double_t = float64 /* _types.h:78:17 */ +type X__float_t = float32 /* _types.h:79:16 */ +type X__intfptr_t = X__int64_t /* _types.h:81:19 */ +type X__intptr_t = X__int64_t /* _types.h:82:19 */ +type X__intmax_t = X__int64_t /* _types.h:93:19 */ +type X__int_fast8_t = X__int32_t /* _types.h:94:19 */ +type X__int_fast16_t = X__int32_t /* _types.h:95:19 */ +type X__int_fast32_t = X__int32_t /* _types.h:96:19 */ +type X__int_fast64_t = X__int64_t /* _types.h:97:19 */ +type X__int_least8_t = X__int8_t /* _types.h:98:18 */ +type X__int_least16_t = X__int16_t /* _types.h:99:19 */ +type X__int_least32_t = X__int32_t /* _types.h:100:19 */ +type X__int_least64_t = X__int64_t /* _types.h:101:19 */ +type X__ptrdiff_t = X__int64_t /* _types.h:103:19 */ // ptr1 - ptr2 +type X__register_t = X__int64_t /* _types.h:104:19 */ +type X__segsz_t = X__int64_t /* _types.h:105:19 */ // segment size (in pages) +type X__size_t = X__uint64_t /* _types.h:106:20 */ // sizeof() +type X__ssize_t = X__int64_t /* _types.h:107:19 */ // byte count or error +type X__time_t = X__int64_t /* _types.h:108:19 */ // time()... +type X__uintfptr_t = X__uint64_t /* _types.h:109:20 */ +type X__uintptr_t = X__uint64_t /* _types.h:110:20 */ +type X__uintmax_t = X__uint64_t /* _types.h:121:20 */ +type X__uint_fast8_t = X__uint32_t /* _types.h:122:20 */ +type X__uint_fast16_t = X__uint32_t /* _types.h:123:20 */ +type X__uint_fast32_t = X__uint32_t /* _types.h:124:20 */ +type X__uint_fast64_t = X__uint64_t /* _types.h:125:20 */ +type X__uint_least8_t = X__uint8_t /* _types.h:126:19 */ +type X__uint_least16_t = X__uint16_t /* _types.h:127:20 */ +type X__uint_least32_t = X__uint32_t /* _types.h:128:20 */ +type X__uint_least64_t = X__uint64_t /* _types.h:129:20 */ +type X__u_register_t = X__uint64_t /* _types.h:131:20 */ +type X__vm_offset_t = X__uint64_t /* _types.h:132:20 */ +type X__vm_paddr_t = X__uint64_t /* _types.h:133:20 */ +type X__vm_size_t = X__uint64_t /* _types.h:134:20 */ +type X___wchar_t = int32 /* _types.h:141:14 */ + +// Standard type definitions. +type X__blksize_t = X__int32_t /* _types.h:40:19 */ // file block size +type X__blkcnt_t = X__int64_t /* _types.h:41:19 */ // file block count +type X__clockid_t = X__int32_t /* _types.h:42:19 */ // clock_gettime()... +type X__fflags_t = X__uint32_t /* _types.h:43:20 */ // file flags +type X__fsblkcnt_t = X__uint64_t /* _types.h:44:20 */ +type X__fsfilcnt_t = X__uint64_t /* _types.h:45:20 */ +type X__gid_t = X__uint32_t /* _types.h:46:20 */ +type X__id_t = X__int64_t /* _types.h:47:19 */ // can hold a gid_t, pid_t, or uid_t +type X__ino_t = X__uint64_t /* _types.h:48:20 */ // inode number +type X__key_t = int64 /* _types.h:49:15 */ // IPC key (for Sys V IPC) +type X__lwpid_t = X__int32_t /* _types.h:50:19 */ // Thread ID (a.k.a. LWP) +type X__mode_t = X__uint16_t /* _types.h:51:20 */ // permissions +type X__accmode_t = int32 /* _types.h:52:14 */ // access permissions +type X__nl_item = int32 /* _types.h:53:14 */ +type X__nlink_t = X__uint64_t /* _types.h:54:20 */ // link count +type X__off_t = X__int64_t /* _types.h:55:19 */ // file offset +type X__off64_t = X__int64_t /* _types.h:56:19 */ // file offset (alias) +type X__pid_t = X__int32_t /* _types.h:57:19 */ // process [group] +type X__rlim_t = X__int64_t /* _types.h:58:19 */ // resource limit - intentionally +// signed, because of legacy code +// that uses -1 for RLIM_INFINITY +type X__sa_family_t = X__uint8_t /* _types.h:61:19 */ +type X__socklen_t = X__uint32_t /* _types.h:62:20 */ +type X__suseconds_t = int64 /* _types.h:63:15 */ // microseconds (signed) +type X__timer_t = uintptr /* _types.h:64:24 */ // timer_gettime()... +type X__mqd_t = uintptr /* _types.h:65:21 */ // mq_open()... +type X__uid_t = X__uint32_t /* _types.h:66:20 */ +type X__useconds_t = uint32 /* _types.h:67:22 */ // microseconds (unsigned) +type X__cpuwhich_t = int32 /* _types.h:68:14 */ // which parameter for cpuset. +type X__cpulevel_t = int32 /* _types.h:69:14 */ // level parameter for cpuset. +type X__cpusetid_t = int32 /* _types.h:70:14 */ // cpuset identifier. +type X__daddr_t = X__int64_t /* _types.h:71:19 */ // bwrite(3), FIOBMAP2, etc + +// Unusual type definitions. +// rune_t is declared to be an ``int'' instead of the more natural +// ``unsigned long'' or ``long''. Two things are happening here. It is not +// unsigned so that EOF (-1) can be naturally assigned to it and used. Also, +// it looks like 10646 will be a 31 bit standard. This means that if your +// ints cannot hold 32 bits, you will be in trouble. The reason an int was +// chosen over a long is that the is*() and to*() routines take ints (says +// ANSI C), but they use __ct_rune_t instead of int. +// +// NOTE: rune_t is not covered by ANSI nor other standards, and should not +// be instantiated outside of lib/libc/locale. Use wchar_t. wint_t and +// rune_t must be the same type. Also, wint_t should be able to hold all +// members of the largest character set plus one extra value (WEOF), and +// must be at least 16 bits. +type X__ct_rune_t = int32 /* _types.h:91:14 */ // arg type for ctype funcs +type X__rune_t = X__ct_rune_t /* _types.h:92:21 */ // rune_t (see above) +type X__wint_t = X__ct_rune_t /* _types.h:93:21 */ // wint_t (see above) + +// Clang already provides these types as built-ins, but only in C++ mode. +type X__char16_t = X__uint_least16_t /* _types.h:97:26 */ +type X__char32_t = X__uint_least32_t /* _types.h:98:26 */ +// In C++11, char16_t and char32_t are built-in types. + +type X__max_align_t = struct { + F__max_align1 int64 + F__max_align2 float64 +} /* _types.h:111:3 */ + +type X__dev_t = X__uint64_t /* _types.h:113:20 */ // device number + +type X__fixpt_t = X__uint32_t /* _types.h:115:20 */ // fixed point number + +// mbstate_t is an opaque object to keep conversion state during multibyte +// stream conversions. +type X__mbstate_t = struct { + _ [0]uint64 + F__mbstate8 [128]int8 +} /* _types.h:124:3 */ + +type X__rman_res_t = X__uintmax_t /* _types.h:126:25 */ + +// Types for varargs. These are all provided by builtin types these +// days, so centralize their definition. +type X__va_list = X__builtin_va_list /* _types.h:133:27 */ // internally known to gcc +type X__gnuc_va_list = X__va_list /* _types.h:140:20 */ // compatibility w/GNU headers + +// When the following macro is defined, the system uses 64-bit inode numbers. +// Programs can use this to avoid including <sys/param.h>, with its associated +// namespace pollution. + +type Gid_t = X__gid_t /* pwd.h:47:18 */ + +type Time_t = X__time_t /* pwd.h:52:18 */ + +type Uid_t = X__uid_t /* pwd.h:57:18 */ + +// Historically, the keys in _PATH_MP_DB/_PATH_SMP_DB had the format +// `1 octet tag | key', where the tag is one of the _PW_KEY* values +// listed below. These values happen to be ASCII digits. Starting +// with FreeBSD 5.1, the tag is now still a single octet, but the +// upper 4 bits are interpreted as a version. Pre-FreeBSD 5.1 format +// entries are version `3' -- this conveniently results in the same +// key values as before. The new, architecture-independent entries +// are version `4'. +// As it happens, some applications read the database directly. +// (Bad app, no cookie!) Thus, we leave the _PW_KEY* symbols at their +// old pre-FreeBSD 5.1 values so these apps still work. Consequently +// we have to muck around a bit more to get the correct, versioned +// tag, and that is what the _PW_VERSIONED macro is about. + +// The database also contains a key to indicate the format version of +// the entries therein. There may be other, older versioned entries +// as well. + +type Passwd = struct { + Fpw_name uintptr + Fpw_passwd uintptr + Fpw_uid Uid_t + Fpw_gid Gid_t + Fpw_change Time_t + Fpw_class uintptr + Fpw_gecos uintptr + Fpw_dir uintptr + Fpw_shell uintptr + Fpw_expire Time_t + Fpw_fields int32 + _ [4]byte +} /* pwd.h:114:1 */ + +var _ int8 /* gen.c:2:13: */ diff --git a/vendor/modernc.org/libc/signal/capi_freebsd_amd64.go b/vendor/modernc.org/libc/signal/capi_freebsd_amd64.go new file mode 100644 index 000000000..218bb0ad5 --- /dev/null +++ b/vendor/modernc.org/libc/signal/capi_freebsd_amd64.go @@ -0,0 +1,5 @@ +// Code generated by 'ccgo signal/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 signal/signal_freebsd_amd64.go -pkgname signal', DO NOT EDIT. + +package signal + +var CAPI = map[string]struct{}{} diff --git a/vendor/modernc.org/libc/signal/more_freebsd_amd64.go b/vendor/modernc.org/libc/signal/more_freebsd_amd64.go new file mode 100644 index 000000000..c1791b2a5 --- /dev/null +++ b/vendor/modernc.org/libc/signal/more_freebsd_amd64.go @@ -0,0 +1,12 @@ +// Copyright 2020 The Libc Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package signal + +const ( + // sys/sys/signal.h:139:#define SIG_DFL ((__sighandler_t *)0) + SIG_DFL = 0 + // sys/sys/signal.h:140:#define SIG_IGN ((__sighandler_t *)1) + SIG_IGN = 1 +) diff --git a/vendor/modernc.org/libc/signal/signal_freebsd_amd64.go b/vendor/modernc.org/libc/signal/signal_freebsd_amd64.go new file mode 100644 index 000000000..755237219 --- /dev/null +++ b/vendor/modernc.org/libc/signal/signal_freebsd_amd64.go @@ -0,0 +1,1621 @@ +// Code generated by 'ccgo signal/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 signal/signal_freebsd_amd64.go -pkgname signal', DO NOT EDIT. + +package signal + +import ( + "math" + "reflect" + "sync/atomic" + "unsafe" +) + +var _ = math.Pi +var _ reflect.Kind +var _ atomic.Value +var _ unsafe.Pointer + +const ( + BUS_ADRALN = 1 + BUS_ADRERR = 2 + BUS_OBJERR = 3 + BUS_OOMERR = 100 + CLD_CONTINUED = 6 + CLD_DUMPED = 3 + CLD_EXITED = 1 + CLD_KILLED = 2 + CLD_STOPPED = 5 + CLD_TRAPPED = 4 + FPE_FLTDIV = 3 + FPE_FLTINV = 7 + FPE_FLTOVF = 4 + FPE_FLTRES = 6 + FPE_FLTSUB = 8 + FPE_FLTUND = 5 + FPE_INTDIV = 2 + FPE_INTOVF = 1 + ILL_BADSTK = 8 + ILL_COPROC = 7 + ILL_ILLADR = 3 + ILL_ILLOPC = 1 + ILL_ILLOPN = 2 + ILL_ILLTRP = 4 + ILL_PRVOPC = 5 + ILL_PRVREG = 6 + MINSIGSTKSZ = 2048 + NSIG = 32 + POLL_ERR = 4 + POLL_HUP = 6 + POLL_IN = 1 + POLL_MSG = 3 + POLL_OUT = 2 + POLL_PRI = 5 + SA_NOCLDSTOP = 0x0008 + SA_NOCLDWAIT = 0x0020 + SA_NODEFER = 0x0010 + SA_ONSTACK = 0x0001 + SA_RESETHAND = 0x0004 + SA_RESTART = 0x0002 + SA_SIGINFO = 0x0040 + SEGV_ACCERR = 2 + SEGV_MAPERR = 1 + SEGV_PKUERR = 100 + SIGABRT = 6 + SIGALRM = 14 + SIGBUS = 10 + SIGCHLD = 20 + SIGCONT = 19 + SIGEMT = 7 + SIGEV_KEVENT = 3 + SIGEV_NONE = 0 + SIGEV_SIGNAL = 1 + SIGEV_THREAD = 2 + SIGEV_THREAD_ID = 4 + SIGFPE = 8 + SIGHUP = 1 + SIGILL = 4 + SIGINFO = 29 + SIGINT = 2 + SIGIO = 23 + SIGIOT = 6 + SIGKILL = 9 + SIGLIBRT = 33 + SIGLWP = 32 + SIGPIPE = 13 + SIGPROF = 27 + SIGQUIT = 3 + SIGRTMAX = 126 + SIGRTMIN = 65 + SIGSEGV = 11 + SIGSTKSZ = 34816 + SIGSTOP = 17 + SIGSYS = 12 + SIGTERM = 15 + SIGTHR = 32 + SIGTRAP = 5 + SIGTSTP = 18 + SIGTTIN = 21 + SIGTTOU = 22 + SIGURG = 16 + SIGUSR1 = 30 + SIGUSR2 = 31 + SIGVTALRM = 26 + SIGWINCH = 28 + SIGXCPU = 24 + SIGXFSZ = 25 + SIG_BLOCK = 1 + SIG_SETMASK = 3 + SIG_UNBLOCK = 2 + SI_ASYNCIO = 0x10004 + SI_KERNEL = 0x10006 + SI_LWP = 0x10007 + SI_MESGQ = 0x10005 + SI_NOINFO = 0 + SI_QUEUE = 0x10002 + SI_TIMER = 0x10003 + SI_UNDEFINED = 0 + SI_USER = 0x10001 + SS_DISABLE = 0x0004 + SS_ONSTACK = 0x0001 + SV_INTERRUPT = 2 + SV_NOCLDSTOP = 8 + SV_NODEFER = 16 + SV_ONSTACK = 1 + SV_RESETHAND = 4 + SV_SIGINFO = 64 + TRAP_BRKPT = 1 + TRAP_CAP = 4 + TRAP_DTRACE = 3 + TRAP_TRACE = 2 + X_FILE_OFFSET_BITS = 64 + X_LP64 = 1 + X_MACHINE__LIMITS_H_ = 0 + X_MACHINE__TYPES_H_ = 0 + X_MC_FLAG_MASK = 7 + X_MC_FPFMT_NODEV = 0x10000 + X_MC_FPFMT_XMM = 0x10002 + X_MC_FPOWNED_FPU = 0x20001 + X_MC_FPOWNED_NONE = 0x20000 + X_MC_FPOWNED_PCB = 0x20002 + X_MC_HASBASES = 0x2 + X_MC_HASFPXSTATE = 0x4 + X_MC_HASSEGS = 0x1 + X_Nonnull = 0 + X_Null_unspecified = 0 + X_Nullable = 0 + X_PID_T_DECLARED = 0 + X_PTHREAD_T_DECLARED = 0 + X_SIGNAL_H_ = 0 + X_SIGSET_T_DECLARED = 0 + X_SIG_MAXSIG = 128 + X_SIG_WORDS = 4 + X_SIZE_T_DECLARED = 0 + X_SYS_CDEFS_H_ = 0 + X_SYS_SIGNAL_H_ = 0 + X_SYS__PTHREADTYPES_H_ = 0 + X_SYS__SIGSET_H_ = 0 + X_SYS__TIMESPEC_H_ = 0 + X_SYS__TYPES_H_ = 0 + X_SYS__UCONTEXT_H_ = 0 + X_TIME_T_DECLARED = 0 + X_UID_T_DECLARED = 0 + X_X86_SIGNAL_H = 1 + X_X86_UCONTEXT_H_ = 0 + Unix = 1 +) + +type Ptrdiff_t = int64 /* <builtin>:3:26 */ + +type Size_t = uint64 /* <builtin>:9:23 */ + +type Wchar_t = int32 /* <builtin>:15:24 */ + +type X__int128_t = struct { + Flo int64 + Fhi int64 +} /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128 +type X__uint128_t = struct { + Flo uint64 + Fhi uint64 +} /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128 + +type X__builtin_va_list = uintptr /* <builtin>:46:14 */ +type X__float128 = float64 /* <builtin>:47:21 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)signal.h 8.3 (Berkeley) 3/30/94 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// Testing against Clang-specific extensions. + +// This code has been put in place to help reduce the addition of +// compiler specific defines in FreeBSD code. It helps to aid in +// having a compiler-agnostic source tree. + +// Compiler memory barriers, specific to gcc and clang. + +// XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced + +// Macro to test if we're using a specific version of gcc or later. + +// The __CONCAT macro is used to concatenate parts of symbol names, e.g. +// with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. +// The __CONCAT macro is a bit tricky to use if it must work in non-ANSI +// mode -- there must be no spaces between its arguments, and for nested +// __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also +// concatenate double-quoted strings produced by the __STRING macro, but +// this only works with ANSI C. +// +// __XSTRING is like __STRING, but it expands any macros in its argument +// first. It is only available with ANSI C. + +// Compiler-dependent macros to help declare dead (non-returning) and +// pure (no side effects) functions, and unused variables. They are +// null except for versions of gcc that are known to support the features +// properly (old versions of gcc-2 supported the dead and pure features +// in a different (wrong) way). If we do not provide an implementation +// for a given compiler, let the compile fail if it is told to use +// a feature that we cannot live without. + +// Keywords added in C11. + +// Emulation of C11 _Generic(). Unlike the previously defined C11 +// keywords, it is not possible to implement this using exactly the same +// syntax. Therefore implement something similar under the name +// __generic(). Unlike _Generic(), this macro can only distinguish +// between a single type, so it requires nested invocations to +// distinguish multiple cases. + +// C99 Static array indices in function parameter declarations. Syntax such as: +// void bar(int myArray[static 10]); +// is allowed in C99 but not in C++. Define __min_size appropriately so +// headers using it can be compiled in either language. Use like this: +// void bar(int myArray[__min_size(10)]); + +// XXX: should use `#if __STDC_VERSION__ < 199901'. + +// C++11 exposes a load of C99 stuff + +// GCC 2.95 provides `__restrict' as an extension to C90 to support the +// C99-specific `restrict' type qualifier. We happen to use `__restrict' as +// a way to define the `restrict' type qualifier without disturbing older +// software that is unaware of C99 keywords. + +// GNU C version 2.96 adds explicit branch prediction so that +// the CPU back-end can hint the processor and also so that +// code blocks can be reordered such that the predicted path +// sees a more linear flow, thus improving cache behavior, etc. +// +// The following two macros provide us with a way to utilize this +// compiler feature. Use __predict_true() if you expect the expression +// to evaluate to true, and __predict_false() if you expect the +// expression to evaluate to false. +// +// A few notes about usage: +// +// * Generally, __predict_false() error condition checks (unless +// you have some _strong_ reason to do otherwise, in which case +// document it), and/or __predict_true() `no-error' condition +// checks, assuming you want to optimize for the no-error case. +// +// * Other than that, if you don't know the likelihood of a test +// succeeding from empirical or other `hard' evidence, don't +// make predictions. +// +// * These are meant to be used in places that are run `a lot'. +// It is wasteful to make predictions in code that is run +// seldomly (e.g. at subsystem initialization time) as the +// basic block reordering that this affects can often generate +// larger code. + +// We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h> +// require it. + +// Given the pointer x to the member m of the struct s, return +// a pointer to the containing structure. When using GCC, we first +// assign pointer x to a local variable, to check that its type is +// compatible with member m. + +// Compiler-dependent macros to declare that functions take printf-like +// or scanf-like arguments. They are null except for versions of gcc +// that are known to support the features properly (old versions of gcc-2 +// didn't permit keeping the keywords out of the application namespace). + +// Compiler-dependent macros that rely on FreeBSD-specific extensions. + +// Embed the rcs id of a source file in the resulting library. Note that in +// more recent ELF binutils, we use .ident allowing the ID to be stripped. +// Usage: +// __FBSDID("$FreeBSD$"); + +// - +// The following definitions are an extension of the behavior originally +// implemented in <sys/_posix.h>, but with a different level of granularity. +// POSIX.1 requires that the macros we test be defined before any standard +// header file is included. +// +// Here's a quick run-down of the versions: +// defined(_POSIX_SOURCE) 1003.1-1988 +// _POSIX_C_SOURCE == 1 1003.1-1990 +// _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option +// _POSIX_C_SOURCE == 199309 1003.1b-1993 +// _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, +// and the omnibus ISO/IEC 9945-1: 1996 +// _POSIX_C_SOURCE == 200112 1003.1-2001 +// _POSIX_C_SOURCE == 200809 1003.1-2008 +// +// In addition, the X/Open Portability Guide, which is now the Single UNIX +// Specification, defines a feature-test macro which indicates the version of +// that specification, and which subsumes _POSIX_C_SOURCE. +// +// Our macros begin with two underscores to avoid namespace screwage. + +// Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. + +// Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. + +// Deal with various X/Open Portability Guides and Single UNIX Spec. + +// Deal with all versions of POSIX. The ordering relative to the tests above is +// important. +// - +// Deal with _ANSI_SOURCE: +// If it is defined, and no other compilation environment is explicitly +// requested, then define our internal feature-test macros to zero. This +// makes no difference to the preprocessor (undefined symbols in preprocessing +// expressions are defined to have value zero), but makes it more convenient for +// a test program to print out the values. +// +// If a program mistakenly defines _ANSI_SOURCE and some other macro such as +// _POSIX_C_SOURCE, we will assume that it wants the broader compilation +// environment (and in fact we will never get here). + +// User override __EXT1_VISIBLE + +// Old versions of GCC use non-standard ARM arch symbols; acle-compat.h +// translates them to __ARM_ARCH and the modern feature symbols defined by ARM. + +// Nullability qualifiers: currently only supported by Clang. + +// Type Safety Checking +// +// Clang provides additional attributes to enable checking type safety +// properties that cannot be enforced by the C type system. + +// Lock annotations. +// +// Clang provides support for doing basic thread-safety tests at +// compile-time, by marking which locks will/should be held when +// entering/leaving a functions. +// +// Furthermore, it is also possible to annotate variables and structure +// members to enforce that they are only accessed when certain locks are +// held. + +// Structure implements a lock. + +// Function acquires an exclusive or shared lock. + +// Function attempts to acquire an exclusive or shared lock. + +// Function releases a lock. + +// Function asserts that an exclusive or shared lock is held. + +// Function requires that an exclusive or shared lock is or is not held. + +// Function should not be analyzed. + +// Function or variable should not be sanitized, i.e. by AddressSanitizer. +// GCC has the nosanitize attribute, but as a function attribute only, and +// warns on use as a variable attribute. + +// Guard variables and structure members by lock. + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-4-Clause +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// Copyright (c) 1990, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. All advertising materials mentioning features or use of this software +// must display the following acknowledgement: +// This product includes software developed by the University of +// California, Berkeley and its contributors. +// 4. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 +// From: @(#)types.h 8.3 (Berkeley) 1/5/94 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1988, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)limits.h 8.3 (Berkeley) 1/4/94 +// $FreeBSD$ + +// According to ANSI (section 2.2.4.2), the values below must be usable by +// #if preprocessing directives. Additionally, the expression must have the +// same type as would an expression that is an object of the corresponding +// type converted according to the integral promotions. The subtraction for +// INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an +// unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). + +// max value for an unsigned long long + +// Quads and longs are the same on the amd64. Ensure they stay in sync. + +// Minimum signal stack size. + +// Basic types upon which most other types are built. +type X__int8_t = int8 /* _types.h:55:22 */ +type X__uint8_t = uint8 /* _types.h:56:24 */ +type X__int16_t = int16 /* _types.h:57:17 */ +type X__uint16_t = uint16 /* _types.h:58:25 */ +type X__int32_t = int32 /* _types.h:59:15 */ +type X__uint32_t = uint32 /* _types.h:60:23 */ +type X__int64_t = int64 /* _types.h:62:16 */ +type X__uint64_t = uint64 /* _types.h:63:24 */ + +// Standard type definitions. +type X__clock_t = X__int32_t /* _types.h:75:19 */ // clock()... +type X__critical_t = X__int64_t /* _types.h:76:19 */ +type X__double_t = float64 /* _types.h:78:17 */ +type X__float_t = float32 /* _types.h:79:16 */ +type X__intfptr_t = X__int64_t /* _types.h:81:19 */ +type X__intptr_t = X__int64_t /* _types.h:82:19 */ +type X__intmax_t = X__int64_t /* _types.h:93:19 */ +type X__int_fast8_t = X__int32_t /* _types.h:94:19 */ +type X__int_fast16_t = X__int32_t /* _types.h:95:19 */ +type X__int_fast32_t = X__int32_t /* _types.h:96:19 */ +type X__int_fast64_t = X__int64_t /* _types.h:97:19 */ +type X__int_least8_t = X__int8_t /* _types.h:98:18 */ +type X__int_least16_t = X__int16_t /* _types.h:99:19 */ +type X__int_least32_t = X__int32_t /* _types.h:100:19 */ +type X__int_least64_t = X__int64_t /* _types.h:101:19 */ +type X__ptrdiff_t = X__int64_t /* _types.h:103:19 */ // ptr1 - ptr2 +type X__register_t = X__int64_t /* _types.h:104:19 */ +type X__segsz_t = X__int64_t /* _types.h:105:19 */ // segment size (in pages) +type X__size_t = X__uint64_t /* _types.h:106:20 */ // sizeof() +type X__ssize_t = X__int64_t /* _types.h:107:19 */ // byte count or error +type X__time_t = X__int64_t /* _types.h:108:19 */ // time()... +type X__uintfptr_t = X__uint64_t /* _types.h:109:20 */ +type X__uintptr_t = X__uint64_t /* _types.h:110:20 */ +type X__uintmax_t = X__uint64_t /* _types.h:121:20 */ +type X__uint_fast8_t = X__uint32_t /* _types.h:122:20 */ +type X__uint_fast16_t = X__uint32_t /* _types.h:123:20 */ +type X__uint_fast32_t = X__uint32_t /* _types.h:124:20 */ +type X__uint_fast64_t = X__uint64_t /* _types.h:125:20 */ +type X__uint_least8_t = X__uint8_t /* _types.h:126:19 */ +type X__uint_least16_t = X__uint16_t /* _types.h:127:20 */ +type X__uint_least32_t = X__uint32_t /* _types.h:128:20 */ +type X__uint_least64_t = X__uint64_t /* _types.h:129:20 */ +type X__u_register_t = X__uint64_t /* _types.h:131:20 */ +type X__vm_offset_t = X__uint64_t /* _types.h:132:20 */ +type X__vm_paddr_t = X__uint64_t /* _types.h:133:20 */ +type X__vm_size_t = X__uint64_t /* _types.h:134:20 */ +type X___wchar_t = int32 /* _types.h:141:14 */ + +// Standard type definitions. +type X__blksize_t = X__int32_t /* _types.h:40:19 */ // file block size +type X__blkcnt_t = X__int64_t /* _types.h:41:19 */ // file block count +type X__clockid_t = X__int32_t /* _types.h:42:19 */ // clock_gettime()... +type X__fflags_t = X__uint32_t /* _types.h:43:20 */ // file flags +type X__fsblkcnt_t = X__uint64_t /* _types.h:44:20 */ +type X__fsfilcnt_t = X__uint64_t /* _types.h:45:20 */ +type X__gid_t = X__uint32_t /* _types.h:46:20 */ +type X__id_t = X__int64_t /* _types.h:47:19 */ // can hold a gid_t, pid_t, or uid_t +type X__ino_t = X__uint64_t /* _types.h:48:20 */ // inode number +type X__key_t = int64 /* _types.h:49:15 */ // IPC key (for Sys V IPC) +type X__lwpid_t = X__int32_t /* _types.h:50:19 */ // Thread ID (a.k.a. LWP) +type X__mode_t = X__uint16_t /* _types.h:51:20 */ // permissions +type X__accmode_t = int32 /* _types.h:52:14 */ // access permissions +type X__nl_item = int32 /* _types.h:53:14 */ +type X__nlink_t = X__uint64_t /* _types.h:54:20 */ // link count +type X__off_t = X__int64_t /* _types.h:55:19 */ // file offset +type X__off64_t = X__int64_t /* _types.h:56:19 */ // file offset (alias) +type X__pid_t = X__int32_t /* _types.h:57:19 */ // process [group] +type X__rlim_t = X__int64_t /* _types.h:58:19 */ // resource limit - intentionally +// signed, because of legacy code +// that uses -1 for RLIM_INFINITY +type X__sa_family_t = X__uint8_t /* _types.h:61:19 */ +type X__socklen_t = X__uint32_t /* _types.h:62:20 */ +type X__suseconds_t = int64 /* _types.h:63:15 */ // microseconds (signed) +type X__timer_t = uintptr /* _types.h:64:24 */ // timer_gettime()... +type X__mqd_t = uintptr /* _types.h:65:21 */ // mq_open()... +type X__uid_t = X__uint32_t /* _types.h:66:20 */ +type X__useconds_t = uint32 /* _types.h:67:22 */ // microseconds (unsigned) +type X__cpuwhich_t = int32 /* _types.h:68:14 */ // which parameter for cpuset. +type X__cpulevel_t = int32 /* _types.h:69:14 */ // level parameter for cpuset. +type X__cpusetid_t = int32 /* _types.h:70:14 */ // cpuset identifier. +type X__daddr_t = X__int64_t /* _types.h:71:19 */ // bwrite(3), FIOBMAP2, etc + +// Unusual type definitions. +// rune_t is declared to be an ``int'' instead of the more natural +// ``unsigned long'' or ``long''. Two things are happening here. It is not +// unsigned so that EOF (-1) can be naturally assigned to it and used. Also, +// it looks like 10646 will be a 31 bit standard. This means that if your +// ints cannot hold 32 bits, you will be in trouble. The reason an int was +// chosen over a long is that the is*() and to*() routines take ints (says +// ANSI C), but they use __ct_rune_t instead of int. +// +// NOTE: rune_t is not covered by ANSI nor other standards, and should not +// be instantiated outside of lib/libc/locale. Use wchar_t. wint_t and +// rune_t must be the same type. Also, wint_t should be able to hold all +// members of the largest character set plus one extra value (WEOF), and +// must be at least 16 bits. +type X__ct_rune_t = int32 /* _types.h:91:14 */ // arg type for ctype funcs +type X__rune_t = X__ct_rune_t /* _types.h:92:21 */ // rune_t (see above) +type X__wint_t = X__ct_rune_t /* _types.h:93:21 */ // wint_t (see above) + +// Clang already provides these types as built-ins, but only in C++ mode. +type X__char16_t = X__uint_least16_t /* _types.h:97:26 */ +type X__char32_t = X__uint_least32_t /* _types.h:98:26 */ +// In C++11, char16_t and char32_t are built-in types. + +type X__max_align_t = struct { + F__max_align1 int64 + F__max_align2 float64 +} /* _types.h:111:3 */ + +type X__dev_t = X__uint64_t /* _types.h:113:20 */ // device number + +type X__fixpt_t = X__uint32_t /* _types.h:115:20 */ // fixed point number + +// mbstate_t is an opaque object to keep conversion state during multibyte +// stream conversions. +type X__mbstate_t = struct { + _ [0]uint64 + F__mbstate8 [128]int8 +} /* _types.h:124:3 */ + +type X__rman_res_t = X__uintmax_t /* _types.h:126:25 */ + +// Types for varargs. These are all provided by builtin types these +// days, so centralize their definition. +type X__va_list = X__builtin_va_list /* _types.h:133:27 */ // internally known to gcc +type X__gnuc_va_list = X__va_list /* _types.h:140:20 */ // compatibility w/GNU headers + +// When the following macro is defined, the system uses 64-bit inode numbers. +// Programs can use this to avoid including <sys/param.h>, with its associated +// namespace pollution. + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1989, 1991, 1993 +// The Regents of the University of California. All rights reserved. +// (c) UNIX System Laboratories, Inc. +// All or some portions of this file are derived from material licensed +// to the University of California by American Telephone and Telegraph +// Co. or Unix System Laboratories, Inc. and are reproduced herein with +// the permission of UNIX System Laboratories, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)signal.h 8.4 (Berkeley) 5/4/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1989, 1991, 1993 +// The Regents of the University of California. All rights reserved. +// (c) UNIX System Laboratories, Inc. +// All or some portions of this file are derived from material licensed +// to the University of California by American Telephone and Telegraph +// Co. or Unix System Laboratories, Inc. and are reproduced herein with +// the permission of UNIX System Laboratories, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)signal.h 8.4 (Berkeley) 5/4/95 +// $FreeBSD$ + +// sigset_t macros. + +type X__sigset = struct{ F__bits [4]X__uint32_t } /* _sigset.h:53:9 */ + +// compatibility w/GNU headers + +// When the following macro is defined, the system uses 64-bit inode numbers. +// Programs can use this to avoid including <sys/param.h>, with its associated +// namespace pollution. + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1989, 1991, 1993 +// The Regents of the University of California. All rights reserved. +// (c) UNIX System Laboratories, Inc. +// All or some portions of this file are derived from material licensed +// to the University of California by American Telephone and Telegraph +// Co. or Unix System Laboratories, Inc. and are reproduced herein with +// the permission of UNIX System Laboratories, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)signal.h 8.4 (Berkeley) 5/4/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1989, 1991, 1993 +// The Regents of the University of California. All rights reserved. +// (c) UNIX System Laboratories, Inc. +// All or some portions of this file are derived from material licensed +// to the University of California by American Telephone and Telegraph +// Co. or Unix System Laboratories, Inc. and are reproduced herein with +// the permission of UNIX System Laboratories, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)signal.h 8.4 (Berkeley) 5/4/95 +// $FreeBSD$ + +// sigset_t macros. + +type X__sigset_t = X__sigset /* _sigset.h:55:3 */ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1988, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)limits.h 8.3 (Berkeley) 1/4/94 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1986, 1989, 1991, 1993 +// The Regents of the University of California. All rights reserved. +// Copyright (c) 2003 Peter Wemm. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)signal.h 8.1 (Berkeley) 6/11/93 +// $FreeBSD$ + +// Machine-dependent signal definitions + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1989, 1991, 1993 +// The Regents of the University of California. All rights reserved. +// (c) UNIX System Laboratories, Inc. +// All or some portions of this file are derived from material licensed +// to the University of California by American Telephone and Telegraph +// Co. or Unix System Laboratories, Inc. and are reproduced herein with +// the permission of UNIX System Laboratories, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)signal.h 8.4 (Berkeley) 5/4/95 +// $FreeBSD$ + +type Sig_atomic_t = int64 /* signal.h:101:14 */ + +// Information pushed on stack when a signal is delivered. +// This is used by the kernel to restore state following +// execution of the signal handler. It is also made available +// to the handler to allow it to restore state properly if +// a non-standard exit is performed. +// +// The sequence of the fields/registers after sc_mask in struct +// sigcontext must match those in mcontext_t and struct trapframe. +type Sigcontext = struct { + Fsc_mask struct{ F__bits [4]X__uint32_t } + Fsc_onstack int64 + Fsc_rdi int64 + Fsc_rsi int64 + Fsc_rdx int64 + Fsc_rcx int64 + Fsc_r8 int64 + Fsc_r9 int64 + Fsc_rax int64 + Fsc_rbx int64 + Fsc_rbp int64 + Fsc_r10 int64 + Fsc_r11 int64 + Fsc_r12 int64 + Fsc_r13 int64 + Fsc_r14 int64 + Fsc_r15 int64 + Fsc_trapno int32 + Fsc_fs int16 + Fsc_gs int16 + Fsc_addr int64 + Fsc_flags int32 + Fsc_es int16 + Fsc_ds int16 + Fsc_err int64 + Fsc_rip int64 + Fsc_cs int64 + Fsc_rflags int64 + Fsc_rsp int64 + Fsc_ss int64 + Fsc_len int64 + Fsc_fpformat int64 + Fsc_ownedfp int64 + Fsc_fpstate [64]int64 + Fsc_fsbase int64 + Fsc_gsbase int64 + Fsc_xfpustate int64 + Fsc_xfpustate_len int64 + Fsc_spare [4]int64 +} /* signal.h:114:1 */ + +type Pthread_once = struct { + Fstate int32 + _ [4]byte + Fmutex Pthread_mutex_t +} /* _pthreadtypes.h:52:1 */ + +// Primitive system data type definitions required by P1003.1c. +// +// Note that P1003.1c specifies that there are no defined comparison +// or assignment operators for the types pthread_attr_t, pthread_cond_t, +// pthread_condattr_t, pthread_mutex_t, pthread_mutexattr_t. +type Pthread_t = uintptr /* _pthreadtypes.h:67:26 */ +type Pthread_attr_t = uintptr /* _pthreadtypes.h:70:30 */ +type Pthread_mutex_t = uintptr /* _pthreadtypes.h:71:31 */ +type Pthread_mutexattr_t = uintptr /* _pthreadtypes.h:72:35 */ +type Pthread_cond_t = uintptr /* _pthreadtypes.h:73:30 */ +type Pthread_condattr_t = uintptr /* _pthreadtypes.h:74:34 */ +type Pthread_key_t = int32 /* _pthreadtypes.h:75:20 */ +type Pthread_once_t = Pthread_once /* _pthreadtypes.h:76:30 */ +type Pthread_rwlock_t = uintptr /* _pthreadtypes.h:77:32 */ +type Pthread_rwlockattr_t = uintptr /* _pthreadtypes.h:78:35 */ +type Pthread_barrier_t = uintptr /* _pthreadtypes.h:79:33 */ +type Pthread_barrierattr_t = uintptr /* _pthreadtypes.h:80:36 */ +type Pthread_spinlock_t = uintptr /* _pthreadtypes.h:81:33 */ + +// Additional type definitions: +// +// Note that P1003.1c reserves the prefixes pthread_ and PTHREAD_ for +// use in header symbols. +type Pthread_addr_t = uintptr /* _pthreadtypes.h:89:14 */ +type Pthread_startroutine_t = uintptr /* _pthreadtypes.h:90:14 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)time.h 8.5 (Berkeley) 5/4/95 +// from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +type Time_t = X__time_t /* _timespec.h:42:18 */ + +type Timespec = struct { + Ftv_sec Time_t + Ftv_nsec int64 +} /* _timespec.h:46:1 */ + +type Uid_t = X__uid_t /* signal.h:61:18 */ + +type Sigset_t = X__sigset_t /* signal.h:166:20 */ + +type Sigval = struct { + _ [0]uint64 + Fsival_int int32 + _ [4]byte +} /* signal.h:171:1 */ + +type Sigevent = struct { + Fsigev_notify int32 + Fsigev_signo int32 + Fsigev_value struct { + _ [0]uint64 + Fsival_int int32 + _ [4]byte + } + F_sigev_un struct { + _ [0]uint64 + F_threadid X__lwpid_t + _ [60]byte + } +} /* signal.h:195:1 */ + +type X__siginfo = struct { + Fsi_signo int32 + Fsi_errno int32 + Fsi_code int32 + Fsi_pid X__pid_t + Fsi_uid X__uid_t + Fsi_status int32 + Fsi_addr uintptr + Fsi_value struct { + _ [0]uint64 + Fsival_int int32 + _ [4]byte + } + F_reason struct { + _ [0]uint64 + F_fault struct{ F_trapno int32 } + _ [36]byte + } +} /* signal.h:229:9 */ + +type Siginfo_t = X__siginfo /* signal.h:263:3 */ + +// Signal vector "template" used in sigaction call. +type Sigaction = struct { + F__sigaction_u struct{ F__sa_handler uintptr } + Fsa_flags int32 + Fsa_mask Sigset_t + _ [4]byte +} /* signal.h:368:1 */ + +// If SA_SIGINFO is set, sa_sigaction must be used instead of sa_handler. + +// a timer set by timer_settime(). +// an asynchronous I/O request. +// message on an empty message queue. + +type Sig_t = uintptr /* signal.h:420:24 */ + +type Sigaltstack = struct { + Fss_sp uintptr + Fss_size X__size_t + Fss_flags int32 + _ [4]byte +} /* signal.h:428:9 */ + +type Stack_t = Sigaltstack /* signal.h:428:26 */ + +// 4.3 compatibility: +// Signal vector "template" used in sigvec call. +type Sigvec = struct { + Fsv_handler uintptr + Fsv_mask int32 + Fsv_flags int32 +} /* signal.h:452:1 */ + +// Keep this in one place only + +// Structure used in sigstack call. +type Sigstack = struct { + Fss_sp uintptr + Fss_onstack int32 + _ [4]byte +} /* signal.h:479:1 */ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 2003 Peter Wemm +// Copyright (c) 1999 Marcel Moolenaar +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer +// in this position and unchanged. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// $FreeBSD$ + +// mc_flags bits. Shall be in sync with TF_XXX. + +type X__mcontext = struct { + Fmc_onstack X__register_t + Fmc_rdi X__register_t + Fmc_rsi X__register_t + Fmc_rdx X__register_t + Fmc_rcx X__register_t + Fmc_r8 X__register_t + Fmc_r9 X__register_t + Fmc_rax X__register_t + Fmc_rbx X__register_t + Fmc_rbp X__register_t + Fmc_r10 X__register_t + Fmc_r11 X__register_t + Fmc_r12 X__register_t + Fmc_r13 X__register_t + Fmc_r14 X__register_t + Fmc_r15 X__register_t + Fmc_trapno X__uint32_t + Fmc_fs X__uint16_t + Fmc_gs X__uint16_t + Fmc_addr X__register_t + Fmc_flags X__uint32_t + Fmc_es X__uint16_t + Fmc_ds X__uint16_t + Fmc_err X__register_t + Fmc_rip X__register_t + Fmc_cs X__register_t + Fmc_rflags X__register_t + Fmc_rsp X__register_t + Fmc_ss X__register_t + Fmc_len int64 + Fmc_fpformat int64 + Fmc_ownedfp int64 + Fmc_fpstate [64]int64 + Fmc_fsbase X__register_t + Fmc_gsbase X__register_t + Fmc_xfpustate X__register_t + Fmc_xfpustate_len X__register_t + Fmc_spare [4]int64 +} /* ucontext.h:106:9 */ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 2003 Peter Wemm +// Copyright (c) 1999 Marcel Moolenaar +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer +// in this position and unchanged. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// $FreeBSD$ + +// mc_flags bits. Shall be in sync with TF_XXX. + +type Mcontext_t = X__mcontext /* ucontext.h:164:3 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1999 Marcel Moolenaar +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer +// in this position and unchanged. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// $FreeBSD$ + +type X__ucontext = struct { + Fuc_sigmask X__sigset_t + Fuc_mcontext Mcontext_t + Fuc_link uintptr + Fuc_stack struct { + Fss_sp uintptr + Fss_size X__size_t + Fss_flags int32 + _ [4]byte + } + Fuc_flags int32 + F__spare__ [4]int32 + _ [4]byte +} /* _ucontext.h:36:9 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1999 Marcel Moolenaar +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer +// in this position and unchanged. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// $FreeBSD$ + +type Ucontext_t = X__ucontext /* _ucontext.h:52:3 */ + +type Pid_t = X__pid_t /* signal.h:60:18 */ // XXX +type X__pthread_t = uintptr /* signal.h:67:24 */ + +var _ int8 /* gen.c:2:13: */ diff --git a/vendor/modernc.org/libc/signal/signal_linux_arm.go b/vendor/modernc.org/libc/signal/signal_linux_arm.go index b4bd91705..9234e728d 100644 --- a/vendor/modernc.org/libc/signal/signal_linux_arm.go +++ b/vendor/modernc.org/libc/signal/signal_linux_arm.go @@ -1628,9 +1628,7 @@ type X_libc_fpstate = struct { } Ffpsr uint32 /* unsigned fpsr: 32 */ Ffpcr uint32 /* unsigned fpcr: 32 */ - _ [1]byte Fftype [8]uint8 - _ [3]byte Finit_flag uint32 } /* ucontext.h:81:1 */ diff --git a/vendor/modernc.org/libc/stdio/capi_freebsd_amd64.go b/vendor/modernc.org/libc/stdio/capi_freebsd_amd64.go new file mode 100644 index 000000000..ef04ad2ea --- /dev/null +++ b/vendor/modernc.org/libc/stdio/capi_freebsd_amd64.go @@ -0,0 +1,5 @@ +// Code generated by 'ccgo stdio/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 stdio/stdio_freebsd_amd64.go -pkgname stdio', DO NOT EDIT. + +package stdio + +var CAPI = map[string]struct{}{} diff --git a/vendor/modernc.org/libc/stdio/stdio_freebsd_amd64.go b/vendor/modernc.org/libc/stdio/stdio_freebsd_amd64.go new file mode 100644 index 000000000..6d9e0bc68 --- /dev/null +++ b/vendor/modernc.org/libc/stdio/stdio_freebsd_amd64.go @@ -0,0 +1,759 @@ +// Code generated by 'ccgo stdio/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 stdio/stdio_freebsd_amd64.go -pkgname stdio', DO NOT EDIT. + +package stdio + +import ( + "math" + "reflect" + "sync/atomic" + "unsafe" +) + +var _ = math.Pi +var _ reflect.Kind +var _ atomic.Value +var _ unsafe.Pointer + +const ( + BUFSIZ = 1024 + EOF = -1 + FILENAME_MAX = 1024 + FOPEN_MAX = 20 + L_ctermid = 1024 + L_cuserid = 17 + L_tmpnam = 1024 + P_tmpdir = "/tmp/" + SEEK_CUR = 1 + SEEK_END = 2 + SEEK_SET = 0 + TMP_MAX = 308915776 + X_FILE_OFFSET_BITS = 64 + X_FSTDIO = 0 + X_FTRUNCATE_DECLARED = 0 + X_IOFBF = 0 + X_IOLBF = 1 + X_IONBF = 2 + X_LP64 = 1 + X_LSEEK_DECLARED = 0 + X_MACHINE__LIMITS_H_ = 0 + X_MACHINE__TYPES_H_ = 0 + X_MMAP_DECLARED = 0 + X_Nonnull = 0 + X_Null_unspecified = 0 + X_Nullable = 0 + X_OFF64_T_DECLARED = 0 + X_OFF_T_DECLARED = 0 + X_RSIZE_T_DEFINED = 0 + X_SIZE_T_DECLARED = 0 + X_SSIZE_T_DECLARED = 0 + X_STDFILE_DECLARED = 0 + X_STDIO_H_ = 0 + X_STDSTREAM_DECLARED = 0 + X_SYS_CDEFS_H_ = 0 + X_SYS__TYPES_H_ = 0 + X_TRUNCATE_DECLARED = 0 + X_VA_LIST_DECLARED = 0 + Unix = 1 +) + +type Ptrdiff_t = int64 /* <builtin>:3:26 */ + +type Size_t = uint64 /* <builtin>:9:23 */ + +type Wchar_t = int32 /* <builtin>:15:24 */ + +type X__int128_t = struct { + Flo int64 + Fhi int64 +} /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128 +type X__uint128_t = struct { + Flo uint64 + Fhi uint64 +} /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128 + +type X__builtin_va_list = uintptr /* <builtin>:46:14 */ +type X__float128 = float64 /* <builtin>:47:21 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1990, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Chris Torek. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)stdio.h 8.5 (Berkeley) 4/29/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// Testing against Clang-specific extensions. + +// This code has been put in place to help reduce the addition of +// compiler specific defines in FreeBSD code. It helps to aid in +// having a compiler-agnostic source tree. + +// Compiler memory barriers, specific to gcc and clang. + +// XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced + +// Macro to test if we're using a specific version of gcc or later. + +// The __CONCAT macro is used to concatenate parts of symbol names, e.g. +// with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. +// The __CONCAT macro is a bit tricky to use if it must work in non-ANSI +// mode -- there must be no spaces between its arguments, and for nested +// __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also +// concatenate double-quoted strings produced by the __STRING macro, but +// this only works with ANSI C. +// +// __XSTRING is like __STRING, but it expands any macros in its argument +// first. It is only available with ANSI C. + +// Compiler-dependent macros to help declare dead (non-returning) and +// pure (no side effects) functions, and unused variables. They are +// null except for versions of gcc that are known to support the features +// properly (old versions of gcc-2 supported the dead and pure features +// in a different (wrong) way). If we do not provide an implementation +// for a given compiler, let the compile fail if it is told to use +// a feature that we cannot live without. + +// Keywords added in C11. + +// Emulation of C11 _Generic(). Unlike the previously defined C11 +// keywords, it is not possible to implement this using exactly the same +// syntax. Therefore implement something similar under the name +// __generic(). Unlike _Generic(), this macro can only distinguish +// between a single type, so it requires nested invocations to +// distinguish multiple cases. + +// C99 Static array indices in function parameter declarations. Syntax such as: +// void bar(int myArray[static 10]); +// is allowed in C99 but not in C++. Define __min_size appropriately so +// headers using it can be compiled in either language. Use like this: +// void bar(int myArray[__min_size(10)]); + +// XXX: should use `#if __STDC_VERSION__ < 199901'. + +// C++11 exposes a load of C99 stuff + +// GCC 2.95 provides `__restrict' as an extension to C90 to support the +// C99-specific `restrict' type qualifier. We happen to use `__restrict' as +// a way to define the `restrict' type qualifier without disturbing older +// software that is unaware of C99 keywords. + +// GNU C version 2.96 adds explicit branch prediction so that +// the CPU back-end can hint the processor and also so that +// code blocks can be reordered such that the predicted path +// sees a more linear flow, thus improving cache behavior, etc. +// +// The following two macros provide us with a way to utilize this +// compiler feature. Use __predict_true() if you expect the expression +// to evaluate to true, and __predict_false() if you expect the +// expression to evaluate to false. +// +// A few notes about usage: +// +// * Generally, __predict_false() error condition checks (unless +// you have some _strong_ reason to do otherwise, in which case +// document it), and/or __predict_true() `no-error' condition +// checks, assuming you want to optimize for the no-error case. +// +// * Other than that, if you don't know the likelihood of a test +// succeeding from empirical or other `hard' evidence, don't +// make predictions. +// +// * These are meant to be used in places that are run `a lot'. +// It is wasteful to make predictions in code that is run +// seldomly (e.g. at subsystem initialization time) as the +// basic block reordering that this affects can often generate +// larger code. + +// We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h> +// require it. + +// Given the pointer x to the member m of the struct s, return +// a pointer to the containing structure. When using GCC, we first +// assign pointer x to a local variable, to check that its type is +// compatible with member m. + +// Compiler-dependent macros to declare that functions take printf-like +// or scanf-like arguments. They are null except for versions of gcc +// that are known to support the features properly (old versions of gcc-2 +// didn't permit keeping the keywords out of the application namespace). + +// Compiler-dependent macros that rely on FreeBSD-specific extensions. + +// Embed the rcs id of a source file in the resulting library. Note that in +// more recent ELF binutils, we use .ident allowing the ID to be stripped. +// Usage: +// __FBSDID("$FreeBSD$"); + +// - +// The following definitions are an extension of the behavior originally +// implemented in <sys/_posix.h>, but with a different level of granularity. +// POSIX.1 requires that the macros we test be defined before any standard +// header file is included. +// +// Here's a quick run-down of the versions: +// defined(_POSIX_SOURCE) 1003.1-1988 +// _POSIX_C_SOURCE == 1 1003.1-1990 +// _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option +// _POSIX_C_SOURCE == 199309 1003.1b-1993 +// _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, +// and the omnibus ISO/IEC 9945-1: 1996 +// _POSIX_C_SOURCE == 200112 1003.1-2001 +// _POSIX_C_SOURCE == 200809 1003.1-2008 +// +// In addition, the X/Open Portability Guide, which is now the Single UNIX +// Specification, defines a feature-test macro which indicates the version of +// that specification, and which subsumes _POSIX_C_SOURCE. +// +// Our macros begin with two underscores to avoid namespace screwage. + +// Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. + +// Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. + +// Deal with various X/Open Portability Guides and Single UNIX Spec. + +// Deal with all versions of POSIX. The ordering relative to the tests above is +// important. +// - +// Deal with _ANSI_SOURCE: +// If it is defined, and no other compilation environment is explicitly +// requested, then define our internal feature-test macros to zero. This +// makes no difference to the preprocessor (undefined symbols in preprocessing +// expressions are defined to have value zero), but makes it more convenient for +// a test program to print out the values. +// +// If a program mistakenly defines _ANSI_SOURCE and some other macro such as +// _POSIX_C_SOURCE, we will assume that it wants the broader compilation +// environment (and in fact we will never get here). + +// User override __EXT1_VISIBLE + +// Old versions of GCC use non-standard ARM arch symbols; acle-compat.h +// translates them to __ARM_ARCH and the modern feature symbols defined by ARM. + +// Nullability qualifiers: currently only supported by Clang. + +// Type Safety Checking +// +// Clang provides additional attributes to enable checking type safety +// properties that cannot be enforced by the C type system. + +// Lock annotations. +// +// Clang provides support for doing basic thread-safety tests at +// compile-time, by marking which locks will/should be held when +// entering/leaving a functions. +// +// Furthermore, it is also possible to annotate variables and structure +// members to enforce that they are only accessed when certain locks are +// held. + +// Structure implements a lock. + +// Function acquires an exclusive or shared lock. + +// Function attempts to acquire an exclusive or shared lock. + +// Function releases a lock. + +// Function asserts that an exclusive or shared lock is held. + +// Function requires that an exclusive or shared lock is or is not held. + +// Function should not be analyzed. + +// Function or variable should not be sanitized, i.e. by AddressSanitizer. +// GCC has the nosanitize attribute, but as a function attribute only, and +// warns on use as a variable attribute. + +// Guard variables and structure members by lock. + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2003 Marcel Moolenaar +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-4-Clause +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// Copyright (c) 1990, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. All advertising materials mentioning features or use of this software +// must display the following acknowledgement: +// This product includes software developed by the University of +// California, Berkeley and its contributors. +// 4. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 +// From: @(#)types.h 8.3 (Berkeley) 1/5/94 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1988, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)limits.h 8.3 (Berkeley) 1/4/94 +// $FreeBSD$ + +// According to ANSI (section 2.2.4.2), the values below must be usable by +// #if preprocessing directives. Additionally, the expression must have the +// same type as would an expression that is an object of the corresponding +// type converted according to the integral promotions. The subtraction for +// INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an +// unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). + +// max value for an unsigned long long + +// Quads and longs are the same on the amd64. Ensure they stay in sync. + +// Minimum signal stack size. + +// Basic types upon which most other types are built. +type X__int8_t = int8 /* _types.h:55:22 */ +type X__uint8_t = uint8 /* _types.h:56:24 */ +type X__int16_t = int16 /* _types.h:57:17 */ +type X__uint16_t = uint16 /* _types.h:58:25 */ +type X__int32_t = int32 /* _types.h:59:15 */ +type X__uint32_t = uint32 /* _types.h:60:23 */ +type X__int64_t = int64 /* _types.h:62:16 */ +type X__uint64_t = uint64 /* _types.h:63:24 */ + +// Standard type definitions. +type X__clock_t = X__int32_t /* _types.h:75:19 */ // clock()... +type X__critical_t = X__int64_t /* _types.h:76:19 */ +type X__double_t = float64 /* _types.h:78:17 */ +type X__float_t = float32 /* _types.h:79:16 */ +type X__intfptr_t = X__int64_t /* _types.h:81:19 */ +type X__intptr_t = X__int64_t /* _types.h:82:19 */ +type X__intmax_t = X__int64_t /* _types.h:93:19 */ +type X__int_fast8_t = X__int32_t /* _types.h:94:19 */ +type X__int_fast16_t = X__int32_t /* _types.h:95:19 */ +type X__int_fast32_t = X__int32_t /* _types.h:96:19 */ +type X__int_fast64_t = X__int64_t /* _types.h:97:19 */ +type X__int_least8_t = X__int8_t /* _types.h:98:18 */ +type X__int_least16_t = X__int16_t /* _types.h:99:19 */ +type X__int_least32_t = X__int32_t /* _types.h:100:19 */ +type X__int_least64_t = X__int64_t /* _types.h:101:19 */ +type X__ptrdiff_t = X__int64_t /* _types.h:103:19 */ // ptr1 - ptr2 +type X__register_t = X__int64_t /* _types.h:104:19 */ +type X__segsz_t = X__int64_t /* _types.h:105:19 */ // segment size (in pages) +type X__size_t = X__uint64_t /* _types.h:106:20 */ // sizeof() +type X__ssize_t = X__int64_t /* _types.h:107:19 */ // byte count or error +type X__time_t = X__int64_t /* _types.h:108:19 */ // time()... +type X__uintfptr_t = X__uint64_t /* _types.h:109:20 */ +type X__uintptr_t = X__uint64_t /* _types.h:110:20 */ +type X__uintmax_t = X__uint64_t /* _types.h:121:20 */ +type X__uint_fast8_t = X__uint32_t /* _types.h:122:20 */ +type X__uint_fast16_t = X__uint32_t /* _types.h:123:20 */ +type X__uint_fast32_t = X__uint32_t /* _types.h:124:20 */ +type X__uint_fast64_t = X__uint64_t /* _types.h:125:20 */ +type X__uint_least8_t = X__uint8_t /* _types.h:126:19 */ +type X__uint_least16_t = X__uint16_t /* _types.h:127:20 */ +type X__uint_least32_t = X__uint32_t /* _types.h:128:20 */ +type X__uint_least64_t = X__uint64_t /* _types.h:129:20 */ +type X__u_register_t = X__uint64_t /* _types.h:131:20 */ +type X__vm_offset_t = X__uint64_t /* _types.h:132:20 */ +type X__vm_paddr_t = X__uint64_t /* _types.h:133:20 */ +type X__vm_size_t = X__uint64_t /* _types.h:134:20 */ +type X___wchar_t = int32 /* _types.h:141:14 */ + +// Standard type definitions. +type X__blksize_t = X__int32_t /* _types.h:40:19 */ // file block size +type X__blkcnt_t = X__int64_t /* _types.h:41:19 */ // file block count +type X__clockid_t = X__int32_t /* _types.h:42:19 */ // clock_gettime()... +type X__fflags_t = X__uint32_t /* _types.h:43:20 */ // file flags +type X__fsblkcnt_t = X__uint64_t /* _types.h:44:20 */ +type X__fsfilcnt_t = X__uint64_t /* _types.h:45:20 */ +type X__gid_t = X__uint32_t /* _types.h:46:20 */ +type X__id_t = X__int64_t /* _types.h:47:19 */ // can hold a gid_t, pid_t, or uid_t +type X__ino_t = X__uint64_t /* _types.h:48:20 */ // inode number +type X__key_t = int64 /* _types.h:49:15 */ // IPC key (for Sys V IPC) +type X__lwpid_t = X__int32_t /* _types.h:50:19 */ // Thread ID (a.k.a. LWP) +type X__mode_t = X__uint16_t /* _types.h:51:20 */ // permissions +type X__accmode_t = int32 /* _types.h:52:14 */ // access permissions +type X__nl_item = int32 /* _types.h:53:14 */ +type X__nlink_t = X__uint64_t /* _types.h:54:20 */ // link count +type X__off_t = X__int64_t /* _types.h:55:19 */ // file offset +type X__off64_t = X__int64_t /* _types.h:56:19 */ // file offset (alias) +type X__pid_t = X__int32_t /* _types.h:57:19 */ // process [group] +type X__rlim_t = X__int64_t /* _types.h:58:19 */ // resource limit - intentionally +// signed, because of legacy code +// that uses -1 for RLIM_INFINITY +type X__sa_family_t = X__uint8_t /* _types.h:61:19 */ +type X__socklen_t = X__uint32_t /* _types.h:62:20 */ +type X__suseconds_t = int64 /* _types.h:63:15 */ // microseconds (signed) +type X__timer_t = uintptr /* _types.h:64:24 */ // timer_gettime()... +type X__mqd_t = uintptr /* _types.h:65:21 */ // mq_open()... +type X__uid_t = X__uint32_t /* _types.h:66:20 */ +type X__useconds_t = uint32 /* _types.h:67:22 */ // microseconds (unsigned) +type X__cpuwhich_t = int32 /* _types.h:68:14 */ // which parameter for cpuset. +type X__cpulevel_t = int32 /* _types.h:69:14 */ // level parameter for cpuset. +type X__cpusetid_t = int32 /* _types.h:70:14 */ // cpuset identifier. +type X__daddr_t = X__int64_t /* _types.h:71:19 */ // bwrite(3), FIOBMAP2, etc + +// Unusual type definitions. +// rune_t is declared to be an ``int'' instead of the more natural +// ``unsigned long'' or ``long''. Two things are happening here. It is not +// unsigned so that EOF (-1) can be naturally assigned to it and used. Also, +// it looks like 10646 will be a 31 bit standard. This means that if your +// ints cannot hold 32 bits, you will be in trouble. The reason an int was +// chosen over a long is that the is*() and to*() routines take ints (says +// ANSI C), but they use __ct_rune_t instead of int. +// +// NOTE: rune_t is not covered by ANSI nor other standards, and should not +// be instantiated outside of lib/libc/locale. Use wchar_t. wint_t and +// rune_t must be the same type. Also, wint_t should be able to hold all +// members of the largest character set plus one extra value (WEOF), and +// must be at least 16 bits. +type X__ct_rune_t = int32 /* _types.h:91:14 */ // arg type for ctype funcs +type X__rune_t = X__ct_rune_t /* _types.h:92:21 */ // rune_t (see above) +type X__wint_t = X__ct_rune_t /* _types.h:93:21 */ // wint_t (see above) + +// Clang already provides these types as built-ins, but only in C++ mode. +type X__char16_t = X__uint_least16_t /* _types.h:97:26 */ +type X__char32_t = X__uint_least32_t /* _types.h:98:26 */ +// In C++11, char16_t and char32_t are built-in types. + +type X__max_align_t = struct { + F__max_align1 int64 + F__max_align2 float64 +} /* _types.h:111:3 */ + +type X__dev_t = X__uint64_t /* _types.h:113:20 */ // device number + +type X__fixpt_t = X__uint32_t /* _types.h:115:20 */ // fixed point number + +// mbstate_t is an opaque object to keep conversion state during multibyte +// stream conversions. +type X__mbstate_t = struct { + _ [0]uint64 + F__mbstate8 [128]int8 +} /* _types.h:124:3 */ + +type X__rman_res_t = X__uintmax_t /* _types.h:126:25 */ + +// Types for varargs. These are all provided by builtin types these +// days, so centralize their definition. +type X__va_list = X__builtin_va_list /* _types.h:133:27 */ // internally known to gcc +type X__gnuc_va_list = X__va_list /* _types.h:140:20 */ // compatibility w/GNU headers + +// When the following macro is defined, the system uses 64-bit inode numbers. +// Programs can use this to avoid including <sys/param.h>, with its associated +// namespace pollution. + +type Fpos_t = X__off_t /* stdio.h:47:18 */ + +type Rsize_t = Size_t /* stdio.h:56:16 */ + +type Off_t = X__off_t /* stdio.h:62:18 */ +type Ssize_t = X__ssize_t /* stdio.h:66:19 */ + +type Off64_t = X__off64_t /* stdio.h:72:19 */ + +type Va_list = X__va_list /* stdio.h:77:19 */ + +// NB: to fit things in six character monocase externals, the stdio +// code uses the prefix `__s' for stdio objects, typically followed +// by a three-character attempt at a mnemonic. + +// stdio buffers +type X__sbuf = struct { + F_base uintptr + F_size int32 + _ [4]byte +} /* stdio.h:91:1 */ + +// stdio state variables. +// +// The following always hold: +// +// if (_flags&(__SLBF|__SWR)) == (__SLBF|__SWR), +// _lbfsize is -_bf._size, else _lbfsize is 0 +// if _flags&__SRD, _w is 0 +// if _flags&__SWR, _r is 0 +// +// This ensures that the getc and putc macros (or inline functions) never +// try to write or read from a file that is in `read' or `write' mode. +// (Moreover, they can, and do, automatically switch from read mode to +// write mode, and back, on "r+" and "w+" files.) +// +// _lbfsize is used only to make the inline line-buffered output stream +// code as compact as possible. +// +// _ub, _up, and _ur are used when ungetc() pushes back more characters +// than fit in the current _bf, or when ungetc() pushes back a character +// that does not match the previous one in _bf. When this happens, +// _ub._base becomes non-nil (i.e., a stream has ungetc() data iff +// _ub._base!=NULL) and _up and _ur save the current values of _p and _r. +// +// Certain members of __sFILE are accessed directly via macros or +// inline functions. To preserve ABI compat, these members must not +// be disturbed. These members are marked below with (*). +type X__sFILE = struct { + F_p uintptr + F_r int32 + F_w int32 + F_flags int16 + F_file int16 + _ [4]byte + F_bf struct { + F_base uintptr + F_size int32 + _ [4]byte + } + F_lbfsize int32 + _ [4]byte + F_cookie uintptr + F_close uintptr + F_read uintptr + F_seek uintptr + F_write uintptr + F_ub struct { + F_base uintptr + F_size int32 + _ [4]byte + } + F_up uintptr + F_ur int32 + F_ubuf [3]uint8 + F_nbuf [1]uint8 + F_lb struct { + F_base uintptr + F_size int32 + _ [4]byte + } + F_blksize int32 + _ [4]byte + F_offset Fpos_t + F_fl_mutex uintptr + F_fl_owner uintptr + F_fl_count int32 + F_orientation int32 + F_mbstate X__mbstate_t + F_flags2 int32 + _ [4]byte +} /* stdio.h:124:1 */ + +type FILE = X__sFILE /* stdio.h:165:24 */ +type Cookie_io_functions_t = struct { + Fread uintptr + Fwrite uintptr + Fseek uintptr + Fclose uintptr +} /* stdio.h:428:3 */ + +// See ISO/IEC 9945-1 ANSI/IEEE Std 1003.1 Second Edition 1996-07-12 +// B.8.2.7 for the rationale behind the *_unlocked() macros. + +var _ int8 /* gen.c:2:13: */ diff --git a/vendor/modernc.org/libc/sys/socket/capi_freebsd_amd64.go b/vendor/modernc.org/libc/sys/socket/capi_freebsd_amd64.go new file mode 100644 index 000000000..03826109a --- /dev/null +++ b/vendor/modernc.org/libc/sys/socket/capi_freebsd_amd64.go @@ -0,0 +1,5 @@ +// 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_freebsd_amd64.go -pkgname socket', DO NOT EDIT. + +package socket + +var CAPI = map[string]struct{}{} diff --git a/vendor/modernc.org/libc/sys/socket/socket_freebsd_amd64.go b/vendor/modernc.org/libc/sys/socket/socket_freebsd_amd64.go new file mode 100644 index 000000000..d5a87e179 --- /dev/null +++ b/vendor/modernc.org/libc/sys/socket/socket_freebsd_amd64.go @@ -0,0 +1,1159 @@ +// 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_freebsd_amd64.go -pkgname socket', DO NOT EDIT. + +package socket + +import ( + "math" + "reflect" + "sync/atomic" + "unsafe" +) + +var _ = math.Pi +var _ reflect.Kind +var _ atomic.Value +var _ unsafe.Pointer + +const ( + AF_APPLETALK = 16 + AF_ARP = 35 + AF_ATM = 30 + AF_BLUETOOTH = 36 + AF_CCITT = 10 + AF_CHAOS = 5 + AF_CNT = 21 + AF_COIP = 20 + AF_DATAKIT = 9 + AF_DECnet = 12 + AF_DLI = 13 + AF_E164 = 26 + AF_ECMA = 8 + AF_HYLINK = 15 + AF_HYPERV = 43 + AF_IEEE80211 = 37 + AF_IMPLINK = 3 + AF_INET = 2 + AF_INET6 = 28 + AF_INET6_SDP = 42 + AF_INET_SDP = 40 + AF_IPX = 23 + AF_ISDN = 26 + AF_ISO = 7 + AF_LAT = 14 + AF_LINK = 18 + AF_LOCAL = 1 + AF_MAX = 43 + AF_NATM = 29 + AF_NETBIOS = 6 + AF_NETGRAPH = 32 + AF_OSI = 7 + AF_PUP = 4 + AF_ROUTE = 17 + AF_SCLUSTER = 34 + AF_SIP = 24 + AF_SLOW = 33 + AF_SNA = 11 + AF_UNIX = 1 + AF_UNSPEC = 0 + AF_VENDOR00 = 39 + AF_VENDOR01 = 41 + AF_VENDOR03 = 45 + AF_VENDOR04 = 47 + AF_VENDOR05 = 49 + AF_VENDOR06 = 51 + AF_VENDOR07 = 53 + AF_VENDOR08 = 55 + AF_VENDOR09 = 57 + AF_VENDOR10 = 59 + AF_VENDOR11 = 61 + AF_VENDOR12 = 63 + AF_VENDOR13 = 65 + AF_VENDOR14 = 67 + AF_VENDOR15 = 69 + AF_VENDOR16 = 71 + AF_VENDOR17 = 73 + AF_VENDOR18 = 75 + AF_VENDOR19 = 77 + AF_VENDOR20 = 79 + AF_VENDOR21 = 81 + AF_VENDOR22 = 83 + AF_VENDOR23 = 85 + AF_VENDOR24 = 87 + AF_VENDOR25 = 89 + AF_VENDOR26 = 91 + AF_VENDOR27 = 93 + AF_VENDOR28 = 95 + AF_VENDOR29 = 97 + AF_VENDOR30 = 99 + AF_VENDOR31 = 101 + AF_VENDOR32 = 103 + AF_VENDOR33 = 105 + AF_VENDOR34 = 107 + AF_VENDOR35 = 109 + AF_VENDOR36 = 111 + AF_VENDOR37 = 113 + AF_VENDOR38 = 115 + AF_VENDOR39 = 117 + AF_VENDOR40 = 119 + AF_VENDOR41 = 121 + AF_VENDOR42 = 123 + AF_VENDOR43 = 125 + AF_VENDOR44 = 127 + AF_VENDOR45 = 129 + AF_VENDOR46 = 131 + AF_VENDOR47 = 133 + CMGROUP_MAX = 16 + MSG_CMSG_CLOEXEC = 0x00040000 + MSG_COMPAT = 0x00008000 + MSG_CTRUNC = 0x00000020 + MSG_DONTROUTE = 0x00000004 + MSG_DONTWAIT = 0x00000080 + MSG_EOF = 0x00000100 + MSG_EOR = 0x00000008 + MSG_NBIO = 0x00004000 + MSG_NOSIGNAL = 0x00020000 + MSG_NOTIFICATION = 0x00002000 + MSG_OOB = 0x00000001 + MSG_PEEK = 0x00000002 + MSG_TRUNC = 0x00000010 + MSG_WAITALL = 0x00000040 + MSG_WAITFORONE = 0x00080000 + NET_RT_DUMP = 1 + NET_RT_FLAGS = 2 + NET_RT_IFLIST = 3 + NET_RT_IFLISTL = 5 + NET_RT_IFMALIST = 4 + NET_RT_NHGRP = 7 + NET_RT_NHOP = 6 + PF_APPLETALK = 16 + PF_ARP = 35 + PF_ATM = 30 + PF_BLUETOOTH = 36 + PF_CCITT = 10 + PF_CHAOS = 5 + PF_CNT = 21 + PF_COIP = 20 + PF_DATAKIT = 9 + PF_DECnet = 12 + PF_DLI = 13 + PF_ECMA = 8 + PF_HYLINK = 15 + PF_IEEE80211 = 37 + PF_IMPLINK = 3 + PF_INET = 2 + PF_INET6 = 28 + PF_INET6_SDP = 42 + PF_INET_SDP = 40 + PF_IPX = 23 + PF_ISDN = 26 + PF_ISO = 7 + PF_KEY = 27 + PF_LAT = 14 + PF_LINK = 18 + PF_LOCAL = 1 + PF_MAX = 43 + PF_NATM = 29 + PF_NETBIOS = 6 + PF_NETGRAPH = 32 + PF_OSI = 7 + PF_PIP = 25 + PF_PUP = 4 + PF_ROUTE = 17 + PF_RTIP = 22 + PF_SCLUSTER = 34 + PF_SIP = 24 + PF_SLOW = 33 + PF_SNA = 11 + PF_UNIX = 1 + PF_UNSPEC = 0 + PF_XTP = 19 + PRU_FLUSH_RD = 0 + PRU_FLUSH_RDWR = 2 + PRU_FLUSH_WR = 1 + SCM_BINTIME = 0x04 + SCM_CREDS = 0x03 + SCM_CREDS2 = 0x08 + SCM_MONOTONIC = 0x06 + SCM_REALTIME = 0x05 + SCM_RIGHTS = 0x01 + SCM_TIMESTAMP = 0x02 + SCM_TIME_INFO = 0x07 + SF_MNOWAIT = 0x00000002 + SF_NOCACHE = 0x00000010 + SF_NODISKIO = 0x00000001 + SF_SYNC = 0x00000004 + SF_USER_READAHEAD = 0x00000008 + SHUT_RD = 0 + SHUT_RDWR = 2 + SHUT_WR = 1 + SOCK_CLOEXEC = 0x10000000 + SOCK_DGRAM = 2 + SOCK_MAXADDRLEN = 255 + SOCK_NONBLOCK = 0x20000000 + SOCK_RAW = 3 + SOCK_RDM = 4 + SOCK_SEQPACKET = 5 + SOCK_STREAM = 1 + SOL_SOCKET = 0xffff + SOMAXCONN = 128 + SO_ACCEPTCONN = 0x00000002 + SO_ACCEPTFILTER = 0x00001000 + SO_BINTIME = 0x00002000 + SO_BROADCAST = 0x00000020 + SO_DEBUG = 0x00000001 + SO_DOMAIN = 0x1019 + SO_DONTROUTE = 0x00000010 + SO_ERROR = 0x1007 + SO_KEEPALIVE = 0x00000008 + SO_LABEL = 0x1009 + SO_LINGER = 0x00000080 + SO_LISTENINCQLEN = 0x1013 + SO_LISTENQLEN = 0x1012 + SO_LISTENQLIMIT = 0x1011 + SO_MAX_PACING_RATE = 0x1018 + SO_NOSIGPIPE = 0x00000800 + SO_NO_DDP = 0x00008000 + SO_NO_OFFLOAD = 0x00004000 + SO_OOBINLINE = 0x00000100 + SO_PEERLABEL = 0x1010 + SO_PROTOCOL = 0x1016 + SO_PROTOTYPE = 4118 + SO_RCVBUF = 0x1002 + SO_RCVLOWAT = 0x1004 + SO_RCVTIMEO = 0x1006 + SO_REUSEADDR = 0x00000004 + SO_REUSEPORT = 0x00000200 + SO_REUSEPORT_LB = 0x00010000 + SO_SETFIB = 0x1014 + SO_SNDBUF = 0x1001 + SO_SNDLOWAT = 0x1003 + SO_SNDTIMEO = 0x1005 + SO_TIMESTAMP = 0x00000400 + SO_TS_BINTIME = 1 + SO_TS_CLOCK = 0x1017 + SO_TS_CLOCK_MAX = 3 + SO_TS_DEFAULT = 0 + SO_TS_MONOTONIC = 3 + SO_TS_REALTIME = 2 + SO_TS_REALTIME_MICRO = 0 + SO_TYPE = 0x1008 + SO_USELOOPBACK = 0x00000040 + SO_USER_COOKIE = 0x1015 + SO_VENDOR = 0x80000000 + ST_INFO_HW = 0x0001 + ST_INFO_HW_HPREC = 0x0002 + X_FILE_OFFSET_BITS = 64 + X_GID_T_DECLARED = 0 + X_LP64 = 1 + X_MACHINE__LIMITS_H_ = 0 + X_MACHINE__TYPES_H_ = 0 + X_Nonnull = 0 + X_Null_unspecified = 0 + X_Nullable = 0 + X_OFF_T_DECLARED = 0 + X_PID_T_DECLARED = 0 + X_SA_FAMILY_T_DECLARED = 0 + X_SIZE_T_DECLARED = 0 + X_SOCKLEN_T_DECLARED = 0 + X_SSIZE_T_DECLARED = 0 + X_SS_MAXSIZE = 128 + X_SYS_CDEFS_H_ = 0 + X_SYS_SOCKET_H_ = 0 + X_SYS__IOVEC_H_ = 0 + X_SYS__SOCKADDR_STORAGE_H_ = 0 + X_SYS__TYPES_H_ = 0 + X_UID_T_DECLARED = 0 + X_UINT32_T_DECLARED = 0 + X_UINTPTR_T_DECLARED = 0 + X_X86_INCLUDE__ALIGN_H_ = 0 + Pseudo_AF_HDRCMPLT = 31 + Pseudo_AF_KEY = 27 + Pseudo_AF_PIP = 25 + Pseudo_AF_RTIP = 22 + Pseudo_AF_XTP = 19 + Unix = 1 +) + +type Ptrdiff_t = int64 /* <builtin>:3:26 */ + +type Size_t = uint64 /* <builtin>:9:23 */ + +type Wchar_t = int32 /* <builtin>:15:24 */ + +type X__int128_t = struct { + Flo int64 + Fhi int64 +} /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128 +type X__uint128_t = struct { + Flo uint64 + Fhi uint64 +} /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128 + +type X__builtin_va_list = uintptr /* <builtin>:46:14 */ +type X__float128 = float64 /* <builtin>:47:21 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)socket.h 8.4 (Berkeley) 2/21/94 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// Testing against Clang-specific extensions. + +// This code has been put in place to help reduce the addition of +// compiler specific defines in FreeBSD code. It helps to aid in +// having a compiler-agnostic source tree. + +// Compiler memory barriers, specific to gcc and clang. + +// XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced + +// Macro to test if we're using a specific version of gcc or later. + +// The __CONCAT macro is used to concatenate parts of symbol names, e.g. +// with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. +// The __CONCAT macro is a bit tricky to use if it must work in non-ANSI +// mode -- there must be no spaces between its arguments, and for nested +// __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also +// concatenate double-quoted strings produced by the __STRING macro, but +// this only works with ANSI C. +// +// __XSTRING is like __STRING, but it expands any macros in its argument +// first. It is only available with ANSI C. + +// Compiler-dependent macros to help declare dead (non-returning) and +// pure (no side effects) functions, and unused variables. They are +// null except for versions of gcc that are known to support the features +// properly (old versions of gcc-2 supported the dead and pure features +// in a different (wrong) way). If we do not provide an implementation +// for a given compiler, let the compile fail if it is told to use +// a feature that we cannot live without. + +// Keywords added in C11. + +// Emulation of C11 _Generic(). Unlike the previously defined C11 +// keywords, it is not possible to implement this using exactly the same +// syntax. Therefore implement something similar under the name +// __generic(). Unlike _Generic(), this macro can only distinguish +// between a single type, so it requires nested invocations to +// distinguish multiple cases. + +// C99 Static array indices in function parameter declarations. Syntax such as: +// void bar(int myArray[static 10]); +// is allowed in C99 but not in C++. Define __min_size appropriately so +// headers using it can be compiled in either language. Use like this: +// void bar(int myArray[__min_size(10)]); + +// XXX: should use `#if __STDC_VERSION__ < 199901'. + +// C++11 exposes a load of C99 stuff + +// GCC 2.95 provides `__restrict' as an extension to C90 to support the +// C99-specific `restrict' type qualifier. We happen to use `__restrict' as +// a way to define the `restrict' type qualifier without disturbing older +// software that is unaware of C99 keywords. + +// GNU C version 2.96 adds explicit branch prediction so that +// the CPU back-end can hint the processor and also so that +// code blocks can be reordered such that the predicted path +// sees a more linear flow, thus improving cache behavior, etc. +// +// The following two macros provide us with a way to utilize this +// compiler feature. Use __predict_true() if you expect the expression +// to evaluate to true, and __predict_false() if you expect the +// expression to evaluate to false. +// +// A few notes about usage: +// +// * Generally, __predict_false() error condition checks (unless +// you have some _strong_ reason to do otherwise, in which case +// document it), and/or __predict_true() `no-error' condition +// checks, assuming you want to optimize for the no-error case. +// +// * Other than that, if you don't know the likelihood of a test +// succeeding from empirical or other `hard' evidence, don't +// make predictions. +// +// * These are meant to be used in places that are run `a lot'. +// It is wasteful to make predictions in code that is run +// seldomly (e.g. at subsystem initialization time) as the +// basic block reordering that this affects can often generate +// larger code. + +// We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h> +// require it. + +// Given the pointer x to the member m of the struct s, return +// a pointer to the containing structure. When using GCC, we first +// assign pointer x to a local variable, to check that its type is +// compatible with member m. + +// Compiler-dependent macros to declare that functions take printf-like +// or scanf-like arguments. They are null except for versions of gcc +// that are known to support the features properly (old versions of gcc-2 +// didn't permit keeping the keywords out of the application namespace). + +// Compiler-dependent macros that rely on FreeBSD-specific extensions. + +// Embed the rcs id of a source file in the resulting library. Note that in +// more recent ELF binutils, we use .ident allowing the ID to be stripped. +// Usage: +// __FBSDID("$FreeBSD$"); + +// - +// The following definitions are an extension of the behavior originally +// implemented in <sys/_posix.h>, but with a different level of granularity. +// POSIX.1 requires that the macros we test be defined before any standard +// header file is included. +// +// Here's a quick run-down of the versions: +// defined(_POSIX_SOURCE) 1003.1-1988 +// _POSIX_C_SOURCE == 1 1003.1-1990 +// _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option +// _POSIX_C_SOURCE == 199309 1003.1b-1993 +// _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, +// and the omnibus ISO/IEC 9945-1: 1996 +// _POSIX_C_SOURCE == 200112 1003.1-2001 +// _POSIX_C_SOURCE == 200809 1003.1-2008 +// +// In addition, the X/Open Portability Guide, which is now the Single UNIX +// Specification, defines a feature-test macro which indicates the version of +// that specification, and which subsumes _POSIX_C_SOURCE. +// +// Our macros begin with two underscores to avoid namespace screwage. + +// Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. + +// Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. + +// Deal with various X/Open Portability Guides and Single UNIX Spec. + +// Deal with all versions of POSIX. The ordering relative to the tests above is +// important. +// - +// Deal with _ANSI_SOURCE: +// If it is defined, and no other compilation environment is explicitly +// requested, then define our internal feature-test macros to zero. This +// makes no difference to the preprocessor (undefined symbols in preprocessing +// expressions are defined to have value zero), but makes it more convenient for +// a test program to print out the values. +// +// If a program mistakenly defines _ANSI_SOURCE and some other macro such as +// _POSIX_C_SOURCE, we will assume that it wants the broader compilation +// environment (and in fact we will never get here). + +// User override __EXT1_VISIBLE + +// Old versions of GCC use non-standard ARM arch symbols; acle-compat.h +// translates them to __ARM_ARCH and the modern feature symbols defined by ARM. + +// Nullability qualifiers: currently only supported by Clang. + +// Type Safety Checking +// +// Clang provides additional attributes to enable checking type safety +// properties that cannot be enforced by the C type system. + +// Lock annotations. +// +// Clang provides support for doing basic thread-safety tests at +// compile-time, by marking which locks will/should be held when +// entering/leaving a functions. +// +// Furthermore, it is also possible to annotate variables and structure +// members to enforce that they are only accessed when certain locks are +// held. + +// Structure implements a lock. + +// Function acquires an exclusive or shared lock. + +// Function attempts to acquire an exclusive or shared lock. + +// Function releases a lock. + +// Function asserts that an exclusive or shared lock is held. + +// Function requires that an exclusive or shared lock is or is not held. + +// Function should not be analyzed. + +// Function or variable should not be sanitized, i.e. by AddressSanitizer. +// GCC has the nosanitize attribute, but as a function attribute only, and +// warns on use as a variable attribute. + +// Guard variables and structure members by lock. + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-4-Clause +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// Copyright (c) 1990, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. All advertising materials mentioning features or use of this software +// must display the following acknowledgement: +// This product includes software developed by the University of +// California, Berkeley and its contributors. +// 4. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 +// From: @(#)types.h 8.3 (Berkeley) 1/5/94 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1988, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)limits.h 8.3 (Berkeley) 1/4/94 +// $FreeBSD$ + +// According to ANSI (section 2.2.4.2), the values below must be usable by +// #if preprocessing directives. Additionally, the expression must have the +// same type as would an expression that is an object of the corresponding +// type converted according to the integral promotions. The subtraction for +// INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an +// unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). + +// max value for an unsigned long long + +// Quads and longs are the same on the amd64. Ensure they stay in sync. + +// Minimum signal stack size. + +// Basic types upon which most other types are built. +type X__int8_t = int8 /* _types.h:55:22 */ +type X__uint8_t = uint8 /* _types.h:56:24 */ +type X__int16_t = int16 /* _types.h:57:17 */ +type X__uint16_t = uint16 /* _types.h:58:25 */ +type X__int32_t = int32 /* _types.h:59:15 */ +type X__uint32_t = uint32 /* _types.h:60:23 */ +type X__int64_t = int64 /* _types.h:62:16 */ +type X__uint64_t = uint64 /* _types.h:63:24 */ + +// Standard type definitions. +type X__clock_t = X__int32_t /* _types.h:75:19 */ // clock()... +type X__critical_t = X__int64_t /* _types.h:76:19 */ +type X__double_t = float64 /* _types.h:78:17 */ +type X__float_t = float32 /* _types.h:79:16 */ +type X__intfptr_t = X__int64_t /* _types.h:81:19 */ +type X__intptr_t = X__int64_t /* _types.h:82:19 */ +type X__intmax_t = X__int64_t /* _types.h:93:19 */ +type X__int_fast8_t = X__int32_t /* _types.h:94:19 */ +type X__int_fast16_t = X__int32_t /* _types.h:95:19 */ +type X__int_fast32_t = X__int32_t /* _types.h:96:19 */ +type X__int_fast64_t = X__int64_t /* _types.h:97:19 */ +type X__int_least8_t = X__int8_t /* _types.h:98:18 */ +type X__int_least16_t = X__int16_t /* _types.h:99:19 */ +type X__int_least32_t = X__int32_t /* _types.h:100:19 */ +type X__int_least64_t = X__int64_t /* _types.h:101:19 */ +type X__ptrdiff_t = X__int64_t /* _types.h:103:19 */ // ptr1 - ptr2 +type X__register_t = X__int64_t /* _types.h:104:19 */ +type X__segsz_t = X__int64_t /* _types.h:105:19 */ // segment size (in pages) +type X__size_t = X__uint64_t /* _types.h:106:20 */ // sizeof() +type X__ssize_t = X__int64_t /* _types.h:107:19 */ // byte count or error +type X__time_t = X__int64_t /* _types.h:108:19 */ // time()... +type X__uintfptr_t = X__uint64_t /* _types.h:109:20 */ +type X__uintptr_t = X__uint64_t /* _types.h:110:20 */ +type X__uintmax_t = X__uint64_t /* _types.h:121:20 */ +type X__uint_fast8_t = X__uint32_t /* _types.h:122:20 */ +type X__uint_fast16_t = X__uint32_t /* _types.h:123:20 */ +type X__uint_fast32_t = X__uint32_t /* _types.h:124:20 */ +type X__uint_fast64_t = X__uint64_t /* _types.h:125:20 */ +type X__uint_least8_t = X__uint8_t /* _types.h:126:19 */ +type X__uint_least16_t = X__uint16_t /* _types.h:127:20 */ +type X__uint_least32_t = X__uint32_t /* _types.h:128:20 */ +type X__uint_least64_t = X__uint64_t /* _types.h:129:20 */ +type X__u_register_t = X__uint64_t /* _types.h:131:20 */ +type X__vm_offset_t = X__uint64_t /* _types.h:132:20 */ +type X__vm_paddr_t = X__uint64_t /* _types.h:133:20 */ +type X__vm_size_t = X__uint64_t /* _types.h:134:20 */ +type X___wchar_t = int32 /* _types.h:141:14 */ + +// Standard type definitions. +type X__blksize_t = X__int32_t /* _types.h:40:19 */ // file block size +type X__blkcnt_t = X__int64_t /* _types.h:41:19 */ // file block count +type X__clockid_t = X__int32_t /* _types.h:42:19 */ // clock_gettime()... +type X__fflags_t = X__uint32_t /* _types.h:43:20 */ // file flags +type X__fsblkcnt_t = X__uint64_t /* _types.h:44:20 */ +type X__fsfilcnt_t = X__uint64_t /* _types.h:45:20 */ +type X__gid_t = X__uint32_t /* _types.h:46:20 */ +type X__id_t = X__int64_t /* _types.h:47:19 */ // can hold a gid_t, pid_t, or uid_t +type X__ino_t = X__uint64_t /* _types.h:48:20 */ // inode number +type X__key_t = int64 /* _types.h:49:15 */ // IPC key (for Sys V IPC) +type X__lwpid_t = X__int32_t /* _types.h:50:19 */ // Thread ID (a.k.a. LWP) +type X__mode_t = X__uint16_t /* _types.h:51:20 */ // permissions +type X__accmode_t = int32 /* _types.h:52:14 */ // access permissions +type X__nl_item = int32 /* _types.h:53:14 */ +type X__nlink_t = X__uint64_t /* _types.h:54:20 */ // link count +type X__off_t = X__int64_t /* _types.h:55:19 */ // file offset +type X__off64_t = X__int64_t /* _types.h:56:19 */ // file offset (alias) +type X__pid_t = X__int32_t /* _types.h:57:19 */ // process [group] +type X__rlim_t = X__int64_t /* _types.h:58:19 */ // resource limit - intentionally +// signed, because of legacy code +// that uses -1 for RLIM_INFINITY +type X__sa_family_t = X__uint8_t /* _types.h:61:19 */ +type X__socklen_t = X__uint32_t /* _types.h:62:20 */ +type X__suseconds_t = int64 /* _types.h:63:15 */ // microseconds (signed) +type X__timer_t = uintptr /* _types.h:64:24 */ // timer_gettime()... +type X__mqd_t = uintptr /* _types.h:65:21 */ // mq_open()... +type X__uid_t = X__uint32_t /* _types.h:66:20 */ +type X__useconds_t = uint32 /* _types.h:67:22 */ // microseconds (unsigned) +type X__cpuwhich_t = int32 /* _types.h:68:14 */ // which parameter for cpuset. +type X__cpulevel_t = int32 /* _types.h:69:14 */ // level parameter for cpuset. +type X__cpusetid_t = int32 /* _types.h:70:14 */ // cpuset identifier. +type X__daddr_t = X__int64_t /* _types.h:71:19 */ // bwrite(3), FIOBMAP2, etc + +// Unusual type definitions. +// rune_t is declared to be an ``int'' instead of the more natural +// ``unsigned long'' or ``long''. Two things are happening here. It is not +// unsigned so that EOF (-1) can be naturally assigned to it and used. Also, +// it looks like 10646 will be a 31 bit standard. This means that if your +// ints cannot hold 32 bits, you will be in trouble. The reason an int was +// chosen over a long is that the is*() and to*() routines take ints (says +// ANSI C), but they use __ct_rune_t instead of int. +// +// NOTE: rune_t is not covered by ANSI nor other standards, and should not +// be instantiated outside of lib/libc/locale. Use wchar_t. wint_t and +// rune_t must be the same type. Also, wint_t should be able to hold all +// members of the largest character set plus one extra value (WEOF), and +// must be at least 16 bits. +type X__ct_rune_t = int32 /* _types.h:91:14 */ // arg type for ctype funcs +type X__rune_t = X__ct_rune_t /* _types.h:92:21 */ // rune_t (see above) +type X__wint_t = X__ct_rune_t /* _types.h:93:21 */ // wint_t (see above) + +// Clang already provides these types as built-ins, but only in C++ mode. +type X__char16_t = X__uint_least16_t /* _types.h:97:26 */ +type X__char32_t = X__uint_least32_t /* _types.h:98:26 */ +// In C++11, char16_t and char32_t are built-in types. + +type X__max_align_t = struct { + F__max_align1 int64 + F__max_align2 float64 +} /* _types.h:111:3 */ + +type X__dev_t = X__uint64_t /* _types.h:113:20 */ // device number + +type X__fixpt_t = X__uint32_t /* _types.h:115:20 */ // fixed point number + +// mbstate_t is an opaque object to keep conversion state during multibyte +// stream conversions. +type X__mbstate_t = struct { + _ [0]uint64 + F__mbstate8 [128]int8 +} /* _types.h:124:3 */ + +type X__rman_res_t = X__uintmax_t /* _types.h:126:25 */ + +// Types for varargs. These are all provided by builtin types these +// days, so centralize their definition. +type X__va_list = X__builtin_va_list /* _types.h:133:27 */ // internally known to gcc +type X__gnuc_va_list = X__va_list /* _types.h:140:20 */ + +type Iovec = struct { + Fiov_base uintptr + Fiov_len Size_t +} /* _iovec.h:45:1 */ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-4-Clause +// +// Copyright (c) 2001 David E. O'Brien +// Copyright (c) 1990 The Regents of the University of California. +// All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// William Jolitz. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. All advertising materials mentioning features or use of this software +// must display the following acknowledgement: +// This product includes software developed by the University of +// California, Berkeley and its contributors. +// 4. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// from: @(#)param.h 5.8 (Berkeley) 6/28/91 +// $FreeBSD$ + +// Round p (pointer or byte index) up to a correctly-aligned value +// for all data types (int, long, ...). The result is unsigned int +// and must be cast to any desired pointer type. + +// Definitions related to sockets: types, address families, options. + +// Data types. +type Gid_t = X__gid_t /* socket.h:52:18 */ + +type Off_t = X__off_t /* socket.h:57:18 */ + +type Pid_t = X__pid_t /* socket.h:62:18 */ + +type Sa_family_t = X__sa_family_t /* socket.h:68:23 */ + +type Socklen_t = X__socklen_t /* socket.h:73:21 */ + +type Ssize_t = X__ssize_t /* socket.h:78:19 */ + +type Uid_t = X__uid_t /* socket.h:84:18 */ + +type Uint32_t = X__uint32_t /* socket.h:90:20 */ + +type Uintptr_t = X__uintptr_t /* socket.h:95:21 */ + +// Types + +// Creation flags, OR'ed into socket() and socketpair() type argument. + +// Option flags per-socket. + +// Additional options, not kept in so_options. + +// Space reserved for new socket options added by third-party vendors. +// This range applies to all socket option levels. New socket options +// in FreeBSD should always use an option value less than SO_VENDOR. + +// Structure used for manipulating linger option. +type Linger = struct { + Fl_onoff int32 + Fl_linger int32 +} /* socket.h:198:1 */ + +type Accept_filter_arg = struct { + Faf_name [16]int8 + Faf_arg [240]int8 +} /* socket.h:204:1 */ + +// Level number for (get/set)sockopt() to apply to socket itself. + +// Address families. +// When allocating a new AF_ constant, please only allocate +// even numbered constants for FreeBSD until 134 as odd numbered AF_ +// constants 39-133 are now reserved for vendors. + +// Structure used by kernel to store most +// addresses. +type Sockaddr = struct { + Fsa_len uint8 + Fsa_family Sa_family_t + Fsa_data [14]int8 +} /* socket.h:328:1 */ + +// Structure used by kernel to pass protocol +// information in raw sockets. +type Sockproto = struct { + Fsp_family uint16 + Fsp_protocol uint16 +} /* socket.h:340:1 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)socket.h 8.4 (Berkeley) 2/21/94 +// $FreeBSD$ + +// RFC 2553: protocol-independent placeholder for socket addresses + +type Sockaddr_storage = struct { + Fss_len uint8 + Fss_family Sa_family_t + F__ss_pad1 [6]int8 + F__ss_align X__int64_t + F__ss_pad2 [112]int8 +} /* _sockaddr_storage.h:48:1 */ + +// Protocol families, same as address families for now. + +// Definitions for network related sysctl, CTL_NET. +// +// Second level is protocol family. +// Third level is protocol number. +// +// Further levels are defined by the individual families. + +// PF_ROUTE - Routing table +// +// Three additional levels are defined: +// Fourth: address family, 0 is wildcard +// Fifth: type of info, defined below +// Sixth: flag(s) to mask with for NET_RT_FLAGS + +// Maximum queue length specifiable by listen. + +// Message header for recvmsg and sendmsg calls. +// Used value-result for recvmsg, value only for sendmsg. +type Msghdr = struct { + Fmsg_name uintptr + Fmsg_namelen Socklen_t + _ [4]byte + Fmsg_iov uintptr + Fmsg_iovlen int32 + _ [4]byte + Fmsg_control uintptr + Fmsg_controllen Socklen_t + Fmsg_flags int32 +} /* socket.h:432:1 */ + +// 0x00000200 unused +// 0x00000400 unused +// 0x00000800 unused +// 0x00001000 unused + +// Header for ancillary data objects in msg_control buffer. +// Used for additional information with/about a datagram +// not expressible by flags. The format is a sequence +// of message elements headed by cmsghdr structures. +type Cmsghdr = struct { + Fcmsg_len Socklen_t + Fcmsg_level int32 + Fcmsg_type int32 +} /* socket.h:481:1 */ + +// While we may have more groups than this, the cmsgcred struct must +// be able to fit in an mbuf and we have historically supported a +// maximum of 16 groups. + +// Credentials structure, used to verify the identity of a peer +// process that has sent us a message. This is allocated by the +// peer process but filled in by the kernel. This prevents the +// peer from lying about its identity. (Note that cmcred_groups[0] +// is the effective GID.) +type Cmsgcred = struct { + Fcmcred_pid Pid_t + Fcmcred_uid Uid_t + Fcmcred_euid Uid_t + Fcmcred_gid Gid_t + Fcmcred_ngroups int16 + _ [2]byte + Fcmcred_groups [16]Gid_t +} /* socket.h:503:1 */ + +// Socket credentials (LOCAL_CREDS). +type Sockcred = struct { + Fsc_uid Uid_t + Fsc_euid Uid_t + Fsc_gid Gid_t + Fsc_egid Gid_t + Fsc_ngroups int32 + Fsc_groups [1]Gid_t +} /* socket.h:515:1 */ + +// Compute size of a sockcred structure with groups. + +// Socket credentials (LOCAL_CREDS_PERSISTENT). +type Sockcred2 = struct { + Fsc_version int32 + Fsc_pid Pid_t + Fsc_uid Uid_t + Fsc_euid Uid_t + Fsc_gid Gid_t + Fsc_egid Gid_t + Fsc_ngroups int32 + Fsc_groups [1]Gid_t +} /* socket.h:533:1 */ + +// given pointer to struct cmsghdr, return pointer to data + +// given pointer to struct cmsghdr, return pointer to next cmsghdr + +// RFC 2292 requires to check msg_controllen, in case that the kernel returns +// an empty list for some reasons. + +// RFC 2292 additions + +// "Socket"-level control message types: + +type Sock_timestamp_info = struct { + Fst_info_flags X__uint32_t + Fst_info_pad0 X__uint32_t + Fst_info_rsv [7]X__uint64_t +} /* socket.h:592:1 */ + +// 4.3 compat sockaddr, move to compat file later +type Osockaddr = struct { + Fsa_family uint16 + Fsa_data [14]int8 +} /* socket.h:607:1 */ + +// 4.3-compat message header (move to compat file later). +type Omsghdr = struct { + Fmsg_name uintptr + Fmsg_namelen int32 + _ [4]byte + Fmsg_iov uintptr + Fmsg_iovlen int32 + _ [4]byte + Fmsg_accrights uintptr + Fmsg_accrightslen int32 + _ [4]byte +} /* socket.h:615:1 */ + +// howto arguments for shutdown(2), specified by Posix.1g. + +// for SCTP +// we cheat and use the SHUT_XX defines for these + +// sendfile(2) header/trailer struct +type Sf_hdtr = struct { + Fheaders uintptr + Fhdr_cnt int32 + _ [4]byte + Ftrailers uintptr + Ftrl_cnt int32 + _ [4]byte +} /* socket.h:644:1 */ + +// Sendfile-specific flag(s) + +// Sendmmsg/recvmmsg specific structure(s) +type Mmsghdr = struct { + Fmsg_hdr struct { + Fmsg_name uintptr + Fmsg_namelen Socklen_t + _ [4]byte + Fmsg_iov uintptr + Fmsg_iovlen int32 + _ [4]byte + Fmsg_control uintptr + Fmsg_controllen Socklen_t + Fmsg_flags int32 + } + Fmsg_len Ssize_t +} /* socket.h:668:1 */ + +var _ int8 /* gen.c:2:13: */ diff --git a/vendor/modernc.org/libc/sys/stat/capi_freebsd_amd64.go b/vendor/modernc.org/libc/sys/stat/capi_freebsd_amd64.go new file mode 100644 index 000000000..4aed33ac0 --- /dev/null +++ b/vendor/modernc.org/libc/sys/stat/capi_freebsd_amd64.go @@ -0,0 +1,5 @@ +// Code generated by 'ccgo sys/stat/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/stat/stat_freebsd_amd64.go -pkgname stat', DO NOT EDIT. + +package stat + +var CAPI = map[string]struct{}{} diff --git a/vendor/modernc.org/libc/sys/stat/stat_freebsd_amd64.go b/vendor/modernc.org/libc/sys/stat/stat_freebsd_amd64.go new file mode 100644 index 000000000..b71940211 --- /dev/null +++ b/vendor/modernc.org/libc/sys/stat/stat_freebsd_amd64.go @@ -0,0 +1,1897 @@ +// Code generated by 'ccgo sys/stat/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/stat/stat_freebsd_amd64.go -pkgname stat', DO NOT EDIT. + +package stat + +import ( + "math" + "reflect" + "sync/atomic" + "unsafe" +) + +var _ = math.Pi +var _ reflect.Kind +var _ atomic.Value +var _ unsafe.Pointer + +const ( + ACCESSPERMS = 511 + ALLPERMS = 4095 + BIG_ENDIAN = 4321 + BYTE_ORDER = 1234 + CLK_TCK = 128 + CLOCKS_PER_SEC = 128 + CLOCK_MONOTONIC = 4 + CLOCK_MONOTONIC_FAST = 12 + CLOCK_MONOTONIC_PRECISE = 11 + CLOCK_PROCESS_CPUTIME_ID = 15 + CLOCK_PROF = 2 + CLOCK_REALTIME = 0 + CLOCK_REALTIME_FAST = 10 + CLOCK_REALTIME_PRECISE = 9 + CLOCK_SECOND = 13 + CLOCK_THREAD_CPUTIME_ID = 14 + CLOCK_UPTIME = 5 + CLOCK_UPTIME_FAST = 8 + CLOCK_UPTIME_PRECISE = 7 + CLOCK_VIRTUAL = 1 + CPUCLOCK_WHICH_PID = 0 + CPUCLOCK_WHICH_TID = 1 + DEFFILEMODE = 438 + DST_AUST = 2 + DST_CAN = 6 + DST_EET = 5 + DST_MET = 4 + DST_NONE = 0 + DST_USA = 1 + DST_WET = 3 + FD_SETSIZE = 1024 + ITIMER_PROF = 2 + ITIMER_REAL = 0 + ITIMER_VIRTUAL = 1 + LITTLE_ENDIAN = 1234 + PDP_ENDIAN = 3412 + SBT_MAX = 0x7fffffffffffffff + SF_APPEND = 0x00040000 + SF_ARCHIVED = 0x00010000 + SF_IMMUTABLE = 0x00020000 + SF_NOUNLINK = 0x00100000 + SF_SETTABLE = 0xffff0000 + SF_SNAPSHOT = 0x00200000 + S_BLKSIZE = 512 + S_IEXEC = 64 + S_IFBLK = 0060000 + S_IFCHR = 0020000 + S_IFDIR = 0040000 + S_IFIFO = 0010000 + S_IFLNK = 0120000 + S_IFMT = 0170000 + S_IFREG = 0100000 + S_IFSOCK = 0140000 + S_IFWHT = 0160000 + S_IREAD = 256 + S_IRGRP = 0000040 + S_IROTH = 0000004 + S_IRUSR = 0000400 + S_IRWXG = 0000070 + S_IRWXO = 0000007 + S_IRWXU = 0000700 + S_ISGID = 0002000 + S_ISTXT = 0001000 + S_ISUID = 0004000 + S_ISVTX = 0001000 + S_IWGRP = 0000020 + S_IWOTH = 0000002 + S_IWRITE = 128 + S_IWUSR = 0000200 + S_IXGRP = 0000010 + S_IXOTH = 0000001 + S_IXUSR = 0000100 + TIMER_ABSTIME = 0x1 + TIMER_RELTIME = 0x0 + TIME_UTC = 1 + UF_APPEND = 0x00000004 + UF_ARCHIVE = 0x00000800 + UF_HIDDEN = 0x00008000 + UF_IMMUTABLE = 0x00000002 + UF_NODUMP = 0x00000001 + UF_NOUNLINK = 0x00000010 + UF_OFFLINE = 0x00000200 + UF_OPAQUE = 0x00000008 + UF_READONLY = 0x00001000 + UF_REPARSE = 0x00000400 + UF_SETTABLE = 0x0000ffff + UF_SPARSE = 0x00000100 + UF_SYSTEM = 0x00000080 + UTIME_NOW = -1 + UTIME_OMIT = -2 + X_ACCMODE_T_DECLARED = 0 + X_BIG_ENDIAN = 4321 + X_BLKCNT_T_DECLARED = 0 + X_BLKSIZE_T_DECLARED = 0 + X_BYTE_ORDER = 1234 + X_CAP_IOCTL_T_DECLARED = 0 + X_CAP_RIGHTS_T_DECLARED = 0 + X_CLOCKID_T_DECLARED = 0 + X_CLOCK_T_DECLARED = 0 + X_DEV_T_DECLARED = 0 + X_FFLAGS_T_DECLARED = 0 + X_FILE_OFFSET_BITS = 64 + X_FSBLKCNT_T_DECLARED = 0 + X_FTRUNCATE_DECLARED = 0 + X_GID_T_DECLARED = 0 + X_ID_T_DECLARED = 0 + X_INO_T_DECLARED = 0 + X_INT16_T_DECLARED = 0 + X_INT32_T_DECLARED = 0 + X_INT64_T_DECLARED = 0 + X_INT8_T_DECLARED = 0 + X_INTMAX_T_DECLARED = 0 + X_INTPTR_T_DECLARED = 0 + X_IN_ADDR_T_DECLARED = 0 + X_IN_PORT_T_DECLARED = 0 + X_KEY_T_DECLARED = 0 + X_LITTLE_ENDIAN = 1234 + X_LOCALE_T_DEFINED = 0 + X_LP64 = 1 + X_LSEEK_DECLARED = 0 + X_LWPID_T_DECLARED = 0 + X_MACHINE_ENDIAN_H_ = 0 + X_MACHINE__LIMITS_H_ = 0 + X_MACHINE__TYPES_H_ = 0 + X_MKNOD_DECLARED = 0 + X_MMAP_DECLARED = 0 + X_MODE_T_DECLARED = 0 + X_MQD_T_DECLARED = 0 + X_NLINK_T_DECLARED = 0 + X_Nonnull = 0 + X_Null_unspecified = 0 + X_Nullable = 0 + X_OFF64_T_DECLARED = 0 + X_OFF_T_DECLARED = 0 + X_PDP_ENDIAN = 3412 + X_PID_T_DECLARED = 0 + X_PTHREAD_T_DECLARED = 0 + X_QUAD_HIGHWORD = 1 + X_QUAD_LOWWORD = 0 + X_RLIM_T_DECLARED = 0 + X_SELECT_DECLARED = 0 + X_SIGSET_T_DECLARED = 0 + X_SIG_MAXSIG = 128 + X_SIG_WORDS = 4 + X_SIZE_T_DECLARED = 0 + X_SSIZE_T_DECLARED = 0 + X_SUSECONDS_T_DECLARED = 0 + X_SYS_CDEFS_H_ = 0 + X_SYS_SELECT_H_ = 0 + X_SYS_STAT_H_ = 0 + X_SYS_TIMESPEC_H_ = 0 + X_SYS_TIME_H_ = 0 + X_SYS_TYPES_H_ = 0 + X_SYS__PTHREADTYPES_H_ = 0 + X_SYS__SIGSET_H_ = 0 + X_SYS__STDINT_H_ = 0 + X_SYS__TIMESPEC_H_ = 0 + X_SYS__TIMEVAL_H_ = 0 + X_SYS__TYPES_H_ = 0 + X_TIMER_T_DECLARED = 0 + X_TIME_H_ = 0 + X_TIME_T_DECLARED = 0 + X_TRUNCATE_DECLARED = 0 + X_UID_T_DECLARED = 0 + X_UINT16_T_DECLARED = 0 + X_UINT32_T_DECLARED = 0 + X_UINT64_T_DECLARED = 0 + X_UINT8_T_DECLARED = 0 + X_UINTMAX_T_DECLARED = 0 + X_UINTPTR_T_DECLARED = 0 + X_USECONDS_T_DECLARED = 0 + X_XLOCALE_LOCALE1_H = 0 + Unix = 1 +) + +type Ptrdiff_t = int64 /* <builtin>:3:26 */ + +type Size_t = uint64 /* <builtin>:9:23 */ + +type Wchar_t = int32 /* <builtin>:15:24 */ + +type X__int128_t = struct { + Flo int64 + Fhi int64 +} /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128 +type X__uint128_t = struct { + Flo uint64 + Fhi uint64 +} /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128 + +type X__builtin_va_list = uintptr /* <builtin>:46:14 */ +type X__float128 = float64 /* <builtin>:47:21 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1989, 1993 +// The Regents of the University of California. All rights reserved. +// (c) UNIX System Laboratories, Inc. +// All or some portions of this file are derived from material licensed +// to the University of California by American Telephone and Telegraph +// Co. or Unix System Laboratories, Inc. and are reproduced herein with +// the permission of UNIX System Laboratories, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)stat.h 8.12 (Berkeley) 6/16/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// Testing against Clang-specific extensions. + +// This code has been put in place to help reduce the addition of +// compiler specific defines in FreeBSD code. It helps to aid in +// having a compiler-agnostic source tree. + +// Compiler memory barriers, specific to gcc and clang. + +// XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced + +// Macro to test if we're using a specific version of gcc or later. + +// The __CONCAT macro is used to concatenate parts of symbol names, e.g. +// with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. +// The __CONCAT macro is a bit tricky to use if it must work in non-ANSI +// mode -- there must be no spaces between its arguments, and for nested +// __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also +// concatenate double-quoted strings produced by the __STRING macro, but +// this only works with ANSI C. +// +// __XSTRING is like __STRING, but it expands any macros in its argument +// first. It is only available with ANSI C. + +// Compiler-dependent macros to help declare dead (non-returning) and +// pure (no side effects) functions, and unused variables. They are +// null except for versions of gcc that are known to support the features +// properly (old versions of gcc-2 supported the dead and pure features +// in a different (wrong) way). If we do not provide an implementation +// for a given compiler, let the compile fail if it is told to use +// a feature that we cannot live without. + +// Keywords added in C11. + +// Emulation of C11 _Generic(). Unlike the previously defined C11 +// keywords, it is not possible to implement this using exactly the same +// syntax. Therefore implement something similar under the name +// __generic(). Unlike _Generic(), this macro can only distinguish +// between a single type, so it requires nested invocations to +// distinguish multiple cases. + +// C99 Static array indices in function parameter declarations. Syntax such as: +// void bar(int myArray[static 10]); +// is allowed in C99 but not in C++. Define __min_size appropriately so +// headers using it can be compiled in either language. Use like this: +// void bar(int myArray[__min_size(10)]); + +// XXX: should use `#if __STDC_VERSION__ < 199901'. + +// C++11 exposes a load of C99 stuff + +// GCC 2.95 provides `__restrict' as an extension to C90 to support the +// C99-specific `restrict' type qualifier. We happen to use `__restrict' as +// a way to define the `restrict' type qualifier without disturbing older +// software that is unaware of C99 keywords. + +// GNU C version 2.96 adds explicit branch prediction so that +// the CPU back-end can hint the processor and also so that +// code blocks can be reordered such that the predicted path +// sees a more linear flow, thus improving cache behavior, etc. +// +// The following two macros provide us with a way to utilize this +// compiler feature. Use __predict_true() if you expect the expression +// to evaluate to true, and __predict_false() if you expect the +// expression to evaluate to false. +// +// A few notes about usage: +// +// * Generally, __predict_false() error condition checks (unless +// you have some _strong_ reason to do otherwise, in which case +// document it), and/or __predict_true() `no-error' condition +// checks, assuming you want to optimize for the no-error case. +// +// * Other than that, if you don't know the likelihood of a test +// succeeding from empirical or other `hard' evidence, don't +// make predictions. +// +// * These are meant to be used in places that are run `a lot'. +// It is wasteful to make predictions in code that is run +// seldomly (e.g. at subsystem initialization time) as the +// basic block reordering that this affects can often generate +// larger code. + +// We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h> +// require it. + +// Given the pointer x to the member m of the struct s, return +// a pointer to the containing structure. When using GCC, we first +// assign pointer x to a local variable, to check that its type is +// compatible with member m. + +// Compiler-dependent macros to declare that functions take printf-like +// or scanf-like arguments. They are null except for versions of gcc +// that are known to support the features properly (old versions of gcc-2 +// didn't permit keeping the keywords out of the application namespace). + +// Compiler-dependent macros that rely on FreeBSD-specific extensions. + +// Embed the rcs id of a source file in the resulting library. Note that in +// more recent ELF binutils, we use .ident allowing the ID to be stripped. +// Usage: +// __FBSDID("$FreeBSD$"); + +// - +// The following definitions are an extension of the behavior originally +// implemented in <sys/_posix.h>, but with a different level of granularity. +// POSIX.1 requires that the macros we test be defined before any standard +// header file is included. +// +// Here's a quick run-down of the versions: +// defined(_POSIX_SOURCE) 1003.1-1988 +// _POSIX_C_SOURCE == 1 1003.1-1990 +// _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option +// _POSIX_C_SOURCE == 199309 1003.1b-1993 +// _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, +// and the omnibus ISO/IEC 9945-1: 1996 +// _POSIX_C_SOURCE == 200112 1003.1-2001 +// _POSIX_C_SOURCE == 200809 1003.1-2008 +// +// In addition, the X/Open Portability Guide, which is now the Single UNIX +// Specification, defines a feature-test macro which indicates the version of +// that specification, and which subsumes _POSIX_C_SOURCE. +// +// Our macros begin with two underscores to avoid namespace screwage. + +// Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. + +// Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. + +// Deal with various X/Open Portability Guides and Single UNIX Spec. + +// Deal with all versions of POSIX. The ordering relative to the tests above is +// important. +// - +// Deal with _ANSI_SOURCE: +// If it is defined, and no other compilation environment is explicitly +// requested, then define our internal feature-test macros to zero. This +// makes no difference to the preprocessor (undefined symbols in preprocessing +// expressions are defined to have value zero), but makes it more convenient for +// a test program to print out the values. +// +// If a program mistakenly defines _ANSI_SOURCE and some other macro such as +// _POSIX_C_SOURCE, we will assume that it wants the broader compilation +// environment (and in fact we will never get here). + +// User override __EXT1_VISIBLE + +// Old versions of GCC use non-standard ARM arch symbols; acle-compat.h +// translates them to __ARM_ARCH and the modern feature symbols defined by ARM. + +// Nullability qualifiers: currently only supported by Clang. + +// Type Safety Checking +// +// Clang provides additional attributes to enable checking type safety +// properties that cannot be enforced by the C type system. + +// Lock annotations. +// +// Clang provides support for doing basic thread-safety tests at +// compile-time, by marking which locks will/should be held when +// entering/leaving a functions. +// +// Furthermore, it is also possible to annotate variables and structure +// members to enforce that they are only accessed when certain locks are +// held. + +// Structure implements a lock. + +// Function acquires an exclusive or shared lock. + +// Function attempts to acquire an exclusive or shared lock. + +// Function releases a lock. + +// Function asserts that an exclusive or shared lock is held. + +// Function requires that an exclusive or shared lock is or is not held. + +// Function should not be analyzed. + +// Function or variable should not be sanitized, i.e. by AddressSanitizer. +// GCC has the nosanitize attribute, but as a function attribute only, and +// warns on use as a variable attribute. + +// Guard variables and structure members by lock. + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)time.h 8.5 (Berkeley) 5/4/95 +// from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-4-Clause +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// Copyright (c) 1990, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. All advertising materials mentioning features or use of this software +// must display the following acknowledgement: +// This product includes software developed by the University of +// California, Berkeley and its contributors. +// 4. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 +// From: @(#)types.h 8.3 (Berkeley) 1/5/94 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1988, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)limits.h 8.3 (Berkeley) 1/4/94 +// $FreeBSD$ + +// According to ANSI (section 2.2.4.2), the values below must be usable by +// #if preprocessing directives. Additionally, the expression must have the +// same type as would an expression that is an object of the corresponding +// type converted according to the integral promotions. The subtraction for +// INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an +// unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). + +// max value for an unsigned long long + +// Quads and longs are the same on the amd64. Ensure they stay in sync. + +// Minimum signal stack size. + +// Basic types upon which most other types are built. +type X__int8_t = int8 /* _types.h:55:22 */ +type X__uint8_t = uint8 /* _types.h:56:24 */ +type X__int16_t = int16 /* _types.h:57:17 */ +type X__uint16_t = uint16 /* _types.h:58:25 */ +type X__int32_t = int32 /* _types.h:59:15 */ +type X__uint32_t = uint32 /* _types.h:60:23 */ +type X__int64_t = int64 /* _types.h:62:16 */ +type X__uint64_t = uint64 /* _types.h:63:24 */ + +// Standard type definitions. +type X__clock_t = X__int32_t /* _types.h:75:19 */ // clock()... +type X__critical_t = X__int64_t /* _types.h:76:19 */ +type X__double_t = float64 /* _types.h:78:17 */ +type X__float_t = float32 /* _types.h:79:16 */ +type X__intfptr_t = X__int64_t /* _types.h:81:19 */ +type X__intptr_t = X__int64_t /* _types.h:82:19 */ +type X__intmax_t = X__int64_t /* _types.h:93:19 */ +type X__int_fast8_t = X__int32_t /* _types.h:94:19 */ +type X__int_fast16_t = X__int32_t /* _types.h:95:19 */ +type X__int_fast32_t = X__int32_t /* _types.h:96:19 */ +type X__int_fast64_t = X__int64_t /* _types.h:97:19 */ +type X__int_least8_t = X__int8_t /* _types.h:98:18 */ +type X__int_least16_t = X__int16_t /* _types.h:99:19 */ +type X__int_least32_t = X__int32_t /* _types.h:100:19 */ +type X__int_least64_t = X__int64_t /* _types.h:101:19 */ +type X__ptrdiff_t = X__int64_t /* _types.h:103:19 */ // ptr1 - ptr2 +type X__register_t = X__int64_t /* _types.h:104:19 */ +type X__segsz_t = X__int64_t /* _types.h:105:19 */ // segment size (in pages) +type X__size_t = X__uint64_t /* _types.h:106:20 */ // sizeof() +type X__ssize_t = X__int64_t /* _types.h:107:19 */ // byte count or error +type X__time_t = X__int64_t /* _types.h:108:19 */ // time()... +type X__uintfptr_t = X__uint64_t /* _types.h:109:20 */ +type X__uintptr_t = X__uint64_t /* _types.h:110:20 */ +type X__uintmax_t = X__uint64_t /* _types.h:121:20 */ +type X__uint_fast8_t = X__uint32_t /* _types.h:122:20 */ +type X__uint_fast16_t = X__uint32_t /* _types.h:123:20 */ +type X__uint_fast32_t = X__uint32_t /* _types.h:124:20 */ +type X__uint_fast64_t = X__uint64_t /* _types.h:125:20 */ +type X__uint_least8_t = X__uint8_t /* _types.h:126:19 */ +type X__uint_least16_t = X__uint16_t /* _types.h:127:20 */ +type X__uint_least32_t = X__uint32_t /* _types.h:128:20 */ +type X__uint_least64_t = X__uint64_t /* _types.h:129:20 */ +type X__u_register_t = X__uint64_t /* _types.h:131:20 */ +type X__vm_offset_t = X__uint64_t /* _types.h:132:20 */ +type X__vm_paddr_t = X__uint64_t /* _types.h:133:20 */ +type X__vm_size_t = X__uint64_t /* _types.h:134:20 */ +type X___wchar_t = int32 /* _types.h:141:14 */ + +// Standard type definitions. +type X__blksize_t = X__int32_t /* _types.h:40:19 */ // file block size +type X__blkcnt_t = X__int64_t /* _types.h:41:19 */ // file block count +type X__clockid_t = X__int32_t /* _types.h:42:19 */ // clock_gettime()... +type X__fflags_t = X__uint32_t /* _types.h:43:20 */ // file flags +type X__fsblkcnt_t = X__uint64_t /* _types.h:44:20 */ +type X__fsfilcnt_t = X__uint64_t /* _types.h:45:20 */ +type X__gid_t = X__uint32_t /* _types.h:46:20 */ +type X__id_t = X__int64_t /* _types.h:47:19 */ // can hold a gid_t, pid_t, or uid_t +type X__ino_t = X__uint64_t /* _types.h:48:20 */ // inode number +type X__key_t = int64 /* _types.h:49:15 */ // IPC key (for Sys V IPC) +type X__lwpid_t = X__int32_t /* _types.h:50:19 */ // Thread ID (a.k.a. LWP) +type X__mode_t = X__uint16_t /* _types.h:51:20 */ // permissions +type X__accmode_t = int32 /* _types.h:52:14 */ // access permissions +type X__nl_item = int32 /* _types.h:53:14 */ +type X__nlink_t = X__uint64_t /* _types.h:54:20 */ // link count +type X__off_t = X__int64_t /* _types.h:55:19 */ // file offset +type X__off64_t = X__int64_t /* _types.h:56:19 */ // file offset (alias) +type X__pid_t = X__int32_t /* _types.h:57:19 */ // process [group] +type X__rlim_t = X__int64_t /* _types.h:58:19 */ // resource limit - intentionally +// signed, because of legacy code +// that uses -1 for RLIM_INFINITY +type X__sa_family_t = X__uint8_t /* _types.h:61:19 */ +type X__socklen_t = X__uint32_t /* _types.h:62:20 */ +type X__suseconds_t = int64 /* _types.h:63:15 */ // microseconds (signed) +type X__timer_t = uintptr /* _types.h:64:24 */ // timer_gettime()... +type X__mqd_t = uintptr /* _types.h:65:21 */ // mq_open()... +type X__uid_t = X__uint32_t /* _types.h:66:20 */ +type X__useconds_t = uint32 /* _types.h:67:22 */ // microseconds (unsigned) +type X__cpuwhich_t = int32 /* _types.h:68:14 */ // which parameter for cpuset. +type X__cpulevel_t = int32 /* _types.h:69:14 */ // level parameter for cpuset. +type X__cpusetid_t = int32 /* _types.h:70:14 */ // cpuset identifier. +type X__daddr_t = X__int64_t /* _types.h:71:19 */ // bwrite(3), FIOBMAP2, etc + +// Unusual type definitions. +// rune_t is declared to be an ``int'' instead of the more natural +// ``unsigned long'' or ``long''. Two things are happening here. It is not +// unsigned so that EOF (-1) can be naturally assigned to it and used. Also, +// it looks like 10646 will be a 31 bit standard. This means that if your +// ints cannot hold 32 bits, you will be in trouble. The reason an int was +// chosen over a long is that the is*() and to*() routines take ints (says +// ANSI C), but they use __ct_rune_t instead of int. +// +// NOTE: rune_t is not covered by ANSI nor other standards, and should not +// be instantiated outside of lib/libc/locale. Use wchar_t. wint_t and +// rune_t must be the same type. Also, wint_t should be able to hold all +// members of the largest character set plus one extra value (WEOF), and +// must be at least 16 bits. +type X__ct_rune_t = int32 /* _types.h:91:14 */ // arg type for ctype funcs +type X__rune_t = X__ct_rune_t /* _types.h:92:21 */ // rune_t (see above) +type X__wint_t = X__ct_rune_t /* _types.h:93:21 */ // wint_t (see above) + +// Clang already provides these types as built-ins, but only in C++ mode. +type X__char16_t = X__uint_least16_t /* _types.h:97:26 */ +type X__char32_t = X__uint_least32_t /* _types.h:98:26 */ +// In C++11, char16_t and char32_t are built-in types. + +type X__max_align_t = struct { + F__max_align1 int64 + F__max_align2 float64 +} /* _types.h:111:3 */ + +type X__dev_t = X__uint64_t /* _types.h:113:20 */ // device number + +type X__fixpt_t = X__uint32_t /* _types.h:115:20 */ // fixed point number + +// mbstate_t is an opaque object to keep conversion state during multibyte +// stream conversions. +type X__mbstate_t = struct { + _ [0]uint64 + F__mbstate8 [128]int8 +} /* _types.h:124:3 */ + +type X__rman_res_t = X__uintmax_t /* _types.h:126:25 */ + +// Types for varargs. These are all provided by builtin types these +// days, so centralize their definition. +type X__va_list = X__builtin_va_list /* _types.h:133:27 */ // internally known to gcc +type X__gnuc_va_list = X__va_list /* _types.h:140:20 */ // compatibility w/GNU headers + +// When the following macro is defined, the system uses 64-bit inode numbers. +// Programs can use this to avoid including <sys/param.h>, with its associated +// namespace pollution. + +type Time_t = X__time_t /* _timespec.h:42:18 */ + +type Timespec = struct { + Ftv_sec Time_t + Ftv_nsec int64 +} /* _timespec.h:46:1 */ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +type Blksize_t = X__blksize_t /* stat.h:48:21 */ + +type Blkcnt_t = X__blkcnt_t /* stat.h:53:20 */ + +type Dev_t = X__dev_t /* stat.h:58:18 */ + +type Fflags_t = X__fflags_t /* stat.h:63:20 */ + +type Gid_t = X__gid_t /* stat.h:68:18 */ + +type Ino_t = X__ino_t /* stat.h:73:18 */ + +type Mode_t = X__mode_t /* stat.h:78:18 */ + +type Nlink_t = X__nlink_t /* stat.h:83:19 */ + +type Off_t = X__off_t /* stat.h:88:18 */ + +type Uid_t = X__uid_t /* stat.h:93:18 */ + +// XXX We get miscellaneous namespace pollution with this. +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)time.h 8.5 (Berkeley) 5/4/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +type Suseconds_t = X__suseconds_t /* _timeval.h:37:23 */ + +// Structure returned by gettimeofday(2) system call, and used in other calls. +type Timeval = struct { + Ftv_sec Time_t + Ftv_usec Suseconds_t +} /* _timeval.h:49:1 */ + +type Pthread_once = struct { + Fstate int32 + _ [4]byte + Fmutex Pthread_mutex_t +} /* _pthreadtypes.h:52:1 */ + +// Primitive system data type definitions required by P1003.1c. +// +// Note that P1003.1c specifies that there are no defined comparison +// or assignment operators for the types pthread_attr_t, pthread_cond_t, +// pthread_condattr_t, pthread_mutex_t, pthread_mutexattr_t. +type Pthread_t = uintptr /* _pthreadtypes.h:67:26 */ +type Pthread_attr_t = uintptr /* _pthreadtypes.h:70:30 */ +type Pthread_mutex_t = uintptr /* _pthreadtypes.h:71:31 */ +type Pthread_mutexattr_t = uintptr /* _pthreadtypes.h:72:35 */ +type Pthread_cond_t = uintptr /* _pthreadtypes.h:73:30 */ +type Pthread_condattr_t = uintptr /* _pthreadtypes.h:74:34 */ +type Pthread_key_t = int32 /* _pthreadtypes.h:75:20 */ +type Pthread_once_t = Pthread_once /* _pthreadtypes.h:76:30 */ +type Pthread_rwlock_t = uintptr /* _pthreadtypes.h:77:32 */ +type Pthread_rwlockattr_t = uintptr /* _pthreadtypes.h:78:35 */ +type Pthread_barrier_t = uintptr /* _pthreadtypes.h:79:33 */ +type Pthread_barrierattr_t = uintptr /* _pthreadtypes.h:80:36 */ +type Pthread_spinlock_t = uintptr /* _pthreadtypes.h:81:33 */ + +// Additional type definitions: +// +// Note that P1003.1c reserves the prefixes pthread_ and PTHREAD_ for +// use in header symbols. +type Pthread_addr_t = uintptr /* _pthreadtypes.h:89:14 */ +type Pthread_startroutine_t = uintptr /* _pthreadtypes.h:90:14 */ + +type U_char = uint8 /* types.h:52:23 */ +type U_short = uint16 /* types.h:53:24 */ +type U_int = uint32 /* types.h:54:22 */ +type U_long = uint64 /* types.h:55:23 */ +type Ushort = uint16 /* types.h:57:24 */ // Sys V compatibility +type Uint = uint32 /* types.h:58:22 */ // Sys V compatibility + +// XXX POSIX sized integrals that should appear only in <sys/stdint.h>. +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2011 David E. O'Brien <obrien@FreeBSD.org> +// Copyright (c) 2001 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +type Int8_t = X__int8_t /* _stdint.h:36:19 */ + +type Int16_t = X__int16_t /* _stdint.h:41:20 */ + +type Int32_t = X__int32_t /* _stdint.h:46:20 */ + +type Int64_t = X__int64_t /* _stdint.h:51:20 */ + +type Uint8_t = X__uint8_t /* _stdint.h:56:20 */ + +type Uint16_t = X__uint16_t /* _stdint.h:61:21 */ + +type Uint32_t = X__uint32_t /* _stdint.h:66:21 */ + +type Uint64_t = X__uint64_t /* _stdint.h:71:21 */ + +type Intptr_t = X__intptr_t /* _stdint.h:76:21 */ +type Uintptr_t = X__uintptr_t /* _stdint.h:80:22 */ +type Intmax_t = X__intmax_t /* _stdint.h:84:21 */ +type Uintmax_t = X__uintmax_t /* _stdint.h:88:22 */ + +type U_int8_t = X__uint8_t /* types.h:67:19 */ // unsigned integrals (deprecated) +type U_int16_t = X__uint16_t /* types.h:68:20 */ +type U_int32_t = X__uint32_t /* types.h:69:20 */ +type U_int64_t = X__uint64_t /* types.h:70:20 */ + +type U_quad_t = X__uint64_t /* types.h:72:20 */ // quads (deprecated) +type Quad_t = X__int64_t /* types.h:73:19 */ +type Qaddr_t = uintptr /* types.h:74:16 */ + +type Caddr_t = uintptr /* types.h:76:14 */ // core address +type C_caddr_t = uintptr /* types.h:77:20 */ // core address, pointer to const + +type Cpuwhich_t = X__cpuwhich_t /* types.h:84:22 */ +type Cpulevel_t = X__cpulevel_t /* types.h:85:22 */ +type Cpusetid_t = X__cpusetid_t /* types.h:86:22 */ + +type Clock_t = X__clock_t /* types.h:94:19 */ + +type Clockid_t = X__clockid_t /* types.h:99:21 */ + +type Critical_t = X__critical_t /* types.h:103:22 */ // Critical section value +type Daddr_t = X__daddr_t /* types.h:104:19 */ // disk address + +type Fixpt_t = X__fixpt_t /* types.h:116:19 */ // fixed point number + +type Fsblkcnt_t = X__fsblkcnt_t /* types.h:119:22 */ +type Fsfilcnt_t = X__fsfilcnt_t /* types.h:120:22 */ + +type In_addr_t = X__uint32_t /* types.h:130:20 */ // base type for internet address + +type In_port_t = X__uint16_t /* types.h:135:20 */ + +type Id_t = X__id_t /* types.h:140:17 */ // can hold a uid_t or pid_t + +type Key_t = X__key_t /* types.h:150:18 */ // IPC key (for Sys V IPC) + +type Lwpid_t = X__lwpid_t /* types.h:155:19 */ // Thread ID (a.k.a. LWP) + +type Accmode_t = X__accmode_t /* types.h:165:21 */ // access permissions + +type Off64_t = X__off64_t /* types.h:180:19 */ // file offset (alias) + +type Pid_t = X__pid_t /* types.h:185:18 */ // process id + +type Register_t = X__register_t /* types.h:189:22 */ + +type Rlim_t = X__rlim_t /* types.h:192:18 */ // resource limit + +type Sbintime_t = X__int64_t /* types.h:196:19 */ + +type Segsz_t = X__segsz_t /* types.h:198:19 */ + +type Ssize_t = X__ssize_t /* types.h:206:19 */ + +type Timer_t = X__timer_t /* types.h:221:19 */ + +type Mqd_t = X__mqd_t /* types.h:226:17 */ + +type U_register_t = X__u_register_t /* types.h:230:24 */ + +type Useconds_t = X__useconds_t /* types.h:238:22 */ // microseconds (unsigned) + +type Cap_ioctl_t = uint64 /* types.h:244:23 */ + +// Types suitable for exporting physical addresses, virtual addresses +// (pointers), and memory object sizes from the kernel independent of native +// word size. These should be used in place of vm_paddr_t, (u)intptr_t, and +// size_t in structs which contain such types that are shared with userspace. +type Kpaddr_t = X__uint64_t /* types.h:260:20 */ +type Kvaddr_t = X__uint64_t /* types.h:261:20 */ +type Ksize_t = X__uint64_t /* types.h:262:20 */ +type Kssize_t = X__int64_t /* types.h:263:19 */ + +type Vm_offset_t = X__vm_offset_t /* types.h:265:23 */ +type Vm_ooffset_t = X__uint64_t /* types.h:266:20 */ +type Vm_paddr_t = X__vm_paddr_t /* types.h:267:22 */ +type Vm_pindex_t = X__uint64_t /* types.h:268:20 */ +type Vm_size_t = X__vm_size_t /* types.h:269:21 */ + +type Rman_res_t = X__rman_res_t /* types.h:271:25 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1992, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1989, 1991, 1993 +// The Regents of the University of California. All rights reserved. +// (c) UNIX System Laboratories, Inc. +// All or some portions of this file are derived from material licensed +// to the University of California by American Telephone and Telegraph +// Co. or Unix System Laboratories, Inc. and are reproduced herein with +// the permission of UNIX System Laboratories, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)signal.h 8.4 (Berkeley) 5/4/95 +// $FreeBSD$ + +// sigset_t macros. + +type X__sigset = struct{ F__bits [4]X__uint32_t } /* _sigset.h:53:9 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1992, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1989, 1991, 1993 +// The Regents of the University of California. All rights reserved. +// (c) UNIX System Laboratories, Inc. +// All or some portions of this file are derived from material licensed +// to the University of California by American Telephone and Telegraph +// Co. or Unix System Laboratories, Inc. and are reproduced herein with +// the permission of UNIX System Laboratories, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)signal.h 8.4 (Berkeley) 5/4/95 +// $FreeBSD$ + +// sigset_t macros. + +type X__sigset_t = X__sigset /* _sigset.h:55:3 */ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)time.h 8.5 (Berkeley) 5/4/95 +// from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)time.h 8.5 (Berkeley) 5/4/95 +// from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp +// $FreeBSD$ + +// Structure defined by POSIX.1b to be like a itimerval, but with +// timespecs. Used in the timer_*() system calls. +type Itimerspec = struct { + Fit_interval struct { + Ftv_sec Time_t + Ftv_nsec int64 + } + Fit_value struct { + Ftv_sec Time_t + Ftv_nsec int64 + } +} /* timespec.h:60:1 */ + +type X__fd_mask = uint64 /* select.h:44:23 */ +type Fd_mask = X__fd_mask /* select.h:46:19 */ + +type Sigset_t = X__sigset_t /* select.h:51:20 */ + +// Select uses bit masks of file descriptors in longs. These macros +// manipulate such bit fields (the filesystem macros use chars). +// FD_SETSIZE may be defined by the user, but the default here should +// be enough for most uses. + +type Fd_set1 = struct{ F__fds_bits [16]X__fd_mask } /* select.h:73:9 */ + +// Select uses bit masks of file descriptors in longs. These macros +// manipulate such bit fields (the filesystem macros use chars). +// FD_SETSIZE may be defined by the user, but the default here should +// be enough for most uses. + +type Fd_set = Fd_set1 /* select.h:75:3 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)time.h 8.5 (Berkeley) 5/4/95 +// from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp +// $FreeBSD$ + +type Timezone = struct { + Ftz_minuteswest int32 + Ftz_dsttime int32 +} /* time.h:42:1 */ + +type Bintime = struct { + Fsec Time_t + Ffrac Uint64_t +} /* time.h:55:1 */ + +// Operations on timespecs + +// Names of the interval timers, and structure +// defining a timer setting. + +type Itimerval = struct { + Fit_interval struct { + Ftv_sec Time_t + Ftv_usec Suseconds_t + } + Fit_value struct { + Ftv_sec Time_t + Ftv_usec Suseconds_t + } +} /* time.h:447:1 */ + +// Getkerninfo clock information structure +type Clockinfo = struct { + Fhz int32 + Ftick int32 + Fspare int32 + Fstathz int32 + Fprofhz int32 +} /* time.h:455:1 */ + +// These macros are also in time.h. + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1989, 1993 +// The Regents of the University of California. All rights reserved. +// (c) UNIX System Laboratories, Inc. +// All or some portions of this file are derived from material licensed +// to the University of California by American Telephone and Telegraph +// Co. or Unix System Laboratories, Inc. and are reproduced herein with +// the permission of UNIX System Laboratories, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)time.h 8.3 (Berkeley) 1/21/94 + +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2003 Marcel Moolenaar +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// Frequency of the clock ticks reported by times(). Deprecated - use +// sysconf(_SC_CLK_TCK) instead. (Removed in 1003.1-2001.) + +// Frequency of the clock ticks reported by clock(). + +// New in POSIX 1003.1b-1993. + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)time.h 8.5 (Berkeley) 5/4/95 +// from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp +// $FreeBSD$ + +// These macros are also in sys/time.h. + +type Tm = struct { + Ftm_sec int32 + Ftm_min int32 + Ftm_hour int32 + Ftm_mday int32 + Ftm_mon int32 + Ftm_year int32 + Ftm_wday int32 + Ftm_yday int32 + Ftm_isdst int32 + _ [4]byte + Ftm_gmtoff int64 + Ftm_zone uintptr +} /* time.h:129:1 */ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2011, 2012 The FreeBSD Foundation +// All rights reserved. +// +// This software was developed by David Chisnall under sponsorship from +// the FreeBSD Foundation. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +type Locale_t = uintptr /* _time.h:36:25 */ + +type Stat = struct { + Fst_dev Dev_t + Fst_ino Ino_t + Fst_nlink Nlink_t + Fst_mode Mode_t + Fst_padding0 X__int16_t + Fst_uid Uid_t + Fst_gid Gid_t + Fst_padding1 X__int32_t + Fst_rdev Dev_t + Fst_atim struct { + Ftv_sec Time_t + Ftv_nsec int64 + } + Fst_mtim struct { + Ftv_sec Time_t + Ftv_nsec int64 + } + Fst_ctim struct { + Ftv_sec Time_t + Ftv_nsec int64 + } + Fst_birthtim struct { + Ftv_sec Time_t + Ftv_nsec int64 + } + Fst_size Off_t + Fst_blocks Blkcnt_t + Fst_blksize Blksize_t + Fst_flags Fflags_t + Fst_gen X__uint64_t + Fst_spare [10]X__uint64_t +} /* stat.h:160:1 */ + +var _ int8 /* gen.c:2:13: */ diff --git a/vendor/modernc.org/libc/sys/types/capi_freebsd_amd64.go b/vendor/modernc.org/libc/sys/types/capi_freebsd_amd64.go new file mode 100644 index 000000000..38dd284ad --- /dev/null +++ b/vendor/modernc.org/libc/sys/types/capi_freebsd_amd64.go @@ -0,0 +1,5 @@ +// Code generated by 'ccgo sys/types/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/types/types_freebsd_amd64.go -pkgname types', DO NOT EDIT. + +package types + +var CAPI = map[string]struct{}{} diff --git a/vendor/modernc.org/libc/sys/types/types_freebsd_amd64.go b/vendor/modernc.org/libc/sys/types/types_freebsd_amd64.go new file mode 100644 index 000000000..348cc4e69 --- /dev/null +++ b/vendor/modernc.org/libc/sys/types/types_freebsd_amd64.go @@ -0,0 +1,1448 @@ +// Code generated by 'ccgo sys/types/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/types/types_freebsd_amd64.go -pkgname types', DO NOT EDIT. + +package types + +import ( + "math" + "reflect" + "sync/atomic" + "unsafe" +) + +var _ = math.Pi +var _ reflect.Kind +var _ atomic.Value +var _ unsafe.Pointer + +const ( + BIG_ENDIAN = 4321 + BYTE_ORDER = 1234 + FD_SETSIZE = 1024 + LITTLE_ENDIAN = 1234 + PDP_ENDIAN = 3412 + X_ACCMODE_T_DECLARED = 0 + X_BIG_ENDIAN = 4321 + X_BLKCNT_T_DECLARED = 0 + X_BLKSIZE_T_DECLARED = 0 + X_BYTE_ORDER = 1234 + X_CAP_IOCTL_T_DECLARED = 0 + X_CAP_RIGHTS_T_DECLARED = 0 + X_CLOCKID_T_DECLARED = 0 + X_CLOCK_T_DECLARED = 0 + X_DEV_T_DECLARED = 0 + X_FFLAGS_T_DECLARED = 0 + X_FILE_OFFSET_BITS = 64 + X_FSBLKCNT_T_DECLARED = 0 + X_FTRUNCATE_DECLARED = 0 + X_GID_T_DECLARED = 0 + X_ID_T_DECLARED = 0 + X_INO_T_DECLARED = 0 + X_INT16_T_DECLARED = 0 + X_INT32_T_DECLARED = 0 + X_INT64_T_DECLARED = 0 + X_INT8_T_DECLARED = 0 + X_INTMAX_T_DECLARED = 0 + X_INTPTR_T_DECLARED = 0 + X_IN_ADDR_T_DECLARED = 0 + X_IN_PORT_T_DECLARED = 0 + X_KEY_T_DECLARED = 0 + X_LITTLE_ENDIAN = 1234 + X_LP64 = 1 + X_LSEEK_DECLARED = 0 + X_LWPID_T_DECLARED = 0 + X_MACHINE_ENDIAN_H_ = 0 + X_MACHINE__LIMITS_H_ = 0 + X_MACHINE__TYPES_H_ = 0 + X_MMAP_DECLARED = 0 + X_MODE_T_DECLARED = 0 + X_MQD_T_DECLARED = 0 + X_NLINK_T_DECLARED = 0 + X_Nonnull = 0 + X_Null_unspecified = 0 + X_Nullable = 0 + X_OFF64_T_DECLARED = 0 + X_OFF_T_DECLARED = 0 + X_PDP_ENDIAN = 3412 + X_PID_T_DECLARED = 0 + X_PTHREAD_T_DECLARED = 0 + X_QUAD_HIGHWORD = 1 + X_QUAD_LOWWORD = 0 + X_RLIM_T_DECLARED = 0 + X_SELECT_DECLARED = 0 + X_SIGSET_T_DECLARED = 0 + X_SIG_MAXSIG = 128 + X_SIG_WORDS = 4 + X_SIZE_T_DECLARED = 0 + X_SSIZE_T_DECLARED = 0 + X_SUSECONDS_T_DECLARED = 0 + X_SYS_CDEFS_H_ = 0 + X_SYS_SELECT_H_ = 0 + X_SYS_TIMESPEC_H_ = 0 + X_SYS_TYPES_H_ = 0 + X_SYS__PTHREADTYPES_H_ = 0 + X_SYS__SIGSET_H_ = 0 + X_SYS__STDINT_H_ = 0 + X_SYS__TIMESPEC_H_ = 0 + X_SYS__TIMEVAL_H_ = 0 + X_SYS__TYPES_H_ = 0 + X_TIMER_T_DECLARED = 0 + X_TIME_T_DECLARED = 0 + X_TRUNCATE_DECLARED = 0 + X_UID_T_DECLARED = 0 + X_UINT16_T_DECLARED = 0 + X_UINT32_T_DECLARED = 0 + X_UINT64_T_DECLARED = 0 + X_UINT8_T_DECLARED = 0 + X_UINTMAX_T_DECLARED = 0 + X_UINTPTR_T_DECLARED = 0 + X_USECONDS_T_DECLARED = 0 + Unix = 1 +) + +type Ptrdiff_t = int64 /* <builtin>:3:26 */ + +type Size_t = uint64 /* <builtin>:9:23 */ + +type Wchar_t = int32 /* <builtin>:15:24 */ + +type X__int128_t = struct { + Flo int64 + Fhi int64 +} /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128 +type X__uint128_t = struct { + Flo uint64 + Fhi uint64 +} /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128 + +type X__builtin_va_list = uintptr /* <builtin>:46:14 */ +type X__float128 = float64 /* <builtin>:47:21 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1991, 1993, 1994 +// The Regents of the University of California. All rights reserved. +// (c) UNIX System Laboratories, Inc. +// All or some portions of this file are derived from material licensed +// to the University of California by American Telephone and Telegraph +// Co. or Unix System Laboratories, Inc. and are reproduced herein with +// the permission of UNIX System Laboratories, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)types.h 8.6 (Berkeley) 2/19/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// Testing against Clang-specific extensions. + +// This code has been put in place to help reduce the addition of +// compiler specific defines in FreeBSD code. It helps to aid in +// having a compiler-agnostic source tree. + +// Compiler memory barriers, specific to gcc and clang. + +// XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced + +// Macro to test if we're using a specific version of gcc or later. + +// The __CONCAT macro is used to concatenate parts of symbol names, e.g. +// with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. +// The __CONCAT macro is a bit tricky to use if it must work in non-ANSI +// mode -- there must be no spaces between its arguments, and for nested +// __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also +// concatenate double-quoted strings produced by the __STRING macro, but +// this only works with ANSI C. +// +// __XSTRING is like __STRING, but it expands any macros in its argument +// first. It is only available with ANSI C. + +// Compiler-dependent macros to help declare dead (non-returning) and +// pure (no side effects) functions, and unused variables. They are +// null except for versions of gcc that are known to support the features +// properly (old versions of gcc-2 supported the dead and pure features +// in a different (wrong) way). If we do not provide an implementation +// for a given compiler, let the compile fail if it is told to use +// a feature that we cannot live without. + +// Keywords added in C11. + +// Emulation of C11 _Generic(). Unlike the previously defined C11 +// keywords, it is not possible to implement this using exactly the same +// syntax. Therefore implement something similar under the name +// __generic(). Unlike _Generic(), this macro can only distinguish +// between a single type, so it requires nested invocations to +// distinguish multiple cases. + +// C99 Static array indices in function parameter declarations. Syntax such as: +// void bar(int myArray[static 10]); +// is allowed in C99 but not in C++. Define __min_size appropriately so +// headers using it can be compiled in either language. Use like this: +// void bar(int myArray[__min_size(10)]); + +// XXX: should use `#if __STDC_VERSION__ < 199901'. + +// C++11 exposes a load of C99 stuff + +// GCC 2.95 provides `__restrict' as an extension to C90 to support the +// C99-specific `restrict' type qualifier. We happen to use `__restrict' as +// a way to define the `restrict' type qualifier without disturbing older +// software that is unaware of C99 keywords. + +// GNU C version 2.96 adds explicit branch prediction so that +// the CPU back-end can hint the processor and also so that +// code blocks can be reordered such that the predicted path +// sees a more linear flow, thus improving cache behavior, etc. +// +// The following two macros provide us with a way to utilize this +// compiler feature. Use __predict_true() if you expect the expression +// to evaluate to true, and __predict_false() if you expect the +// expression to evaluate to false. +// +// A few notes about usage: +// +// * Generally, __predict_false() error condition checks (unless +// you have some _strong_ reason to do otherwise, in which case +// document it), and/or __predict_true() `no-error' condition +// checks, assuming you want to optimize for the no-error case. +// +// * Other than that, if you don't know the likelihood of a test +// succeeding from empirical or other `hard' evidence, don't +// make predictions. +// +// * These are meant to be used in places that are run `a lot'. +// It is wasteful to make predictions in code that is run +// seldomly (e.g. at subsystem initialization time) as the +// basic block reordering that this affects can often generate +// larger code. + +// We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h> +// require it. + +// Given the pointer x to the member m of the struct s, return +// a pointer to the containing structure. When using GCC, we first +// assign pointer x to a local variable, to check that its type is +// compatible with member m. + +// Compiler-dependent macros to declare that functions take printf-like +// or scanf-like arguments. They are null except for versions of gcc +// that are known to support the features properly (old versions of gcc-2 +// didn't permit keeping the keywords out of the application namespace). + +// Compiler-dependent macros that rely on FreeBSD-specific extensions. + +// Embed the rcs id of a source file in the resulting library. Note that in +// more recent ELF binutils, we use .ident allowing the ID to be stripped. +// Usage: +// __FBSDID("$FreeBSD$"); + +// - +// The following definitions are an extension of the behavior originally +// implemented in <sys/_posix.h>, but with a different level of granularity. +// POSIX.1 requires that the macros we test be defined before any standard +// header file is included. +// +// Here's a quick run-down of the versions: +// defined(_POSIX_SOURCE) 1003.1-1988 +// _POSIX_C_SOURCE == 1 1003.1-1990 +// _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option +// _POSIX_C_SOURCE == 199309 1003.1b-1993 +// _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, +// and the omnibus ISO/IEC 9945-1: 1996 +// _POSIX_C_SOURCE == 200112 1003.1-2001 +// _POSIX_C_SOURCE == 200809 1003.1-2008 +// +// In addition, the X/Open Portability Guide, which is now the Single UNIX +// Specification, defines a feature-test macro which indicates the version of +// that specification, and which subsumes _POSIX_C_SOURCE. +// +// Our macros begin with two underscores to avoid namespace screwage. + +// Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. + +// Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. + +// Deal with various X/Open Portability Guides and Single UNIX Spec. + +// Deal with all versions of POSIX. The ordering relative to the tests above is +// important. +// - +// Deal with _ANSI_SOURCE: +// If it is defined, and no other compilation environment is explicitly +// requested, then define our internal feature-test macros to zero. This +// makes no difference to the preprocessor (undefined symbols in preprocessing +// expressions are defined to have value zero), but makes it more convenient for +// a test program to print out the values. +// +// If a program mistakenly defines _ANSI_SOURCE and some other macro such as +// _POSIX_C_SOURCE, we will assume that it wants the broader compilation +// environment (and in fact we will never get here). + +// User override __EXT1_VISIBLE + +// Old versions of GCC use non-standard ARM arch symbols; acle-compat.h +// translates them to __ARM_ARCH and the modern feature symbols defined by ARM. + +// Nullability qualifiers: currently only supported by Clang. + +// Type Safety Checking +// +// Clang provides additional attributes to enable checking type safety +// properties that cannot be enforced by the C type system. + +// Lock annotations. +// +// Clang provides support for doing basic thread-safety tests at +// compile-time, by marking which locks will/should be held when +// entering/leaving a functions. +// +// Furthermore, it is also possible to annotate variables and structure +// members to enforce that they are only accessed when certain locks are +// held. + +// Structure implements a lock. + +// Function acquires an exclusive or shared lock. + +// Function attempts to acquire an exclusive or shared lock. + +// Function releases a lock. + +// Function asserts that an exclusive or shared lock is held. + +// Function requires that an exclusive or shared lock is or is not held. + +// Function should not be analyzed. + +// Function or variable should not be sanitized, i.e. by AddressSanitizer. +// GCC has the nosanitize attribute, but as a function attribute only, and +// warns on use as a variable attribute. + +// Guard variables and structure members by lock. + +// Machine type dependent parameters. +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1987, 1991 Regents of the University of California. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)endian.h 7.8 (Berkeley) 4/3/91 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-4-Clause +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// Copyright (c) 1990, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. All advertising materials mentioning features or use of this software +// must display the following acknowledgement: +// This product includes software developed by the University of +// California, Berkeley and its contributors. +// 4. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 +// From: @(#)types.h 8.3 (Berkeley) 1/5/94 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1988, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)limits.h 8.3 (Berkeley) 1/4/94 +// $FreeBSD$ + +// According to ANSI (section 2.2.4.2), the values below must be usable by +// #if preprocessing directives. Additionally, the expression must have the +// same type as would an expression that is an object of the corresponding +// type converted according to the integral promotions. The subtraction for +// INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an +// unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). + +// max value for an unsigned long long + +// Quads and longs are the same on the amd64. Ensure they stay in sync. + +// Minimum signal stack size. + +// Basic types upon which most other types are built. +type X__int8_t = int8 /* _types.h:55:22 */ +type X__uint8_t = uint8 /* _types.h:56:24 */ +type X__int16_t = int16 /* _types.h:57:17 */ +type X__uint16_t = uint16 /* _types.h:58:25 */ +type X__int32_t = int32 /* _types.h:59:15 */ +type X__uint32_t = uint32 /* _types.h:60:23 */ +type X__int64_t = int64 /* _types.h:62:16 */ +type X__uint64_t = uint64 /* _types.h:63:24 */ + +// Standard type definitions. +type X__clock_t = X__int32_t /* _types.h:75:19 */ // clock()... +type X__critical_t = X__int64_t /* _types.h:76:19 */ +type X__double_t = float64 /* _types.h:78:17 */ +type X__float_t = float32 /* _types.h:79:16 */ +type X__intfptr_t = X__int64_t /* _types.h:81:19 */ +type X__intptr_t = X__int64_t /* _types.h:82:19 */ +type X__intmax_t = X__int64_t /* _types.h:93:19 */ +type X__int_fast8_t = X__int32_t /* _types.h:94:19 */ +type X__int_fast16_t = X__int32_t /* _types.h:95:19 */ +type X__int_fast32_t = X__int32_t /* _types.h:96:19 */ +type X__int_fast64_t = X__int64_t /* _types.h:97:19 */ +type X__int_least8_t = X__int8_t /* _types.h:98:18 */ +type X__int_least16_t = X__int16_t /* _types.h:99:19 */ +type X__int_least32_t = X__int32_t /* _types.h:100:19 */ +type X__int_least64_t = X__int64_t /* _types.h:101:19 */ +type X__ptrdiff_t = X__int64_t /* _types.h:103:19 */ // ptr1 - ptr2 +type X__register_t = X__int64_t /* _types.h:104:19 */ +type X__segsz_t = X__int64_t /* _types.h:105:19 */ // segment size (in pages) +type X__size_t = X__uint64_t /* _types.h:106:20 */ // sizeof() +type X__ssize_t = X__int64_t /* _types.h:107:19 */ // byte count or error +type X__time_t = X__int64_t /* _types.h:108:19 */ // time()... +type X__uintfptr_t = X__uint64_t /* _types.h:109:20 */ +type X__uintptr_t = X__uint64_t /* _types.h:110:20 */ +type X__uintmax_t = X__uint64_t /* _types.h:121:20 */ +type X__uint_fast8_t = X__uint32_t /* _types.h:122:20 */ +type X__uint_fast16_t = X__uint32_t /* _types.h:123:20 */ +type X__uint_fast32_t = X__uint32_t /* _types.h:124:20 */ +type X__uint_fast64_t = X__uint64_t /* _types.h:125:20 */ +type X__uint_least8_t = X__uint8_t /* _types.h:126:19 */ +type X__uint_least16_t = X__uint16_t /* _types.h:127:20 */ +type X__uint_least32_t = X__uint32_t /* _types.h:128:20 */ +type X__uint_least64_t = X__uint64_t /* _types.h:129:20 */ +type X__u_register_t = X__uint64_t /* _types.h:131:20 */ +type X__vm_offset_t = X__uint64_t /* _types.h:132:20 */ +type X__vm_paddr_t = X__uint64_t /* _types.h:133:20 */ +type X__vm_size_t = X__uint64_t /* _types.h:134:20 */ +type X___wchar_t = int32 /* _types.h:141:14 */ + +// Standard type definitions. +type X__blksize_t = X__int32_t /* _types.h:40:19 */ // file block size +type X__blkcnt_t = X__int64_t /* _types.h:41:19 */ // file block count +type X__clockid_t = X__int32_t /* _types.h:42:19 */ // clock_gettime()... +type X__fflags_t = X__uint32_t /* _types.h:43:20 */ // file flags +type X__fsblkcnt_t = X__uint64_t /* _types.h:44:20 */ +type X__fsfilcnt_t = X__uint64_t /* _types.h:45:20 */ +type X__gid_t = X__uint32_t /* _types.h:46:20 */ +type X__id_t = X__int64_t /* _types.h:47:19 */ // can hold a gid_t, pid_t, or uid_t +type X__ino_t = X__uint64_t /* _types.h:48:20 */ // inode number +type X__key_t = int64 /* _types.h:49:15 */ // IPC key (for Sys V IPC) +type X__lwpid_t = X__int32_t /* _types.h:50:19 */ // Thread ID (a.k.a. LWP) +type X__mode_t = X__uint16_t /* _types.h:51:20 */ // permissions +type X__accmode_t = int32 /* _types.h:52:14 */ // access permissions +type X__nl_item = int32 /* _types.h:53:14 */ +type X__nlink_t = X__uint64_t /* _types.h:54:20 */ // link count +type X__off_t = X__int64_t /* _types.h:55:19 */ // file offset +type X__off64_t = X__int64_t /* _types.h:56:19 */ // file offset (alias) +type X__pid_t = X__int32_t /* _types.h:57:19 */ // process [group] +type X__rlim_t = X__int64_t /* _types.h:58:19 */ // resource limit - intentionally +// signed, because of legacy code +// that uses -1 for RLIM_INFINITY +type X__sa_family_t = X__uint8_t /* _types.h:61:19 */ +type X__socklen_t = X__uint32_t /* _types.h:62:20 */ +type X__suseconds_t = int64 /* _types.h:63:15 */ // microseconds (signed) +type X__timer_t = uintptr /* _types.h:64:24 */ // timer_gettime()... +type X__mqd_t = uintptr /* _types.h:65:21 */ // mq_open()... +type X__uid_t = X__uint32_t /* _types.h:66:20 */ +type X__useconds_t = uint32 /* _types.h:67:22 */ // microseconds (unsigned) +type X__cpuwhich_t = int32 /* _types.h:68:14 */ // which parameter for cpuset. +type X__cpulevel_t = int32 /* _types.h:69:14 */ // level parameter for cpuset. +type X__cpusetid_t = int32 /* _types.h:70:14 */ // cpuset identifier. +type X__daddr_t = X__int64_t /* _types.h:71:19 */ // bwrite(3), FIOBMAP2, etc + +// Unusual type definitions. +// rune_t is declared to be an ``int'' instead of the more natural +// ``unsigned long'' or ``long''. Two things are happening here. It is not +// unsigned so that EOF (-1) can be naturally assigned to it and used. Also, +// it looks like 10646 will be a 31 bit standard. This means that if your +// ints cannot hold 32 bits, you will be in trouble. The reason an int was +// chosen over a long is that the is*() and to*() routines take ints (says +// ANSI C), but they use __ct_rune_t instead of int. +// +// NOTE: rune_t is not covered by ANSI nor other standards, and should not +// be instantiated outside of lib/libc/locale. Use wchar_t. wint_t and +// rune_t must be the same type. Also, wint_t should be able to hold all +// members of the largest character set plus one extra value (WEOF), and +// must be at least 16 bits. +type X__ct_rune_t = int32 /* _types.h:91:14 */ // arg type for ctype funcs +type X__rune_t = X__ct_rune_t /* _types.h:92:21 */ // rune_t (see above) +type X__wint_t = X__ct_rune_t /* _types.h:93:21 */ // wint_t (see above) + +// Clang already provides these types as built-ins, but only in C++ mode. +type X__char16_t = X__uint_least16_t /* _types.h:97:26 */ +type X__char32_t = X__uint_least32_t /* _types.h:98:26 */ +// In C++11, char16_t and char32_t are built-in types. + +type X__max_align_t = struct { + F__max_align1 int64 + F__max_align2 float64 +} /* _types.h:111:3 */ + +type X__dev_t = X__uint64_t /* _types.h:113:20 */ // device number + +type X__fixpt_t = X__uint32_t /* _types.h:115:20 */ // fixed point number + +// mbstate_t is an opaque object to keep conversion state during multibyte +// stream conversions. +type X__mbstate_t = struct { + _ [0]uint64 + F__mbstate8 [128]int8 +} /* _types.h:124:3 */ + +type X__rman_res_t = X__uintmax_t /* _types.h:126:25 */ + +// Types for varargs. These are all provided by builtin types these +// days, so centralize their definition. +type X__va_list = X__builtin_va_list /* _types.h:133:27 */ // internally known to gcc +type X__gnuc_va_list = X__va_list /* _types.h:140:20 */ +type Pthread_once = struct { + Fstate int32 + _ [4]byte + Fmutex Pthread_mutex_t +} /* _pthreadtypes.h:52:1 */ + +// Primitive system data type definitions required by P1003.1c. +// +// Note that P1003.1c specifies that there are no defined comparison +// or assignment operators for the types pthread_attr_t, pthread_cond_t, +// pthread_condattr_t, pthread_mutex_t, pthread_mutexattr_t. +type Pthread_t = uintptr /* _pthreadtypes.h:67:26 */ +type Pthread_attr_t = uintptr /* _pthreadtypes.h:70:30 */ +type Pthread_mutex_t = uintptr /* _pthreadtypes.h:71:31 */ +type Pthread_mutexattr_t = uintptr /* _pthreadtypes.h:72:35 */ +type Pthread_cond_t = uintptr /* _pthreadtypes.h:73:30 */ +type Pthread_condattr_t = uintptr /* _pthreadtypes.h:74:34 */ +type Pthread_key_t = int32 /* _pthreadtypes.h:75:20 */ +type Pthread_once_t = Pthread_once /* _pthreadtypes.h:76:30 */ +type Pthread_rwlock_t = uintptr /* _pthreadtypes.h:77:32 */ +type Pthread_rwlockattr_t = uintptr /* _pthreadtypes.h:78:35 */ +type Pthread_barrier_t = uintptr /* _pthreadtypes.h:79:33 */ +type Pthread_barrierattr_t = uintptr /* _pthreadtypes.h:80:36 */ +type Pthread_spinlock_t = uintptr /* _pthreadtypes.h:81:33 */ + +// Additional type definitions: +// +// Note that P1003.1c reserves the prefixes pthread_ and PTHREAD_ for +// use in header symbols. +type Pthread_addr_t = uintptr /* _pthreadtypes.h:89:14 */ +type Pthread_startroutine_t = uintptr /* _pthreadtypes.h:90:14 */ + +type U_char = uint8 /* types.h:52:23 */ +type U_short = uint16 /* types.h:53:24 */ +type U_int = uint32 /* types.h:54:22 */ +type U_long = uint64 /* types.h:55:23 */ +type Ushort = uint16 /* types.h:57:24 */ // Sys V compatibility +type Uint = uint32 /* types.h:58:22 */ // Sys V compatibility + +// XXX POSIX sized integrals that should appear only in <sys/stdint.h>. +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2011 David E. O'Brien <obrien@FreeBSD.org> +// Copyright (c) 2001 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +type Int8_t = X__int8_t /* _stdint.h:36:19 */ + +type Int16_t = X__int16_t /* _stdint.h:41:20 */ + +type Int32_t = X__int32_t /* _stdint.h:46:20 */ + +type Int64_t = X__int64_t /* _stdint.h:51:20 */ + +type Uint8_t = X__uint8_t /* _stdint.h:56:20 */ + +type Uint16_t = X__uint16_t /* _stdint.h:61:21 */ + +type Uint32_t = X__uint32_t /* _stdint.h:66:21 */ + +type Uint64_t = X__uint64_t /* _stdint.h:71:21 */ + +type Intptr_t = X__intptr_t /* _stdint.h:76:21 */ +type Uintptr_t = X__uintptr_t /* _stdint.h:80:22 */ +type Intmax_t = X__intmax_t /* _stdint.h:84:21 */ +type Uintmax_t = X__uintmax_t /* _stdint.h:88:22 */ + +type U_int8_t = X__uint8_t /* types.h:67:19 */ // unsigned integrals (deprecated) +type U_int16_t = X__uint16_t /* types.h:68:20 */ +type U_int32_t = X__uint32_t /* types.h:69:20 */ +type U_int64_t = X__uint64_t /* types.h:70:20 */ + +type U_quad_t = X__uint64_t /* types.h:72:20 */ // quads (deprecated) +type Quad_t = X__int64_t /* types.h:73:19 */ +type Qaddr_t = uintptr /* types.h:74:16 */ + +type Caddr_t = uintptr /* types.h:76:14 */ // core address +type C_caddr_t = uintptr /* types.h:77:20 */ // core address, pointer to const + +type Blksize_t = X__blksize_t /* types.h:80:21 */ + +type Cpuwhich_t = X__cpuwhich_t /* types.h:84:22 */ +type Cpulevel_t = X__cpulevel_t /* types.h:85:22 */ +type Cpusetid_t = X__cpusetid_t /* types.h:86:22 */ + +type Blkcnt_t = X__blkcnt_t /* types.h:89:20 */ + +type Clock_t = X__clock_t /* types.h:94:19 */ + +type Clockid_t = X__clockid_t /* types.h:99:21 */ + +type Critical_t = X__critical_t /* types.h:103:22 */ // Critical section value +type Daddr_t = X__daddr_t /* types.h:104:19 */ // disk address + +type Dev_t = X__dev_t /* types.h:107:18 */ // device number or struct cdev + +type Fflags_t = X__fflags_t /* types.h:112:20 */ // file flags + +type Fixpt_t = X__fixpt_t /* types.h:116:19 */ // fixed point number + +type Fsblkcnt_t = X__fsblkcnt_t /* types.h:119:22 */ +type Fsfilcnt_t = X__fsfilcnt_t /* types.h:120:22 */ + +type Gid_t = X__gid_t /* types.h:125:18 */ // group id + +type In_addr_t = X__uint32_t /* types.h:130:20 */ // base type for internet address + +type In_port_t = X__uint16_t /* types.h:135:20 */ + +type Id_t = X__id_t /* types.h:140:17 */ // can hold a uid_t or pid_t + +type Ino_t = X__ino_t /* types.h:145:18 */ // inode number + +type Key_t = X__key_t /* types.h:150:18 */ // IPC key (for Sys V IPC) + +type Lwpid_t = X__lwpid_t /* types.h:155:19 */ // Thread ID (a.k.a. LWP) + +type Mode_t = X__mode_t /* types.h:160:18 */ // permissions + +type Accmode_t = X__accmode_t /* types.h:165:21 */ // access permissions + +type Nlink_t = X__nlink_t /* types.h:170:19 */ // link count + +type Off_t = X__off_t /* types.h:175:18 */ // file offset + +type Off64_t = X__off64_t /* types.h:180:19 */ // file offset (alias) + +type Pid_t = X__pid_t /* types.h:185:18 */ // process id + +type Register_t = X__register_t /* types.h:189:22 */ + +type Rlim_t = X__rlim_t /* types.h:192:18 */ // resource limit + +type Sbintime_t = X__int64_t /* types.h:196:19 */ + +type Segsz_t = X__segsz_t /* types.h:198:19 */ + +type Ssize_t = X__ssize_t /* types.h:206:19 */ + +type Suseconds_t = X__suseconds_t /* types.h:211:23 */ // microseconds (signed) + +type Time_t = X__time_t /* types.h:216:18 */ + +type Timer_t = X__timer_t /* types.h:221:19 */ + +type Mqd_t = X__mqd_t /* types.h:226:17 */ + +type U_register_t = X__u_register_t /* types.h:230:24 */ + +type Uid_t = X__uid_t /* types.h:233:18 */ // user id + +type Useconds_t = X__useconds_t /* types.h:238:22 */ // microseconds (unsigned) + +type Cap_ioctl_t = uint64 /* types.h:244:23 */ + +// Types suitable for exporting physical addresses, virtual addresses +// (pointers), and memory object sizes from the kernel independent of native +// word size. These should be used in place of vm_paddr_t, (u)intptr_t, and +// size_t in structs which contain such types that are shared with userspace. +type Kpaddr_t = X__uint64_t /* types.h:260:20 */ +type Kvaddr_t = X__uint64_t /* types.h:261:20 */ +type Ksize_t = X__uint64_t /* types.h:262:20 */ +type Kssize_t = X__int64_t /* types.h:263:19 */ + +type Vm_offset_t = X__vm_offset_t /* types.h:265:23 */ +type Vm_ooffset_t = X__uint64_t /* types.h:266:20 */ +type Vm_paddr_t = X__vm_paddr_t /* types.h:267:22 */ +type Vm_pindex_t = X__uint64_t /* types.h:268:20 */ +type Vm_size_t = X__vm_size_t /* types.h:269:21 */ + +type Rman_res_t = X__rman_res_t /* types.h:271:25 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1992, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1989, 1991, 1993 +// The Regents of the University of California. All rights reserved. +// (c) UNIX System Laboratories, Inc. +// All or some portions of this file are derived from material licensed +// to the University of California by American Telephone and Telegraph +// Co. or Unix System Laboratories, Inc. and are reproduced herein with +// the permission of UNIX System Laboratories, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)signal.h 8.4 (Berkeley) 5/4/95 +// $FreeBSD$ + +// sigset_t macros. + +type X__sigset = struct{ F__bits [4]X__uint32_t } /* _sigset.h:53:9 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1992, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1989, 1991, 1993 +// The Regents of the University of California. All rights reserved. +// (c) UNIX System Laboratories, Inc. +// All or some portions of this file are derived from material licensed +// to the University of California by American Telephone and Telegraph +// Co. or Unix System Laboratories, Inc. and are reproduced herein with +// the permission of UNIX System Laboratories, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)signal.h 8.4 (Berkeley) 5/4/95 +// $FreeBSD$ + +// sigset_t macros. + +type X__sigset_t = X__sigset /* _sigset.h:55:3 */ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// Structure returned by gettimeofday(2) system call, and used in other calls. +type Timeval = struct { + Ftv_sec Time_t + Ftv_usec Suseconds_t +} /* _timeval.h:49:1 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)time.h 8.5 (Berkeley) 5/4/95 +// from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)time.h 8.5 (Berkeley) 5/4/95 +// from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +type Timespec = struct { + Ftv_sec Time_t + Ftv_nsec int64 +} /* _timespec.h:46:1 */ + +// Structure defined by POSIX.1b to be like a itimerval, but with +// timespecs. Used in the timer_*() system calls. +type Itimerspec = struct { + Fit_interval struct { + Ftv_sec Time_t + Ftv_nsec int64 + } + Fit_value struct { + Ftv_sec Time_t + Ftv_nsec int64 + } +} /* timespec.h:60:1 */ + +type X__fd_mask = uint64 /* select.h:44:23 */ +type Fd_mask = X__fd_mask /* select.h:46:19 */ + +type Sigset_t = X__sigset_t /* select.h:51:20 */ + +// Select uses bit masks of file descriptors in longs. These macros +// manipulate such bit fields (the filesystem macros use chars). +// FD_SETSIZE may be defined by the user, but the default here should +// be enough for most uses. + +type Fd_set1 = struct{ F__fds_bits [16]X__fd_mask } /* select.h:73:9 */ + +// Select uses bit masks of file descriptors in longs. These macros +// manipulate such bit fields (the filesystem macros use chars). +// FD_SETSIZE may be defined by the user, but the default here should +// be enough for most uses. + +type Fd_set = Fd_set1 /* select.h:75:3 */ + +var _ int8 /* gen.c:2:13: */ diff --git a/vendor/modernc.org/libc/termios/capi_freebsd_amd64.go b/vendor/modernc.org/libc/termios/capi_freebsd_amd64.go new file mode 100644 index 000000000..b8f8280d2 --- /dev/null +++ b/vendor/modernc.org/libc/termios/capi_freebsd_amd64.go @@ -0,0 +1,5 @@ +// Code generated by 'ccgo termios/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 termios/termios_freebsd_amd64.go -pkgname termios', DO NOT EDIT. + +package termios + +var CAPI = map[string]struct{}{} diff --git a/vendor/modernc.org/libc/termios/termios_freebsd_amd64.go b/vendor/modernc.org/libc/termios/termios_freebsd_amd64.go new file mode 100644 index 000000000..4b67b9ebc --- /dev/null +++ b/vendor/modernc.org/libc/termios/termios_freebsd_amd64.go @@ -0,0 +1,999 @@ +// Code generated by 'ccgo termios/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 termios/termios_freebsd_amd64.go -pkgname termios', DO NOT EDIT. + +package termios + +import ( + "math" + "reflect" + "sync/atomic" + "unsafe" +) + +var _ = math.Pi +var _ reflect.Kind +var _ atomic.Value +var _ unsafe.Pointer + +const ( + ALTWERASE = 0x00000200 + B0 = 0 + B110 = 110 + B115200 = 115200 + B1200 = 1200 + B134 = 134 + B14400 = 14400 + B150 = 150 + B1800 = 1800 + B19200 = 19200 + B200 = 200 + B230400 = 230400 + B2400 = 2400 + B28800 = 28800 + B300 = 300 + B38400 = 38400 + B460800 = 460800 + B4800 = 4800 + B50 = 50 + B57600 = 57600 + B600 = 600 + B7200 = 7200 + B75 = 75 + B76800 = 76800 + B921600 = 921600 + B9600 = 9600 + BRKINT = 0x00000002 + CBRK = 255 + CCAR_OFLOW = 0x00100000 + CCTS_OFLOW = 0x00010000 + CDISCARD = 15 + CDSR_OFLOW = 0x00080000 + CDSUSP = 25 + CDTR_IFLOW = 0x00040000 + CEOF = 4 + CEOL = 0xff + CEOT = 4 + CERASE = 127 + CERASE2 = 8 + CFLUSH = 15 + CIGNORE = 0x00000001 + CINTR = 3 + CKILL = 21 + CLNEXT = 22 + CLOCAL = 0x00008000 + CMIN = 1 + CNO_RTSDTR = 0x00200000 + CQUIT = 28 + CREAD = 0x00000800 + CREPRINT = 18 + CRPRNT = 18 + CRTSCTS = 196608 + CRTS_IFLOW = 0x00020000 + CS5 = 0x00000000 + CS6 = 0x00000100 + CS7 = 0x00000200 + CS8 = 0x00000300 + CSIZE = 0x00000300 + CSTART = 17 + CSTATUS = 20 + CSTOP = 19 + CSTOPB = 0x00000400 + CSUSP = 26 + CTIME = 0 + CWERASE = 23 + ECHO = 0x00000008 + ECHOCTL = 0x00000040 + ECHOE = 0x00000002 + ECHOK = 0x00000004 + ECHOKE = 0x00000001 + ECHONL = 0x00000010 + ECHOPRT = 0x00000020 + EXTA = 19200 + EXTB = 38400 + EXTPROC = 0x00000800 + FLUSHO = 0x00800000 + H4DISC = 7 + HUPCL = 0x00004000 + ICANON = 0x00000100 + ICRNL = 0x00000100 + IEXTEN = 0x00000400 + IGNBRK = 0x00000001 + IGNCR = 0x00000080 + IGNPAR = 0x00000004 + IMAXBEL = 0x00002000 + INLCR = 0x00000040 + INPCK = 0x00000010 + IOCPARM_MASK = 8191 + IOCPARM_MAX = 8192 + IOCPARM_SHIFT = 13 + IOC_DIRMASK = 3758096384 + IOC_IN = 0x80000000 + IOC_INOUT = 3221225472 + IOC_OUT = 0x40000000 + IOC_VOID = 0x20000000 + ISIG = 0x00000080 + ISTRIP = 0x00000020 + IXANY = 0x00000800 + IXOFF = 0x00000400 + IXON = 0x00000200 + MDMBUF = 1048576 + NCCS = 20 + NETGRAPHDISC = 6 + NOFLSH = 0x80000000 + NOKERNINFO = 0x02000000 + OCRNL = 0x00000010 + ONLCR = 0x00000002 + ONLRET = 0x00000040 + ONOCR = 0x00000020 + ONOEOT = 0x00000008 + OPOST = 0x00000001 + OXTABS = 4 + PARENB = 0x00001000 + PARMRK = 0x00000008 + PARODD = 0x00002000 + PENDIN = 0x20000000 + PPPDISC = 5 + SLIPDISC = 4 + TAB0 = 0x00000000 + TAB3 = 0x00000004 + TABDLY = 0x00000004 + TCIFLUSH = 1 + TCIOFF = 3 + TCIOFLUSH = 3 + TCION = 4 + TCOFLUSH = 2 + TCOOFF = 1 + TCOON = 2 + TCSADRAIN = 1 + TCSAFLUSH = 2 + TCSANOW = 0 + TCSASOFT = 0x10 + TIOCM_CAR = 64 + TIOCM_CD = 64 + TIOCM_CTS = 0040 + TIOCM_DCD = 0100 + TIOCM_DSR = 0400 + TIOCM_DTR = 0002 + TIOCM_LE = 0001 + TIOCM_RI = 0200 + TIOCM_RNG = 128 + TIOCM_RTS = 0004 + TIOCM_SR = 0020 + TIOCM_ST = 0010 + TIOCPKT_DATA = 0x00 + TIOCPKT_DOSTOP = 0x20 + TIOCPKT_FLUSHREAD = 0x01 + TIOCPKT_FLUSHWRITE = 0x02 + TIOCPKT_IOCTL = 0x40 + TIOCPKT_NOSTOP = 0x10 + TIOCPKT_START = 0x08 + TIOCPKT_STOP = 0x04 + TOSTOP = 0x00400000 + TTYDEF_CFLAG = 19200 + TTYDEF_IFLAG = 11010 + TTYDEF_LFLAG = 1483 + TTYDEF_LFLAG_ECHO = 1483 + TTYDEF_LFLAG_NOECHO = 1408 + TTYDEF_OFLAG = 3 + TTYDEF_SPEED = 9600 + TTYDISC = 0 + VDISCARD = 15 + VDSUSP = 11 + VEOF = 0 + VEOL = 1 + VEOL2 = 2 + VERASE = 3 + VERASE2 = 7 + VINTR = 8 + VKILL = 5 + VLNEXT = 14 + VMIN = 16 + VQUIT = 9 + VREPRINT = 6 + VSTART = 12 + VSTATUS = 18 + VSTOP = 13 + VSUSP = 10 + VTIME = 17 + VWERASE = 4 + X_FILE_OFFSET_BITS = 64 + X_LP64 = 1 + X_MACHINE__LIMITS_H_ = 0 + X_MACHINE__TYPES_H_ = 0 + X_Nonnull = 0 + X_Null_unspecified = 0 + X_Nullable = 0 + X_PID_T_DECLARED = 0 + X_POSIX_VDISABLE = 0xff + X_SYS_CDEFS_H_ = 0 + X_SYS_IOCCOM_H_ = 0 + X_SYS_TTYCOM_H_ = 0 + X_SYS_TTYDEFAULTS_H_ = 0 + X_SYS__TERMIOS_H_ = 0 + X_SYS__TYPES_H_ = 0 + X_SYS__WINSIZE_H_ = 0 + X_TERMIOS_H_ = 0 + Unix = 1 +) + +type Ptrdiff_t = int64 /* <builtin>:3:26 */ + +type Size_t = uint64 /* <builtin>:9:23 */ + +type Wchar_t = int32 /* <builtin>:15:24 */ + +type X__int128_t = struct { + Flo int64 + Fhi int64 +} /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128 +type X__uint128_t = struct { + Flo uint64 + Fhi uint64 +} /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128 + +type X__builtin_va_list = uintptr /* <builtin>:46:14 */ +type X__float128 = float64 /* <builtin>:47:21 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1988, 1989, 1993, 1994 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)termios.h 8.3 (Berkeley) 3/28/94 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// Testing against Clang-specific extensions. + +// This code has been put in place to help reduce the addition of +// compiler specific defines in FreeBSD code. It helps to aid in +// having a compiler-agnostic source tree. + +// Compiler memory barriers, specific to gcc and clang. + +// XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced + +// Macro to test if we're using a specific version of gcc or later. + +// The __CONCAT macro is used to concatenate parts of symbol names, e.g. +// with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. +// The __CONCAT macro is a bit tricky to use if it must work in non-ANSI +// mode -- there must be no spaces between its arguments, and for nested +// __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also +// concatenate double-quoted strings produced by the __STRING macro, but +// this only works with ANSI C. +// +// __XSTRING is like __STRING, but it expands any macros in its argument +// first. It is only available with ANSI C. + +// Compiler-dependent macros to help declare dead (non-returning) and +// pure (no side effects) functions, and unused variables. They are +// null except for versions of gcc that are known to support the features +// properly (old versions of gcc-2 supported the dead and pure features +// in a different (wrong) way). If we do not provide an implementation +// for a given compiler, let the compile fail if it is told to use +// a feature that we cannot live without. + +// Keywords added in C11. + +// Emulation of C11 _Generic(). Unlike the previously defined C11 +// keywords, it is not possible to implement this using exactly the same +// syntax. Therefore implement something similar under the name +// __generic(). Unlike _Generic(), this macro can only distinguish +// between a single type, so it requires nested invocations to +// distinguish multiple cases. + +// C99 Static array indices in function parameter declarations. Syntax such as: +// void bar(int myArray[static 10]); +// is allowed in C99 but not in C++. Define __min_size appropriately so +// headers using it can be compiled in either language. Use like this: +// void bar(int myArray[__min_size(10)]); + +// XXX: should use `#if __STDC_VERSION__ < 199901'. + +// C++11 exposes a load of C99 stuff + +// GCC 2.95 provides `__restrict' as an extension to C90 to support the +// C99-specific `restrict' type qualifier. We happen to use `__restrict' as +// a way to define the `restrict' type qualifier without disturbing older +// software that is unaware of C99 keywords. + +// GNU C version 2.96 adds explicit branch prediction so that +// the CPU back-end can hint the processor and also so that +// code blocks can be reordered such that the predicted path +// sees a more linear flow, thus improving cache behavior, etc. +// +// The following two macros provide us with a way to utilize this +// compiler feature. Use __predict_true() if you expect the expression +// to evaluate to true, and __predict_false() if you expect the +// expression to evaluate to false. +// +// A few notes about usage: +// +// * Generally, __predict_false() error condition checks (unless +// you have some _strong_ reason to do otherwise, in which case +// document it), and/or __predict_true() `no-error' condition +// checks, assuming you want to optimize for the no-error case. +// +// * Other than that, if you don't know the likelihood of a test +// succeeding from empirical or other `hard' evidence, don't +// make predictions. +// +// * These are meant to be used in places that are run `a lot'. +// It is wasteful to make predictions in code that is run +// seldomly (e.g. at subsystem initialization time) as the +// basic block reordering that this affects can often generate +// larger code. + +// We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h> +// require it. + +// Given the pointer x to the member m of the struct s, return +// a pointer to the containing structure. When using GCC, we first +// assign pointer x to a local variable, to check that its type is +// compatible with member m. + +// Compiler-dependent macros to declare that functions take printf-like +// or scanf-like arguments. They are null except for versions of gcc +// that are known to support the features properly (old versions of gcc-2 +// didn't permit keeping the keywords out of the application namespace). + +// Compiler-dependent macros that rely on FreeBSD-specific extensions. + +// Embed the rcs id of a source file in the resulting library. Note that in +// more recent ELF binutils, we use .ident allowing the ID to be stripped. +// Usage: +// __FBSDID("$FreeBSD$"); + +// - +// The following definitions are an extension of the behavior originally +// implemented in <sys/_posix.h>, but with a different level of granularity. +// POSIX.1 requires that the macros we test be defined before any standard +// header file is included. +// +// Here's a quick run-down of the versions: +// defined(_POSIX_SOURCE) 1003.1-1988 +// _POSIX_C_SOURCE == 1 1003.1-1990 +// _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option +// _POSIX_C_SOURCE == 199309 1003.1b-1993 +// _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, +// and the omnibus ISO/IEC 9945-1: 1996 +// _POSIX_C_SOURCE == 200112 1003.1-2001 +// _POSIX_C_SOURCE == 200809 1003.1-2008 +// +// In addition, the X/Open Portability Guide, which is now the Single UNIX +// Specification, defines a feature-test macro which indicates the version of +// that specification, and which subsumes _POSIX_C_SOURCE. +// +// Our macros begin with two underscores to avoid namespace screwage. + +// Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. + +// Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. + +// Deal with various X/Open Portability Guides and Single UNIX Spec. + +// Deal with all versions of POSIX. The ordering relative to the tests above is +// important. +// - +// Deal with _ANSI_SOURCE: +// If it is defined, and no other compilation environment is explicitly +// requested, then define our internal feature-test macros to zero. This +// makes no difference to the preprocessor (undefined symbols in preprocessing +// expressions are defined to have value zero), but makes it more convenient for +// a test program to print out the values. +// +// If a program mistakenly defines _ANSI_SOURCE and some other macro such as +// _POSIX_C_SOURCE, we will assume that it wants the broader compilation +// environment (and in fact we will never get here). + +// User override __EXT1_VISIBLE + +// Old versions of GCC use non-standard ARM arch symbols; acle-compat.h +// translates them to __ARM_ARCH and the modern feature symbols defined by ARM. + +// Nullability qualifiers: currently only supported by Clang. + +// Type Safety Checking +// +// Clang provides additional attributes to enable checking type safety +// properties that cannot be enforced by the C type system. + +// Lock annotations. +// +// Clang provides support for doing basic thread-safety tests at +// compile-time, by marking which locks will/should be held when +// entering/leaving a functions. +// +// Furthermore, it is also possible to annotate variables and structure +// members to enforce that they are only accessed when certain locks are +// held. + +// Structure implements a lock. + +// Function acquires an exclusive or shared lock. + +// Function attempts to acquire an exclusive or shared lock. + +// Function releases a lock. + +// Function asserts that an exclusive or shared lock is held. + +// Function requires that an exclusive or shared lock is or is not held. + +// Function should not be analyzed. + +// Function or variable should not be sanitized, i.e. by AddressSanitizer. +// GCC has the nosanitize attribute, but as a function attribute only, and +// warns on use as a variable attribute. + +// Guard variables and structure members by lock. + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1988, 1989, 1993, 1994 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)termios.h 8.3 (Berkeley) 3/28/94 +// $FreeBSD$ + +// Special Control Characters +// +// Index into c_cc[] character array. +// +// Name Subscript Enabled by +// 7 ex-spare 1 +// 19 spare 2 + +// Input flags - software input processing + +// Output flags - software output processing + +// Control flags - hardware control of terminal + +// "Local" flags - dumping ground for other state +// +// Warning: some flags in this structure begin with +// the letter "I" and look like they belong in the +// input flag. + +// Standard speeds + +type Tcflag_t = uint32 /* _termios.h:216:22 */ +type Cc_t = uint8 /* _termios.h:217:23 */ +type Speed_t = uint32 /* _termios.h:218:22 */ + +type Termios = struct { + Fc_iflag Tcflag_t + Fc_oflag Tcflag_t + Fc_cflag Tcflag_t + Fc_lflag Tcflag_t + Fc_cc [20]Cc_t + Fc_ispeed Speed_t + Fc_ospeed Speed_t +} /* _termios.h:220:1 */ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-4-Clause +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// Copyright (c) 1990, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. All advertising materials mentioning features or use of this software +// must display the following acknowledgement: +// This product includes software developed by the University of +// California, Berkeley and its contributors. +// 4. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 +// From: @(#)types.h 8.3 (Berkeley) 1/5/94 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1988, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)limits.h 8.3 (Berkeley) 1/4/94 +// $FreeBSD$ + +// According to ANSI (section 2.2.4.2), the values below must be usable by +// #if preprocessing directives. Additionally, the expression must have the +// same type as would an expression that is an object of the corresponding +// type converted according to the integral promotions. The subtraction for +// INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an +// unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). + +// max value for an unsigned long long + +// Quads and longs are the same on the amd64. Ensure they stay in sync. + +// Minimum signal stack size. + +// Basic types upon which most other types are built. +type X__int8_t = int8 /* _types.h:55:22 */ +type X__uint8_t = uint8 /* _types.h:56:24 */ +type X__int16_t = int16 /* _types.h:57:17 */ +type X__uint16_t = uint16 /* _types.h:58:25 */ +type X__int32_t = int32 /* _types.h:59:15 */ +type X__uint32_t = uint32 /* _types.h:60:23 */ +type X__int64_t = int64 /* _types.h:62:16 */ +type X__uint64_t = uint64 /* _types.h:63:24 */ + +// Standard type definitions. +type X__clock_t = X__int32_t /* _types.h:75:19 */ // clock()... +type X__critical_t = X__int64_t /* _types.h:76:19 */ +type X__double_t = float64 /* _types.h:78:17 */ +type X__float_t = float32 /* _types.h:79:16 */ +type X__intfptr_t = X__int64_t /* _types.h:81:19 */ +type X__intptr_t = X__int64_t /* _types.h:82:19 */ +type X__intmax_t = X__int64_t /* _types.h:93:19 */ +type X__int_fast8_t = X__int32_t /* _types.h:94:19 */ +type X__int_fast16_t = X__int32_t /* _types.h:95:19 */ +type X__int_fast32_t = X__int32_t /* _types.h:96:19 */ +type X__int_fast64_t = X__int64_t /* _types.h:97:19 */ +type X__int_least8_t = X__int8_t /* _types.h:98:18 */ +type X__int_least16_t = X__int16_t /* _types.h:99:19 */ +type X__int_least32_t = X__int32_t /* _types.h:100:19 */ +type X__int_least64_t = X__int64_t /* _types.h:101:19 */ +type X__ptrdiff_t = X__int64_t /* _types.h:103:19 */ // ptr1 - ptr2 +type X__register_t = X__int64_t /* _types.h:104:19 */ +type X__segsz_t = X__int64_t /* _types.h:105:19 */ // segment size (in pages) +type X__size_t = X__uint64_t /* _types.h:106:20 */ // sizeof() +type X__ssize_t = X__int64_t /* _types.h:107:19 */ // byte count or error +type X__time_t = X__int64_t /* _types.h:108:19 */ // time()... +type X__uintfptr_t = X__uint64_t /* _types.h:109:20 */ +type X__uintptr_t = X__uint64_t /* _types.h:110:20 */ +type X__uintmax_t = X__uint64_t /* _types.h:121:20 */ +type X__uint_fast8_t = X__uint32_t /* _types.h:122:20 */ +type X__uint_fast16_t = X__uint32_t /* _types.h:123:20 */ +type X__uint_fast32_t = X__uint32_t /* _types.h:124:20 */ +type X__uint_fast64_t = X__uint64_t /* _types.h:125:20 */ +type X__uint_least8_t = X__uint8_t /* _types.h:126:19 */ +type X__uint_least16_t = X__uint16_t /* _types.h:127:20 */ +type X__uint_least32_t = X__uint32_t /* _types.h:128:20 */ +type X__uint_least64_t = X__uint64_t /* _types.h:129:20 */ +type X__u_register_t = X__uint64_t /* _types.h:131:20 */ +type X__vm_offset_t = X__uint64_t /* _types.h:132:20 */ +type X__vm_paddr_t = X__uint64_t /* _types.h:133:20 */ +type X__vm_size_t = X__uint64_t /* _types.h:134:20 */ +type X___wchar_t = int32 /* _types.h:141:14 */ + +// Standard type definitions. +type X__blksize_t = X__int32_t /* _types.h:40:19 */ // file block size +type X__blkcnt_t = X__int64_t /* _types.h:41:19 */ // file block count +type X__clockid_t = X__int32_t /* _types.h:42:19 */ // clock_gettime()... +type X__fflags_t = X__uint32_t /* _types.h:43:20 */ // file flags +type X__fsblkcnt_t = X__uint64_t /* _types.h:44:20 */ +type X__fsfilcnt_t = X__uint64_t /* _types.h:45:20 */ +type X__gid_t = X__uint32_t /* _types.h:46:20 */ +type X__id_t = X__int64_t /* _types.h:47:19 */ // can hold a gid_t, pid_t, or uid_t +type X__ino_t = X__uint64_t /* _types.h:48:20 */ // inode number +type X__key_t = int64 /* _types.h:49:15 */ // IPC key (for Sys V IPC) +type X__lwpid_t = X__int32_t /* _types.h:50:19 */ // Thread ID (a.k.a. LWP) +type X__mode_t = X__uint16_t /* _types.h:51:20 */ // permissions +type X__accmode_t = int32 /* _types.h:52:14 */ // access permissions +type X__nl_item = int32 /* _types.h:53:14 */ +type X__nlink_t = X__uint64_t /* _types.h:54:20 */ // link count +type X__off_t = X__int64_t /* _types.h:55:19 */ // file offset +type X__off64_t = X__int64_t /* _types.h:56:19 */ // file offset (alias) +type X__pid_t = X__int32_t /* _types.h:57:19 */ // process [group] +type X__rlim_t = X__int64_t /* _types.h:58:19 */ // resource limit - intentionally +// signed, because of legacy code +// that uses -1 for RLIM_INFINITY +type X__sa_family_t = X__uint8_t /* _types.h:61:19 */ +type X__socklen_t = X__uint32_t /* _types.h:62:20 */ +type X__suseconds_t = int64 /* _types.h:63:15 */ // microseconds (signed) +type X__timer_t = uintptr /* _types.h:64:24 */ // timer_gettime()... +type X__mqd_t = uintptr /* _types.h:65:21 */ // mq_open()... +type X__uid_t = X__uint32_t /* _types.h:66:20 */ +type X__useconds_t = uint32 /* _types.h:67:22 */ // microseconds (unsigned) +type X__cpuwhich_t = int32 /* _types.h:68:14 */ // which parameter for cpuset. +type X__cpulevel_t = int32 /* _types.h:69:14 */ // level parameter for cpuset. +type X__cpusetid_t = int32 /* _types.h:70:14 */ // cpuset identifier. +type X__daddr_t = X__int64_t /* _types.h:71:19 */ // bwrite(3), FIOBMAP2, etc + +// Unusual type definitions. +// rune_t is declared to be an ``int'' instead of the more natural +// ``unsigned long'' or ``long''. Two things are happening here. It is not +// unsigned so that EOF (-1) can be naturally assigned to it and used. Also, +// it looks like 10646 will be a 31 bit standard. This means that if your +// ints cannot hold 32 bits, you will be in trouble. The reason an int was +// chosen over a long is that the is*() and to*() routines take ints (says +// ANSI C), but they use __ct_rune_t instead of int. +// +// NOTE: rune_t is not covered by ANSI nor other standards, and should not +// be instantiated outside of lib/libc/locale. Use wchar_t. wint_t and +// rune_t must be the same type. Also, wint_t should be able to hold all +// members of the largest character set plus one extra value (WEOF), and +// must be at least 16 bits. +type X__ct_rune_t = int32 /* _types.h:91:14 */ // arg type for ctype funcs +type X__rune_t = X__ct_rune_t /* _types.h:92:21 */ // rune_t (see above) +type X__wint_t = X__ct_rune_t /* _types.h:93:21 */ // wint_t (see above) + +// Clang already provides these types as built-ins, but only in C++ mode. +type X__char16_t = X__uint_least16_t /* _types.h:97:26 */ +type X__char32_t = X__uint_least32_t /* _types.h:98:26 */ +// In C++11, char16_t and char32_t are built-in types. + +type X__max_align_t = struct { + F__max_align1 int64 + F__max_align2 float64 +} /* _types.h:111:3 */ + +type X__dev_t = X__uint64_t /* _types.h:113:20 */ // device number + +type X__fixpt_t = X__uint32_t /* _types.h:115:20 */ // fixed point number + +// mbstate_t is an opaque object to keep conversion state during multibyte +// stream conversions. +type X__mbstate_t = struct { + _ [0]uint64 + F__mbstate8 [128]int8 +} /* _types.h:124:3 */ + +type X__rman_res_t = X__uintmax_t /* _types.h:126:25 */ + +// Types for varargs. These are all provided by builtin types these +// days, so centralize their definition. +type X__va_list = X__builtin_va_list /* _types.h:133:27 */ // internally known to gcc +type X__gnuc_va_list = X__va_list /* _types.h:140:20 */ // compatibility w/GNU headers + +// When the following macro is defined, the system uses 64-bit inode numbers. +// Programs can use this to avoid including <sys/param.h>, with its associated +// namespace pollution. + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1988, 1989, 1993, 1994 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)ttycom.h 8.1 (Berkeley) 3/28/94 +// $FreeBSD$ + +// Window/terminal size structure. This information is stored by the kernel +// in order to provide a consistent interface, but is not used by the kernel. +type Winsize = struct { + Fws_row uint16 + Fws_col uint16 + Fws_xpixel uint16 + Fws_ypixel uint16 +} /* _winsize.h:42:1 */ + +type Pid_t = X__pid_t /* termios.h:46:18 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1988, 1989, 1993, 1994 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)ttycom.h 8.1 (Berkeley) 3/28/94 +// $FreeBSD$ + +// Tty ioctl's except for those supported only for backwards compatibility +// with the old tty driver. + +// 0-2 compat +// 3-7 unused +// 8-10 compat +// 11-12 unused +// 17-18 compat +// 23-25 unused +// 29-85 unused +// 88 unused +// 89-91 conflicts: tun and tap +// 92-93 tun and tap +// 94-97 conflicts: tun and tap +// 100 unused +// 105 unused +// 116-117 compat +// 124-127 compat + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1993 +// The Regents of the University of California. All rights reserved. +// (c) UNIX System Laboratories, Inc. +// All or some portions of this file are derived from material licensed +// to the University of California by American Telephone and Telegraph +// Co. or Unix System Laboratories, Inc. and are reproduced herein with +// the permission of UNIX System Laboratories, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)ttydefaults.h 8.4 (Berkeley) 1/21/94 +// $FreeBSD$ + +// System wide defaults for terminal state. + +// Defaults on "first" open. + +// Control Character Defaults +// XXX: A lot of code uses lowercase characters, but control-character +// conversion is actually only valid when applied to uppercase +// characters. We just treat lowercase characters as if they were +// inserted as uppercase. +// compat + +// PROTECTED INCLUSION ENDS HERE + +// #define TTYDEFCHARS to include an array of default control characters. +var _ int8 /* gen.c:2:13: */ diff --git a/vendor/modernc.org/libc/time/capi_freebsd_amd64.go b/vendor/modernc.org/libc/time/capi_freebsd_amd64.go new file mode 100644 index 000000000..f79c0726b --- /dev/null +++ b/vendor/modernc.org/libc/time/capi_freebsd_amd64.go @@ -0,0 +1,5 @@ +// Code generated by 'ccgo time/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 time/time_freebsd_amd64.go -pkgname time', DO NOT EDIT. + +package time + +var CAPI = map[string]struct{}{} diff --git a/vendor/modernc.org/libc/time/time_freebsd_amd64.go b/vendor/modernc.org/libc/time/time_freebsd_amd64.go new file mode 100644 index 000000000..a58c29f8a --- /dev/null +++ b/vendor/modernc.org/libc/time/time_freebsd_amd64.go @@ -0,0 +1,877 @@ +// Code generated by 'ccgo time/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 time/time_freebsd_amd64.go -pkgname time', DO NOT EDIT. + +package time + +import ( + "math" + "reflect" + "sync/atomic" + "unsafe" +) + +var _ = math.Pi +var _ reflect.Kind +var _ atomic.Value +var _ unsafe.Pointer + +const ( + CLK_TCK = 128 + CLOCKS_PER_SEC = 128 + CLOCK_MONOTONIC = 4 + CLOCK_MONOTONIC_FAST = 12 + CLOCK_MONOTONIC_PRECISE = 11 + CLOCK_PROCESS_CPUTIME_ID = 15 + CLOCK_PROF = 2 + CLOCK_REALTIME = 0 + CLOCK_REALTIME_FAST = 10 + CLOCK_REALTIME_PRECISE = 9 + CLOCK_SECOND = 13 + CLOCK_THREAD_CPUTIME_ID = 14 + CLOCK_UPTIME = 5 + CLOCK_UPTIME_FAST = 8 + CLOCK_UPTIME_PRECISE = 7 + CLOCK_VIRTUAL = 1 + TIMER_ABSTIME = 0x1 + TIMER_RELTIME = 0x0 + TIME_UTC = 1 + X_CLOCKID_T_DECLARED = 0 + X_CLOCK_T_DECLARED = 0 + X_FILE_OFFSET_BITS = 64 + X_LOCALE_T_DEFINED = 0 + X_LP64 = 1 + X_MACHINE__LIMITS_H_ = 0 + X_MACHINE__TYPES_H_ = 0 + X_Nonnull = 0 + X_Null_unspecified = 0 + X_Nullable = 0 + X_PID_T_DECLARED = 0 + X_SIZE_T_DECLARED = 0 + X_SYS_CDEFS_H_ = 0 + X_SYS_TIMESPEC_H_ = 0 + X_SYS__TIMESPEC_H_ = 0 + X_SYS__TYPES_H_ = 0 + X_TIMER_T_DECLARED = 0 + X_TIME_H_ = 0 + X_TIME_T_DECLARED = 0 + X_XLOCALE_LOCALE1_H = 0 + Unix = 1 +) + +type Ptrdiff_t = int64 /* <builtin>:3:26 */ + +type Size_t = uint64 /* <builtin>:9:23 */ + +type Wchar_t = int32 /* <builtin>:15:24 */ + +type X__int128_t = struct { + Flo int64 + Fhi int64 +} /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128 +type X__uint128_t = struct { + Flo uint64 + Fhi uint64 +} /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128 + +type X__builtin_va_list = uintptr /* <builtin>:46:14 */ +type X__float128 = float64 /* <builtin>:47:21 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1989, 1993 +// The Regents of the University of California. All rights reserved. +// (c) UNIX System Laboratories, Inc. +// All or some portions of this file are derived from material licensed +// to the University of California by American Telephone and Telegraph +// Co. or Unix System Laboratories, Inc. and are reproduced herein with +// the permission of UNIX System Laboratories, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)time.h 8.3 (Berkeley) 1/21/94 + +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// Testing against Clang-specific extensions. + +// This code has been put in place to help reduce the addition of +// compiler specific defines in FreeBSD code. It helps to aid in +// having a compiler-agnostic source tree. + +// Compiler memory barriers, specific to gcc and clang. + +// XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced + +// Macro to test if we're using a specific version of gcc or later. + +// The __CONCAT macro is used to concatenate parts of symbol names, e.g. +// with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. +// The __CONCAT macro is a bit tricky to use if it must work in non-ANSI +// mode -- there must be no spaces between its arguments, and for nested +// __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also +// concatenate double-quoted strings produced by the __STRING macro, but +// this only works with ANSI C. +// +// __XSTRING is like __STRING, but it expands any macros in its argument +// first. It is only available with ANSI C. + +// Compiler-dependent macros to help declare dead (non-returning) and +// pure (no side effects) functions, and unused variables. They are +// null except for versions of gcc that are known to support the features +// properly (old versions of gcc-2 supported the dead and pure features +// in a different (wrong) way). If we do not provide an implementation +// for a given compiler, let the compile fail if it is told to use +// a feature that we cannot live without. + +// Keywords added in C11. + +// Emulation of C11 _Generic(). Unlike the previously defined C11 +// keywords, it is not possible to implement this using exactly the same +// syntax. Therefore implement something similar under the name +// __generic(). Unlike _Generic(), this macro can only distinguish +// between a single type, so it requires nested invocations to +// distinguish multiple cases. + +// C99 Static array indices in function parameter declarations. Syntax such as: +// void bar(int myArray[static 10]); +// is allowed in C99 but not in C++. Define __min_size appropriately so +// headers using it can be compiled in either language. Use like this: +// void bar(int myArray[__min_size(10)]); + +// XXX: should use `#if __STDC_VERSION__ < 199901'. + +// C++11 exposes a load of C99 stuff + +// GCC 2.95 provides `__restrict' as an extension to C90 to support the +// C99-specific `restrict' type qualifier. We happen to use `__restrict' as +// a way to define the `restrict' type qualifier without disturbing older +// software that is unaware of C99 keywords. + +// GNU C version 2.96 adds explicit branch prediction so that +// the CPU back-end can hint the processor and also so that +// code blocks can be reordered such that the predicted path +// sees a more linear flow, thus improving cache behavior, etc. +// +// The following two macros provide us with a way to utilize this +// compiler feature. Use __predict_true() if you expect the expression +// to evaluate to true, and __predict_false() if you expect the +// expression to evaluate to false. +// +// A few notes about usage: +// +// * Generally, __predict_false() error condition checks (unless +// you have some _strong_ reason to do otherwise, in which case +// document it), and/or __predict_true() `no-error' condition +// checks, assuming you want to optimize for the no-error case. +// +// * Other than that, if you don't know the likelihood of a test +// succeeding from empirical or other `hard' evidence, don't +// make predictions. +// +// * These are meant to be used in places that are run `a lot'. +// It is wasteful to make predictions in code that is run +// seldomly (e.g. at subsystem initialization time) as the +// basic block reordering that this affects can often generate +// larger code. + +// We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h> +// require it. + +// Given the pointer x to the member m of the struct s, return +// a pointer to the containing structure. When using GCC, we first +// assign pointer x to a local variable, to check that its type is +// compatible with member m. + +// Compiler-dependent macros to declare that functions take printf-like +// or scanf-like arguments. They are null except for versions of gcc +// that are known to support the features properly (old versions of gcc-2 +// didn't permit keeping the keywords out of the application namespace). + +// Compiler-dependent macros that rely on FreeBSD-specific extensions. + +// Embed the rcs id of a source file in the resulting library. Note that in +// more recent ELF binutils, we use .ident allowing the ID to be stripped. +// Usage: +// __FBSDID("$FreeBSD$"); + +// - +// The following definitions are an extension of the behavior originally +// implemented in <sys/_posix.h>, but with a different level of granularity. +// POSIX.1 requires that the macros we test be defined before any standard +// header file is included. +// +// Here's a quick run-down of the versions: +// defined(_POSIX_SOURCE) 1003.1-1988 +// _POSIX_C_SOURCE == 1 1003.1-1990 +// _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option +// _POSIX_C_SOURCE == 199309 1003.1b-1993 +// _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, +// and the omnibus ISO/IEC 9945-1: 1996 +// _POSIX_C_SOURCE == 200112 1003.1-2001 +// _POSIX_C_SOURCE == 200809 1003.1-2008 +// +// In addition, the X/Open Portability Guide, which is now the Single UNIX +// Specification, defines a feature-test macro which indicates the version of +// that specification, and which subsumes _POSIX_C_SOURCE. +// +// Our macros begin with two underscores to avoid namespace screwage. + +// Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. + +// Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. + +// Deal with various X/Open Portability Guides and Single UNIX Spec. + +// Deal with all versions of POSIX. The ordering relative to the tests above is +// important. +// - +// Deal with _ANSI_SOURCE: +// If it is defined, and no other compilation environment is explicitly +// requested, then define our internal feature-test macros to zero. This +// makes no difference to the preprocessor (undefined symbols in preprocessing +// expressions are defined to have value zero), but makes it more convenient for +// a test program to print out the values. +// +// If a program mistakenly defines _ANSI_SOURCE and some other macro such as +// _POSIX_C_SOURCE, we will assume that it wants the broader compilation +// environment (and in fact we will never get here). + +// User override __EXT1_VISIBLE + +// Old versions of GCC use non-standard ARM arch symbols; acle-compat.h +// translates them to __ARM_ARCH and the modern feature symbols defined by ARM. + +// Nullability qualifiers: currently only supported by Clang. + +// Type Safety Checking +// +// Clang provides additional attributes to enable checking type safety +// properties that cannot be enforced by the C type system. + +// Lock annotations. +// +// Clang provides support for doing basic thread-safety tests at +// compile-time, by marking which locks will/should be held when +// entering/leaving a functions. +// +// Furthermore, it is also possible to annotate variables and structure +// members to enforce that they are only accessed when certain locks are +// held. + +// Structure implements a lock. + +// Function acquires an exclusive or shared lock. + +// Function attempts to acquire an exclusive or shared lock. + +// Function releases a lock. + +// Function asserts that an exclusive or shared lock is held. + +// Function requires that an exclusive or shared lock is or is not held. + +// Function should not be analyzed. + +// Function or variable should not be sanitized, i.e. by AddressSanitizer. +// GCC has the nosanitize attribute, but as a function attribute only, and +// warns on use as a variable attribute. + +// Guard variables and structure members by lock. + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2003 Marcel Moolenaar +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-4-Clause +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// Copyright (c) 1990, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. All advertising materials mentioning features or use of this software +// must display the following acknowledgement: +// This product includes software developed by the University of +// California, Berkeley and its contributors. +// 4. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 +// From: @(#)types.h 8.3 (Berkeley) 1/5/94 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1988, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)limits.h 8.3 (Berkeley) 1/4/94 +// $FreeBSD$ + +// According to ANSI (section 2.2.4.2), the values below must be usable by +// #if preprocessing directives. Additionally, the expression must have the +// same type as would an expression that is an object of the corresponding +// type converted according to the integral promotions. The subtraction for +// INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an +// unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). + +// max value for an unsigned long long + +// Quads and longs are the same on the amd64. Ensure they stay in sync. + +// Minimum signal stack size. + +// Basic types upon which most other types are built. +type X__int8_t = int8 /* _types.h:55:22 */ +type X__uint8_t = uint8 /* _types.h:56:24 */ +type X__int16_t = int16 /* _types.h:57:17 */ +type X__uint16_t = uint16 /* _types.h:58:25 */ +type X__int32_t = int32 /* _types.h:59:15 */ +type X__uint32_t = uint32 /* _types.h:60:23 */ +type X__int64_t = int64 /* _types.h:62:16 */ +type X__uint64_t = uint64 /* _types.h:63:24 */ + +// Standard type definitions. +type X__clock_t = X__int32_t /* _types.h:75:19 */ // clock()... +type X__critical_t = X__int64_t /* _types.h:76:19 */ +type X__double_t = float64 /* _types.h:78:17 */ +type X__float_t = float32 /* _types.h:79:16 */ +type X__intfptr_t = X__int64_t /* _types.h:81:19 */ +type X__intptr_t = X__int64_t /* _types.h:82:19 */ +type X__intmax_t = X__int64_t /* _types.h:93:19 */ +type X__int_fast8_t = X__int32_t /* _types.h:94:19 */ +type X__int_fast16_t = X__int32_t /* _types.h:95:19 */ +type X__int_fast32_t = X__int32_t /* _types.h:96:19 */ +type X__int_fast64_t = X__int64_t /* _types.h:97:19 */ +type X__int_least8_t = X__int8_t /* _types.h:98:18 */ +type X__int_least16_t = X__int16_t /* _types.h:99:19 */ +type X__int_least32_t = X__int32_t /* _types.h:100:19 */ +type X__int_least64_t = X__int64_t /* _types.h:101:19 */ +type X__ptrdiff_t = X__int64_t /* _types.h:103:19 */ // ptr1 - ptr2 +type X__register_t = X__int64_t /* _types.h:104:19 */ +type X__segsz_t = X__int64_t /* _types.h:105:19 */ // segment size (in pages) +type X__size_t = X__uint64_t /* _types.h:106:20 */ // sizeof() +type X__ssize_t = X__int64_t /* _types.h:107:19 */ // byte count or error +type X__time_t = X__int64_t /* _types.h:108:19 */ // time()... +type X__uintfptr_t = X__uint64_t /* _types.h:109:20 */ +type X__uintptr_t = X__uint64_t /* _types.h:110:20 */ +type X__uintmax_t = X__uint64_t /* _types.h:121:20 */ +type X__uint_fast8_t = X__uint32_t /* _types.h:122:20 */ +type X__uint_fast16_t = X__uint32_t /* _types.h:123:20 */ +type X__uint_fast32_t = X__uint32_t /* _types.h:124:20 */ +type X__uint_fast64_t = X__uint64_t /* _types.h:125:20 */ +type X__uint_least8_t = X__uint8_t /* _types.h:126:19 */ +type X__uint_least16_t = X__uint16_t /* _types.h:127:20 */ +type X__uint_least32_t = X__uint32_t /* _types.h:128:20 */ +type X__uint_least64_t = X__uint64_t /* _types.h:129:20 */ +type X__u_register_t = X__uint64_t /* _types.h:131:20 */ +type X__vm_offset_t = X__uint64_t /* _types.h:132:20 */ +type X__vm_paddr_t = X__uint64_t /* _types.h:133:20 */ +type X__vm_size_t = X__uint64_t /* _types.h:134:20 */ +type X___wchar_t = int32 /* _types.h:141:14 */ + +// Standard type definitions. +type X__blksize_t = X__int32_t /* _types.h:40:19 */ // file block size +type X__blkcnt_t = X__int64_t /* _types.h:41:19 */ // file block count +type X__clockid_t = X__int32_t /* _types.h:42:19 */ // clock_gettime()... +type X__fflags_t = X__uint32_t /* _types.h:43:20 */ // file flags +type X__fsblkcnt_t = X__uint64_t /* _types.h:44:20 */ +type X__fsfilcnt_t = X__uint64_t /* _types.h:45:20 */ +type X__gid_t = X__uint32_t /* _types.h:46:20 */ +type X__id_t = X__int64_t /* _types.h:47:19 */ // can hold a gid_t, pid_t, or uid_t +type X__ino_t = X__uint64_t /* _types.h:48:20 */ // inode number +type X__key_t = int64 /* _types.h:49:15 */ // IPC key (for Sys V IPC) +type X__lwpid_t = X__int32_t /* _types.h:50:19 */ // Thread ID (a.k.a. LWP) +type X__mode_t = X__uint16_t /* _types.h:51:20 */ // permissions +type X__accmode_t = int32 /* _types.h:52:14 */ // access permissions +type X__nl_item = int32 /* _types.h:53:14 */ +type X__nlink_t = X__uint64_t /* _types.h:54:20 */ // link count +type X__off_t = X__int64_t /* _types.h:55:19 */ // file offset +type X__off64_t = X__int64_t /* _types.h:56:19 */ // file offset (alias) +type X__pid_t = X__int32_t /* _types.h:57:19 */ // process [group] +type X__rlim_t = X__int64_t /* _types.h:58:19 */ // resource limit - intentionally +// signed, because of legacy code +// that uses -1 for RLIM_INFINITY +type X__sa_family_t = X__uint8_t /* _types.h:61:19 */ +type X__socklen_t = X__uint32_t /* _types.h:62:20 */ +type X__suseconds_t = int64 /* _types.h:63:15 */ // microseconds (signed) +type X__timer_t = uintptr /* _types.h:64:24 */ // timer_gettime()... +type X__mqd_t = uintptr /* _types.h:65:21 */ // mq_open()... +type X__uid_t = X__uint32_t /* _types.h:66:20 */ +type X__useconds_t = uint32 /* _types.h:67:22 */ // microseconds (unsigned) +type X__cpuwhich_t = int32 /* _types.h:68:14 */ // which parameter for cpuset. +type X__cpulevel_t = int32 /* _types.h:69:14 */ // level parameter for cpuset. +type X__cpusetid_t = int32 /* _types.h:70:14 */ // cpuset identifier. +type X__daddr_t = X__int64_t /* _types.h:71:19 */ // bwrite(3), FIOBMAP2, etc + +// Unusual type definitions. +// rune_t is declared to be an ``int'' instead of the more natural +// ``unsigned long'' or ``long''. Two things are happening here. It is not +// unsigned so that EOF (-1) can be naturally assigned to it and used. Also, +// it looks like 10646 will be a 31 bit standard. This means that if your +// ints cannot hold 32 bits, you will be in trouble. The reason an int was +// chosen over a long is that the is*() and to*() routines take ints (says +// ANSI C), but they use __ct_rune_t instead of int. +// +// NOTE: rune_t is not covered by ANSI nor other standards, and should not +// be instantiated outside of lib/libc/locale. Use wchar_t. wint_t and +// rune_t must be the same type. Also, wint_t should be able to hold all +// members of the largest character set plus one extra value (WEOF), and +// must be at least 16 bits. +type X__ct_rune_t = int32 /* _types.h:91:14 */ // arg type for ctype funcs +type X__rune_t = X__ct_rune_t /* _types.h:92:21 */ // rune_t (see above) +type X__wint_t = X__ct_rune_t /* _types.h:93:21 */ // wint_t (see above) + +// Clang already provides these types as built-ins, but only in C++ mode. +type X__char16_t = X__uint_least16_t /* _types.h:97:26 */ +type X__char32_t = X__uint_least32_t /* _types.h:98:26 */ +// In C++11, char16_t and char32_t are built-in types. + +type X__max_align_t = struct { + F__max_align1 int64 + F__max_align2 float64 +} /* _types.h:111:3 */ + +type X__dev_t = X__uint64_t /* _types.h:113:20 */ // device number + +type X__fixpt_t = X__uint32_t /* _types.h:115:20 */ // fixed point number + +// mbstate_t is an opaque object to keep conversion state during multibyte +// stream conversions. +type X__mbstate_t = struct { + _ [0]uint64 + F__mbstate8 [128]int8 +} /* _types.h:124:3 */ + +type X__rman_res_t = X__uintmax_t /* _types.h:126:25 */ + +// Types for varargs. These are all provided by builtin types these +// days, so centralize their definition. +type X__va_list = X__builtin_va_list /* _types.h:133:27 */ // internally known to gcc +type X__gnuc_va_list = X__va_list /* _types.h:140:20 */ // compatibility w/GNU headers + +// When the following macro is defined, the system uses 64-bit inode numbers. +// Programs can use this to avoid including <sys/param.h>, with its associated +// namespace pollution. + +// Frequency of the clock ticks reported by times(). Deprecated - use +// sysconf(_SC_CLK_TCK) instead. (Removed in 1003.1-2001.) + +// Frequency of the clock ticks reported by clock(). + +type Clock_t = X__clock_t /* time.h:62:19 */ + +type Time_t = X__time_t /* time.h:67:18 */ + +// New in POSIX 1003.1b-1993. +type Clockid_t = X__clockid_t /* time.h:81:21 */ + +type Timer_t = X__timer_t /* time.h:86:19 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)time.h 8.5 (Berkeley) 5/4/95 +// from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)time.h 8.5 (Berkeley) 5/4/95 +// from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +type Timespec = struct { + Ftv_sec Time_t + Ftv_nsec int64 +} /* _timespec.h:46:1 */ + +// Structure defined by POSIX.1b to be like a itimerval, but with +// timespecs. Used in the timer_*() system calls. +type Itimerspec = struct { + Fit_interval struct { + Ftv_sec Time_t + Ftv_nsec int64 + } + Fit_value struct { + Ftv_sec Time_t + Ftv_nsec int64 + } +} /* timespec.h:60:1 */ + +type Pid_t = X__pid_t /* time.h:95:18 */ + +// These macros are also in sys/time.h. + +type Tm = struct { + Ftm_sec int32 + Ftm_min int32 + Ftm_hour int32 + Ftm_mday int32 + Ftm_mon int32 + Ftm_year int32 + Ftm_wday int32 + Ftm_yday int32 + Ftm_isdst int32 + _ [4]byte + Ftm_gmtoff int64 + Ftm_zone uintptr +} /* time.h:129:1 */ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2011, 2012 The FreeBSD Foundation +// All rights reserved. +// +// This software was developed by David Chisnall under sponsorship from +// the FreeBSD Foundation. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +type Locale_t = uintptr /* _time.h:36:25 */ + +var _ int8 /* gen.c:2:13: */ diff --git a/vendor/modernc.org/libc/unistd/capi_freebsd_amd64.go b/vendor/modernc.org/libc/unistd/capi_freebsd_amd64.go new file mode 100644 index 000000000..3b07321b0 --- /dev/null +++ b/vendor/modernc.org/libc/unistd/capi_freebsd_amd64.go @@ -0,0 +1,5 @@ +// Code generated by 'ccgo unistd/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 unistd/unistd_freebsd_amd64.go -pkgname unistd', DO NOT EDIT. + +package unistd + +var CAPI = map[string]struct{}{} diff --git a/vendor/modernc.org/libc/unistd/unistd_freebsd_amd64.go b/vendor/modernc.org/libc/unistd/unistd_freebsd_amd64.go new file mode 100644 index 000000000..40c398922 --- /dev/null +++ b/vendor/modernc.org/libc/unistd/unistd_freebsd_amd64.go @@ -0,0 +1,1810 @@ +// Code generated by 'ccgo unistd/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 unistd/unistd_freebsd_amd64.go -pkgname unistd', DO NOT EDIT. + +package unistd + +import ( + "math" + "reflect" + "sync/atomic" + "unsafe" +) + +var _ = math.Pi +var _ reflect.Kind +var _ atomic.Value +var _ unsafe.Pointer + +const ( + BIG_ENDIAN = 4321 + BYTE_ORDER = 1234 + FD_SETSIZE = 1024 + F_LOCK = 1 + F_OK = 0 + F_TEST = 3 + F_TLOCK = 2 + F_ULOCK = 0 + LITTLE_ENDIAN = 1234 + L_INCR = 1 + L_SET = 0 + L_XTND = 2 + PDP_ENDIAN = 3412 + RFCENVG = 2048 + RFCFDG = 4096 + RFCNAMEG = 1024 + RFENVG = 2 + RFFDG = 4 + RFFLAGS = 2416930932 + RFHIGHPID = 262144 + RFKERNELONLY = 268828672 + RFLINUXTHPN = 65536 + RFMEM = 32 + RFNAMEG = 1 + RFNOTEG = 8 + RFNOWAIT = 64 + RFPPWAIT = 2147483648 + RFPROC = 16 + RFPROCDESC = 268435456 + RFSIGSHARE = 16384 + RFSPAWN = 2147483648 + RFSTOPPED = 131072 + RFTHREAD = 8192 + RFTSIGMASK = 0xFF + RFTSIGSHIFT = 20 + RFTSIGZMB = 524288 + R_OK = 0x04 + SEEK_CUR = 1 + SEEK_DATA = 3 + SEEK_END = 2 + SEEK_HOLE = 4 + SEEK_SET = 0 + STDERR_FILENO = 2 + STDIN_FILENO = 0 + STDOUT_FILENO = 1 + W_OK = 0x02 + X_OK = 0x01 + X_ACCMODE_T_DECLARED = 0 + X_BIG_ENDIAN = 4321 + X_BLKCNT_T_DECLARED = 0 + X_BLKSIZE_T_DECLARED = 0 + X_BYTE_ORDER = 1234 + X_CAP_IOCTL_T_DECLARED = 0 + X_CAP_RIGHTS_T_DECLARED = 0 + X_CLOCKID_T_DECLARED = 0 + X_CLOCK_T_DECLARED = 0 + X_CS_PATH = 1 + X_CS_POSIX_V6_ILP32_OFF32_CFLAGS = 2 + X_CS_POSIX_V6_ILP32_OFF32_LDFLAGS = 3 + X_CS_POSIX_V6_ILP32_OFF32_LIBS = 4 + X_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS = 5 + X_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS = 6 + X_CS_POSIX_V6_ILP32_OFFBIG_LIBS = 7 + X_CS_POSIX_V6_LP64_OFF64_CFLAGS = 8 + X_CS_POSIX_V6_LP64_OFF64_LDFLAGS = 9 + X_CS_POSIX_V6_LP64_OFF64_LIBS = 10 + X_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS = 11 + X_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS = 12 + X_CS_POSIX_V6_LPBIG_OFFBIG_LIBS = 13 + X_CS_POSIX_V6_WIDTH_RESTRICTED_ENVS = 14 + X_DEV_T_DECLARED = 0 + X_FFLAGS_T_DECLARED = 0 + X_FILE_OFFSET_BITS = 64 + X_FSBLKCNT_T_DECLARED = 0 + X_FTRUNCATE_DECLARED = 0 + X_GETOPT_DECLARED = 0 + X_GID_T_DECLARED = 0 + X_ID_T_DECLARED = 0 + X_INO_T_DECLARED = 0 + X_INT16_T_DECLARED = 0 + X_INT32_T_DECLARED = 0 + X_INT64_T_DECLARED = 0 + X_INT8_T_DECLARED = 0 + X_INTMAX_T_DECLARED = 0 + X_INTPTR_T_DECLARED = 0 + X_IN_ADDR_T_DECLARED = 0 + X_IN_PORT_T_DECLARED = 0 + X_KEY_T_DECLARED = 0 + X_LITTLE_ENDIAN = 1234 + X_LP64 = 1 + X_LSEEK_DECLARED = 0 + X_LWPID_T_DECLARED = 0 + X_MACHINE_ENDIAN_H_ = 0 + X_MACHINE__LIMITS_H_ = 0 + X_MACHINE__TYPES_H_ = 0 + X_MKDTEMP_DECLARED = 0 + X_MKNOD_DECLARED = 0 + X_MKSTEMP_DECLARED = 0 + X_MKTEMP_DECLARED = 0 + X_MMAP_DECLARED = 0 + X_MODE_T_DECLARED = 0 + X_MQD_T_DECLARED = 0 + X_NLINK_T_DECLARED = 0 + X_Nonnull = 0 + X_Null_unspecified = 0 + X_Nullable = 0 + X_OFF64_T_DECLARED = 0 + X_OFF_T_DECLARED = 0 + X_OPTRESET_DECLARED = 0 + X_PC_ACL_EXTENDED = 59 + X_PC_ACL_NFS4 = 64 + X_PC_ACL_PATH_MAX = 60 + X_PC_ALLOC_SIZE_MIN = 10 + X_PC_ASYNC_IO = 53 + X_PC_CAP_PRESENT = 61 + X_PC_CHOWN_RESTRICTED = 7 + X_PC_FILESIZEBITS = 12 + X_PC_INF_PRESENT = 62 + X_PC_LINK_MAX = 1 + X_PC_MAC_PRESENT = 63 + X_PC_MAX_CANON = 2 + X_PC_MAX_INPUT = 3 + X_PC_MIN_HOLE_SIZE = 21 + X_PC_NAME_MAX = 4 + X_PC_NO_TRUNC = 8 + X_PC_PATH_MAX = 5 + X_PC_PIPE_BUF = 6 + X_PC_PRIO_IO = 54 + X_PC_REC_INCR_XFER_SIZE = 14 + X_PC_REC_MAX_XFER_SIZE = 15 + X_PC_REC_MIN_XFER_SIZE = 16 + X_PC_REC_XFER_ALIGN = 17 + X_PC_SYMLINK_MAX = 18 + X_PC_SYNC_IO = 55 + X_PC_VDISABLE = 9 + X_PDP_ENDIAN = 3412 + X_PID_T_DECLARED = 0 + X_POSIX2_CHAR_TERM = 1 + X_POSIX2_C_BIND = 200112 + X_POSIX2_C_DEV = -1 + X_POSIX2_FORT_DEV = -1 + X_POSIX2_FORT_RUN = 200112 + X_POSIX2_LOCALEDEF = -1 + X_POSIX2_PBS = -1 + X_POSIX2_PBS_ACCOUNTING = -1 + X_POSIX2_PBS_CHECKPOINT = -1 + X_POSIX2_PBS_LOCATE = -1 + X_POSIX2_PBS_MESSAGE = -1 + X_POSIX2_PBS_TRACK = -1 + X_POSIX2_SW_DEV = -1 + X_POSIX2_UPE = 200112 + X_POSIX2_VERSION = 199212 + X_POSIX_ADVISORY_INFO = 200112 + X_POSIX_ASYNCHRONOUS_IO = 200112 + X_POSIX_BARRIERS = 200112 + X_POSIX_CHOWN_RESTRICTED = 1 + X_POSIX_CLOCK_SELECTION = -1 + X_POSIX_CPUTIME = 200112 + X_POSIX_FSYNC = 200112 + X_POSIX_IPV6 = 0 + X_POSIX_JOB_CONTROL = 1 + X_POSIX_MAPPED_FILES = 200112 + X_POSIX_MEMLOCK = -1 + X_POSIX_MEMLOCK_RANGE = 200112 + X_POSIX_MEMORY_PROTECTION = 200112 + X_POSIX_MESSAGE_PASSING = 200112 + X_POSIX_MONOTONIC_CLOCK = 200112 + X_POSIX_NO_TRUNC = 1 + X_POSIX_PRIORITIZED_IO = -1 + X_POSIX_PRIORITY_SCHEDULING = 0 + X_POSIX_RAW_SOCKETS = 200112 + X_POSIX_READER_WRITER_LOCKS = 200112 + X_POSIX_REALTIME_SIGNALS = 200112 + X_POSIX_REGEXP = 1 + X_POSIX_SEMAPHORES = 200112 + X_POSIX_SHARED_MEMORY_OBJECTS = 200112 + X_POSIX_SHELL = 1 + X_POSIX_SPAWN = 200112 + X_POSIX_SPIN_LOCKS = 200112 + X_POSIX_SPORADIC_SERVER = -1 + X_POSIX_SYNCHRONIZED_IO = -1 + X_POSIX_THREADS = 200112 + X_POSIX_THREAD_ATTR_STACKADDR = 200112 + X_POSIX_THREAD_ATTR_STACKSIZE = 200112 + X_POSIX_THREAD_CPUTIME = 200112 + X_POSIX_THREAD_PRIORITY_SCHEDULING = 200112 + X_POSIX_THREAD_PRIO_INHERIT = 200112 + X_POSIX_THREAD_PRIO_PROTECT = 200112 + X_POSIX_THREAD_PROCESS_SHARED = 200112 + X_POSIX_THREAD_SAFE_FUNCTIONS = -1 + X_POSIX_THREAD_SPORADIC_SERVER = -1 + X_POSIX_TIMEOUTS = 200112 + X_POSIX_TIMERS = 200112 + X_POSIX_TRACE = -1 + X_POSIX_TRACE_EVENT_FILTER = -1 + X_POSIX_TRACE_INHERIT = -1 + X_POSIX_TRACE_LOG = -1 + X_POSIX_TYPED_MEMORY_OBJECTS = -1 + X_POSIX_VDISABLE = 0xff + X_POSIX_VERSION = 200112 + X_PTHREAD_T_DECLARED = 0 + X_QUAD_HIGHWORD = 1 + X_QUAD_LOWWORD = 0 + X_RLIM_T_DECLARED = 0 + X_SC_2_CHAR_TERM = 20 + X_SC_2_C_BIND = 18 + X_SC_2_C_DEV = 19 + X_SC_2_FORT_DEV = 21 + X_SC_2_FORT_RUN = 22 + X_SC_2_LOCALEDEF = 23 + X_SC_2_PBS = 59 + X_SC_2_PBS_ACCOUNTING = 60 + X_SC_2_PBS_CHECKPOINT = 61 + X_SC_2_PBS_LOCATE = 62 + X_SC_2_PBS_MESSAGE = 63 + X_SC_2_PBS_TRACK = 64 + X_SC_2_SW_DEV = 24 + X_SC_2_UPE = 25 + X_SC_2_VERSION = 17 + X_SC_ADVISORY_INFO = 65 + X_SC_AIO_LISTIO_MAX = 42 + X_SC_AIO_MAX = 43 + X_SC_AIO_PRIO_DELTA_MAX = 44 + X_SC_ARG_MAX = 1 + X_SC_ASYNCHRONOUS_IO = 28 + X_SC_ATEXIT_MAX = 107 + X_SC_BARRIERS = 66 + X_SC_BC_BASE_MAX = 9 + X_SC_BC_DIM_MAX = 10 + X_SC_BC_SCALE_MAX = 11 + X_SC_BC_STRING_MAX = 12 + X_SC_CHILD_MAX = 2 + X_SC_CLK_TCK = 3 + X_SC_CLOCK_SELECTION = 67 + X_SC_COLL_WEIGHTS_MAX = 13 + X_SC_CPUSET_SIZE = 122 + X_SC_CPUTIME = 68 + X_SC_DELAYTIMER_MAX = 45 + X_SC_EXPR_NEST_MAX = 14 + X_SC_FILE_LOCKING = 69 + X_SC_FSYNC = 38 + X_SC_GETGR_R_SIZE_MAX = 70 + X_SC_GETPW_R_SIZE_MAX = 71 + X_SC_HOST_NAME_MAX = 72 + X_SC_IOV_MAX = 56 + X_SC_IPV6 = 118 + X_SC_JOB_CONTROL = 6 + X_SC_LINE_MAX = 15 + X_SC_LOGIN_NAME_MAX = 73 + X_SC_MAPPED_FILES = 29 + X_SC_MEMLOCK = 30 + X_SC_MEMLOCK_RANGE = 31 + X_SC_MEMORY_PROTECTION = 32 + X_SC_MESSAGE_PASSING = 33 + X_SC_MONOTONIC_CLOCK = 74 + X_SC_MQ_OPEN_MAX = 46 + X_SC_MQ_PRIO_MAX = 75 + X_SC_NGROUPS_MAX = 4 + X_SC_NPROCESSORS_CONF = 57 + X_SC_NPROCESSORS_ONLN = 58 + X_SC_OPEN_MAX = 5 + X_SC_PAGESIZE = 47 + X_SC_PAGE_SIZE = 47 + X_SC_PHYS_PAGES = 121 + X_SC_PRIORITIZED_IO = 34 + X_SC_PRIORITY_SCHEDULING = 35 + X_SC_RAW_SOCKETS = 119 + X_SC_READER_WRITER_LOCKS = 76 + X_SC_REALTIME_SIGNALS = 36 + X_SC_REGEXP = 77 + X_SC_RE_DUP_MAX = 16 + X_SC_RTSIG_MAX = 48 + X_SC_SAVED_IDS = 7 + X_SC_SEMAPHORES = 37 + X_SC_SEM_NSEMS_MAX = 49 + X_SC_SEM_VALUE_MAX = 50 + X_SC_SHARED_MEMORY_OBJECTS = 39 + X_SC_SHELL = 78 + X_SC_SIGQUEUE_MAX = 51 + X_SC_SPAWN = 79 + X_SC_SPIN_LOCKS = 80 + X_SC_SPORADIC_SERVER = 81 + X_SC_STREAM_MAX = 26 + X_SC_SYMLOOP_MAX = 120 + X_SC_SYNCHRONIZED_IO = 40 + X_SC_THREADS = 96 + X_SC_THREAD_ATTR_STACKADDR = 82 + X_SC_THREAD_ATTR_STACKSIZE = 83 + X_SC_THREAD_CPUTIME = 84 + X_SC_THREAD_DESTRUCTOR_ITERATIONS = 85 + X_SC_THREAD_KEYS_MAX = 86 + X_SC_THREAD_PRIORITY_SCHEDULING = 89 + X_SC_THREAD_PRIO_INHERIT = 87 + X_SC_THREAD_PRIO_PROTECT = 88 + X_SC_THREAD_PROCESS_SHARED = 90 + X_SC_THREAD_SAFE_FUNCTIONS = 91 + X_SC_THREAD_SPORADIC_SERVER = 92 + X_SC_THREAD_STACK_MIN = 93 + X_SC_THREAD_THREADS_MAX = 94 + X_SC_TIMEOUTS = 95 + X_SC_TIMERS = 41 + X_SC_TIMER_MAX = 52 + X_SC_TRACE = 97 + X_SC_TRACE_EVENT_FILTER = 98 + X_SC_TRACE_INHERIT = 99 + X_SC_TRACE_LOG = 100 + X_SC_TTY_NAME_MAX = 101 + X_SC_TYPED_MEMORY_OBJECTS = 102 + X_SC_TZNAME_MAX = 27 + X_SC_V6_ILP32_OFF32 = 103 + X_SC_V6_ILP32_OFFBIG = 104 + X_SC_V6_LP64_OFF64 = 105 + X_SC_V6_LPBIG_OFFBIG = 106 + X_SC_VERSION = 8 + X_SC_XOPEN_CRYPT = 108 + X_SC_XOPEN_ENH_I18N = 109 + X_SC_XOPEN_LEGACY = 110 + X_SC_XOPEN_REALTIME = 111 + X_SC_XOPEN_REALTIME_THREADS = 112 + X_SC_XOPEN_SHM = 113 + X_SC_XOPEN_STREAMS = 114 + X_SC_XOPEN_UNIX = 115 + X_SC_XOPEN_VERSION = 116 + X_SC_XOPEN_XCU_VERSION = 117 + X_SELECT_DECLARED = 0 + X_SIGSET_T_DECLARED = 0 + X_SIG_MAXSIG = 128 + X_SIG_WORDS = 4 + X_SIZE_T_DECLARED = 0 + X_SSIZE_T_DECLARED = 0 + X_SUSECONDS_T_DECLARED = 0 + X_SWAB_DECLARED = 0 + X_SYS_CDEFS_H_ = 0 + X_SYS_SELECT_H_ = 0 + X_SYS_TIMESPEC_H_ = 0 + X_SYS_TYPES_H_ = 0 + X_SYS_UNISTD_H_ = 0 + X_SYS__PTHREADTYPES_H_ = 0 + X_SYS__SIGSET_H_ = 0 + X_SYS__STDINT_H_ = 0 + X_SYS__TIMESPEC_H_ = 0 + X_SYS__TIMEVAL_H_ = 0 + X_SYS__TYPES_H_ = 0 + X_TIMER_T_DECLARED = 0 + X_TIME_T_DECLARED = 0 + X_TRUNCATE_DECLARED = 0 + X_UID_T_DECLARED = 0 + X_UINT16_T_DECLARED = 0 + X_UINT32_T_DECLARED = 0 + X_UINT64_T_DECLARED = 0 + X_UINT8_T_DECLARED = 0 + X_UINTMAX_T_DECLARED = 0 + X_UINTPTR_T_DECLARED = 0 + X_UNISTD_H_ = 0 + X_USECONDS_T_DECLARED = 0 + X_V6_ILP32_OFF32 = -1 + X_V6_ILP32_OFFBIG = 0 + X_V6_LP64_OFF64 = 0 + X_V6_LPBIG_OFFBIG = -1 + X_XOPEN_CRYPT = -1 + X_XOPEN_ENH_I18N = -1 + X_XOPEN_LEGACY = -1 + X_XOPEN_REALTIME = -1 + X_XOPEN_REALTIME_THREADS = -1 + X_XOPEN_SHM = 1 + X_XOPEN_STREAMS = -1 + X_XOPEN_UNIX = -1 + Unix = 1 +) + +type Ptrdiff_t = int64 /* <builtin>:3:26 */ + +type Size_t = uint64 /* <builtin>:9:23 */ + +type Wchar_t = int32 /* <builtin>:15:24 */ + +type X__int128_t = struct { + Flo int64 + Fhi int64 +} /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128 +type X__uint128_t = struct { + Flo uint64 + Fhi uint64 +} /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128 + +type X__builtin_va_list = uintptr /* <builtin>:46:14 */ +type X__float128 = float64 /* <builtin>:47:21 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993, 1994 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)unistd.h 8.12 (Berkeley) 4/27/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// Testing against Clang-specific extensions. + +// This code has been put in place to help reduce the addition of +// compiler specific defines in FreeBSD code. It helps to aid in +// having a compiler-agnostic source tree. + +// Compiler memory barriers, specific to gcc and clang. + +// XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced + +// Macro to test if we're using a specific version of gcc or later. + +// The __CONCAT macro is used to concatenate parts of symbol names, e.g. +// with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. +// The __CONCAT macro is a bit tricky to use if it must work in non-ANSI +// mode -- there must be no spaces between its arguments, and for nested +// __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also +// concatenate double-quoted strings produced by the __STRING macro, but +// this only works with ANSI C. +// +// __XSTRING is like __STRING, but it expands any macros in its argument +// first. It is only available with ANSI C. + +// Compiler-dependent macros to help declare dead (non-returning) and +// pure (no side effects) functions, and unused variables. They are +// null except for versions of gcc that are known to support the features +// properly (old versions of gcc-2 supported the dead and pure features +// in a different (wrong) way). If we do not provide an implementation +// for a given compiler, let the compile fail if it is told to use +// a feature that we cannot live without. + +// Keywords added in C11. + +// Emulation of C11 _Generic(). Unlike the previously defined C11 +// keywords, it is not possible to implement this using exactly the same +// syntax. Therefore implement something similar under the name +// __generic(). Unlike _Generic(), this macro can only distinguish +// between a single type, so it requires nested invocations to +// distinguish multiple cases. + +// C99 Static array indices in function parameter declarations. Syntax such as: +// void bar(int myArray[static 10]); +// is allowed in C99 but not in C++. Define __min_size appropriately so +// headers using it can be compiled in either language. Use like this: +// void bar(int myArray[__min_size(10)]); + +// XXX: should use `#if __STDC_VERSION__ < 199901'. + +// C++11 exposes a load of C99 stuff + +// GCC 2.95 provides `__restrict' as an extension to C90 to support the +// C99-specific `restrict' type qualifier. We happen to use `__restrict' as +// a way to define the `restrict' type qualifier without disturbing older +// software that is unaware of C99 keywords. + +// GNU C version 2.96 adds explicit branch prediction so that +// the CPU back-end can hint the processor and also so that +// code blocks can be reordered such that the predicted path +// sees a more linear flow, thus improving cache behavior, etc. +// +// The following two macros provide us with a way to utilize this +// compiler feature. Use __predict_true() if you expect the expression +// to evaluate to true, and __predict_false() if you expect the +// expression to evaluate to false. +// +// A few notes about usage: +// +// * Generally, __predict_false() error condition checks (unless +// you have some _strong_ reason to do otherwise, in which case +// document it), and/or __predict_true() `no-error' condition +// checks, assuming you want to optimize for the no-error case. +// +// * Other than that, if you don't know the likelihood of a test +// succeeding from empirical or other `hard' evidence, don't +// make predictions. +// +// * These are meant to be used in places that are run `a lot'. +// It is wasteful to make predictions in code that is run +// seldomly (e.g. at subsystem initialization time) as the +// basic block reordering that this affects can often generate +// larger code. + +// We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h> +// require it. + +// Given the pointer x to the member m of the struct s, return +// a pointer to the containing structure. When using GCC, we first +// assign pointer x to a local variable, to check that its type is +// compatible with member m. + +// Compiler-dependent macros to declare that functions take printf-like +// or scanf-like arguments. They are null except for versions of gcc +// that are known to support the features properly (old versions of gcc-2 +// didn't permit keeping the keywords out of the application namespace). + +// Compiler-dependent macros that rely on FreeBSD-specific extensions. + +// Embed the rcs id of a source file in the resulting library. Note that in +// more recent ELF binutils, we use .ident allowing the ID to be stripped. +// Usage: +// __FBSDID("$FreeBSD$"); + +// - +// The following definitions are an extension of the behavior originally +// implemented in <sys/_posix.h>, but with a different level of granularity. +// POSIX.1 requires that the macros we test be defined before any standard +// header file is included. +// +// Here's a quick run-down of the versions: +// defined(_POSIX_SOURCE) 1003.1-1988 +// _POSIX_C_SOURCE == 1 1003.1-1990 +// _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option +// _POSIX_C_SOURCE == 199309 1003.1b-1993 +// _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, +// and the omnibus ISO/IEC 9945-1: 1996 +// _POSIX_C_SOURCE == 200112 1003.1-2001 +// _POSIX_C_SOURCE == 200809 1003.1-2008 +// +// In addition, the X/Open Portability Guide, which is now the Single UNIX +// Specification, defines a feature-test macro which indicates the version of +// that specification, and which subsumes _POSIX_C_SOURCE. +// +// Our macros begin with two underscores to avoid namespace screwage. + +// Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. + +// Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. + +// Deal with various X/Open Portability Guides and Single UNIX Spec. + +// Deal with all versions of POSIX. The ordering relative to the tests above is +// important. +// - +// Deal with _ANSI_SOURCE: +// If it is defined, and no other compilation environment is explicitly +// requested, then define our internal feature-test macros to zero. This +// makes no difference to the preprocessor (undefined symbols in preprocessing +// expressions are defined to have value zero), but makes it more convenient for +// a test program to print out the values. +// +// If a program mistakenly defines _ANSI_SOURCE and some other macro such as +// _POSIX_C_SOURCE, we will assume that it wants the broader compilation +// environment (and in fact we will never get here). + +// User override __EXT1_VISIBLE + +// Old versions of GCC use non-standard ARM arch symbols; acle-compat.h +// translates them to __ARM_ARCH and the modern feature symbols defined by ARM. + +// Nullability qualifiers: currently only supported by Clang. + +// Type Safety Checking +// +// Clang provides additional attributes to enable checking type safety +// properties that cannot be enforced by the C type system. + +// Lock annotations. +// +// Clang provides support for doing basic thread-safety tests at +// compile-time, by marking which locks will/should be held when +// entering/leaving a functions. +// +// Furthermore, it is also possible to annotate variables and structure +// members to enforce that they are only accessed when certain locks are +// held. + +// Structure implements a lock. + +// Function acquires an exclusive or shared lock. + +// Function attempts to acquire an exclusive or shared lock. + +// Function releases a lock. + +// Function asserts that an exclusive or shared lock is held. + +// Function requires that an exclusive or shared lock is or is not held. + +// Function should not be analyzed. + +// Function or variable should not be sanitized, i.e. by AddressSanitizer. +// GCC has the nosanitize attribute, but as a function attribute only, and +// warns on use as a variable attribute. + +// Guard variables and structure members by lock. + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1991, 1993, 1994 +// The Regents of the University of California. All rights reserved. +// (c) UNIX System Laboratories, Inc. +// All or some portions of this file are derived from material licensed +// to the University of California by American Telephone and Telegraph +// Co. or Unix System Laboratories, Inc. and are reproduced herein with +// the permission of UNIX System Laboratories, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)types.h 8.6 (Berkeley) 2/19/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// Machine type dependent parameters. +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1987, 1991 Regents of the University of California. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)endian.h 7.8 (Berkeley) 4/3/91 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-4-Clause +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// Copyright (c) 1990, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. All advertising materials mentioning features or use of this software +// must display the following acknowledgement: +// This product includes software developed by the University of +// California, Berkeley and its contributors. +// 4. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 +// From: @(#)types.h 8.3 (Berkeley) 1/5/94 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1988, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)limits.h 8.3 (Berkeley) 1/4/94 +// $FreeBSD$ + +// According to ANSI (section 2.2.4.2), the values below must be usable by +// #if preprocessing directives. Additionally, the expression must have the +// same type as would an expression that is an object of the corresponding +// type converted according to the integral promotions. The subtraction for +// INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an +// unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). + +// max value for an unsigned long long + +// Quads and longs are the same on the amd64. Ensure they stay in sync. + +// Minimum signal stack size. + +// Basic types upon which most other types are built. +type X__int8_t = int8 /* _types.h:55:22 */ +type X__uint8_t = uint8 /* _types.h:56:24 */ +type X__int16_t = int16 /* _types.h:57:17 */ +type X__uint16_t = uint16 /* _types.h:58:25 */ +type X__int32_t = int32 /* _types.h:59:15 */ +type X__uint32_t = uint32 /* _types.h:60:23 */ +type X__int64_t = int64 /* _types.h:62:16 */ +type X__uint64_t = uint64 /* _types.h:63:24 */ + +// Standard type definitions. +type X__clock_t = X__int32_t /* _types.h:75:19 */ // clock()... +type X__critical_t = X__int64_t /* _types.h:76:19 */ +type X__double_t = float64 /* _types.h:78:17 */ +type X__float_t = float32 /* _types.h:79:16 */ +type X__intfptr_t = X__int64_t /* _types.h:81:19 */ +type X__intptr_t = X__int64_t /* _types.h:82:19 */ +type X__intmax_t = X__int64_t /* _types.h:93:19 */ +type X__int_fast8_t = X__int32_t /* _types.h:94:19 */ +type X__int_fast16_t = X__int32_t /* _types.h:95:19 */ +type X__int_fast32_t = X__int32_t /* _types.h:96:19 */ +type X__int_fast64_t = X__int64_t /* _types.h:97:19 */ +type X__int_least8_t = X__int8_t /* _types.h:98:18 */ +type X__int_least16_t = X__int16_t /* _types.h:99:19 */ +type X__int_least32_t = X__int32_t /* _types.h:100:19 */ +type X__int_least64_t = X__int64_t /* _types.h:101:19 */ +type X__ptrdiff_t = X__int64_t /* _types.h:103:19 */ // ptr1 - ptr2 +type X__register_t = X__int64_t /* _types.h:104:19 */ +type X__segsz_t = X__int64_t /* _types.h:105:19 */ // segment size (in pages) +type X__size_t = X__uint64_t /* _types.h:106:20 */ // sizeof() +type X__ssize_t = X__int64_t /* _types.h:107:19 */ // byte count or error +type X__time_t = X__int64_t /* _types.h:108:19 */ // time()... +type X__uintfptr_t = X__uint64_t /* _types.h:109:20 */ +type X__uintptr_t = X__uint64_t /* _types.h:110:20 */ +type X__uintmax_t = X__uint64_t /* _types.h:121:20 */ +type X__uint_fast8_t = X__uint32_t /* _types.h:122:20 */ +type X__uint_fast16_t = X__uint32_t /* _types.h:123:20 */ +type X__uint_fast32_t = X__uint32_t /* _types.h:124:20 */ +type X__uint_fast64_t = X__uint64_t /* _types.h:125:20 */ +type X__uint_least8_t = X__uint8_t /* _types.h:126:19 */ +type X__uint_least16_t = X__uint16_t /* _types.h:127:20 */ +type X__uint_least32_t = X__uint32_t /* _types.h:128:20 */ +type X__uint_least64_t = X__uint64_t /* _types.h:129:20 */ +type X__u_register_t = X__uint64_t /* _types.h:131:20 */ +type X__vm_offset_t = X__uint64_t /* _types.h:132:20 */ +type X__vm_paddr_t = X__uint64_t /* _types.h:133:20 */ +type X__vm_size_t = X__uint64_t /* _types.h:134:20 */ +type X___wchar_t = int32 /* _types.h:141:14 */ + +// Standard type definitions. +type X__blksize_t = X__int32_t /* _types.h:40:19 */ // file block size +type X__blkcnt_t = X__int64_t /* _types.h:41:19 */ // file block count +type X__clockid_t = X__int32_t /* _types.h:42:19 */ // clock_gettime()... +type X__fflags_t = X__uint32_t /* _types.h:43:20 */ // file flags +type X__fsblkcnt_t = X__uint64_t /* _types.h:44:20 */ +type X__fsfilcnt_t = X__uint64_t /* _types.h:45:20 */ +type X__gid_t = X__uint32_t /* _types.h:46:20 */ +type X__id_t = X__int64_t /* _types.h:47:19 */ // can hold a gid_t, pid_t, or uid_t +type X__ino_t = X__uint64_t /* _types.h:48:20 */ // inode number +type X__key_t = int64 /* _types.h:49:15 */ // IPC key (for Sys V IPC) +type X__lwpid_t = X__int32_t /* _types.h:50:19 */ // Thread ID (a.k.a. LWP) +type X__mode_t = X__uint16_t /* _types.h:51:20 */ // permissions +type X__accmode_t = int32 /* _types.h:52:14 */ // access permissions +type X__nl_item = int32 /* _types.h:53:14 */ +type X__nlink_t = X__uint64_t /* _types.h:54:20 */ // link count +type X__off_t = X__int64_t /* _types.h:55:19 */ // file offset +type X__off64_t = X__int64_t /* _types.h:56:19 */ // file offset (alias) +type X__pid_t = X__int32_t /* _types.h:57:19 */ // process [group] +type X__rlim_t = X__int64_t /* _types.h:58:19 */ // resource limit - intentionally +// signed, because of legacy code +// that uses -1 for RLIM_INFINITY +type X__sa_family_t = X__uint8_t /* _types.h:61:19 */ +type X__socklen_t = X__uint32_t /* _types.h:62:20 */ +type X__suseconds_t = int64 /* _types.h:63:15 */ // microseconds (signed) +type X__timer_t = uintptr /* _types.h:64:24 */ // timer_gettime()... +type X__mqd_t = uintptr /* _types.h:65:21 */ // mq_open()... +type X__uid_t = X__uint32_t /* _types.h:66:20 */ +type X__useconds_t = uint32 /* _types.h:67:22 */ // microseconds (unsigned) +type X__cpuwhich_t = int32 /* _types.h:68:14 */ // which parameter for cpuset. +type X__cpulevel_t = int32 /* _types.h:69:14 */ // level parameter for cpuset. +type X__cpusetid_t = int32 /* _types.h:70:14 */ // cpuset identifier. +type X__daddr_t = X__int64_t /* _types.h:71:19 */ // bwrite(3), FIOBMAP2, etc + +// Unusual type definitions. +// rune_t is declared to be an ``int'' instead of the more natural +// ``unsigned long'' or ``long''. Two things are happening here. It is not +// unsigned so that EOF (-1) can be naturally assigned to it and used. Also, +// it looks like 10646 will be a 31 bit standard. This means that if your +// ints cannot hold 32 bits, you will be in trouble. The reason an int was +// chosen over a long is that the is*() and to*() routines take ints (says +// ANSI C), but they use __ct_rune_t instead of int. +// +// NOTE: rune_t is not covered by ANSI nor other standards, and should not +// be instantiated outside of lib/libc/locale. Use wchar_t. wint_t and +// rune_t must be the same type. Also, wint_t should be able to hold all +// members of the largest character set plus one extra value (WEOF), and +// must be at least 16 bits. +type X__ct_rune_t = int32 /* _types.h:91:14 */ // arg type for ctype funcs +type X__rune_t = X__ct_rune_t /* _types.h:92:21 */ // rune_t (see above) +type X__wint_t = X__ct_rune_t /* _types.h:93:21 */ // wint_t (see above) + +// Clang already provides these types as built-ins, but only in C++ mode. +type X__char16_t = X__uint_least16_t /* _types.h:97:26 */ +type X__char32_t = X__uint_least32_t /* _types.h:98:26 */ +// In C++11, char16_t and char32_t are built-in types. + +type X__max_align_t = struct { + F__max_align1 int64 + F__max_align2 float64 +} /* _types.h:111:3 */ + +type X__dev_t = X__uint64_t /* _types.h:113:20 */ // device number + +type X__fixpt_t = X__uint32_t /* _types.h:115:20 */ // fixed point number + +// mbstate_t is an opaque object to keep conversion state during multibyte +// stream conversions. +type X__mbstate_t = struct { + _ [0]uint64 + F__mbstate8 [128]int8 +} /* _types.h:124:3 */ + +type X__rman_res_t = X__uintmax_t /* _types.h:126:25 */ + +// Types for varargs. These are all provided by builtin types these +// days, so centralize their definition. +type X__va_list = X__builtin_va_list /* _types.h:133:27 */ // internally known to gcc +type X__gnuc_va_list = X__va_list /* _types.h:140:20 */ +type Pthread_once = struct { + Fstate int32 + _ [4]byte + Fmutex Pthread_mutex_t +} /* _pthreadtypes.h:52:1 */ + +// Primitive system data type definitions required by P1003.1c. +// +// Note that P1003.1c specifies that there are no defined comparison +// or assignment operators for the types pthread_attr_t, pthread_cond_t, +// pthread_condattr_t, pthread_mutex_t, pthread_mutexattr_t. +type Pthread_t = uintptr /* _pthreadtypes.h:67:26 */ +type Pthread_attr_t = uintptr /* _pthreadtypes.h:70:30 */ +type Pthread_mutex_t = uintptr /* _pthreadtypes.h:71:31 */ +type Pthread_mutexattr_t = uintptr /* _pthreadtypes.h:72:35 */ +type Pthread_cond_t = uintptr /* _pthreadtypes.h:73:30 */ +type Pthread_condattr_t = uintptr /* _pthreadtypes.h:74:34 */ +type Pthread_key_t = int32 /* _pthreadtypes.h:75:20 */ +type Pthread_once_t = Pthread_once /* _pthreadtypes.h:76:30 */ +type Pthread_rwlock_t = uintptr /* _pthreadtypes.h:77:32 */ +type Pthread_rwlockattr_t = uintptr /* _pthreadtypes.h:78:35 */ +type Pthread_barrier_t = uintptr /* _pthreadtypes.h:79:33 */ +type Pthread_barrierattr_t = uintptr /* _pthreadtypes.h:80:36 */ +type Pthread_spinlock_t = uintptr /* _pthreadtypes.h:81:33 */ + +// Additional type definitions: +// +// Note that P1003.1c reserves the prefixes pthread_ and PTHREAD_ for +// use in header symbols. +type Pthread_addr_t = uintptr /* _pthreadtypes.h:89:14 */ +type Pthread_startroutine_t = uintptr /* _pthreadtypes.h:90:14 */ + +type U_char = uint8 /* types.h:52:23 */ +type U_short = uint16 /* types.h:53:24 */ +type U_int = uint32 /* types.h:54:22 */ +type U_long = uint64 /* types.h:55:23 */ +type Ushort = uint16 /* types.h:57:24 */ // Sys V compatibility +type Uint = uint32 /* types.h:58:22 */ // Sys V compatibility + +// XXX POSIX sized integrals that should appear only in <sys/stdint.h>. +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2011 David E. O'Brien <obrien@FreeBSD.org> +// Copyright (c) 2001 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +type Int8_t = X__int8_t /* _stdint.h:36:19 */ + +type Int16_t = X__int16_t /* _stdint.h:41:20 */ + +type Int32_t = X__int32_t /* _stdint.h:46:20 */ + +type Int64_t = X__int64_t /* _stdint.h:51:20 */ + +type Uint8_t = X__uint8_t /* _stdint.h:56:20 */ + +type Uint16_t = X__uint16_t /* _stdint.h:61:21 */ + +type Uint32_t = X__uint32_t /* _stdint.h:66:21 */ + +type Uint64_t = X__uint64_t /* _stdint.h:71:21 */ + +type Intptr_t = X__intptr_t /* _stdint.h:76:21 */ +type Uintptr_t = X__uintptr_t /* _stdint.h:80:22 */ +type Intmax_t = X__intmax_t /* _stdint.h:84:21 */ +type Uintmax_t = X__uintmax_t /* _stdint.h:88:22 */ + +type U_int8_t = X__uint8_t /* types.h:67:19 */ // unsigned integrals (deprecated) +type U_int16_t = X__uint16_t /* types.h:68:20 */ +type U_int32_t = X__uint32_t /* types.h:69:20 */ +type U_int64_t = X__uint64_t /* types.h:70:20 */ + +type U_quad_t = X__uint64_t /* types.h:72:20 */ // quads (deprecated) +type Quad_t = X__int64_t /* types.h:73:19 */ +type Qaddr_t = uintptr /* types.h:74:16 */ + +type Caddr_t = uintptr /* types.h:76:14 */ // core address +type C_caddr_t = uintptr /* types.h:77:20 */ // core address, pointer to const + +type Blksize_t = X__blksize_t /* types.h:80:21 */ + +type Cpuwhich_t = X__cpuwhich_t /* types.h:84:22 */ +type Cpulevel_t = X__cpulevel_t /* types.h:85:22 */ +type Cpusetid_t = X__cpusetid_t /* types.h:86:22 */ + +type Blkcnt_t = X__blkcnt_t /* types.h:89:20 */ + +type Clock_t = X__clock_t /* types.h:94:19 */ + +type Clockid_t = X__clockid_t /* types.h:99:21 */ + +type Critical_t = X__critical_t /* types.h:103:22 */ // Critical section value +type Daddr_t = X__daddr_t /* types.h:104:19 */ // disk address + +type Dev_t = X__dev_t /* types.h:107:18 */ // device number or struct cdev + +type Fflags_t = X__fflags_t /* types.h:112:20 */ // file flags + +type Fixpt_t = X__fixpt_t /* types.h:116:19 */ // fixed point number + +type Fsblkcnt_t = X__fsblkcnt_t /* types.h:119:22 */ +type Fsfilcnt_t = X__fsfilcnt_t /* types.h:120:22 */ + +type Gid_t = X__gid_t /* types.h:125:18 */ // group id + +type In_addr_t = X__uint32_t /* types.h:130:20 */ // base type for internet address + +type In_port_t = X__uint16_t /* types.h:135:20 */ + +type Id_t = X__id_t /* types.h:140:17 */ // can hold a uid_t or pid_t + +type Ino_t = X__ino_t /* types.h:145:18 */ // inode number + +type Key_t = X__key_t /* types.h:150:18 */ // IPC key (for Sys V IPC) + +type Lwpid_t = X__lwpid_t /* types.h:155:19 */ // Thread ID (a.k.a. LWP) + +type Mode_t = X__mode_t /* types.h:160:18 */ // permissions + +type Accmode_t = X__accmode_t /* types.h:165:21 */ // access permissions + +type Nlink_t = X__nlink_t /* types.h:170:19 */ // link count + +type Off_t = X__off_t /* types.h:175:18 */ // file offset + +type Off64_t = X__off64_t /* types.h:180:19 */ // file offset (alias) + +type Pid_t = X__pid_t /* types.h:185:18 */ // process id + +type Register_t = X__register_t /* types.h:189:22 */ + +type Rlim_t = X__rlim_t /* types.h:192:18 */ // resource limit + +type Sbintime_t = X__int64_t /* types.h:196:19 */ + +type Segsz_t = X__segsz_t /* types.h:198:19 */ + +type Ssize_t = X__ssize_t /* types.h:206:19 */ + +type Suseconds_t = X__suseconds_t /* types.h:211:23 */ // microseconds (signed) + +type Time_t = X__time_t /* types.h:216:18 */ + +type Timer_t = X__timer_t /* types.h:221:19 */ + +type Mqd_t = X__mqd_t /* types.h:226:17 */ + +type U_register_t = X__u_register_t /* types.h:230:24 */ + +type Uid_t = X__uid_t /* types.h:233:18 */ // user id + +type Useconds_t = X__useconds_t /* types.h:238:22 */ // microseconds (unsigned) + +type Cap_ioctl_t = uint64 /* types.h:244:23 */ + +// Types suitable for exporting physical addresses, virtual addresses +// (pointers), and memory object sizes from the kernel independent of native +// word size. These should be used in place of vm_paddr_t, (u)intptr_t, and +// size_t in structs which contain such types that are shared with userspace. +type Kpaddr_t = X__uint64_t /* types.h:260:20 */ +type Kvaddr_t = X__uint64_t /* types.h:261:20 */ +type Ksize_t = X__uint64_t /* types.h:262:20 */ +type Kssize_t = X__int64_t /* types.h:263:19 */ + +type Vm_offset_t = X__vm_offset_t /* types.h:265:23 */ +type Vm_ooffset_t = X__uint64_t /* types.h:266:20 */ +type Vm_paddr_t = X__vm_paddr_t /* types.h:267:22 */ +type Vm_pindex_t = X__uint64_t /* types.h:268:20 */ +type Vm_size_t = X__vm_size_t /* types.h:269:21 */ + +type Rman_res_t = X__rman_res_t /* types.h:271:25 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1992, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1989, 1991, 1993 +// The Regents of the University of California. All rights reserved. +// (c) UNIX System Laboratories, Inc. +// All or some portions of this file are derived from material licensed +// to the University of California by American Telephone and Telegraph +// Co. or Unix System Laboratories, Inc. and are reproduced herein with +// the permission of UNIX System Laboratories, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)signal.h 8.4 (Berkeley) 5/4/95 +// $FreeBSD$ + +// sigset_t macros. + +type X__sigset = struct{ F__bits [4]X__uint32_t } /* _sigset.h:53:9 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1992, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1989, 1991, 1993 +// The Regents of the University of California. All rights reserved. +// (c) UNIX System Laboratories, Inc. +// All or some portions of this file are derived from material licensed +// to the University of California by American Telephone and Telegraph +// Co. or Unix System Laboratories, Inc. and are reproduced herein with +// the permission of UNIX System Laboratories, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)signal.h 8.4 (Berkeley) 5/4/95 +// $FreeBSD$ + +// sigset_t macros. + +type X__sigset_t = X__sigset /* _sigset.h:55:3 */ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// Structure returned by gettimeofday(2) system call, and used in other calls. +type Timeval = struct { + Ftv_sec Time_t + Ftv_usec Suseconds_t +} /* _timeval.h:49:1 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)time.h 8.5 (Berkeley) 5/4/95 +// from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1982, 1986, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)time.h 8.5 (Berkeley) 5/4/95 +// from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +type Timespec = struct { + Ftv_sec Time_t + Ftv_nsec int64 +} /* _timespec.h:46:1 */ + +// Structure defined by POSIX.1b to be like a itimerval, but with +// timespecs. Used in the timer_*() system calls. +type Itimerspec = struct { + Fit_interval struct { + Ftv_sec Time_t + Ftv_nsec int64 + } + Fit_value struct { + Ftv_sec Time_t + Ftv_nsec int64 + } +} /* timespec.h:60:1 */ + +type X__fd_mask = uint64 /* select.h:44:23 */ +type Fd_mask = X__fd_mask /* select.h:46:19 */ + +type Sigset_t = X__sigset_t /* select.h:51:20 */ + +// Select uses bit masks of file descriptors in longs. These macros +// manipulate such bit fields (the filesystem macros use chars). +// FD_SETSIZE may be defined by the user, but the default here should +// be enough for most uses. + +type Fd_set1 = struct{ F__fds_bits [16]X__fd_mask } /* select.h:73:9 */ + +// Select uses bit masks of file descriptors in longs. These macros +// manipulate such bit fields (the filesystem macros use chars). +// FD_SETSIZE may be defined by the user, but the default here should +// be enough for most uses. + +type Fd_set = Fd_set1 /* select.h:75:3 */ // select(2) + +type Crypt_data = struct { + Finitialized int32 + F__buf [256]int8 +} /* unistd.h:489:1 */ + +// getopt(3) external variable + +var _ int8 /* gen.c:2:13: */ diff --git a/vendor/modernc.org/libc/utime/capi_freebsd_amd64.go b/vendor/modernc.org/libc/utime/capi_freebsd_amd64.go new file mode 100644 index 000000000..88dc9f354 --- /dev/null +++ b/vendor/modernc.org/libc/utime/capi_freebsd_amd64.go @@ -0,0 +1,5 @@ +// Code generated by 'ccgo utime/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 utime/utime_freebsd_amd64.go -pkgname utime', DO NOT EDIT. + +package utime + +var CAPI = map[string]struct{}{} diff --git a/vendor/modernc.org/libc/utime/utime_freebsd_amd64.go b/vendor/modernc.org/libc/utime/utime_freebsd_amd64.go new file mode 100644 index 000000000..46ba2616c --- /dev/null +++ b/vendor/modernc.org/libc/utime/utime_freebsd_amd64.go @@ -0,0 +1,603 @@ +// Code generated by 'ccgo utime/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 utime/utime_freebsd_amd64.go -pkgname utime', DO NOT EDIT. + +package utime + +import ( + "math" + "reflect" + "sync/atomic" + "unsafe" +) + +var _ = math.Pi +var _ reflect.Kind +var _ atomic.Value +var _ unsafe.Pointer + +const ( + X_FILE_OFFSET_BITS = 64 + X_LP64 = 1 + X_MACHINE__LIMITS_H_ = 0 + X_MACHINE__TYPES_H_ = 0 + X_Nonnull = 0 + X_Null_unspecified = 0 + X_Nullable = 0 + X_SYS_CDEFS_H_ = 0 + X_SYS__TYPES_H_ = 0 + X_TIME_T_DECLARED = 0 + X_UTIME_H_ = 0 + Unix = 1 +) + +type Ptrdiff_t = int64 /* <builtin>:3:26 */ + +type Size_t = uint64 /* <builtin>:9:23 */ + +type Wchar_t = int32 /* <builtin>:15:24 */ + +type X__int128_t = struct { + Flo int64 + Fhi int64 +} /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128 +type X__uint128_t = struct { + Flo uint64 + Fhi uint64 +} /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128 + +type X__builtin_va_list = uintptr /* <builtin>:46:14 */ +type X__float128 = float64 /* <builtin>:47:21 */ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1990, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)utime.h 8.1 (Berkeley) 6/2/93 +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// Testing against Clang-specific extensions. + +// This code has been put in place to help reduce the addition of +// compiler specific defines in FreeBSD code. It helps to aid in +// having a compiler-agnostic source tree. + +// Compiler memory barriers, specific to gcc and clang. + +// XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced + +// Macro to test if we're using a specific version of gcc or later. + +// The __CONCAT macro is used to concatenate parts of symbol names, e.g. +// with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. +// The __CONCAT macro is a bit tricky to use if it must work in non-ANSI +// mode -- there must be no spaces between its arguments, and for nested +// __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also +// concatenate double-quoted strings produced by the __STRING macro, but +// this only works with ANSI C. +// +// __XSTRING is like __STRING, but it expands any macros in its argument +// first. It is only available with ANSI C. + +// Compiler-dependent macros to help declare dead (non-returning) and +// pure (no side effects) functions, and unused variables. They are +// null except for versions of gcc that are known to support the features +// properly (old versions of gcc-2 supported the dead and pure features +// in a different (wrong) way). If we do not provide an implementation +// for a given compiler, let the compile fail if it is told to use +// a feature that we cannot live without. + +// Keywords added in C11. + +// Emulation of C11 _Generic(). Unlike the previously defined C11 +// keywords, it is not possible to implement this using exactly the same +// syntax. Therefore implement something similar under the name +// __generic(). Unlike _Generic(), this macro can only distinguish +// between a single type, so it requires nested invocations to +// distinguish multiple cases. + +// C99 Static array indices in function parameter declarations. Syntax such as: +// void bar(int myArray[static 10]); +// is allowed in C99 but not in C++. Define __min_size appropriately so +// headers using it can be compiled in either language. Use like this: +// void bar(int myArray[__min_size(10)]); + +// XXX: should use `#if __STDC_VERSION__ < 199901'. + +// C++11 exposes a load of C99 stuff + +// GCC 2.95 provides `__restrict' as an extension to C90 to support the +// C99-specific `restrict' type qualifier. We happen to use `__restrict' as +// a way to define the `restrict' type qualifier without disturbing older +// software that is unaware of C99 keywords. + +// GNU C version 2.96 adds explicit branch prediction so that +// the CPU back-end can hint the processor and also so that +// code blocks can be reordered such that the predicted path +// sees a more linear flow, thus improving cache behavior, etc. +// +// The following two macros provide us with a way to utilize this +// compiler feature. Use __predict_true() if you expect the expression +// to evaluate to true, and __predict_false() if you expect the +// expression to evaluate to false. +// +// A few notes about usage: +// +// * Generally, __predict_false() error condition checks (unless +// you have some _strong_ reason to do otherwise, in which case +// document it), and/or __predict_true() `no-error' condition +// checks, assuming you want to optimize for the no-error case. +// +// * Other than that, if you don't know the likelihood of a test +// succeeding from empirical or other `hard' evidence, don't +// make predictions. +// +// * These are meant to be used in places that are run `a lot'. +// It is wasteful to make predictions in code that is run +// seldomly (e.g. at subsystem initialization time) as the +// basic block reordering that this affects can often generate +// larger code. + +// We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h> +// require it. + +// Given the pointer x to the member m of the struct s, return +// a pointer to the containing structure. When using GCC, we first +// assign pointer x to a local variable, to check that its type is +// compatible with member m. + +// Compiler-dependent macros to declare that functions take printf-like +// or scanf-like arguments. They are null except for versions of gcc +// that are known to support the features properly (old versions of gcc-2 +// didn't permit keeping the keywords out of the application namespace). + +// Compiler-dependent macros that rely on FreeBSD-specific extensions. + +// Embed the rcs id of a source file in the resulting library. Note that in +// more recent ELF binutils, we use .ident allowing the ID to be stripped. +// Usage: +// __FBSDID("$FreeBSD$"); + +// - +// The following definitions are an extension of the behavior originally +// implemented in <sys/_posix.h>, but with a different level of granularity. +// POSIX.1 requires that the macros we test be defined before any standard +// header file is included. +// +// Here's a quick run-down of the versions: +// defined(_POSIX_SOURCE) 1003.1-1988 +// _POSIX_C_SOURCE == 1 1003.1-1990 +// _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option +// _POSIX_C_SOURCE == 199309 1003.1b-1993 +// _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, +// and the omnibus ISO/IEC 9945-1: 1996 +// _POSIX_C_SOURCE == 200112 1003.1-2001 +// _POSIX_C_SOURCE == 200809 1003.1-2008 +// +// In addition, the X/Open Portability Guide, which is now the Single UNIX +// Specification, defines a feature-test macro which indicates the version of +// that specification, and which subsumes _POSIX_C_SOURCE. +// +// Our macros begin with two underscores to avoid namespace screwage. + +// Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. + +// Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. + +// Deal with various X/Open Portability Guides and Single UNIX Spec. + +// Deal with all versions of POSIX. The ordering relative to the tests above is +// important. +// - +// Deal with _ANSI_SOURCE: +// If it is defined, and no other compilation environment is explicitly +// requested, then define our internal feature-test macros to zero. This +// makes no difference to the preprocessor (undefined symbols in preprocessing +// expressions are defined to have value zero), but makes it more convenient for +// a test program to print out the values. +// +// If a program mistakenly defines _ANSI_SOURCE and some other macro such as +// _POSIX_C_SOURCE, we will assume that it wants the broader compilation +// environment (and in fact we will never get here). + +// User override __EXT1_VISIBLE + +// Old versions of GCC use non-standard ARM arch symbols; acle-compat.h +// translates them to __ARM_ARCH and the modern feature symbols defined by ARM. + +// Nullability qualifiers: currently only supported by Clang. + +// Type Safety Checking +// +// Clang provides additional attributes to enable checking type safety +// properties that cannot be enforced by the C type system. + +// Lock annotations. +// +// Clang provides support for doing basic thread-safety tests at +// compile-time, by marking which locks will/should be held when +// entering/leaving a functions. +// +// Furthermore, it is also possible to annotate variables and structure +// members to enforce that they are only accessed when certain locks are +// held. + +// Structure implements a lock. + +// Function acquires an exclusive or shared lock. + +// Function attempts to acquire an exclusive or shared lock. + +// Function releases a lock. + +// Function asserts that an exclusive or shared lock is held. + +// Function requires that an exclusive or shared lock is or is not held. + +// Function should not be analyzed. + +// Function or variable should not be sanitized, i.e. by AddressSanitizer. +// GCC has the nosanitize attribute, but as a function attribute only, and +// warns on use as a variable attribute. + +// Guard variables and structure members by lock. + +// - +// SPDX-License-Identifier: BSD-2-Clause-FreeBSD +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-4-Clause +// +// Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org> +// Copyright (c) 1990, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. All advertising materials mentioning features or use of this software +// must display the following acknowledgement: +// This product includes software developed by the University of +// California, Berkeley and its contributors. +// 4. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 +// From: @(#)types.h 8.3 (Berkeley) 1/5/94 +// $FreeBSD$ + +// - +// This file is in the public domain. +// $FreeBSD$ + +// - +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright (c) 1988, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)limits.h 8.3 (Berkeley) 1/4/94 +// $FreeBSD$ + +// According to ANSI (section 2.2.4.2), the values below must be usable by +// #if preprocessing directives. Additionally, the expression must have the +// same type as would an expression that is an object of the corresponding +// type converted according to the integral promotions. The subtraction for +// INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an +// unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). + +// max value for an unsigned long long + +// Quads and longs are the same on the amd64. Ensure they stay in sync. + +// Minimum signal stack size. + +// Basic types upon which most other types are built. +type X__int8_t = int8 /* _types.h:55:22 */ +type X__uint8_t = uint8 /* _types.h:56:24 */ +type X__int16_t = int16 /* _types.h:57:17 */ +type X__uint16_t = uint16 /* _types.h:58:25 */ +type X__int32_t = int32 /* _types.h:59:15 */ +type X__uint32_t = uint32 /* _types.h:60:23 */ +type X__int64_t = int64 /* _types.h:62:16 */ +type X__uint64_t = uint64 /* _types.h:63:24 */ + +// Standard type definitions. +type X__clock_t = X__int32_t /* _types.h:75:19 */ // clock()... +type X__critical_t = X__int64_t /* _types.h:76:19 */ +type X__double_t = float64 /* _types.h:78:17 */ +type X__float_t = float32 /* _types.h:79:16 */ +type X__intfptr_t = X__int64_t /* _types.h:81:19 */ +type X__intptr_t = X__int64_t /* _types.h:82:19 */ +type X__intmax_t = X__int64_t /* _types.h:93:19 */ +type X__int_fast8_t = X__int32_t /* _types.h:94:19 */ +type X__int_fast16_t = X__int32_t /* _types.h:95:19 */ +type X__int_fast32_t = X__int32_t /* _types.h:96:19 */ +type X__int_fast64_t = X__int64_t /* _types.h:97:19 */ +type X__int_least8_t = X__int8_t /* _types.h:98:18 */ +type X__int_least16_t = X__int16_t /* _types.h:99:19 */ +type X__int_least32_t = X__int32_t /* _types.h:100:19 */ +type X__int_least64_t = X__int64_t /* _types.h:101:19 */ +type X__ptrdiff_t = X__int64_t /* _types.h:103:19 */ // ptr1 - ptr2 +type X__register_t = X__int64_t /* _types.h:104:19 */ +type X__segsz_t = X__int64_t /* _types.h:105:19 */ // segment size (in pages) +type X__size_t = X__uint64_t /* _types.h:106:20 */ // sizeof() +type X__ssize_t = X__int64_t /* _types.h:107:19 */ // byte count or error +type X__time_t = X__int64_t /* _types.h:108:19 */ // time()... +type X__uintfptr_t = X__uint64_t /* _types.h:109:20 */ +type X__uintptr_t = X__uint64_t /* _types.h:110:20 */ +type X__uintmax_t = X__uint64_t /* _types.h:121:20 */ +type X__uint_fast8_t = X__uint32_t /* _types.h:122:20 */ +type X__uint_fast16_t = X__uint32_t /* _types.h:123:20 */ +type X__uint_fast32_t = X__uint32_t /* _types.h:124:20 */ +type X__uint_fast64_t = X__uint64_t /* _types.h:125:20 */ +type X__uint_least8_t = X__uint8_t /* _types.h:126:19 */ +type X__uint_least16_t = X__uint16_t /* _types.h:127:20 */ +type X__uint_least32_t = X__uint32_t /* _types.h:128:20 */ +type X__uint_least64_t = X__uint64_t /* _types.h:129:20 */ +type X__u_register_t = X__uint64_t /* _types.h:131:20 */ +type X__vm_offset_t = X__uint64_t /* _types.h:132:20 */ +type X__vm_paddr_t = X__uint64_t /* _types.h:133:20 */ +type X__vm_size_t = X__uint64_t /* _types.h:134:20 */ +type X___wchar_t = int32 /* _types.h:141:14 */ + +// Standard type definitions. +type X__blksize_t = X__int32_t /* _types.h:40:19 */ // file block size +type X__blkcnt_t = X__int64_t /* _types.h:41:19 */ // file block count +type X__clockid_t = X__int32_t /* _types.h:42:19 */ // clock_gettime()... +type X__fflags_t = X__uint32_t /* _types.h:43:20 */ // file flags +type X__fsblkcnt_t = X__uint64_t /* _types.h:44:20 */ +type X__fsfilcnt_t = X__uint64_t /* _types.h:45:20 */ +type X__gid_t = X__uint32_t /* _types.h:46:20 */ +type X__id_t = X__int64_t /* _types.h:47:19 */ // can hold a gid_t, pid_t, or uid_t +type X__ino_t = X__uint64_t /* _types.h:48:20 */ // inode number +type X__key_t = int64 /* _types.h:49:15 */ // IPC key (for Sys V IPC) +type X__lwpid_t = X__int32_t /* _types.h:50:19 */ // Thread ID (a.k.a. LWP) +type X__mode_t = X__uint16_t /* _types.h:51:20 */ // permissions +type X__accmode_t = int32 /* _types.h:52:14 */ // access permissions +type X__nl_item = int32 /* _types.h:53:14 */ +type X__nlink_t = X__uint64_t /* _types.h:54:20 */ // link count +type X__off_t = X__int64_t /* _types.h:55:19 */ // file offset +type X__off64_t = X__int64_t /* _types.h:56:19 */ // file offset (alias) +type X__pid_t = X__int32_t /* _types.h:57:19 */ // process [group] +type X__rlim_t = X__int64_t /* _types.h:58:19 */ // resource limit - intentionally +// signed, because of legacy code +// that uses -1 for RLIM_INFINITY +type X__sa_family_t = X__uint8_t /* _types.h:61:19 */ +type X__socklen_t = X__uint32_t /* _types.h:62:20 */ +type X__suseconds_t = int64 /* _types.h:63:15 */ // microseconds (signed) +type X__timer_t = uintptr /* _types.h:64:24 */ // timer_gettime()... +type X__mqd_t = uintptr /* _types.h:65:21 */ // mq_open()... +type X__uid_t = X__uint32_t /* _types.h:66:20 */ +type X__useconds_t = uint32 /* _types.h:67:22 */ // microseconds (unsigned) +type X__cpuwhich_t = int32 /* _types.h:68:14 */ // which parameter for cpuset. +type X__cpulevel_t = int32 /* _types.h:69:14 */ // level parameter for cpuset. +type X__cpusetid_t = int32 /* _types.h:70:14 */ // cpuset identifier. +type X__daddr_t = X__int64_t /* _types.h:71:19 */ // bwrite(3), FIOBMAP2, etc + +// Unusual type definitions. +// rune_t is declared to be an ``int'' instead of the more natural +// ``unsigned long'' or ``long''. Two things are happening here. It is not +// unsigned so that EOF (-1) can be naturally assigned to it and used. Also, +// it looks like 10646 will be a 31 bit standard. This means that if your +// ints cannot hold 32 bits, you will be in trouble. The reason an int was +// chosen over a long is that the is*() and to*() routines take ints (says +// ANSI C), but they use __ct_rune_t instead of int. +// +// NOTE: rune_t is not covered by ANSI nor other standards, and should not +// be instantiated outside of lib/libc/locale. Use wchar_t. wint_t and +// rune_t must be the same type. Also, wint_t should be able to hold all +// members of the largest character set plus one extra value (WEOF), and +// must be at least 16 bits. +type X__ct_rune_t = int32 /* _types.h:91:14 */ // arg type for ctype funcs +type X__rune_t = X__ct_rune_t /* _types.h:92:21 */ // rune_t (see above) +type X__wint_t = X__ct_rune_t /* _types.h:93:21 */ // wint_t (see above) + +// Clang already provides these types as built-ins, but only in C++ mode. +type X__char16_t = X__uint_least16_t /* _types.h:97:26 */ +type X__char32_t = X__uint_least32_t /* _types.h:98:26 */ +// In C++11, char16_t and char32_t are built-in types. + +type X__max_align_t = struct { + F__max_align1 int64 + F__max_align2 float64 +} /* _types.h:111:3 */ + +type X__dev_t = X__uint64_t /* _types.h:113:20 */ // device number + +type X__fixpt_t = X__uint32_t /* _types.h:115:20 */ // fixed point number + +// mbstate_t is an opaque object to keep conversion state during multibyte +// stream conversions. +type X__mbstate_t = struct { + _ [0]uint64 + F__mbstate8 [128]int8 +} /* _types.h:124:3 */ + +type X__rman_res_t = X__uintmax_t /* _types.h:126:25 */ + +// Types for varargs. These are all provided by builtin types these +// days, so centralize their definition. +type X__va_list = X__builtin_va_list /* _types.h:133:27 */ // internally known to gcc +type X__gnuc_va_list = X__va_list /* _types.h:140:20 */ // compatibility w/GNU headers + +// When the following macro is defined, the system uses 64-bit inode numbers. +// Programs can use this to avoid including <sys/param.h>, with its associated +// namespace pollution. + +type Time_t = X__time_t /* utime.h:42:18 */ + +type Utimbuf = struct { + Factime Time_t + Fmodtime Time_t +} /* utime.h:46:1 */ + +var _ int8 /* gen.c:2:13: */ |