Skip to content

Instantly share code, notes, and snippets.

@arichardson
Created November 16, 2016 15:51
Show Gist options
  • Save arichardson/4ea715ca1e4a0b8de81371cc8c196cf1 to your computer and use it in GitHub Desktop.
Save arichardson/4ea715ca1e4a0b8de81371cc8c196cf1 to your computer and use it in GitHub Desktop.
/tmp/xlocale-1d9a31.c
# 1 "<built-in>"
# 1 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale.c"
/*-
* Copyright (c) 2011 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$
*/
#if 0 /* expanded by -frewrite-includes */
#include <pthread.h>
#endif /* expanded by -frewrite-includes */
# 32 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale.c"
# 1 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/pthread.h" 1
/*
* Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu
* Copyright (c) 1995-1998 by John Birrell <jb@cimlogic.com.au>
* 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 Chris Provenzano.
* 4. The name of Chris Provenzano may not be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``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 CHRIS PROVENZANO 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$
*/
#ifndef _PTHREAD_H_
#define _PTHREAD_H_
/*
* Header files.
*/
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 41 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/pthread.h"
# 1 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 1 3 4
/*-
* 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.
* 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.
*
* @(#)cdefs.h 8.8 (Berkeley) 1/9/95
* $FreeBSD$
*/
#ifndef _SYS_CDEFS_H_
#define _SYS_CDEFS_H_
/*
* Testing against Clang-specific extensions.
*/
#ifndef __has_attribute
#define __has_attribute(x) 0
#endif
# 45 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifndef __has_extension
#define __has_extension __has_feature
#endif
# 48 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifndef __has_feature
#define __has_feature(x) 0
#endif
# 51 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifndef __has_include
#define __has_include(x) 0
#endif
# 54 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifndef __has_builtin
#define __has_builtin(x) 0
#endif
# 57 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if defined(__cplusplus)
#define __BEGIN_DECLS extern "C" {
#define __END_DECLS }
#else
# 62 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __BEGIN_DECLS
#define __END_DECLS
#endif
# 65 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* 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.
*/
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
#if __GNUC__ >= 3 || defined(__INTEL_COMPILER)
#define __GNUCLIKE_ASM 3
#define __GNUCLIKE_MATH_BUILTIN_CONSTANTS
#else
# 78 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __GNUCLIKE_ASM 2
#endif
# 80 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __GNUCLIKE___TYPEOF 1
#define __GNUCLIKE___OFFSETOF 1
#define __GNUCLIKE___SECTION 1
#ifndef __INTEL_COMPILER
#define __GNUCLIKE_CTOR_SECTION_HANDLING 1
#endif
# 87 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __GNUCLIKE_BUILTIN_CONSTANT_P 1
#if defined(__INTEL_COMPILER) && defined(__cplusplus) && \
__INTEL_COMPILER < 800
#undef __GNUCLIKE_BUILTIN_CONSTANT_P
#endif
# 93 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if (__GNUC_MINOR__ > 95 || __GNUC__ >= 3)
#define __GNUCLIKE_BUILTIN_VARARGS 1
#define __GNUCLIKE_BUILTIN_STDARG 1
#define __GNUCLIKE_BUILTIN_VAALIST 1
#endif
# 99 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if defined(__GNUC__)
#define __GNUC_VA_LIST_COMPATIBILITY 1
#endif
# 103 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* Compiler memory barriers, specific to gcc and clang.
*/
#if defined(__GNUC__)
#define __compiler_membar() __asm __volatile(" " : : : "memory")
#endif
# 110 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifndef __INTEL_COMPILER
#define __GNUCLIKE_BUILTIN_NEXT_ARG 1
#define __GNUCLIKE_MATH_BUILTIN_RELOPS
#endif
# 115 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __GNUCLIKE_BUILTIN_MEMCPY 1
/* XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced */
#define __CC_SUPPORTS_INLINE 1
#define __CC_SUPPORTS___INLINE 1
#define __CC_SUPPORTS___INLINE__ 1
#define __CC_SUPPORTS___FUNC__ 1
#define __CC_SUPPORTS_WARNING 1
#define __CC_SUPPORTS_VARADIC_XXX 1 /* see varargs.h */
#define __CC_SUPPORTS_DYNAMIC_ARRAY_INIT 1
#endif /* __GNUC__ || __INTEL_COMPILER */
# 131 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* Macro to test if we're using a specific version of gcc or later.
*/
#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
#define __GNUC_PREREQ__(ma, mi) \
(__GNUC__ > (ma) || __GNUC__ == (ma) && __GNUC_MINOR__ >= (mi))
#else
# 139 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __GNUC_PREREQ__(ma, mi) 0
#endif
# 141 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* 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.
*/
#if defined(__STDC__) || defined(__cplusplus)
#define __P(protos) protos /* full-blown ANSI C */
#define __CONCAT1(x,y) x ## y
#define __CONCAT(x,y) __CONCAT1(x,y)
#define __STRING(x) #x /* stringify without expanding x */
#define __XSTRING(x) __STRING(x) /* expand x, then stringify */
#define __const const /* define reserved names to standard */
#define __signed signed
#define __volatile volatile
#if defined(__cplusplus)
#define __inline inline /* convert to C++ keyword */
#else
# 167 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if !(defined(__CC_SUPPORTS___INLINE))
#define __inline /* delete GCC keyword */
#endif /* ! __CC_SUPPORTS___INLINE */
# 170 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif /* !__cplusplus */
# 171 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#else /* !(__STDC__ || __cplusplus) */
# 173 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __P(protos) () /* traditional C preprocessor */
#define __CONCAT(x,y) x/**/y
#define __STRING(x) "x"
#if !defined(__CC_SUPPORTS___INLINE)
#define __const /* delete pseudo-ANSI C keywords */
#define __inline
#define __signed
#define __volatile
/*
* In non-ANSI C environments, new programs will want ANSI-only C keywords
* deleted from the program and old programs will want them left alone.
* When using a compiler other than gcc, programs using the ANSI C keywords
* const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS.
* When using "gcc -traditional", we assume that this is the intent; if
* __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone.
*/
#ifndef NO_ANSI_KEYWORDS
#define const /* delete ANSI C keywords */
#define inline
#define signed
#define volatile
#endif /* !NO_ANSI_KEYWORDS */
# 196 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif /* !__CC_SUPPORTS___INLINE */
# 197 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif /* !(__STDC__ || __cplusplus) */
# 198 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* 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.
*/
#ifdef lint
#define __dead2
#define __pure2
#define __unused
#define __packed
#define __aligned(x)
#define __alloc_align(x)
#define __alloc_size(x)
#define __section(x)
#define __weak_symbol
#else
# 219 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __weak_symbol __attribute__((__weak__))
#if !__GNUC_PREREQ__(2, 5) && !defined(__INTEL_COMPILER)
#define __dead2
#define __pure2
#define __unused
#endif
# 225 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7 && !defined(__INTEL_COMPILER)
#define __dead2 __attribute__((__noreturn__))
#define __pure2 __attribute__((__const__))
#define __unused
/* XXX Find out what to do for __packed, __aligned and __section */
#endif
# 231 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if __GNUC_PREREQ__(2, 7) || defined(__INTEL_COMPILER)
#define __dead2 __attribute__((__noreturn__))
#define __pure2 __attribute__((__const__))
#define __unused __attribute__((__unused__))
#define __used __attribute__((__used__))
#define __packed __attribute__((__packed__))
#define __aligned(x) __attribute__((__aligned__(x)))
#define __section(x) __attribute__((__section__(x)))
#endif
# 240 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if __GNUC_PREREQ__(4, 3) || __has_attribute(__alloc_size__)
#define __alloc_size(x) __attribute__((__alloc_size__(x)))
#else
# 243 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __alloc_size(x)
#endif
# 245 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if __GNUC_PREREQ__(4, 9) || __has_attribute(__alloc_align__)
#define __alloc_align(x) __attribute__((__alloc_align__(x)))
#else
# 248 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __alloc_align(x)
#endif
# 250 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif /* lint */
# 251 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if !__GNUC_PREREQ__(2, 95)
#define __alignof(x) __offsetof(struct { char __a; x __b; }, __b)
#endif
# 255 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* Keywords added in C11.
*/
#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L || defined(lint)
#if !__has_extension(c_alignas)
#if (defined(__cplusplus) && __cplusplus >= 201103L) || \
__has_extension(cxx_alignas)
#define _Alignas(x) alignas(x)
#else
# 267 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/* XXX: Only emulates _Alignas(constant-expression); not _Alignas(type-name). */
#define _Alignas(x) __aligned(x)
#endif
# 270 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 271 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if defined(__cplusplus) && __cplusplus >= 201103L
#define _Alignof(x) alignof(x)
#else
# 275 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define _Alignof(x) __alignof(x)
#endif
# 277 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if !defined(__cplusplus) && !__has_extension(c_atomic) && \
!__has_extension(cxx_atomic)
/*
* No native support for _Atomic(). Place object in structure to prevent
* most forms of direct non-atomic access.
*/
#define _Atomic(T) struct { T volatile __val; }
#endif
# 286 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if defined(__cplusplus) && __cplusplus >= 201103L
#define _Noreturn [[noreturn]]
#else
# 290 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define _Noreturn __dead2
#endif
# 292 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if !__has_extension(c_static_assert)
#if (defined(__cplusplus) && __cplusplus >= 201103L) || \
__has_extension(cxx_static_assert)
#define _Static_assert(x, y) static_assert(x, y)
#elif __GNUC_PREREQ__(4,6)
# 298 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/* Nothing, gcc 4.6 and higher has _Static_assert built-in */
#elif defined(__COUNTER__)
# 300 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define _Static_assert(x, y) __Static_assert(x, __COUNTER__)
#define __Static_assert(x, y) ___Static_assert(x, y)
#define ___Static_assert(x, y) typedef char __assert_ ## y[(x) ? 1 : -1] \
__unused
#else
# 305 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define _Static_assert(x, y) struct __hack
#endif
# 307 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 308 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if !__has_extension(c_thread_local)
/*
* XXX: Some compilers (Clang 3.3, GCC 4.7) falsely announce C++11 mode
* without actually supporting the thread_local keyword. Don't check for
* the presence of C++11 when defining _Thread_local.
*/
#if /* (defined(__cplusplus) && __cplusplus >= 201103L) || */ \
__has_extension(cxx_thread_local)
#define _Thread_local thread_local
#else
# 319 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define _Thread_local __thread
#endif
# 321 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 322 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif /* __STDC_VERSION__ || __STDC_VERSION__ < 201112L */
# 324 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* 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.
*/
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \
__has_extension(c_generic_selections)
#define __generic(expr, t, yes, no) \
_Generic(expr, t: yes, default: no)
#elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus)
# 339 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __generic(expr, t, yes, no) \
__builtin_choose_expr( \
__builtin_types_compatible_p(__typeof(expr), t), yes, no)
#endif
# 343 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* 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)]);
*/
#if !defined(__cplusplus) && \
(!defined(__STDC_VERSION) || (__STDC_VERSION__ >= 199901))
#define __min_size(x) static (x)
#else
# 355 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __min_size(x) (x)
#endif
# 357 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if __GNUC_PREREQ__(2, 96)
#define __malloc_like __attribute__((__malloc__))
#define __pure __attribute__((__pure__))
#else
# 362 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __malloc_like
#define __pure
#endif
# 365 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if __GNUC_PREREQ__(3, 1) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800)
#define __always_inline __attribute__((__always_inline__))
#else
# 369 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __always_inline
#endif
# 371 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if __GNUC_PREREQ__(3, 1)
#define __noinline __attribute__ ((__noinline__))
#else
# 375 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __noinline
#endif
# 377 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if __GNUC_PREREQ__(3, 3)
#define __nonnull(x) __attribute__((__nonnull__(x)))
#define __nonnull_all __attribute__((__nonnull__))
#else
# 382 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __nonnull(x)
#define __nonnull_all
#endif
# 385 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if __GNUC_PREREQ__(3, 4)
#define __fastcall __attribute__((__fastcall__))
#define __result_use_check __attribute__((__warn_unused_result__))
#else
# 390 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __fastcall
#define __result_use_check
#endif
# 393 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if __GNUC_PREREQ__(4, 1)
#define __returns_twice __attribute__((__returns_twice__))
#else
# 397 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __returns_twice
#endif
# 399 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if __GNUC_PREREQ__(4, 6) || __has_builtin(__builtin_unreachable)
#define __unreachable() __builtin_unreachable()
#else
# 403 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __unreachable() ((void)0)
#endif
# 405 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/* XXX: should use `#if __STDC_VERSION__ < 199901'. */
#if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER)
#define __func__ NULL
#endif
# 410 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if (defined(__INTEL_COMPILER) || (defined(__GNUC__) && __GNUC__ >= 2)) && !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901
#define __LONG_LONG_SUPPORTED
#endif
# 414 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/* C++11 exposes a load of C99 stuff */
#if defined(__cplusplus) && __cplusplus >= 201103L
#define __LONG_LONG_SUPPORTED
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS
#endif
# 421 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifndef __STDC_CONSTANT_MACROS
#define __STDC_CONSTANT_MACROS
#endif
# 424 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 425 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* 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.
*/
#if !(__GNUC__ == 2 && __GNUC_MINOR__ == 95)
#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901 || defined(lint)
#define __restrict
#else
# 436 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __restrict restrict
#endif
# 438 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 439 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* 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.
*/
#if __GNUC_PREREQ__(2, 96)
#define __predict_true(exp) __builtin_expect((exp), 1)
#define __predict_false(exp) __builtin_expect((exp), 0)
#else
# 472 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __predict_true(exp) (exp)
#define __predict_false(exp) (exp)
#endif
# 475 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if __GNUC_PREREQ__(4, 0)
#define __null_sentinel __attribute__((__sentinel__))
#define __exported __attribute__((__visibility__("default")))
#define __hidden __attribute__((__visibility__("hidden")))
#else
# 481 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __null_sentinel
#define __exported
#define __hidden
#endif
# 485 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h>
* require it.
*/
#if __GNUC_PREREQ__(4, 1)
#define __offsetof(type, field) __builtin_offsetof(type, field)
#else
# 493 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifndef __cplusplus
#define __offsetof(type, field) \
((__size_t)(__uintptr_t)((const volatile void *)&((type *)0)->field))
#else
# 497 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __offsetof(type, field) \
(__offsetof__ (reinterpret_cast <__size_t> \
(&reinterpret_cast <const volatile char &> \
(static_cast<type *> (0)->field))))
#endif
# 502 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 503 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __rangeof(type, start, end) \
(__offsetof(type, end) - __offsetof(type, start))
/*
* 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.
*/
#if __GNUC_PREREQ__(3, 1)
#define __containerof(x, s, m) ({ \
const volatile __typeof(((s *)0)->m) *__x = (x); \
__DEQUALIFY(s *, (const volatile char *)__x - __offsetof(s, m));\
})
#else
# 518 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __containerof(x, s, m) \
__DEQUALIFY(s *, (const volatile char *)(x) - __offsetof(s, m))
#endif
# 521 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* 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).
*/
#if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER)
#define __printflike(fmtarg, firstvararg)
#define __scanflike(fmtarg, firstvararg)
#define __format_arg(fmtarg)
#define __strfmonlike(fmtarg, firstvararg)
#define __strftimelike(fmtarg, firstvararg)
#else
# 535 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __printflike(fmtarg, firstvararg) \
__attribute__((__format__ (__printf__, fmtarg, firstvararg)))
#define __scanflike(fmtarg, firstvararg) \
__attribute__((__format__ (__scanf__, fmtarg, firstvararg)))
#define __format_arg(fmtarg) __attribute__((__format_arg__ (fmtarg)))
#define __strfmonlike(fmtarg, firstvararg) \
__attribute__((__format__ (__strfmon__, fmtarg, firstvararg)))
#define __strftimelike(fmtarg, firstvararg) \
__attribute__((__format__ (__strftime__, fmtarg, firstvararg)))
#endif
# 545 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* FORTIFY_SOURCE, and perhaps other compiler-specific features, require
* the use of non-standard inlining. In general we should try to avoid
* using these but GCC-compatible compilers tend to support the extensions
* well enough to use them in limited cases.
*/
#if defined(__GNUC_GNU_INLINE__) || defined(__GNUC_STDC_INLINE__)
#if __GNUC_PREREQ__(4, 3) || __has_attribute(__artificial__)
#define __gnu_inline __attribute__((__gnu_inline__, __artificial__))
#else
# 556 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __gnu_inline __attribute__((__gnu_inline__))
#endif /* artificial */
# 558 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#else
# 559 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __gnu_inline
#endif
# 561 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/* Compiler-dependent macros that rely on FreeBSD-specific extensions. */
#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 && \
defined(__GNUC__) && !defined(__INTEL_COMPILER)
#define __printf0like(fmtarg, firstvararg) \
__attribute__((__format__ (__printf0__, fmtarg, firstvararg)))
#else
# 568 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __printf0like(fmtarg, firstvararg)
#endif
# 570 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
#ifndef __INTEL_COMPILER
#define __strong_reference(sym,aliassym) \
extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym)))
#endif
# 576 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifdef __STDC__
#define __weak_reference(sym,alias) \
__asm__(".weak " #alias); \
__asm__(".equ " #alias ", " #sym)
#define __warn_references(sym,msg) \
__asm__(".section .gnu.warning." #sym); \
__asm__(".asciz \"" msg "\""); \
__asm__(".previous")
#define __sym_compat(sym,impl,verid) \
__asm__(".symver " #impl ", " #sym "@" #verid)
#define __sym_default(sym,impl,verid) \
__asm__(".symver " #impl ", " #sym "@@" #verid)
#else
# 589 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __weak_reference(sym,alias) \
__asm__(".weak alias"); \
__asm__(".equ alias, sym")
#define __warn_references(sym,msg) \
__asm__(".section .gnu.warning.sym"); \
__asm__(".asciz \"msg\""); \
__asm__(".previous")
#define __sym_compat(sym,impl,verid) \
__asm__(".symver impl, sym@verid")
#define __sym_default(impl,sym,verid) \
__asm__(".symver impl, sym@@verid")
#endif /* __STDC__ */
# 601 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif /* __GNUC__ || __INTEL_COMPILER */
# 602 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __GLOBL1(sym) __asm__(".globl " #sym)
#define __GLOBL(sym) __GLOBL1(sym)
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
#define __IDSTRING(name,string) __asm__(".ident\t\"" string "\"")
#else
# 609 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* The following definition might not work well if used in header files,
* but it should be better than nothing. If you want a "do nothing"
* version, then it should generate some harmless declaration, such as:
* #define __IDSTRING(name,string) struct __hack
*/
#define __IDSTRING(name,string) static const char name[] __unused = string
#endif
# 617 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* 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$");
*/
#ifndef __FBSDID
#if !defined(lint) && !defined(STRIP_FBSDID)
#define __FBSDID(s) __IDSTRING(__CONCAT(__rcsid_,__LINE__),s)
#else
# 628 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __FBSDID(s) struct __hack
#endif
# 630 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 631 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifndef __RCSID
#ifndef NO__RCSID
#define __RCSID(s) __IDSTRING(__CONCAT(__rcsid_,__LINE__),s)
#else
# 636 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __RCSID(s) struct __hack
#endif
# 638 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 639 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifndef __RCSID_SOURCE
#ifndef NO__RCSID_SOURCE
#define __RCSID_SOURCE(s) __IDSTRING(__CONCAT(__rcsid_source_,__LINE__),s)
#else
# 644 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __RCSID_SOURCE(s) struct __hack
#endif
# 646 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 647 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifndef __SCCSID
#ifndef NO__SCCSID
#define __SCCSID(s) __IDSTRING(__CONCAT(__sccsid_,__LINE__),s)
#else
# 652 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __SCCSID(s) struct __hack
#endif
# 654 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 655 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifndef __COPYRIGHT
#ifndef NO__COPYRIGHT
#define __COPYRIGHT(s) __IDSTRING(__CONCAT(__copyright_,__LINE__),s)
#else
# 660 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __COPYRIGHT(s) struct __hack
#endif
# 662 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 663 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifndef __DECONST
#if !__has_feature(capabilities)
#define __DECONST(type, var) ((type)(__uintptr_t)(const void *)(var))
#else
# 668 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __DECONST(type, var) ((type)(__intcap_t)(__capability const void *)(var))
#endif
# 670 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 671 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifndef __DEVOLATILE
#if !__has_feature(capabilities)
#define __DEVOLATILE(type, var) ((type)(__uintptr_t)(volatile void *)(var))
#else
# 676 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __DEVOLATILE(type, var) ((type)(__intcap_t)(__capability volatile void *)(var))
#endif
# 678 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 679 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifndef __DEQUALIFY
#if !__has_feature(capabilities)
#define __DEQUALIFY(type, var) ((type)(__uintptr_t)(const volatile void *)(var))
#else
# 684 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __DEQUALIFY(type, var) ((type)(__intcap_t)(__capability const volatile void *)(var))
#endif
# 686 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 687 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*-
* 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. */
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1
#undef _POSIX_C_SOURCE /* Probably illegal, but beyond caring now. */
#define _POSIX_C_SOURCE 199009
#endif
# 716 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. */
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 199209
#endif
# 722 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/* Deal with various X/Open Portability Guides and Single UNIX Spec. */
#ifdef _XOPEN_SOURCE
#if _XOPEN_SOURCE - 0 >= 700
#define __XSI_VISIBLE 700
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200809
#elif _XOPEN_SOURCE - 0 >= 600
# 730 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __XSI_VISIBLE 600
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200112
#elif _XOPEN_SOURCE - 0 >= 500
# 734 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __XSI_VISIBLE 500
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 199506
#endif
# 738 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 739 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* Deal with all versions of POSIX. The ordering relative to the tests above is
* important.
*/
#if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)
#define _POSIX_C_SOURCE 198808
#endif
# 747 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#ifdef _POSIX_C_SOURCE
#if _POSIX_C_SOURCE >= 200809
#define __POSIX_VISIBLE 200809
#define __ISO_C_VISIBLE 1999
#elif _POSIX_C_SOURCE >= 200112
# 752 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 200112
#define __ISO_C_VISIBLE 1999
#elif _POSIX_C_SOURCE >= 199506
# 755 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 199506
#define __ISO_C_VISIBLE 1990
#elif _POSIX_C_SOURCE >= 199309
# 758 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 199309
#define __ISO_C_VISIBLE 1990
#elif _POSIX_C_SOURCE >= 199209
# 761 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 199209
#define __ISO_C_VISIBLE 1990
#elif _POSIX_C_SOURCE >= 199009
# 764 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 199009
#define __ISO_C_VISIBLE 1990
#else
# 767 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 198808
#define __ISO_C_VISIBLE 0
#endif /* _POSIX_C_SOURCE */
# 770 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#else
# 771 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*-
* Deal with _ANSI_SOURCE:
* If it is defined, and no other compilation environment is explicitly
* requested, then define our internal feature-test macros to zero. This
* makes no difference to the preprocessor (undefined symbols in preprocessing
* expressions are defined to have value zero), but makes it more convenient for
* a test program to print out the values.
*
* If a program mistakenly defines _ANSI_SOURCE and some other macro such as
* _POSIX_C_SOURCE, we will assume that it wants the broader compilation
* environment (and in fact we will never get here).
*/
#if defined(_ANSI_SOURCE) /* Hide almost everything. */
#define __POSIX_VISIBLE 0
#define __XSI_VISIBLE 0
#define __BSD_VISIBLE 0
#define __ISO_C_VISIBLE 1990
#elif defined(_C99_SOURCE) /* Localism to specify strict C99 env. */
# 789 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 0
#define __XSI_VISIBLE 0
#define __BSD_VISIBLE 0
#define __ISO_C_VISIBLE 1999
#elif defined(_C11_SOURCE) /* Localism to specify strict C11 env. */
# 794 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 0
#define __XSI_VISIBLE 0
#define __BSD_VISIBLE 0
#define __ISO_C_VISIBLE 2011
#else /* Default environment: show everything. */
# 799 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 200809
#define __XSI_VISIBLE 700
#define __BSD_VISIBLE 1
#define __ISO_C_VISIBLE 2011
#endif
# 804 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 805 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#if defined(__mips) || defined(__powerpc64__) || defined(__riscv__)
#define __NO_TLS 1
#endif
# 809 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* 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.
*/
#if defined(__arm__) && !defined(__ARM_ARCH)
#if 0 /* expanded by -frewrite-includes */
#include <machine/acle-compat.h>
#endif /* expanded by -frewrite-includes */
# 815 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
# 816 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif
# 817 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* Type Safety Checking
*
* Clang provides additional attributes to enable checking type safety
* properties that cannot be enforced by the C type system.
*/
#if __has_attribute(__argument_with_type_tag__) && \
__has_attribute(__type_tag_for_datatype__) && !defined(lint)
#define __arg_type_tag(arg_kind, arg_idx, type_tag_idx) \
__attribute__((__argument_with_type_tag__(arg_kind, arg_idx, type_tag_idx)))
#define __datatype_type_tag(kind, type) \
__attribute__((__type_tag_for_datatype__(kind, type)))
#else
# 832 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __arg_type_tag(arg_kind, arg_idx, type_tag_idx)
#define __datatype_type_tag(kind, type)
#endif
# 835 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/*
* 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.
*/
#if __has_extension(c_thread_safety_attributes)
#define __lock_annotate(x) __attribute__((x))
#else
# 851 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __lock_annotate(x)
#endif
# 853 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
/* Structure implements a lock. */
#define __lockable __lock_annotate(lockable)
/* Function acquires an exclusive or shared lock. */
#define __locks_exclusive(...) \
__lock_annotate(exclusive_lock_function(__VA_ARGS__))
#define __locks_shared(...) \
__lock_annotate(shared_lock_function(__VA_ARGS__))
/* Function attempts to acquire an exclusive or shared lock. */
#define __trylocks_exclusive(...) \
__lock_annotate(exclusive_trylock_function(__VA_ARGS__))
#define __trylocks_shared(...) \
__lock_annotate(shared_trylock_function(__VA_ARGS__))
/* Function releases a lock. */
#define __unlocks(...) __lock_annotate(unlock_function(__VA_ARGS__))
/* Function asserts that an exclusive or shared lock is held. */
#define __asserts_exclusive(...) \
__lock_annotate(assert_exclusive_lock(__VA_ARGS__))
#define __asserts_shared(...) \
__lock_annotate(assert_shared_lock(__VA_ARGS__))
/* Function requires that an exclusive or shared lock is or is not held. */
#define __requires_exclusive(...) \
__lock_annotate(exclusive_locks_required(__VA_ARGS__))
#define __requires_shared(...) \
__lock_annotate(shared_locks_required(__VA_ARGS__))
#define __requires_unlocked(...) \
__lock_annotate(locks_excluded(__VA_ARGS__))
/* Function should not be analyzed. */
#define __no_lock_analysis __lock_annotate(no_thread_safety_analysis)
/* Guard variables and structure members by lock. */
#define __guarded_by(x) __lock_annotate(guarded_by(x))
#define __pt_guarded_by(x) __lock_annotate(pt_guarded_by(x))
/* Specify that a file requires capabilities */
#if __has_feature(capabilities)
#define __REQUIRE_CAPABILITIES
#else
# 897 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#define __REQUIRE_CAPABILITIES \
_Pragma("GCC error \"This file requires a capability-aware compiler\"")
#endif
# 900 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
#endif /* !_SYS_CDEFS_H_ */
# 902 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/cdefs.h" 3 4
# 42 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/pthread.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <sys/_pthreadtypes.h>
#endif /* expanded by -frewrite-includes */
# 42 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/pthread.h"
# 1 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_pthreadtypes.h" 1 3 4
/*
* Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu
* Copyright (c) 1995-1998 by John Birrell <jb@cimlogic.com.au>
* 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 Chris Provenzano.
* 4. The name of Chris Provenzano may not be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``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 CHRIS PROVENZANO 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$
*/
#ifndef _SYS__PTHREADTYPES_H_
#define _SYS__PTHREADTYPES_H_
/*
* Forward structure definitions.
*
* These are mostly opaque to the user.
*/
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;
/*
* 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.
*/
#ifndef _PTHREAD_T_DECLARED
typedef struct pthread *pthread_t;
#define _PTHREAD_T_DECLARED
#endif
# 68 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_pthreadtypes.h" 3 4
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;
/*
* Additional type definitions:
*
* Note that P1003.1c reserves the prefixes pthread_ and PTHREAD_ for
* use in header symbols.
*/
typedef void *pthread_addr_t;
typedef void *(*pthread_startroutine_t)(void *);
/*
* Once definitions.
*/
struct pthread_once {
int state;
pthread_mutex_t mutex;
};
#endif /* ! _SYS__PTHREADTYPES_H_ */
# 99 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_pthreadtypes.h" 3 4
# 43 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/pthread.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <machine/_limits.h>
#endif /* expanded by -frewrite-includes */
# 43 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/pthread.h"
# 1 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_limits.h" 1 3 4
/*-
* 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.
* 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.
*
* @(#)limits.h 8.3 (Berkeley) 1/4/94
* from: src/sys/i386/include/_limits.h,v 1.27 2005/01/06 22:18:15 imp
* $FreeBSD$
*/
#ifndef _MACHINE__LIMITS_H_
#define _MACHINE__LIMITS_H_
/*
* 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).
*/
#define __CHAR_BIT 8 /* number of bits in a char */
#define __SCHAR_MAX 0x7f /* max value for a signed char */
#define __SCHAR_MIN (-0x7f - 1) /* min value for a signed char */
#define __UCHAR_MAX 0xff /* max value for an unsigned char */
#define __USHRT_MAX 0xffff /* max value for an unsigned short */
#define __SHRT_MAX 0x7fff /* max value for a short */
#define __SHRT_MIN (-0x7fff - 1) /* min value for a short */
#define __UINT_MAX 0xffffffff /* max value for an unsigned int */
#define __INT_MAX 0x7fffffff /* max value for an int */
#define __INT_MIN (-0x7fffffff - 1) /* min value for an int */
#ifdef __mips_n64
#define __ULONG_MAX 0xffffffffffffffff
#define __LONG_MAX 0x7fffffffffffffff
#define __LONG_MIN (-0x7fffffffffffffff - 1)
#define __LONG_BIT 64
#else
# 67 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_limits.h" 3 4
#define __ULONG_MAX 0xffffffffUL /* max value for an unsigned long */
#define __LONG_MAX 0x7fffffffL /* max value for a long */
#define __LONG_MIN (-0x7fffffffL - 1) /* min value for a long */
#define __LONG_BIT 32
#endif
# 72 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_limits.h" 3 4
/* max value for an unsigned long long */
#define __ULLONG_MAX 0xffffffffffffffffULL
#define __LLONG_MAX 0x7fffffffffffffffLL /* max value for a long long */
#define __LLONG_MIN (-0x7fffffffffffffffLL - 1) /* min for a long long */
#define __SSIZE_MAX __LONG_MAX /* max value for a ssize_t */
#define __SIZE_T_MAX __ULONG_MAX /* max value for a size_t */
#define __OFF_MAX __LLONG_MAX /* max value for an off_t */
#define __OFF_MIN __LLONG_MIN /* min value for an off_t */
/* Quads and long longs are the same size. Ensure they stay in sync. */
#define __UQUAD_MAX __ULLONG_MAX /* max value for a uquad_t */
#define __QUAD_MAX __LLONG_MAX /* max value for a quad_t */
#define __QUAD_MIN __LLONG_MIN /* min value for a quad_t */
#define __WORD_BIT 32
#define __MINSIGSTKSZ (512 * 4)
#endif /* !_MACHINE__LIMITS_H_ */
# 95 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_limits.h" 3 4
# 44 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/pthread.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <machine/_types.h>
#endif /* expanded by -frewrite-includes */
# 44 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/pthread.h"
# 1 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 1 3 4
/*-
* 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
* from: src/sys/i386/include/_types.h,v 1.12 2005/07/02 23:13:31 thompsa
* $FreeBSD$
*/
#ifndef _MACHINE__TYPES_H_
#define _MACHINE__TYPES_H_
#ifndef _SYS_CDEFS_H_
#error this file needs sys/cdefs.h as a prerequisite
#endif
# 46 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
/*
* Basic types upon which most other types are built.
*/
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef short __int16_t;
typedef unsigned short __uint16_t;
typedef int __int32_t;
typedef unsigned int __uint32_t;
#ifdef __mips_n64
typedef long __int64_t;
typedef unsigned long __uint64_t;
#else
# 60 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
#ifndef lint
__extension__
#endif
# 63 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
/* LONGLONG */
typedef long long __int64_t;
#ifndef lint
__extension__
#endif
# 68 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
/* LONGLONG */
typedef unsigned long long __uint64_t;
#endif
# 71 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
/*
* Standard type definitions.
*/
typedef __int32_t __clock_t; /* clock()... */
typedef double __double_t;
typedef float __float_t;
#ifdef __mips_n64
#ifndef __CHERI_PURE_CAPABILITY__
typedef __int64_t __critical_t;
typedef __int64_t __intfptr_t;
typedef __int64_t __intptr_t;
#else
# 84 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
typedef __intcap_t __critical_t;
typedef __intcap_t __intfptr_t;
typedef __intcap_t __intptr_t;
#endif
# 88 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
#else
# 89 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
typedef __int32_t __critical_t;
typedef __int32_t __intfptr_t;
typedef __int32_t __intptr_t;
#endif
# 93 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
typedef __int64_t __intmax_t;
typedef __int32_t __int_fast8_t;
typedef __int32_t __int_fast16_t;
typedef __int32_t __int_fast32_t;
typedef __int64_t __int_fast64_t;
typedef __int8_t __int_least8_t;
typedef __int16_t __int_least16_t;
typedef __int32_t __int_least32_t;
typedef __int64_t __int_least64_t;
#if defined(__mips_n64) || defined(__mips_n32)
typedef __int64_t __register_t;
typedef __int64_t f_register_t;
#else
# 106 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
typedef __int32_t __register_t;
typedef __int32_t f_register_t;
#endif
# 109 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
#ifdef __mips_n64
typedef __int64_t __ptrdiff_t;
typedef __int64_t __segsz_t;
typedef __uint64_t __size_t;
typedef __int64_t __ssize_t;
#ifndef __CHERI_PURE_CAPABILITY__
typedef __uint64_t __uintfptr_t;
typedef __uint64_t __uintptr_t;
#else
# 118 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
typedef __uintcap_t __uintfptr_t;
typedef __uintcap_t __uintptr_t;
#endif
# 121 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
#else
# 122 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
typedef __int32_t __ptrdiff_t; /* ptr1 - ptr2 */
typedef __int32_t __segsz_t; /* segment size (in pages) */
typedef __uint32_t __size_t; /* sizeof() */
typedef __int32_t __ssize_t; /* byte count or error */
typedef __uint32_t __uintfptr_t;
typedef __uint32_t __uintptr_t;
#endif
# 129 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
typedef __int64_t __time_t; /* time()... */
typedef __uint64_t __uintmax_t;
typedef __uint32_t __uint_fast8_t;
typedef __uint32_t __uint_fast16_t;
typedef __uint32_t __uint_fast32_t;
typedef __uint64_t __uint_fast64_t;
typedef __uint8_t __uint_least8_t;
typedef __uint16_t __uint_least16_t;
typedef __uint32_t __uint_least32_t;
typedef __uint64_t __uint_least64_t;
#if defined(__mips_n64) || defined(__mips_n32)
typedef __uint64_t __u_register_t;
#else
# 142 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
typedef __uint32_t __u_register_t;
#endif
# 144 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
#ifdef __mips_n64
typedef __uint64_t __vm_offset_t;
typedef __uint64_t __vm_size_t;
#else
# 148 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
typedef __uint32_t __vm_offset_t;
typedef __uint32_t __vm_size_t;
#endif
# 151 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
#if defined(__mips_n64) || defined(__mips_n32) /* PHYSADDR_64_BIT */
typedef __uint64_t __vm_paddr_t;
#else
# 154 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
typedef __uint32_t __vm_paddr_t;
#endif
# 156 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
typedef __int64_t __vm_ooffset_t;
typedef __uint64_t __vm_pindex_t;
typedef int ___wchar_t;
#define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */
#define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */
/*
* Unusual type definitions.
*/
#ifdef __GNUCLIKE_BUILTIN_VARARGS
typedef __builtin_va_list __va_list; /* internally known to gcc */
#else
# 170 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
typedef char * __va_list;
#endif /* __GNUCLIKE_BUILTIN_VARARGS */
# 172 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
#if defined(__GNUC_VA_LIST_COMPATIBILITY) && !defined(__GNUC_VA_LIST) \
&& !defined(__NO_GNUC_VA_LIST)
#define __GNUC_VA_LIST
typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/
#endif
# 177 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
#endif /* !_MACHINE__TYPES_H_ */
# 179 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_types.h" 3 4
# 45 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/pthread.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <sys/_sigset.h>
#endif /* expanded by -frewrite-includes */
# 45 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/pthread.h"
# 1 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_sigset.h" 1 3 4
/*-
* 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.
* 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.
*
* @(#)signal.h 8.4 (Berkeley) 5/4/95
* $FreeBSD$
*/
#ifndef _SYS__SIGSET_H_
#define _SYS__SIGSET_H_
/*
* sigset_t macros.
*/
#define _SIG_WORDS 4
#define _SIG_MAXSIG 128
#define _SIG_IDX(sig) ((sig) - 1)
#define _SIG_WORD(sig) (_SIG_IDX(sig) >> 5)
#define _SIG_BIT(sig) (1 << (_SIG_IDX(sig) & 31))
#define _SIG_VALID(sig) ((sig) <= _SIG_MAXSIG && (sig) > 0)
typedef struct __sigset {
__uint32_t __bits[_SIG_WORDS];
} __sigset_t;
#if defined(_KERNEL) && defined(COMPAT_43)
typedef unsigned int osigset_t;
#endif
# 58 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_sigset.h" 3 4
#endif /* !_SYS__SIGSET_H_ */
# 60 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_sigset.h" 3 4
# 46 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/pthread.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <sched.h>
#endif /* expanded by -frewrite-includes */
# 46 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/pthread.h"
# 1 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sched.h" 1 3 4
/*-
* 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$
*/
#ifndef _SCHED_H_
#define _SCHED_H_
#ifdef _KERNEL
/*
* General scheduling info.
*
* sched_load:
* Total runnable non-ithread threads in the system.
*
* sched_runnable:
* Runnable threads for this processor.
*/
int sched_load(void);
int sched_rr_interval(void);
int sched_runnable(void);
/*
* Proc related scheduling hooks.
*/
void sched_exit(struct proc *p, struct thread *childtd);
void sched_fork(struct thread *td, struct thread *childtd);
void sched_fork_exit(struct thread *td);
void sched_class(struct thread *td, int class);
void sched_nice(struct proc *p, int nice);
/*
* Threads are switched in and out, block on resources, have temporary
* priorities inherited from their procs, and use up cpu time.
*/
void sched_exit_thread(struct thread *td, struct thread *child);
u_int sched_estcpu(struct thread *td);
void sched_fork_thread(struct thread *td, struct thread *child);
void sched_lend_prio(struct thread *td, u_char prio);
void sched_lend_user_prio(struct thread *td, u_char pri);
fixpt_t sched_pctcpu(struct thread *td);
void sched_prio(struct thread *td, u_char prio);
void sched_sleep(struct thread *td, int prio);
void sched_switch(struct thread *td, struct thread *newtd, int flags);
void sched_throw(struct thread *td);
void sched_unlend_prio(struct thread *td, u_char prio);
void sched_user_prio(struct thread *td, u_char prio);
void sched_userret(struct thread *td);
void sched_wakeup(struct thread *td);
#ifdef RACCT
#ifdef SCHED_4BSD
fixpt_t sched_pctcpu_delta(struct thread *td);
#endif
# 110 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sched.h" 3 4
#endif
# 111 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sched.h" 3 4
/*
* Threads are moved on and off of run queues
*/
void sched_add(struct thread *td, int flags);
void sched_clock(struct thread *td);
void sched_preempt(struct thread *td);
void sched_rem(struct thread *td);
void sched_relinquish(struct thread *td);
struct thread *sched_choose(void);
void sched_idletd(void *);
/*
* Binding makes cpu affinity permanent while pinning is used to temporarily
* hold a thread on a particular CPU.
*/
void sched_bind(struct thread *td, int cpu);
static __inline void sched_pin(void);
void sched_unbind(struct thread *td);
static __inline void sched_unpin(void);
int sched_is_bound(struct thread *td);
void sched_affinity(struct thread *td);
/*
* These procedures tell the process data structure allocation code how
* many bytes to actually allocate.
*/
int sched_sizeof_proc(void);
int sched_sizeof_thread(void);
/*
* This routine provides a consistent thread name for use with KTR graphing
* functions.
*/
char *sched_tdname(struct thread *td);
#ifdef KTR
void sched_clear_tdname(struct thread *td);
#endif
# 149 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sched.h" 3 4
static __inline void
sched_pin(void)
{
curthread->td_pinned++;
__compiler_membar();
}
static __inline void
sched_unpin(void)
{
__compiler_membar();
curthread->td_pinned--;
}
/* sched_add arguments (formerly setrunqueue) */
#define SRQ_BORING 0x0000 /* No special circumstances. */
#define SRQ_YIELDING 0x0001 /* We are yielding (from mi_switch). */
#define SRQ_OURSELF 0x0002 /* It is ourself (from mi_switch). */
#define SRQ_INTR 0x0004 /* It is probably urgent. */
#define SRQ_PREEMPTED 0x0008 /* has been preempted.. be kind */
#define SRQ_BORROWING 0x0010 /* Priority updated due to prio_lend */
/* Scheduler stats. */
#ifdef SCHED_STATS
DPCPU_DECLARE(long, sched_switch_stats[SWT_COUNT]);
#define SCHED_STAT_DEFINE_VAR(name, ptr, descr) \
static void name ## _add_proc(void *dummy __unused) \
{ \
\
SYSCTL_ADD_PROC(NULL, \
SYSCTL_STATIC_CHILDREN(_kern_sched_stats), OID_AUTO, \
#name, CTLTYPE_LONG|CTLFLAG_RD|CTLFLAG_MPSAFE, \
ptr, 0, sysctl_dpcpu_long, "LU", descr); \
} \
SYSINIT(name, SI_SUB_LAST, SI_ORDER_MIDDLE, name ## _add_proc, NULL);
#define SCHED_STAT_DEFINE(name, descr) \
DPCPU_DEFINE(unsigned long, name); \
SCHED_STAT_DEFINE_VAR(name, &DPCPU_NAME(name), descr)
/*
* Sched stats are always incremented in critical sections so no atomic
* is necesssary to increment them.
*/
#define SCHED_STAT_INC(var) DPCPU_GET(var)++;
#else
# 196 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sched.h" 3 4
#define SCHED_STAT_DEFINE_VAR(name, descr, ptr)
#define SCHED_STAT_DEFINE(name, descr)
#define SCHED_STAT_INC(var) (void)0
#endif
# 200 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sched.h" 3 4
/*
* Fixup scheduler state for proc0 and thread0
*/
void schedinit(void);
#endif /* _KERNEL */
# 206 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sched.h" 3 4
/* POSIX 1003.1b Process Scheduling */
/*
* POSIX scheduling policies
*/
#define SCHED_FIFO 1
#define SCHED_OTHER 2
#define SCHED_RR 3
struct sched_param {
int sched_priority;
};
/*
* POSIX scheduling declarations for userland.
*/
#ifndef _KERNEL
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 224 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sched.h" 3 4
# 225 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sched.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_timespec.h>
#endif /* expanded by -frewrite-includes */
# 225 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sched.h" 3 4
# 1 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_timespec.h" 1 3 4
/*-
* 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.
* 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.
*
* @(#)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$
*/
#ifndef _SYS__TIMESPEC_H_
#define _SYS__TIMESPEC_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 37 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_timespec.h" 3 4
# 1 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_types.h" 1 3 4
/*-
* 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$
*/
#ifndef _SYS__TYPES_H_
#define _SYS__TYPES_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 32 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_types.h" 3 4
# 33 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <machine/_types.h>
#endif /* expanded by -frewrite-includes */
# 33 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_types.h" 3 4
# 34 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_types.h" 3 4
/*
* Standard type definitions.
*/
typedef __int32_t __blksize_t; /* file block size */
typedef __int64_t __blkcnt_t; /* file block count */
typedef __int32_t __clockid_t; /* clock_gettime()... */
typedef __uint32_t __fflags_t; /* file flags */
typedef __uint64_t __fsblkcnt_t;
typedef __uint64_t __fsfilcnt_t;
typedef __uint32_t __gid_t;
typedef __int64_t __id_t; /* can hold a gid_t, pid_t, or uid_t */
typedef __uint32_t __ino_t; /* inode number */
typedef long __key_t; /* IPC key (for Sys V IPC) */
typedef __int32_t __lwpid_t; /* Thread ID (a.k.a. LWP) */
typedef __uint16_t __mode_t; /* permissions */
typedef int __accmode_t; /* access permissions */
typedef int __nl_item;
typedef __uint16_t __nlink_t; /* link count */
typedef __int64_t __off_t; /* file offset */
typedef __int64_t __off64_t; /* file offset (alias) */
typedef __int32_t __pid_t; /* process [group] */
typedef __int64_t __rlim_t; /* resource limit - intentionally */
/* signed, because of legacy code */
/* that uses -1 for RLIM_INFINITY */
typedef __uint8_t __sa_family_t;
typedef __uint32_t __socklen_t;
typedef long __suseconds_t; /* microseconds (signed) */
typedef struct __timer *__timer_t; /* timer_gettime()... */
typedef struct __mq *__mqd_t; /* mq_open()... */
typedef __uint32_t __uid_t;
typedef unsigned int __useconds_t; /* microseconds (unsigned) */
typedef int __cpuwhich_t; /* which parameter for cpuset. */
typedef int __cpulevel_t; /* level parameter for cpuset. */
typedef int __cpusetid_t; /* cpuset identifier. */
/*
* 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.
*/
typedef int __ct_rune_t; /* arg type for ctype funcs */
typedef __ct_rune_t __rune_t; /* rune_t (see above) */
typedef __ct_rune_t __wint_t; /* wint_t (see above) */
/* Clang already provides these types as built-ins, but only in C++ mode. */
#if !defined(__clang__) || !defined(__cplusplus)
typedef __uint_least16_t __char16_t;
typedef __uint_least32_t __char32_t;
#endif
# 97 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_types.h" 3 4
/* In C++11, char16_t and char32_t are built-in types. */
#if defined(__cplusplus) && __cplusplus >= 201103L
#define _CHAR16_T_DECLARED
#define _CHAR32_T_DECLARED
#endif
# 102 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_types.h" 3 4
typedef struct {
long long __max_align1 __aligned(_Alignof(long long));
long double __max_align2 __aligned(_Alignof(long double));
} __max_align_t;
typedef __uint32_t __dev_t; /* device number */
typedef __uint32_t __fixpt_t; /* fixed point number */
/*
* mbstate_t is an opaque object to keep conversion state during multibyte
* stream conversions.
*/
typedef union {
char __mbstate8[128];
__int64_t _mbstateL; /* for alignment */
} __mbstate_t;
typedef __uintmax_t __rman_res_t;
#endif /* !_SYS__TYPES_H_ */
# 124 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_types.h" 3 4
# 38 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_timespec.h" 2 3 4
#ifndef _TIME_T_DECLARED
typedef __time_t time_t;
#define _TIME_T_DECLARED
#endif
# 43 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_timespec.h" 3 4
struct timespec {
time_t tv_sec; /* seconds */
long tv_nsec; /* and nanoseconds */
};
#endif /* !_SYS__TIMESPEC_H_ */
# 50 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_timespec.h" 3 4
# 226 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sched.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 226 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sched.h" 3 4
# 227 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sched.h" 3 4
#ifndef _PID_T_DECLARED
typedef __pid_t pid_t;
#define _PID_T_DECLARED
#endif
# 232 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sched.h" 3 4
__BEGIN_DECLS
int sched_get_priority_max(int);
int sched_get_priority_min(int);
int sched_getparam(pid_t, struct sched_param *);
int sched_getscheduler(pid_t);
int sched_rr_get_interval(pid_t, struct timespec *);
int sched_setparam(pid_t, const struct sched_param *);
int sched_setscheduler(pid_t, int, const struct sched_param *);
int sched_yield(void);
__END_DECLS
#endif
# 245 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sched.h" 3 4
#endif /* !_SCHED_H_ */
# 246 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sched.h" 3 4
# 47 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/pthread.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <time.h>
#endif /* expanded by -frewrite-includes */
# 47 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/pthread.h"
# 1 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h" 1
/*
* 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$
*/
#ifndef _TIME_H_
#define _TIME_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 44 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
# 45 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
#if 0 /* expanded by -frewrite-includes */
#include <sys/_null.h>
#endif /* expanded by -frewrite-includes */
# 45 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
# 1 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_null.h" 1 3 4
/*-
* 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$
*/
#ifndef NULL
#if !defined(__cplusplus)
#define NULL ((void *)0)
#else
# 34 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_null.h" 3 4
#if __cplusplus >= 201103L
#define NULL nullptr
#elif defined(__GNUG__) && defined(__GNUC__) && __GNUC__ >= 4
# 37 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_null.h" 3 4
#define NULL __null
#else
# 39 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_null.h" 3 4
#if defined(__LP64__)
#define NULL (0L)
#else
# 42 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_null.h" 3 4
#define NULL 0
#endif /* __LP64__ */
# 44 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_null.h" 3 4
#endif /* __GNUG__ */
# 45 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_null.h" 3 4
#endif /* !__cplusplus */
# 46 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_null.h" 3 4
#endif
# 48 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_null.h" 3 4
# 46 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 46 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
# 47 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
#if __POSIX_VISIBLE > 0 && __POSIX_VISIBLE < 200112 || __BSD_VISIBLE
/*
* Frequency of the clock ticks reported by times(). Deprecated - use
* sysconf(_SC_CLK_TCK) instead. (Removed in 1003.1-2001.)
*/
#define CLK_TCK 128
#endif
# 55 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
/* Frequency of the clock ticks reported by clock(). */
#define CLOCKS_PER_SEC 128
#ifndef _CLOCK_T_DECLARED
typedef __clock_t clock_t;
#define _CLOCK_T_DECLARED
#endif
# 63 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
#ifndef _TIME_T_DECLARED
typedef __time_t time_t;
#define _TIME_T_DECLARED
#endif
# 68 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
#ifndef _SIZE_T_DECLARED
typedef __size_t size_t;
#define _SIZE_T_DECLARED
#endif
# 73 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
#if __POSIX_VISIBLE >= 199309
/*
* New in POSIX 1003.1b-1993.
*/
#ifndef _CLOCKID_T_DECLARED
typedef __clockid_t clockid_t;
#define _CLOCKID_T_DECLARED
#endif
# 82 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
#ifndef _TIMER_T_DECLARED
typedef __timer_t timer_t;
#define _TIMER_T_DECLARED
#endif
# 87 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
#if 0 /* expanded by -frewrite-includes */
#include <sys/timespec.h>
#endif /* expanded by -frewrite-includes */
# 88 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
# 1 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/timespec.h" 1 3 4
/*-
* 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.
* 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.
*
* @(#)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$
*/
#ifndef _SYS_TIMESPEC_H_
#define _SYS_TIMESPEC_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 37 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/timespec.h" 3 4
# 38 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/timespec.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_timespec.h>
#endif /* expanded by -frewrite-includes */
# 38 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/timespec.h" 3 4
# 39 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/timespec.h" 3 4
#if __BSD_VISIBLE
#define TIMEVAL_TO_TIMESPEC(tv, ts) \
do { \
(ts)->tv_sec = (tv)->tv_sec; \
(ts)->tv_nsec = (tv)->tv_usec * 1000; \
} while (0)
#define TIMESPEC_TO_TIMEVAL(tv, ts) \
do { \
(tv)->tv_sec = (ts)->tv_sec; \
(tv)->tv_usec = (ts)->tv_nsec / 1000; \
} while (0)
#endif /* __BSD_VISIBLE */
# 53 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/timespec.h" 3 4
/*
* Structure defined by POSIX.1b to be like a itimerval, but with
* timespecs. Used in the timer_*() system calls.
*/
struct itimerspec {
struct timespec it_interval;
struct timespec it_value;
};
#endif /* _SYS_TIMESPEC_H_ */
# 64 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/timespec.h" 3 4
# 89 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h" 2
#endif /* __POSIX_VISIBLE >= 199309 */
# 90 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
#if __POSIX_VISIBLE >= 200112
#ifndef _PID_T_DECLARED
typedef __pid_t pid_t;
#define _PID_T_DECLARED
#endif
# 96 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
#endif
# 97 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
/* These macros are also in sys/time.h. */
#if !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 200112
#define CLOCK_REALTIME 0
#ifdef __BSD_VISIBLE
#define CLOCK_VIRTUAL 1
#define CLOCK_PROF 2
#endif
# 105 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
#define CLOCK_MONOTONIC 4
#define CLOCK_UPTIME 5 /* FreeBSD-specific. */
#define CLOCK_UPTIME_PRECISE 7 /* FreeBSD-specific. */
#define CLOCK_UPTIME_FAST 8 /* FreeBSD-specific. */
#define CLOCK_REALTIME_PRECISE 9 /* FreeBSD-specific. */
#define CLOCK_REALTIME_FAST 10 /* FreeBSD-specific. */
#define CLOCK_MONOTONIC_PRECISE 11 /* FreeBSD-specific. */
#define CLOCK_MONOTONIC_FAST 12 /* FreeBSD-specific. */
#define CLOCK_SECOND 13 /* FreeBSD-specific. */
#define CLOCK_THREAD_CPUTIME_ID 14
#define CLOCK_PROCESS_CPUTIME_ID 15
#endif /* !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 200112 */
# 117 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
#if !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 200112
#if __BSD_VISIBLE
#define TIMER_RELTIME 0x0 /* relative timer */
#endif
# 122 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
#define TIMER_ABSTIME 0x1 /* absolute timer */
#endif /* !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 200112 */
# 124 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
struct tm {
int tm_sec; /* seconds after the minute [0-60] */
int tm_min; /* minutes after the hour [0-59] */
int tm_hour; /* hours since midnight [0-23] */
int tm_mday; /* day of the month [1-31] */
int tm_mon; /* months since January [0-11] */
int tm_year; /* years since 1900 */
int tm_wday; /* days since Sunday [0-6] */
int tm_yday; /* days since January 1 [0-365] */
int tm_isdst; /* Daylight Savings Time flag */
long tm_gmtoff; /* offset from UTC in seconds */
char *tm_zone; /* timezone abbreviation */
};
#if __POSIX_VISIBLE
extern char *tzname[];
#endif
# 142 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
__BEGIN_DECLS
char *asctime(const struct tm *);
clock_t clock(void);
char *ctime(const time_t *);
double difftime(time_t, time_t);
/* XXX missing: getdate() */
struct tm *gmtime(const time_t *);
struct tm *localtime(const time_t *);
time_t mktime(struct tm *);
size_t strftime(char * __restrict, size_t, const char * __restrict,
const struct tm * __restrict);
time_t time(time_t *);
#if __POSIX_VISIBLE >= 200112
struct sigevent;
int timer_create(clockid_t, struct sigevent *__restrict, timer_t *__restrict);
int timer_delete(timer_t);
int timer_gettime(timer_t, struct itimerspec *);
int timer_getoverrun(timer_t);
int timer_settime(timer_t, int, const struct itimerspec *__restrict,
struct itimerspec *__restrict);
#endif
# 164 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
#if __POSIX_VISIBLE
void tzset(void);
#endif
# 167 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
#if __POSIX_VISIBLE >= 199309
int clock_getres(clockid_t, struct timespec *);
int clock_gettime(clockid_t, struct timespec *);
int clock_settime(clockid_t, const struct timespec *);
/* XXX missing: clock_nanosleep() */
int nanosleep(const struct timespec *, struct timespec *);
#endif /* __POSIX_VISIBLE >= 199309 */
# 175 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
#if __POSIX_VISIBLE >= 200112
int clock_getcpuclockid(pid_t, clockid_t *);
#endif
# 179 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
#if __POSIX_VISIBLE >= 199506
char *asctime_r(const struct tm *, char *);
char *ctime_r(const time_t *, char *);
struct tm *gmtime_r(const time_t *, struct tm *);
struct tm *localtime_r(const time_t *, struct tm *);
#endif
# 186 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
#if __XSI_VISIBLE
char *strptime(const char * __restrict, const char * __restrict,
struct tm * __restrict);
#endif
# 191 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
#if __BSD_VISIBLE
char *timezone(int, int); /* XXX XSI conflict */
void tzsetwall(void);
time_t timelocal(struct tm * const);
time_t timegm(struct tm * const);
int timer_oshandle_np(timer_t timerid);
#endif /* __BSD_VISIBLE */
# 199 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_)
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_time.h>
#endif /* expanded by -frewrite-includes */
# 201 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
# 1 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_time.h" 1
/*-
* 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$
*/
#ifndef _LOCALE_T_DEFINED
#define _LOCALE_T_DEFINED
typedef struct _xlocale *locale_t;
#endif
# 36 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_time.h"
/*
* This file is included from both locale.h and xlocale.h. We need to expose
* the declarations unconditionally if we are included from xlocale.h, but only
* if we are in POSIX2008 mode if included from locale.h.
*/
#ifndef _XLOCALE_LOCALE1_H
#define _XLOCALE_LOCALE1_H
size_t strftime_l(char * __restrict, size_t, const char * __restrict,
const struct tm * __restrict, locale_t) __strftimelike(3, 0);
#endif /* _XLOCALE_LOCALE1_H */
# 49 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_time.h"
#ifdef _XLOCALE_H_
#ifndef _XLOCALE_LOCALE2_H
#define _XLOCALE_LOCALE2_H
char *strptime_l(const char * __restrict, const char * __restrict,
struct tm * __restrict, locale_t);
#endif /* _XLOCALE_LOCALE2_H */
# 58 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_time.h"
#endif /* _XLOCALE_H_ */
# 59 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_time.h"
# 202 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h" 2
#endif
# 203 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
__END_DECLS
#endif /* !_TIME_H_ */
# 206 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/time.h"
# 48 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/pthread.h" 2
/*
* Run-time invariant values:
*/
#define PTHREAD_DESTRUCTOR_ITERATIONS 4
#define PTHREAD_KEYS_MAX 256
#define PTHREAD_STACK_MIN __MINSIGSTKSZ
#define PTHREAD_THREADS_MAX __ULONG_MAX
#define PTHREAD_BARRIER_SERIAL_THREAD -1
/*
* Flags for threads and thread attributes.
*/
#define PTHREAD_DETACHED 0x1
#define PTHREAD_SCOPE_SYSTEM 0x2
#define PTHREAD_INHERIT_SCHED 0x4
#define PTHREAD_NOFLOAT 0x8
#define PTHREAD_CREATE_DETACHED PTHREAD_DETACHED
#define PTHREAD_CREATE_JOINABLE 0
#define PTHREAD_SCOPE_PROCESS 0
#define PTHREAD_EXPLICIT_SCHED 0
/*
* Values for process shared/private attributes.
*/
#define PTHREAD_PROCESS_PRIVATE 0
#define PTHREAD_PROCESS_SHARED 1
/*
* Flags for cancelling threads
*/
#define PTHREAD_CANCEL_ENABLE 0
#define PTHREAD_CANCEL_DISABLE 1
#define PTHREAD_CANCEL_DEFERRED 0
#define PTHREAD_CANCEL_ASYNCHRONOUS 2
#define PTHREAD_CANCELED ((void *) 1)
/*
* Flags for once initialization.
*/
#define PTHREAD_NEEDS_INIT 0
#define PTHREAD_DONE_INIT 1
/*
* Static once initialization values.
*/
#define PTHREAD_ONCE_INIT { PTHREAD_NEEDS_INIT, NULL }
/*
* Static initialization values.
*/
#define PTHREAD_MUTEX_INITIALIZER NULL
#define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP ((pthread_mutex_t)1)
#define PTHREAD_COND_INITIALIZER NULL
#define PTHREAD_RWLOCK_INITIALIZER NULL
/*
* Default attribute arguments (draft 4, deprecated).
*/
#ifndef PTHREAD_KERNEL
#define pthread_condattr_default NULL
#define pthread_mutexattr_default NULL
#define pthread_attr_default NULL
#endif
# 113 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/pthread.h"
#define PTHREAD_PRIO_NONE 0
#define PTHREAD_PRIO_INHERIT 1
#define PTHREAD_PRIO_PROTECT 2
/*
* 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.
*/
enum pthread_mutextype {
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
};
#define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_ERRORCHECK
#define PTHREAD_MUTEX_STALLED 0
#define PTHREAD_MUTEX_ROBUST 1
struct _pthread_cleanup_info {
__uintptr_t pthread_cleanup_pad[8];
};
/*
* Thread function prototype definitions:
*/
__BEGIN_DECLS
int pthread_atfork(void (*)(void), void (*)(void), void (*)(void));
int pthread_attr_destroy(pthread_attr_t *) __nonnull(1);
int pthread_attr_getstack(const pthread_attr_t * __restrict,
void ** __restrict, size_t * __restrict)
__nonnull_all;
int pthread_attr_getstacksize(const pthread_attr_t *, size_t *)
__nonnull_all;
int pthread_attr_getguardsize(const pthread_attr_t *, size_t *);
int pthread_attr_getstackaddr(const pthread_attr_t *, void **);
int pthread_attr_getdetachstate(const pthread_attr_t *, int *)
__nonnull_all;
int pthread_attr_init(pthread_attr_t *) __nonnull(1);
int pthread_attr_setstacksize(pthread_attr_t *, size_t)
__nonnull(1);
int pthread_attr_setguardsize(pthread_attr_t *, size_t)
__nonnull(1);
int pthread_attr_setstack(pthread_attr_t *, void *, size_t)
__nonnull(1);
int pthread_attr_setstackaddr(pthread_attr_t *, void *);
int pthread_attr_setdetachstate(pthread_attr_t *, int) __nonnull(1);
int pthread_barrier_destroy(pthread_barrier_t *);
int pthread_barrier_init(pthread_barrier_t *,
const pthread_barrierattr_t *, unsigned);
int pthread_barrier_wait(pthread_barrier_t *);
int pthread_barrierattr_destroy(pthread_barrierattr_t *);
int pthread_barrierattr_getpshared(const pthread_barrierattr_t *,
int *);
int pthread_barrierattr_init(pthread_barrierattr_t *) __nonnull(1);
int pthread_barrierattr_setpshared(pthread_barrierattr_t *, int);
#define pthread_cleanup_push(cleanup_routine, cleanup_arg) \
{ \
struct _pthread_cleanup_info __cleanup_info__; \
__pthread_cleanup_push_imp(cleanup_routine, cleanup_arg,\
&__cleanup_info__); \
{
#define pthread_cleanup_pop(execute) \
(void)0; \
} \
__pthread_cleanup_pop_imp(execute); \
}
int pthread_condattr_destroy(pthread_condattr_t *) __nonnull(1);
int pthread_condattr_getclock(const pthread_condattr_t *,
clockid_t *) __nonnull_all;
int pthread_condattr_getpshared(const pthread_condattr_t *, int *)
__nonnull_all;
int pthread_condattr_init(pthread_condattr_t *) __nonnull(1);
int pthread_condattr_setclock(pthread_condattr_t *, clockid_t)
__nonnull(1);
int pthread_condattr_setpshared(pthread_condattr_t *, int)
__nonnull(1);
int pthread_cond_broadcast(pthread_cond_t *)
__nonnull(1);
int pthread_cond_destroy(pthread_cond_t *)
__nonnull(1);
int pthread_cond_init(pthread_cond_t *,
const pthread_condattr_t *) __nonnull(1);
int pthread_cond_signal(pthread_cond_t *) __nonnull(1);
int pthread_cond_timedwait(pthread_cond_t *,
pthread_mutex_t *__mutex, const struct timespec *)
__nonnull_all __requires_exclusive(*__mutex);
int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *__mutex)
__nonnull_all __requires_exclusive(*__mutex);
int pthread_create(pthread_t *, const pthread_attr_t *,
void *(*) (void *), void *) __nonnull(1) __nonnull(3);
int pthread_detach(pthread_t);
int pthread_equal(pthread_t, pthread_t);
void pthread_exit(void *) __dead2;
void *pthread_getspecific(pthread_key_t);
int pthread_getcpuclockid(pthread_t, clockid_t *) __nonnull(2);
int pthread_join(pthread_t, void **);
int pthread_key_create(pthread_key_t *,
void (*) (void *)) __nonnull(1);
int pthread_key_delete(pthread_key_t);
int pthread_mutexattr_init(pthread_mutexattr_t *) __nonnull(1);
int pthread_mutexattr_destroy(pthread_mutexattr_t *) __nonnull(1);
int pthread_mutexattr_getpshared(const pthread_mutexattr_t *,
int *) __nonnull_all;
int pthread_mutexattr_gettype(pthread_mutexattr_t *, int *)
__nonnull_all;
int pthread_mutexattr_settype(pthread_mutexattr_t *, int)
__nonnull(1);
int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int)
__nonnull(1);
int pthread_mutex_consistent(pthread_mutex_t *__mutex)
__nonnull(1) __requires_exclusive(*__mutex);
int pthread_mutex_destroy(pthread_mutex_t *__mutex)
__nonnull(1) __requires_unlocked(*__mutex);
int pthread_mutex_init(pthread_mutex_t *__mutex,
const pthread_mutexattr_t *)
__nonnull(1) __requires_unlocked(*__mutex);
int pthread_mutex_lock(pthread_mutex_t *__mutex)
__nonnull(1) __locks_exclusive(*__mutex);
int pthread_mutex_trylock(pthread_mutex_t *__mutex)
__nonnull(1) __trylocks_exclusive(0, *__mutex);
int pthread_mutex_timedlock(pthread_mutex_t *__mutex,
const struct timespec *)
__nonnull_all __trylocks_exclusive(0, *__mutex);
int pthread_mutex_unlock(pthread_mutex_t *__mutex)
__nonnull(1) __unlocks(*__mutex);
int pthread_once(pthread_once_t *, void (*) (void)) __nonnull_all;
int pthread_rwlock_destroy(pthread_rwlock_t *__rwlock)
__nonnull(1) __requires_unlocked(*__rwlock);
int pthread_rwlock_init(pthread_rwlock_t *__rwlock,
const pthread_rwlockattr_t *)
__nonnull(1) __requires_unlocked(*__rwlock);
int pthread_rwlock_rdlock(pthread_rwlock_t *__rwlock)
__nonnull(1) __locks_shared(*__rwlock);
int pthread_rwlock_timedrdlock(pthread_rwlock_t *__rwlock,
const struct timespec *)
__nonnull_all __trylocks_shared(0, *__rwlock);
int pthread_rwlock_timedwrlock(pthread_rwlock_t *__rwlock,
const struct timespec *)
__nonnull_all __trylocks_exclusive(0, *__rwlock);
int pthread_rwlock_tryrdlock(pthread_rwlock_t *__rwlock)
__nonnull(1) __trylocks_shared(0, *__rwlock);
int pthread_rwlock_trywrlock(pthread_rwlock_t *__rwlock)
__nonnull(1) __trylocks_exclusive(0, *__rwlock);
int pthread_rwlock_unlock(pthread_rwlock_t *__rwlock)
__nonnull(1) __unlocks(*__rwlock);
int pthread_rwlock_wrlock(pthread_rwlock_t *__rwlock)
__nonnull(1) __locks_exclusive(*__rwlock);
int pthread_rwlockattr_destroy(pthread_rwlockattr_t *)
__nonnull(1);
int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *,
int *);
int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *,
int *) __nonnull_all;
int pthread_rwlockattr_init(pthread_rwlockattr_t *)
__nonnull(1);
int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *, int);
int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int)
__nonnull(1);
pthread_t pthread_self(void);
int pthread_setspecific(pthread_key_t, const void *);
int pthread_spin_init(pthread_spinlock_t *__spin, int)
__requires_unlocked(*__spin);
int pthread_spin_destroy(pthread_spinlock_t *__spin)
__requires_unlocked(*__spin);
int pthread_spin_lock(pthread_spinlock_t *__spin)
__locks_exclusive(*__spin);
int pthread_spin_trylock(pthread_spinlock_t *__spin)
__trylocks_exclusive(0, *__spin);
int pthread_spin_unlock(pthread_spinlock_t *__spin)
__unlocks(*__spin);
int pthread_cancel(pthread_t);
int pthread_setcancelstate(int, int *);
int pthread_setcanceltype(int, int *);
void pthread_testcancel(void);
#if __BSD_VISIBLE
int pthread_getprio(pthread_t);
int pthread_setprio(pthread_t, int);
void pthread_yield(void);
#endif
# 307 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/pthread.h"
int pthread_mutexattr_getprioceiling(pthread_mutexattr_t *,
int *);
int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *,
int);
int pthread_mutex_getprioceiling(pthread_mutex_t *, int *);
int pthread_mutex_setprioceiling(pthread_mutex_t *, int, int *);
int pthread_mutexattr_getprotocol(pthread_mutexattr_t *, int *);
int pthread_mutexattr_setprotocol(pthread_mutexattr_t *, int);
int pthread_mutexattr_getrobust(pthread_mutexattr_t *__restrict,
int *__restrict) __nonnull_all;
int pthread_mutexattr_setrobust(pthread_mutexattr_t *, int)
__nonnull(1);
int pthread_attr_getinheritsched(const pthread_attr_t *, int *);
int pthread_attr_getschedparam(const pthread_attr_t *,
struct sched_param *) __nonnull_all;
int pthread_attr_getschedpolicy(const pthread_attr_t *, int *)
__nonnull_all;
int pthread_attr_getscope(const pthread_attr_t *, int *)
__nonnull_all;
int pthread_attr_setinheritsched(pthread_attr_t *, int);
int pthread_attr_setschedparam(pthread_attr_t *,
const struct sched_param *) __nonnull(1) __nonnull(2);
int pthread_attr_setschedpolicy(pthread_attr_t *, int) __nonnull(1);
int pthread_attr_setscope(pthread_attr_t *, int) __nonnull(1);
int pthread_getschedparam(pthread_t pthread, int *,
struct sched_param *) __nonnull(2) __nonnull(3);
int pthread_setschedparam(pthread_t, int,
const struct sched_param *) __nonnull(3);
#if __XSI_VISIBLE
int pthread_getconcurrency(void);
int pthread_setconcurrency(int);
#endif
# 343 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/pthread.h"
void __pthread_cleanup_push_imp(void (*)(void *), void *,
struct _pthread_cleanup_info *);
void __pthread_cleanup_pop_imp(int);
__END_DECLS
#endif
# 350 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/pthread.h"
# 33 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale.c" 2
#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>
#endif /* expanded by -frewrite-includes */
# 33 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale.c"
# 1 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h" 1
/*-
* 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$
*/
#ifndef _STDIO_H_
#define _STDIO_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 39 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
# 40 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#if 0 /* expanded by -frewrite-includes */
#include <sys/_null.h>
#endif /* expanded by -frewrite-includes */
# 40 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
# 41 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 41 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
# 42 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
typedef __off_t fpos_t;
#ifndef _SIZE_T_DECLARED
typedef __size_t size_t;
#define _SIZE_T_DECLARED
#endif
# 49 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#if __POSIX_VISIBLE >= 200809
#ifndef _OFF_T_DECLARED
#define _OFF_T_DECLARED
typedef __off_t off_t;
#endif
# 55 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#ifndef _SSIZE_T_DECLARED
#define _SSIZE_T_DECLARED
typedef __ssize_t ssize_t;
#endif
# 59 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#endif
# 60 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#ifndef _OFF64_T_DECLARED
#define _OFF64_T_DECLARED
typedef __off64_t off64_t;
#endif
# 65 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
#ifndef _VA_LIST_DECLARED
typedef __va_list va_list;
#define _VA_LIST_DECLARED
#endif
# 71 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#endif
# 72 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#define _FSTDIO /* Define for new stdio with functions. */
/*
* 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 */
struct __sbuf {
unsigned char *_base;
int _size;
};
/*
* 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 (*).
*/
struct __sFILE {
unsigned char *_p; /* (*) current position in (some) buffer */
int _r; /* (*) read space left for getc() */
int _w; /* (*) write space left for putc() */
short _flags; /* (*) flags, below; this FILE is free if 0 */
short _file; /* (*) fileno, if Unix descriptor, else -1 */
struct __sbuf _bf; /* (*) the buffer (at least 1 byte, if !NULL) */
int _lbfsize; /* (*) 0 or -_bf._size, for inline putc */
/* operations */
void *_cookie; /* (*) cookie passed to io functions */
int (*_close)(void *);
int (*_read)(void *, char *, int);
fpos_t (*_seek)(void *, fpos_t, int);
int (*_write)(void *, const char *, int);
/* separate buffer for long sequences of ungetc() */
struct __sbuf _ub; /* ungetc buffer */
unsigned char *_up; /* saved _p when _p is doing ungetc data */
int _ur; /* saved _r when _r is counting ungetc data */
/* tricks to meet minimum requirements even when malloc() fails */
unsigned char _ubuf[3]; /* guarantee an ungetc() buffer */
unsigned char _nbuf[1]; /* guarantee a getc() buffer */
/* separate buffer for fgetln() when line crosses buffer boundary */
struct __sbuf _lb; /* buffer for fgetln() */
/* Unix stdio files get aligned to block boundaries on fseek() */
int _blksize; /* stat.st_blksize (may be != _bf._size) */
fpos_t _offset; /* current lseek offset */
struct pthread_mutex *_fl_mutex; /* used for MT-safety */
struct pthread *_fl_owner; /* current owner */
int _fl_count; /* recursive lock count */
int _orientation; /* orientation for fwide() */
__mbstate_t _mbstate; /* multibyte conversion state */
int _flags2; /* additional flags */
};
#ifndef _STDFILE_DECLARED
#define _STDFILE_DECLARED
typedef struct __sFILE FILE;
#endif
# 158 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#ifndef _STDSTREAM_DECLARED
__BEGIN_DECLS
extern FILE *__stdinp;
extern FILE *__stdoutp;
extern FILE *__stderrp;
__END_DECLS
#define _STDSTREAM_DECLARED
#endif
# 166 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#define __SLBF 0x0001 /* line buffered */
#define __SNBF 0x0002 /* unbuffered */
#define __SRD 0x0004 /* OK to read */
#define __SWR 0x0008 /* OK to write */
/* RD and WR are never simultaneously asserted */
#define __SRW 0x0010 /* open for reading & writing */
#define __SEOF 0x0020 /* found EOF */
#define __SERR 0x0040 /* found error */
#define __SMBF 0x0080 /* _bf._base is from malloc */
#define __SAPP 0x0100 /* fdopen()ed in append mode */
#define __SSTR 0x0200 /* this is an sprintf/snprintf string */
#define __SOPT 0x0400 /* do fseek() optimization */
#define __SNPT 0x0800 /* do not do fseek() optimization */
#define __SOFF 0x1000 /* set iff _offset is in fact correct */
#define __SMOD 0x2000 /* true => fgetln modified _p text */
#define __SALC 0x4000 /* allocate string space dynamically */
#define __SIGN 0x8000 /* ignore this file in _fwalk */
#define __S2OAP 0x0001 /* O_APPEND mode is set */
/*
* The following three definitions are for ANSI C, which took them
* from System V, which brilliantly took internal interface macros and
* made them official arguments to setvbuf(), without renaming them.
* Hence, these ugly _IOxxx names are *supposed* to appear in user code.
*
* Although numbered as their counterparts above, the implementation
* does not rely on this.
*/
#define _IOFBF 0 /* setvbuf should set fully buffered */
#define _IOLBF 1 /* setvbuf should set line buffered */
#define _IONBF 2 /* setvbuf should set unbuffered */
#define BUFSIZ 1024 /* size of buffer used by setbuf */
#define EOF (-1)
/*
* FOPEN_MAX is a minimum maximum, and is the number of streams that
* stdio can provide without attempting to allocate further resources
* (which could fail). Do not use this for anything.
*/
/* must be == _POSIX_STREAM_MAX <limits.h> */
#ifndef FOPEN_MAX
#define FOPEN_MAX 20 /* must be <= OPEN_MAX <sys/syslimits.h> */
#endif
# 212 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#define FILENAME_MAX 1024 /* must be <= PATH_MAX <sys/syslimits.h> */
/* System V/ANSI C; this is the wrong way to do this, do *not* use these. */
#if __XSI_VISIBLE
#define P_tmpdir "/tmp/"
#endif
# 218 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#define L_tmpnam 1024 /* XXX must be == PATH_MAX */
#define TMP_MAX 308915776
#ifndef SEEK_SET
#define SEEK_SET 0 /* set file offset to offset */
#endif
# 224 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#ifndef SEEK_CUR
#define SEEK_CUR 1 /* set file offset to current plus offset */
#endif
# 227 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#ifndef SEEK_END
#define SEEK_END 2 /* set file offset to EOF plus offset */
#endif
# 230 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#define stdin __stdinp
#define stdout __stdoutp
#define stderr __stderrp
__BEGIN_DECLS
#ifdef _XLOCALE_H_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_stdio.h>
#endif /* expanded by -frewrite-includes */
# 237 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
# 238 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#endif
# 239 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
/*
* Functions defined in ANSI C standard.
*/
void clearerr(FILE *);
int fclose(FILE *);
int feof(FILE *);
int ferror(FILE *);
int fflush(FILE *);
int fgetc(FILE *);
int fgetpos(FILE * __restrict, fpos_t * __restrict);
char *fgets(char * __restrict, int, FILE * __restrict);
FILE *fopen(const char * __restrict, const char * __restrict);
int fprintf(FILE * __restrict, const char * __restrict, ...) __printflike(2, 3);
int fputc(int, FILE *);
int fputs(const char * __restrict, FILE * __restrict);
size_t fread(void * __restrict, size_t, size_t, FILE * __restrict);
FILE *freopen(const char * __restrict, const char * __restrict, FILE * __restrict);
int fscanf(FILE * __restrict, const char * __restrict, ...) __scanflike(2, 3);;
int fseek(FILE *, long, int);
int fsetpos(FILE *, const fpos_t *);
long ftell(FILE *);
size_t fwrite(const void * __restrict, size_t, size_t, FILE * __restrict);
int getc(FILE *);
int getchar(void);
char *gets(char *);
void perror(const char *);
int printf(const char * __restrict, ...) __printflike(1, 2);
int putc(int, FILE *);
int putchar(int);
int puts(const char *);
int remove(const char *);
int rename(const char *, const char *);
void rewind(FILE *);
int scanf(const char * __restrict, ...) __scanflike(1, 2);
void setbuf(FILE * __restrict, char * __restrict);
int setvbuf(FILE * __restrict, char * __restrict, int, size_t);
int sprintf(char * __restrict, const char * __restrict, ...) __printflike(2, 3);
int sscanf(const char * __restrict, const char * __restrict, ...) __scanflike(2, 3);
FILE *tmpfile(void);
char *tmpnam(char *);
int ungetc(int, FILE *);
int vfprintf(FILE * __restrict, const char * __restrict,
__va_list);
int vprintf(const char * __restrict, __va_list);
int vsprintf(char * __restrict, const char * __restrict,
__va_list);
#if __ISO_C_VISIBLE >= 1999
int snprintf(char * __restrict, size_t, const char * __restrict,
...) __printflike(3, 4);
int vfscanf(FILE * __restrict, const char * __restrict, __va_list)
__scanflike(2, 0);
int vscanf(const char * __restrict, __va_list) __scanflike(1, 0);
int vsnprintf(char * __restrict, size_t, const char * __restrict,
__va_list) __printflike(3, 0);
int vsscanf(const char * __restrict, const char * __restrict, __va_list)
__scanflike(2, 0);
#endif
# 297 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
/*
* Functions defined in all versions of POSIX 1003.1.
*/
#if __BSD_VISIBLE || (__POSIX_VISIBLE && __POSIX_VISIBLE <= 199506)
#define L_cuserid 17 /* size for cuserid(3); MAXLOGNAME, legacy */
#endif
# 304 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#if __POSIX_VISIBLE
#define L_ctermid 1024 /* size for ctermid(3); PATH_MAX */
char *ctermid(char *);
FILE *fdopen(int, const char *);
int fileno(FILE *);
#endif /* __POSIX_VISIBLE */
# 312 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#if __POSIX_VISIBLE >= 199209
int pclose(FILE *);
FILE *popen(const char *, const char *);
#endif
# 317 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#if __POSIX_VISIBLE >= 199506
int ftrylockfile(FILE *);
void flockfile(FILE *);
void funlockfile(FILE *);
/*
* These are normally used through macros as defined below, but POSIX
* requires functions as well.
*/
int getc_unlocked(FILE *);
int getchar_unlocked(void);
int putc_unlocked(int, FILE *);
int putchar_unlocked(int);
#endif
# 332 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#if __BSD_VISIBLE
void clearerr_unlocked(FILE *);
int feof_unlocked(FILE *);
int ferror_unlocked(FILE *);
int fileno_unlocked(FILE *);
#endif
# 338 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#if __POSIX_VISIBLE >= 200112
int fseeko(FILE *, __off_t, int);
__off_t ftello(FILE *);
#endif
# 343 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#if __BSD_VISIBLE || __XSI_VISIBLE > 0 && __XSI_VISIBLE < 600
int getw(FILE *);
int putw(int, FILE *);
#endif /* BSD or X/Open before issue 6 */
# 348 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#if __XSI_VISIBLE
char *tempnam(const char *, const char *);
#endif
# 352 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#if __POSIX_VISIBLE >= 200809
FILE *fmemopen(void * __restrict, size_t, const char * __restrict);
ssize_t getdelim(char ** __restrict, size_t * __restrict, int,
FILE * __restrict);
FILE *open_memstream(char **, size_t *);
int renameat(int, const char *, int, const char *);
int vdprintf(int, const char * __restrict, __va_list) __printflike(2, 0);
/* _WITH_GETLINE to allow pre 11 sources to build on 11+ systems */
ssize_t getline(char ** __restrict, size_t * __restrict, FILE * __restrict);
int dprintf(int, const char * __restrict, ...) __printflike(2, 3);
#endif /* __POSIX_VISIBLE >= 200809 */
# 364 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
/*
* Routines that are purely local.
*/
#if __BSD_VISIBLE
int asprintf(char **, const char *, ...) __printflike(2, 3);
char *ctermid_r(char *);
void fcloseall(void);
int fdclose(FILE *, int *);
char *fgetln(FILE *, size_t *);
const char *fmtcheck(const char *, const char *) __format_arg(2);
int fpurge(FILE *);
void setbuffer(FILE *, char *, int);
int setlinebuf(FILE *);
int vasprintf(char **, const char *, __va_list)
__printflike(2, 0);
/*
* The system error table contains messages for the first sys_nerr
* positive errno values. Use strerror() or strerror_r() from <string.h>
* instead.
*/
extern const int sys_nerr;
extern const char * const sys_errlist[];
/*
* Stdio function-access interface.
*/
FILE *funopen(const void *,
int (*)(void *, char *, int),
int (*)(void *, const char *, int),
fpos_t (*)(void *, fpos_t, int),
int (*)(void *));
#define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0)
#define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0)
typedef __ssize_t cookie_read_function_t(void *, char *, size_t);
typedef __ssize_t cookie_write_function_t(void *, const char *, size_t);
typedef int cookie_seek_function_t(void *, off64_t *, int);
typedef int cookie_close_function_t(void *);
typedef struct {
cookie_read_function_t *read;
cookie_write_function_t *write;
cookie_seek_function_t *seek;
cookie_close_function_t *close;
} cookie_io_functions_t;
FILE *fopencookie(void *, const char *, cookie_io_functions_t);
/*
* Portability hacks. See <sys/types.h>.
*/
#ifndef _FTRUNCATE_DECLARED
#define _FTRUNCATE_DECLARED
int ftruncate(int, __off_t);
#endif
# 419 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#ifndef _LSEEK_DECLARED
#define _LSEEK_DECLARED
__off_t lseek(int, __off_t, int);
#endif
# 423 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#ifndef _MMAP_DECLARED
#define _MMAP_DECLARED
void *mmap(void *, size_t, int, int, int, __off_t);
#endif
# 427 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#ifndef _TRUNCATE_DECLARED
#define _TRUNCATE_DECLARED
int truncate(const char *, __off_t);
#endif
# 431 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#endif /* __BSD_VISIBLE */
# 432 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
/*
* Functions internal to the implementation.
*/
int __srget(FILE *);
int __swbuf(int, FILE *);
/*
* The __sfoo macros are here so that we can
* define function versions in the C library.
*/
#define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++))
#if defined(__GNUC__) && defined(__STDC__)
static __inline int __sputc(int _c, FILE *_p) {
if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
return (*_p->_p++ = _c);
else
return (__swbuf(_c, _p));
}
#else
# 452 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
/*
* This has been tuned to generate reasonable code on the vax using pcc.
*/
#define __sputc(c, p) \
(--(p)->_w < 0 ? \
(p)->_w >= (p)->_lbfsize ? \
(*(p)->_p = (c)), *(p)->_p != '\n' ? \
(int)*(p)->_p++ : \
__swbuf('\n', p) : \
__swbuf((int)(c), p) : \
(*(p)->_p = (c), (int)*(p)->_p++))
#endif
# 464 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
extern int __isthreaded;
#ifndef __cplusplus
#define __sfeof(p) (((p)->_flags & __SEOF) != 0)
#define __sferror(p) (((p)->_flags & __SERR) != 0)
#define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF)))
#define __sfileno(p) ((p)->_file)
#define feof(p) (!__isthreaded ? __sfeof(p) : (feof)(p))
#define ferror(p) (!__isthreaded ? __sferror(p) : (ferror)(p))
#define clearerr(p) (!__isthreaded ? __sclearerr(p) : (clearerr)(p))
#if __POSIX_VISIBLE
#define fileno(p) (!__isthreaded ? __sfileno(p) : (fileno)(p))
#endif
# 482 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#define getc(fp) (!__isthreaded ? __sgetc(fp) : (getc)(fp))
#define putc(x, fp) (!__isthreaded ? __sputc(x, fp) : (putc)(x, fp))
#define getchar() getc(stdin)
#define putchar(x) putc(x, stdout)
#if __BSD_VISIBLE
/*
* 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.
*/
#define feof_unlocked(p) __sfeof(p)
#define ferror_unlocked(p) __sferror(p)
#define clearerr_unlocked(p) __sclearerr(p)
#define fileno_unlocked(p) __sfileno(p)
#endif
# 499 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#if __POSIX_VISIBLE >= 199506
#define getc_unlocked(fp) __sgetc(fp)
#define putc_unlocked(x, fp) __sputc(x, fp)
#define getchar_unlocked() getc_unlocked(stdin)
#define putchar_unlocked(x) putc_unlocked(x, stdout)
#endif
# 506 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
#endif /* __cplusplus */
# 507 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
__END_DECLS
#endif /* !_STDIO_H_ */
# 510 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdio.h"
# 34 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale.c" 2
#if 0 /* expanded by -frewrite-includes */
#include <string.h>
#endif /* expanded by -frewrite-includes */
# 34 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale.c"
# 1 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h" 1
/*-
* 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.
*
* @(#)string.h 8.1 (Berkeley) 6/2/93
* $FreeBSD$
*/
#ifndef _STRING_H_
#define _STRING_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 36 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
# 37 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
#if 0 /* expanded by -frewrite-includes */
#include <sys/_null.h>
#endif /* expanded by -frewrite-includes */
# 37 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
# 38 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 38 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
# 39 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
/*
* Prototype functions which were historically defined in <string.h>, but
* are required by POSIX to be prototyped in <strings.h>.
*/
#if __BSD_VISIBLE
#if 0 /* expanded by -frewrite-includes */
#include <strings.h>
#endif /* expanded by -frewrite-includes */
# 45 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
# 1 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/strings.h" 1
/*-
* 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$
*/
#ifndef _STRINGS_H_
#define _STRINGS_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 32 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/strings.h"
# 33 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/strings.h"
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 33 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/strings.h"
# 34 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/strings.h"
#ifndef _SIZE_T_DECLARED
typedef __size_t size_t;
#define _SIZE_T_DECLARED
#endif
# 39 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/strings.h"
__BEGIN_DECLS
#if __BSD_VISIBLE || __POSIX_VISIBLE <= 200112
int bcmp(const void *, const void *, size_t) __pure; /* LEGACY */
void bcopy(const void *, void *, size_t); /* LEGACY */
void bzero(void *, size_t); /* LEGACY */
#endif
# 46 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/strings.h"
#if __BSD_VISIBLE
void explicit_bzero(void *, size_t);
#endif
# 49 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/strings.h"
#if __XSI_VISIBLE
int ffs(int) __pure2;
#endif
# 52 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/strings.h"
#if __BSD_VISIBLE
int ffsl(long) __pure2;
int ffsll(long long) __pure2;
int fls(int) __pure2;
int flsl(long) __pure2;
int flsll(long long) __pure2;
#endif
# 59 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/strings.h"
#if __BSD_VISIBLE || __POSIX_VISIBLE <= 200112
char *index(const char *, int) __pure; /* LEGACY */
char *rindex(const char *, int) __pure; /* LEGACY */
#endif
# 63 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/strings.h"
int strcasecmp(const char *, const char *) __pure;
int strncasecmp(const char *, const char *, size_t) __pure;
#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_)
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_strings.h>
#endif /* expanded by -frewrite-includes */
# 67 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/strings.h"
# 1 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_strings.h" 1
/*-
* Copyright (c) 2011, 2012 The FreeBSD Foundation
* 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$
*/
#ifndef _LOCALE_T_DEFINED
#define _LOCALE_T_DEFINED
typedef struct _xlocale *locale_t;
#endif
# 33 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_strings.h"
/*
* This file is included from both strings.h and xlocale.h. We need to expose
* the declarations unconditionally if we are included from xlocale.h, but only
* if we are in POSIX2008 mode if included from string.h.
*/
#ifndef _XLOCALE_STRINGS1_H
#define _XLOCALE_STRINGS1_H
/*
* POSIX2008 functions
*/
int strcasecmp_l(const char *, const char *, locale_t);
int strncasecmp_l(const char *, const char *, size_t, locale_t);
#endif /* _XLOCALE_STRINGS1_H */
# 49 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_strings.h"
# 68 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/strings.h" 2
#endif
# 69 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/strings.h"
__END_DECLS
#endif /* _STRINGS_H_ */
# 72 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/strings.h"
# 46 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h" 2
#endif
# 47 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
#ifndef _SIZE_T_DECLARED
typedef __size_t size_t;
#define _SIZE_T_DECLARED
#endif
# 52 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
__BEGIN_DECLS
#if __XSI_VISIBLE >= 600
void *memccpy(void * __restrict, const void * __restrict, int, size_t);
#endif
# 57 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
void *memchr(const void *, int, size_t) __pure;
#if __BSD_VISIBLE
void *memrchr(const void *, int, size_t) __pure;
#endif
# 61 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
int memcmp(const void *, const void *, size_t) __pure;
void *memcpy(void * __restrict, const void * __restrict, size_t);
#if __BSD_VISIBLE
void *memmem(const void *, size_t, const void *, size_t) __pure;
#endif
# 66 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
void *memmove(void *, const void *, size_t);
void *memset(void *, int, size_t);
#if __POSIX_VISIBLE >= 200809
char *stpcpy(char * __restrict, const char * __restrict);
char *stpncpy(char * __restrict, const char * __restrict, size_t);
#endif
# 72 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
#if __BSD_VISIBLE
char *strcasestr(const char *, const char *) __pure;
#endif
# 75 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
char *strcat(char * __restrict, const char * __restrict);
char *strchr(const char *, int) __pure;
#if __BSD_VISIBLE
char *strchrnul(const char*, int) __pure;
#endif
# 80 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
int strcmp(const char *, const char *) __pure;
int strcoll(const char *, const char *);
char *strcpy(char * __restrict, const char * __restrict);
size_t strcspn(const char *, const char *) __pure;
#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
char *strdup(const char *) __malloc_like;
#endif
# 87 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
char *strerror(int);
#if __POSIX_VISIBLE >= 200112
int strerror_r(int, char *, size_t);
#endif
# 91 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
#if __BSD_VISIBLE
size_t strlcat(char * __restrict, const char * __restrict, size_t);
size_t strlcpy(char * __restrict, const char * __restrict, size_t);
#endif
# 95 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
size_t strlen(const char *) __pure;
#if __BSD_VISIBLE
void strmode(int, char *);
#endif
# 99 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
char *strncat(char * __restrict, const char * __restrict, size_t);
int strncmp(const char *, const char *, size_t) __pure;
char *strncpy(char * __restrict, const char * __restrict, size_t);
#if __POSIX_VISIBLE >= 200809
char *strndup(const char *, size_t) __malloc_like;
size_t strnlen(const char *, size_t) __pure;
#endif
# 106 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
#if __BSD_VISIBLE
char *strnstr(const char *, const char *, size_t) __pure;
#endif
# 109 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
char *strpbrk(const char *, const char *) __pure;
char *strrchr(const char *, int) __pure;
#if __BSD_VISIBLE
char *strsep(char **, const char *);
#endif
# 114 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
#if __POSIX_VISIBLE >= 200809
char *strsignal(int);
#endif
# 117 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
size_t strspn(const char *, const char *) __pure;
char *strstr(const char *, const char *) __pure;
char *strtok(char * __restrict, const char * __restrict);
#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500
char *strtok_r(char *, const char *, char **);
#endif
# 123 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
size_t strxfrm(char * __restrict, const char * __restrict, size_t);
#if __BSD_VISIBLE
#ifndef _SWAB_DECLARED
#define _SWAB_DECLARED
#ifndef _SSIZE_T_DECLARED
typedef __ssize_t ssize_t;
#define _SSIZE_T_DECLARED
#endif /* _SIZE_T_DECLARED */
# 133 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
void swab(const void * __restrict, void * __restrict, ssize_t);
#endif /* _SWAB_DECLARED */
# 136 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
#if __has_feature(capabilities)
__capability const void *
memchr_c_const(__capability const void *, int, size_t) __pure;
__capability void
*memchr_c(__capability const void *, int, size_t) __pure;
int memcmp_c(__capability const void *, __capability const void *, size_t)
__pure;
__capability void
*memcpy_c(__capability void * __restrict,
__capability const void * __restrict, size_t);
void *memcpy_c_fromcap(void * __restrict,
__capability const void * __restrict, size_t);
__capability void
*memcpy_c_tocap(__capability void * __restrict,
const void * __restrict, size_t);
__capability void
*memmove_c(__capability void * __restrict,
__capability const void * __restrict, size_t);
__capability void
*memset_c(__capability void *, int, size_t);
__capability char
*strchr_c(__capability const char *, int) __pure;
int strcmp_c(__capability const char *,
__capability const char *s2) __pure;
__capability char
*strcpy_c(__capability char * __restrict,
__capability const char * __restrict);
int strncmp_c(__capability const char *, __capability const char *,
size_t) __pure;
__capability char
*strncpy_c(__capability char * __restrict, __capability const char * __restrict,
size_t);
char *strncpy_c_fromcap(char * __restrict,
__capability const char * __restrict, size_t);
__capability char
*strncpy_c_tocap(__capability char * __restrict,
const char * __restrict, size_t);
size_t strnlen_c(__capability const char *, size_t) __pure;
#endif
# 177 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
int timingsafe_bcmp(const void *, const void *, size_t);
int timingsafe_memcmp(const void *, const void *, size_t);
#endif /* __BSD_VISIBLE */
# 181 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_)
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_string.h>
#endif /* expanded by -frewrite-includes */
# 183 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
# 1 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_string.h" 1
/*-
* Copyright (c) 2011, 2012 The FreeBSD Foundation
* 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$
*/
#ifndef _LOCALE_T_DEFINED
#define _LOCALE_T_DEFINED
typedef struct _xlocale *locale_t;
#endif
# 33 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_string.h"
/*
* This file is included from both string.h and xlocale.h. We need to expose
* the declarations unconditionally if we are included from xlocale.h, but only
* if we are in POSIX2008 mode if included from string.h.
*/
#ifndef _XLOCALE_STRING1_H
#define _XLOCALE_STRING1_H
/*
* POSIX2008 functions
*/
int strcoll_l(const char *, const char *, locale_t);
size_t strxfrm_l(char *, const char *, size_t, locale_t);
#endif /* _XLOCALE_STRING1_H */
# 49 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_string.h"
/*
* xlocale extensions
*/
#ifdef _XLOCALE_H_
#ifndef _XLOCALE_STRING2_H
#define _XLOCALE_STRING2_H
char *strcasestr_l(const char *, const char *, locale_t);
#endif /* _XLOCALE_STRING2_H */
# 59 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_string.h"
#endif /* _XLOCALE_H_ */
# 60 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_string.h"
# 184 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h" 2
#endif
# 185 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
__END_DECLS
#endif /* _STRING_H_ */
# 188 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/string.h"
# 35 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale.c" 2
#if 0 /* expanded by -frewrite-includes */
#include <runetype.h>
#endif /* expanded by -frewrite-includes */
# 35 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale.c"
# 1 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/runetype.h" 1
/*-
* Copyright (c) 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Paul Borman at Krystal Technologies.
*
* 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.
*
* @(#)runetype.h 8.1 (Berkeley) 6/2/93
* $FreeBSD$
*/
#ifndef _RUNETYPE_H_
#define _RUNETYPE_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 39 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/runetype.h"
# 40 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/runetype.h"
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 40 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/runetype.h"
# 41 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/runetype.h"
#define _CACHED_RUNES (1 <<8 ) /* Must be a power of 2 */
#define _CRMASK (~(_CACHED_RUNES - 1))
/*
* The lower 8 bits of runetype[] contain the digit value of the rune.
*/
typedef struct {
__rune_t __min; /* First rune of the range */
__rune_t __max; /* Last rune (inclusive) of the range */
__rune_t __map; /* What first maps to in maps */
unsigned long *__types; /* Array of types in range */
} _RuneEntry;
typedef struct {
int __nranges; /* Number of ranges stored */
_RuneEntry *__ranges; /* Pointer to the ranges */
} _RuneRange;
typedef struct {
char __magic[8]; /* Magic saying what version we are */
char __encoding[32]; /* ASCII name of this encoding */
__rune_t (*__sgetrune)(const char *, __size_t, char const **);
int (*__sputrune)(__rune_t, char *, __size_t, char **);
__rune_t __invalid_rune;
unsigned long __runetype[_CACHED_RUNES];
__rune_t __maplower[_CACHED_RUNES];
__rune_t __mapupper[_CACHED_RUNES];
/*
* The following are to deal with Runes larger than _CACHED_RUNES - 1.
* Their data is actually contiguous with this structure so as to make
* it easier to read/write from/to disk.
*/
_RuneRange __runetype_ext;
_RuneRange __maplower_ext;
_RuneRange __mapupper_ext;
void *__variable; /* Data which depends on the encoding */
int __variable_len; /* how long that data is */
} _RuneLocale;
#define _RUNE_MAGIC_1 "RuneMagi" /* Indicates version 0 of RuneLocale */
__BEGIN_DECLS
extern const _RuneLocale _DefaultRuneLocale;
extern const _RuneLocale *_CurrentRuneLocale;
#if defined(__NO_TLS) || defined(__RUNETYPE_INTERNAL)
extern const _RuneLocale *__getCurrentRuneLocale(void);
#else
# 92 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/runetype.h"
extern _Thread_local const _RuneLocale *_ThreadRuneLocale;
static __inline const _RuneLocale *__getCurrentRuneLocale(void)
{
if (_ThreadRuneLocale)
return _ThreadRuneLocale;
if (_CurrentRuneLocale)
return _CurrentRuneLocale;
return &_DefaultRuneLocale;
}
#endif /* __NO_TLS || __RUNETYPE_INTERNAL */
# 103 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/runetype.h"
#define _CurrentRuneLocale (__getCurrentRuneLocale())
__END_DECLS
#endif /* !_RUNETYPE_H_ */
# 107 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/runetype.h"
# 36 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale.c" 2
#if 0 /* expanded by -frewrite-includes */
#include "libc_private.h"
#endif /* expanded by -frewrite-includes */
# 36 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale.c"
# 1 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/include/libc_private.h" 1
/*
* Copyright (c) 1998 John Birrell <jb@cimlogic.com.au>.
* 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 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 JOHN BIRRELL 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$
*
* Private definitions for libc, libc_r and libpthread.
*
*/
#ifndef _LIBC_PRIVATE_H_
#define _LIBC_PRIVATE_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 37 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/include/libc_private.h"
# 38 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/include/libc_private.h"
#if 0 /* expanded by -frewrite-includes */
#include <sys/_pthreadtypes.h>
#endif /* expanded by -frewrite-includes */
# 38 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/include/libc_private.h"
# 39 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/include/libc_private.h"
/*
* This global flag is non-zero when a process has created one
* or more threads. It is used to avoid calling locking functions
* when they are not required.
*/
extern int __isthreaded;
/*
* Elf_Auxinfo *__elf_aux_vector, the pointer to the ELF aux vector
* provided by kernel. Either set for us by rtld, or found at runtime
* on stack for static binaries.
*
* Type is void to avoid polluting whole libc with ELF types.
*/
extern void *__elf_aux_vector;
/*
* libc should use libc_dlopen internally, which respects a global
* flag where loading of new shared objects can be restricted.
*/
void *libc_dlopen(const char *, int);
/*
* For dynamic linker.
*/
void _rtld_error(const char *fmt, ...);
/*
* File lock contention is difficult to diagnose without knowing
* where locks were set. Allow a debug library to be built which
* records the source file and line number of each lock call.
*/
#ifdef _FLOCK_DEBUG
#define _FLOCKFILE(x) _flockfile_debug(x, __FILE__, __LINE__)
#else
# 75 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/include/libc_private.h"
#define _FLOCKFILE(x) _flockfile(x)
#endif
# 77 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/include/libc_private.h"
/*
* Macros for locking and unlocking FILEs. These test if the
* process is threaded to avoid locking when not required.
*/
#define FLOCKFILE(fp) if (__isthreaded) _FLOCKFILE(fp)
#define FUNLOCKFILE(fp) if (__isthreaded) _funlockfile(fp)
struct _spinlock;
extern struct _spinlock __stdio_thread_lock __hidden;
#define STDIO_THREAD_LOCK() \
do { \
if (__isthreaded) \
_SPINLOCK(&__stdio_thread_lock); \
} while (0)
#define STDIO_THREAD_UNLOCK() \
do { \
if (__isthreaded) \
_SPINUNLOCK(&__stdio_thread_lock); \
} while (0)
void __libc_spinlock_stub(struct _spinlock *);
void __libc_spinunlock_stub(struct _spinlock *);
/*
* Indexes into the pthread jump table.
*
* Warning! If you change this type, you must also change the threads
* libraries that reference it (libc_r, libpthread).
*/
typedef enum {
PJT_ATFORK,
PJT_ATTR_DESTROY,
PJT_ATTR_GETDETACHSTATE,
PJT_ATTR_GETGUARDSIZE,
PJT_ATTR_GETINHERITSCHED,
PJT_ATTR_GETSCHEDPARAM,
PJT_ATTR_GETSCHEDPOLICY,
PJT_ATTR_GETSCOPE,
PJT_ATTR_GETSTACKADDR,
PJT_ATTR_GETSTACKSIZE,
PJT_ATTR_INIT,
PJT_ATTR_SETDETACHSTATE,
PJT_ATTR_SETGUARDSIZE,
PJT_ATTR_SETINHERITSCHED,
PJT_ATTR_SETSCHEDPARAM,
PJT_ATTR_SETSCHEDPOLICY,
PJT_ATTR_SETSCOPE,
PJT_ATTR_SETSTACKADDR,
PJT_ATTR_SETSTACKSIZE,
PJT_CANCEL,
PJT_CLEANUP_POP,
PJT_CLEANUP_PUSH,
PJT_COND_BROADCAST,
PJT_COND_DESTROY,
PJT_COND_INIT,
PJT_COND_SIGNAL,
PJT_COND_TIMEDWAIT,
PJT_COND_WAIT,
PJT_DETACH,
PJT_EQUAL,
PJT_EXIT,
PJT_GETSPECIFIC,
PJT_JOIN,
PJT_KEY_CREATE,
PJT_KEY_DELETE,
PJT_KILL,
PJT_MAIN_NP,
PJT_MUTEXATTR_DESTROY,
PJT_MUTEXATTR_INIT,
PJT_MUTEXATTR_SETTYPE,
PJT_MUTEX_DESTROY,
PJT_MUTEX_INIT,
PJT_MUTEX_LOCK,
PJT_MUTEX_TRYLOCK,
PJT_MUTEX_UNLOCK,
PJT_ONCE,
PJT_RWLOCK_DESTROY,
PJT_RWLOCK_INIT,
PJT_RWLOCK_RDLOCK,
PJT_RWLOCK_TRYRDLOCK,
PJT_RWLOCK_TRYWRLOCK,
PJT_RWLOCK_UNLOCK,
PJT_RWLOCK_WRLOCK,
PJT_SELF,
PJT_SETCANCELSTATE,
PJT_SETCANCELTYPE,
PJT_SETSPECIFIC,
PJT_SIGMASK,
PJT_TESTCANCEL,
PJT_CLEANUP_POP_IMP,
PJT_CLEANUP_PUSH_IMP,
PJT_CANCEL_ENTER,
PJT_CANCEL_LEAVE,
PJT_MUTEX_CONSISTENT,
PJT_MUTEXATTR_GETROBUST,
PJT_MUTEXATTR_SETROBUST,
PJT_MAX
} pjt_index_t;
typedef int (*pthread_func_t)(void);
typedef pthread_func_t pthread_func_entry_t[2];
extern pthread_func_entry_t __thr_jtable[];
void __set_error_selector(int *(*arg)(void));
int _pthread_mutex_init_calloc_cb_stub(pthread_mutex_t *mutex,
void *(calloc_cb)(__size_t, __size_t));
typedef int (*interpos_func_t)(void);
interpos_func_t *__libc_interposing_slot(int interposno);
extern interpos_func_t __libc_interposing[] __hidden;
enum {
INTERPOS_accept,
INTERPOS_accept4,
INTERPOS_aio_suspend,
INTERPOS_close,
INTERPOS_connect,
INTERPOS_fcntl,
INTERPOS_fsync,
INTERPOS_fork,
INTERPOS_msync,
INTERPOS_nanosleep,
INTERPOS_openat,
INTERPOS_poll,
INTERPOS_pselect,
INTERPOS_recvfrom,
INTERPOS_recvmsg,
INTERPOS_select,
INTERPOS_sendmsg,
INTERPOS_sendto,
INTERPOS_setcontext,
INTERPOS_sigaction,
INTERPOS_sigprocmask,
INTERPOS_sigsuspend,
INTERPOS_sigwait,
INTERPOS_sigtimedwait,
INTERPOS_sigwaitinfo,
INTERPOS_swapcontext,
INTERPOS_system,
INTERPOS_tcdrain,
INTERPOS_read,
INTERPOS_readv,
INTERPOS_wait4,
INTERPOS_write,
INTERPOS_writev,
INTERPOS__pthread_mutex_init_calloc_cb,
INTERPOS_spinlock,
INTERPOS_spinunlock,
INTERPOS_kevent,
INTERPOS_wait6,
INTERPOS_ppoll,
INTERPOS_map_stacks_exec,
INTERPOS_fdatasync,
INTERPOS_MAX
};
/*
* yplib internal interfaces
*/
#ifdef YP
int _yp_check(char **);
#endif
# 241 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/include/libc_private.h"
/*
* Initialise TLS for static programs
*/
void _init_tls(void);
/*
* Provides pthread_once()-like functionality for both single-threaded
* and multi-threaded applications.
*/
int _once(pthread_once_t *, void (*)(void));
/*
* Set the TLS thread pointer
*/
void _set_tp(void *tp);
/*
* This is a pointer in the C run-time startup code. It is used
* by getprogname() and setprogname().
*/
extern const char *__progname;
/*
* This function is used by the threading libraries to notify malloc that a
* thread is exiting.
*/
void _malloc_thread_cleanup(void);
/*
* This function is used by the threading libraries to notify libc that a
* thread is exiting, so its thread-local dtors should be called.
*/
void __cxa_thread_call_dtors(void);
/*
* These functions are used by the threading libraries in order to protect
* malloc across fork().
*/
void _malloc_prefork(void);
void _malloc_postfork(void);
void _malloc_first_thread(void);
/*
* Function to clean up streams, called from abort() and exit().
*/
extern void (*__cleanup)(void) __hidden;
/*
* Get kern.osreldate to detect ABI revisions. Explicitly
* ignores value of $OSVERSION and caches result.
*/
int __getosreldate(void);
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 295 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/include/libc_private.h"
# 296 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/include/libc_private.h"
#if 0 /* expanded by -frewrite-includes */
#include <sys/_sigset.h>
#endif /* expanded by -frewrite-includes */
# 296 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/include/libc_private.h"
# 297 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/include/libc_private.h"
struct aiocb;
struct fd_set;
struct iovec;
struct kevent;
struct msghdr;
struct pollfd;
struct rusage;
struct sigaction;
struct sockaddr;
struct timespec;
struct timeval;
struct timezone;
struct __siginfo;
struct __ucontext;
struct __wrusage;
enum idtype;
int __sys_aio_suspend(const struct aiocb * const[], int,
const struct timespec *);
int __sys_accept(int, struct sockaddr *, __socklen_t *);
int __sys_accept4(int, struct sockaddr *, __socklen_t *, int);
int __sys_clock_gettime(__clockid_t, struct timespec *ts);
int __sys_close(int);
int __sys_connect(int, const struct sockaddr *, __socklen_t);
/* fcntl declared to match the kernel so we can call directly */
int __sys_fcntl(int, int, __intptr_t);
int __sys_fdatasync(int);
int __sys_fsync(int);
__pid_t __sys_fork(void);
int __sys_ftruncate(int, __off_t);
int __sys_gettimeofday(struct timeval *, struct timezone *);
/* ioctl declared to match the kernel so we can call directly */
int __sys_ioctl(int, unsigned long, void *);
int __sys_kevent(int, const struct kevent *, int, struct kevent *,
int, const struct timespec *);
__off_t __sys_lseek(int, __off_t, int);
void *__sys_mmap(void *, __size_t, int, int, int, __off_t);
int __sys_msync(void *, __size_t, int);
int __sys_nanosleep(const struct timespec *, struct timespec *);
/* openat declared to match the kernel so we can call directly */
int __sys_openat(int, const char *, int, int);
int __sys_pselect(int, struct fd_set *, struct fd_set *,
struct fd_set *, const struct timespec *,
const __sigset_t *);
int __sys_ptrace(int, __pid_t, char *, int);
int __sys_poll(struct pollfd *, unsigned, int);
int __sys_ppoll(struct pollfd *, unsigned, const struct timespec *,
const __sigset_t *);
__ssize_t __sys_pread(int, void *, __size_t, __off_t);
__ssize_t __sys_pwrite(int, const void *, __size_t, __off_t);
__ssize_t __sys_read(int, void *, __size_t);
__ssize_t __sys_readv(int, const struct iovec *, int);
__ssize_t __sys_recv(int, void *, __size_t, int);
__ssize_t __sys_recvfrom(int, void *, __size_t, int, struct sockaddr *,
__socklen_t *);
__ssize_t __sys_recvmsg(int, struct msghdr *, int);
int __sys_select(int, struct fd_set *, struct fd_set *,
struct fd_set *, struct timeval *);
__ssize_t __sys_sendmsg(int, const struct msghdr *, int);
__ssize_t __sys_sendto(int, const void *, __size_t, int,
const struct sockaddr *, __socklen_t);
int __sys_setcontext(const struct __ucontext *);
int __sys_sigaction(int, const struct sigaction *,
struct sigaction *);
int __sys_sigprocmask(int, const __sigset_t *, __sigset_t *);
int __sys_sigsuspend(const __sigset_t *);
int __sys_sigtimedwait(const __sigset_t *, struct __siginfo *,
const struct timespec *);
int __sys_sigwait(const __sigset_t *, int *);
int __sys_sigwaitinfo(const __sigset_t *, struct __siginfo *);
int __sys_swapcontext(struct __ucontext *,
const struct __ucontext *);
int __sys_thr_kill(long, int);
int __sys_thr_self(long *);
int __sys_truncate(const char *, __off_t);
__pid_t __sys_wait4(__pid_t, int *, int, struct rusage *);
__pid_t __sys_wait6(enum idtype, __id_t, int *, int,
struct __wrusage *, struct __siginfo *);
__ssize_t __sys_write(int, const void *, __size_t);
__ssize_t __sys_writev(int, const struct iovec *, int);
int __libc_sigaction(int, const struct sigaction *,
struct sigaction *) __hidden;
int __libc_sigprocmask(int, const __sigset_t *, __sigset_t *)
__hidden;
int __libc_sigsuspend(const __sigset_t *) __hidden;
int __libc_sigwait(const __sigset_t * __restrict,
int * restrict sig);
int __libc_system(const char *);
int __libc_tcdrain(int);
int __fcntl_compat(int fd, int cmd, ...);
int __sys_futimens(int fd, const struct timespec *times) __hidden;
int __sys_utimensat(int fd, const char *path,
const struct timespec *times, int flag) __hidden;
/* execve() with PATH processing to implement posix_spawnp() */
int _execvpe(const char *, char * const *, char * const *);
int _elf_aux_info(int aux, void *buf, int buflen);
struct dl_phdr_info;
int __elf_phdr_match_addr(struct dl_phdr_info *, void *);
void __init_elf_aux_vector(void);
void __libc_map_stacks_exec(void);
void _pthread_cancel_enter(int);
void _pthread_cancel_leave(int);
#endif /* _LIBC_PRIVATE_H_ */
# 406 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/include/libc_private.h"
# 37 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale.c" 2
#if 0 /* expanded by -frewrite-includes */
#include "xlocale_private.h"
#endif /* expanded by -frewrite-includes */
# 37 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale.c"
# 1 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale_private.h" 1
/*-
* Copyright (c) 2011 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$
*/
#ifndef _XLOCALE_PRIVATE__H_
#define _XLOCALE_PRIVATE__H_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale.h>
#endif /* expanded by -frewrite-includes */
# 35 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale_private.h"
# 1 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h" 1
/*-
* 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$
*/
#ifndef _XLOCALE_H_
#define _XLOCALE_H_
#if 0 /* expanded by -frewrite-includes */
#include <locale.h>
#endif /* expanded by -frewrite-includes */
# 35 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
# 1 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/locale.h" 1
/*
* 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.
*
* @(#)locale.h 8.1 (Berkeley) 6/2/93
* $FreeBSD$
*/
#ifndef _LOCALE_H_
#define _LOCALE_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/_null.h>
#endif /* expanded by -frewrite-includes */
# 36 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/locale.h"
# 37 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/locale.h"
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;
};
#define LC_ALL 0
#define LC_COLLATE 1
#define LC_CTYPE 2
#define LC_MONETARY 3
#define LC_NUMERIC 4
#define LC_TIME 5
#define LC_MESSAGES 6
#define _LC_LAST 7 /* marks end */
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 75 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/locale.h"
# 76 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/locale.h"
__BEGIN_DECLS
struct lconv *localeconv(void);
char *setlocale(int, const char *);
#if __POSIX_VISIBLE >= 200809
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_locale.h>
#endif /* expanded by -frewrite-includes */
# 82 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/locale.h"
# 1 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_locale.h" 1
/*-
* 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$
*/
#ifndef _XLOCALE_LOCALE_H
#define _XLOCALE_LOCALE_H
/* Bit shifting order of LC_*_MASK should match XLC_* and LC_* order. */
#define LC_COLLATE_MASK (1<<0)
#define LC_CTYPE_MASK (1<<1)
#define LC_MONETARY_MASK (1<<2)
#define LC_NUMERIC_MASK (1<<3)
#define LC_TIME_MASK (1<<4)
#define LC_MESSAGES_MASK (1<<5)
#define LC_ALL_MASK (LC_COLLATE_MASK | LC_CTYPE_MASK | LC_MESSAGES_MASK | \
LC_MONETARY_MASK | LC_NUMERIC_MASK | LC_TIME_MASK)
#define LC_GLOBAL_LOCALE ((locale_t)-1)
#ifndef _LOCALE_T_DEFINED
#define _LOCALE_T_DEFINED
typedef struct _xlocale *locale_t;
#endif
# 50 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_locale.h"
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);
#endif /* _XLOCALE_LOCALE_H */
# 58 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_locale.h"
# 83 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/locale.h" 2
#endif
# 84 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/locale.h"
__END_DECLS
#endif /* _LOCALE_H_ */
# 88 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/locale.h"
# 36 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h" 2
__BEGIN_DECLS
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_locale.h>
#endif /* expanded by -frewrite-includes */
# 37 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
# 38 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
#ifdef _STRING_H_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_string.h>
#endif /* expanded by -frewrite-includes */
# 40 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
# 1 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_string.h" 1
/*-
* Copyright (c) 2011, 2012 The FreeBSD Foundation
* 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$
*/
#ifndef _LOCALE_T_DEFINED
#define _LOCALE_T_DEFINED
typedef struct _xlocale *locale_t;
#endif
# 33 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_string.h"
/*
* This file is included from both string.h and xlocale.h. We need to expose
* the declarations unconditionally if we are included from xlocale.h, but only
* if we are in POSIX2008 mode if included from string.h.
*/
#ifndef _XLOCALE_STRING1_H
#define _XLOCALE_STRING1_H
/*
* POSIX2008 functions
*/
int strcoll_l(const char *, const char *, locale_t);
size_t strxfrm_l(char *, const char *, size_t, locale_t);
#endif /* _XLOCALE_STRING1_H */
# 49 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_string.h"
/*
* xlocale extensions
*/
#ifdef _XLOCALE_H_
#ifndef _XLOCALE_STRING2_H
#define _XLOCALE_STRING2_H
char *strcasestr_l(const char *, const char *, locale_t);
#endif /* _XLOCALE_STRING2_H */
# 59 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_string.h"
#endif /* _XLOCALE_H_ */
# 60 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_string.h"
# 41 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h" 2
#endif
# 42 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
#ifdef _INTTYPES_H_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_inttypes.h>
#endif /* expanded by -frewrite-includes */
# 44 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
# 45 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
#endif
# 46 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
#ifdef _MONETARY_H_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_monetary.h>
#endif /* expanded by -frewrite-includes */
# 48 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
# 49 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
#endif
# 50 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
#ifdef _STDLIB_H_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_stdlib.h>
#endif /* expanded by -frewrite-includes */
# 52 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
# 53 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
#endif
# 54 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
#ifdef _TIME_H_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_time.h>
#endif /* expanded by -frewrite-includes */
# 56 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
# 1 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_time.h" 1
/*-
* 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$
*/
#ifndef _LOCALE_T_DEFINED
#define _LOCALE_T_DEFINED
typedef struct _xlocale *locale_t;
#endif
# 36 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_time.h"
/*
* This file is included from both locale.h and xlocale.h. We need to expose
* the declarations unconditionally if we are included from xlocale.h, but only
* if we are in POSIX2008 mode if included from locale.h.
*/
#ifndef _XLOCALE_LOCALE1_H
#define _XLOCALE_LOCALE1_H
size_t strftime_l(char * __restrict, size_t, const char * __restrict,
const struct tm * __restrict, locale_t) __strftimelike(3, 0);
#endif /* _XLOCALE_LOCALE1_H */
# 49 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_time.h"
#ifdef _XLOCALE_H_
#ifndef _XLOCALE_LOCALE2_H
#define _XLOCALE_LOCALE2_H
char *strptime_l(const char * __restrict, const char * __restrict,
struct tm * __restrict, locale_t);
#endif /* _XLOCALE_LOCALE2_H */
# 58 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_time.h"
#endif /* _XLOCALE_H_ */
# 59 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_time.h"
# 57 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h" 2
#endif
# 58 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
#ifdef _LANGINFO_H_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_langinfo.h>
#endif /* expanded by -frewrite-includes */
# 60 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
# 61 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
#endif
# 62 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
#ifdef _CTYPE_H_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_ctype.h>
#endif /* expanded by -frewrite-includes */
# 64 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
# 65 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
#endif
# 66 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
#ifdef _WCTYPE_H_
#define _XLOCALE_WCTYPES 1
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_ctype.h>
#endif /* expanded by -frewrite-includes */
# 69 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
# 70 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
#endif
# 71 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
#ifdef _STDIO_H_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_stdio.h>
#endif /* expanded by -frewrite-includes */
# 73 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
# 1 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_stdio.h" 1
/*-
* 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$
*/
int asprintf_l(char **, locale_t, const char *, ...) __printflike(3, 4);
int dprintf_l(int, locale_t, const char * __restrict, ...)
__printflike(3, 4);
int fprintf_l(FILE * __restrict, locale_t, const char * __restrict, ...)
__printflike(3, 4);
int fscanf_l(FILE * __restrict, locale_t, const char * __restrict, ...)
__scanflike(3, 4);
int printf_l(locale_t, const char * __restrict, ...) __printflike(2, 3);
int scanf_l(locale_t, const char * __restrict, ...) __scanflike(2, 3);
int snprintf_l(char * __restrict, size_t, locale_t,
const char * __restrict, ...) __printflike(4, 5);
int sprintf_l(char * __restrict, locale_t, const char * __restrict, ...)
__printflike(3, 4);
int sscanf_l(const char * __restrict, locale_t, const char * __restrict,
...) __scanflike(3, 4);
int vfprintf_l(FILE * __restrict, locale_t, const char * __restrict,
__va_list) __printflike(3, 0);
int vprintf_l(locale_t, const char * __restrict, __va_list)
__printflike(2, 0);
int vsprintf_l(char * __restrict, locale_t, const char * __restrict,
__va_list) __printflike(3, 0);
int vfscanf_l(FILE * __restrict, locale_t, const char * __restrict,
__va_list) __scanflike(3, 0);
int vscanf_l(locale_t, const char * __restrict, __va_list)
__scanflike(2, 0);
int vsnprintf_l(char * __restrict, size_t, locale_t,
const char * __restrict, __va_list) __printflike(4, 0);
int vsscanf_l(const char * __restrict, locale_t, const char * __restrict,
__va_list) __scanflike(3, 0);
int vdprintf_l(int, locale_t, const char * __restrict, __va_list)
__printflike(3, 0);
int vasprintf_l(char **, locale_t, const char *, __va_list)
__printflike(3, 0);
# 74 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h" 2
#endif
# 75 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
#ifdef _WCHAR_H_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_wchar.h>
#endif /* expanded by -frewrite-includes */
# 77 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
# 78 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
#endif
# 79 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
struct lconv *localeconv_l(locale_t);
__END_DECLS
#endif
# 86 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale.h"
# 36 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale_private.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <locale.h>
#endif /* expanded by -frewrite-includes */
# 36 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale_private.h"
# 37 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale_private.h"
#if 0 /* expanded by -frewrite-includes */
#include <stdlib.h>
#endif /* expanded by -frewrite-includes */
# 37 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale_private.h"
# 1 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h" 1
/*-
* 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.
*
* @(#)stdlib.h 8.5 (Berkeley) 5/19/95
* $FreeBSD$
*/
#ifndef _STDLIB_H_
#define _STDLIB_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 36 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
# 37 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
#if 0 /* expanded by -frewrite-includes */
#include <sys/_null.h>
#endif /* expanded by -frewrite-includes */
# 37 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
# 38 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 38 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
# 39 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
#if __BSD_VISIBLE
#ifndef _RUNE_T_DECLARED
typedef __rune_t rune_t;
#define _RUNE_T_DECLARED
#endif
# 45 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
#endif
# 46 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
#ifndef _SIZE_T_DECLARED
typedef __size_t size_t;
#define _SIZE_T_DECLARED
#endif
# 51 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
#ifndef __cplusplus
#ifndef _WCHAR_T_DECLARED
typedef ___wchar_t wchar_t;
#define _WCHAR_T_DECLARED
#endif
# 57 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
#endif
# 58 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
typedef struct {
int quot; /* quotient */
int rem; /* remainder */
} div_t;
typedef struct {
long quot;
long rem;
} ldiv_t;
#define EXIT_FAILURE 1
#define EXIT_SUCCESS 0
#define RAND_MAX 0x7ffffffd
__BEGIN_DECLS
#ifdef _XLOCALE_H_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_stdlib.h>
#endif /* expanded by -frewrite-includes */
# 76 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
# 1 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_stdlib.h" 1
/*-
* 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$
*/
/*
* Extended locale versions of the locale-aware functions from stdlib.h.
*
* Include <stdlib.h> before <xlocale.h> to expose these.
*/
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);
#define MB_CUR_MAX_L(x) ((size_t)___mb_cur_max_l(x))
#if __has_feature(capabilities)
long strtol_l_c(__capability const char *,
__capability char **, int, locale_t);
#endif
# 64 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/xlocale/_stdlib.h"
# 77 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h" 2
#endif
# 78 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
extern int __mb_cur_max;
extern int ___mb_cur_max(void);
#define MB_CUR_MAX ((size_t)___mb_cur_max())
_Noreturn void abort(void);
int abs(int) __pure2;
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) __malloc_like __result_use_check
__alloc_size(1) __alloc_size(2);
div_t div(int, int) __pure2;
_Noreturn void exit(int);
void free(void *);
char *getenv(const char *);
long labs(long) __pure2;
ldiv_t ldiv(long, long) __pure2;
void *malloc(size_t) __malloc_like __result_use_check __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) __result_use_check __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);
/*
* Functions added in C99 which we make conditionally available in the
* BSD^C89 namespace if the compiler supports `long long'.
* The #if test is more complicated than it ought to be because
* __BSD_VISIBLE implies __ISO_C_VISIBLE == 1999 *even if* `long long'
* is not supported in the compilation environment (which therefore means
* that it can't really be ISO C99).
*
* (The only other extension made by C99 in thie header is _Exit().)
*/
#if __ISO_C_VISIBLE >= 1999 || defined(__cplusplus)
#ifdef __LONG_LONG_SUPPORTED
/* LONGLONG */
typedef struct {
long long quot;
long long rem;
} lldiv_t;
/* LONGLONG */
long long
atoll(const char *);
/* LONGLONG */
long long
llabs(long long) __pure2;
/* LONGLONG */
lldiv_t lldiv(long long, long long) __pure2;
/* LONGLONG */
long long
strtoll(const char * __restrict, char ** __restrict, int);
/* LONGLONG */
unsigned long long
strtoull(const char * __restrict, char ** __restrict, int);
#endif /* __LONG_LONG_SUPPORTED */
# 151 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
_Noreturn void _Exit(int);
#endif /* __ISO_C_VISIBLE >= 1999 */
# 154 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
/*
* If we're in a mode greater than C99, expose C11 functions.
*/
#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L
void * aligned_alloc(size_t, size_t) __malloc_like __alloc_align(1)
__alloc_size(2);
int at_quick_exit(void (*)(void));
_Noreturn void
quick_exit(int);
#endif /* __ISO_C_VISIBLE >= 2011 */
# 165 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
/*
* Extensions made by POSIX relative to C.
*/
#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE
char *realpath(const char * __restrict, char * __restrict);
#endif
# 171 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
#if __POSIX_VISIBLE >= 199506
int rand_r(unsigned *); /* (TSF) */
#endif
# 174 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
#if __POSIX_VISIBLE >= 200112
int posix_memalign(void **, size_t, size_t) __nonnull(1); /* (ADV) */
int setenv(const char *, const char *, int);
int unsetenv(const char *);
#endif
# 179 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
#if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE
int getsubopt(char **, char *const *, char **);
#ifndef _MKDTEMP_DECLARED
char *mkdtemp(char *);
#define _MKDTEMP_DECLARED
#endif
# 186 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
#ifndef _MKSTEMP_DECLARED
int mkstemp(char *);
#define _MKSTEMP_DECLARED
#endif
# 190 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
#endif /* __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE */
# 191 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
/*
* The only changes to the XSI namespace in revision 6 were the deletion
* of the ttyslot() and valloc() functions, which FreeBSD never declared
* in this header. For revision 7, ecvt(), fcvt(), and gcvt(), which
* FreeBSD also does not have, and mktemp(), are to be deleted.
*/
#if __XSI_VISIBLE
/* XXX XSI requires pollution from <sys/wait.h> here. We'd rather not. */
long a64l(const char *);
double drand48(void);
/* char *ecvt(double, int, int * __restrict, int * __restrict); */
double erand48(unsigned short[3]);
/* char *fcvt(double, int, int * __restrict, int * __restrict); */
/* char *gcvt(double, int, int * __restrict, int * __restrict); */
int grantpt(int);
char *initstate(unsigned int, char *, size_t);
long jrand48(unsigned short[3]);
char *l64a(long);
void lcong48(unsigned short[7]);
long lrand48(void);
#if !defined(_MKTEMP_DECLARED) && (__BSD_VISIBLE || __XSI_VISIBLE <= 600)
char *mktemp(char *);
#define _MKTEMP_DECLARED
#endif
# 216 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
long mrand48(void);
long nrand48(unsigned short[3]);
int posix_openpt(int);
char *ptsname(int);
int putenv(char *);
long random(void);
unsigned short
*seed48(unsigned short[3]);
char *setstate(/* const */ char *);
void srand48(long);
void srandom(unsigned int);
int unlockpt(int);
#endif /* __XSI_VISIBLE */
# 229 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
#if __BSD_VISIBLE
extern const char *malloc_conf;
extern void (*malloc_message)(void *, const char *);
/*
* The alloca() function can't be implemented in C, and on some
* platforms it can't be implemented at all as a callable function.
* The GNU C compiler provides a built-in alloca() which we can use;
* in all other cases, provide a prototype, mainly to pacify various
* incarnations of lint. On platforms where alloca() is not in libc,
* programs which use it will fail to link when compiled with non-GNU
* compilers.
*/
#if __GNUC__ >= 2 || defined(__INTEL_COMPILER)
#undef alloca /* some GNU bits try to get cute and define this on their own */
#define alloca(sz) __builtin_alloca(sz)
#elif defined(lint)
# 247 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
void *alloca(size_t);
#endif
# 249 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
void abort2(const char *, int, void **) __dead2;
__uint32_t
arc4random(void);
void arc4random_addrandom(unsigned char *, int);
void arc4random_buf(void *, size_t);
void arc4random_stir(void);
__uint32_t
arc4random_uniform(__uint32_t);
#ifdef __BLOCKS__
int atexit_b(void (^)(void));
void *bsearch_b(const void *, const void *, size_t,
size_t, int (^)(const void *, const void *));
#endif
# 263 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
char *getbsize(int *, long *);
/* getcap(3) functions */
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);
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 *));
#ifdef __BLOCKS__
int heapsort_b(void *, size_t, size_t, int (^)(const void *, const void *));
void qsort_b(void *, size_t, size_t,
int (^)(const void *, const void *));
#endif
# 291 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
int l64a_r(long, char *, int);
int mergesort(void *, size_t, size_t, int (*)(const void *, const void *));
#ifdef __BLOCKS__
int mergesort_b(void *, size_t, size_t, int (^)(const void *, const void *));
#endif
# 296 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
int mkostemp(char *, int);
int mkostemps(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) __result_use_check __alloc_size(2)
__alloc_size(3);
void *reallocf(void *, size_t) __alloc_size(2);
int rpmatch(const char *);
void setprogname(const char *);
int sradixsort(const unsigned char **, int, const unsigned char *,
unsigned);
void sranddev(void);
void srandomdev(void);
long long
strtonum(const char *, long long, long long, const char **);
/* Deprecated interfaces, to be removed in FreeBSD 6.0. */
__int64_t
strtoq(const char *, char **, int);
__uint64_t
strtouq(const char *, char **, int);
#if __has_feature(capabilities)
long strtol_c(__capability const char * __restrict,
__capability char ** __restrict, int);
long double
strtold_c(__capability const char * __restrict,
__capability char ** __restrict);
#endif
# 327 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
extern char *suboptarg; /* getsubopt(3) external variable */
#endif /* __BSD_VISIBLE */
# 330 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
__END_DECLS
#endif /* !_STDLIB_H_ */
# 333 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../../include/stdlib.h"
# 38 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale_private.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 38 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale_private.h"
# 1 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdint.h" 1 3 4
/*-
* 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$
*/
#ifndef _SYS_STDINT_H_
#define _SYS_STDINT_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 32 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdint.h" 3 4
# 33 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdint.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 33 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdint.h" 3 4
# 34 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdint.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <machine/_stdint.h>
#endif /* expanded by -frewrite-includes */
# 35 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdint.h" 3 4
# 1 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_stdint.h" 1 3 4
/*-
* Copyright (c) 2001, 2002 Mike Barcroft <mike@FreeBSD.org>
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Klaus Klein.
*
* 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 NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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: src/sys/i386/include/_stdint.h,v 1.2 2004/05/18 16:04:57 stefanf
* $FreeBSD$
*/
#ifndef _MACHINE__STDINT_H_
#define _MACHINE__STDINT_H_
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)
#define INT8_C(c) (c)
#define INT16_C(c) (c)
#define INT32_C(c) (c)
#define UINT8_C(c) (c)
#define UINT16_C(c) (c)
#define UINT32_C(c) (c ## U)
#ifdef __mips_n64
#define INT64_C(c) (c ## L)
#define UINT64_C(c) (c ## UL)
#else
# 58 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_stdint.h" 3 4
#define INT64_C(c) (c ## LL)
#define UINT64_C(c) (c ## ULL)
#endif
# 61 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_stdint.h" 3 4
#define INTMAX_C(c) INT64_C(c)
#define UINTMAX_C(c) UINT64_C(c)
#endif /* !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) */
# 66 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_stdint.h" 3 4
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
#ifndef __INT64_C
#ifdef __mips_n64
#define __INT64_C(c) (c ## L)
#define __UINT64_C(c) (c ## UL)
#else
# 74 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_stdint.h" 3 4
#define __INT64_C(c) (c ## LL)
#define __UINT64_C(c) (c ## ULL)
#endif
# 77 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_stdint.h" 3 4
#endif
# 78 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_stdint.h" 3 4
/*
* ISO/IEC 9899:1999
* 7.18.2.1 Limits of exact-width integer types
*/
/* Minimum values of exact-width signed integer types. */
#define INT8_MIN (-0x7f-1)
#define INT16_MIN (-0x7fff-1)
#define INT32_MIN (-0x7fffffff-1)
#define INT64_MIN (-__INT64_C(0x7fffffffffffffff)-1)
/* Maximum values of exact-width signed integer types. */
#define INT8_MAX 0x7f
#define INT16_MAX 0x7fff
#define INT32_MAX 0x7fffffff
#define INT64_MAX __INT64_C(0x7fffffffffffffff)
/* Maximum values of exact-width unsigned integer types. */
#define UINT8_MAX 0xff
#define UINT16_MAX 0xffff
#define UINT32_MAX 0xffffffff
#define UINT64_MAX __UINT64_C(0xffffffffffffffff)
/*
* ISO/IEC 9899:1999
* 7.18.2.2 Limits of minimum-width integer types
*/
/* Minimum values of minimum-width signed integer types. */
#define INT_LEAST8_MIN INT8_MIN
#define INT_LEAST16_MIN INT16_MIN
#define INT_LEAST32_MIN INT32_MIN
#define INT_LEAST64_MIN INT64_MIN
/* Maximum values of minimum-width signed integer types. */
#define INT_LEAST8_MAX INT8_MAX
#define INT_LEAST16_MAX INT16_MAX
#define INT_LEAST32_MAX INT32_MAX
#define INT_LEAST64_MAX INT64_MAX
/* Maximum values of minimum-width unsigned integer types. */
#define UINT_LEAST8_MAX UINT8_MAX
#define UINT_LEAST16_MAX UINT16_MAX
#define UINT_LEAST32_MAX UINT32_MAX
#define UINT_LEAST64_MAX UINT64_MAX
/*
* ISO/IEC 9899:1999
* 7.18.2.3 Limits of fastest minimum-width integer types
*/
/* Minimum values of fastest minimum-width signed integer types. */
#define INT_FAST8_MIN INT32_MIN
#define INT_FAST16_MIN INT32_MIN
#define INT_FAST32_MIN INT32_MIN
#define INT_FAST64_MIN INT64_MIN
/* Maximum values of fastest minimum-width signed integer types. */
#define INT_FAST8_MAX INT32_MAX
#define INT_FAST16_MAX INT32_MAX
#define INT_FAST32_MAX INT32_MAX
#define INT_FAST64_MAX INT64_MAX
/* Maximum values of fastest minimum-width unsigned integer types. */
#define UINT_FAST8_MAX UINT32_MAX
#define UINT_FAST16_MAX UINT32_MAX
#define UINT_FAST32_MAX UINT32_MAX
#define UINT_FAST64_MAX UINT64_MAX
/*
* ISO/IEC 9899:1999
* 7.18.2.4 Limits of integer types capable of holding object pointers
*/
#ifdef __mips_n64
#define INTPTR_MIN INT64_MIN
#define INTPTR_MAX INT64_MAX
#define UINTPTR_MAX UINT64_MAX
#else
# 154 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_stdint.h" 3 4
#define INTPTR_MIN INT32_MIN
#define INTPTR_MAX INT32_MAX
#define UINTPTR_MAX UINT32_MAX
#endif
# 158 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_stdint.h" 3 4
/*
* ISO/IEC 9899:1999
* 7.18.2.5 Limits of greatest-width integer types
*/
#define INTMAX_MIN INT64_MIN
#define INTMAX_MAX INT64_MAX
#define UINTMAX_MAX UINT64_MAX
/*
* ISO/IEC 9899:1999
* 7.18.3 Limits of other integer types
*/
#ifdef __mips_n64
/* Limits of ptrdiff_t. */
#define PTRDIFF_MIN INT64_MIN
#define PTRDIFF_MAX INT64_MAX
/* Limit of size_t. */
#define SIZE_MAX UINT64_MAX
#else
# 179 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_stdint.h" 3 4
/* Limits of ptrdiff_t. */
#define PTRDIFF_MIN INT32_MIN
#define PTRDIFF_MAX INT32_MAX
/* Limit of size_t. */
#define SIZE_MAX UINT32_MAX
#endif
# 186 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_stdint.h" 3 4
/* Limits of sig_atomic_t. */
#define SIG_ATOMIC_MIN INT32_MIN
#define SIG_ATOMIC_MAX INT32_MAX
/* Limits of wint_t. */
#define WINT_MIN INT32_MIN
#define WINT_MAX INT32_MAX
#endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */
# 196 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_stdint.h" 3 4
#endif /* !_MACHINE__STDINT_H_ */
# 198 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/_stdint.h" 3 4
# 36 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdint.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_stdint.h>
#endif /* expanded by -frewrite-includes */
# 36 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdint.h" 3 4
# 1 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 1 3 4
/*-
* 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$
*/
#ifndef _SYS__STDINT_H_
#define _SYS__STDINT_H_
#ifndef _INT8_T_DECLARED
typedef __int8_t int8_t;
#define _INT8_T_DECLARED
#endif
# 37 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
#ifndef _INT16_T_DECLARED
typedef __int16_t int16_t;
#define _INT16_T_DECLARED
#endif
# 42 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
#ifndef _INT32_T_DECLARED
typedef __int32_t int32_t;
#define _INT32_T_DECLARED
#endif
# 47 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
#ifndef _INT64_T_DECLARED
typedef __int64_t int64_t;
#define _INT64_T_DECLARED
#endif
# 52 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
#ifndef _UINT8_T_DECLARED
typedef __uint8_t uint8_t;
#define _UINT8_T_DECLARED
#endif
# 57 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
#ifndef _UINT16_T_DECLARED
typedef __uint16_t uint16_t;
#define _UINT16_T_DECLARED
#endif
# 62 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
#ifndef _UINT32_T_DECLARED
typedef __uint32_t uint32_t;
#define _UINT32_T_DECLARED
#endif
# 67 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
#ifndef _UINT64_T_DECLARED
typedef __uint64_t uint64_t;
#define _UINT64_T_DECLARED
#endif
# 72 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
#ifndef _INTPTR_T_DECLARED
typedef __intptr_t intptr_t;
#define _INTPTR_T_DECLARED
#endif
# 77 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
#ifndef _UINTPTR_T_DECLARED
typedef __uintptr_t uintptr_t;
#define _UINTPTR_T_DECLARED
#endif
# 81 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
#ifndef _INTMAX_T_DECLARED
typedef __intmax_t intmax_t;
#define _INTMAX_T_DECLARED
#endif
# 85 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
#ifndef _UINTMAX_T_DECLARED
typedef __uintmax_t uintmax_t;
#define _UINTMAX_T_DECLARED
#endif
# 89 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
#ifdef __MEMADDR_TYPE__
typedef __MEMADDR_TYPE__ vaddr_t;
#elif defined(__CHERI_PURE_CAPABILITY__)
# 93 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
typedef __uintcap_t vaddr_t;
#else
# 95 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
typedef __uintptr_t vaddr_t;
#endif
# 97 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
#endif /* !_SYS__STDINT_H_ */
# 99 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_stdint.h" 3 4
# 37 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdint.h" 2 3 4
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;
/* GNU and Darwin define this and people seem to think it's portable */
#if defined(UINTPTR_MAX) && defined(UINT64_MAX) && (UINTPTR_MAX == UINT64_MAX)
#define __WORDSIZE 64
#else
# 62 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdint.h" 3 4
#define __WORDSIZE 32
#endif
# 64 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdint.h" 3 4
/* Limits of wchar_t. */
#define WCHAR_MIN __WCHAR_MIN
#define WCHAR_MAX __WCHAR_MAX
#endif /* !_SYS_STDINT_H_ */
# 70 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/stdint.h" 3 4
# 39 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale_private.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <sys/types.h>
#endif /* expanded by -frewrite-includes */
# 39 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale_private.h"
# 1 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 1 3 4
/*-
* 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.
* 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.
*
* @(#)types.h 8.6 (Berkeley) 2/19/95
* $FreeBSD$
*/
#ifndef _SYS_TYPES_H_
#define _SYS_TYPES_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 41 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
# 42 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
/* Machine type dependent parameters. */
#if 0 /* expanded by -frewrite-includes */
#include <machine/endian.h>
#endif /* expanded by -frewrite-includes */
# 44 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
# 1 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 1 3 4
/*-
* 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.
* 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.
*
* @(#)endian.h 7.8 (Berkeley) 4/3/91
* $FreeBSD$
*/
#ifndef _MACHINE_ENDIAN_H_
#define _MACHINE_ENDIAN_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 36 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
# 37 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
#ifndef __ASSEMBLER__
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 38 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
# 39 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
#endif
# 40 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
#ifdef __cplusplus
extern "C" {
#endif
# 44 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
/*
* Definitions for byte order, according to byte significance from low
* address to high.
*/
#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
#ifdef __MIPSEB__
#define _BYTE_ORDER _BIG_ENDIAN
#else
# 56 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
#define _BYTE_ORDER _LITTLE_ENDIAN
#endif /* __MIBSEB__ */
# 58 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
/*
* Deprecated variants that don't have enough underscores to be useful in more
* strict namespaces.
*/
#if __BSD_VISIBLE
#define LITTLE_ENDIAN _LITTLE_ENDIAN
#define BIG_ENDIAN _BIG_ENDIAN
#define PDP_ENDIAN _PDP_ENDIAN
#define BYTE_ORDER _BYTE_ORDER
#endif
# 69 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
#ifndef __ASSEMBLER__
#if defined(__GNUCLIKE_BUILTIN_CONSTANT_P) && defined(__OPTIMIZE__)
#define __is_constant(x) __builtin_constant_p(x)
#else
# 74 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
#define __is_constant(x) 0
#endif
# 76 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
#define __bswap16_const(x) (((x) >> 8) | (((x) << 8) & 0xff00))
#define __bswap32_const(x) (((x) >> 24) | (((x) >> 8) & 0xff00) | \
(((x) << 8) & 0xff0000) | (((x) << 24) & 0xff000000))
#define __bswap64_const(x) (((x) >> 56) | (((x) >> 40) & 0xff00) | \
(((x) >> 24) & 0xff0000) | (((x) >> 8) & 0xff000000) | \
(((x) << 8) & ((__uint64_t)0xff << 32)) | \
(((x) << 24) & ((__uint64_t)0xff << 40)) | \
(((x) << 40) & ((__uint64_t)0xff << 48)) | (((x) << 56)))
static __inline __uint16_t
__bswap16_var(__uint16_t _x)
{
return ((_x >> 8) | ((_x << 8) & 0xff00));
}
static __inline __uint32_t
__bswap32_var(__uint32_t _x)
{
return ((_x >> 24) | ((_x >> 8) & 0xff00) | ((_x << 8) & 0xff0000) |
((_x << 24) & 0xff000000));
}
static __inline __uint64_t
__bswap64_var(__uint64_t _x)
{
return ((_x >> 56) | ((_x >> 40) & 0xff00) | ((_x >> 24) & 0xff0000) |
((_x >> 8) & 0xff000000) | ((_x << 8) & ((__uint64_t)0xff << 32)) |
((_x << 24) & ((__uint64_t)0xff << 40)) |
((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56)));
}
#define __bswap16(x) ((__uint16_t)(__is_constant((x)) ? \
__bswap16_const((__uint16_t)(x)) : __bswap16_var((__uint16_t)(x))))
#define __bswap32(x) ((__uint32_t)(__is_constant((x)) ? \
__bswap32_const((__uint32_t)(x)) : __bswap32_var((__uint32_t)(x))))
#define __bswap64(x) ((__uint64_t)(__is_constant((x)) ? \
__bswap64_const((__uint64_t)(x)) : __bswap64_var((__uint64_t)(x))))
#ifdef __MIPSEB__
#define __htonl(x) ((__uint32_t)(x))
#define __htons(x) ((__uint16_t)(x))
#define __ntohl(x) ((__uint32_t)(x))
#define __ntohs(x) ((__uint16_t)(x))
/*
* Define the order of 32-bit words in 64-bit words.
*/
/*
* XXXMIPS: Additional parentheses to make gcc more happy.
*/
#define _QUAD_HIGHWORD 0
#define _QUAD_LOWWORD 1
#else
# 132 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
#define _QUAD_HIGHWORD 1
#define _QUAD_LOWWORD 0
#define __ntohl(x) (__bswap32((x)))
#define __ntohs(x) (__bswap16((x)))
#define __htonl(x) (__bswap32((x)))
#define __htons(x) (__bswap16((x)))
#endif /* _MIPSEB */
# 139 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
#endif /* _ASSEMBLER_ */
# 141 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
#ifdef __cplusplus
}
#endif
# 145 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
#endif /* !_MACHINE_ENDIAN_H_ */
# 147 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/endian.h" 3 4
# 45 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 45 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
# 46 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_pthreadtypes.h>
#endif /* expanded by -frewrite-includes */
# 47 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
# 48 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#if __BSD_VISIBLE
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
#ifndef _KERNEL
typedef unsigned short ushort; /* Sys V compatibility */
typedef unsigned int uint; /* Sys V compatibility */
#endif
# 58 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#endif
# 59 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
/*
* XXX POSIX sized integrals that should appear only in <sys/stdint.h>.
*/
#if 0 /* expanded by -frewrite-includes */
#include <sys/_stdint.h>
#endif /* expanded by -frewrite-includes */
# 63 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
# 64 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
typedef __uint8_t u_int8_t; /* unsigned integrals (deprecated) */
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;
typedef __uint64_t u_quad_t; /* quads (deprecated) */
typedef __int64_t quad_t;
typedef quad_t * qaddr_t;
typedef char * caddr_t; /* core address */
typedef const char * c_caddr_t; /* core address, pointer to const */
#ifndef _BLKSIZE_T_DECLARED
typedef __blksize_t blksize_t;
#define _BLKSIZE_T_DECLARED
#endif
# 81 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
typedef __cpuwhich_t cpuwhich_t;
typedef __cpulevel_t cpulevel_t;
typedef __cpusetid_t cpusetid_t;
#ifndef _BLKCNT_T_DECLARED
typedef __blkcnt_t blkcnt_t;
#define _BLKCNT_T_DECLARED
#endif
# 90 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _CLOCK_T_DECLARED
typedef __clock_t clock_t;
#define _CLOCK_T_DECLARED
#endif
# 95 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _CLOCKID_T_DECLARED
typedef __clockid_t clockid_t;
#define _CLOCKID_T_DECLARED
#endif
# 100 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
typedef __critical_t critical_t; /* Critical section value */
typedef __int64_t daddr_t; /* disk address */
#ifndef _DEV_T_DECLARED
typedef __dev_t dev_t; /* device number or struct cdev */
#define _DEV_T_DECLARED
#endif
# 108 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _FFLAGS_T_DECLARED
typedef __fflags_t fflags_t; /* file flags */
#define _FFLAGS_T_DECLARED
#endif
# 113 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
typedef __fixpt_t fixpt_t; /* fixed point number */
#ifndef _FSBLKCNT_T_DECLARED /* for statvfs() */
typedef __fsblkcnt_t fsblkcnt_t;
typedef __fsfilcnt_t fsfilcnt_t;
#define _FSBLKCNT_T_DECLARED
#endif
# 121 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _GID_T_DECLARED
typedef __gid_t gid_t; /* group id */
#define _GID_T_DECLARED
#endif
# 126 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _IN_ADDR_T_DECLARED
typedef __uint32_t in_addr_t; /* base type for internet address */
#define _IN_ADDR_T_DECLARED
#endif
# 131 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _IN_PORT_T_DECLARED
typedef __uint16_t in_port_t;
#define _IN_PORT_T_DECLARED
#endif
# 136 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _ID_T_DECLARED
typedef __id_t id_t; /* can hold a uid_t or pid_t */
#define _ID_T_DECLARED
#endif
# 141 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _INO_T_DECLARED
typedef __ino_t ino_t; /* inode number */
#define _INO_T_DECLARED
#endif
# 146 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _KEY_T_DECLARED
typedef __key_t key_t; /* IPC key (for Sys V IPC) */
#define _KEY_T_DECLARED
#endif
# 151 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _LWPID_T_DECLARED
typedef __lwpid_t lwpid_t; /* Thread ID (a.k.a. LWP) */
#define _LWPID_T_DECLARED
#endif
# 156 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _MODE_T_DECLARED
typedef __mode_t mode_t; /* permissions */
#define _MODE_T_DECLARED
#endif
# 161 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _ACCMODE_T_DECLARED
typedef __accmode_t accmode_t; /* access permissions */
#define _ACCMODE_T_DECLARED
#endif
# 166 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _NLINK_T_DECLARED
typedef __nlink_t nlink_t; /* link count */
#define _NLINK_T_DECLARED
#endif
# 171 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _OFF_T_DECLARED
typedef __off_t off_t; /* file offset */
#define _OFF_T_DECLARED
#endif
# 176 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _OFF64_T_DECLARED
typedef __off64_t off64_t; /* file offset (alias) */
#define _OFF64_T_DECLARED
#endif
# 181 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _PID_T_DECLARED
typedef __pid_t pid_t; /* process id */
#define _PID_T_DECLARED
#endif
# 186 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
typedef __register_t register_t;
#ifndef _RLIM_T_DECLARED
typedef __rlim_t rlim_t; /* resource limit */
#define _RLIM_T_DECLARED
#endif
# 193 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
typedef __int64_t sbintime_t;
typedef __segsz_t segsz_t; /* segment size (in pages) */
#ifndef _SIZE_T_DECLARED
typedef __size_t size_t;
#define _SIZE_T_DECLARED
#endif
# 202 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _SSIZE_T_DECLARED
typedef __ssize_t ssize_t;
#define _SSIZE_T_DECLARED
#endif
# 207 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _SUSECONDS_T_DECLARED
typedef __suseconds_t suseconds_t; /* microseconds (signed) */
#define _SUSECONDS_T_DECLARED
#endif
# 212 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _TIME_T_DECLARED
typedef __time_t time_t;
#define _TIME_T_DECLARED
#endif
# 217 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _TIMER_T_DECLARED
typedef __timer_t timer_t;
#define _TIMER_T_DECLARED
#endif
# 222 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _MQD_T_DECLARED
typedef __mqd_t mqd_t;
#define _MQD_T_DECLARED
#endif
# 227 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
typedef __u_register_t u_register_t;
#ifndef _UID_T_DECLARED
typedef __uid_t uid_t; /* user id */
#define _UID_T_DECLARED
#endif
# 234 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _USECONDS_T_DECLARED
typedef __useconds_t useconds_t; /* microseconds (unsigned) */
#define _USECONDS_T_DECLARED
#endif
# 239 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _CAP_IOCTL_T_DECLARED
#define _CAP_IOCTL_T_DECLARED
typedef unsigned long cap_ioctl_t;
#endif
# 244 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _CAP_RIGHTS_T_DECLARED
#define _CAP_RIGHTS_T_DECLARED
struct cap_rights;
typedef struct cap_rights cap_rights_t;
#endif
# 251 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
typedef __vm_offset_t vm_offset_t;
typedef __vm_ooffset_t vm_ooffset_t;
typedef __vm_paddr_t vm_paddr_t;
typedef __vm_pindex_t vm_pindex_t;
typedef __vm_size_t vm_size_t;
typedef __rman_res_t rman_res_t;
#ifdef _KERNEL
typedef int boolean_t;
typedef struct device *device_t;
typedef __intfptr_t intfptr_t;
/*
* XXX this is fixed width for historical reasons. It should have had type
* __int_fast32_t. Fixed-width types should not be used unless binary
* compatibility is essential. Least-width types should be used even less
* since they provide smaller benefits.
*
* XXX should be MD.
*
* XXX this is bogus in -current, but still used for spl*().
*/
typedef __uint32_t intrmask_t; /* Interrupt mask (spl, xxx_imask...) */
typedef __uintfptr_t uintfptr_t;
typedef __uint64_t uoff_t;
typedef char vm_memattr_t; /* memory attribute codes */
typedef struct vm_page *vm_page_t;
#if !defined(__bool_true_false_are_defined) && !defined(__cplusplus)
#define __bool_true_false_are_defined 1
#define false 0
#define true 1
#if __STDC_VERSION__ < 199901L && __GNUC__ < 3 && !defined(__INTEL_COMPILER)
typedef int _Bool;
#endif
# 289 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
typedef _Bool bool;
#endif /* !__bool_true_false_are_defined && !__cplusplus */
# 291 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#define offsetof(type, field) __offsetof(type, field)
#endif /* !_KERNEL */
# 295 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
/*
* The following are all things that really shouldn't exist in this header,
* since its purpose is to provide typedefs, not miscellaneous doodads.
*/
#ifdef __POPCNT__
#define __bitcount64(x) __builtin_popcountll((__uint64_t)(x))
#define __bitcount32(x) __builtin_popcount((__uint32_t)(x))
#define __bitcount16(x) __builtin_popcount((__uint16_t)(x))
#define __bitcountl(x) __builtin_popcountl((unsigned long)(x))
#define __bitcount(x) __builtin_popcount((unsigned int)(x))
#else
# 308 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
/*
* Population count algorithm using SWAR approach
* - "SIMD Within A Register".
*/
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);
}
#ifdef __LP64__
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);
}
#define __bitcountl(x) __bitcount64((unsigned long)(x))
#else
# 351 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
static __inline __uint64_t
__bitcount64(__uint64_t _x)
{
return (__bitcount32(_x >> 32) + __bitcount32(_x));
}
#define __bitcountl(x) __bitcount32((unsigned long)(x))
#endif
# 360 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#define __bitcount(x) __bitcount32((unsigned int)(x))
#endif
# 362 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#if __BSD_VISIBLE
#if 0 /* expanded by -frewrite-includes */
#include <sys/select.h>
#endif /* expanded by -frewrite-includes */
# 365 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
# 1 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 1 3 4
/*-
* 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.
* 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.
*
* $FreeBSD$
*/
#ifndef _SYS_SELECT_H_
#define _SYS_SELECT_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 35 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
# 36 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 36 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
# 37 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_sigset.h>
#endif /* expanded by -frewrite-includes */
# 38 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
# 39 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_timeval.h>
#endif /* expanded by -frewrite-includes */
# 39 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
# 1 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_timeval.h" 1 3 4
/*-
* 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$
*/
#ifndef _SYS__TIMEVAL_H_
#define _SYS__TIMEVAL_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 32 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_timeval.h" 3 4
# 33 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_timeval.h" 3 4
#ifndef _SUSECONDS_T_DECLARED
typedef __suseconds_t suseconds_t;
#define _SUSECONDS_T_DECLARED
#endif
# 38 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_timeval.h" 3 4
#ifndef _TIME_T_DECLARED
typedef __time_t time_t;
#define _TIME_T_DECLARED
#endif
# 43 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_timeval.h" 3 4
/*
* Structure returned by gettimeofday(2) system call, and used in other calls.
*/
struct timeval {
time_t tv_sec; /* seconds */
suseconds_t tv_usec; /* and microseconds */
};
#endif /* !_SYS__TIMEVAL_H_ */
# 53 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/_timeval.h" 3 4
# 40 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/timespec.h>
#endif /* expanded by -frewrite-includes */
# 40 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
# 41 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
typedef unsigned long __fd_mask;
#if __BSD_VISIBLE
typedef __fd_mask fd_mask;
#endif
# 46 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
#ifndef _SIGSET_T_DECLARED
#define _SIGSET_T_DECLARED
typedef __sigset_t sigset_t;
#endif
# 51 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
/*
* 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.
*/
#ifndef FD_SETSIZE
#define FD_SETSIZE 1024
#endif
# 61 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
#define _NFDBITS (sizeof(__fd_mask) * 8) /* bits per mask */
#if __BSD_VISIBLE
#define NFDBITS _NFDBITS
#endif
# 66 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
#ifndef _howmany
#define _howmany(x, y) (((x) + ((y) - 1)) / (y))
#endif
# 70 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
typedef struct fd_set {
__fd_mask __fds_bits[_howmany(FD_SETSIZE, _NFDBITS)];
} fd_set;
#if __BSD_VISIBLE
#define fds_bits __fds_bits
#endif
# 77 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
#define __fdset_mask(n) ((__fd_mask)1 << ((n) % _NFDBITS))
#define FD_CLR(n, p) ((p)->__fds_bits[(n)/_NFDBITS] &= ~__fdset_mask(n))
#if __BSD_VISIBLE
#define FD_COPY(f, t) (void)(*(t) = *(f))
#endif
# 83 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
#define FD_ISSET(n, p) (((p)->__fds_bits[(n)/_NFDBITS] & __fdset_mask(n)) != 0)
#define FD_SET(n, p) ((p)->__fds_bits[(n)/_NFDBITS] |= __fdset_mask(n))
#define FD_ZERO(p) do { \
fd_set *_p; \
__size_t _n; \
\
_p = (p); \
_n = _howmany(FD_SETSIZE, _NFDBITS); \
while (_n > 0) \
_p->__fds_bits[--_n] = 0; \
} while (0)
#ifndef _KERNEL
__BEGIN_DECLS
int pselect(int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict,
const struct timespec *__restrict, const sigset_t *__restrict);
#ifndef _SELECT_DECLARED
#define _SELECT_DECLARED
/* XXX missing restrict type-qualifier */
int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
#endif
# 105 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
__END_DECLS
#endif /* !_KERNEL */
# 107 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
#endif /* _SYS_SELECT_H_ */
# 109 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/select.h" 3 4
# 366 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 2 3 4
/*
* minor() gives a cookie instead of an index since we don't want to
* change the meanings of bits 0-15 or waste time and space shifting
* bits 16-31 for devices that don't use them.
*/
#define major(x) ((int)(((u_int)(x) >> 8)&0xff)) /* major number */
#define minor(x) ((int)((x)&0xffff00ff)) /* minor number */
#define makedev(x,y) ((dev_t)(((x) << 8) | (y))) /* create dev_t */
/*
* These declarations belong elsewhere, but are repeated here and in
* <stdio.h> to give broken programs a better chance of working with
* 64-bit off_t's.
*/
#ifndef _KERNEL
__BEGIN_DECLS
#ifndef _FTRUNCATE_DECLARED
#define _FTRUNCATE_DECLARED
int ftruncate(int, off_t);
#endif
# 387 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _LSEEK_DECLARED
#define _LSEEK_DECLARED
off_t lseek(int, off_t, int);
#endif
# 391 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _MMAP_DECLARED
#define _MMAP_DECLARED
void * mmap(void *, size_t, int, int, int, off_t);
#endif
# 395 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#ifndef _TRUNCATE_DECLARED
#define _TRUNCATE_DECLARED
int truncate(const char *, off_t);
#endif
# 399 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
__END_DECLS
#endif /* !_KERNEL */
# 401 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#endif /* __BSD_VISIBLE */
# 403 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
#endif /* !_SYS_TYPES_H_ */
# 405 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/sys/types.h" 3 4
# 40 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale_private.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <machine/atomic.h>
#endif /* expanded by -frewrite-includes */
# 40 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale_private.h"
# 1 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 1 3 4
/*-
* Copyright (c) 1998 Doug Rabson
* 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.
*
* from: src/sys/alpha/include/atomic.h,v 1.21.2.3 2005/10/06 18:12:05 jhb
* $FreeBSD$
*/
#ifndef _MACHINE_ATOMIC_H_
#define _MACHINE_ATOMIC_H_
#ifndef _SYS_CDEFS_H_
#error this file needs sys/cdefs.h as a prerequisite
#endif
# 36 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
/*
* Note: All the 64-bit atomic operations are only atomic when running
* in 64-bit mode. It is assumed that code compiled for n32 and n64
* fits into this definition and no further safeties are needed.
*
* It is also assumed that the add, subtract and other arithmetic is
* done on numbers not pointers. The special rules for n32 pointers
* do not have atomic operations defined for them, but generally shouldn't
* need atomic operations.
*/
#ifndef __MIPS_PLATFORM_SYNC_NOPS
#define __MIPS_PLATFORM_SYNC_NOPS ""
#endif
# 50 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
static __inline void
mips_sync(void)
{
__asm __volatile (".set noreorder\n"
"\tsync\n"
__MIPS_PLATFORM_SYNC_NOPS
".set reorder\n"
: : : "memory");
}
#define mb() mips_sync()
#define wmb() mips_sync()
#define rmb() mips_sync()
/*
* Various simple arithmetic on memory which is atomic in the presence
* of interrupts and SMP safe.
*/
void atomic_set_8(__volatile uint8_t *, uint8_t);
void atomic_clear_8(__volatile uint8_t *, uint8_t);
void atomic_add_8(__volatile uint8_t *, uint8_t);
void atomic_subtract_8(__volatile uint8_t *, uint8_t);
void atomic_set_16(__volatile uint16_t *, uint16_t);
void atomic_clear_16(__volatile uint16_t *, uint16_t);
void atomic_add_16(__volatile uint16_t *, uint16_t);
void atomic_subtract_16(__volatile uint16_t *, uint16_t);
/* Work around https://github.com/CTSRD-CHERI/qemu/issues/4 */
#define QEMU_TLB_WORKAROUND32(register) \
"clw $zero, $zero, 0(" register ")\n\t"
#define QEMU_TLB_WORKAROUND64(register) \
"cld $zero, $zero, 0(" register ")\n\t"
static __inline void
atomic_set_32(__volatile uint32_t *p, uint32_t v)
{
uint32_t temp;
#ifndef __CHERI_PURE_CAPABILITY__
__asm __volatile (
"1:\tll %0, %1\n\t" /* load old value */
"or %0, %2, %0\n\t" /* calculate new value */
"sc %0, %1\n\t" /* attempt to store */
"beqz %0, 1b\n\t" /* spin if failed */
: "=&r" (temp), "+m" (*p)
: "r" (v)
: "memory");
#else
# 102 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
__asm __volatile (
"1:\n\t"
QEMU_TLB_WORKAROUND32("%1")
"cllw %0, %1\n\t" /* load old value */
"or %0, %2, %0\n\t" /* calculate new value */
"cscw %0, %0, %1\n\t" /* attempt to store */
"beqz %0, 1b\n\t" /* spin if failed */
: "=&r" (temp), "+C" (p)
: "r" (v)
: "memory");
#endif
# 113 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
}
static __inline void
atomic_clear_32(__volatile uint32_t *p, uint32_t v)
{
uint32_t temp;
v = ~v;
#ifndef __CHERI_PURE_CAPABILITY__
__asm __volatile (
"1:\tll %0, %1\n\t" /* load old value */
"and %0, %2, %0\n\t" /* calculate new value */
"sc %0, %1\n\t" /* attempt to store */
"beqz %0, 1b\n\t" /* spin if failed */
: "=&r" (temp), "+m" (*p)
: "r" (v)
: "memory");
#else
# 132 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
__asm __volatile (
"1:\n\t"
QEMU_TLB_WORKAROUND32("%1")
"cllw %0, %1\n\t" /* load old value */
"and %0, %2, %0\n\t" /* calculate new value */
"cscw %0, %0, %1\n\t" /* attempt to store */
"beqz %0, 1b\n\t" /* spin if failed */
: "=&r" (temp), "+C" (p)
: "r" (v)
: "memory");
#endif
# 143 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
}
static __inline void
atomic_add_32(__volatile uint32_t *p, uint32_t v)
{
uint32_t temp;
#ifndef __CHERI_PURE_CAPABILITY__
__asm __volatile (
"1:\tll %0, %1\n\t" /* load old value */
"addu %0, %2, %0\n\t" /* calculate new value */
"sc %0, %1\n\t" /* attempt to store */
"beqz %0, 1b\n\t" /* spin if failed */
: "=&r" (temp), "+m" (*p)
: "r" (v)
: "memory");
#else
# 160 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
__asm __volatile (
"1:\n\t"
QEMU_TLB_WORKAROUND32("%1")
"cllw %0, %1\n\t" /* load old value */
"addu %0, %2, %0\n\t" /* calculate new value */
"cscw %0, %0, %1\n\t" /* attempt to store */
"beqz %0, 1b\n\t" /* spin if failed */
: "=&r" (temp), "+C" (p)
: "r" (v)
: "memory");
#endif
# 171 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
}
static __inline void
atomic_subtract_32(__volatile uint32_t *p, uint32_t v)
{
uint32_t temp;
#ifndef __CHERI_PURE_CAPABILITY__
__asm __volatile (
"1:\tll %0, %1\n\t" /* load old value */
"subu %0, %2\n\t" /* calculate new value */
"sc %0, %1\n\t" /* attempt to store */
"beqz %0, 1b\n\t" /* spin if failed */
: "=&r" (temp), "+m" (*p)
: "r" (v)
: "memory");
#else
# 188 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
__asm __volatile (
"1:\n\t"
QEMU_TLB_WORKAROUND32("%1")
"cllw %0, %1\n\t" /* load old value */
"subu %0, %2\n\t" /* calculate new value */
"cscw %0, %0, %1\n\t" /* attempt to store */
"beqz %0, 1b\n\t" /* spin if failed */
: "=&r" (temp), "+C" (p)
: "r" (v)
: "memory");
#endif
# 199 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
}
static __inline uint32_t
atomic_readandclear_32(__volatile uint32_t *addr)
{
uint32_t result,temp;
#ifndef __CHERI_PURE_CAPABILITY__
__asm __volatile (
"1:\tll %0,%2\n\t" /* load current value, asserting lock */
"li %1,0\n\t" /* value to store */
"sc %1,%2\n\t" /* attempt to store */
"beqz %1, 1b\n\t" /* if the store failed, spin */
: "=&r"(result), "=&r"(temp), "+m" (*addr)
:
: "memory");
#else
# 216 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
__asm __volatile (
"1:\n\t"
QEMU_TLB_WORKAROUND32("%2")
"cllw %0, %2\n\t" /* load current value, asserting lock */
"li %1, 0\n\t" /* value to store */
"cscw %1, %1, %2\n\t" /* attempt to store */
"beqz %1, 1b\n\t" /* if the store failed, spin */
: "=&r"(result), "=&r"(temp), "+C" (addr)
:
: "memory");
#endif
# 227 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
return result;
}
static __inline uint32_t
atomic_readandset_32(__volatile uint32_t *addr, uint32_t value)
{
uint32_t result,temp;
#ifndef __CHERI_PURE_CAPABILITY__
__asm __volatile (
"1:\tll %0,%2\n\t" /* load current value, asserting lock */
"or %1,$0,%3\n\t"
"sc %1,%2\n\t" /* attempt to store */
"beqz %1, 1b\n\t" /* if the store failed, spin */
: "=&r"(result), "=&r"(temp), "+m" (*addr)
: "r" (value)
: "memory");
#else
# 246 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
__asm __volatile (
"1:\n\t"
QEMU_TLB_WORKAROUND32("%2")
"cllw %0, %2\n\t" /* load current value, asserting lock */
"or %1, $0, %3\n\t"
"cscw %1, %1, %2\n\t" /* attempt to store */
"beqz %1, 1b\n\t" /* if the store failed, spin */
: "=&r"(result), "=&r"(temp), "+C" (addr)
: "r" (value)
: "memory");
#endif
# 257 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
return result;
}
#if defined(__mips_n64) || defined(__mips_n32)
static __inline void
atomic_set_64(__volatile uint64_t *p, uint64_t v)
{
uint64_t temp;
#ifndef __CHERI_PURE_CAPABILITY__
__asm __volatile (
"1:\n\t"
"lld %0, %1\n\t" /* load old value */
"or %0, %2, %0\n\t" /* calculate new value */
"scd %0, %1\n\t" /* attempt to store */
"beqz %0, 1b\n\t" /* spin if failed */
: "=&r" (temp), "+m" (*p)
: "r" (v)
: "memory");
#else
# 278 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
__asm __volatile (
"1:\n\t"
QEMU_TLB_WORKAROUND64("%1")
"clld %0, %1\n\t" /* load old value */
"or %0, %2, %0\n\t" /* calculate new value */
"cscd %0, %0, %1\n\t" /* attempt to store */
"beqz %0, 1b\n\t" /* spin if failed */
: "=&r" (temp), "+C" (p)
: "r" (v)
: "memory");
#endif
# 289 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
}
static __inline void
atomic_clear_64(__volatile uint64_t *p, uint64_t v)
{
uint64_t temp;
v = ~v;
#ifndef __CHERI_PURE_CAPABILITY__
__asm __volatile (
"1:\n\t"
"lld %0, %1\n\t" /* load old value */
"and %0, %2, %0\n\t" /* calculate new value */
"scd %0, %1\n\t" /* attempt to store */
"beqz %0, 1b\n\t" /* spin if failed */
: "=&r" (temp), "+m" (*p)
: "r" (v)
: "memory");
#else
# 309 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
__asm __volatile (
"1:\n\t"
QEMU_TLB_WORKAROUND64("%1")
"clld %0, %1\n\t" /* load old value */
"and %0, %2, %0\n\t" /* calculate new value */
"cscd %0, %0, %1\n\t" /* attempt to store */
"beqz %0, 1b\n\t" /* spin if failed */
: "=&r" (temp), "+C" (p)
: "r" (v)
: "memory");
#endif
# 320 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
}
static __inline void
atomic_add_64(__volatile uint64_t *p, uint64_t v)
{
uint64_t temp;
#ifndef __CHERI_PURE_CAPABILITY__
__asm __volatile (
"1:\n\t"
"lld %0, %1\n\t" /* load old value */
"daddu %0, %2, %0\n\t" /* calculate new value */
"scd %0, %1\n\t" /* attempt to store */
"beqz %0, 1b\n\t" /* spin if failed */
: "=&r" (temp), "+m" (*p)
: "r" (v)
: "memory");
#else
# 338 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
__asm __volatile (
"1:\n\t"
QEMU_TLB_WORKAROUND64("%1")
"clld %0, %1\n\t" /* load old value */
"daddu %0, %2, %0\n\t" /* calculate new value */
"cscd %0, %0, %1\n\t" /* attempt to store */
"beqz %0, 1b\n\t" /* spin if failed */
: "=&r" (temp), "+C" (p)
: "r" (v)
: "memory");
#endif
# 349 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
}
static __inline void
atomic_subtract_64(__volatile uint64_t *p, uint64_t v)
{
uint64_t temp;
#ifndef __CHERI_PURE_CAPABILITY__
__asm __volatile (
"1:\n\t"
"lld %0, %1\n\t" /* load old value */
"dsubu %0, %2\n\t" /* calculate new value */
"scd %0, %1\n\t" /* attempt to store */
"beqz %0, 1b\n\t" /* spin if failed */
: "=&r" (temp), "+m" (*p)
: "r" (v)
: "memory");
#else
# 367 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
__asm __volatile (
"1:\n\t"
QEMU_TLB_WORKAROUND64("%1")
"clld %0, %1\n\t" /* load old value */
"dsubu %0, %2\n\t" /* calculate new value */
"cscd %0, %0, %1\n\t" /* attempt to store */
"beqz %0, 1b\n\t" /* spin if failed */
: "=&r" (temp), "+C" (p)
: "r" (v)
: "memory");
#endif
# 378 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
}
static __inline uint64_t
atomic_readandclear_64(__volatile uint64_t *addr)
{
uint64_t result,temp;
#ifndef __CHERI_PURE_CAPABILITY__
__asm __volatile (
"1:\n\t"
"lld %0, %2\n\t" /* load old value */
"li %1, 0\n\t" /* value to store */
"scd %1, %2\n\t" /* attempt to store */
"beqz %1, 1b\n\t" /* if the store failed, spin */
: "=&r"(result), "=&r"(temp), "+m" (*addr)
:
: "memory");
#else
# 396 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
__asm __volatile (
"1:\n\t"
QEMU_TLB_WORKAROUND64("%2")
"clld %0, %2\n\t" /* load old value */
"li %1, 0\n\t" /* value to store */
"cscd %1, %1, %2\n\t" /* attempt to store */
"beqz %1, 1b\n\t" /* if the store failed, spin */
: "=&r"(result), "=&r"(temp), "+C" (addr)
:
: "memory");
#endif
# 407 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
return result;
}
static __inline uint64_t
atomic_readandset_64(__volatile uint64_t *addr, uint64_t value)
{
uint64_t result,temp;
#ifndef __CHERI_PURE_CAPABILITY__
__asm __volatile (
"1:\n\t"
"lld %0,%2\n\t" /* Load old value*/
"or %1,$0,%3\n\t"
"scd %1,%2\n\t" /* attempt to store */
"beqz %1, 1b\n\t" /* if the store failed, spin */
: "=&r"(result), "=&r"(temp), "+m" (*addr)
: "r" (value)
: "memory");
#else
# 427 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
__asm __volatile (
"1:\n\t"
QEMU_TLB_WORKAROUND64("%2")
"clld %0, %2\n\t" /* load old value*/
"or %1, $0, %3\n\t"
"cscd %1, %1, %2\n\t" /* attempt to store */
"beqz %1, 1b\n\t" /* if the store failed, spin */
: "=&r"(result), "=&r"(temp), "+C" (addr)
: "r" (value)
: "memory");
#endif
# 438 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
return result;
}
#endif
# 442 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
#define ATOMIC_ACQ_REL(NAME, WIDTH) \
static __inline void \
atomic_##NAME##_acq_##WIDTH(__volatile uint##WIDTH##_t *p, uint##WIDTH##_t v)\
{ \
atomic_##NAME##_##WIDTH(p, v); \
mips_sync(); \
} \
\
static __inline void \
atomic_##NAME##_rel_##WIDTH(__volatile uint##WIDTH##_t *p, uint##WIDTH##_t v)\
{ \
mips_sync(); \
atomic_##NAME##_##WIDTH(p, v); \
}
/* Variants of simple arithmetic with memory barriers. */
ATOMIC_ACQ_REL(set, 8)
ATOMIC_ACQ_REL(clear, 8)
ATOMIC_ACQ_REL(add, 8)
ATOMIC_ACQ_REL(subtract, 8)
ATOMIC_ACQ_REL(set, 16)
ATOMIC_ACQ_REL(clear, 16)
ATOMIC_ACQ_REL(add, 16)
ATOMIC_ACQ_REL(subtract, 16)
ATOMIC_ACQ_REL(set, 32)
ATOMIC_ACQ_REL(clear, 32)
ATOMIC_ACQ_REL(add, 32)
ATOMIC_ACQ_REL(subtract, 32)
#if defined(__mips_n64) || defined(__mips_n32)
ATOMIC_ACQ_REL(set, 64)
ATOMIC_ACQ_REL(clear, 64)
ATOMIC_ACQ_REL(add, 64)
ATOMIC_ACQ_REL(subtract, 64)
#endif
# 477 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
#undef ATOMIC_ACQ_REL
/*
* We assume that a = b will do atomic loads and stores.
*/
#define ATOMIC_STORE_LOAD(WIDTH) \
static __inline uint##WIDTH##_t \
atomic_load_acq_##WIDTH(__volatile uint##WIDTH##_t *p) \
{ \
uint##WIDTH##_t v; \
\
v = *p; \
mips_sync(); \
return (v); \
} \
\
static __inline void \
atomic_store_rel_##WIDTH(__volatile uint##WIDTH##_t *p, uint##WIDTH##_t v)\
{ \
mips_sync(); \
*p = v; \
}
ATOMIC_STORE_LOAD(32)
ATOMIC_STORE_LOAD(64)
#if !defined(__mips_n64) && !defined(__mips_n32)
void atomic_store_64(__volatile uint64_t *, uint64_t *);
void atomic_load_64(__volatile uint64_t *, uint64_t *);
#else
# 507 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
static __inline void
atomic_store_64(__volatile uint64_t *p, uint64_t *v)
{
*p = *v;
}
static __inline void
atomic_load_64(__volatile uint64_t *p, uint64_t *v)
{
*v = *p;
}
#endif
# 519 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
#undef ATOMIC_STORE_LOAD
/*
* Atomically compare the value stored at *p with cmpval and if the
* two values are equal, update the value of *p with newval. Returns
* zero if the compare failed, nonzero otherwise.
*/
static __inline uint32_t
atomic_cmpset_32(__volatile uint32_t* p, uint32_t cmpval, uint32_t newval)
{
uint32_t ret;
#ifndef __CHERI_PURE_CAPABILITY__
__asm __volatile (
"1:\tll %0, %1\n\t" /* load old value */
"bne %0, %2, 2f\n\t" /* compare */
"move %0, %3\n\t" /* value to store */
"sc %0, %1\n\t" /* attempt to store */
"beqz %0, 1b\n\t" /* if it failed, spin */
"j 3f\n\t"
"2:\n\t"
"li %0, 0\n\t"
"3:\n"
: "=&r" (ret), "+m" (*p)
: "r" (cmpval), "r" (newval)
: "memory");
#else
# 547 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
__asm __volatile (
"1:\n\t"
QEMU_TLB_WORKAROUND32("%1")
"cllw %0, %1\n\t" /* load old value */
"bne %0, %2, 2f\n\t" /* compare */
"move %0, %3\n\t" /* value to store */
"cscw %0, %0, %1\n\t" /* attempt to store */
"beqz %0, 1b\n\t" /* if it failed, spin */
"b 3f\n\t"
"2:\n\t"
"li %0, 0\n\t"
"3:\n"
: "=&r" (ret), "+C" (p)
: "r" (cmpval), "r" (newval)
: "memory");
#endif
# 563 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
return ret;
}
/*
* Atomically compare the value stored at *p with cmpval and if the
* two values are equal, update the value of *p with newval. Returns
* zero if the compare failed, nonzero otherwise.
*/
static __inline uint32_t
atomic_cmpset_acq_32(__volatile uint32_t *p, uint32_t cmpval, uint32_t newval)
{
int retval;
retval = atomic_cmpset_32(p, cmpval, newval);
mips_sync();
return (retval);
}
static __inline uint32_t
atomic_cmpset_rel_32(__volatile uint32_t *p, uint32_t cmpval, uint32_t newval)
{
mips_sync();
return (atomic_cmpset_32(p, cmpval, newval));
}
/*
* Atomically add the value of v to the integer pointed to by p and return
* the previous value of *p.
*/
static __inline uint32_t
atomic_fetchadd_32(__volatile uint32_t *p, uint32_t v)
{
uint32_t value, temp;
#ifndef __CHERI_PURE_CAPABILITY__
__asm __volatile (
"1:\tll %0, %1\n\t" /* load old value */
"addu %2, %3, %0\n\t" /* calculate new value */
"sc %2, %1\n\t" /* attempt to store */
"beqz %2, 1b\n\t" /* spin if failed */
: "=&r" (value), "+m" (*p), "=&r" (temp)
: "r" (v));
#else
# 607 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
__asm __volatile (
"1:\n\t"
QEMU_TLB_WORKAROUND32("%1")
"cllw %0, %1\n\t" /* load old value */
"addu %2, %3, %0\n\t" /* calculate new value */
"cscw %2, %2, %1\n\t" /* attempt to store */
"beqz %2, 1b\n\t" /* spin if failed */
: "=&r" (value), "+C" (p), "=&r" (temp)
: "r" (v));
#endif
# 617 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
return (value);
}
#if defined(__mips_n64) || defined(__mips_n32)
/*
* Atomically compare the value stored at *p with cmpval and if the
* two values are equal, update the value of *p with newval. Returns
* zero if the compare failed, nonzero otherwise.
*/
static __inline uint64_t
atomic_cmpset_64(__volatile uint64_t* p, uint64_t cmpval, uint64_t newval)
{
uint64_t ret;
#ifndef __CHERI_PURE_CAPABILITY__
__asm __volatile (
"1:\n\t"
"lld %0, %1\n\t" /* load old value */
"bne %0, %2, 2f\n\t" /* compare */
"move %0, %3\n\t" /* value to store */
"scd %0, %1\n\t" /* attempt to store */
"beqz %0, 1b\n\t" /* if it failed, spin */
"j 3f\n\t"
"2:\n\t"
"li %0, 0\n\t"
"3:\n"
: "=&r" (ret), "+m" (*p)
: "r" (cmpval), "r" (newval)
: "memory");
#else
# 647 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
__asm __volatile (
"1:\n\t"
QEMU_TLB_WORKAROUND64("%1")
"clld %0, %1\n\t" /* load old value */
"bne %0, %2, 2f\n\t" /* compare */
"move %0, %3\n\t" /* value to store */
"cscd %0, %0, %1\n\t" /* attempt to store */
"beqz %0, 1b\n\t" /* if it failed, spin */
"j 3f\n\t"
"2:\n\t"
"li %0, 0\n\t"
"3:\n"
: "=&r" (ret), "+C" (p)
: "r" (cmpval), "r" (newval)
: "memory");
#endif
# 663 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
return ret;
}
/*
* Atomically compare the value stored at *p with cmpval and if the
* two values are equal, update the value of *p with newval. Returns
* zero if the compare failed, nonzero otherwise.
*/
static __inline uint64_t
atomic_cmpset_acq_64(__volatile uint64_t *p, uint64_t cmpval, uint64_t newval)
{
int retval;
retval = atomic_cmpset_64(p, cmpval, newval);
mips_sync();
return (retval);
}
static __inline uint64_t
atomic_cmpset_rel_64(__volatile uint64_t *p, uint64_t cmpval, uint64_t newval)
{
mips_sync();
return (atomic_cmpset_64(p, cmpval, newval));
}
/*
* Atomically add the value of v to the integer pointed to by p and return
* the previous value of *p.
*/
static __inline uint64_t
atomic_fetchadd_64(__volatile uint64_t *p, uint64_t v)
{
uint64_t value, temp;
#ifndef __CHERI_PURE_CAPABILITY__
__asm __volatile (
"1:\n\t"
"lld %0, %1\n\t" /* load old value */
"daddu %2, %3, %0\n\t" /* calculate new value */
"scd %2, %1\n\t" /* attempt to store */
"beqz %2, 1b\n\t" /* spin if failed */
: "=&r" (value), "+m" (*p), "=&r" (temp)
: "r" (v));
#else
# 708 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
__asm __volatile (
"1:\n\t"
QEMU_TLB_WORKAROUND64("%1")
"clld %0, %1\n\t" /* load old value */
"daddu %2, %3, %0\n\t" /* calculate new value */
"cscd %2, %2, %1\n\t" /* attempt to store */
"beqz %2, 1b\n\t" /* spin if failed */
: "=&r" (value), "+C" (p), "=&r" (temp)
: "r" (v));
#endif
# 718 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
return (value);
}
#endif
# 721 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
static __inline void
atomic_thread_fence_acq(void)
{
mips_sync();
}
static __inline void
atomic_thread_fence_rel(void)
{
mips_sync();
}
static __inline void
atomic_thread_fence_acq_rel(void)
{
mips_sync();
}
static __inline void
atomic_thread_fence_seq_cst(void)
{
mips_sync();
}
/* Operations on chars. */
#define atomic_set_char atomic_set_8
#define atomic_set_acq_char atomic_set_acq_8
#define atomic_set_rel_char atomic_set_rel_8
#define atomic_clear_char atomic_clear_8
#define atomic_clear_acq_char atomic_clear_acq_8
#define atomic_clear_rel_char atomic_clear_rel_8
#define atomic_add_char atomic_add_8
#define atomic_add_acq_char atomic_add_acq_8
#define atomic_add_rel_char atomic_add_rel_8
#define atomic_subtract_char atomic_subtract_8
#define atomic_subtract_acq_char atomic_subtract_acq_8
#define atomic_subtract_rel_char atomic_subtract_rel_8
/* Operations on shorts. */
#define atomic_set_short atomic_set_16
#define atomic_set_acq_short atomic_set_acq_16
#define atomic_set_rel_short atomic_set_rel_16
#define atomic_clear_short atomic_clear_16
#define atomic_clear_acq_short atomic_clear_acq_16
#define atomic_clear_rel_short atomic_clear_rel_16
#define atomic_add_short atomic_add_16
#define atomic_add_acq_short atomic_add_acq_16
#define atomic_add_rel_short atomic_add_rel_16
#define atomic_subtract_short atomic_subtract_16
#define atomic_subtract_acq_short atomic_subtract_acq_16
#define atomic_subtract_rel_short atomic_subtract_rel_16
/* Operations on ints. */
#define atomic_set_int atomic_set_32
#define atomic_set_acq_int atomic_set_acq_32
#define atomic_set_rel_int atomic_set_rel_32
#define atomic_clear_int atomic_clear_32
#define atomic_clear_acq_int atomic_clear_acq_32
#define atomic_clear_rel_int atomic_clear_rel_32
#define atomic_add_int atomic_add_32
#define atomic_add_acq_int atomic_add_acq_32
#define atomic_add_rel_int atomic_add_rel_32
#define atomic_subtract_int atomic_subtract_32
#define atomic_subtract_acq_int atomic_subtract_acq_32
#define atomic_subtract_rel_int atomic_subtract_rel_32
#define atomic_cmpset_int atomic_cmpset_32
#define atomic_cmpset_acq_int atomic_cmpset_acq_32
#define atomic_cmpset_rel_int atomic_cmpset_rel_32
#define atomic_load_acq_int atomic_load_acq_32
#define atomic_store_rel_int atomic_store_rel_32
#define atomic_readandclear_int atomic_readandclear_32
#define atomic_readandset_int atomic_readandset_32
#define atomic_fetchadd_int atomic_fetchadd_32
/*
* I think the following is right, even for n32. For n32 the pointers
* are still 32-bits, so we need to operate on them as 32-bit quantities,
* even though they are sign extended in operation. For longs, there's
* no question because they are always 32-bits.
*/
#ifdef __mips_n64
/* Operations on longs. */
#define atomic_set_long atomic_set_64
#define atomic_set_acq_long atomic_set_acq_64
#define atomic_set_rel_long atomic_set_rel_64
#define atomic_clear_long atomic_clear_64
#define atomic_clear_acq_long atomic_clear_acq_64
#define atomic_clear_rel_long atomic_clear_rel_64
#define atomic_add_long atomic_add_64
#define atomic_add_acq_long atomic_add_acq_64
#define atomic_add_rel_long atomic_add_rel_64
#define atomic_subtract_long atomic_subtract_64
#define atomic_subtract_acq_long atomic_subtract_acq_64
#define atomic_subtract_rel_long atomic_subtract_rel_64
#define atomic_cmpset_long atomic_cmpset_64
#define atomic_cmpset_acq_long atomic_cmpset_acq_64
#define atomic_cmpset_rel_long atomic_cmpset_rel_64
#define atomic_load_acq_long atomic_load_acq_64
#define atomic_store_rel_long atomic_store_rel_64
#define atomic_fetchadd_long atomic_fetchadd_64
#define atomic_readandclear_long atomic_readandclear_64
#else /* !__mips_n64 */
# 829 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
/* Operations on longs. */
#define atomic_set_long(p, v) \
atomic_set_32((volatile u_int *)(p), (u_int)(v))
#define atomic_set_acq_long(p, v) \
atomic_set_acq_32((volatile u_int *)(p), (u_int)(v))
#define atomic_set_rel_long(p, v) \
atomic_set_rel_32((volatile u_int *)(p), (u_int)(v))
#define atomic_clear_long(p, v) \
atomic_clear_32((volatile u_int *)(p), (u_int)(v))
#define atomic_clear_acq_long(p, v) \
atomic_clear_acq_32((volatile u_int *)(p), (u_int)(v))
#define atomic_clear_rel_long(p, v) \
atomic_clear_rel_32((volatile u_int *)(p), (u_int)(v))
#define atomic_add_long(p, v) \
atomic_add_32((volatile u_int *)(p), (u_int)(v))
#define atomic_add_acq_long(p, v) \
atomic_add_32((volatile u_int *)(p), (u_int)(v))
#define atomic_add_rel_long(p, v) \
atomic_add_32((volatile u_int *)(p), (u_int)(v))
#define atomic_subtract_long(p, v) \
atomic_subtract_32((volatile u_int *)(p), (u_int)(v))
#define atomic_subtract_acq_long(p, v) \
atomic_subtract_acq_32((volatile u_int *)(p), (u_int)(v))
#define atomic_subtract_rel_long(p, v) \
atomic_subtract_rel_32((volatile u_int *)(p), (u_int)(v))
#define atomic_cmpset_long(p, cmpval, newval) \
atomic_cmpset_32((volatile u_int *)(p), (u_int)(cmpval), \
(u_int)(newval))
#define atomic_cmpset_acq_long(p, cmpval, newval) \
atomic_cmpset_acq_32((volatile u_int *)(p), (u_int)(cmpval), \
(u_int)(newval))
#define atomic_cmpset_rel_long(p, cmpval, newval) \
atomic_cmpset_rel_32((volatile u_int *)(p), (u_int)(cmpval), \
(u_int)(newval))
#define atomic_load_acq_long(p) \
(u_long)atomic_load_acq_32((volatile u_int *)(p))
#define atomic_store_rel_long(p, v) \
atomic_store_rel_32((volatile u_int *)(p), (u_int)(v))
#define atomic_fetchadd_long(p, v) \
atomic_fetchadd_32((volatile u_int *)(p), (u_int)(v))
#define atomic_readandclear_long(p) \
atomic_readandclear_32((volatile u_int *)(p))
#endif /* __mips_n64 */
# 874 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
/* Operations on pointers. */
#define atomic_set_ptr atomic_set_long
#define atomic_set_acq_ptr atomic_set_acq_long
#define atomic_set_rel_ptr atomic_set_rel_long
#define atomic_clear_ptr atomic_clear_long
#define atomic_clear_acq_ptr atomic_clear_acq_long
#define atomic_clear_rel_ptr atomic_clear_rel_long
#define atomic_add_ptr atomic_add_long
#define atomic_add_acq_ptr atomic_add_acq_long
#define atomic_add_rel_ptr atomic_add_rel_long
#define atomic_subtract_ptr atomic_subtract_long
#define atomic_subtract_acq_ptr atomic_subtract_acq_long
#define atomic_subtract_rel_ptr atomic_subtract_rel_long
#define atomic_cmpset_ptr atomic_cmpset_long
#define atomic_cmpset_acq_ptr atomic_cmpset_acq_long
#define atomic_cmpset_rel_ptr atomic_cmpset_rel_long
#define atomic_load_acq_ptr atomic_load_acq_long
#define atomic_store_rel_ptr atomic_store_rel_long
#define atomic_readandclear_ptr atomic_readandclear_long
#endif /* ! _MACHINE_ATOMIC_H_ */
# 896 "/home/alr48/cheri/build/cheribsd-obj-256/mips.mips64/home/alr48/cheri/sources/cheribsd/tmp/usr/include/machine/atomic.h" 3 4
# 41 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale_private.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "setlocale.h"
#endif /* expanded by -frewrite-includes */
# 41 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale_private.h"
# 1 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/setlocale.h" 1
/*-
* Copyright (C) 1997 by Andrey A. Chernov, Moscow, Russia.
* 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 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$
*/
#ifndef _SETLOCALE_H_
#define _SETLOCALE_H_
#define ENCODING_LEN 31
#define CATEGORY_LEN 11
extern char *_PathLocale;
int __detect_path_locale(void);
int __wrap_setrunelocale(const char *);
#endif /* !_SETLOCALE_H_ */
# 41 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/setlocale.h"
# 42 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale_private.h" 2
enum {
XLC_COLLATE = 0,
XLC_CTYPE,
XLC_MONETARY,
XLC_NUMERIC,
XLC_TIME,
XLC_MESSAGES,
XLC_LAST
};
/**
* Header used for objects that are reference counted. Objects may optionally
* have a destructor associated, which is responsible for destroying the
* structure. Global / static versions of the structure should have no
* destructor set - they can then have their reference counts manipulated as
* normal, but will not do anything with them.
*
* The header stores a retain count - objects are assumed to have a reference
* count of 1 when they are created, but the retain count is 0. When the
* retain count is less than 0, they are freed.
*/
struct xlocale_refcounted {
/** Number of references to this component. */
long retain_count;
/** Function used to destroy this component, if one is required*/
void(*destructor)(void*);
};
/**
* Header for a locale component. All locale components must begin with this
* header.
*/
struct xlocale_component {
struct xlocale_refcounted header;
/** Name of the locale used for this component. */
char locale[ENCODING_LEN+1];
};
/**
* xlocale structure, stores per-thread locale information.
*/
struct _xlocale {
struct xlocale_refcounted header;
/** Components for the locale. */
struct xlocale_component *components[XLC_LAST];
/** Flag indicating if components[XLC_MONETARY] has changed since the
* last call to localeconv_l() with this locale. */
int monetary_locale_changed;
/** Flag indicating whether this locale is actually using a locale for
* LC_MONETARY (1), or if it should use the C default instead (0). */
int using_monetary_locale;
/** Flag indicating if components[XLC_NUMERIC] has changed since the
* last call to localeconv_l() with this locale. */
int numeric_locale_changed;
/** Flag indicating whether this locale is actually using a locale for
* LC_NUMERIC (1), or if it should use the C default instead (0). */
int using_numeric_locale;
/** Flag indicating whether this locale is actually using a locale for
* LC_TIME (1), or if it should use the C default instead (0). */
int using_time_locale;
/** Flag indicating whether this locale is actually using a locale for
* LC_MESSAGES (1), or if it should use the C default instead (0). */
int using_messages_locale;
/** The structure to be returned from localeconv_l() for this locale. */
struct lconv lconv;
/** Persistent state used by mblen() calls. */
__mbstate_t mblen;
/** Persistent state used by mbrlen() calls. */
__mbstate_t mbrlen;
/** Persistent state used by mbrtoc16() calls. */
__mbstate_t mbrtoc16;
/** Persistent state used by mbrtoc32() calls. */
__mbstate_t mbrtoc32;
/** Persistent state used by mbrtowc() calls. */
__mbstate_t mbrtowc;
/** Persistent state used by mbsnrtowcs() calls. */
__mbstate_t mbsnrtowcs;
/** Persistent state used by mbsrtowcs() calls. */
__mbstate_t mbsrtowcs;
/** Persistent state used by mbtowc() calls. */
__mbstate_t mbtowc;
/** Persistent state used by c16rtomb() calls. */
__mbstate_t c16rtomb;
/** Persistent state used by c32rtomb() calls. */
__mbstate_t c32rtomb;
/** Persistent state used by wcrtomb() calls. */
__mbstate_t wcrtomb;
/** Persistent state used by wcsnrtombs() calls. */
__mbstate_t wcsnrtombs;
/** Persistent state used by wcsrtombs() calls. */
__mbstate_t wcsrtombs;
/** Persistent state used by wctomb() calls. */
__mbstate_t wctomb;
/** Buffer used by nl_langinfo_l() */
char *csym;
};
/**
* Increments the reference count of a reference-counted structure.
*/
__attribute__((unused)) static void*
xlocale_retain(void *val)
{
struct xlocale_refcounted *obj = val;
atomic_add_long(&(obj->retain_count), 1);
return (val);
}
/**
* Decrements the reference count of a reference-counted structure, freeing it
* if this is the last reference, calling its destructor if it has one.
*/
__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 != NULL)
obj->destructor(obj);
}
/**
* Load functions. Each takes the name of a locale and a pointer to the data
* to be initialised as arguments. Two special values are allowed for the
*/
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;
/**
* Caches the rune table in TLS for fast access.
*/
void __set_thread_rune_locale(locale_t loc);
/**
* Flag indicating whether a per-thread locale has been set. If no per-thread
* locale has ever been set, then we always use the global locale.
*/
extern int __has_thread_locale;
#ifndef __NO_TLS
/**
* The per-thread locale. Avoids the need to use pthread lookup functions when
* getting the per-thread locale.
*/
extern _Thread_local locale_t __thread_locale;
/**
* Returns the current locale for this thread, or the global locale if none is
* set. The caller does not have to free the locale. The return value from
* this call is not guaranteed to remain valid after the locale changes. As
* such, this should only be called within libc functions.
*/
static inline locale_t __get_locale(void)
{
#ifdef FORCE_C_LOCALE
return (&__xlocale_C_locale);
#else
# 207 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale_private.h"
if (!__has_thread_locale) {
return (&__xlocale_global_locale);
}
return (__thread_locale ? __thread_locale : &__xlocale_global_locale);
#endif
# 212 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale_private.h"
}
#else
# 214 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale_private.h"
locale_t __get_locale(void);
#endif
# 216 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale_private.h"
/**
* Two magic values are allowed for locale_t objects. NULL and -1. This
* function maps those to the real locales that they represent.
*/
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);
}
}
/**
* Replace a placeholder locale with the real global or thread-local locale_t.
*/
#define FIX_LOCALE(l) (l = get_real_locale(l))
#endif
# 236 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale_private.h"
# 38 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale.c" 2
/**
* Each locale loader declares a global component. This is used by setlocale()
* and also by xlocale with LC_GLOBAL_LOCALE..
*/
extern struct xlocale_component __xlocale_global_collate;
extern struct xlocale_component __xlocale_global_ctype;
extern struct xlocale_component __xlocale_global_monetary;
extern struct xlocale_component __xlocale_global_numeric;
extern struct xlocale_component __xlocale_global_time;
extern struct xlocale_component __xlocale_global_messages;
/*
* And another version for the statically-allocated C locale. We only have
* components for the parts that are expected to be sensible.
*/
extern struct xlocale_component __xlocale_C_collate;
extern struct xlocale_component __xlocale_C_ctype;
#ifndef __NO_TLS
/*
* The locale for this thread.
*/
_Thread_local locale_t __thread_locale;
#endif
# 62 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale.c"
/*
* Flag indicating that one or more per-thread locales exist.
*/
int __has_thread_locale;
/*
* Private functions in setlocale.c.
*/
const char *
__get_locale_env(int category);
int
__detect_path_locale(void);
struct _xlocale __xlocale_global_locale = {
{0},
{
&__xlocale_global_collate,
&__xlocale_global_ctype,
&__xlocale_global_monetary,
&__xlocale_global_numeric,
&__xlocale_global_time,
&__xlocale_global_messages
},
1,
0,
1,
0
};
struct _xlocale __xlocale_C_locale = {
{0},
{
&__xlocale_C_collate,
&__xlocale_C_ctype,
0, 0, 0, 0
},
1,
0,
1,
0
};
static void*(*constructors[])(const char*, locale_t) =
{
__collate_load,
__ctype_load,
__monetary_load,
__numeric_load,
__time_load,
__messages_load
};
static pthread_key_t locale_info_key;
static int fake_tls;
static locale_t thread_local_locale;
static void init_key(void)
{
pthread_key_create(&locale_info_key, xlocale_release);
pthread_setspecific(locale_info_key, (void*)42);
if (pthread_getspecific(locale_info_key) == (void*)42) {
pthread_setspecific(locale_info_key, 0);
} else {
fake_tls = 1;
}
/* At least one per-thread locale has now been set. */
__has_thread_locale = 1;
__detect_path_locale();
}
static pthread_once_t once_control = PTHREAD_ONCE_INIT;
static locale_t
get_thread_locale(void)
{
_once(&once_control, init_key);
return (fake_tls ? thread_local_locale :
pthread_getspecific(locale_info_key));
}
#ifdef __NO_TLS
locale_t
__get_locale(void)
{
#ifndef FORCE_C_LOCALE
locale_t l = get_thread_locale();
return (l ? l : &__xlocale_global_locale);
#else
# 152 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale.c"
return (&__xlocale_global_locale);
#endif
# 154 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale.c"
}
#endif
# 156 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale.c"
static void
set_thread_locale(locale_t loc)
{
locale_t l = (loc == LC_GLOBAL_LOCALE) ? 0 : loc;
_once(&once_control, init_key);
if (NULL != l) {
xlocale_retain((struct xlocale_refcounted*)l);
}
locale_t old = pthread_getspecific(locale_info_key);
if ((NULL != old) && (l != old)) {
xlocale_release((struct xlocale_refcounted*)old);
}
if (fake_tls) {
thread_local_locale = l;
} else {
pthread_setspecific(locale_info_key, l);
}
#ifndef __NO_TLS
__thread_locale = l;
__set_thread_rune_locale(loc);
#endif
# 180 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale.c"
}
/**
* Clean up a locale, once its reference count reaches zero. This function is
* called by xlocale_release(), it should not be called directly.
*/
static void
destruct_locale(void *l)
{
locale_t loc = l;
for (int type=0 ; type<XLC_LAST ; type++) {
if (loc->components[type]) {
xlocale_release(loc->components[type]);
}
}
if (loc->csym) {
free(loc->csym);
}
free(l);
}
/**
* Allocates a new, uninitialised, locale.
*/
static locale_t
alloc_locale(void)
{
locale_t new = calloc(sizeof(struct _xlocale), 1);
new->header.destructor = destruct_locale;
new->monetary_locale_changed = 1;
new->numeric_locale_changed = 1;
return (new);
}
static void
copyflags(locale_t new, locale_t old)
{
new->using_monetary_locale = old->using_monetary_locale;
new->using_numeric_locale = old->using_numeric_locale;
new->using_time_locale = old->using_time_locale;
new->using_messages_locale = old->using_messages_locale;
}
static int dupcomponent(int type, locale_t base, locale_t new)
{
/* Always copy from the global locale, since it has mutable components.
*/
struct xlocale_component *src = base->components[type];
if (&__xlocale_global_locale == base) {
new->components[type] = constructors[type](src->locale, new);
if (new->components[type]) {
strncpy(new->components[type]->locale, src->locale,
ENCODING_LEN);
}
} else if (base->components[type]) {
new->components[type] = xlocale_retain(base->components[type]);
} else {
/* If the component was NULL, return success - if base is a
* valid locale then the flag indicating that this isn't
* present should be set. If it isn't a valid locale, then
* we're stuck anyway. */
return 1;
}
return (0 != new->components[type]);
}
/*
* Public interfaces. These are the five public functions described by the
* xlocale interface.
*/
locale_t newlocale(int mask, const char *locale, locale_t base)
{
#ifndef FORCE_C_LOCALE
int type;
const char *realLocale = locale;
int useenv = 0;
int success = 1;
_once(&once_control, init_key);
locale_t new = alloc_locale();
if (NULL == new) {
return (NULL);
}
FIX_LOCALE(base);
copyflags(new, base);
if (NULL == locale) {
realLocale = "C";
} else if ('\0' == locale[0]) {
useenv = 1;
}
for (type=0 ; type<XLC_LAST ; type++) {
if (mask & 1) {
if (useenv) {
realLocale = __get_locale_env(type);
}
new->components[type] =
constructors[type](realLocale, new);
if (new->components[type]) {
strncpy(new->components[type]->locale,
realLocale, ENCODING_LEN);
} else {
success = 0;
break;
}
} else {
if (!dupcomponent(type, base, new)) {
success = 0;
break;
}
}
mask >>= 1;
}
if (0 == success) {
xlocale_release(new);
new = NULL;
}
return (new);
#else
# 306 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale.c"
return (NULL);
#endif
# 308 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale.c"
}
locale_t duplocale(locale_t base)
{
#ifndef FORCE_C_LOCALE
locale_t new = alloc_locale();
int type;
_once(&once_control, init_key);
if (NULL == new) {
return (NULL);
}
FIX_LOCALE(base);
copyflags(new, base);
for (type=0 ; type<XLC_LAST ; type++) {
dupcomponent(type, base, new);
}
return (new);
#else
# 331 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale.c"
return (NULL);
#endif
# 333 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale.c"
}
/*
* Free a locale_t. This is quite a poorly named function. It actually
* disclaims a reference to a locale_t, rather than freeing it.
*/
void
freelocale(locale_t loc)
{
/*
* Fail if we're passed something that isn't a locale. If we're
* passed the global locale, pretend that we freed it but don't
* actually do anything.
*/
if (loc != NULL && loc != LC_GLOBAL_LOCALE &&
loc != &__xlocale_global_locale)
xlocale_release(loc);
}
/*
* Returns the name of the locale for a particular component of a locale_t.
*/
const char *querylocale(int mask, locale_t loc)
{
int type = ffs(mask) - 1;
FIX_LOCALE(loc);
if (type >= XLC_LAST)
return (NULL);
if (loc->components[type])
return (loc->components[type]->locale);
return ("C");
}
/*
* Installs the specified locale_t as this thread's locale.
*/
locale_t uselocale(locale_t loc)
{
#ifndef FORCE_C_LOCALE
locale_t old = get_thread_locale();
if (NULL != loc) {
set_thread_locale(loc);
}
return (old ? old : LC_GLOBAL_LOCALE);
#else
# 379 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale.c"
return (LC_GLOBAL_LOCALE);
#endif
# 381 "/home/alr48/cheri/sources/cheribsd/lib/libc_cheri/../libc/locale/xlocale.c"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment