R1 LovePara: app-server stack, on-target C dev, new NIC support
This commit is contained in:
parent
8de5ae7e9e
commit
2a0f3a406c
1376 changed files with 262659 additions and 28 deletions
108
board/mentalnet/overlay/usr/include/sys/acct.h
Normal file
108
board/mentalnet/overlay/usr/include/sys/acct.h
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
/* Copyright (C) 1996-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_ACCT_H
|
||||
#define _SYS_ACCT_H 1
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <bits/endian.h>
|
||||
#include <bits/types/time_t.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#define ACCT_COMM 16
|
||||
|
||||
/*
|
||||
comp_t is a 16-bit "floating" point number with a 3-bit base 8
|
||||
exponent and a 13-bit fraction. See linux/kernel/acct.c for the
|
||||
specific encoding system used.
|
||||
*/
|
||||
|
||||
typedef uint16_t comp_t;
|
||||
|
||||
struct acct
|
||||
{
|
||||
char ac_flag; /* Flags. */
|
||||
uint16_t ac_uid; /* Real user ID. */
|
||||
uint16_t ac_gid; /* Real group ID. */
|
||||
uint16_t ac_tty; /* Controlling terminal. */
|
||||
uint32_t ac_btime; /* Beginning time. */
|
||||
comp_t ac_utime; /* User time. */
|
||||
comp_t ac_stime; /* System time. */
|
||||
comp_t ac_etime; /* Elapsed time. */
|
||||
comp_t ac_mem; /* Average memory usage. */
|
||||
comp_t ac_io; /* Chars transferred. */
|
||||
comp_t ac_rw; /* Blocks read or written. */
|
||||
comp_t ac_minflt; /* Minor pagefaults. */
|
||||
comp_t ac_majflt; /* Major pagefaults. */
|
||||
comp_t ac_swaps; /* Number of swaps. */
|
||||
uint32_t ac_exitcode; /* Process exitcode. */
|
||||
char ac_comm[ACCT_COMM+1]; /* Command name. */
|
||||
char ac_pad[10]; /* Padding bytes. */
|
||||
};
|
||||
|
||||
|
||||
struct acct_v3
|
||||
{
|
||||
char ac_flag; /* Flags */
|
||||
char ac_version; /* Always set to ACCT_VERSION */
|
||||
uint16_t ac_tty; /* Control Terminal */
|
||||
uint32_t ac_exitcode; /* Exitcode */
|
||||
uint32_t ac_uid; /* Real User ID */
|
||||
uint32_t ac_gid; /* Real Group ID */
|
||||
uint32_t ac_pid; /* Process ID */
|
||||
uint32_t ac_ppid; /* Parent Process ID */
|
||||
uint32_t ac_btime; /* Process Creation Time */
|
||||
float ac_etime; /* Elapsed Time */
|
||||
comp_t ac_utime; /* User Time */
|
||||
comp_t ac_stime; /* System Time */
|
||||
comp_t ac_mem; /* Average Memory Usage */
|
||||
comp_t ac_io; /* Chars Transferred */
|
||||
comp_t ac_rw; /* Blocks Read or Written */
|
||||
comp_t ac_minflt; /* Minor Pagefaults */
|
||||
comp_t ac_majflt; /* Major Pagefaults */
|
||||
comp_t ac_swaps; /* Number of Swaps */
|
||||
char ac_comm[ACCT_COMM]; /* Command Name */
|
||||
};
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
AFORK = 0x01, /* Has executed fork, but no exec. */
|
||||
ASU = 0x02, /* Used super-user privileges. */
|
||||
ACORE = 0x08, /* Dumped core. */
|
||||
AXSIG = 0x10, /* Killed by a signal. */
|
||||
AGROUP = 0x20 /* Was the last task of the process
|
||||
(task group). */
|
||||
};
|
||||
|
||||
#if __BYTE_ORDER == __BIG_ENDIAN
|
||||
# define ACCT_BYTEORDER 0x80 /* Accounting file is big endian. */
|
||||
#else
|
||||
# define ACCT_BYTEORDER 0x00 /* Accounting file is little endian. */
|
||||
#endif
|
||||
|
||||
#define AHZ 100
|
||||
|
||||
|
||||
/* Switch process accounting on and off. */
|
||||
extern int acct (const char *__filename) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/acct.h */
|
||||
36
board/mentalnet/overlay/usr/include/sys/auxv.h
Normal file
36
board/mentalnet/overlay/usr/include/sys/auxv.h
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
/* Access to the auxiliary vector.
|
||||
Copyright (C) 2012-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_AUXV_H
|
||||
#define _SYS_AUXV_H 1
|
||||
|
||||
#include <elf.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <bits/hwcap.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Return the value associated with an Elf*_auxv_t type from the auxv list
|
||||
passed to the program on startup. If TYPE was not present in the auxv
|
||||
list, returns zero and sets errno to ENOENT. */
|
||||
extern unsigned long int getauxval (unsigned long int __type)
|
||||
__THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/auxv.h */
|
||||
3
board/mentalnet/overlay/usr/include/sys/bitypes.h
Normal file
3
board/mentalnet/overlay/usr/include/sys/bitypes.h
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
/* The GNU <sys/types.h> defines all the necessary types. */
|
||||
|
||||
#include <sys/types.h>
|
||||
255
board/mentalnet/overlay/usr/include/sys/capability.h
Normal file
255
board/mentalnet/overlay/usr/include/sys/capability.h
Normal file
|
|
@ -0,0 +1,255 @@
|
|||
/*
|
||||
* <sys/capability.h>
|
||||
*
|
||||
* Copyright (C) 1997 Aleph One
|
||||
* Copyright (C) 1997,8, 2008,19-22 Andrew G. Morgan <morgan@kernel.org>
|
||||
*
|
||||
* defunct POSIX.1e Standard: 25.2 Capabilities <sys/capability.h>
|
||||
*/
|
||||
|
||||
#ifndef _SYS_CAPABILITY_H
|
||||
#define _SYS_CAPABILITY_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Provide a programmatic way to #ifdef around features.
|
||||
*/
|
||||
#define LIBCAP_MAJOR 2
|
||||
#define LIBCAP_MINOR 73
|
||||
|
||||
/*
|
||||
* This file complements the kernel file by providing prototype
|
||||
* information for the user library.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef __user
|
||||
#define __user
|
||||
#endif
|
||||
#include <linux/capability.h>
|
||||
|
||||
/*
|
||||
* POSIX capability types
|
||||
*/
|
||||
|
||||
/*
|
||||
* Opaque capability handle (defined internally by libcap)
|
||||
* internal capability representation
|
||||
*/
|
||||
typedef struct _cap_struct *cap_t;
|
||||
|
||||
/* "external" capability representation is a (void *) */
|
||||
|
||||
/*
|
||||
* This is the type used to identify capabilities
|
||||
*/
|
||||
|
||||
typedef int cap_value_t;
|
||||
|
||||
/*
|
||||
* libcap initialized first unnamed capability of the running kernel.
|
||||
* capsh includes a runtime test to flag when this is larger than
|
||||
* what is known to libcap... Time for a new libcap release!
|
||||
*/
|
||||
extern cap_value_t cap_max_bits(void);
|
||||
|
||||
/*
|
||||
* cap_proc_root reads and (optionally: when root != NULL) changes
|
||||
* libcap's notion of where the "/proc" filesystem is mounted. When
|
||||
* the return value is NULL, it should be interpreted as the
|
||||
* value "/proc".
|
||||
*
|
||||
* Note, this is a global value and not considered thread safe to
|
||||
* write - so the client should take suitable care when changing
|
||||
* it.
|
||||
*
|
||||
* Further, libcap will allocate a memory copy for storing the
|
||||
* replacement root, and it is this kind of memory that is returned.
|
||||
* So, when changing the value, the caller should
|
||||
* cap_free(the-return-value) else cause a memory leak.
|
||||
*
|
||||
* Note, the library uses a destructor to clean up the live allocated
|
||||
* value of the working setting.
|
||||
*/
|
||||
extern char *cap_proc_root(const char *root);
|
||||
|
||||
/*
|
||||
* Set identifiers
|
||||
*/
|
||||
typedef enum {
|
||||
CAP_EFFECTIVE = 0, /* Specifies the effective flag */
|
||||
CAP_PERMITTED = 1, /* Specifies the permitted flag */
|
||||
CAP_INHERITABLE = 2 /* Specifies the inheritable flag */
|
||||
} cap_flag_t;
|
||||
|
||||
typedef enum {
|
||||
CAP_IAB_INH = 2,
|
||||
CAP_IAB_AMB = 3,
|
||||
CAP_IAB_BOUND = 4
|
||||
} cap_iab_vector_t;
|
||||
|
||||
/*
|
||||
* An opaque generalization of the inheritable bits that includes both
|
||||
* what ambient bits to raise and what bounding bits to *lower* (aka
|
||||
* drop). None of these bits once set, using cap_iab_set(), affect
|
||||
* the running process but are consulted, through the execve() system
|
||||
* call, by the kernel. Note, the ambient bits ('A') of the running
|
||||
* process are fragile with respect to other aspects of the "posix"
|
||||
* (cap_t) operations: most importantly, 'A' cannot ever hold bits not
|
||||
* present in the intersection of 'pI' and 'pP'. The kernel
|
||||
* immediately drops all ambient caps whenever such a situation
|
||||
* arises. Typically, the ambient bits are used to support a naive
|
||||
* capability inheritance model - at odds with the POSIX (sic) model
|
||||
* of inheritance where inherited (pI) capabilities need to also be
|
||||
* wanted by the executed binary (fI) in order to become raised
|
||||
* through exec.
|
||||
*/
|
||||
typedef struct cap_iab_s *cap_iab_t;
|
||||
|
||||
/*
|
||||
* These are the states available to each capability
|
||||
*/
|
||||
typedef enum {
|
||||
CAP_CLEAR=0, /* The flag is cleared/disabled */
|
||||
CAP_SET=1 /* The flag is set/enabled */
|
||||
} cap_flag_value_t;
|
||||
|
||||
/*
|
||||
* User-space capability manipulation routines
|
||||
*/
|
||||
typedef unsigned cap_mode_t;
|
||||
#define CAP_MODE_UNCERTAIN ((cap_mode_t) 0)
|
||||
#define CAP_MODE_NOPRIV ((cap_mode_t) 1)
|
||||
#define CAP_MODE_PURE1E_INIT ((cap_mode_t) 2)
|
||||
#define CAP_MODE_PURE1E ((cap_mode_t) 3)
|
||||
#define CAP_MODE_HYBRID ((cap_mode_t) 4)
|
||||
|
||||
/* libcap/cap_alloc.c */
|
||||
extern cap_t cap_dup(cap_t);
|
||||
extern int cap_free(void *);
|
||||
extern cap_t cap_init(void);
|
||||
extern cap_iab_t cap_iab_dup(cap_iab_t);
|
||||
extern cap_iab_t cap_iab_init(void);
|
||||
|
||||
/* libcap/cap_flag.c */
|
||||
extern int cap_get_flag(cap_t, cap_value_t, cap_flag_t, cap_flag_value_t *);
|
||||
extern int cap_set_flag(cap_t, cap_flag_t, int, const cap_value_t *,
|
||||
cap_flag_value_t);
|
||||
extern int cap_clear(cap_t);
|
||||
extern int cap_clear_flag(cap_t, cap_flag_t);
|
||||
extern int cap_fill_flag(cap_t cap_d, cap_flag_t to,
|
||||
cap_t ref, cap_flag_t from);
|
||||
extern int cap_fill(cap_t, cap_flag_t, cap_flag_t);
|
||||
|
||||
#define CAP_DIFFERS(result, flag) (((result) & (1 << (flag))) != 0)
|
||||
extern int cap_compare(cap_t, cap_t);
|
||||
#define CAP_IAB_DIFFERS(result, vector) (((result) & (1 << (vector))) != 0)
|
||||
extern int cap_iab_compare(cap_iab_t, cap_iab_t);
|
||||
|
||||
extern cap_flag_value_t cap_iab_get_vector(cap_iab_t, cap_iab_vector_t,
|
||||
cap_value_t);
|
||||
extern int cap_iab_set_vector(cap_iab_t, cap_iab_vector_t, cap_value_t,
|
||||
cap_flag_value_t);
|
||||
extern int cap_iab_fill(cap_iab_t, cap_iab_vector_t, cap_t, cap_flag_t);
|
||||
|
||||
/* libcap/cap_file.c */
|
||||
extern cap_t cap_get_fd(int);
|
||||
extern cap_t cap_get_file(const char *);
|
||||
extern uid_t cap_get_nsowner(cap_t);
|
||||
extern int cap_set_fd(int, cap_t);
|
||||
extern int cap_set_file(const char *, cap_t);
|
||||
extern int cap_set_nsowner(cap_t, uid_t);
|
||||
|
||||
/* libcap/cap_proc.c */
|
||||
extern cap_t cap_get_proc(void);
|
||||
extern cap_t cap_get_pid(pid_t);
|
||||
extern int cap_set_proc(cap_t);
|
||||
|
||||
extern int cap_get_bound(cap_value_t);
|
||||
extern int cap_drop_bound(cap_value_t);
|
||||
#define CAP_IS_SUPPORTED(cap) (cap_get_bound(cap) >= 0)
|
||||
|
||||
extern int cap_get_ambient(cap_value_t);
|
||||
extern int cap_set_ambient(cap_value_t, cap_flag_value_t);
|
||||
extern int cap_reset_ambient(void);
|
||||
#define CAP_AMBIENT_SUPPORTED() (cap_get_ambient(CAP_CHOWN) >= 0)
|
||||
|
||||
/* libcap/cap_extint.c */
|
||||
extern ssize_t cap_size(cap_t cap_d);
|
||||
extern ssize_t cap_copy_ext(void *cap_ext, cap_t cap_d, ssize_t length);
|
||||
extern cap_t cap_copy_int(const void *cap_ext);
|
||||
extern cap_t cap_copy_int_check(const void *cap_ext, ssize_t length);
|
||||
|
||||
/* libcap/cap_text.c */
|
||||
extern cap_t cap_from_text(const char *);
|
||||
extern char * cap_to_text(cap_t, ssize_t *);
|
||||
extern int cap_from_name(const char *, cap_value_t *);
|
||||
extern char * cap_to_name(cap_value_t);
|
||||
|
||||
extern char * cap_iab_to_text(cap_iab_t iab);
|
||||
extern cap_iab_t cap_iab_from_text(const char *text);
|
||||
|
||||
/* libcap/cap_proc.c */
|
||||
extern void cap_set_syscall(long int (*new_syscall)(long int,
|
||||
long int, long int, long int),
|
||||
long int (*new_syscall6)(long int,
|
||||
long int, long int, long int,
|
||||
long int, long int, long int));
|
||||
|
||||
extern int cap_set_mode(cap_mode_t flavor);
|
||||
extern cap_mode_t cap_get_mode(void);
|
||||
extern const char *cap_mode_name(cap_mode_t flavor);
|
||||
|
||||
extern unsigned cap_get_secbits(void);
|
||||
extern int cap_set_secbits(unsigned bits);
|
||||
|
||||
extern int cap_prctl(long int pr_cmd, long int arg1, long int arg2,
|
||||
long int arg3, long int arg4, long int arg5);
|
||||
extern int cap_prctlw(long int pr_cmd, long int arg1, long int arg2,
|
||||
long int arg3, long int arg4, long int arg5);
|
||||
extern int cap_setuid(uid_t uid);
|
||||
extern int cap_setgroups(gid_t gid, size_t ngroups, const gid_t groups[]);
|
||||
|
||||
extern cap_iab_t cap_iab_get_proc(void);
|
||||
extern cap_iab_t cap_iab_get_pid(pid_t);
|
||||
extern int cap_iab_set_proc(cap_iab_t iab);
|
||||
|
||||
typedef struct cap_launch_s *cap_launch_t;
|
||||
|
||||
extern cap_launch_t cap_new_launcher(const char *arg0, const char * const *argv,
|
||||
const char * const *envp);
|
||||
extern cap_launch_t cap_func_launcher(int (callback_fn)(void *detail));
|
||||
extern int cap_launcher_callback(cap_launch_t attr,
|
||||
int (callback_fn)(void *detail));
|
||||
extern int cap_launcher_setuid(cap_launch_t attr, uid_t uid);
|
||||
extern int cap_launcher_setgroups(cap_launch_t attr, gid_t gid,
|
||||
int ngroups, const gid_t *groups);
|
||||
extern int cap_launcher_set_mode(cap_launch_t attr, cap_mode_t flavor);
|
||||
extern cap_iab_t cap_launcher_set_iab(cap_launch_t attr, cap_iab_t iab);
|
||||
extern int cap_launcher_set_chroot(cap_launch_t attr, const char *chroot);
|
||||
extern pid_t cap_launch(cap_launch_t attr, void *detail);
|
||||
|
||||
/*
|
||||
* system calls - look to libc for function to system call
|
||||
* mapping. Note, libcap does not use capset directly, but permits the
|
||||
* cap_set_syscall() to redirect the system call function.
|
||||
*/
|
||||
extern int capget(cap_user_header_t header, cap_user_data_t data);
|
||||
extern int capset(cap_user_header_t header, const cap_user_data_t data);
|
||||
|
||||
/* deprecated - use cap_get_pid() */
|
||||
extern int capgetp(pid_t pid, cap_t cap_d);
|
||||
|
||||
/* not valid with filesystem capability support - use cap_set_proc() */
|
||||
extern int capsetp(pid_t pid, cap_t cap_d);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _SYS_CAPABILITY_H */
|
||||
886
board/mentalnet/overlay/usr/include/sys/cdefs.h
Normal file
886
board/mentalnet/overlay/usr/include/sys/cdefs.h
Normal file
|
|
@ -0,0 +1,886 @@
|
|||
/* Copyright (C) 1992-2025 Free Software Foundation, Inc.
|
||||
Copyright The GNU Toolchain Authors.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_CDEFS_H
|
||||
#define _SYS_CDEFS_H 1
|
||||
|
||||
/* We are almost always included from features.h. */
|
||||
#ifndef _FEATURES_H
|
||||
# include <features.h>
|
||||
#endif
|
||||
|
||||
/* The GNU libc does not support any K&R compilers or the traditional mode
|
||||
of ISO C compilers anymore. Check for some of the combinations not
|
||||
supported anymore. */
|
||||
#if defined __GNUC__ && !defined __STDC__ && !defined __cplusplus
|
||||
# error "You need a ISO C or C++ conforming compiler to use the glibc headers"
|
||||
#endif
|
||||
|
||||
/* Some user header file might have defined this before. */
|
||||
#undef __P
|
||||
#undef __PMT
|
||||
|
||||
/* Compilers that lack __has_attribute may object to
|
||||
#if defined __has_attribute && __has_attribute (...)
|
||||
even though they do not need to evaluate the right-hand side of the &&.
|
||||
Similarly for __has_builtin, etc. */
|
||||
#if (defined __has_attribute \
|
||||
&& (!defined __clang_minor__ \
|
||||
|| 3 < __clang_major__ + (5 <= __clang_minor__)))
|
||||
# define __glibc_has_attribute(attr) __has_attribute (attr)
|
||||
#else
|
||||
# define __glibc_has_attribute(attr) 0
|
||||
#endif
|
||||
#ifdef __has_builtin
|
||||
# define __glibc_has_builtin(name) __has_builtin (name)
|
||||
#else
|
||||
# define __glibc_has_builtin(name) 0
|
||||
#endif
|
||||
#ifdef __has_extension
|
||||
# define __glibc_has_extension(ext) __has_extension (ext)
|
||||
#else
|
||||
# define __glibc_has_extension(ext) 0
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ || defined __clang__
|
||||
|
||||
/* All functions, except those with callbacks or those that
|
||||
synchronize memory, are leaf functions. */
|
||||
# if __GNUC_PREREQ (4, 6) && !defined _LIBC
|
||||
# define __LEAF , __leaf__
|
||||
# define __LEAF_ATTR __attribute__ ((__leaf__))
|
||||
# else
|
||||
# define __LEAF
|
||||
# define __LEAF_ATTR
|
||||
# endif
|
||||
|
||||
/* GCC can always grok prototypes. For C++ programs we add throw()
|
||||
to help it optimize the function calls. But this only works with
|
||||
gcc 2.8.x and egcs. For gcc 3.4 and up we even mark C functions
|
||||
as non-throwing using a function attribute since programs can use
|
||||
the -fexceptions options for C code as well. */
|
||||
# if !defined __cplusplus \
|
||||
&& (__GNUC_PREREQ (3, 4) || __glibc_has_attribute (__nothrow__))
|
||||
# define __THROW __attribute__ ((__nothrow__ __LEAF))
|
||||
# define __THROWNL __attribute__ ((__nothrow__))
|
||||
# define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct
|
||||
# define __NTHNL(fct) __attribute__ ((__nothrow__)) fct
|
||||
# else
|
||||
# if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major__ >= 4)
|
||||
# if __cplusplus >= 201103L
|
||||
# define __THROW noexcept (true)
|
||||
# else
|
||||
# define __THROW throw ()
|
||||
# endif
|
||||
# define __THROWNL __THROW
|
||||
# define __NTH(fct) __LEAF_ATTR fct __THROW
|
||||
# define __NTHNL(fct) fct __THROW
|
||||
# else
|
||||
# define __THROW
|
||||
# define __THROWNL
|
||||
# define __NTH(fct) fct
|
||||
# define __NTHNL(fct) fct
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if __GNUC_PREREQ (4, 3) || __glibc_has_attribute (__cold__)
|
||||
# define __COLD __attribute__ ((__cold__))
|
||||
# else
|
||||
# define __COLD
|
||||
# endif
|
||||
|
||||
#else /* Not GCC or clang. */
|
||||
|
||||
# if (defined __cplusplus \
|
||||
|| (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
|
||||
# define __inline inline
|
||||
# else
|
||||
# define __inline /* No inline functions. */
|
||||
# endif
|
||||
|
||||
# define __THROW
|
||||
# define __THROWNL
|
||||
# define __NTH(fct) fct
|
||||
# define __COLD
|
||||
|
||||
#endif /* GCC || clang. */
|
||||
|
||||
/* These two macros are not used in glibc anymore. They are kept here
|
||||
only because some other projects expect the macros to be defined. */
|
||||
#define __P(args) args
|
||||
#define __PMT(args) args
|
||||
|
||||
/* For these things, GCC behaves the ANSI way normally,
|
||||
and the non-ANSI way under -traditional. */
|
||||
|
||||
#define __CONCAT(x,y) x ## y
|
||||
#define __STRING(x) #x
|
||||
|
||||
/* This is not a typedef so `const __ptr_t' does the right thing. */
|
||||
#define __ptr_t void *
|
||||
|
||||
|
||||
/* C++ needs to know that types and declarations are C, not C++. */
|
||||
#ifdef __cplusplus
|
||||
# define __BEGIN_DECLS extern "C" {
|
||||
# define __END_DECLS }
|
||||
#else
|
||||
# define __BEGIN_DECLS
|
||||
# define __END_DECLS
|
||||
#endif
|
||||
|
||||
|
||||
/* The overloadable attribute was added on clang 2.6. */
|
||||
#if defined __clang_major__ \
|
||||
&& (__clang_major__ + (__clang_minor__ >= 6) > 2)
|
||||
# define __attribute_overloadable__ __attribute__((__overloadable__))
|
||||
#else
|
||||
# define __attribute_overloadable__
|
||||
#endif
|
||||
|
||||
/* Fortify support. */
|
||||
#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
|
||||
#define __bos0(ptr) __builtin_object_size (ptr, 0)
|
||||
|
||||
/* Use __builtin_dynamic_object_size at _FORTIFY_SOURCE=3 when available. */
|
||||
#if __USE_FORTIFY_LEVEL == 3 && (__glibc_clang_prereq (9, 0) \
|
||||
|| __GNUC_PREREQ (12, 0))
|
||||
# define __glibc_objsize0(__o) __builtin_dynamic_object_size (__o, 0)
|
||||
# define __glibc_objsize(__o) __builtin_dynamic_object_size (__o, 1)
|
||||
#else
|
||||
# define __glibc_objsize0(__o) __bos0 (__o)
|
||||
# define __glibc_objsize(__o) __bos (__o)
|
||||
#endif
|
||||
|
||||
#if __USE_FORTIFY_LEVEL > 0
|
||||
/* Compile time conditions to choose between the regular, _chk and _chk_warn
|
||||
variants. These conditions should get evaluated to constant and optimized
|
||||
away. */
|
||||
|
||||
#define __glibc_safe_len_cond(__l, __s, __osz) ((__l) <= (__osz) / (__s))
|
||||
#define __glibc_unsigned_or_positive(__l) \
|
||||
((__typeof (__l)) 0 < (__typeof (__l)) -1 \
|
||||
|| (__builtin_constant_p (__l) && (__l) > 0))
|
||||
|
||||
/* Length is known to be safe at compile time if the __L * __S <= __OBJSZ
|
||||
condition can be folded to a constant and if it is true, or unknown (-1) */
|
||||
#define __glibc_safe_or_unknown_len(__l, __s, __osz) \
|
||||
((__builtin_constant_p (__osz) && (__osz) == (__SIZE_TYPE__) -1) \
|
||||
|| (__glibc_unsigned_or_positive (__l) \
|
||||
&& __builtin_constant_p (__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), \
|
||||
(__s), (__osz))) \
|
||||
&& __glibc_safe_len_cond ((__SIZE_TYPE__) (__l), (__s), (__osz))))
|
||||
|
||||
/* Conversely, we know at compile time that the length is unsafe if the
|
||||
__L * __S <= __OBJSZ condition can be folded to a constant and if it is
|
||||
false. */
|
||||
#define __glibc_unsafe_len(__l, __s, __osz) \
|
||||
(__glibc_unsigned_or_positive (__l) \
|
||||
&& __builtin_constant_p (__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), \
|
||||
__s, __osz)) \
|
||||
&& !__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), __s, __osz))
|
||||
|
||||
/* To correctly instrument the fortify wrapper clang requires the
|
||||
pass_object_size attribute, and the attribute has the restriction that the
|
||||
argument needs to be 'const'. Furthermore, to make it usable with C
|
||||
interfaces, clang provides the overload attribute, which provides a C++
|
||||
like function overload support. The overloaded fortify wrapper with the
|
||||
pass_object_size attribute has precedence over the default symbol.
|
||||
|
||||
Also, clang does not support __va_arg_pack, so variadic functions are
|
||||
expanded to issue va_arg implementations. The error function must not have
|
||||
bodies (address takes are expanded to nonfortified calls), and with
|
||||
__fortify_function compiler might still create a body with the C++
|
||||
mangling name (due to the overload attribute). In this case, the function
|
||||
is defined with __fortify_function_error_function macro instead.
|
||||
|
||||
The argument size check is also done with a clang-only attribute,
|
||||
__attribute__ ((__diagnose_if__ (...))), different than gcc which calls
|
||||
symbol_chk_warn alias with uses __warnattr attribute.
|
||||
|
||||
The pass_object_size was added on clang 4.0, __diagnose_if__ on 5.0,
|
||||
and pass_dynamic_object_size on 9.0. */
|
||||
#if defined __clang_major__ && __clang_major__ >= 5
|
||||
# define __fortify_use_clang 1
|
||||
|
||||
# define __fortify_function_error_function static __attribute__((__unused__))
|
||||
|
||||
# define __fortify_clang_pass_object_size_n(n) \
|
||||
__attribute__ ((__pass_object_size__ (n)))
|
||||
# define __fortify_clang_pass_object_size0 \
|
||||
__fortify_clang_pass_object_size_n (0)
|
||||
# define __fortify_clang_pass_object_size \
|
||||
__fortify_clang_pass_object_size_n (__USE_FORTIFY_LEVEL > 1)
|
||||
|
||||
# if __clang_major__ >= 9
|
||||
# define __fortify_clang_pass_dynamic_object_size_n(n) \
|
||||
__attribute__ ((__pass_dynamic_object_size__ (n)))
|
||||
# define __fortify_clang_pass_dynamic_object_size0 \
|
||||
__fortify_clang_pass_dynamic_object_size_n (0)
|
||||
# define __fortify_clang_pass_dynamic_object_size \
|
||||
__fortify_clang_pass_dynamic_object_size_n (1)
|
||||
# else
|
||||
# define __fortify_clang_pass_dynamic_object_size_n(n)
|
||||
# define __fortify_clang_pass_dynamic_object_size0
|
||||
# define __fortify_clang_pass_dynamic_object_size
|
||||
# endif
|
||||
|
||||
# define __fortify_clang_bos_static_lt_impl(bos_val, n, s) \
|
||||
((bos_val) != -1ULL && (n) > (bos_val) / (s))
|
||||
# define __fortify_clang_bos_static_lt2(__n, __e, __s) \
|
||||
__fortify_clang_bos_static_lt_impl (__bos (__e), __n, __s)
|
||||
# define __fortify_clang_bos_static_lt(__n, __e) \
|
||||
__fortify_clang_bos_static_lt2 (__n, __e, 1)
|
||||
# define __fortify_clang_bos0_static_lt2(__n, __e, __s) \
|
||||
__fortify_clang_bos_static_lt_impl (__bos0 (__e), __n, __s)
|
||||
# define __fortify_clang_bos0_static_lt(__n, __e) \
|
||||
__fortify_clang_bos0_static_lt2 (__n, __e, 1)
|
||||
|
||||
# define __fortify_clang_bosn_args(bos_fn, n, buf, div, complaint) \
|
||||
(__fortify_clang_bos_static_lt_impl (bos_fn (buf), n, div)), (complaint), \
|
||||
"warning"
|
||||
|
||||
# define __fortify_clang_warning(__c, __msg) \
|
||||
__attribute__ ((__diagnose_if__ ((__c), (__msg), "warning")))
|
||||
# define __fortify_clang_error(__c, __msg) \
|
||||
__attribute__ ((__diagnose_if__ ((__c), (__msg), "error")))
|
||||
# define __fortify_clang_warning_only_if_bos0_lt(n, buf, complaint) \
|
||||
__attribute__ ((__diagnose_if__ \
|
||||
(__fortify_clang_bosn_args (__bos0, n, buf, 1, complaint))))
|
||||
# define __fortify_clang_warning_only_if_bos0_lt2(n, buf, div, complaint) \
|
||||
__attribute__ ((__diagnose_if__ \
|
||||
(__fortify_clang_bosn_args (__bos0, n, buf, div, complaint))))
|
||||
# define __fortify_clang_warning_only_if_bos_lt(n, buf, complaint) \
|
||||
__attribute__ ((__diagnose_if__ \
|
||||
(__fortify_clang_bosn_args (__bos, n, buf, 1, complaint))))
|
||||
# define __fortify_clang_warning_only_if_bos_lt2(n, buf, div, complaint) \
|
||||
__attribute__ ((__diagnose_if__ \
|
||||
(__fortify_clang_bosn_args (__bos, n, buf, div, complaint))))
|
||||
|
||||
# define __fortify_clang_prefer_this_overload \
|
||||
__attribute__ ((enable_if (1, "")))
|
||||
# define __fortify_clang_unavailable(__msg) \
|
||||
__attribute__ ((unavailable(__msg)))
|
||||
|
||||
# if __USE_FORTIFY_LEVEL == 3
|
||||
# define __fortify_clang_overload_arg(__type, __attr, __name) \
|
||||
__type __attr const __fortify_clang_pass_dynamic_object_size __name
|
||||
# define __fortify_clang_overload_arg0(__type, __attr, __name) \
|
||||
__type __attr const __fortify_clang_pass_dynamic_object_size0 __name
|
||||
# else
|
||||
# define __fortify_clang_overload_arg(__type, __attr, __name) \
|
||||
__type __attr const __fortify_clang_pass_object_size __name
|
||||
# define __fortify_clang_overload_arg0(__type, __attr, __name) \
|
||||
__type __attr const __fortify_clang_pass_object_size0 __name
|
||||
# endif
|
||||
|
||||
# define __fortify_clang_mul_may_overflow(size, n) \
|
||||
((size | n) >= (((size_t)1) << (8 * sizeof (size_t) / 2)))
|
||||
|
||||
# define __fortify_clang_size_too_small(__bos, __dest, __len) \
|
||||
(__bos (__dest) != (size_t) -1 && __bos (__dest) < __len)
|
||||
# define __fortify_clang_warn_if_src_too_large(__dest, __src) \
|
||||
__fortify_clang_warning (__fortify_clang_size_too_small (__glibc_objsize, \
|
||||
__dest, \
|
||||
__builtin_strlen (__src) + 1), \
|
||||
"destination buffer will always be overflown by source")
|
||||
# define __fortify_clang_warn_if_dest_too_small(__dest, __len) \
|
||||
__fortify_clang_warning (__fortify_clang_size_too_small (__glibc_objsize, \
|
||||
__dest, \
|
||||
__len), \
|
||||
"function called with bigger length than the destination buffer")
|
||||
# define __fortify_clang_warn_if_dest_too_small0(__dest, __len) \
|
||||
__fortify_clang_warning (__fortify_clang_size_too_small (__glibc_objsize0, \
|
||||
__dest, \
|
||||
__len), \
|
||||
"function called with bigger length than the destination buffer")
|
||||
#else
|
||||
# define __fortify_use_clang 0
|
||||
# define __fortify_clang_warning(__c, __msg)
|
||||
# define __fortify_clang_warning_only_if_bos0_lt(__n, __buf, __complaint)
|
||||
# define __fortify_clang_warning_only_if_bos0_lt2(__n, __buf, __div, complaint)
|
||||
# define __fortify_clang_warning_only_if_bos_lt(__n, __buf, __complaint)
|
||||
# define __fortify_clang_warning_only_if_bos_lt2(__n, __buf, div, __complaint)
|
||||
# define __fortify_clang_overload_arg(__type, __attr, __name) \
|
||||
__type __attr __name
|
||||
# define __fortify_clang_overload_arg0(__type, __attr, __name) \
|
||||
__fortify_clang_overload_arg (__type, __attr, __name)
|
||||
# define __fortify_clang_warn_if_src_too_large(__dest, __src)
|
||||
# define __fortify_clang_warn_if_dest_too_small(__dest, __len)
|
||||
# define __fortify_clang_warn_if_dest_too_small0(__dest, __len)
|
||||
#endif
|
||||
|
||||
|
||||
/* Fortify function f. __f_alias, __f_chk and __f_chk_warn must be
|
||||
declared. */
|
||||
|
||||
#if !__fortify_use_clang
|
||||
# define __glibc_fortify(f, __l, __s, __osz, ...) \
|
||||
(__glibc_safe_or_unknown_len (__l, __s, __osz) \
|
||||
? __ ## f ## _alias (__VA_ARGS__) \
|
||||
: (__glibc_unsafe_len (__l, __s, __osz) \
|
||||
? __ ## f ## _chk_warn (__VA_ARGS__, __osz) \
|
||||
: __ ## f ## _chk (__VA_ARGS__, __osz)))
|
||||
#else
|
||||
# define __glibc_fortify(f, __l, __s, __osz, ...) \
|
||||
(__osz == (__SIZE_TYPE__) -1) \
|
||||
? __ ## f ## _alias (__VA_ARGS__) \
|
||||
: __ ## f ## _chk (__VA_ARGS__, __osz)
|
||||
#endif
|
||||
|
||||
/* Fortify function f, where object size argument passed to f is the number of
|
||||
elements and not total size. */
|
||||
|
||||
#if !__fortify_use_clang
|
||||
# define __glibc_fortify_n(f, __l, __s, __osz, ...) \
|
||||
(__glibc_safe_or_unknown_len (__l, __s, __osz) \
|
||||
? __ ## f ## _alias (__VA_ARGS__) \
|
||||
: (__glibc_unsafe_len (__l, __s, __osz) \
|
||||
? __ ## f ## _chk_warn (__VA_ARGS__, (__osz) / (__s)) \
|
||||
: __ ## f ## _chk (__VA_ARGS__, (__osz) / (__s))))
|
||||
# else
|
||||
# define __glibc_fortify_n(f, __l, __s, __osz, ...) \
|
||||
(__osz == (__SIZE_TYPE__) -1) \
|
||||
? __ ## f ## _alias (__VA_ARGS__) \
|
||||
: __ ## f ## _chk (__VA_ARGS__, (__osz) / (__s))
|
||||
#endif
|
||||
|
||||
#endif /* __USE_FORTIFY_LEVEL > 0 */
|
||||
|
||||
#if __GNUC_PREREQ (4,3)
|
||||
# define __warnattr(msg) __attribute__((__warning__ (msg)))
|
||||
# define __errordecl(name, msg) \
|
||||
extern void name (void) __attribute__((__error__ (msg)))
|
||||
#else
|
||||
# define __warnattr(msg)
|
||||
# define __errordecl(name, msg) extern void name (void)
|
||||
#endif
|
||||
|
||||
/* Support for flexible arrays.
|
||||
Headers that should use flexible arrays only if they're "real"
|
||||
(e.g. only if they won't affect sizeof()) should test
|
||||
#if __glibc_c99_flexarr_available. */
|
||||
#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L && !defined __HP_cc
|
||||
# define __flexarr []
|
||||
# define __glibc_c99_flexarr_available 1
|
||||
#elif __GNUC_PREREQ (2,97) || defined __clang__
|
||||
/* GCC 2.97 and clang support C99 flexible array members as an extension,
|
||||
even when in C89 mode or compiling C++ (any version). */
|
||||
# define __flexarr []
|
||||
# define __glibc_c99_flexarr_available 1
|
||||
#elif defined __GNUC__
|
||||
/* Pre-2.97 GCC did not support C99 flexible arrays but did have
|
||||
an equivalent extension with slightly different notation. */
|
||||
# define __flexarr [0]
|
||||
# define __glibc_c99_flexarr_available 1
|
||||
#else
|
||||
/* Some other non-C99 compiler. Approximate with [1]. */
|
||||
# define __flexarr [1]
|
||||
# define __glibc_c99_flexarr_available 0
|
||||
#endif
|
||||
|
||||
|
||||
/* __asm__ ("xyz") is used throughout the headers to rename functions
|
||||
at the assembly language level. This is wrapped by the __REDIRECT
|
||||
macro, in order to support compilers that can do this some other
|
||||
way. When compilers don't support asm-names at all, we have to do
|
||||
preprocessor tricks instead (which don't have exactly the right
|
||||
semantics, but it's the best we can do).
|
||||
|
||||
Example:
|
||||
int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */
|
||||
|
||||
#if (defined __GNUC__ && __GNUC__ >= 2) || (__clang_major__ >= 4)
|
||||
|
||||
# define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias))
|
||||
# ifdef __cplusplus
|
||||
# define __REDIRECT_NTH(name, proto, alias) \
|
||||
name proto __THROW __asm__ (__ASMNAME (#alias))
|
||||
# define __REDIRECT_NTHNL(name, proto, alias) \
|
||||
name proto __THROWNL __asm__ (__ASMNAME (#alias))
|
||||
# else
|
||||
# define __REDIRECT_NTH(name, proto, alias) \
|
||||
name proto __asm__ (__ASMNAME (#alias)) __THROW
|
||||
# define __REDIRECT_NTHNL(name, proto, alias) \
|
||||
name proto __asm__ (__ASMNAME (#alias)) __THROWNL
|
||||
# endif
|
||||
# define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname)
|
||||
# define __ASMNAME2(prefix, cname) __STRING (prefix) cname
|
||||
|
||||
#ifndef __REDIRECT_FORTIFY
|
||||
#define __REDIRECT_FORTIFY __REDIRECT
|
||||
#endif
|
||||
|
||||
#ifndef __REDIRECT_FORTIFY_NTH
|
||||
#define __REDIRECT_FORTIFY_NTH __REDIRECT_NTH
|
||||
#endif
|
||||
|
||||
/*
|
||||
#elif __SOME_OTHER_COMPILER__
|
||||
|
||||
# define __REDIRECT(name, proto, alias) name proto; \
|
||||
_Pragma("let " #name " = " #alias)
|
||||
*/
|
||||
#endif
|
||||
|
||||
/* GCC and clang have various useful declarations that can be made with
|
||||
the '__attribute__' syntax. All of the ways we use this do fine if
|
||||
they are omitted for compilers that don't understand it. */
|
||||
#if !(defined __GNUC__ || defined __clang__)
|
||||
# define __attribute__(xyz) /* Ignore */
|
||||
#endif
|
||||
|
||||
/* At some point during the gcc 2.96 development the `malloc' attribute
|
||||
for functions was introduced. We don't want to use it unconditionally
|
||||
(although this would be possible) since it generates warnings. */
|
||||
#if __GNUC_PREREQ (2,96) || __glibc_has_attribute (__malloc__)
|
||||
# define __attribute_malloc__ __attribute__ ((__malloc__))
|
||||
#else
|
||||
# define __attribute_malloc__ /* Ignore */
|
||||
#endif
|
||||
|
||||
/* Tell the compiler which arguments to an allocation function
|
||||
indicate the size of the allocation. */
|
||||
#if __GNUC_PREREQ (4, 3)
|
||||
# define __attribute_alloc_size__(params) \
|
||||
__attribute__ ((__alloc_size__ params))
|
||||
#else
|
||||
# define __attribute_alloc_size__(params) /* Ignore. */
|
||||
#endif
|
||||
|
||||
/* Tell the compiler which argument to an allocation function
|
||||
indicates the alignment of the allocation. */
|
||||
#if __GNUC_PREREQ (4, 9) || __glibc_has_attribute (__alloc_align__)
|
||||
# define __attribute_alloc_align__(param) \
|
||||
__attribute__ ((__alloc_align__ param))
|
||||
#else
|
||||
# define __attribute_alloc_align__(param) /* Ignore. */
|
||||
#endif
|
||||
|
||||
/* At some point during the gcc 2.96 development the `pure' attribute
|
||||
for functions was introduced. We don't want to use it unconditionally
|
||||
(although this would be possible) since it generates warnings. */
|
||||
#if __GNUC_PREREQ (2,96) || __glibc_has_attribute (__pure__)
|
||||
# define __attribute_pure__ __attribute__ ((__pure__))
|
||||
#else
|
||||
# define __attribute_pure__ /* Ignore */
|
||||
#endif
|
||||
|
||||
/* This declaration tells the compiler that the value is constant. */
|
||||
#if __GNUC_PREREQ (2,5) || __glibc_has_attribute (__const__)
|
||||
# define __attribute_const__ __attribute__ ((__const__))
|
||||
#else
|
||||
# define __attribute_const__ /* Ignore */
|
||||
#endif
|
||||
|
||||
#if __GNUC_PREREQ (2,7) || __glibc_has_attribute (__unused__)
|
||||
# define __attribute_maybe_unused__ __attribute__ ((__unused__))
|
||||
#else
|
||||
# define __attribute_maybe_unused__ /* Ignore */
|
||||
#endif
|
||||
|
||||
/* At some point during the gcc 3.1 development the `used' attribute
|
||||
for functions was introduced. We don't want to use it unconditionally
|
||||
(although this would be possible) since it generates warnings. */
|
||||
#if __GNUC_PREREQ (3,1) || __glibc_has_attribute (__used__)
|
||||
# define __attribute_used__ __attribute__ ((__used__))
|
||||
# define __attribute_noinline__ __attribute__ ((__noinline__))
|
||||
#else
|
||||
# define __attribute_used__ __attribute__ ((__unused__))
|
||||
# define __attribute_noinline__ /* Ignore */
|
||||
#endif
|
||||
|
||||
/* Since version 3.2, gcc allows marking deprecated functions. */
|
||||
#if __GNUC_PREREQ (3,2) || __glibc_has_attribute (__deprecated__)
|
||||
# define __attribute_deprecated__ __attribute__ ((__deprecated__))
|
||||
#else
|
||||
# define __attribute_deprecated__ /* Ignore */
|
||||
#endif
|
||||
|
||||
/* Since version 4.5, gcc also allows one to specify the message printed
|
||||
when a deprecated function is used. clang claims to be gcc 4.2, but
|
||||
may also support this feature. */
|
||||
#if __GNUC_PREREQ (4,5) \
|
||||
|| __glibc_has_extension (__attribute_deprecated_with_message__)
|
||||
# define __attribute_deprecated_msg__(msg) \
|
||||
__attribute__ ((__deprecated__ (msg)))
|
||||
#else
|
||||
# define __attribute_deprecated_msg__(msg) __attribute_deprecated__
|
||||
#endif
|
||||
|
||||
/* At some point during the gcc 2.8 development the `format_arg' attribute
|
||||
for functions was introduced. We don't want to use it unconditionally
|
||||
(although this would be possible) since it generates warnings.
|
||||
If several `format_arg' attributes are given for the same function, in
|
||||
gcc-3.0 and older, all but the last one are ignored. In newer gccs,
|
||||
all designated arguments are considered. */
|
||||
#if __GNUC_PREREQ (2,8) || __glibc_has_attribute (__format_arg__)
|
||||
# define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x)))
|
||||
#else
|
||||
# define __attribute_format_arg__(x) /* Ignore */
|
||||
#endif
|
||||
|
||||
/* At some point during the gcc 2.97 development the `strfmon' format
|
||||
attribute for functions was introduced. We don't want to use it
|
||||
unconditionally (although this would be possible) since it
|
||||
generates warnings. */
|
||||
#if __GNUC_PREREQ (2,97) || __glibc_has_attribute (__format__)
|
||||
# define __attribute_format_strfmon__(a,b) \
|
||||
__attribute__ ((__format__ (__strfmon__, a, b)))
|
||||
#else
|
||||
# define __attribute_format_strfmon__(a,b) /* Ignore */
|
||||
#endif
|
||||
|
||||
/* The nonnull function attribute marks pointer parameters that
|
||||
must not be NULL. This has the name __nonnull in glibc,
|
||||
and __attribute_nonnull__ in files shared with Gnulib to avoid
|
||||
collision with a different __nonnull in DragonFlyBSD 5.9. */
|
||||
#ifndef __attribute_nonnull__
|
||||
# if __GNUC_PREREQ (3,3) || __glibc_has_attribute (__nonnull__)
|
||||
# define __attribute_nonnull__(params) __attribute__ ((__nonnull__ params))
|
||||
# else
|
||||
# define __attribute_nonnull__(params)
|
||||
# endif
|
||||
#endif
|
||||
#ifndef __nonnull
|
||||
# define __nonnull(params) __attribute_nonnull__ (params)
|
||||
#endif
|
||||
|
||||
/* The returns_nonnull function attribute marks the return type of the function
|
||||
as always being non-null. */
|
||||
#ifndef __returns_nonnull
|
||||
# if __GNUC_PREREQ (4, 9) || __glibc_has_attribute (__returns_nonnull__)
|
||||
# define __returns_nonnull __attribute__ ((__returns_nonnull__))
|
||||
# else
|
||||
# define __returns_nonnull
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* If fortification mode, we warn about unused results of certain
|
||||
function calls which can lead to problems. */
|
||||
#if __GNUC_PREREQ (3,4) || __glibc_has_attribute (__warn_unused_result__)
|
||||
# define __attribute_warn_unused_result__ \
|
||||
__attribute__ ((__warn_unused_result__))
|
||||
# if defined __USE_FORTIFY_LEVEL && __USE_FORTIFY_LEVEL > 0
|
||||
# define __wur __attribute_warn_unused_result__
|
||||
# endif
|
||||
#else
|
||||
# define __attribute_warn_unused_result__ /* empty */
|
||||
#endif
|
||||
#ifndef __wur
|
||||
# define __wur /* Ignore */
|
||||
#endif
|
||||
|
||||
/* Forces a function to be always inlined. */
|
||||
#if __GNUC_PREREQ (3,2) || __glibc_has_attribute (__always_inline__)
|
||||
/* The Linux kernel defines __always_inline in stddef.h (283d7573), and
|
||||
it conflicts with this definition. Therefore undefine it first to
|
||||
allow either header to be included first. */
|
||||
# undef __always_inline
|
||||
# define __always_inline __inline __attribute__ ((__always_inline__))
|
||||
#else
|
||||
# undef __always_inline
|
||||
# define __always_inline __inline
|
||||
#endif
|
||||
|
||||
/* Associate error messages with the source location of the call site rather
|
||||
than with the source location inside the function. */
|
||||
#if __GNUC_PREREQ (4,3) || __glibc_has_attribute (__artificial__)
|
||||
# define __attribute_artificial__ __attribute__ ((__artificial__))
|
||||
#else
|
||||
# define __attribute_artificial__ /* Ignore */
|
||||
#endif
|
||||
|
||||
/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
|
||||
inline semantics, unless -fgnu89-inline is used. Using __GNUC_STDC_INLINE__
|
||||
or __GNUC_GNU_INLINE is not a good enough check for gcc because gcc versions
|
||||
older than 4.3 may define these macros and still not guarantee GNU inlining
|
||||
semantics.
|
||||
|
||||
clang++ identifies itself as gcc-4.2, but has support for GNU inlining
|
||||
semantics, that can be checked for by using the __GNUC_STDC_INLINE_ and
|
||||
__GNUC_GNU_INLINE__ macro definitions. */
|
||||
#if (!defined __cplusplus || __GNUC_PREREQ (4,3) \
|
||||
|| (defined __clang__ && (defined __GNUC_STDC_INLINE__ \
|
||||
|| defined __GNUC_GNU_INLINE__)))
|
||||
# if defined __GNUC_STDC_INLINE__ || defined __cplusplus
|
||||
# define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
|
||||
# define __extern_always_inline \
|
||||
extern __always_inline __attribute__ ((__gnu_inline__))
|
||||
# else
|
||||
# define __extern_inline extern __inline
|
||||
# define __extern_always_inline extern __always_inline
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __extern_always_inline
|
||||
# define __fortify_function __extern_always_inline __attribute_artificial__
|
||||
#endif
|
||||
|
||||
/* GCC 4.3 and above allow passing all anonymous arguments of an
|
||||
__extern_always_inline function to some other vararg function. */
|
||||
#if __GNUC_PREREQ (4,3)
|
||||
# define __va_arg_pack() __builtin_va_arg_pack ()
|
||||
# define __va_arg_pack_len() __builtin_va_arg_pack_len ()
|
||||
#endif
|
||||
|
||||
/* It is possible to compile containing GCC extensions even if GCC is
|
||||
run in pedantic mode if the uses are carefully marked using the
|
||||
`__extension__' keyword. But this is not generally available before
|
||||
version 2.8. */
|
||||
#if !(__GNUC_PREREQ (2,8) || defined __clang__)
|
||||
# define __extension__ /* Ignore */
|
||||
#endif
|
||||
|
||||
/* __restrict is known in EGCS 1.2 and above, and in clang.
|
||||
It works also in C++ mode (outside of arrays), but only when spelled
|
||||
as '__restrict', not 'restrict'. */
|
||||
#if !(__GNUC_PREREQ (2,92) || __clang_major__ >= 3)
|
||||
# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
|
||||
# define __restrict restrict
|
||||
# else
|
||||
# define __restrict /* Ignore */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* ISO C99 also allows to declare arrays as non-overlapping. The syntax is
|
||||
array_name[restrict]
|
||||
GCC 3.1 and clang support this.
|
||||
This syntax is not usable in C++ mode. */
|
||||
#if (__GNUC_PREREQ (3,1) || __clang_major__ >= 3) && !defined __cplusplus
|
||||
# define __restrict_arr __restrict
|
||||
#else
|
||||
# ifdef __GNUC__
|
||||
# define __restrict_arr /* Not supported in old GCC. */
|
||||
# else
|
||||
# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
|
||||
# define __restrict_arr restrict
|
||||
# else
|
||||
/* Some other non-C99 compiler. */
|
||||
# define __restrict_arr /* Not supported. */
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if (__GNUC__ >= 3) || __glibc_has_builtin (__builtin_expect)
|
||||
# define __glibc_unlikely(cond) __builtin_expect ((cond), 0)
|
||||
# define __glibc_likely(cond) __builtin_expect ((cond), 1)
|
||||
#else
|
||||
# define __glibc_unlikely(cond) (cond)
|
||||
# define __glibc_likely(cond) (cond)
|
||||
#endif
|
||||
|
||||
#if (!defined _Noreturn \
|
||||
&& (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \
|
||||
&& !(__GNUC_PREREQ (4,7) \
|
||||
|| (3 < __clang_major__ + (5 <= __clang_minor__))))
|
||||
# if __GNUC_PREREQ (2,8)
|
||||
# define _Noreturn __attribute__ ((__noreturn__))
|
||||
# else
|
||||
# define _Noreturn
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if __GNUC_PREREQ (8, 0)
|
||||
/* Describes a char array whose address can safely be passed as the first
|
||||
argument to strncpy and strncat, as the char array is not necessarily
|
||||
a NUL-terminated string. */
|
||||
# define __attribute_nonstring__ __attribute__ ((__nonstring__))
|
||||
#else
|
||||
# define __attribute_nonstring__
|
||||
#endif
|
||||
|
||||
/* Undefine (also defined in libc-symbols.h). */
|
||||
#undef __attribute_copy__
|
||||
#if __GNUC_PREREQ (9, 0)
|
||||
/* Copies attributes from the declaration or type referenced by
|
||||
the argument. */
|
||||
# define __attribute_copy__(arg) __attribute__ ((__copy__ (arg)))
|
||||
#else
|
||||
# define __attribute_copy__(arg)
|
||||
#endif
|
||||
|
||||
#if (!defined _Static_assert && !defined __cplusplus \
|
||||
&& (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \
|
||||
&& (!(__GNUC_PREREQ (4, 6) || __clang_major__ >= 4) \
|
||||
|| defined __STRICT_ANSI__))
|
||||
# define _Static_assert(expr, diagnostic) \
|
||||
extern int (*__Static_assert_function (void)) \
|
||||
[!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })]
|
||||
#endif
|
||||
|
||||
/* Gnulib avoids including these, as they don't work on non-glibc or
|
||||
older glibc platforms. */
|
||||
#ifndef __GNULIB_CDEFS
|
||||
# include <bits/wordsize.h>
|
||||
# include <bits/long-double.h>
|
||||
#endif
|
||||
|
||||
#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
|
||||
# ifdef __REDIRECT
|
||||
|
||||
/* Alias name defined automatically. */
|
||||
# define __LDBL_REDIR(name, proto) ... unused__ldbl_redir
|
||||
# define __LDBL_REDIR_DECL(name) \
|
||||
extern __typeof (name) name __asm (__ASMNAME ("__" #name "ieee128"));
|
||||
# define __REDIRECT_LDBL(name, proto, alias) \
|
||||
name proto __asm (__ASMNAME ("__" #alias "ieee128"))
|
||||
|
||||
/* Alias name defined automatically, with leading underscores. */
|
||||
# define __LDBL_REDIR2_DECL(name) \
|
||||
extern __typeof (__##name) __##name \
|
||||
__asm (__ASMNAME ("__" #name "ieee128"));
|
||||
|
||||
/* Alias name defined manually. */
|
||||
# define __LDBL_REDIR1(name, proto, alias) ... unused__ldbl_redir1
|
||||
# define __LDBL_REDIR1_DECL(name, alias) \
|
||||
extern __typeof (name) name __asm (__ASMNAME (#alias));
|
||||
|
||||
# define __LDBL_REDIR1_NTH(name, proto, alias) \
|
||||
__REDIRECT_NTH (name, proto, alias)
|
||||
# define __REDIRECT_NTH_LDBL(name, proto, alias) \
|
||||
__LDBL_REDIR1_NTH (name, proto, __##alias##ieee128)
|
||||
|
||||
/* Unused. */
|
||||
# define __LDBL_REDIR_NTH(name, proto) ... unused__ldbl_redir_nth
|
||||
|
||||
# else
|
||||
_Static_assert (0, "IEEE 128-bits long double requires redirection on this platform");
|
||||
# endif
|
||||
#elif defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
|
||||
# define __LDBL_COMPAT 1
|
||||
# ifdef __REDIRECT
|
||||
# define __LDBL_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias)
|
||||
# define __LDBL_REDIR(name, proto) \
|
||||
__LDBL_REDIR1 (name, proto, __nldbl_##name)
|
||||
# define __LDBL_REDIR1_NTH(name, proto, alias) __REDIRECT_NTH (name, proto, alias)
|
||||
# define __LDBL_REDIR_NTH(name, proto) \
|
||||
__LDBL_REDIR1_NTH (name, proto, __nldbl_##name)
|
||||
# define __LDBL_REDIR2_DECL(name) \
|
||||
extern __typeof (__##name) __##name __asm (__ASMNAME ("__nldbl___" #name));
|
||||
# define __LDBL_REDIR1_DECL(name, alias) \
|
||||
extern __typeof (name) name __asm (__ASMNAME (#alias));
|
||||
# define __LDBL_REDIR_DECL(name) \
|
||||
extern __typeof (name) name __asm (__ASMNAME ("__nldbl_" #name));
|
||||
# define __REDIRECT_LDBL(name, proto, alias) \
|
||||
__LDBL_REDIR1 (name, proto, __nldbl_##alias)
|
||||
# define __REDIRECT_NTH_LDBL(name, proto, alias) \
|
||||
__LDBL_REDIR1_NTH (name, proto, __nldbl_##alias)
|
||||
# endif
|
||||
#endif
|
||||
#if (!defined __LDBL_COMPAT && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0) \
|
||||
|| !defined __REDIRECT
|
||||
# define __LDBL_REDIR1(name, proto, alias) name proto
|
||||
# define __LDBL_REDIR(name, proto) name proto
|
||||
# define __LDBL_REDIR1_NTH(name, proto, alias) name proto __THROW
|
||||
# define __LDBL_REDIR_NTH(name, proto) name proto __THROW
|
||||
# define __LDBL_REDIR2_DECL(name)
|
||||
# define __LDBL_REDIR_DECL(name)
|
||||
# ifdef __REDIRECT
|
||||
# define __REDIRECT_LDBL(name, proto, alias) __REDIRECT (name, proto, alias)
|
||||
# define __REDIRECT_NTH_LDBL(name, proto, alias) \
|
||||
__REDIRECT_NTH (name, proto, alias)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* __glibc_macro_warning (MESSAGE) issues warning MESSAGE. This is
|
||||
intended for use in preprocessor macros.
|
||||
|
||||
Note: MESSAGE must be a _single_ string; concatenation of string
|
||||
literals is not supported. */
|
||||
#if __GNUC_PREREQ (4,8) || __glibc_clang_prereq (3,5)
|
||||
# define __glibc_macro_warning1(message) _Pragma (#message)
|
||||
# define __glibc_macro_warning(message) \
|
||||
__glibc_macro_warning1 (GCC warning message)
|
||||
#else
|
||||
# define __glibc_macro_warning(msg)
|
||||
#endif
|
||||
|
||||
/* Generic selection (ISO C11) is a C-only feature, available in GCC
|
||||
since version 4.9. Previous versions do not provide generic
|
||||
selection, even though they might set __STDC_VERSION__ to 201112L,
|
||||
when in -std=c11 mode. Thus, we must check for !defined __GNUC__
|
||||
when testing __STDC_VERSION__ for generic selection support.
|
||||
On the other hand, Clang also defines __GNUC__, so a clang-specific
|
||||
check is required to enable the use of generic selection. */
|
||||
#if !defined __cplusplus \
|
||||
&& (__GNUC_PREREQ (4, 9) \
|
||||
|| __glibc_has_extension (c_generic_selections) \
|
||||
|| (!defined __GNUC__ && defined __STDC_VERSION__ \
|
||||
&& __STDC_VERSION__ >= 201112L))
|
||||
# define __HAVE_GENERIC_SELECTION 1
|
||||
#else
|
||||
# define __HAVE_GENERIC_SELECTION 0
|
||||
#endif
|
||||
|
||||
#if __GNUC_PREREQ (10, 0)
|
||||
/* Designates a 1-based positional argument ref-index of pointer type
|
||||
that can be used to access size-index elements of the pointed-to
|
||||
array according to access mode, or at least one element when
|
||||
size-index is not provided:
|
||||
access (access-mode, <ref-index> [, <size-index>]) */
|
||||
# define __attr_access(x) __attribute__ ((__access__ x))
|
||||
/* For _FORTIFY_SOURCE == 3 we use __builtin_dynamic_object_size, which may
|
||||
use the access attribute to get object sizes from function definition
|
||||
arguments, so we can't use them on functions we fortify. Drop the access
|
||||
attribute for such functions. */
|
||||
# if __USE_FORTIFY_LEVEL == 3
|
||||
# define __fortified_attr_access(a, o, s)
|
||||
# else
|
||||
# define __fortified_attr_access(a, o, s) __attr_access ((a, o, s))
|
||||
# endif
|
||||
# if __GNUC_PREREQ (11, 0)
|
||||
# define __attr_access_none(argno) __attribute__ ((__access__ (__none__, argno)))
|
||||
# else
|
||||
# define __attr_access_none(argno)
|
||||
# endif
|
||||
#else
|
||||
# define __fortified_attr_access(a, o, s)
|
||||
# define __attr_access(x)
|
||||
# define __attr_access_none(argno)
|
||||
#endif
|
||||
|
||||
#if __GNUC_PREREQ (11, 0)
|
||||
/* Designates dealloc as a function to call to deallocate objects
|
||||
allocated by the declared function. */
|
||||
# define __attr_dealloc(dealloc, argno) \
|
||||
__attribute__ ((__malloc__ (dealloc, argno)))
|
||||
# define __attr_dealloc_free __attr_dealloc (__builtin_free, 1)
|
||||
#else
|
||||
# define __attr_dealloc(dealloc, argno)
|
||||
# define __attr_dealloc_free
|
||||
#endif
|
||||
|
||||
/* Specify that a function such as setjmp or vfork may return
|
||||
twice. */
|
||||
#if __GNUC_PREREQ (4, 1)
|
||||
# define __attribute_returns_twice__ __attribute__ ((__returns_twice__))
|
||||
#else
|
||||
# define __attribute_returns_twice__ /* Ignore. */
|
||||
#endif
|
||||
|
||||
/* Mark struct types as aliasable. Restricted to compilers that
|
||||
support forward declarations of structs in the presence of the
|
||||
attribute. */
|
||||
#if __GNUC_PREREQ (7, 1) || defined __clang__
|
||||
# define __attribute_struct_may_alias__ __attribute__ ((__may_alias__))
|
||||
#else
|
||||
# define __attribute_struct_may_alias__
|
||||
#endif
|
||||
|
||||
#endif /* sys/cdefs.h */
|
||||
88
board/mentalnet/overlay/usr/include/sys/debugreg.h
Normal file
88
board/mentalnet/overlay/usr/include/sys/debugreg.h
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
/* Copyright (C) 2001-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_DEBUGREG_H
|
||||
#define _SYS_DEBUGREG_H 1
|
||||
|
||||
/* Indicate the register numbers for a number of the specific
|
||||
debug registers. Registers 0-3 contain the addresses we wish to trap on */
|
||||
#define DR_FIRSTADDR 0 /* u_debugreg[DR_FIRSTADDR] */
|
||||
#define DR_LASTADDR 3 /* u_debugreg[DR_LASTADDR] */
|
||||
|
||||
#define DR_STATUS 6 /* u_debugreg[DR_STATUS] */
|
||||
#define DR_CONTROL 7 /* u_debugreg[DR_CONTROL] */
|
||||
|
||||
/* Define a few things for the status register. We can use this to determine
|
||||
which debugging register was responsible for the trap. The other bits
|
||||
are either reserved or not of interest to us. */
|
||||
|
||||
#define DR_TRAP0 (0x1) /* db0 */
|
||||
#define DR_TRAP1 (0x2) /* db1 */
|
||||
#define DR_TRAP2 (0x4) /* db2 */
|
||||
#define DR_TRAP3 (0x8) /* db3 */
|
||||
|
||||
#define DR_STEP (0x4000) /* single-step */
|
||||
#define DR_SWITCH (0x8000) /* task switch */
|
||||
|
||||
/* Now define a bunch of things for manipulating the control register.
|
||||
The top two bytes of the control register consist of 4 fields of 4
|
||||
bits - each field corresponds to one of the four debug registers,
|
||||
and indicates what types of access we trap on, and how large the data
|
||||
field is that we are looking at */
|
||||
|
||||
#define DR_CONTROL_SHIFT 16 /* Skip this many bits in ctl register */
|
||||
#define DR_CONTROL_SIZE 4 /* 4 control bits per register */
|
||||
|
||||
#define DR_RW_EXECUTE (0x0) /* Settings for the access types to trap on */
|
||||
#define DR_RW_WRITE (0x1)
|
||||
#define DR_RW_READ (0x3)
|
||||
|
||||
#define DR_LEN_1 (0x0) /* Settings for data length to trap on */
|
||||
#define DR_LEN_2 (0x4)
|
||||
#define DR_LEN_4 (0xC)
|
||||
#ifdef __x86_64__
|
||||
# define DR_LEN_8 (0x8)
|
||||
#endif
|
||||
|
||||
/* The low byte to the control register determine which registers are
|
||||
enabled. There are 4 fields of two bits. One bit is "local", meaning
|
||||
that the processor will reset the bit after a task switch and the other
|
||||
is global meaning that we have to explicitly reset the bit. With linux,
|
||||
you can use either one, since we explicitly zero the register when we enter
|
||||
kernel mode. */
|
||||
|
||||
#define DR_LOCAL_ENABLE_SHIFT 0 /* Extra shift to the local enable bit */
|
||||
#define DR_GLOBAL_ENABLE_SHIFT 1 /* Extra shift to the global enable bit */
|
||||
#define DR_ENABLE_SIZE 2 /* 2 enable bits per register */
|
||||
|
||||
#define DR_LOCAL_ENABLE_MASK (0x55) /* Set local bits for all 4 regs */
|
||||
#define DR_GLOBAL_ENABLE_MASK (0xAA) /* Set global bits for all 4 regs */
|
||||
|
||||
/* The second byte to the control register has a few special
|
||||
things. */
|
||||
|
||||
|
||||
|
||||
#ifdef __x86_64__
|
||||
# define DR_CONTROL_RESERVED (0xFFFFFFFF0000FC00ULL) /* Reserved */
|
||||
#else
|
||||
# define DR_CONTROL_RESERVED (0x00FC00U) /* Reserved */
|
||||
#endif
|
||||
#define DR_LOCAL_SLOWDOWN (0x100) /* Local slow the pipeline */
|
||||
#define DR_GLOBAL_SLOWDOWN (0x200) /* Global slow the pipeline */
|
||||
|
||||
#endif /* sys/debugreg.h */
|
||||
27
board/mentalnet/overlay/usr/include/sys/dir.h
Normal file
27
board/mentalnet/overlay/usr/include/sys/dir.h
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_DIR_H
|
||||
#define _SYS_DIR_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#include <dirent.h>
|
||||
|
||||
#define direct dirent
|
||||
|
||||
#endif /* sys/dir.h */
|
||||
29
board/mentalnet/overlay/usr/include/sys/elf.h
Normal file
29
board/mentalnet/overlay/usr/include/sys/elf.h
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/* Copyright (C) 1998-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_ELF_H
|
||||
#define _SYS_ELF_H 1
|
||||
|
||||
#ifdef __x86_64__
|
||||
# error This header is unsupported on x86-64.
|
||||
#else
|
||||
# warning "This header is obsolete; use <sys/procfs.h> instead."
|
||||
|
||||
# include <sys/procfs.h>
|
||||
#endif
|
||||
|
||||
#endif /* _SYS_ELF_H */
|
||||
177
board/mentalnet/overlay/usr/include/sys/epoll.h
Normal file
177
board/mentalnet/overlay/usr/include/sys/epoll.h
Normal file
|
|
@ -0,0 +1,177 @@
|
|||
/* Copyright (C) 2002-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_EPOLL_H
|
||||
#define _SYS_EPOLL_H 1
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <bits/types/sigset_t.h>
|
||||
#include <bits/types/struct_timespec.h>
|
||||
|
||||
/* Get the platform-dependent flags. */
|
||||
#include <bits/epoll.h>
|
||||
|
||||
#ifndef __EPOLL_PACKED
|
||||
# define __EPOLL_PACKED
|
||||
#endif
|
||||
|
||||
|
||||
enum EPOLL_EVENTS
|
||||
{
|
||||
EPOLLIN = 0x001,
|
||||
#define EPOLLIN EPOLLIN
|
||||
EPOLLPRI = 0x002,
|
||||
#define EPOLLPRI EPOLLPRI
|
||||
EPOLLOUT = 0x004,
|
||||
#define EPOLLOUT EPOLLOUT
|
||||
EPOLLRDNORM = 0x040,
|
||||
#define EPOLLRDNORM EPOLLRDNORM
|
||||
EPOLLRDBAND = 0x080,
|
||||
#define EPOLLRDBAND EPOLLRDBAND
|
||||
EPOLLWRNORM = 0x100,
|
||||
#define EPOLLWRNORM EPOLLWRNORM
|
||||
EPOLLWRBAND = 0x200,
|
||||
#define EPOLLWRBAND EPOLLWRBAND
|
||||
EPOLLMSG = 0x400,
|
||||
#define EPOLLMSG EPOLLMSG
|
||||
EPOLLERR = 0x008,
|
||||
#define EPOLLERR EPOLLERR
|
||||
EPOLLHUP = 0x010,
|
||||
#define EPOLLHUP EPOLLHUP
|
||||
EPOLLRDHUP = 0x2000,
|
||||
#define EPOLLRDHUP EPOLLRDHUP
|
||||
EPOLLEXCLUSIVE = 1u << 28,
|
||||
#define EPOLLEXCLUSIVE EPOLLEXCLUSIVE
|
||||
EPOLLWAKEUP = 1u << 29,
|
||||
#define EPOLLWAKEUP EPOLLWAKEUP
|
||||
EPOLLONESHOT = 1u << 30,
|
||||
#define EPOLLONESHOT EPOLLONESHOT
|
||||
EPOLLET = 1u << 31
|
||||
#define EPOLLET EPOLLET
|
||||
};
|
||||
|
||||
|
||||
/* Valid opcodes ( "op" parameter ) to issue to epoll_ctl(). */
|
||||
#define EPOLL_CTL_ADD 1 /* Add a file descriptor to the interface. */
|
||||
#define EPOLL_CTL_DEL 2 /* Remove a file descriptor from the interface. */
|
||||
#define EPOLL_CTL_MOD 3 /* Change file descriptor epoll_event structure. */
|
||||
|
||||
|
||||
typedef union epoll_data
|
||||
{
|
||||
void *ptr;
|
||||
int fd;
|
||||
uint32_t u32;
|
||||
uint64_t u64;
|
||||
} epoll_data_t;
|
||||
|
||||
struct epoll_event
|
||||
{
|
||||
uint32_t events; /* Epoll events */
|
||||
epoll_data_t data; /* User data variable */
|
||||
} __EPOLL_PACKED;
|
||||
|
||||
struct epoll_params
|
||||
{
|
||||
uint32_t busy_poll_usecs;
|
||||
uint16_t busy_poll_budget;
|
||||
uint8_t prefer_busy_poll;
|
||||
|
||||
/* pad the struct to a multiple of 64bits */
|
||||
uint8_t __pad;
|
||||
};
|
||||
|
||||
#define EPOLL_IOC_TYPE 0x8A
|
||||
#define EPIOCSPARAMS _IOW(EPOLL_IOC_TYPE, 0x01, struct epoll_params)
|
||||
#define EPIOCGPARAMS _IOR(EPOLL_IOC_TYPE, 0x02, struct epoll_params)
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Creates an epoll instance. Returns an fd for the new instance.
|
||||
The "size" parameter is a hint specifying the number of file
|
||||
descriptors to be associated with the new instance. The fd
|
||||
returned by epoll_create() should be closed with close(). */
|
||||
extern int epoll_create (int __size) __THROW;
|
||||
|
||||
/* Same as epoll_create but with an FLAGS parameter. The unused SIZE
|
||||
parameter has been dropped. */
|
||||
extern int epoll_create1 (int __flags) __THROW;
|
||||
|
||||
|
||||
/* Manipulate an epoll instance "epfd". Returns 0 in case of success,
|
||||
-1 in case of error ( the "errno" variable will contain the
|
||||
specific error code ) The "op" parameter is one of the EPOLL_CTL_*
|
||||
constants defined above. The "fd" parameter is the target of the
|
||||
operation. The "event" parameter describes which events the caller
|
||||
is interested in and any associated user data. */
|
||||
extern int epoll_ctl (int __epfd, int __op, int __fd,
|
||||
struct epoll_event *__event) __THROW;
|
||||
|
||||
|
||||
/* Wait for events on an epoll instance "epfd". Returns the number of
|
||||
triggered events returned in "events" buffer. Or -1 in case of
|
||||
error with the "errno" variable set to the specific error code. The
|
||||
"events" parameter is a buffer that will contain triggered
|
||||
events. The "maxevents" is the maximum number of events to be
|
||||
returned ( usually size of "events" ). The "timeout" parameter
|
||||
specifies the maximum wait time in milliseconds (-1 == infinite).
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern int epoll_wait (int __epfd, struct epoll_event *__events,
|
||||
int __maxevents, int __timeout)
|
||||
__attr_access ((__write_only__, 2, 3)) __nonnull ((2));
|
||||
|
||||
|
||||
/* Same as epoll_wait, but the thread's signal mask is temporarily
|
||||
and atomically replaced with the one provided as parameter.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern int epoll_pwait (int __epfd, struct epoll_event *__events,
|
||||
int __maxevents, int __timeout,
|
||||
const __sigset_t *__ss)
|
||||
__attr_access ((__write_only__, 2, 3)) __nonnull ((2));
|
||||
|
||||
/* Same as epoll_pwait, but the timeout as a timespec.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
#ifndef __USE_TIME64_REDIRECTS
|
||||
extern int epoll_pwait2 (int __epfd, struct epoll_event *__events,
|
||||
int __maxevents, const struct timespec *__timeout,
|
||||
const __sigset_t *__ss)
|
||||
__attr_access ((__write_only__, 2, 3)) __nonnull ((2));
|
||||
#else
|
||||
# ifdef __REDIRECT
|
||||
extern int __REDIRECT (epoll_pwait2, (int __epfd, struct epoll_event *__ev,
|
||||
int __maxevs,
|
||||
const struct timespec *__timeout,
|
||||
const __sigset_t *__ss),
|
||||
__epoll_pwait2_time64)
|
||||
__attr_access ((__write_only__, 2, 3)) __nonnull ((2));
|
||||
# else
|
||||
# define epoll_pwait2 __epoll_pwait2_time64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/epoll.h */
|
||||
1
board/mentalnet/overlay/usr/include/sys/errno.h
Normal file
1
board/mentalnet/overlay/usr/include/sys/errno.h
Normal file
|
|
@ -0,0 +1 @@
|
|||
#include <errno.h>
|
||||
44
board/mentalnet/overlay/usr/include/sys/eventfd.h
Normal file
44
board/mentalnet/overlay/usr/include/sys/eventfd.h
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
/* Copyright (C) 2007-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_EVENTFD_H
|
||||
#define _SYS_EVENTFD_H 1
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/* Get the platform-dependent flags. */
|
||||
#include <bits/eventfd.h>
|
||||
|
||||
/* Type for event counter. */
|
||||
typedef uint64_t eventfd_t;
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Return file descriptor for generic event channel. Set initial
|
||||
value to COUNT. */
|
||||
extern int eventfd (unsigned int __count, int __flags) __THROW;
|
||||
|
||||
/* Read event counter and possibly wait for events. */
|
||||
extern int eventfd_read (int __fd, eventfd_t *__value);
|
||||
|
||||
/* Increment event counter. */
|
||||
extern int eventfd_write (int __fd, eventfd_t __value);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/eventfd.h */
|
||||
38
board/mentalnet/overlay/usr/include/sys/fanotify.h
Normal file
38
board/mentalnet/overlay/usr/include/sys/fanotify.h
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
/* Copyright (C) 2010-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_FANOTIFY_H
|
||||
#define _SYS_FANOTIFY_H 1
|
||||
|
||||
#include <stdint.h>
|
||||
#include <linux/fanotify.h>
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Create and initialize fanotify group. */
|
||||
extern int fanotify_init (unsigned int __flags, unsigned int __event_f_flags)
|
||||
__THROW;
|
||||
|
||||
/* Add, remove, or modify an fanotify mark on a filesystem object. */
|
||||
extern int fanotify_mark (int __fanotify_fd, unsigned int __flags,
|
||||
uint64_t __mask, int __dfd, const char *__pathname)
|
||||
__THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/fanotify.h */
|
||||
1
board/mentalnet/overlay/usr/include/sys/fcntl.h
Normal file
1
board/mentalnet/overlay/usr/include/sys/fcntl.h
Normal file
|
|
@ -0,0 +1 @@
|
|||
#include <fcntl.h>
|
||||
55
board/mentalnet/overlay/usr/include/sys/file.h
Normal file
55
board/mentalnet/overlay/usr/include/sys/file.h
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_FILE_H
|
||||
#define _SYS_FILE_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#ifndef _FCNTL_H
|
||||
# include <fcntl.h>
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
|
||||
/* Alternate names for values for the WHENCE argument to `lseek'.
|
||||
These are the same as SEEK_SET, SEEK_CUR, and SEEK_END, respectively. */
|
||||
#ifndef L_SET
|
||||
# define L_SET 0 /* Seek from beginning of file. */
|
||||
# define L_INCR 1 /* Seek from current position. */
|
||||
# define L_XTND 2 /* Seek from end of file. */
|
||||
#endif
|
||||
|
||||
|
||||
/* Operations for the `flock' call. */
|
||||
#define LOCK_SH 1 /* Shared lock. */
|
||||
#define LOCK_EX 2 /* Exclusive lock. */
|
||||
#define LOCK_UN 8 /* Unlock. */
|
||||
|
||||
/* Can be OR'd in to one of the above. */
|
||||
#define LOCK_NB 4 /* Don't block when locking. */
|
||||
|
||||
|
||||
/* Apply or remove an advisory lock, according to OPERATION,
|
||||
on the file FD refers to. */
|
||||
extern int flock (int __fd, int __operation) __THROW;
|
||||
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/file.h */
|
||||
35
board/mentalnet/overlay/usr/include/sys/fsuid.h
Normal file
35
board/mentalnet/overlay/usr/include/sys/fsuid.h
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
/* Copyright (C) 1997-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_FSUID_H
|
||||
#define _SYS_FSUID_H 1
|
||||
|
||||
#include <features.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Change uid used for file access control to UID, without affecting
|
||||
other privileges (such as who can send signals at the process). */
|
||||
extern int setfsuid (__uid_t __uid) __THROW;
|
||||
|
||||
/* Ditto for group id. */
|
||||
extern int setfsgid (__gid_t __gid) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* fsuid.h */
|
||||
203
board/mentalnet/overlay/usr/include/sys/gmon.h
Normal file
203
board/mentalnet/overlay/usr/include/sys/gmon.h
Normal file
|
|
@ -0,0 +1,203 @@
|
|||
/*-
|
||||
* Copyright (c) 1982, 1986, 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.
|
||||
*
|
||||
* @(#)gmon.h 8.2 (Berkeley) 1/4/94
|
||||
*/
|
||||
|
||||
#ifndef _SYS_GMON_H
|
||||
#define _SYS_GMON_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
/*
|
||||
* See gmon_out.h for gmon.out format.
|
||||
*/
|
||||
|
||||
/* structure emitted by "gcc -a". This must match struct bb in
|
||||
gcc/libgcc2.c. It is OK for gcc to declare a longer structure as
|
||||
long as the members below are present. */
|
||||
struct __bb
|
||||
{
|
||||
long zero_word;
|
||||
const char *filename;
|
||||
long *counts;
|
||||
long ncounts;
|
||||
struct __bb *next;
|
||||
const unsigned long *addresses;
|
||||
};
|
||||
|
||||
extern struct __bb *__bb_head;
|
||||
|
||||
/*
|
||||
* histogram counters are unsigned shorts (according to the kernel).
|
||||
*/
|
||||
#define HISTCOUNTER unsigned short
|
||||
|
||||
/*
|
||||
* fraction of text space to allocate for histogram counters here, 1/2
|
||||
*/
|
||||
#define HISTFRACTION 2
|
||||
|
||||
/*
|
||||
* Fraction of text space to allocate for from hash buckets.
|
||||
* The value of HASHFRACTION is based on the minimum number of bytes
|
||||
* of separation between two subroutine call points in the object code.
|
||||
* Given MIN_SUBR_SEPARATION bytes of separation the value of
|
||||
* HASHFRACTION is calculated as:
|
||||
*
|
||||
* HASHFRACTION = MIN_SUBR_SEPARATION / (2 * sizeof(short) - 1);
|
||||
*
|
||||
* For example, on the VAX, the shortest two call sequence is:
|
||||
*
|
||||
* calls $0,(r0)
|
||||
* calls $0,(r0)
|
||||
*
|
||||
* which is separated by only three bytes, thus HASHFRACTION is
|
||||
* calculated as:
|
||||
*
|
||||
* HASHFRACTION = 3 / (2 * 2 - 1) = 1
|
||||
*
|
||||
* Note that the division above rounds down, thus if MIN_SUBR_FRACTION
|
||||
* is less than three, this algorithm will not work!
|
||||
*
|
||||
* In practice, however, call instructions are rarely at a minimal
|
||||
* distance. Hence, we will define HASHFRACTION to be 2 across all
|
||||
* architectures. This saves a reasonable amount of space for
|
||||
* profiling data structures without (in practice) sacrificing
|
||||
* any granularity.
|
||||
*/
|
||||
#define HASHFRACTION 2
|
||||
|
||||
/*
|
||||
* Percent of text space to allocate for tostructs.
|
||||
* This is a heuristic; we will fail with a warning when profiling programs
|
||||
* with a very large number of very small functions, but that's
|
||||
* normally OK.
|
||||
* 2 is probably still a good value for normal programs.
|
||||
* Profiling a test case with 64000 small functions will work if
|
||||
* you raise this value to 3 and link statically (which bloats the
|
||||
* text size, thus raising the number of arcs expected by the heuristic).
|
||||
*/
|
||||
#define ARCDENSITY 3
|
||||
|
||||
/*
|
||||
* Always allocate at least this many tostructs. This
|
||||
* hides the inadequacy of the ARCDENSITY heuristic, at least
|
||||
* for small programs.
|
||||
*
|
||||
* Value can be overridden at runtime by glibc.gmon.minarcs tunable.
|
||||
*/
|
||||
#define MINARCS 50
|
||||
|
||||
/*
|
||||
* The type used to represent indices into gmonparam.tos[].
|
||||
*/
|
||||
#define ARCINDEX unsigned long
|
||||
|
||||
/*
|
||||
* Maximum number of arcs we want to allow.
|
||||
* Used to be max representable value of ARCINDEX minus 2, but now
|
||||
* that ARCINDEX is a long, that's too large; we don't really want
|
||||
* to allow a 48 gigabyte table.
|
||||
*
|
||||
* Value can be overridden at runtime by glibc.gmon.maxarcs tunable.
|
||||
*/
|
||||
#define MAXARCS (1 << 20)
|
||||
|
||||
struct tostruct {
|
||||
unsigned long selfpc;
|
||||
long count;
|
||||
ARCINDEX link;
|
||||
};
|
||||
|
||||
/*
|
||||
* a raw arc, with pointers to the calling site and
|
||||
* the called site and a count.
|
||||
*/
|
||||
struct rawarc {
|
||||
unsigned long raw_frompc;
|
||||
unsigned long raw_selfpc;
|
||||
long raw_count;
|
||||
};
|
||||
|
||||
/*
|
||||
* general rounding functions.
|
||||
*/
|
||||
#define ROUNDDOWN(x,y) (((x)/(y))*(y))
|
||||
#define ROUNDUP(x,y) ((((x)+(y)-1)/(y))*(y))
|
||||
|
||||
/*
|
||||
* The profiling data structures are housed in this structure.
|
||||
*/
|
||||
struct gmonparam {
|
||||
long int state;
|
||||
unsigned short *kcount;
|
||||
unsigned long kcountsize;
|
||||
ARCINDEX *froms;
|
||||
unsigned long fromssize;
|
||||
struct tostruct *tos;
|
||||
unsigned long tossize;
|
||||
long tolimit;
|
||||
unsigned long lowpc;
|
||||
unsigned long highpc;
|
||||
unsigned long textsize;
|
||||
unsigned long hashfraction;
|
||||
long log_hashfraction;
|
||||
};
|
||||
|
||||
/*
|
||||
* Possible states of profiling.
|
||||
*/
|
||||
#define GMON_PROF_ON 0
|
||||
#define GMON_PROF_BUSY 1
|
||||
#define GMON_PROF_ERROR 2
|
||||
#define GMON_PROF_OFF 3
|
||||
|
||||
/*
|
||||
* Sysctl definitions for extracting profiling information from the kernel.
|
||||
*/
|
||||
#define GPROF_STATE 0 /* int: profiling enabling variable */
|
||||
#define GPROF_COUNT 1 /* struct: profile tick count buffer */
|
||||
#define GPROF_FROMS 2 /* struct: from location hash bucket */
|
||||
#define GPROF_TOS 3 /* struct: destination/count structure */
|
||||
#define GPROF_GMONPARAM 4 /* struct: profiling parameters (see above) */
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Set up data structures and start profiling. */
|
||||
extern void __monstartup (unsigned long __lowpc, unsigned long __highpc) __THROW;
|
||||
extern void monstartup (unsigned long __lowpc, unsigned long __highpc) __THROW;
|
||||
|
||||
/* Clean up profiling and write out gmon.out. */
|
||||
extern void _mcleanup (void) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/gmon.h */
|
||||
78
board/mentalnet/overlay/usr/include/sys/gmon_out.h
Normal file
78
board/mentalnet/overlay/usr/include/sys/gmon_out.h
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
/* Copyright (C) 1996-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* This file specifies the format of gmon.out files. It should have
|
||||
as few external dependencies as possible as it is going to be included
|
||||
in many different programs. That is, minimize the number of #include's.
|
||||
|
||||
A gmon.out file consists of a header (defined by gmon_hdr) followed by
|
||||
a sequence of records. Each record starts with a one-byte tag
|
||||
identifying the type of records, followed by records specific data. */
|
||||
|
||||
#ifndef _SYS_GMON_OUT_H
|
||||
#define _SYS_GMON_OUT_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#define GMON_MAGIC "gmon" /* magic cookie */
|
||||
#define GMON_VERSION 1 /* version number */
|
||||
|
||||
/* For profiling shared object we need a new format. */
|
||||
#define GMON_SHOBJ_VERSION 0x1ffff
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/*
|
||||
* Raw header as it appears on file (without padding). This header
|
||||
* always comes first in gmon.out and is then followed by a series
|
||||
* records defined below.
|
||||
*/
|
||||
struct gmon_hdr
|
||||
{
|
||||
char cookie[4];
|
||||
char version[4];
|
||||
char spare[3 * 4];
|
||||
};
|
||||
|
||||
/* types of records in this file: */
|
||||
typedef enum
|
||||
{
|
||||
GMON_TAG_TIME_HIST = 0,
|
||||
GMON_TAG_CG_ARC = 1,
|
||||
GMON_TAG_BB_COUNT = 2
|
||||
} GMON_Record_Tag;
|
||||
|
||||
struct gmon_hist_hdr
|
||||
{
|
||||
char low_pc[sizeof (char *)]; /* base pc address of sample buffer */
|
||||
char high_pc[sizeof (char *)]; /* max pc address of sampled buffer */
|
||||
char hist_size[4]; /* size of sample buffer */
|
||||
char prof_rate[4]; /* profiling clock rate */
|
||||
char dimen[15]; /* phys. dim., usually "seconds" */
|
||||
char dimen_abbrev; /* usually 's' for "seconds" */
|
||||
};
|
||||
|
||||
struct gmon_cg_arc_record
|
||||
{
|
||||
char from_pc[sizeof (char *)]; /* address within caller's body */
|
||||
char self_pc[sizeof (char *)]; /* address within callee's body */
|
||||
char count[4]; /* number of arc traversals */
|
||||
};
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/gmon_out.h */
|
||||
100
board/mentalnet/overlay/usr/include/sys/inotify.h
Normal file
100
board/mentalnet/overlay/usr/include/sys/inotify.h
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
/* Copyright (C) 2005-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_INOTIFY_H
|
||||
#define _SYS_INOTIFY_H 1
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/* Get the platform-dependent flags. */
|
||||
#include <bits/inotify.h>
|
||||
|
||||
|
||||
/* Structure describing an inotify event. */
|
||||
struct inotify_event
|
||||
{
|
||||
int wd; /* Watch descriptor. */
|
||||
uint32_t mask; /* Watch mask. */
|
||||
uint32_t cookie; /* Cookie to synchronize two events. */
|
||||
uint32_t len; /* Length (including NULs) of name. */
|
||||
char name __flexarr; /* Name. */
|
||||
};
|
||||
|
||||
|
||||
/* Supported events suitable for MASK parameter of INOTIFY_ADD_WATCH. */
|
||||
#define IN_ACCESS 0x00000001 /* File was accessed. */
|
||||
#define IN_MODIFY 0x00000002 /* File was modified. */
|
||||
#define IN_ATTRIB 0x00000004 /* Metadata changed. */
|
||||
#define IN_CLOSE_WRITE 0x00000008 /* Writtable file was closed. */
|
||||
#define IN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed. */
|
||||
#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* Close. */
|
||||
#define IN_OPEN 0x00000020 /* File was opened. */
|
||||
#define IN_MOVED_FROM 0x00000040 /* File was moved from X. */
|
||||
#define IN_MOVED_TO 0x00000080 /* File was moved to Y. */
|
||||
#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* Moves. */
|
||||
#define IN_CREATE 0x00000100 /* Subfile was created. */
|
||||
#define IN_DELETE 0x00000200 /* Subfile was deleted. */
|
||||
#define IN_DELETE_SELF 0x00000400 /* Self was deleted. */
|
||||
#define IN_MOVE_SELF 0x00000800 /* Self was moved. */
|
||||
|
||||
/* Events sent by the kernel. */
|
||||
#define IN_UNMOUNT 0x00002000 /* Backing fs was unmounted. */
|
||||
#define IN_Q_OVERFLOW 0x00004000 /* Event queued overflowed. */
|
||||
#define IN_IGNORED 0x00008000 /* File was ignored. */
|
||||
|
||||
/* Helper events. */
|
||||
#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* Close. */
|
||||
#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* Moves. */
|
||||
|
||||
/* Special flags. */
|
||||
#define IN_ONLYDIR 0x01000000 /* Only watch the path if it is a
|
||||
directory. */
|
||||
#define IN_DONT_FOLLOW 0x02000000 /* Do not follow a sym link. */
|
||||
#define IN_EXCL_UNLINK 0x04000000 /* Exclude events on unlinked
|
||||
objects. */
|
||||
#define IN_MASK_CREATE 0x10000000 /* Only create watches. */
|
||||
#define IN_MASK_ADD 0x20000000 /* Add to the mask of an already
|
||||
existing watch. */
|
||||
#define IN_ISDIR 0x40000000 /* Event occurred against dir. */
|
||||
#define IN_ONESHOT 0x80000000 /* Only send event once. */
|
||||
|
||||
/* All events which a program can wait on. */
|
||||
#define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE \
|
||||
| IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM \
|
||||
| IN_MOVED_TO | IN_CREATE | IN_DELETE \
|
||||
| IN_DELETE_SELF | IN_MOVE_SELF)
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Create and initialize inotify instance. */
|
||||
extern int inotify_init (void) __THROW;
|
||||
|
||||
/* Create and initialize inotify instance. */
|
||||
extern int inotify_init1 (int __flags) __THROW;
|
||||
|
||||
/* Add watch of object NAME to inotify instance FD. Notify about
|
||||
events specified by MASK. */
|
||||
extern int inotify_add_watch (int __fd, const char *__name, uint32_t __mask)
|
||||
__THROW;
|
||||
|
||||
/* Remove the watch specified by WD from the inotify instance FD. */
|
||||
extern int inotify_rm_watch (int __fd, int __wd) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/inotify.h */
|
||||
183
board/mentalnet/overlay/usr/include/sys/io.h
Normal file
183
board/mentalnet/overlay/usr/include/sys/io.h
Normal file
|
|
@ -0,0 +1,183 @@
|
|||
/* Copyright (C) 1996-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_IO_H
|
||||
#define _SYS_IO_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* If TURN_ON is TRUE, request for permission to do direct i/o on the
|
||||
port numbers in the range [FROM,FROM+NUM-1]. Otherwise, turn I/O
|
||||
permission off for that range. This call requires root privileges.
|
||||
|
||||
Portability note: not all Linux platforms support this call. Most
|
||||
platforms based on the PC I/O architecture probably will, however.
|
||||
E.g., Linux/Alpha for Alpha PCs supports this. */
|
||||
extern int ioperm (unsigned long int __from, unsigned long int __num,
|
||||
int __turn_on) __THROW;
|
||||
|
||||
/* Set the I/O privilege level to LEVEL. If LEVEL>3, permission to
|
||||
access any I/O port is granted. This call requires root
|
||||
privileges. */
|
||||
extern int iopl (int __level) __THROW;
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 2
|
||||
|
||||
static __inline unsigned char
|
||||
inb (unsigned short int __port)
|
||||
{
|
||||
unsigned char _v;
|
||||
|
||||
__asm__ __volatile__ ("inb %w1,%0":"=a" (_v):"Nd" (__port));
|
||||
return _v;
|
||||
}
|
||||
|
||||
static __inline unsigned char
|
||||
inb_p (unsigned short int __port)
|
||||
{
|
||||
unsigned char _v;
|
||||
|
||||
__asm__ __volatile__ ("inb %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (__port));
|
||||
return _v;
|
||||
}
|
||||
|
||||
static __inline unsigned short int
|
||||
inw (unsigned short int __port)
|
||||
{
|
||||
unsigned short _v;
|
||||
|
||||
__asm__ __volatile__ ("inw %w1,%0":"=a" (_v):"Nd" (__port));
|
||||
return _v;
|
||||
}
|
||||
|
||||
static __inline unsigned short int
|
||||
inw_p (unsigned short int __port)
|
||||
{
|
||||
unsigned short int _v;
|
||||
|
||||
__asm__ __volatile__ ("inw %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (__port));
|
||||
return _v;
|
||||
}
|
||||
|
||||
static __inline unsigned int
|
||||
inl (unsigned short int __port)
|
||||
{
|
||||
unsigned int _v;
|
||||
|
||||
__asm__ __volatile__ ("inl %w1,%0":"=a" (_v):"Nd" (__port));
|
||||
return _v;
|
||||
}
|
||||
|
||||
static __inline unsigned int
|
||||
inl_p (unsigned short int __port)
|
||||
{
|
||||
unsigned int _v;
|
||||
__asm__ __volatile__ ("inl %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (__port));
|
||||
return _v;
|
||||
}
|
||||
|
||||
static __inline void
|
||||
outb (unsigned char __value, unsigned short int __port)
|
||||
{
|
||||
__asm__ __volatile__ ("outb %b0,%w1": :"a" (__value), "Nd" (__port));
|
||||
}
|
||||
|
||||
static __inline void
|
||||
outb_p (unsigned char __value, unsigned short int __port)
|
||||
{
|
||||
__asm__ __volatile__ ("outb %b0,%w1\noutb %%al,$0x80": :"a" (__value),
|
||||
"Nd" (__port));
|
||||
}
|
||||
|
||||
static __inline void
|
||||
outw (unsigned short int __value, unsigned short int __port)
|
||||
{
|
||||
__asm__ __volatile__ ("outw %w0,%w1": :"a" (__value), "Nd" (__port));
|
||||
|
||||
}
|
||||
|
||||
static __inline void
|
||||
outw_p (unsigned short int __value, unsigned short int __port)
|
||||
{
|
||||
__asm__ __volatile__ ("outw %w0,%w1\noutb %%al,$0x80": :"a" (__value),
|
||||
"Nd" (__port));
|
||||
}
|
||||
|
||||
static __inline void
|
||||
outl (unsigned int __value, unsigned short int __port)
|
||||
{
|
||||
__asm__ __volatile__ ("outl %0,%w1": :"a" (__value), "Nd" (__port));
|
||||
}
|
||||
|
||||
static __inline void
|
||||
outl_p (unsigned int __value, unsigned short int __port)
|
||||
{
|
||||
__asm__ __volatile__ ("outl %0,%w1\noutb %%al,$0x80": :"a" (__value),
|
||||
"Nd" (__port));
|
||||
}
|
||||
|
||||
static __inline void
|
||||
insb (unsigned short int __port, void *__addr, unsigned long int __count)
|
||||
{
|
||||
__asm__ __volatile__ ("cld ; rep ; insb":"=D" (__addr), "=c" (__count)
|
||||
:"d" (__port), "0" (__addr), "1" (__count));
|
||||
}
|
||||
|
||||
static __inline void
|
||||
insw (unsigned short int __port, void *__addr, unsigned long int __count)
|
||||
{
|
||||
__asm__ __volatile__ ("cld ; rep ; insw":"=D" (__addr), "=c" (__count)
|
||||
:"d" (__port), "0" (__addr), "1" (__count));
|
||||
}
|
||||
|
||||
static __inline void
|
||||
insl (unsigned short int __port, void *__addr, unsigned long int __count)
|
||||
{
|
||||
__asm__ __volatile__ ("cld ; rep ; insl":"=D" (__addr), "=c" (__count)
|
||||
:"d" (__port), "0" (__addr), "1" (__count));
|
||||
}
|
||||
|
||||
static __inline void
|
||||
outsb (unsigned short int __port, const void *__addr,
|
||||
unsigned long int __count)
|
||||
{
|
||||
__asm__ __volatile__ ("cld ; rep ; outsb":"=S" (__addr), "=c" (__count)
|
||||
:"d" (__port), "0" (__addr), "1" (__count));
|
||||
}
|
||||
|
||||
static __inline void
|
||||
outsw (unsigned short int __port, const void *__addr,
|
||||
unsigned long int __count)
|
||||
{
|
||||
__asm__ __volatile__ ("cld ; rep ; outsw":"=S" (__addr), "=c" (__count)
|
||||
:"d" (__port), "0" (__addr), "1" (__count));
|
||||
}
|
||||
|
||||
static __inline void
|
||||
outsl (unsigned short int __port, const void *__addr,
|
||||
unsigned long int __count)
|
||||
{
|
||||
__asm__ __volatile__ ("cld ; rep ; outsl":"=S" (__addr), "=c" (__count)
|
||||
:"d" (__port), "0" (__addr), "1" (__count));
|
||||
}
|
||||
|
||||
#endif /* GNU C */
|
||||
|
||||
__END_DECLS
|
||||
#endif /* _SYS_IO_H */
|
||||
55
board/mentalnet/overlay/usr/include/sys/ioctl.h
Normal file
55
board/mentalnet/overlay/usr/include/sys/ioctl.h
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_IOCTL_H
|
||||
#define _SYS_IOCTL_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Get the list of `ioctl' requests and related constants. */
|
||||
#include <bits/ioctls.h>
|
||||
|
||||
/* Define some types used by `ioctl' requests. */
|
||||
#include <bits/ioctl-types.h>
|
||||
|
||||
/* On a Unix system, the system <sys/ioctl.h> probably defines some of
|
||||
the symbols we define in <sys/ttydefaults.h> (usually with the same
|
||||
values). The code to generate <bits/ioctls.h> has omitted these
|
||||
symbols to avoid the conflict, but a Unix program expects <sys/ioctl.h>
|
||||
to define them, so we must include <sys/ttydefaults.h> here. */
|
||||
#include <sys/ttydefaults.h>
|
||||
|
||||
/* Perform the I/O control operation specified by REQUEST on FD.
|
||||
One argument may follow; its presence and type depend on REQUEST.
|
||||
Return value depends on REQUEST. Usually -1 indicates error. */
|
||||
#ifndef __USE_TIME64_REDIRECTS
|
||||
extern int ioctl (int __fd, unsigned long int __request, ...) __THROW;
|
||||
#else
|
||||
# ifdef __REDIRECT
|
||||
extern int __REDIRECT_NTH (ioctl, (int __fd, unsigned long int __request, ...),
|
||||
__ioctl_time64);
|
||||
# else
|
||||
extern int __ioctl_time64 (int __fd, unsigned long int __request, ...) __THROW;
|
||||
# define ioctl __ioctl_time64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/ioctl.h */
|
||||
54
board/mentalnet/overlay/usr/include/sys/ipc.h
Normal file
54
board/mentalnet/overlay/usr/include/sys/ipc.h
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
/* Copyright (C) 1995-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_IPC_H
|
||||
#define _SYS_IPC_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
/* Get system dependent definition of `struct ipc_perm' and more. */
|
||||
#include <bits/ipctypes.h>
|
||||
#include <bits/ipc.h>
|
||||
|
||||
#ifndef __uid_t_defined
|
||||
typedef __uid_t uid_t;
|
||||
# define __uid_t_defined
|
||||
#endif
|
||||
|
||||
#ifndef __gid_t_defined
|
||||
typedef __gid_t gid_t;
|
||||
# define __gid_t_defined
|
||||
#endif
|
||||
|
||||
#ifndef __mode_t_defined
|
||||
typedef __mode_t mode_t;
|
||||
# define __mode_t_defined
|
||||
#endif
|
||||
|
||||
#ifndef __key_t_defined
|
||||
typedef __key_t key_t;
|
||||
# define __key_t_defined
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Generates key for System V style IPC. */
|
||||
extern key_t ftok (const char *__pathname, int __proj_id) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/ipc.h */
|
||||
34
board/mentalnet/overlay/usr/include/sys/kd.h
Normal file
34
board/mentalnet/overlay/usr/include/sys/kd.h
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
/* Copyright (C) 1996-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_KD_H
|
||||
#define _SYS_KD_H 1
|
||||
|
||||
/* Make sure the <linux/types.h> header is not loaded. */
|
||||
#ifndef _LINUX_TYPES_H
|
||||
# define _LINUX_TYPES_H 1
|
||||
# define __undef_LINUX_TYPES_H
|
||||
#endif
|
||||
|
||||
#include <linux/kd.h>
|
||||
|
||||
#ifdef __undef_LINUX_TYPES_H
|
||||
# undef _LINUX_TYPES_H
|
||||
# undef __undef_LINUX_TYPES_H
|
||||
#endif
|
||||
|
||||
#endif /* sys/kd.h */
|
||||
33
board/mentalnet/overlay/usr/include/sys/klog.h
Normal file
33
board/mentalnet/overlay/usr/include/sys/klog.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/* Copyright (C) 1996-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_KLOG_H
|
||||
|
||||
#define _SYS_KLOG_H 1
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Control the kernel's logging facility. This corresponds exactly to
|
||||
the kernel's syslog system call, but that name is easily confused
|
||||
with the user-level syslog facility, which is something completely
|
||||
different. */
|
||||
extern int klogctl (int __type, char *__bufp, int __len) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SYS_KLOG_H */
|
||||
156
board/mentalnet/overlay/usr/include/sys/mman.h
Normal file
156
board/mentalnet/overlay/usr/include/sys/mman.h
Normal file
|
|
@ -0,0 +1,156 @@
|
|||
/* Definitions for BSD-style memory management.
|
||||
Copyright (C) 1994-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_MMAN_H
|
||||
#define _SYS_MMAN_H 1
|
||||
|
||||
#include <features.h>
|
||||
#include <bits/types.h>
|
||||
#define __need_size_t
|
||||
#include <stddef.h>
|
||||
|
||||
#ifndef __off_t_defined
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
typedef __off_t off_t;
|
||||
# else
|
||||
typedef __off64_t off_t;
|
||||
# endif
|
||||
# define __off_t_defined
|
||||
#endif
|
||||
|
||||
#ifndef __mode_t_defined
|
||||
typedef __mode_t mode_t;
|
||||
# define __mode_t_defined
|
||||
#endif
|
||||
|
||||
#include <bits/mman.h>
|
||||
|
||||
/* Return value of `mmap' in case of an error. */
|
||||
#define MAP_FAILED ((void *) -1)
|
||||
|
||||
__BEGIN_DECLS
|
||||
/* Map addresses starting near ADDR and extending for LEN bytes. from
|
||||
OFFSET into the file FD describes according to PROT and FLAGS. If ADDR
|
||||
is nonzero, it is the desired mapping address. If the MAP_FIXED bit is
|
||||
set in FLAGS, the mapping will be at ADDR exactly (which must be
|
||||
page-aligned); otherwise the system chooses a convenient nearby address.
|
||||
The return value is the actual mapping address chosen or MAP_FAILED
|
||||
for errors (in which case `errno' is set). A successful `mmap' call
|
||||
deallocates any previous mapping for the affected region. */
|
||||
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
extern void *mmap (void *__addr, size_t __len, int __prot,
|
||||
int __flags, int __fd, __off_t __offset) __THROW;
|
||||
#else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern void * __REDIRECT_NTH (mmap,
|
||||
(void *__addr, size_t __len, int __prot,
|
||||
int __flags, int __fd, __off64_t __offset),
|
||||
mmap64);
|
||||
# else
|
||||
# define mmap mmap64
|
||||
# endif
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern void *mmap64 (void *__addr, size_t __len, int __prot,
|
||||
int __flags, int __fd, __off64_t __offset) __THROW;
|
||||
#endif
|
||||
|
||||
/* Deallocate any mapping for the region starting at ADDR and extending LEN
|
||||
bytes. Returns 0 if successful, -1 for errors (and sets errno). */
|
||||
extern int munmap (void *__addr, size_t __len) __THROW;
|
||||
|
||||
/* Change the memory protection of the region starting at ADDR and
|
||||
extending LEN bytes to PROT. Returns 0 if successful, -1 for errors
|
||||
(and sets errno). */
|
||||
extern int mprotect (void *__addr, size_t __len, int __prot) __THROW;
|
||||
|
||||
/* Synchronize the region starting at ADDR and extending LEN bytes with the
|
||||
file it maps. Filesystem operations on a file being mapped are
|
||||
unpredictable before this is done. Flags are from the MS_* set.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern int msync (void *__addr, size_t __len, int __flags);
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* Advise the system about particular usage patterns the program follows
|
||||
for the region starting at ADDR and extending LEN bytes. */
|
||||
extern int madvise (void *__addr, size_t __len, int __advice) __THROW;
|
||||
#endif
|
||||
#ifdef __USE_XOPEN2K
|
||||
/* This is the POSIX name for this function. */
|
||||
extern int posix_madvise (void *__addr, size_t __len, int __advice) __THROW;
|
||||
#endif
|
||||
|
||||
/* Guarantee all whole pages mapped by the range [ADDR,ADDR+LEN) to
|
||||
be memory resident. */
|
||||
extern int mlock (const void *__addr, size_t __len) __THROW
|
||||
__attr_access_none (1);
|
||||
|
||||
/* Unlock whole pages previously mapped by the range [ADDR,ADDR+LEN). */
|
||||
extern int munlock (const void *__addr, size_t __len) __THROW
|
||||
__attr_access_none (1);
|
||||
|
||||
/* Cause all currently mapped pages of the process to be memory resident
|
||||
until unlocked by a call to the `munlockall', until the process exits,
|
||||
or until the process calls `execve'. */
|
||||
extern int mlockall (int __flags) __THROW;
|
||||
|
||||
/* All currently mapped pages of the process' address space become
|
||||
unlocked. */
|
||||
extern int munlockall (void) __THROW;
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* mincore returns the memory residency status of the pages in the
|
||||
current process's address space specified by [start, start + len).
|
||||
The status is returned in a vector of bytes. The least significant
|
||||
bit of each byte is 1 if the referenced page is in memory, otherwise
|
||||
it is zero. */
|
||||
extern int mincore (void *__start, size_t __len, unsigned char *__vec)
|
||||
__THROW;
|
||||
#endif
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Remap pages mapped by the range [ADDR,ADDR+OLD_LEN) to new length
|
||||
NEW_LEN. If MREMAP_MAYMOVE is set in FLAGS the returned address
|
||||
may differ from ADDR. If MREMAP_FIXED is set in FLAGS the function
|
||||
takes another parameter which is a fixed address at which the block
|
||||
resides after a successful call. */
|
||||
extern void *mremap (void *__addr, size_t __old_len, size_t __new_len,
|
||||
int __flags, ...) __THROW;
|
||||
|
||||
/* Remap arbitrary pages of a shared backing store within an existing
|
||||
VMA. */
|
||||
extern int remap_file_pages (void *__start, size_t __size, int __prot,
|
||||
size_t __pgoff, int __flags) __THROW;
|
||||
#endif
|
||||
|
||||
|
||||
/* Open shared memory segment. */
|
||||
extern int shm_open (const char *__name, int __oflag, mode_t __mode);
|
||||
|
||||
/* Remove shared memory segment. */
|
||||
extern int shm_unlink (const char *__name);
|
||||
|
||||
/* System-specific extensions. */
|
||||
#include <bits/mman_ext.h>
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/mman.h */
|
||||
331
board/mentalnet/overlay/usr/include/sys/mount.h
Normal file
331
board/mentalnet/overlay/usr/include/sys/mount.h
Normal file
|
|
@ -0,0 +1,331 @@
|
|||
/* Header file for mounting/unmount Linux filesystems.
|
||||
Copyright (C) 1996-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* This is taken from /usr/include/linux/fs.h. */
|
||||
|
||||
#ifndef _SYS_MOUNT_H
|
||||
#define _SYS_MOUNT_H 1
|
||||
|
||||
#include <features.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#ifdef __has_include
|
||||
# if __has_include ("linux/mount.h")
|
||||
# include "linux/mount.h"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#define BLOCK_SIZE_BITS 10
|
||||
#define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
|
||||
|
||||
|
||||
/* These are the fs-independent mount-flags: up to 16 flags are
|
||||
supported */
|
||||
enum
|
||||
{
|
||||
#undef MS_RDONLY
|
||||
MS_RDONLY = 1, /* Mount read-only. */
|
||||
#define MS_RDONLY MS_RDONLY
|
||||
#undef MS_NOSUID
|
||||
MS_NOSUID = 2, /* Ignore suid and sgid bits. */
|
||||
#define MS_NOSUID MS_NOSUID
|
||||
#undef MS_NODEV
|
||||
MS_NODEV = 4, /* Disallow access to device special files. */
|
||||
#define MS_NODEV MS_NODEV
|
||||
#undef MS_NOEXEC
|
||||
MS_NOEXEC = 8, /* Disallow program execution. */
|
||||
#define MS_NOEXEC MS_NOEXEC
|
||||
#undef MS_SYNCHRONOUS
|
||||
MS_SYNCHRONOUS = 16, /* Writes are synced at once. */
|
||||
#define MS_SYNCHRONOUS MS_SYNCHRONOUS
|
||||
#undef MS_REMOUNT
|
||||
MS_REMOUNT = 32, /* Alter flags of a mounted FS. */
|
||||
#define MS_REMOUNT MS_REMOUNT
|
||||
#undef MS_MANDLOCK
|
||||
MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
|
||||
#define MS_MANDLOCK MS_MANDLOCK
|
||||
#undef MS_DIRSYNC
|
||||
MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
|
||||
#define MS_DIRSYNC MS_DIRSYNC
|
||||
#undef MS_NOSYMFOLLOW
|
||||
MS_NOSYMFOLLOW = 256, /* Do not follow symlinks. */
|
||||
#define MS_NOSYMFOLLOW MS_NOSYMFOLLOW
|
||||
#undef MS_NOATIME
|
||||
MS_NOATIME = 1024, /* Do not update access times. */
|
||||
#define MS_NOATIME MS_NOATIME
|
||||
#undef MS_NODIRATIME
|
||||
MS_NODIRATIME = 2048, /* Do not update directory access times. */
|
||||
#define MS_NODIRATIME MS_NODIRATIME
|
||||
#undef MS_BIND
|
||||
MS_BIND = 4096, /* Bind directory at different place. */
|
||||
#define MS_BIND MS_BIND
|
||||
#undef MS_MOVE
|
||||
MS_MOVE = 8192,
|
||||
#define MS_MOVE MS_MOVE
|
||||
#undef MS_REC
|
||||
MS_REC = 16384,
|
||||
#define MS_REC MS_REC
|
||||
#undef MS_SILENT
|
||||
MS_SILENT = 32768,
|
||||
#define MS_SILENT MS_SILENT
|
||||
#undef MS_POSIXACL
|
||||
MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
|
||||
#define MS_POSIXACL MS_POSIXACL
|
||||
#undef MS_UNBINDABLE
|
||||
MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
|
||||
#define MS_UNBINDABLE MS_UNBINDABLE
|
||||
#undef MS_PRIVATE
|
||||
MS_PRIVATE = 1 << 18, /* Change to private. */
|
||||
#define MS_PRIVATE MS_PRIVATE
|
||||
#undef MS_SLAVE
|
||||
MS_SLAVE = 1 << 19, /* Change to slave. */
|
||||
#define MS_SLAVE MS_SLAVE
|
||||
#undef MS_SHARED
|
||||
MS_SHARED = 1 << 20, /* Change to shared. */
|
||||
#define MS_SHARED MS_SHARED
|
||||
#undef MS_RELATIME
|
||||
MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
|
||||
#define MS_RELATIME MS_RELATIME
|
||||
#undef MS_KERNMOUNT
|
||||
MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
|
||||
#define MS_KERNMOUNT MS_KERNMOUNT
|
||||
#undef MS_I_VERSION
|
||||
MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
|
||||
#define MS_I_VERSION MS_I_VERSION
|
||||
#undef MS_STRICTATIME
|
||||
MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
|
||||
#define MS_STRICTATIME MS_STRICTATIME
|
||||
#undef MS_LAZYTIME
|
||||
MS_LAZYTIME = 1 << 25, /* Update the on-disk [acm]times lazily. */
|
||||
#define MS_LAZYTIME MS_LAZYTIME
|
||||
#undef MS_ACTIVE
|
||||
MS_ACTIVE = 1 << 30,
|
||||
#define MS_ACTIVE MS_ACTIVE
|
||||
#undef MS_NOUSER
|
||||
MS_NOUSER = 1 << 31
|
||||
#define MS_NOUSER MS_NOUSER
|
||||
};
|
||||
|
||||
/* Flags that can be altered by MS_REMOUNT */
|
||||
#undef MS_RMT_MASK
|
||||
#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION \
|
||||
|MS_LAZYTIME)
|
||||
|
||||
|
||||
/* Magic mount flag number. Has to be or-ed to the flag values. */
|
||||
|
||||
#undef MS_MGC_VAL
|
||||
#define MS_MGC_VAL 0xc0ed0000 /* Magic flag number to indicate "new" flags */
|
||||
#define MS_MGC_MSK 0xffff0000 /* Magic flag number mask */
|
||||
|
||||
|
||||
/* The read-only stuff doesn't really belong here, but any other place
|
||||
is probably as bad and I don't want to create yet another include
|
||||
file. */
|
||||
|
||||
#undef BLKROSET
|
||||
#define BLKROSET _IO(0x12, 93) /* Set device read-only (0 = read-write). */
|
||||
#undef BLKROGET
|
||||
#define BLKROGET _IO(0x12, 94) /* Get read-only status (0 = read_write). */
|
||||
#undef BLKRRPART
|
||||
#define BLKRRPART _IO(0x12, 95) /* Re-read partition table. */
|
||||
#undef BLKGETSIZE
|
||||
#define BLKGETSIZE _IO(0x12, 96) /* Return device size. */
|
||||
#undef BLKFLSBUF
|
||||
#define BLKFLSBUF _IO(0x12, 97) /* Flush buffer cache. */
|
||||
#undef BLKRASET
|
||||
#define BLKRASET _IO(0x12, 98) /* Set read ahead for block device. */
|
||||
#undef BLKRAGET
|
||||
#define BLKRAGET _IO(0x12, 99) /* Get current read ahead setting. */
|
||||
#undef BLKFRASET
|
||||
#define BLKFRASET _IO(0x12,100) /* Set filesystem read-ahead. */
|
||||
#undef BLKFRAGET
|
||||
#define BLKFRAGET _IO(0x12,101) /* Get filesystem read-ahead. */
|
||||
#undef BLKSECTSET
|
||||
#define BLKSECTSET _IO(0x12,102) /* Set max sectors per request. */
|
||||
#undef BLKSECTGET
|
||||
#define BLKSECTGET _IO(0x12,103) /* Get max sectors per request. */
|
||||
#undef BLKSSZGET
|
||||
#define BLKSSZGET _IO(0x12,104) /* Get block device sector size. */
|
||||
#undef BLKBSZGET
|
||||
#define BLKBSZGET _IOR(0x12,112,size_t)
|
||||
#undef BLKBSZSET
|
||||
#define BLKBSZSET _IOW(0x12,113,size_t)
|
||||
#undef BLKGETSIZE64
|
||||
#define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size. */
|
||||
|
||||
|
||||
/* Possible value for FLAGS parameter of `umount2'. */
|
||||
enum
|
||||
{
|
||||
MNT_FORCE = 1, /* Force unmounting. */
|
||||
#define MNT_FORCE MNT_FORCE
|
||||
MNT_DETACH = 2, /* Just detach from the tree. */
|
||||
#define MNT_DETACH MNT_DETACH
|
||||
MNT_EXPIRE = 4, /* Mark for expiry. */
|
||||
#define MNT_EXPIRE MNT_EXPIRE
|
||||
UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
|
||||
#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
|
||||
};
|
||||
|
||||
|
||||
/* fsmount flags. */
|
||||
#define FSMOUNT_CLOEXEC 0x00000001
|
||||
|
||||
/* mount attributes used on fsmount. */
|
||||
#define MOUNT_ATTR_RDONLY 0x00000001 /* Mount read-only. */
|
||||
#define MOUNT_ATTR_NOSUID 0x00000002 /* Ignore suid and sgid bits. */
|
||||
#define MOUNT_ATTR_NODEV 0x00000004 /* Disallow access to device special files. */
|
||||
#define MOUNT_ATTR_NOEXEC 0x00000008 /* Disallow program execution. */
|
||||
#define MOUNT_ATTR__ATIME 0x00000070 /* Setting on how atime should be updated. */
|
||||
#define MOUNT_ATTR_RELATIME 0x00000000 /* - Update atime relative to mtime/ctime. */
|
||||
#define MOUNT_ATTR_NOATIME 0x00000010 /* - Do not update access times. */
|
||||
#define MOUNT_ATTR_STRICTATIME 0x00000020 /* - Always perform atime updates */
|
||||
#define MOUNT_ATTR_NODIRATIME 0x00000080 /* Do not update directory access times. */
|
||||
#define MOUNT_ATTR_IDMAP 0x00100000 /* Idmap mount to @userns_fd in struct mount_attr. */
|
||||
#define MOUNT_ATTR_NOSYMFOLLOW 0x00200000 /* Do not follow symlinks. */
|
||||
|
||||
|
||||
#ifndef MOUNT_ATTR_SIZE_VER0
|
||||
/* For mount_setattr. */
|
||||
struct mount_attr
|
||||
{
|
||||
uint64_t attr_set;
|
||||
uint64_t attr_clr;
|
||||
uint64_t propagation;
|
||||
uint64_t userns_fd;
|
||||
};
|
||||
#endif
|
||||
|
||||
#define MOUNT_ATTR_SIZE_VER0 32 /* sizeof first published struct */
|
||||
|
||||
/* move_mount flags. */
|
||||
#define MOVE_MOUNT_F_SYMLINKS 0x00000001 /* Follow symlinks on from path */
|
||||
#define MOVE_MOUNT_F_AUTOMOUNTS 0x00000002 /* Follow automounts on from path */
|
||||
#define MOVE_MOUNT_F_EMPTY_PATH 0x00000004 /* Empty from path permitted */
|
||||
#define MOVE_MOUNT_T_SYMLINKS 0x00000010 /* Follow symlinks on to path */
|
||||
#define MOVE_MOUNT_T_AUTOMOUNTS 0x00000020 /* Follow automounts on to path */
|
||||
#define MOVE_MOUNT_T_EMPTY_PATH 0x00000040 /* Empty to path permitted */
|
||||
#define MOVE_MOUNT_SET_GROUP 0x00000100 /* Set sharing group instead */
|
||||
#define MOVE_MOUNT_BENEATH 0x00000200 /* Mount beneath top mount */
|
||||
|
||||
|
||||
/* fspick flags. */
|
||||
#define FSPICK_CLOEXEC 0x00000001
|
||||
#define FSPICK_SYMLINK_NOFOLLOW 0x00000002
|
||||
#define FSPICK_NO_AUTOMOUNT 0x00000004
|
||||
#define FSPICK_EMPTY_PATH 0x00000008
|
||||
|
||||
|
||||
#ifndef FSOPEN_CLOEXEC
|
||||
/* The type of fsconfig call made. */
|
||||
enum fsconfig_command
|
||||
{
|
||||
FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */
|
||||
# define FSCONFIG_SET_FLAG FSCONFIG_SET_FLAG
|
||||
FSCONFIG_SET_STRING = 1, /* Set parameter, supplying a string value */
|
||||
# define FSCONFIG_SET_STRING FSCONFIG_SET_STRING
|
||||
FSCONFIG_SET_BINARY = 2, /* Set parameter, supplying a binary blob value */
|
||||
# define FSCONFIG_SET_BINARY FSCONFIG_SET_BINARY
|
||||
FSCONFIG_SET_PATH = 3, /* Set parameter, supplying an object by path */
|
||||
# define FSCONFIG_SET_PATH FSCONFIG_SET_PATH
|
||||
FSCONFIG_SET_PATH_EMPTY = 4, /* Set parameter, supplying an object by (empty) path */
|
||||
# define FSCONFIG_SET_PATH_EMPTY FSCONFIG_SET_PATH_EMPTY
|
||||
FSCONFIG_SET_FD = 5, /* Set parameter, supplying an object by fd */
|
||||
# define FSCONFIG_SET_FD FSCONFIG_SET_FD
|
||||
FSCONFIG_CMD_CREATE = 6, /* Invoke superblock creation */
|
||||
# define FSCONFIG_CMD_CREATE FSCONFIG_CMD_CREATE
|
||||
FSCONFIG_CMD_RECONFIGURE = 7, /* Invoke superblock reconfiguration */
|
||||
# define FSCONFIG_CMD_RECONFIGURE FSCONFIG_CMD_RECONFIGURE
|
||||
FSCONFIG_CMD_CREATE_EXCL = 8, /* Create new superblock, fail if reusing existing superblock */
|
||||
# define FSCONFIG_CMD_CREATE_EXCL FSCONFIG_CMD_CREATE_EXCL
|
||||
};
|
||||
#endif
|
||||
|
||||
/* fsopen flags. */
|
||||
#define FSOPEN_CLOEXEC 0x00000001
|
||||
|
||||
/* open_tree flags. */
|
||||
#ifndef OPEN_TREE_CLONE
|
||||
# define OPEN_TREE_CLONE 1 /* Clone the target tree and attach the clone */
|
||||
#endif
|
||||
#ifndef O_CLOEXEC
|
||||
# include <bits/cloexec.h>
|
||||
# define O_CLOEXEC __O_CLOEXEC
|
||||
#endif
|
||||
#ifndef OPEN_TREE_CLOEXEC
|
||||
# define OPEN_TREE_CLOEXEC O_CLOEXEC /* Close the file on execve() */
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Mount a filesystem. */
|
||||
extern int mount (const char *__special_file, const char *__dir,
|
||||
const char *__fstype, unsigned long int __rwflag,
|
||||
const void *__data) __THROW;
|
||||
|
||||
/* Unmount a filesystem. */
|
||||
extern int umount (const char *__special_file) __THROW;
|
||||
|
||||
/* Unmount a filesystem. Force unmounting if FLAGS is set to MNT_FORCE. */
|
||||
extern int umount2 (const char *__special_file, int __flags) __THROW;
|
||||
|
||||
/* Open the filesystem referenced by FS_NAME so it can be configured for
|
||||
mouting. */
|
||||
extern int fsopen (const char *__fs_name, unsigned int __flags) __THROW;
|
||||
|
||||
/* Create a mount representation for the FD created by fsopen using
|
||||
FLAGS with ATTR_FLAGS describing how the mount is to be performed. */
|
||||
extern int fsmount (int __fd, unsigned int __flags,
|
||||
unsigned int __ms_flags) __THROW;
|
||||
|
||||
/* Add the mounted FROM_DFD referenced by FROM_PATHNAME filesystem returned
|
||||
by fsmount in the hierarchy in the place TO_DFD reference by TO_PATHNAME
|
||||
using FLAGS. */
|
||||
extern int move_mount (int __from_dfd, const char *__from_pathname,
|
||||
int __to_dfd, const char *__to_pathname,
|
||||
unsigned int flags) __THROW;
|
||||
|
||||
/* Set parameters and trigger CMD action on the FD context. KEY, VALUE,
|
||||
and AUX are used depending ng of the CMD. */
|
||||
extern int fsconfig (int __fd, unsigned int __cmd, const char *__key,
|
||||
const void *__value, int __aux) __THROW;
|
||||
|
||||
/* Equivalent of fopen for an existing mount point. */
|
||||
extern int fspick (int __dfd, const char *__path, unsigned int __flags)
|
||||
__THROW;
|
||||
|
||||
/* Open the mount point FILENAME in directory DFD using FLAGS. */
|
||||
extern int open_tree (int __dfd, const char *__filename, unsigned int __flags)
|
||||
__THROW;
|
||||
|
||||
/* Change the mount properties of the mount or an entire mount tree. If
|
||||
PATH is a relative pathname, then it is interpreted relative to the
|
||||
directory referred to by the file descriptor dirfd. Otherwise if DFD is
|
||||
the special value AT_FDCWD then PATH is interpreted relative to the current
|
||||
working directory of the calling process. */
|
||||
extern int mount_setattr (int __dfd, const char *__path, unsigned int __flags,
|
||||
struct mount_attr *__uattr, size_t __usize)
|
||||
__THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SYS_MOUNT_H */
|
||||
92
board/mentalnet/overlay/usr/include/sys/msg.h
Normal file
92
board/mentalnet/overlay/usr/include/sys/msg.h
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
/* Copyright (C) 1995-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_MSG_H
|
||||
#define _SYS_MSG_H
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#define __need_size_t
|
||||
#include <stddef.h>
|
||||
|
||||
/* Get common definition of System V style IPC. */
|
||||
#include <sys/ipc.h>
|
||||
|
||||
/* Get system dependent definition of `struct msqid_ds' and more. */
|
||||
#include <bits/msq.h>
|
||||
|
||||
/* Define types required by the standard. */
|
||||
#include <bits/types/time_t.h>
|
||||
|
||||
#ifndef __pid_t_defined
|
||||
typedef __pid_t pid_t;
|
||||
# define __pid_t_defined
|
||||
#endif
|
||||
|
||||
#ifndef __ssize_t_defined
|
||||
typedef __ssize_t ssize_t;
|
||||
# define __ssize_t_defined
|
||||
#endif
|
||||
|
||||
/* The following System V style IPC functions implement a message queue
|
||||
system. The definition is found in XPG2. */
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Template for struct to be used as argument for `msgsnd' and `msgrcv'. */
|
||||
struct msgbuf
|
||||
{
|
||||
__syscall_slong_t mtype; /* type of received/sent message */
|
||||
char mtext[1]; /* text of the message */
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Message queue control operation. */
|
||||
#ifndef __USE_TIME64_REDIRECTS
|
||||
extern int msgctl (int __msqid, int __cmd, struct msqid_ds *__buf) __THROW;
|
||||
#else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (msgctl,
|
||||
(int __msqid, int __cmd, struct msqid_ds *__buf),
|
||||
__msgctl64);
|
||||
# else
|
||||
# define msgctl __msgctl64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Get messages queue. */
|
||||
extern int msgget (key_t __key, int __msgflg) __THROW;
|
||||
|
||||
/* Receive message from message queue.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern ssize_t msgrcv (int __msqid, void *__msgp, size_t __msgsz,
|
||||
long int __msgtyp, int __msgflg);
|
||||
|
||||
/* Send message to message queue.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern int msgsnd (int __msqid, const void *__msgp, size_t __msgsz,
|
||||
int __msgflg);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/msg.h */
|
||||
275
board/mentalnet/overlay/usr/include/sys/mtio.h
Normal file
275
board/mentalnet/overlay/usr/include/sys/mtio.h
Normal file
|
|
@ -0,0 +1,275 @@
|
|||
/* Structures and definitions for magnetic tape I/O control commands.
|
||||
Copyright (C) 1996-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
|
||||
#ifndef _SYS_MTIO_H
|
||||
#define _SYS_MTIO_H 1
|
||||
|
||||
/* Get necessary definitions from system and kernel headers. */
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
|
||||
/* Structure for MTIOCTOP - magnetic tape operation command. */
|
||||
struct mtop
|
||||
{
|
||||
short int mt_op; /* Operations defined below. */
|
||||
int mt_count; /* How many of them. */
|
||||
};
|
||||
#define _IOT_mtop /* Hurd ioctl type field. */ \
|
||||
_IOT (_IOTS (short), 1, _IOTS (int), 1, 0, 0)
|
||||
|
||||
/* Magnetic Tape operations [Not all operations supported by all drivers]. */
|
||||
#define MTRESET 0 /* +reset drive in case of problems. */
|
||||
#define MTFSF 1 /* Forward space over FileMark,
|
||||
* position at first record of next file. */
|
||||
#define MTBSF 2 /* Backward space FileMark (position before FM). */
|
||||
#define MTFSR 3 /* Forward space record. */
|
||||
#define MTBSR 4 /* Backward space record. */
|
||||
#define MTWEOF 5 /* Write an end-of-file record (mark). */
|
||||
#define MTREW 6 /* Rewind. */
|
||||
#define MTOFFL 7 /* Rewind and put the drive offline (eject?). */
|
||||
#define MTNOP 8 /* No op, set status only (read with MTIOCGET). */
|
||||
#define MTRETEN 9 /* Retension tape. */
|
||||
#define MTBSFM 10 /* +backward space FileMark, position at FM. */
|
||||
#define MTFSFM 11 /* +forward space FileMark, position at FM. */
|
||||
#define MTEOM 12 /* Goto end of recorded media (for appending files).
|
||||
MTEOM positions after the last FM, ready for
|
||||
appending another file. */
|
||||
#define MTERASE 13 /* Erase tape -- be careful! */
|
||||
|
||||
#define MTRAS1 14 /* Run self test 1 (nondestructive). */
|
||||
#define MTRAS2 15 /* Run self test 2 (destructive). */
|
||||
#define MTRAS3 16 /* Reserved for self test 3. */
|
||||
|
||||
#define MTSETBLK 20 /* Set block length (SCSI). */
|
||||
#define MTSETDENSITY 21 /* Set tape density (SCSI). */
|
||||
#define MTSEEK 22 /* Seek to block (Tandberg, etc.). */
|
||||
#define MTTELL 23 /* Tell block (Tandberg, etc.). */
|
||||
#define MTSETDRVBUFFER 24 /* Set the drive buffering according to SCSI-2.
|
||||
Ordinary buffered operation with code 1. */
|
||||
#define MTFSS 25 /* Space forward over setmarks. */
|
||||
#define MTBSS 26 /* Space backward over setmarks. */
|
||||
#define MTWSM 27 /* Write setmarks. */
|
||||
|
||||
#define MTLOCK 28 /* Lock the drive door. */
|
||||
#define MTUNLOCK 29 /* Unlock the drive door. */
|
||||
#define MTLOAD 30 /* Execute the SCSI load command. */
|
||||
#define MTUNLOAD 31 /* Execute the SCSI unload command. */
|
||||
#define MTCOMPRESSION 32/* Control compression with SCSI mode page 15. */
|
||||
#define MTSETPART 33 /* Change the active tape partition. */
|
||||
#define MTMKPART 34 /* Format the tape with one or two partitions. */
|
||||
|
||||
/* structure for MTIOCGET - mag tape get status command */
|
||||
|
||||
struct mtget
|
||||
{
|
||||
long int mt_type; /* Type of magtape device. */
|
||||
long int mt_resid; /* Residual count: (not sure)
|
||||
number of bytes ignored, or
|
||||
number of files not skipped, or
|
||||
number of records not skipped. */
|
||||
/* The following registers are device dependent. */
|
||||
long int mt_dsreg; /* Status register. */
|
||||
long int mt_gstat; /* Generic (device independent) status. */
|
||||
long int mt_erreg; /* Error register. */
|
||||
/* The next two fields are not always used. */
|
||||
__daddr_t mt_fileno; /* Number of current file on tape. */
|
||||
__daddr_t mt_blkno; /* Current block number. */
|
||||
};
|
||||
#define _IOT_mtget /* Hurd ioctl type field. */ \
|
||||
_IOT (_IOTS (long), 7, 0, 0, 0, 0)
|
||||
|
||||
|
||||
/* Constants for mt_type. Not all of these are supported, and
|
||||
these are not all of the ones that are supported. */
|
||||
#define MT_ISUNKNOWN 0x01
|
||||
#define MT_ISQIC02 0x02 /* Generic QIC-02 tape streamer. */
|
||||
#define MT_ISWT5150 0x03 /* Wangtek 5150EQ, QIC-150, QIC-02. */
|
||||
#define MT_ISARCHIVE_5945L2 0x04 /* Archive 5945L-2, QIC-24, QIC-02?. */
|
||||
#define MT_ISCMSJ500 0x05 /* CMS Jumbo 500 (QIC-02?). */
|
||||
#define MT_ISTDC3610 0x06 /* Tandberg 6310, QIC-24. */
|
||||
#define MT_ISARCHIVE_VP60I 0x07 /* Archive VP60i, QIC-02. */
|
||||
#define MT_ISARCHIVE_2150L 0x08 /* Archive Viper 2150L. */
|
||||
#define MT_ISARCHIVE_2060L 0x09 /* Archive Viper 2060L. */
|
||||
#define MT_ISARCHIVESC499 0x0A /* Archive SC-499 QIC-36 controller. */
|
||||
#define MT_ISQIC02_ALL_FEATURES 0x0F /* Generic QIC-02 with all features. */
|
||||
#define MT_ISWT5099EEN24 0x11 /* Wangtek 5099-een24, 60MB, QIC-24. */
|
||||
#define MT_ISTEAC_MT2ST 0x12 /* Teac MT-2ST 155mb drive,
|
||||
Teac DC-1 card (Wangtek type). */
|
||||
#define MT_ISEVEREX_FT40A 0x32 /* Everex FT40A (QIC-40). */
|
||||
#define MT_ISDDS1 0x51 /* DDS device without partitions. */
|
||||
#define MT_ISDDS2 0x52 /* DDS device with partitions. */
|
||||
#define MT_ISSCSI1 0x71 /* Generic ANSI SCSI-1 tape unit. */
|
||||
#define MT_ISSCSI2 0x72 /* Generic ANSI SCSI-2 tape unit. */
|
||||
|
||||
/* QIC-40/80/3010/3020 ftape supported drives.
|
||||
20bit vendor ID + 0x800000 (see vendors.h in ftape distribution). */
|
||||
#define MT_ISFTAPE_UNKNOWN 0x800000 /* obsolete */
|
||||
#define MT_ISFTAPE_FLAG 0x800000
|
||||
|
||||
struct mt_tape_info
|
||||
{
|
||||
long int t_type; /* Device type id (mt_type). */
|
||||
char *t_name; /* Descriptive name. */
|
||||
};
|
||||
|
||||
#define MT_TAPE_INFO \
|
||||
{ \
|
||||
{MT_ISUNKNOWN, "Unknown type of tape device"}, \
|
||||
{MT_ISQIC02, "Generic QIC-02 tape streamer"}, \
|
||||
{MT_ISWT5150, "Wangtek 5150, QIC-150"}, \
|
||||
{MT_ISARCHIVE_5945L2, "Archive 5945L-2"}, \
|
||||
{MT_ISCMSJ500, "CMS Jumbo 500"}, \
|
||||
{MT_ISTDC3610, "Tandberg TDC 3610, QIC-24"}, \
|
||||
{MT_ISARCHIVE_VP60I, "Archive VP60i, QIC-02"}, \
|
||||
{MT_ISARCHIVE_2150L, "Archive Viper 2150L"}, \
|
||||
{MT_ISARCHIVE_2060L, "Archive Viper 2060L"}, \
|
||||
{MT_ISARCHIVESC499, "Archive SC-499 QIC-36 controller"}, \
|
||||
{MT_ISQIC02_ALL_FEATURES, "Generic QIC-02 tape, all features"}, \
|
||||
{MT_ISWT5099EEN24, "Wangtek 5099-een24, 60MB"}, \
|
||||
{MT_ISTEAC_MT2ST, "Teac MT-2ST 155mb data cassette drive"}, \
|
||||
{MT_ISEVEREX_FT40A, "Everex FT40A, QIC-40"}, \
|
||||
{MT_ISSCSI1, "Generic SCSI-1 tape"}, \
|
||||
{MT_ISSCSI2, "Generic SCSI-2 tape"}, \
|
||||
{0, NULL} \
|
||||
}
|
||||
|
||||
|
||||
/* Structure for MTIOCPOS - mag tape get position command. */
|
||||
|
||||
struct mtpos
|
||||
{
|
||||
long int mt_blkno; /* Current block number. */
|
||||
};
|
||||
#define _IOT_mtpos /* Hurd ioctl type field. */ \
|
||||
_IOT_SIMPLE (long)
|
||||
|
||||
|
||||
/* Structure for MTIOCGETCONFIG/MTIOCSETCONFIG primarily intended
|
||||
as an interim solution for QIC-02 until DDI is fully implemented. */
|
||||
struct mtconfiginfo
|
||||
{
|
||||
long int mt_type; /* Drive type. */
|
||||
long int ifc_type; /* Interface card type. */
|
||||
unsigned short int irqnr; /* IRQ number to use. */
|
||||
unsigned short int dmanr; /* DMA channel to use. */
|
||||
unsigned short int port; /* IO port base address. */
|
||||
|
||||
unsigned long int debug; /* Debugging flags. */
|
||||
|
||||
unsigned have_dens:1;
|
||||
unsigned have_bsf:1;
|
||||
unsigned have_fsr:1;
|
||||
unsigned have_bsr:1;
|
||||
unsigned have_eod:1;
|
||||
unsigned have_seek:1;
|
||||
unsigned have_tell:1;
|
||||
unsigned have_ras1:1;
|
||||
unsigned have_ras2:1;
|
||||
unsigned have_ras3:1;
|
||||
unsigned have_qfa:1;
|
||||
|
||||
unsigned pad1:5;
|
||||
char reserved[10];
|
||||
};
|
||||
#define _IOT_mtconfiginfo /* Hurd ioctl type field. */ \
|
||||
_IOT (_IOTS (long), 2, _IOTS (short), 3, _IOTS (long), 1) /* XXX wrong */
|
||||
|
||||
|
||||
/* Magnetic tape I/O control commands. */
|
||||
#define MTIOCTOP _IOW('m', 1, struct mtop) /* Do a mag tape op. */
|
||||
#define MTIOCGET _IOR('m', 2, struct mtget) /* Get tape status. */
|
||||
#define MTIOCPOS _IOR('m', 3, struct mtpos) /* Get tape position.*/
|
||||
|
||||
/* The next two are used by the QIC-02 driver for runtime reconfiguration.
|
||||
See tpqic02.h for struct mtconfiginfo. */
|
||||
#define MTIOCGETCONFIG _IOR('m', 4, struct mtconfiginfo) /* Get tape config.*/
|
||||
#define MTIOCSETCONFIG _IOW('m', 5, struct mtconfiginfo) /* Set tape config.*/
|
||||
|
||||
/* Generic Mag Tape (device independent) status macros for examining
|
||||
mt_gstat -- HP-UX compatible.
|
||||
There is room for more generic status bits here, but I don't
|
||||
know which of them are reserved. At least three or so should
|
||||
be added to make this really useful. */
|
||||
#define GMT_EOF(x) ((x) & 0x80000000)
|
||||
#define GMT_BOT(x) ((x) & 0x40000000)
|
||||
#define GMT_EOT(x) ((x) & 0x20000000)
|
||||
#define GMT_SM(x) ((x) & 0x10000000) /* DDS setmark */
|
||||
#define GMT_EOD(x) ((x) & 0x08000000) /* DDS EOD */
|
||||
#define GMT_WR_PROT(x) ((x) & 0x04000000)
|
||||
/* #define GMT_ ? ((x) & 0x02000000) */
|
||||
#define GMT_ONLINE(x) ((x) & 0x01000000)
|
||||
#define GMT_D_6250(x) ((x) & 0x00800000)
|
||||
#define GMT_D_1600(x) ((x) & 0x00400000)
|
||||
#define GMT_D_800(x) ((x) & 0x00200000)
|
||||
/* #define GMT_ ? ((x) & 0x00100000) */
|
||||
/* #define GMT_ ? ((x) & 0x00080000) */
|
||||
#define GMT_DR_OPEN(x) ((x) & 0x00040000) /* Door open (no tape). */
|
||||
/* #define GMT_ ? ((x) & 0x00020000) */
|
||||
#define GMT_IM_REP_EN(x) ((x) & 0x00010000) /* Immediate report mode.*/
|
||||
/* 16 generic status bits unused. */
|
||||
|
||||
|
||||
/* SCSI-tape specific definitions. Bitfield shifts in the status */
|
||||
#define MT_ST_BLKSIZE_SHIFT 0
|
||||
#define MT_ST_BLKSIZE_MASK 0xffffff
|
||||
#define MT_ST_DENSITY_SHIFT 24
|
||||
#define MT_ST_DENSITY_MASK 0xff000000
|
||||
|
||||
#define MT_ST_SOFTERR_SHIFT 0
|
||||
#define MT_ST_SOFTERR_MASK 0xffff
|
||||
|
||||
/* Bitfields for the MTSETDRVBUFFER ioctl. */
|
||||
#define MT_ST_OPTIONS 0xf0000000
|
||||
#define MT_ST_BOOLEANS 0x10000000
|
||||
#define MT_ST_SETBOOLEANS 0x30000000
|
||||
#define MT_ST_CLEARBOOLEANS 0x40000000
|
||||
#define MT_ST_WRITE_THRESHOLD 0x20000000
|
||||
#define MT_ST_DEF_BLKSIZE 0x50000000
|
||||
#define MT_ST_DEF_OPTIONS 0x60000000
|
||||
|
||||
#define MT_ST_BUFFER_WRITES 0x1
|
||||
#define MT_ST_ASYNC_WRITES 0x2
|
||||
#define MT_ST_READ_AHEAD 0x4
|
||||
#define MT_ST_DEBUGGING 0x8
|
||||
#define MT_ST_TWO_FM 0x10
|
||||
#define MT_ST_FAST_MTEOM 0x20
|
||||
#define MT_ST_AUTO_LOCK 0x40
|
||||
#define MT_ST_DEF_WRITES 0x80
|
||||
#define MT_ST_CAN_BSR 0x100
|
||||
#define MT_ST_NO_BLKLIMS 0x200
|
||||
#define MT_ST_CAN_PARTITIONS 0x400
|
||||
#define MT_ST_SCSI2LOGICAL 0x800
|
||||
|
||||
/* The mode parameters to be controlled. Parameter chosen with bits 20-28. */
|
||||
#define MT_ST_CLEAR_DEFAULT 0xfffff
|
||||
#define MT_ST_DEF_DENSITY (MT_ST_DEF_OPTIONS | 0x100000)
|
||||
#define MT_ST_DEF_COMPRESSION (MT_ST_DEF_OPTIONS | 0x200000)
|
||||
#define MT_ST_DEF_DRVBUFFER (MT_ST_DEF_OPTIONS | 0x300000)
|
||||
|
||||
/* The offset for the arguments for the special HP changer load command. */
|
||||
#define MT_ST_HPLOADER_OFFSET 10000
|
||||
|
||||
|
||||
/* Specify default tape device. */
|
||||
#ifndef DEFTAPE
|
||||
# define DEFTAPE "/dev/tape"
|
||||
#endif
|
||||
|
||||
#endif /* mtio.h */
|
||||
106
board/mentalnet/overlay/usr/include/sys/param.h
Normal file
106
board/mentalnet/overlay/usr/include/sys/param.h
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
/* Compatibility header for old-style Unix parameters and limits.
|
||||
Copyright (C) 1995-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_PARAM_H
|
||||
#define _SYS_PARAM_H 1
|
||||
|
||||
#define __need_NULL
|
||||
#include <stddef.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <limits.h>
|
||||
#include <endian.h> /* Define BYTE_ORDER et al. */
|
||||
#include <signal.h> /* Define NSIG. */
|
||||
|
||||
/* This file defines some things in system-specific ways. */
|
||||
#include <bits/param.h>
|
||||
|
||||
|
||||
/* BSD names for some <limits.h> values. */
|
||||
|
||||
#define NBBY CHAR_BIT
|
||||
|
||||
#if !defined NGROUPS && defined NGROUPS_MAX
|
||||
# define NGROUPS NGROUPS_MAX
|
||||
#endif
|
||||
#if !defined MAXSYMLINKS && defined SYMLOOP_MAX
|
||||
# define MAXSYMLINKS SYMLOOP_MAX
|
||||
#endif
|
||||
#if !defined CANBSIZ && defined MAX_CANON
|
||||
# define CANBSIZ MAX_CANON
|
||||
#endif
|
||||
#if !defined MAXPATHLEN && defined PATH_MAX
|
||||
# define MAXPATHLEN PATH_MAX
|
||||
#endif
|
||||
#if !defined NOFILE && defined OPEN_MAX
|
||||
# define NOFILE OPEN_MAX
|
||||
#endif
|
||||
#if !defined MAXHOSTNAMELEN && defined HOST_NAME_MAX
|
||||
# define MAXHOSTNAMELEN HOST_NAME_MAX
|
||||
#endif
|
||||
#ifndef NCARGS
|
||||
# ifdef ARG_MAX
|
||||
# define NCARGS ARG_MAX
|
||||
# else
|
||||
/* ARG_MAX is unlimited, but we define NCARGS for BSD programs that want to
|
||||
compare against some fixed limit. */
|
||||
# define NCARGS INT_MAX
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Magical constants. */
|
||||
#ifndef NOGROUP
|
||||
# define NOGROUP 65535 /* Marker for empty group set member. */
|
||||
#endif
|
||||
#ifndef NODEV
|
||||
# define NODEV ((dev_t) -1) /* Non-existent device. */
|
||||
#endif
|
||||
|
||||
|
||||
/* Unit of `st_blocks'. */
|
||||
#ifndef DEV_BSIZE
|
||||
# define DEV_BSIZE 512
|
||||
#endif
|
||||
|
||||
|
||||
/* Bit map related macros. */
|
||||
#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
|
||||
#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
|
||||
#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
|
||||
#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
|
||||
|
||||
/* Macros for counting and rounding. */
|
||||
#ifndef howmany
|
||||
# define howmany(x, y) (((x) + ((y) - 1)) / (y))
|
||||
#endif
|
||||
#ifdef __GNUC__
|
||||
# define roundup(x, y) (__builtin_constant_p (y) && powerof2 (y) \
|
||||
? (((x) + (y) - 1) & ~((y) - 1)) \
|
||||
: ((((x) + ((y) - 1)) / (y)) * (y)))
|
||||
#else
|
||||
# define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
|
||||
#endif
|
||||
#define powerof2(x) ((((x) - 1) & (x)) == 0)
|
||||
|
||||
/* Macros for min/max. */
|
||||
#define MIN(a,b) (((a)<(b))?(a):(b))
|
||||
#define MAX(a,b) (((a)>(b))?(a):(b))
|
||||
|
||||
|
||||
#endif /* sys/param.h */
|
||||
24
board/mentalnet/overlay/usr/include/sys/pci.h
Normal file
24
board/mentalnet/overlay/usr/include/sys/pci.h
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/* Copyright (C) 1997-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_PCI_H
|
||||
#define _SYS_PCI_H 1
|
||||
|
||||
/* We use the constants from the kernel. */
|
||||
#include <linux/pci.h>
|
||||
|
||||
#endif /* sys/pci.h */
|
||||
35
board/mentalnet/overlay/usr/include/sys/perm.h
Normal file
35
board/mentalnet/overlay/usr/include/sys/perm.h
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
/* Copyright (C) 1996-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_PERM_H
|
||||
|
||||
#define _SYS_PERM_H 1
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Set port input/output permissions. */
|
||||
extern int ioperm (unsigned long int __from, unsigned long int __num,
|
||||
int __turn_on) __THROW;
|
||||
|
||||
|
||||
/* Change I/O privilege level. */
|
||||
extern int iopl (int __level) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SYS_PERM_H */
|
||||
80
board/mentalnet/overlay/usr/include/sys/personality.h
Normal file
80
board/mentalnet/overlay/usr/include/sys/personality.h
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
/* Copyright (C) 2002-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Taken verbatim from Linux 2.6 (include/linux/personality.h). */
|
||||
|
||||
#ifndef _SYS_PERSONALITY_H
|
||||
#define _SYS_PERSONALITY_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
/* Flags for bug emulation.
|
||||
These occupy the top three bytes. */
|
||||
enum
|
||||
{
|
||||
UNAME26 = 0x0020000,
|
||||
ADDR_NO_RANDOMIZE = 0x0040000,
|
||||
FDPIC_FUNCPTRS = 0x0080000,
|
||||
MMAP_PAGE_ZERO = 0x0100000,
|
||||
ADDR_COMPAT_LAYOUT = 0x0200000,
|
||||
READ_IMPLIES_EXEC = 0x0400000,
|
||||
ADDR_LIMIT_32BIT = 0x0800000,
|
||||
SHORT_INODE = 0x1000000,
|
||||
WHOLE_SECONDS = 0x2000000,
|
||||
STICKY_TIMEOUTS = 0x4000000,
|
||||
ADDR_LIMIT_3GB = 0x8000000
|
||||
};
|
||||
|
||||
/* Personality types.
|
||||
|
||||
These go in the low byte. Avoid using the top bit, it will
|
||||
conflict with error returns. */
|
||||
enum
|
||||
{
|
||||
PER_LINUX = 0x0000,
|
||||
PER_LINUX_32BIT = 0x0000 | ADDR_LIMIT_32BIT,
|
||||
PER_LINUX_FDPIC = 0x0000 | FDPIC_FUNCPTRS,
|
||||
PER_SVR4 = 0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
|
||||
PER_SVR3 = 0x0002 | STICKY_TIMEOUTS | SHORT_INODE,
|
||||
PER_SCOSVR3 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS | SHORT_INODE,
|
||||
PER_OSR5 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS,
|
||||
PER_WYSEV386 = 0x0004 | STICKY_TIMEOUTS | SHORT_INODE,
|
||||
PER_ISCR4 = 0x0005 | STICKY_TIMEOUTS,
|
||||
PER_BSD = 0x0006,
|
||||
PER_SUNOS = 0x0006 | STICKY_TIMEOUTS,
|
||||
PER_XENIX = 0x0007 | STICKY_TIMEOUTS | SHORT_INODE,
|
||||
PER_LINUX32 = 0x0008,
|
||||
PER_LINUX32_3GB = 0x0008 | ADDR_LIMIT_3GB,
|
||||
PER_IRIX32 = 0x0009 | STICKY_TIMEOUTS, /* IRIX5 32-bit */
|
||||
PER_IRIXN32 = 0x000a | STICKY_TIMEOUTS, /* IRIX6 new 32-bit */
|
||||
PER_IRIX64 = 0x000b | STICKY_TIMEOUTS, /* IRIX6 64-bit */
|
||||
PER_RISCOS = 0x000c,
|
||||
PER_SOLARIS = 0x000d | STICKY_TIMEOUTS,
|
||||
PER_UW7 = 0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
|
||||
PER_OSF4 = 0x000f,
|
||||
PER_HPUX = 0x0010,
|
||||
PER_MASK = 0x00ff,
|
||||
};
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Set different ABIs (personalities). */
|
||||
extern int personality (unsigned long int __persona) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/personality.h */
|
||||
66
board/mentalnet/overlay/usr/include/sys/pidfd.h
Normal file
66
board/mentalnet/overlay/usr/include/sys/pidfd.h
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
/* Wrapper for file descriptors that refers to a process functions.
|
||||
Copyright (C) 2022-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _PIDFD_H
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <bits/types/siginfo_t.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#define PIDFD_NONBLOCK O_NONBLOCK
|
||||
#define PIDFD_THREAD O_EXCL
|
||||
|
||||
#define PIDFD_SIGNAL_THREAD (1UL << 0)
|
||||
#define PIDFD_SIGNAL_THREAD_GROUP (1UL << 1)
|
||||
#define PIDFD_SIGNAL_PROCESS_GROUP (1UL << 2)
|
||||
|
||||
#define PIDFS_IOCTL_MAGIC 0xFF
|
||||
|
||||
#define PIDFD_GET_CGROUP_NAMESPACE _IO(PIDFS_IOCTL_MAGIC, 1)
|
||||
#define PIDFD_GET_IPC_NAMESPACE _IO(PIDFS_IOCTL_MAGIC, 2)
|
||||
#define PIDFD_GET_MNT_NAMESPACE _IO(PIDFS_IOCTL_MAGIC, 3)
|
||||
#define PIDFD_GET_NET_NAMESPACE _IO(PIDFS_IOCTL_MAGIC, 4)
|
||||
#define PIDFD_GET_PID_NAMESPACE _IO(PIDFS_IOCTL_MAGIC, 5)
|
||||
#define PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE _IO(PIDFS_IOCTL_MAGIC, 6)
|
||||
#define PIDFD_GET_TIME_NAMESPACE _IO(PIDFS_IOCTL_MAGIC, 7)
|
||||
#define PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE _IO(PIDFS_IOCTL_MAGIC, 8)
|
||||
#define PIDFD_GET_USER_NAMESPACE _IO(PIDFS_IOCTL_MAGIC, 9)
|
||||
#define PIDFD_GET_UTS_NAMESPACE _IO(PIDFS_IOCTL_MAGIC, 10)
|
||||
|
||||
/* Returns a file descriptor that refers to the process PID. The
|
||||
close-on-exec is set on the file descriptor. */
|
||||
extern int pidfd_open (__pid_t __pid, unsigned int __flags) __THROW;
|
||||
|
||||
/* Duplicates an existing file descriptor TARGETFD in the process referred
|
||||
by the PIDFD file descriptor PIDFD.
|
||||
|
||||
The FLAGS argument is reserved for future use, it must be specified
|
||||
as 0. */
|
||||
extern int pidfd_getfd (int __pidfd, int __targetfd,
|
||||
unsigned int __flags) __THROW;
|
||||
|
||||
/* Sends the signal SIG to the target process referred by the PIDFD. If
|
||||
INFO points to a siginfo_t buffer, it will be populated. */
|
||||
extern int pidfd_send_signal (int __pidfd, int __sig, siginfo_t *__info,
|
||||
unsigned int __flags) __THROW;
|
||||
|
||||
/* Query the process ID (PID) from process descriptor FD. Return the PID
|
||||
or -1 in case of an error. */
|
||||
extern pid_t pidfd_getpid (int __fd) __THROW;
|
||||
|
||||
#endif /* _PIDFD_H */
|
||||
69
board/mentalnet/overlay/usr/include/sys/platform/x86.h
Normal file
69
board/mentalnet/overlay/usr/include/sys/platform/x86.h
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
/* Data structure for x86 CPU features.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 2008-2025 Free Software Foundation, Inc.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_PLATFORM_X86_H
|
||||
#define _SYS_PLATFORM_X86_H
|
||||
|
||||
#include <features.h>
|
||||
#include <stdbool.h>
|
||||
#include <bits/platform/x86.h>
|
||||
#include <bits/platform/features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Get a pointer to the CPU feature structure. */
|
||||
extern const struct cpuid_feature *__x86_get_cpuid_feature_leaf (unsigned int)
|
||||
__attribute__ ((pure));
|
||||
|
||||
static __inline__ bool
|
||||
x86_cpu_present (unsigned int __index)
|
||||
{
|
||||
const struct cpuid_feature *__ptr = __x86_get_cpuid_feature_leaf
|
||||
(__index / (8 * sizeof (unsigned int) * 4));
|
||||
unsigned int __reg
|
||||
= __index & (8 * sizeof (unsigned int) * 4 - 1);
|
||||
unsigned int __bit = __reg & (8 * sizeof (unsigned int) - 1);
|
||||
__reg /= 8 * sizeof (unsigned int);
|
||||
|
||||
return __ptr->cpuid_array[__reg] & (1 << __bit);
|
||||
}
|
||||
|
||||
static __inline__ bool
|
||||
x86_cpu_active (unsigned int __index)
|
||||
{
|
||||
if (__index == x86_cpu_IBT || __index == x86_cpu_SHSTK)
|
||||
return x86_cpu_cet_active (__index);
|
||||
|
||||
const struct cpuid_feature *__ptr = __x86_get_cpuid_feature_leaf
|
||||
(__index / (8 * sizeof (unsigned int) * 4));
|
||||
unsigned int __reg
|
||||
= __index & (8 * sizeof (unsigned int) * 4 - 1);
|
||||
unsigned int __bit = __reg & (8 * sizeof (unsigned int) - 1);
|
||||
__reg /= 8 * sizeof (unsigned int);
|
||||
|
||||
return __ptr->active_array[__reg] & (1 << __bit);
|
||||
}
|
||||
|
||||
/* CPU_FEATURE_PRESENT evaluates to true if CPU supports the feature. */
|
||||
#define CPU_FEATURE_PRESENT(name) x86_cpu_present (x86_cpu_##name)
|
||||
/* CPU_FEATURE_ACTIVE evaluates to true if the feature is active. */
|
||||
#define CPU_FEATURE_ACTIVE(name) x86_cpu_active (x86_cpu_##name)
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SYS_PLATFORM_X86_H */
|
||||
90
board/mentalnet/overlay/usr/include/sys/poll.h
Normal file
90
board/mentalnet/overlay/usr/include/sys/poll.h
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
/* Compatibility definitions for System V `poll' interface.
|
||||
Copyright (C) 1994-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_POLL_H
|
||||
#define _SYS_POLL_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
/* Get the platform dependent bits of `poll'. */
|
||||
#include <bits/poll.h>
|
||||
#ifdef __USE_GNU
|
||||
# include <bits/types/__sigset_t.h>
|
||||
# include <bits/types/struct_timespec.h>
|
||||
#endif
|
||||
|
||||
|
||||
/* Type used for the number of file descriptors. */
|
||||
typedef unsigned long int nfds_t;
|
||||
|
||||
/* Data structure describing a polling request. */
|
||||
struct pollfd
|
||||
{
|
||||
int fd; /* File descriptor to poll. */
|
||||
short int events; /* Types of events poller cares about. */
|
||||
short int revents; /* Types of events that actually occurred. */
|
||||
};
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Poll the file descriptors described by the NFDS structures starting at
|
||||
FDS. If TIMEOUT is nonzero and not -1, allow TIMEOUT milliseconds for
|
||||
an event to occur; if TIMEOUT is -1, block until an event occurs.
|
||||
Returns the number of file descriptors with events, zero if timed out,
|
||||
or -1 for errors.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern int poll (struct pollfd *__fds, nfds_t __nfds, int __timeout)
|
||||
__fortified_attr_access (__write_only__, 1, 2);
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Like poll, but before waiting the threads signal mask is replaced
|
||||
with that specified in the fourth parameter. For better usability,
|
||||
the timeout value is specified using a TIMESPEC object.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern int ppoll (struct pollfd *__fds, nfds_t __nfds,
|
||||
const struct timespec *__timeout,
|
||||
const __sigset_t *__ss)
|
||||
__fortified_attr_access (__write_only__, 1, 2);
|
||||
|
||||
# ifdef __USE_TIME64_REDIRECTS
|
||||
# ifdef __REDIRECT
|
||||
extern int __REDIRECT (ppoll, (struct pollfd *__fds, nfds_t __nfds,
|
||||
const struct timespec *__timeout,
|
||||
const __sigset_t *__ss),
|
||||
__ppoll64)
|
||||
__fortified_attr_access (__write_only__, 1, 2);
|
||||
# else
|
||||
# define ppoll __ppoll64
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
||||
/* Define some inlines helping to catch common problems. */
|
||||
#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
|
||||
# include <bits/poll2.h>
|
||||
#endif
|
||||
|
||||
#endif /* sys/poll.h */
|
||||
55
board/mentalnet/overlay/usr/include/sys/prctl.h
Normal file
55
board/mentalnet/overlay/usr/include/sys/prctl.h
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
/* Copyright (C) 1997-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_PRCTL_H
|
||||
#define _SYS_PRCTL_H 1
|
||||
|
||||
#include <features.h>
|
||||
#include <linux/prctl.h> /* The magic values come from here */
|
||||
|
||||
/* Recent extensions to linux which may post-date the kernel headers
|
||||
we're picking up... */
|
||||
|
||||
/* Memory tagging control operations (for AArch64). */
|
||||
#ifndef PR_MTE_TCF_SHIFT
|
||||
# define PR_MTE_TCF_SHIFT 1
|
||||
# define PR_MTE_TCF_NONE (0UL << PR_MTE_TCF_SHIFT)
|
||||
# define PR_MTE_TCF_SYNC (1UL << PR_MTE_TCF_SHIFT)
|
||||
# define PR_MTE_TCF_ASYNC (2UL << PR_MTE_TCF_SHIFT)
|
||||
# define PR_MTE_TCF_MASK (3UL << PR_MTE_TCF_SHIFT)
|
||||
# define PR_MTE_TAG_SHIFT 3
|
||||
# define PR_MTE_TAG_MASK (0xffffUL << PR_MTE_TAG_SHIFT)
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Control process execution. */
|
||||
#ifndef __USE_TIME64_REDIRECTS
|
||||
extern int prctl (int __option, ...) __THROW;
|
||||
#else
|
||||
# ifdef __REDIRECT
|
||||
extern int __REDIRECT_NTH (prctl, (int __option, ...), __prctl_time64);
|
||||
# else
|
||||
extern int __prctl_time64 (int __option,d ...) __THROW;
|
||||
# define ioctl __prctl_time64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/prctl.h */
|
||||
126
board/mentalnet/overlay/usr/include/sys/procfs.h
Normal file
126
board/mentalnet/overlay/usr/include/sys/procfs.h
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
/* Definitions for core files and libthread_db. Generic Linux version.
|
||||
Copyright (C) 1996-2025 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_PROCFS_H
|
||||
#define _SYS_PROCFS_H 1
|
||||
|
||||
/* This is somewhat modelled after the file of the same name on SVR4
|
||||
systems. It provides a definition of the core file format for ELF
|
||||
used on Linux. It doesn't have anything to do with the /proc file
|
||||
system, even though Linux has one.
|
||||
|
||||
Anyway, the whole purpose of this file is for GDB and GDB only.
|
||||
Don't read too much into it. Don't use it for anything other than
|
||||
GDB unless you know what you are doing. */
|
||||
|
||||
#include <features.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/user.h>
|
||||
|
||||
/* bits/procfs.h, provided by each architecture, must define
|
||||
elf_gregset_t, elf_fpregset_t and any other architecture-specific
|
||||
types needed. */
|
||||
#include <bits/procfs.h>
|
||||
|
||||
/* bits/procfs-id.h must define __pr_uid_t and __pr_gid_t, the types
|
||||
of pr_uid and pr_gid. */
|
||||
#include <bits/procfs-id.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Signal info. */
|
||||
struct elf_siginfo
|
||||
{
|
||||
int si_signo; /* Signal number. */
|
||||
int si_code; /* Extra code. */
|
||||
int si_errno; /* Errno. */
|
||||
};
|
||||
|
||||
/* Definitions to generate Intel SVR4-like core files. These mostly
|
||||
have the same names as the SVR4 types with "elf_" tacked on the
|
||||
front to prevent clashes with Linux definitions, and the typedef
|
||||
forms have been avoided. This is mostly like the SVR4 structure,
|
||||
but more Linuxy, with things that Linux does not support and which
|
||||
GDB doesn't really use excluded. */
|
||||
|
||||
struct elf_prstatus
|
||||
{
|
||||
struct elf_siginfo pr_info; /* Info associated with signal. */
|
||||
short int pr_cursig; /* Current signal. */
|
||||
unsigned long int pr_sigpend; /* Set of pending signals. */
|
||||
unsigned long int pr_sighold; /* Set of held signals. */
|
||||
__pid_t pr_pid;
|
||||
__pid_t pr_ppid;
|
||||
__pid_t pr_pgrp;
|
||||
__pid_t pr_sid;
|
||||
struct timeval pr_utime; /* User time. */
|
||||
struct timeval pr_stime; /* System time. */
|
||||
struct timeval pr_cutime; /* Cumulative user time. */
|
||||
struct timeval pr_cstime; /* Cumulative system time. */
|
||||
elf_gregset_t pr_reg; /* GP registers. */
|
||||
int pr_fpvalid; /* True if math copro being used. */
|
||||
};
|
||||
|
||||
|
||||
#define ELF_PRARGSZ (80) /* Number of chars for args. */
|
||||
|
||||
struct elf_prpsinfo
|
||||
{
|
||||
char pr_state; /* Numeric process state. */
|
||||
char pr_sname; /* Char for pr_state. */
|
||||
char pr_zomb; /* Zombie. */
|
||||
char pr_nice; /* Nice val. */
|
||||
unsigned long int pr_flag; /* Flags. */
|
||||
__pr_uid_t pr_uid;
|
||||
__pr_gid_t pr_gid;
|
||||
int pr_pid, pr_ppid, pr_pgrp, pr_sid;
|
||||
/* Lots missing */
|
||||
char pr_fname[16]; /* Filename of executable. */
|
||||
char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
|
||||
};
|
||||
|
||||
/* The rest of this file provides the types for emulation of the
|
||||
Solaris <proc_service.h> interfaces that should be implemented by
|
||||
users of libthread_db. */
|
||||
|
||||
/* Addresses. */
|
||||
typedef void *psaddr_t;
|
||||
|
||||
#include <bits/procfs-prregset.h>
|
||||
|
||||
/* Register sets. Linux has different names. */
|
||||
typedef __prgregset_t prgregset_t;
|
||||
typedef __prfpregset_t prfpregset_t;
|
||||
|
||||
/* We don't have any differences between processes and threads,
|
||||
therefore have only one PID type. */
|
||||
typedef __pid_t lwpid_t;
|
||||
|
||||
/* Process status and info. In the end we do provide typedefs for them. */
|
||||
typedef struct elf_prstatus prstatus_t;
|
||||
typedef struct elf_prpsinfo prpsinfo_t;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
/* On some architectures, provide other-ABI variants of the above
|
||||
types. */
|
||||
#include <bits/procfs-extra.h>
|
||||
|
||||
#endif /* sys/procfs.h. */
|
||||
60
board/mentalnet/overlay/usr/include/sys/profil.h
Normal file
60
board/mentalnet/overlay/usr/include/sys/profil.h
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
/* Copyright (C) 2001-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _PROFIL_H
|
||||
#define _PROFIL_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
/* This interface is intended to follow the sprofil() system calls as
|
||||
described by the sprofil(2) man page of Irix v6.5, except that:
|
||||
|
||||
- there is no a priori limit on number of text sections
|
||||
- pr_scale is declared as unsigned long (instead of "unsigned int")
|
||||
- pr_size is declared as size_t (instead of "unsigned int")
|
||||
- pr_off is declared as void * (instead of "__psunsigned_t")
|
||||
- the overflow bin (pr_base==0, pr_scale==2) can appear anywhere
|
||||
in the profp array
|
||||
- PROF_FAST has no effect */
|
||||
|
||||
struct prof
|
||||
{
|
||||
void *pr_base; /* buffer base */
|
||||
size_t pr_size; /* buffer size */
|
||||
size_t pr_off; /* pc offset */
|
||||
unsigned long int pr_scale; /* pc scaling (fixed-point number) */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
PROF_USHORT = 0, /* use 16-bit counters (default) */
|
||||
PROF_UINT = 1 << 0, /* use 32-bit counters */
|
||||
PROF_FAST = 1 << 1 /* profile faster than usual */
|
||||
};
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
extern int sprofil (struct prof *__profp, int __profcnt,
|
||||
struct timeval *__tvp, unsigned int __flags) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* profil.h */
|
||||
121
board/mentalnet/overlay/usr/include/sys/psx_syscall.h
Normal file
121
board/mentalnet/overlay/usr/include/sys/psx_syscall.h
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
/*
|
||||
* Copyright (c) 2019,24 Andrew G. Morgan <morgan@kernel.org>
|
||||
*
|
||||
* This header, and the -lpsx library, provide a number of things to
|
||||
* support POSIX semantics for syscalls associated with the pthread
|
||||
* library. For any code that references the psx_syscall{3,6}
|
||||
* functions, linking this code is as follows:
|
||||
*
|
||||
* ld ... -lpsx -lpthread
|
||||
* or,
|
||||
* gcc ... -lpsx -lpthread
|
||||
*
|
||||
* NOTE: linking with -lcap to make it silently aware of the psx
|
||||
* mechanism is tricky. You have to envelope the -lpsx part with
|
||||
* the following linker flags:
|
||||
*
|
||||
* ld ... --no-as-needed --whole-archive -lpsx --no-whole-archive --as-needed -lpthread
|
||||
* or,
|
||||
* gcc ... -Wl,--no-as-needed -Wl,--whole-archive -lpsx -Wl,--no-whole-archive -Wl,--as-needed -lpthread
|
||||
*
|
||||
* These options are provided in the
|
||||
* https://en.wikipedia.org/wiki/Pkg-config libpsx.pc file
|
||||
* distributed with the library.
|
||||
*
|
||||
* FYI Earlier versions of libpsx relied on gcc
|
||||
* ... -Wl,--wrap=pthread_create linkage in all cases, but since
|
||||
* libpsx-2.72 the library can work with non pthread threads (LWP)
|
||||
* under Linux and such wrapping is no longer needed. That being
|
||||
* said, for compatibility reasons such linking is still supported.
|
||||
*
|
||||
* glibc provides a subset of this functionality natively through the
|
||||
* nptl:setxid mechanism and could implement psx_syscall() directly
|
||||
* using that style of functionality but, as of 2019-11-30, the setxid
|
||||
* mechanism is limited to 9 specific set*() syscalls that do not
|
||||
* support the syscall6 API (needed for prctl functions and the ambient
|
||||
* capabilities set for example).
|
||||
*/
|
||||
|
||||
#ifndef _SYS_PSX_SYSCALL_H
|
||||
#define _SYS_PSX_SYSCALL_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
/*
|
||||
* Programmatic way to recognize feature set.
|
||||
*/
|
||||
#define LIBPSX_MAJOR 2
|
||||
#define LIBPSX_MINOR 73
|
||||
|
||||
/*
|
||||
* psx_syscall performs the specified syscall on all psx registered
|
||||
* threads. The mechanism by which this occurs is much less efficient
|
||||
* than a standard system call on Linux, so it should only be used
|
||||
* when POSIX semantics are required to change process relevant
|
||||
* security state.
|
||||
*
|
||||
* Glibc has native support for POSIX semantics on setgroups() and the
|
||||
* 8 set*[gu]id() functions. So, there is no need to use psx_syscall()
|
||||
* for these calls. This call exists for all the other system calls
|
||||
* that need to maintain parity on all pthreads of a program.
|
||||
*
|
||||
* Some macrology is used to allow the caller to provide only as many
|
||||
* arguments as needed, thus psx_syscall() cannot be used as a
|
||||
* function pointer. For those situations, we define psx_syscall3()
|
||||
* and psx_syscall6().
|
||||
*/
|
||||
#define psx_syscall(syscall_nr, ...) \
|
||||
__psx_syscall(syscall_nr, __VA_ARGS__, (long int) 6, (long int) 5, \
|
||||
(long int) 4, (long int) 3, (long int) 2, \
|
||||
(long int) 1, (long int) 0)
|
||||
long int __psx_syscall(long int syscall_nr, ...);
|
||||
long int psx_syscall3(long int syscall_nr,
|
||||
long int arg1, long int arg2, long int arg3);
|
||||
long int psx_syscall6(long int syscall_nr,
|
||||
long int arg1, long int arg2, long int arg3,
|
||||
long int arg4, long int arg5, long int arg6);
|
||||
|
||||
/*
|
||||
* This function should be used by systems to obtain pointers to the
|
||||
* two syscall functions provided by the PSX library. A linkage trick
|
||||
* is to define this function as weak in a library that can optionally
|
||||
* use libpsx and then, should the caller link -lpsx, that library can
|
||||
* implicitly use these POSIX semantics syscalls. See libcap for an
|
||||
* example of this usage.
|
||||
*/
|
||||
void psx_load_syscalls(long int (**syscall_fn)(long int,
|
||||
long int, long int, long int),
|
||||
long int (**syscall6_fn)(long int,
|
||||
long int, long int, long int,
|
||||
long int, long int, long int));
|
||||
|
||||
/*
|
||||
* psx_sensitivity_t holds the level of paranoia for non-POSIX syscall
|
||||
* behavior. The default is PSX_IGNORE: which is best effort - no
|
||||
* enforcement; PSX_WARNING will dump to stderr a warning when a
|
||||
* syscall's results differ; PSX_ERROR will dump info as per
|
||||
* PSX_WARNING and generate a SIGSYS. The current mode can be set with
|
||||
* psx_set_sensitivity().
|
||||
*/
|
||||
typedef enum {
|
||||
PSX_IGNORE = 0,
|
||||
PSX_WARNING = 1,
|
||||
PSX_ERROR = 2,
|
||||
} psx_sensitivity_t;
|
||||
|
||||
/*
|
||||
* psx_set_sensitivity sets the current sensitivity of the PSX
|
||||
* mechanism. The function returns 0 on success and -1 if the
|
||||
* requested level is invalid.
|
||||
*/
|
||||
int psx_set_sensitivity(psx_sensitivity_t level);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _SYS_PSX_SYSCALL_H */
|
||||
216
board/mentalnet/overlay/usr/include/sys/ptrace.h
Normal file
216
board/mentalnet/overlay/usr/include/sys/ptrace.h
Normal file
|
|
@ -0,0 +1,216 @@
|
|||
/* `ptrace' debugger support interface. Linux/x86 version.
|
||||
Copyright (C) 1996-2025 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_PTRACE_H
|
||||
#define _SYS_PTRACE_H 1
|
||||
|
||||
#include <features.h>
|
||||
#include <bits/types.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Type of the REQUEST argument to `ptrace.' */
|
||||
enum __ptrace_request
|
||||
{
|
||||
/* Indicate that the process making this request should be traced.
|
||||
All signals received by this process can be intercepted by its
|
||||
parent, and its parent can use the other `ptrace' requests. */
|
||||
PTRACE_TRACEME = 0,
|
||||
#define PT_TRACE_ME PTRACE_TRACEME
|
||||
|
||||
/* Return the word in the process's text space at address ADDR. */
|
||||
PTRACE_PEEKTEXT = 1,
|
||||
#define PT_READ_I PTRACE_PEEKTEXT
|
||||
|
||||
/* Return the word in the process's data space at address ADDR. */
|
||||
PTRACE_PEEKDATA = 2,
|
||||
#define PT_READ_D PTRACE_PEEKDATA
|
||||
|
||||
/* Return the word in the process's user area at offset ADDR. */
|
||||
PTRACE_PEEKUSER = 3,
|
||||
#define PT_READ_U PTRACE_PEEKUSER
|
||||
|
||||
/* Write the word DATA into the process's text space at address ADDR. */
|
||||
PTRACE_POKETEXT = 4,
|
||||
#define PT_WRITE_I PTRACE_POKETEXT
|
||||
|
||||
/* Write the word DATA into the process's data space at address ADDR. */
|
||||
PTRACE_POKEDATA = 5,
|
||||
#define PT_WRITE_D PTRACE_POKEDATA
|
||||
|
||||
/* Write the word DATA into the process's user area at offset ADDR. */
|
||||
PTRACE_POKEUSER = 6,
|
||||
#define PT_WRITE_U PTRACE_POKEUSER
|
||||
|
||||
/* Continue the process. */
|
||||
PTRACE_CONT = 7,
|
||||
#define PT_CONTINUE PTRACE_CONT
|
||||
|
||||
/* Kill the process. */
|
||||
PTRACE_KILL = 8,
|
||||
#define PT_KILL PTRACE_KILL
|
||||
|
||||
/* Single step the process. */
|
||||
PTRACE_SINGLESTEP = 9,
|
||||
#define PT_STEP PTRACE_SINGLESTEP
|
||||
|
||||
/* Get all general purpose registers used by a processes. */
|
||||
PTRACE_GETREGS = 12,
|
||||
#define PT_GETREGS PTRACE_GETREGS
|
||||
|
||||
/* Set all general purpose registers used by a processes. */
|
||||
PTRACE_SETREGS = 13,
|
||||
#define PT_SETREGS PTRACE_SETREGS
|
||||
|
||||
/* Get all floating point registers used by a processes. */
|
||||
PTRACE_GETFPREGS = 14,
|
||||
#define PT_GETFPREGS PTRACE_GETFPREGS
|
||||
|
||||
/* Set all floating point registers used by a processes. */
|
||||
PTRACE_SETFPREGS = 15,
|
||||
#define PT_SETFPREGS PTRACE_SETFPREGS
|
||||
|
||||
/* Attach to a process that is already running. */
|
||||
PTRACE_ATTACH = 16,
|
||||
#define PT_ATTACH PTRACE_ATTACH
|
||||
|
||||
/* Detach from a process attached to with PTRACE_ATTACH. */
|
||||
PTRACE_DETACH = 17,
|
||||
#define PT_DETACH PTRACE_DETACH
|
||||
|
||||
/* Get all extended floating point registers used by a processes. */
|
||||
PTRACE_GETFPXREGS = 18,
|
||||
#define PT_GETFPXREGS PTRACE_GETFPXREGS
|
||||
|
||||
/* Set all extended floating point registers used by a processes. */
|
||||
PTRACE_SETFPXREGS = 19,
|
||||
#define PT_SETFPXREGS PTRACE_SETFPXREGS
|
||||
|
||||
/* Continue and stop at the next entry to or return from syscall. */
|
||||
PTRACE_SYSCALL = 24,
|
||||
#define PT_SYSCALL PTRACE_SYSCALL
|
||||
|
||||
/* Get a TLS entry in the GDT. */
|
||||
PTRACE_GET_THREAD_AREA = 25,
|
||||
#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA
|
||||
|
||||
/* Change a TLS entry in the GDT. */
|
||||
PTRACE_SET_THREAD_AREA = 26,
|
||||
#define PT_SET_THREAD_AREA PTRACE_SET_THREAD_AREA
|
||||
|
||||
#ifdef __x86_64__
|
||||
/* Access TLS data. */
|
||||
PTRACE_ARCH_PRCTL = 30,
|
||||
# define PT_ARCH_PRCTL PTRACE_ARCH_PRCTL
|
||||
#endif
|
||||
|
||||
/* Continue and stop at the next syscall, it will not be executed. */
|
||||
PTRACE_SYSEMU = 31,
|
||||
#define PT_SYSEMU PTRACE_SYSEMU
|
||||
|
||||
/* Single step the process, the next syscall will not be executed. */
|
||||
PTRACE_SYSEMU_SINGLESTEP = 32,
|
||||
#define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP
|
||||
|
||||
/* Execute process until next taken branch. */
|
||||
PTRACE_SINGLEBLOCK = 33,
|
||||
#define PT_STEPBLOCK PTRACE_SINGLEBLOCK
|
||||
|
||||
/* Set ptrace filter options. */
|
||||
PTRACE_SETOPTIONS = 0x4200,
|
||||
#define PT_SETOPTIONS PTRACE_SETOPTIONS
|
||||
|
||||
/* Get last ptrace message. */
|
||||
PTRACE_GETEVENTMSG = 0x4201,
|
||||
#define PT_GETEVENTMSG PTRACE_GETEVENTMSG
|
||||
|
||||
/* Get siginfo for process. */
|
||||
PTRACE_GETSIGINFO = 0x4202,
|
||||
#define PT_GETSIGINFO PTRACE_GETSIGINFO
|
||||
|
||||
/* Set new siginfo for process. */
|
||||
PTRACE_SETSIGINFO = 0x4203,
|
||||
#define PT_SETSIGINFO PTRACE_SETSIGINFO
|
||||
|
||||
/* Get register content. */
|
||||
PTRACE_GETREGSET = 0x4204,
|
||||
#define PTRACE_GETREGSET PTRACE_GETREGSET
|
||||
|
||||
/* Set register content. */
|
||||
PTRACE_SETREGSET = 0x4205,
|
||||
#define PTRACE_SETREGSET PTRACE_SETREGSET
|
||||
|
||||
/* Like PTRACE_ATTACH, but do not force tracee to trap and do not affect
|
||||
signal or group stop state. */
|
||||
PTRACE_SEIZE = 0x4206,
|
||||
#define PTRACE_SEIZE PTRACE_SEIZE
|
||||
|
||||
/* Trap seized tracee. */
|
||||
PTRACE_INTERRUPT = 0x4207,
|
||||
#define PTRACE_INTERRUPT PTRACE_INTERRUPT
|
||||
|
||||
/* Wait for next group event. */
|
||||
PTRACE_LISTEN = 0x4208,
|
||||
#define PTRACE_LISTEN PTRACE_LISTEN
|
||||
|
||||
/* Retrieve siginfo_t structures without removing signals from a queue. */
|
||||
PTRACE_PEEKSIGINFO = 0x4209,
|
||||
#define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO
|
||||
|
||||
/* Get the mask of blocked signals. */
|
||||
PTRACE_GETSIGMASK = 0x420a,
|
||||
#define PTRACE_GETSIGMASK PTRACE_GETSIGMASK
|
||||
|
||||
/* Change the mask of blocked signals. */
|
||||
PTRACE_SETSIGMASK = 0x420b,
|
||||
#define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
|
||||
|
||||
/* Get seccomp BPF filters. */
|
||||
PTRACE_SECCOMP_GET_FILTER = 0x420c,
|
||||
#define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
|
||||
|
||||
/* Get seccomp BPF filter metadata. */
|
||||
PTRACE_SECCOMP_GET_METADATA = 0x420d,
|
||||
#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
|
||||
|
||||
/* Get information about system call. */
|
||||
PTRACE_GET_SYSCALL_INFO = 0x420e,
|
||||
#define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO
|
||||
|
||||
/* Get rseq configuration information. */
|
||||
PTRACE_GET_RSEQ_CONFIGURATION = 0x420f,
|
||||
#define PTRACE_GET_RSEQ_CONFIGURATION PTRACE_GET_RSEQ_CONFIGURATION
|
||||
|
||||
/* Set configuration for syscall user dispatch. */
|
||||
PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG = 0x4210,
|
||||
#define PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG \
|
||||
PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG
|
||||
|
||||
/* Get configuration for syscall user dispatch. */
|
||||
PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG = 0x4211
|
||||
#define PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG \
|
||||
PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG
|
||||
};
|
||||
|
||||
|
||||
#include <bits/ptrace-shared.h>
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SYS_PTRACE_H */
|
||||
574
board/mentalnet/overlay/usr/include/sys/queue.h
Normal file
574
board/mentalnet/overlay/usr/include/sys/queue.h
Normal file
|
|
@ -0,0 +1,574 @@
|
|||
/*
|
||||
* 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.
|
||||
*
|
||||
* @(#)queue.h 8.5 (Berkeley) 8/20/94
|
||||
*/
|
||||
|
||||
#ifndef _SYS_QUEUE_H_
|
||||
#define _SYS_QUEUE_H_
|
||||
|
||||
/*
|
||||
* This file defines five types of data structures: singly-linked lists,
|
||||
* lists, simple queues, tail queues, and circular queues.
|
||||
*
|
||||
* A singly-linked list is headed by a single forward pointer. The
|
||||
* elements are singly linked for minimum space and pointer manipulation
|
||||
* overhead at the expense of O(n) removal for arbitrary elements. New
|
||||
* elements can be added to the list after an existing element or at the
|
||||
* head of the list. Elements being removed from the head of the list
|
||||
* should use the explicit macro for this purpose for optimum
|
||||
* efficiency. A singly-linked list may only be traversed in the forward
|
||||
* direction. Singly-linked lists are ideal for applications with large
|
||||
* datasets and few or no removals or for implementing a LIFO queue.
|
||||
*
|
||||
* A list is headed by a single forward pointer (or an array of forward
|
||||
* pointers for a hash table header). The elements are doubly linked
|
||||
* so that an arbitrary element can be removed without a need to
|
||||
* traverse the list. New elements can be added to the list before
|
||||
* or after an existing element or at the head of the list. A list
|
||||
* may only be traversed in the forward direction.
|
||||
*
|
||||
* A simple queue is headed by a pair of pointers, one the head of the
|
||||
* list and the other to the tail of the list. The elements are singly
|
||||
* linked to save space, so elements can only be removed from the
|
||||
* head of the list. New elements can be added to the list after
|
||||
* an existing element, at the head of the list, or at the end of the
|
||||
* list. A simple queue may only be traversed in the forward direction.
|
||||
*
|
||||
* A tail queue is headed by a pair of pointers, one to the head of the
|
||||
* list and the other to the tail of the list. The elements are doubly
|
||||
* linked so that an arbitrary element can be removed without a need to
|
||||
* traverse the list. New elements can be added to the list before or
|
||||
* after an existing element, at the head of the list, or at the end of
|
||||
* the list. A tail queue may be traversed in either direction.
|
||||
*
|
||||
* A circle queue is headed by a pair of pointers, one to the head of the
|
||||
* list and the other to the tail of the list. The elements are doubly
|
||||
* linked so that an arbitrary element can be removed without a need to
|
||||
* traverse the list. New elements can be added to the list before or after
|
||||
* an existing element, at the head of the list, or at the end of the list.
|
||||
* A circle queue may be traversed in either direction, but has a more
|
||||
* complex end of list detection.
|
||||
*
|
||||
* For details on the use of these macros, see the queue(3) manual page.
|
||||
*/
|
||||
|
||||
/*
|
||||
* List definitions.
|
||||
*/
|
||||
#define LIST_HEAD(name, type) \
|
||||
struct name { \
|
||||
struct type *lh_first; /* first element */ \
|
||||
}
|
||||
|
||||
#define LIST_HEAD_INITIALIZER(head) \
|
||||
{ NULL }
|
||||
|
||||
#define LIST_ENTRY(type) \
|
||||
struct { \
|
||||
struct type *le_next; /* next element */ \
|
||||
struct type **le_prev; /* address of previous next element */ \
|
||||
}
|
||||
|
||||
/*
|
||||
* List functions.
|
||||
*/
|
||||
#define LIST_INIT(head) do { \
|
||||
(head)->lh_first = NULL; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define LIST_INSERT_AFTER(listelm, elm, field) do { \
|
||||
if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \
|
||||
(listelm)->field.le_next->field.le_prev = \
|
||||
&(elm)->field.le_next; \
|
||||
(listelm)->field.le_next = (elm); \
|
||||
(elm)->field.le_prev = &(listelm)->field.le_next; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define LIST_INSERT_BEFORE(listelm, elm, field) do { \
|
||||
(elm)->field.le_prev = (listelm)->field.le_prev; \
|
||||
(elm)->field.le_next = (listelm); \
|
||||
*(listelm)->field.le_prev = (elm); \
|
||||
(listelm)->field.le_prev = &(elm)->field.le_next; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define LIST_INSERT_HEAD(head, elm, field) do { \
|
||||
if (((elm)->field.le_next = (head)->lh_first) != NULL) \
|
||||
(head)->lh_first->field.le_prev = &(elm)->field.le_next;\
|
||||
(head)->lh_first = (elm); \
|
||||
(elm)->field.le_prev = &(head)->lh_first; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define LIST_REMOVE(elm, field) do { \
|
||||
if ((elm)->field.le_next != NULL) \
|
||||
(elm)->field.le_next->field.le_prev = \
|
||||
(elm)->field.le_prev; \
|
||||
*(elm)->field.le_prev = (elm)->field.le_next; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define LIST_FOREACH(var, head, field) \
|
||||
for ((var) = ((head)->lh_first); \
|
||||
(var); \
|
||||
(var) = ((var)->field.le_next))
|
||||
|
||||
/*
|
||||
* List access methods.
|
||||
*/
|
||||
#define LIST_EMPTY(head) ((head)->lh_first == NULL)
|
||||
#define LIST_FIRST(head) ((head)->lh_first)
|
||||
#define LIST_NEXT(elm, field) ((elm)->field.le_next)
|
||||
|
||||
|
||||
/*
|
||||
* Singly-linked List definitions.
|
||||
*/
|
||||
#define SLIST_HEAD(name, type) \
|
||||
struct name { \
|
||||
struct type *slh_first; /* first element */ \
|
||||
}
|
||||
|
||||
#define SLIST_HEAD_INITIALIZER(head) \
|
||||
{ NULL }
|
||||
|
||||
#define SLIST_ENTRY(type) \
|
||||
struct { \
|
||||
struct type *sle_next; /* next element */ \
|
||||
}
|
||||
|
||||
/*
|
||||
* Singly-linked List functions.
|
||||
*/
|
||||
#define SLIST_INIT(head) do { \
|
||||
(head)->slh_first = NULL; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \
|
||||
(elm)->field.sle_next = (slistelm)->field.sle_next; \
|
||||
(slistelm)->field.sle_next = (elm); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define SLIST_INSERT_HEAD(head, elm, field) do { \
|
||||
(elm)->field.sle_next = (head)->slh_first; \
|
||||
(head)->slh_first = (elm); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define SLIST_REMOVE_HEAD(head, field) do { \
|
||||
(head)->slh_first = (head)->slh_first->field.sle_next; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define SLIST_REMOVE(head, elm, type, field) do { \
|
||||
if ((head)->slh_first == (elm)) { \
|
||||
SLIST_REMOVE_HEAD((head), field); \
|
||||
} \
|
||||
else { \
|
||||
struct type *curelm = (head)->slh_first; \
|
||||
while(curelm->field.sle_next != (elm)) \
|
||||
curelm = curelm->field.sle_next; \
|
||||
curelm->field.sle_next = \
|
||||
curelm->field.sle_next->field.sle_next; \
|
||||
} \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define SLIST_FOREACH(var, head, field) \
|
||||
for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next)
|
||||
|
||||
/*
|
||||
* Singly-linked List access methods.
|
||||
*/
|
||||
#define SLIST_EMPTY(head) ((head)->slh_first == NULL)
|
||||
#define SLIST_FIRST(head) ((head)->slh_first)
|
||||
#define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
|
||||
|
||||
|
||||
/*
|
||||
* Singly-linked Tail queue declarations.
|
||||
*/
|
||||
#define STAILQ_HEAD(name, type) \
|
||||
struct name { \
|
||||
struct type *stqh_first; /* first element */ \
|
||||
struct type **stqh_last; /* addr of last next element */ \
|
||||
}
|
||||
|
||||
#define STAILQ_HEAD_INITIALIZER(head) \
|
||||
{ NULL, &(head).stqh_first }
|
||||
|
||||
#define STAILQ_ENTRY(type) \
|
||||
struct { \
|
||||
struct type *stqe_next; /* next element */ \
|
||||
}
|
||||
|
||||
/*
|
||||
* Singly-linked Tail queue functions.
|
||||
*/
|
||||
#define STAILQ_INIT(head) do { \
|
||||
(head)->stqh_first = NULL; \
|
||||
(head)->stqh_last = &(head)->stqh_first; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define STAILQ_INSERT_HEAD(head, elm, field) do { \
|
||||
if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \
|
||||
(head)->stqh_last = &(elm)->field.stqe_next; \
|
||||
(head)->stqh_first = (elm); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define STAILQ_INSERT_TAIL(head, elm, field) do { \
|
||||
(elm)->field.stqe_next = NULL; \
|
||||
*(head)->stqh_last = (elm); \
|
||||
(head)->stqh_last = &(elm)->field.stqe_next; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
|
||||
if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\
|
||||
(head)->stqh_last = &(elm)->field.stqe_next; \
|
||||
(listelm)->field.stqe_next = (elm); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define STAILQ_REMOVE_HEAD(head, field) do { \
|
||||
if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \
|
||||
(head)->stqh_last = &(head)->stqh_first; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define STAILQ_REMOVE(head, elm, type, field) do { \
|
||||
if ((head)->stqh_first == (elm)) { \
|
||||
STAILQ_REMOVE_HEAD((head), field); \
|
||||
} else { \
|
||||
struct type *curelm = (head)->stqh_first; \
|
||||
while (curelm->field.stqe_next != (elm)) \
|
||||
curelm = curelm->field.stqe_next; \
|
||||
if ((curelm->field.stqe_next = \
|
||||
curelm->field.stqe_next->field.stqe_next) == NULL) \
|
||||
(head)->stqh_last = &(curelm)->field.stqe_next; \
|
||||
} \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define STAILQ_FOREACH(var, head, field) \
|
||||
for ((var) = ((head)->stqh_first); \
|
||||
(var); \
|
||||
(var) = ((var)->field.stqe_next))
|
||||
|
||||
#define STAILQ_CONCAT(head1, head2) do { \
|
||||
if (!STAILQ_EMPTY((head2))) { \
|
||||
*(head1)->stqh_last = (head2)->stqh_first; \
|
||||
(head1)->stqh_last = (head2)->stqh_last; \
|
||||
STAILQ_INIT((head2)); \
|
||||
} \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
/*
|
||||
* Singly-linked Tail queue access methods.
|
||||
*/
|
||||
#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL)
|
||||
#define STAILQ_FIRST(head) ((head)->stqh_first)
|
||||
#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
|
||||
|
||||
|
||||
/*
|
||||
* Simple queue definitions.
|
||||
*/
|
||||
#define SIMPLEQ_HEAD(name, type) \
|
||||
struct name { \
|
||||
struct type *sqh_first; /* first element */ \
|
||||
struct type **sqh_last; /* addr of last next element */ \
|
||||
}
|
||||
|
||||
#define SIMPLEQ_HEAD_INITIALIZER(head) \
|
||||
{ NULL, &(head).sqh_first }
|
||||
|
||||
#define SIMPLEQ_ENTRY(type) \
|
||||
struct { \
|
||||
struct type *sqe_next; /* next element */ \
|
||||
}
|
||||
|
||||
/*
|
||||
* Simple queue functions.
|
||||
*/
|
||||
#define SIMPLEQ_INIT(head) do { \
|
||||
(head)->sqh_first = NULL; \
|
||||
(head)->sqh_last = &(head)->sqh_first; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \
|
||||
if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \
|
||||
(head)->sqh_last = &(elm)->field.sqe_next; \
|
||||
(head)->sqh_first = (elm); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \
|
||||
(elm)->field.sqe_next = NULL; \
|
||||
*(head)->sqh_last = (elm); \
|
||||
(head)->sqh_last = &(elm)->field.sqe_next; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
|
||||
if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\
|
||||
(head)->sqh_last = &(elm)->field.sqe_next; \
|
||||
(listelm)->field.sqe_next = (elm); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define SIMPLEQ_REMOVE_HEAD(head, field) do { \
|
||||
if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \
|
||||
(head)->sqh_last = &(head)->sqh_first; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define SIMPLEQ_REMOVE(head, elm, type, field) do { \
|
||||
if ((head)->sqh_first == (elm)) { \
|
||||
SIMPLEQ_REMOVE_HEAD((head), field); \
|
||||
} else { \
|
||||
struct type *curelm = (head)->sqh_first; \
|
||||
while (curelm->field.sqe_next != (elm)) \
|
||||
curelm = curelm->field.sqe_next; \
|
||||
if ((curelm->field.sqe_next = \
|
||||
curelm->field.sqe_next->field.sqe_next) == NULL) \
|
||||
(head)->sqh_last = &(curelm)->field.sqe_next; \
|
||||
} \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define SIMPLEQ_FOREACH(var, head, field) \
|
||||
for ((var) = ((head)->sqh_first); \
|
||||
(var); \
|
||||
(var) = ((var)->field.sqe_next))
|
||||
|
||||
/*
|
||||
* Simple queue access methods.
|
||||
*/
|
||||
#define SIMPLEQ_EMPTY(head) ((head)->sqh_first == NULL)
|
||||
#define SIMPLEQ_FIRST(head) ((head)->sqh_first)
|
||||
#define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next)
|
||||
|
||||
|
||||
/*
|
||||
* Tail queue definitions.
|
||||
*/
|
||||
#define _TAILQ_HEAD(name, type, qual) \
|
||||
struct name { \
|
||||
qual type *tqh_first; /* first element */ \
|
||||
qual type *qual *tqh_last; /* addr of last next element */ \
|
||||
}
|
||||
#define TAILQ_HEAD(name, type) _TAILQ_HEAD(name, struct type,)
|
||||
|
||||
#define TAILQ_HEAD_INITIALIZER(head) \
|
||||
{ NULL, &(head).tqh_first }
|
||||
|
||||
#define _TAILQ_ENTRY(type, qual) \
|
||||
struct { \
|
||||
qual type *tqe_next; /* next element */ \
|
||||
qual type *qual *tqe_prev; /* address of previous next element */\
|
||||
}
|
||||
#define TAILQ_ENTRY(type) _TAILQ_ENTRY(struct type,)
|
||||
|
||||
/*
|
||||
* Tail queue functions.
|
||||
*/
|
||||
#define TAILQ_INIT(head) do { \
|
||||
(head)->tqh_first = NULL; \
|
||||
(head)->tqh_last = &(head)->tqh_first; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define TAILQ_INSERT_HEAD(head, elm, field) do { \
|
||||
if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
|
||||
(head)->tqh_first->field.tqe_prev = \
|
||||
&(elm)->field.tqe_next; \
|
||||
else \
|
||||
(head)->tqh_last = &(elm)->field.tqe_next; \
|
||||
(head)->tqh_first = (elm); \
|
||||
(elm)->field.tqe_prev = &(head)->tqh_first; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define TAILQ_INSERT_TAIL(head, elm, field) do { \
|
||||
(elm)->field.tqe_next = NULL; \
|
||||
(elm)->field.tqe_prev = (head)->tqh_last; \
|
||||
*(head)->tqh_last = (elm); \
|
||||
(head)->tqh_last = &(elm)->field.tqe_next; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
|
||||
if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
|
||||
(elm)->field.tqe_next->field.tqe_prev = \
|
||||
&(elm)->field.tqe_next; \
|
||||
else \
|
||||
(head)->tqh_last = &(elm)->field.tqe_next; \
|
||||
(listelm)->field.tqe_next = (elm); \
|
||||
(elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
|
||||
(elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
|
||||
(elm)->field.tqe_next = (listelm); \
|
||||
*(listelm)->field.tqe_prev = (elm); \
|
||||
(listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define TAILQ_REMOVE(head, elm, field) do { \
|
||||
if (((elm)->field.tqe_next) != NULL) \
|
||||
(elm)->field.tqe_next->field.tqe_prev = \
|
||||
(elm)->field.tqe_prev; \
|
||||
else \
|
||||
(head)->tqh_last = (elm)->field.tqe_prev; \
|
||||
*(elm)->field.tqe_prev = (elm)->field.tqe_next; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define TAILQ_FOREACH(var, head, field) \
|
||||
for ((var) = ((head)->tqh_first); \
|
||||
(var); \
|
||||
(var) = ((var)->field.tqe_next))
|
||||
|
||||
#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
|
||||
for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last)); \
|
||||
(var); \
|
||||
(var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last)))
|
||||
|
||||
#define TAILQ_CONCAT(head1, head2, field) do { \
|
||||
if (!TAILQ_EMPTY(head2)) { \
|
||||
*(head1)->tqh_last = (head2)->tqh_first; \
|
||||
(head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \
|
||||
(head1)->tqh_last = (head2)->tqh_last; \
|
||||
TAILQ_INIT((head2)); \
|
||||
} \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
/*
|
||||
* Tail queue access methods.
|
||||
*/
|
||||
#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL)
|
||||
#define TAILQ_FIRST(head) ((head)->tqh_first)
|
||||
#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
|
||||
|
||||
#define TAILQ_LAST(head, headname) \
|
||||
(*(((struct headname *)((head)->tqh_last))->tqh_last))
|
||||
#define TAILQ_PREV(elm, headname, field) \
|
||||
(*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
|
||||
|
||||
|
||||
/*
|
||||
* Circular queue definitions.
|
||||
*/
|
||||
#define CIRCLEQ_HEAD(name, type) \
|
||||
struct name { \
|
||||
struct type *cqh_first; /* first element */ \
|
||||
struct type *cqh_last; /* last element */ \
|
||||
}
|
||||
|
||||
#define CIRCLEQ_HEAD_INITIALIZER(head) \
|
||||
{ (void *)&head, (void *)&head }
|
||||
|
||||
#define CIRCLEQ_ENTRY(type) \
|
||||
struct { \
|
||||
struct type *cqe_next; /* next element */ \
|
||||
struct type *cqe_prev; /* previous element */ \
|
||||
}
|
||||
|
||||
/*
|
||||
* Circular queue functions.
|
||||
*/
|
||||
#define CIRCLEQ_INIT(head) do { \
|
||||
(head)->cqh_first = (void *)(head); \
|
||||
(head)->cqh_last = (void *)(head); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
|
||||
(elm)->field.cqe_next = (listelm)->field.cqe_next; \
|
||||
(elm)->field.cqe_prev = (listelm); \
|
||||
if ((listelm)->field.cqe_next == (void *)(head)) \
|
||||
(head)->cqh_last = (elm); \
|
||||
else \
|
||||
(listelm)->field.cqe_next->field.cqe_prev = (elm); \
|
||||
(listelm)->field.cqe_next = (elm); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \
|
||||
(elm)->field.cqe_next = (listelm); \
|
||||
(elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
|
||||
if ((listelm)->field.cqe_prev == (void *)(head)) \
|
||||
(head)->cqh_first = (elm); \
|
||||
else \
|
||||
(listelm)->field.cqe_prev->field.cqe_next = (elm); \
|
||||
(listelm)->field.cqe_prev = (elm); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \
|
||||
(elm)->field.cqe_next = (head)->cqh_first; \
|
||||
(elm)->field.cqe_prev = (void *)(head); \
|
||||
if ((head)->cqh_last == (void *)(head)) \
|
||||
(head)->cqh_last = (elm); \
|
||||
else \
|
||||
(head)->cqh_first->field.cqe_prev = (elm); \
|
||||
(head)->cqh_first = (elm); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \
|
||||
(elm)->field.cqe_next = (void *)(head); \
|
||||
(elm)->field.cqe_prev = (head)->cqh_last; \
|
||||
if ((head)->cqh_first == (void *)(head)) \
|
||||
(head)->cqh_first = (elm); \
|
||||
else \
|
||||
(head)->cqh_last->field.cqe_next = (elm); \
|
||||
(head)->cqh_last = (elm); \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define CIRCLEQ_REMOVE(head, elm, field) do { \
|
||||
if ((elm)->field.cqe_next == (void *)(head)) \
|
||||
(head)->cqh_last = (elm)->field.cqe_prev; \
|
||||
else \
|
||||
(elm)->field.cqe_next->field.cqe_prev = \
|
||||
(elm)->field.cqe_prev; \
|
||||
if ((elm)->field.cqe_prev == (void *)(head)) \
|
||||
(head)->cqh_first = (elm)->field.cqe_next; \
|
||||
else \
|
||||
(elm)->field.cqe_prev->field.cqe_next = \
|
||||
(elm)->field.cqe_next; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define CIRCLEQ_FOREACH(var, head, field) \
|
||||
for ((var) = ((head)->cqh_first); \
|
||||
(var) != (const void *)(head); \
|
||||
(var) = ((var)->field.cqe_next))
|
||||
|
||||
#define CIRCLEQ_FOREACH_REVERSE(var, head, field) \
|
||||
for ((var) = ((head)->cqh_last); \
|
||||
(var) != (const void *)(head); \
|
||||
(var) = ((var)->field.cqe_prev))
|
||||
|
||||
/*
|
||||
* Circular queue access methods.
|
||||
*/
|
||||
#define CIRCLEQ_EMPTY(head) ((head)->cqh_first == (void *)(head))
|
||||
#define CIRCLEQ_FIRST(head) ((head)->cqh_first)
|
||||
#define CIRCLEQ_LAST(head) ((head)->cqh_last)
|
||||
#define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next)
|
||||
#define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev)
|
||||
|
||||
#define CIRCLEQ_LOOP_NEXT(head, elm, field) \
|
||||
(((elm)->field.cqe_next == (void *)(head)) \
|
||||
? ((head)->cqh_first) \
|
||||
: (elm->field.cqe_next))
|
||||
#define CIRCLEQ_LOOP_PREV(head, elm, field) \
|
||||
(((elm)->field.cqe_prev == (void *)(head)) \
|
||||
? ((head)->cqh_last) \
|
||||
: (elm->field.cqe_prev))
|
||||
|
||||
#endif /* sys/queue.h */
|
||||
135
board/mentalnet/overlay/usr/include/sys/quota.h
Normal file
135
board/mentalnet/overlay/usr/include/sys/quota.h
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
/* This just represents the non-kernel parts of <linux/quota.h>.
|
||||
Copyright (C) 1998-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986 Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Robert Elz at The University of Melbourne.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must 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.
|
||||
*/
|
||||
|
||||
#ifndef _SYS_QUOTA_H
|
||||
#define _SYS_QUOTA_H 1
|
||||
|
||||
#include <features.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <linux/quota.h>
|
||||
|
||||
/*
|
||||
* Convert diskblocks to blocks and the other way around.
|
||||
* currently only to fool the BSD source. :-)
|
||||
*/
|
||||
#define dbtob(num) ((num) << 10)
|
||||
#define btodb(num) ((num) >> 10)
|
||||
|
||||
/*
|
||||
* Convert count of filesystem blocks to diskquota blocks, meant for
|
||||
* filesystems where i_blksize != 1024.
|
||||
*/
|
||||
#define fs_to_dq_blocks(num, blksize) (((num) * (blksize)) / 1024)
|
||||
|
||||
/*
|
||||
* Definitions for disk quotas imposed on the average user
|
||||
* (big brother finally hits Linux).
|
||||
*
|
||||
* The following constants define the amount of time given a user
|
||||
* before the soft limits are treated as hard limits (usually resulting
|
||||
* in an allocation failure). The timer is started when the user crosses
|
||||
* their soft limit, it is reset when they go below their soft limit.
|
||||
*/
|
||||
#define MAX_IQ_TIME 604800 /* (7*24*60*60) 1 week */
|
||||
#define MAX_DQ_TIME 604800 /* (7*24*60*60) 1 week */
|
||||
|
||||
#define QUOTAFILENAME "quota"
|
||||
#define QUOTAGROUP "staff"
|
||||
|
||||
#define NR_DQHASH 43 /* Just an arbitrary number any suggestions ? */
|
||||
#define NR_DQUOTS 256 /* Number of quotas active at one time */
|
||||
|
||||
/* Old name for struct if_dqblk. */
|
||||
struct dqblk
|
||||
{
|
||||
__uint64_t dqb_bhardlimit; /* absolute limit on disk quota blocks alloc */
|
||||
__uint64_t dqb_bsoftlimit; /* preferred limit on disk quota blocks */
|
||||
__uint64_t dqb_curspace; /* current quota block count */
|
||||
__uint64_t dqb_ihardlimit; /* maximum # allocated inodes */
|
||||
__uint64_t dqb_isoftlimit; /* preferred inode limit */
|
||||
__uint64_t dqb_curinodes; /* current # allocated inodes */
|
||||
__uint64_t dqb_btime; /* time limit for excessive disk use */
|
||||
__uint64_t dqb_itime; /* time limit for excessive files */
|
||||
__uint32_t dqb_valid; /* bitmask of QIF_* constants */
|
||||
};
|
||||
|
||||
/*
|
||||
* Shorthand notation.
|
||||
*/
|
||||
#define dq_bhardlimit dq_dqb.dqb_bhardlimit
|
||||
#define dq_bsoftlimit dq_dqb.dqb_bsoftlimit
|
||||
#define dq_curspace dq_dqb.dqb_curspace
|
||||
#define dq_valid dq_dqb.dqb_valid
|
||||
#define dq_ihardlimit dq_dqb.dqb_ihardlimit
|
||||
#define dq_isoftlimit dq_dqb.dqb_isoftlimit
|
||||
#define dq_curinodes dq_dqb.dqb_curinodes
|
||||
#define dq_btime dq_dqb.dqb_btime
|
||||
#define dq_itime dq_dqb.dqb_itime
|
||||
|
||||
#define dqoff(UID) ((__loff_t)((UID) * sizeof (struct dqblk)))
|
||||
|
||||
/* Old name for struct if_dqinfo. */
|
||||
struct dqinfo
|
||||
{
|
||||
__uint64_t dqi_bgrace;
|
||||
__uint64_t dqi_igrace;
|
||||
__uint32_t dqi_flags;
|
||||
__uint32_t dqi_valid;
|
||||
};
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
extern int quotactl (int __cmd, const char *__special, int __id,
|
||||
__caddr_t __addr) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/quota.h */
|
||||
45
board/mentalnet/overlay/usr/include/sys/random.h
Normal file
45
board/mentalnet/overlay/usr/include/sys/random.h
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
/* Interfaces for obtaining random bytes.
|
||||
Copyright (C) 2016-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_RANDOM_H
|
||||
#define _SYS_RANDOM_H 1
|
||||
|
||||
#include <features.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
/* Flags for use with getrandom. */
|
||||
#define GRND_NONBLOCK 0x01
|
||||
#define GRND_RANDOM 0x02
|
||||
#define GRND_INSECURE 0x04
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Write LENGTH bytes of randomness starting at BUFFER. Return the
|
||||
number of bytes written, or -1 on error. */
|
||||
ssize_t getrandom (void *__buffer, size_t __length,
|
||||
unsigned int __flags) __wur
|
||||
__attr_access ((__write_only__, 1, 2));
|
||||
|
||||
/* Write LENGTH bytes of randomness starting at BUFFER. Return 0 on
|
||||
success or -1 on error. */
|
||||
int getentropy (void *__buffer, size_t __length) __wur
|
||||
__attr_access ((__write_only__, 1, 2));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SYS_RANDOM_H */
|
||||
38
board/mentalnet/overlay/usr/include/sys/raw.h
Normal file
38
board/mentalnet/overlay/usr/include/sys/raw.h
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
/* Copyright (C) 1999-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_RAW_H
|
||||
#define _SYS_RAW_H 1
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
/* The major device number for raw devices. */
|
||||
#define RAW_MAJOR 162
|
||||
|
||||
/* `ioctl' commands for raw devices. */
|
||||
#define RAW_SETBIND _IO(0xac, 0)
|
||||
#define RAW_GETBIND _IO(0xac, 1)
|
||||
|
||||
struct raw_config_request
|
||||
{
|
||||
int raw_minor;
|
||||
uint64_t block_major;
|
||||
uint64_t block_minor;
|
||||
};
|
||||
|
||||
#endif /* sys/raw.h */
|
||||
54
board/mentalnet/overlay/usr/include/sys/reboot.h
Normal file
54
board/mentalnet/overlay/usr/include/sys/reboot.h
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
/* Copyright (C) 1996-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* This file should define RB_* macros to be used as flag
|
||||
bits in the argument to the `reboot' system call. */
|
||||
|
||||
#ifndef _SYS_REBOOT_H
|
||||
#define _SYS_REBOOT_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
/* Perform a hard reset now. */
|
||||
#define RB_AUTOBOOT 0x01234567
|
||||
|
||||
/* Halt the system. */
|
||||
#define RB_HALT_SYSTEM 0xcdef0123
|
||||
|
||||
/* Enable reboot using Ctrl-Alt-Delete keystroke. */
|
||||
#define RB_ENABLE_CAD 0x89abcdef
|
||||
|
||||
/* Disable reboot using Ctrl-Alt-Delete keystroke. */
|
||||
#define RB_DISABLE_CAD 0
|
||||
|
||||
/* Stop system and switch power off if possible. */
|
||||
#define RB_POWER_OFF 0x4321fedc
|
||||
|
||||
/* Suspend system using software suspend. */
|
||||
#define RB_SW_SUSPEND 0xd000fce2
|
||||
|
||||
/* Reboot system into new kernel. */
|
||||
#define RB_KEXEC 0x45584543
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Reboot or halt the system. */
|
||||
extern int reboot (int __howto) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SYS_REBOOT_H */
|
||||
77
board/mentalnet/overlay/usr/include/sys/reg.h
Normal file
77
board/mentalnet/overlay/usr/include/sys/reg.h
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
/* Copyright (C) 2001-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_REG_H
|
||||
#define _SYS_REG_H 1
|
||||
|
||||
|
||||
#ifdef __x86_64__
|
||||
/* Index into an array of 8 byte longs returned from ptrace for
|
||||
location of the users' stored general purpose registers. */
|
||||
|
||||
# define R15 0
|
||||
# define R14 1
|
||||
# define R13 2
|
||||
# define R12 3
|
||||
# define RBP 4
|
||||
# define RBX 5
|
||||
# define R11 6
|
||||
# define R10 7
|
||||
# define R9 8
|
||||
# define R8 9
|
||||
# define RAX 10
|
||||
# define RCX 11
|
||||
# define RDX 12
|
||||
# define RSI 13
|
||||
# define RDI 14
|
||||
# define ORIG_RAX 15
|
||||
# define RIP 16
|
||||
# define CS 17
|
||||
# define EFLAGS 18
|
||||
# define RSP 19
|
||||
# define SS 20
|
||||
# define FS_BASE 21
|
||||
# define GS_BASE 22
|
||||
# define DS 23
|
||||
# define ES 24
|
||||
# define FS 25
|
||||
# define GS 26
|
||||
#else
|
||||
|
||||
/* Index into an array of 4 byte integers returned from ptrace for
|
||||
* location of the users' stored general purpose registers. */
|
||||
|
||||
# define EBX 0
|
||||
# define ECX 1
|
||||
# define EDX 2
|
||||
# define ESI 3
|
||||
# define EDI 4
|
||||
# define EBP 5
|
||||
# define EAX 6
|
||||
# define DS 7
|
||||
# define ES 8
|
||||
# define FS 9
|
||||
# define GS 10
|
||||
# define ORIG_EAX 11
|
||||
# define EIP 12
|
||||
# define CS 13
|
||||
# define EFL 14
|
||||
# define UESP 15
|
||||
# define SS 16
|
||||
#endif
|
||||
|
||||
#endif
|
||||
114
board/mentalnet/overlay/usr/include/sys/resource.h
Normal file
114
board/mentalnet/overlay/usr/include/sys/resource.h
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
/* Copyright (C) 1992-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_RESOURCE_H
|
||||
#define _SYS_RESOURCE_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
/* Get the system-dependent definitions of structures and bit values. */
|
||||
#include <bits/resource.h>
|
||||
|
||||
#ifndef __id_t_defined
|
||||
typedef __id_t id_t;
|
||||
# define __id_t_defined
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* The X/Open standard defines that all the functions below must use
|
||||
`int' as the type for the first argument. When we are compiling with
|
||||
GNU extensions we change this slightly to provide better error
|
||||
checking. */
|
||||
#if defined __USE_GNU && !defined __cplusplus
|
||||
typedef enum __rlimit_resource __rlimit_resource_t;
|
||||
typedef enum __rusage_who __rusage_who_t;
|
||||
typedef enum __priority_which __priority_which_t;
|
||||
#else
|
||||
typedef int __rlimit_resource_t;
|
||||
typedef int __rusage_who_t;
|
||||
typedef int __priority_which_t;
|
||||
#endif
|
||||
|
||||
/* Put the soft and hard limits for RESOURCE in *RLIMITS.
|
||||
Returns 0 if successful, -1 if not (and sets errno). */
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
extern int getrlimit (__rlimit_resource_t __resource,
|
||||
struct rlimit *__rlimits) __THROW __nonnull ((2));
|
||||
#else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (getrlimit, (__rlimit_resource_t __resource,
|
||||
struct rlimit *__rlimits), getrlimit64)
|
||||
__nonnull ((2));
|
||||
# else
|
||||
# define getrlimit getrlimit64
|
||||
# endif
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern int getrlimit64 (__rlimit_resource_t __resource,
|
||||
struct rlimit64 *__rlimits) __THROW __nonnull ((2));
|
||||
#endif
|
||||
|
||||
/* Set the soft and hard limits for RESOURCE to *RLIMITS.
|
||||
Only the super-user can increase hard limits.
|
||||
Return 0 if successful, -1 if not (and sets errno). */
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
extern int setrlimit (__rlimit_resource_t __resource,
|
||||
const struct rlimit *__rlimits) __THROW __nonnull ((2));
|
||||
#else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (setrlimit, (__rlimit_resource_t __resource,
|
||||
const struct rlimit *__rlimits),
|
||||
setrlimit64) __nonnull ((2));
|
||||
# else
|
||||
# define setrlimit setrlimit64
|
||||
# endif
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern int setrlimit64 (__rlimit_resource_t __resource,
|
||||
const struct rlimit64 *__rlimits) __THROW
|
||||
__nonnull ((2));
|
||||
#endif
|
||||
|
||||
/* Return resource usage information on process indicated by WHO
|
||||
and put it in *USAGE. Returns 0 for success, -1 for failure. */
|
||||
extern int getrusage (__rusage_who_t __who, struct rusage *__usage) __THROW;
|
||||
|
||||
#ifdef __USE_TIME64_REDIRECTS
|
||||
# if defined(__REDIRECT_NTH)
|
||||
extern int __REDIRECT_NTH (getrusage, (__rusage_who_t __who,
|
||||
struct rusage *__usage),
|
||||
__getrusage64);
|
||||
# else
|
||||
# define getrusage __getrusage64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Return the highest priority of any process specified by WHICH and WHO
|
||||
(see above); if WHO is zero, the current process, process group, or user
|
||||
(as specified by WHO) is used. A lower priority number means higher
|
||||
priority. Priorities range from PRIO_MIN to PRIO_MAX (above). */
|
||||
extern int getpriority (__priority_which_t __which, id_t __who) __THROW;
|
||||
|
||||
/* Set the priority of all processes specified by WHICH and WHO (see above)
|
||||
to PRIO. Returns 0 on success, -1 on errors. */
|
||||
extern int setpriority (__priority_which_t __which, id_t __who, int __prio)
|
||||
__THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/resource.h */
|
||||
180
board/mentalnet/overlay/usr/include/sys/rseq.h
Normal file
180
board/mentalnet/overlay/usr/include/sys/rseq.h
Normal file
|
|
@ -0,0 +1,180 @@
|
|||
/* Restartable Sequences exported symbols. Linux header.
|
||||
Copyright (C) 2021-2025 Free Software Foundation, Inc.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_RSEQ_H
|
||||
#define _SYS_RSEQ_H 1
|
||||
|
||||
/* Architecture-specific rseq signature. */
|
||||
#include <bits/rseq.h>
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#ifdef __has_include
|
||||
# if __has_include ("linux/rseq.h")
|
||||
# define __GLIBC_HAVE_KERNEL_RSEQ
|
||||
# endif
|
||||
#else
|
||||
# include <linux/version.h>
|
||||
# if LINUX_VERSION_CODE >= KERNEL_VERSION (4, 18, 0)
|
||||
# define __GLIBC_HAVE_KERNEL_RSEQ
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __GLIBC_HAVE_KERNEL_RSEQ
|
||||
/* We use the structures declarations from the kernel headers. */
|
||||
# include <linux/rseq.h>
|
||||
#else /* __GLIBC_HAVE_KERNEL_RSEQ */
|
||||
/* We use a copy of the include/uapi/linux/rseq.h kernel header. */
|
||||
|
||||
enum rseq_cpu_id_state
|
||||
{
|
||||
RSEQ_CPU_ID_UNINITIALIZED = -1,
|
||||
RSEQ_CPU_ID_REGISTRATION_FAILED = -2,
|
||||
};
|
||||
|
||||
enum rseq_flags
|
||||
{
|
||||
RSEQ_FLAG_UNREGISTER = (1 << 0),
|
||||
};
|
||||
|
||||
enum rseq_cs_flags_bit
|
||||
{
|
||||
RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT_BIT = 0,
|
||||
RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL_BIT = 1,
|
||||
RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE_BIT = 2,
|
||||
};
|
||||
|
||||
enum rseq_cs_flags
|
||||
{
|
||||
RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT =
|
||||
(1U << RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT_BIT),
|
||||
RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL =
|
||||
(1U << RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL_BIT),
|
||||
RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE =
|
||||
(1U << RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE_BIT),
|
||||
};
|
||||
|
||||
/* struct rseq_cs is aligned on 32 bytes to ensure it is always
|
||||
contained within a single cache-line. It is usually declared as
|
||||
link-time constant data. */
|
||||
struct rseq_cs
|
||||
{
|
||||
/* Version of this structure. */
|
||||
uint32_t version;
|
||||
/* enum rseq_cs_flags. */
|
||||
uint32_t flags;
|
||||
uint64_t start_ip;
|
||||
/* Offset from start_ip. */
|
||||
uint64_t post_commit_offset;
|
||||
uint64_t abort_ip;
|
||||
} __attribute__ ((__aligned__ (32)));
|
||||
|
||||
/* struct rseq is aligned on 32 bytes to ensure it is always
|
||||
contained within a single cache-line.
|
||||
|
||||
A single struct rseq per thread is allowed. */
|
||||
struct rseq
|
||||
{
|
||||
/* Restartable sequences cpu_id_start field. Updated by the
|
||||
kernel. Read by user-space with single-copy atomicity
|
||||
semantics. This field should only be read by the thread which
|
||||
registered this data structure. Aligned on 32-bit. Always
|
||||
contains a value in the range of possible CPUs, although the
|
||||
value may not be the actual current CPU (e.g. if rseq is not
|
||||
initialized). This CPU number value should always be compared
|
||||
against the value of the cpu_id field before performing a rseq
|
||||
commit or returning a value read from a data structure indexed
|
||||
using the cpu_id_start value. */
|
||||
uint32_t cpu_id_start;
|
||||
/* Restartable sequences cpu_id field. Updated by the kernel.
|
||||
Read by user-space with single-copy atomicity semantics. This
|
||||
field should only be read by the thread which registered this
|
||||
data structure. Aligned on 32-bit. Values
|
||||
RSEQ_CPU_ID_UNINITIALIZED and RSEQ_CPU_ID_REGISTRATION_FAILED
|
||||
have a special semantic: the former means "rseq uninitialized",
|
||||
and latter means "rseq initialization failed". This value is
|
||||
meant to be read within rseq critical sections and compared
|
||||
with the cpu_id_start value previously read, before performing
|
||||
the commit instruction, or read and compared with the
|
||||
cpu_id_start value before returning a value loaded from a data
|
||||
structure indexed using the cpu_id_start value. */
|
||||
uint32_t cpu_id;
|
||||
/* Restartable sequences rseq_cs field.
|
||||
|
||||
Contains NULL when no critical section is active for the current
|
||||
thread, or holds a pointer to the currently active struct rseq_cs.
|
||||
|
||||
Updated by user-space, which sets the address of the currently
|
||||
active rseq_cs at the beginning of assembly instruction sequence
|
||||
block, and set to NULL by the kernel when it restarts an assembly
|
||||
instruction sequence block, as well as when the kernel detects that
|
||||
it is preempting or delivering a signal outside of the range
|
||||
targeted by the rseq_cs. Also needs to be set to NULL by user-space
|
||||
before reclaiming memory that contains the targeted struct rseq_cs.
|
||||
|
||||
Read and set by the kernel. Set by user-space with single-copy
|
||||
atomicity semantics. This field should only be updated by the
|
||||
thread which registered this data structure. Aligned on 64-bit.
|
||||
|
||||
32-bit architectures should update the low order bits of the
|
||||
rseq_cs field, leaving the high order bits initialized to 0. */
|
||||
uint64_t rseq_cs;
|
||||
/* Restartable sequences flags field.
|
||||
|
||||
This field should only be updated by the thread which
|
||||
registered this data structure. Read by the kernel.
|
||||
Mainly used for single-stepping through rseq critical sections
|
||||
with debuggers.
|
||||
|
||||
- RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT
|
||||
Inhibit instruction sequence block restart on preemption
|
||||
for this thread.
|
||||
- RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL
|
||||
Inhibit instruction sequence block restart on signal
|
||||
delivery for this thread.
|
||||
- RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE
|
||||
Inhibit instruction sequence block restart on migration for
|
||||
this thread. */
|
||||
uint32_t flags;
|
||||
/* Restartable sequences node_id field. Updated by the kernel. Read by
|
||||
user-space with single-copy atomicity semantics. This field should only
|
||||
be read by the thread which registered this data structure. Aligned on
|
||||
32-bit. Contains the current NUMA node ID. */
|
||||
uint32_t node_id;
|
||||
/* Restartable sequences mm_cid field. Updated by the kernel. Read by
|
||||
user-space with single-copy atomicity semantics. This field should only
|
||||
be read by the thread which registered this data structure. Aligned on
|
||||
32-bit. Contains the current thread's concurrency ID (allocated
|
||||
uniquely within a memory map). */
|
||||
uint32_t mm_cid;
|
||||
} __attribute__ ((__aligned__ (32)));
|
||||
|
||||
#endif /* __GLIBC_HAVE_KERNEL_RSEQ */
|
||||
|
||||
/* Offset from the thread pointer to the rseq area. */
|
||||
extern const ptrdiff_t __rseq_offset;
|
||||
|
||||
/* Size of the registered rseq area. 0 if the registration was
|
||||
unsuccessful. */
|
||||
extern const unsigned int __rseq_size;
|
||||
|
||||
/* Flags used during rseq registration. */
|
||||
extern const unsigned int __rseq_flags;
|
||||
|
||||
#endif /* sys/rseq.h */
|
||||
155
board/mentalnet/overlay/usr/include/sys/select.h
Normal file
155
board/mentalnet/overlay/usr/include/sys/select.h
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
/* `fd_set' type and related macros, and `select'/`pselect' declarations.
|
||||
Copyright (C) 1996-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* POSIX 1003.1g: 6.2 Select from File Descriptor Sets <sys/select.h> */
|
||||
|
||||
#ifndef _SYS_SELECT_H
|
||||
#define _SYS_SELECT_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
/* Get definition of needed basic types. */
|
||||
#include <bits/types.h>
|
||||
|
||||
/* Get __FD_* definitions. */
|
||||
#include <bits/select.h>
|
||||
|
||||
/* Get sigset_t. */
|
||||
#include <bits/types/sigset_t.h>
|
||||
|
||||
/* Get definition of timer specification structures. */
|
||||
#include <bits/types/time_t.h>
|
||||
#include <bits/types/struct_timeval.h>
|
||||
#ifdef __USE_XOPEN2K
|
||||
# include <bits/types/struct_timespec.h>
|
||||
#endif
|
||||
|
||||
#ifndef __suseconds_t_defined
|
||||
typedef __suseconds_t suseconds_t;
|
||||
# define __suseconds_t_defined
|
||||
#endif
|
||||
|
||||
|
||||
/* The fd_set member is required to be an array of longs. */
|
||||
typedef long int __fd_mask;
|
||||
|
||||
/* Some versions of <linux/posix_types.h> define this macros. */
|
||||
#undef __NFDBITS
|
||||
/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */
|
||||
#define __NFDBITS (8 * (int) sizeof (__fd_mask))
|
||||
#define __FD_ELT(d) ((d) / __NFDBITS)
|
||||
#define __FD_MASK(d) ((__fd_mask) (1UL << ((d) % __NFDBITS)))
|
||||
|
||||
/* fd_set for select and pselect. */
|
||||
typedef struct
|
||||
{
|
||||
/* XPG4.2 requires this member name. Otherwise avoid the name
|
||||
from the global namespace. */
|
||||
#ifdef __USE_XOPEN
|
||||
__fd_mask fds_bits[__FD_SETSIZE / __NFDBITS];
|
||||
# define __FDS_BITS(set) ((set)->fds_bits)
|
||||
#else
|
||||
__fd_mask __fds_bits[__FD_SETSIZE / __NFDBITS];
|
||||
# define __FDS_BITS(set) ((set)->__fds_bits)
|
||||
#endif
|
||||
} fd_set;
|
||||
|
||||
/* Maximum number of file descriptors in `fd_set'. */
|
||||
#define FD_SETSIZE __FD_SETSIZE
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* Sometimes the fd_set member is assumed to have this type. */
|
||||
typedef __fd_mask fd_mask;
|
||||
|
||||
/* Number of bits per word of `fd_set' (some code assumes this is 32). */
|
||||
# define NFDBITS __NFDBITS
|
||||
#endif
|
||||
|
||||
|
||||
/* Access macros for `fd_set'. */
|
||||
#define FD_SET(fd, fdsetp) __FD_SET (fd, fdsetp)
|
||||
#define FD_CLR(fd, fdsetp) __FD_CLR (fd, fdsetp)
|
||||
#define FD_ISSET(fd, fdsetp) __FD_ISSET (fd, fdsetp)
|
||||
#define FD_ZERO(fdsetp) __FD_ZERO (fdsetp)
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Check the first NFDS descriptors each in READFDS (if not NULL) for read
|
||||
readiness, in WRITEFDS (if not NULL) for write readiness, and in EXCEPTFDS
|
||||
(if not NULL) for exceptional conditions. If TIMEOUT is not NULL, time out
|
||||
after waiting the interval specified therein. Returns the number of ready
|
||||
descriptors, or -1 for errors.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
#ifndef __USE_TIME64_REDIRECTS
|
||||
extern int select (int __nfds, fd_set *__restrict __readfds,
|
||||
fd_set *__restrict __writefds,
|
||||
fd_set *__restrict __exceptfds,
|
||||
struct timeval *__restrict __timeout);
|
||||
#else
|
||||
# ifdef __REDIRECT
|
||||
extern int __REDIRECT (select,
|
||||
(int __nfds, fd_set *__restrict __readfds,
|
||||
fd_set *__restrict __writefds,
|
||||
fd_set *__restrict __exceptfds,
|
||||
struct timeval *__restrict __timeout),
|
||||
__select64);
|
||||
# else
|
||||
# define select __select64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __USE_XOPEN2K
|
||||
/* Same as above only that the TIMEOUT value is given with higher
|
||||
resolution and a sigmask which is been set temporarily. This version
|
||||
should be used.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
extern int pselect (int __nfds, fd_set *__restrict __readfds,
|
||||
fd_set *__restrict __writefds,
|
||||
fd_set *__restrict __exceptfds,
|
||||
const struct timespec *__restrict __timeout,
|
||||
const __sigset_t *__restrict __sigmask);
|
||||
# else
|
||||
# ifdef __REDIRECT
|
||||
extern int __REDIRECT (pselect,
|
||||
(int __nfds, fd_set *__restrict __readfds,
|
||||
fd_set *__restrict __writefds,
|
||||
fd_set *__restrict __exceptfds,
|
||||
const struct timespec *__restrict __timeout,
|
||||
const __sigset_t *__restrict __sigmask),
|
||||
__pselect64);
|
||||
# else
|
||||
# define pselect __pselect64
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Define some inlines helping to catch common problems. */
|
||||
#if __USE_FORTIFY_LEVEL > 0 && defined __GNUC__
|
||||
# include <bits/select2.h>
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/select.h */
|
||||
88
board/mentalnet/overlay/usr/include/sys/sem.h
Normal file
88
board/mentalnet/overlay/usr/include/sys/sem.h
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
/* Copyright (C) 1995-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_SEM_H
|
||||
#define _SYS_SEM_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#define __need_size_t
|
||||
#include <stddef.h>
|
||||
|
||||
/* Get common definition of System V style IPC. */
|
||||
#include <sys/ipc.h>
|
||||
|
||||
/* Get system dependent definition of `struct semid_ds' and more. */
|
||||
#include <bits/sem.h>
|
||||
|
||||
#ifdef __USE_GNU
|
||||
# include <bits/types/struct_timespec.h>
|
||||
#endif
|
||||
|
||||
/* The following System V style IPC functions implement a semaphore
|
||||
handling. The definition is found in XPG2. */
|
||||
|
||||
/* Structure used for argument to `semop' to describe operations. */
|
||||
struct sembuf
|
||||
{
|
||||
unsigned short int sem_num; /* semaphore number */
|
||||
short int sem_op; /* semaphore operation */
|
||||
short int sem_flg; /* operation flag */
|
||||
};
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Semaphore control operation. */
|
||||
#ifndef __USE_TIME64_REDIRECTS
|
||||
extern int semctl (int __semid, int __semnum, int __cmd, ...) __THROW;
|
||||
#else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (semctl,
|
||||
(int __semid, int __semnum, int __cmd, ...),
|
||||
__semctl64);
|
||||
# else
|
||||
# define semctl __semctl64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Get semaphore. */
|
||||
extern int semget (key_t __key, int __nsems, int __semflg) __THROW;
|
||||
|
||||
/* Operate on semaphore. */
|
||||
extern int semop (int __semid, struct sembuf *__sops, size_t __nsops) __THROW;
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Operate on semaphore with timeout. */
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
extern int semtimedop (int __semid, struct sembuf *__sops, size_t __nsops,
|
||||
const struct timespec *__timeout) __THROW;
|
||||
# else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (semtimedop, (int __semid, struct sembuf *__sops,
|
||||
size_t __nsops,
|
||||
const struct timespec *__timeout),
|
||||
__semtimedop64);
|
||||
# else
|
||||
# define semtimedop __semtimedop64
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/sem.h */
|
||||
51
board/mentalnet/overlay/usr/include/sys/sendfile.h
Normal file
51
board/mentalnet/overlay/usr/include/sys/sendfile.h
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
/* sendfile -- copy data directly from one file descriptor to another
|
||||
Copyright (C) 1998-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_SENDFILE_H
|
||||
#define _SYS_SENDFILE_H 1
|
||||
|
||||
#include <features.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Send up to COUNT bytes from file associated with IN_FD starting at
|
||||
*OFFSET to descriptor OUT_FD. Set *OFFSET to the IN_FD's file position
|
||||
following the read bytes. If OFFSET is a null pointer, use the normal
|
||||
file position instead. Return the number of written bytes, or -1 in
|
||||
case of error. */
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
extern ssize_t sendfile (int __out_fd, int __in_fd, off_t *__offset,
|
||||
size_t __count) __THROW;
|
||||
#else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern ssize_t __REDIRECT_NTH (sendfile,
|
||||
(int __out_fd, int __in_fd, __off64_t *__offset,
|
||||
size_t __count), sendfile64);
|
||||
# else
|
||||
# define sendfile sendfile64
|
||||
# endif
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern ssize_t sendfile64 (int __out_fd, int __in_fd, __off64_t *__offset,
|
||||
size_t __count) __THROW;
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/sendfile.h */
|
||||
73
board/mentalnet/overlay/usr/include/sys/shm.h
Normal file
73
board/mentalnet/overlay/usr/include/sys/shm.h
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
/* Copyright (C) 1995-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_SHM_H
|
||||
#define _SYS_SHM_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#define __need_size_t
|
||||
#include <stddef.h>
|
||||
|
||||
/* Get common definition of System V style IPC. */
|
||||
#include <sys/ipc.h>
|
||||
|
||||
/* Get system dependent definition of `struct shmid_ds' and more. */
|
||||
#include <bits/shm.h>
|
||||
|
||||
/* Define types required by the standard. */
|
||||
#include <bits/types/time_t.h>
|
||||
|
||||
#ifdef __USE_XOPEN
|
||||
# ifndef __pid_t_defined
|
||||
typedef __pid_t pid_t;
|
||||
# define __pid_t_defined
|
||||
# endif
|
||||
#endif /* X/Open */
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* The following System V style IPC functions implement a shared memory
|
||||
facility. The definition is found in XPG4.2. */
|
||||
|
||||
/* Shared memory control operation. */
|
||||
#ifndef __USE_TIME64_REDIRECTS
|
||||
extern int shmctl (int __shmid, int __cmd, struct shmid_ds *__buf) __THROW;
|
||||
#else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (shmctl,
|
||||
(int __shmid, int __cmd, struct shmid_ds *__buf),
|
||||
__shmctl64);
|
||||
# else
|
||||
# define shmctl __shmctl64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Get shared memory segment. */
|
||||
extern int shmget (key_t __key, size_t __size, int __shmflg) __THROW;
|
||||
|
||||
/* Attach shared memory segment. */
|
||||
extern void *shmat (int __shmid, const void *__shmaddr, int __shmflg)
|
||||
__THROW;
|
||||
|
||||
/* Detach shared memory segment. */
|
||||
extern int shmdt (const void *__shmaddr) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/shm.h */
|
||||
1
board/mentalnet/overlay/usr/include/sys/signal.h
Normal file
1
board/mentalnet/overlay/usr/include/sys/signal.h
Normal file
|
|
@ -0,0 +1 @@
|
|||
#include <signal.h>
|
||||
62
board/mentalnet/overlay/usr/include/sys/signalfd.h
Normal file
62
board/mentalnet/overlay/usr/include/sys/signalfd.h
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
/* Copyright (C) 2007-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_SIGNALFD_H
|
||||
#define _SYS_SIGNALFD_H 1
|
||||
|
||||
#include <stdint.h>
|
||||
#include <bits/types/sigset_t.h>
|
||||
|
||||
/* Get the platform-dependent flags. */
|
||||
#include <bits/signalfd.h>
|
||||
|
||||
struct signalfd_siginfo
|
||||
{
|
||||
uint32_t ssi_signo;
|
||||
int32_t ssi_errno;
|
||||
int32_t ssi_code;
|
||||
uint32_t ssi_pid;
|
||||
uint32_t ssi_uid;
|
||||
int32_t ssi_fd;
|
||||
uint32_t ssi_tid;
|
||||
uint32_t ssi_band;
|
||||
uint32_t ssi_overrun;
|
||||
uint32_t ssi_trapno;
|
||||
int32_t ssi_status;
|
||||
int32_t ssi_int;
|
||||
uint64_t ssi_ptr;
|
||||
uint64_t ssi_utime;
|
||||
uint64_t ssi_stime;
|
||||
uint64_t ssi_addr;
|
||||
uint16_t ssi_addr_lsb;
|
||||
uint16_t __pad2;
|
||||
int32_t ssi_syscall;
|
||||
uint64_t ssi_call_addr;
|
||||
uint32_t ssi_arch;
|
||||
uint8_t __pad[28];
|
||||
};
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Request notification for delivery of signals in MASK to be
|
||||
performed using descriptor FD.*/
|
||||
extern int signalfd (int __fd, const sigset_t *__mask, int __flags)
|
||||
__THROW __nonnull ((2));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/signalfd.h */
|
||||
33
board/mentalnet/overlay/usr/include/sys/single_threaded.h
Normal file
33
board/mentalnet/overlay/usr/include/sys/single_threaded.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/* Support for single-thread optimizations.
|
||||
Copyright (C) 2020-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_SINGLE_THREADED_H
|
||||
#define _SYS_SINGLE_THREADED_H
|
||||
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* If this variable is non-zero, then the current thread is the only
|
||||
thread in the process image. If it is zero, the process might be
|
||||
multi-threaded. */
|
||||
extern char __libc_single_threaded;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SYS_SINGLE_THREADED_H */
|
||||
348
board/mentalnet/overlay/usr/include/sys/socket.h
Normal file
348
board/mentalnet/overlay/usr/include/sys/socket.h
Normal file
|
|
@ -0,0 +1,348 @@
|
|||
/* Declarations of socket constants, types, and functions.
|
||||
Copyright (C) 1991-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_SOCKET_H
|
||||
#define _SYS_SOCKET_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#include <bits/types/struct_iovec.h>
|
||||
#define __need_size_t
|
||||
#include <stddef.h>
|
||||
|
||||
/* This operating system-specific header file defines the SOCK_*, PF_*,
|
||||
AF_*, MSG_*, SOL_*, and SO_* constants, and the `struct sockaddr',
|
||||
`struct msghdr', and `struct linger' types. */
|
||||
#include <bits/socket.h>
|
||||
|
||||
#ifdef __USE_MISC
|
||||
# include <bits/types/struct_osockaddr.h>
|
||||
#endif
|
||||
|
||||
/* The following constants should be used for the second parameter of
|
||||
`shutdown'. */
|
||||
enum
|
||||
{
|
||||
SHUT_RD = 0, /* No more receptions. */
|
||||
#define SHUT_RD SHUT_RD
|
||||
SHUT_WR, /* No more transmissions. */
|
||||
#define SHUT_WR SHUT_WR
|
||||
SHUT_RDWR /* No more receptions or transmissions. */
|
||||
#define SHUT_RDWR SHUT_RDWR
|
||||
};
|
||||
|
||||
/* This is the type we use for generic socket address arguments.
|
||||
|
||||
With GCC 2.7 and later, the funky union causes redeclarations or
|
||||
uses with any of the listed types to be allowed without complaint.
|
||||
G++ 2.7 does not support transparent unions so there we want the
|
||||
old-style declaration, too. */
|
||||
#if defined __cplusplus || !__GNUC_PREREQ (2, 7) || !defined __USE_GNU
|
||||
# define __SOCKADDR_ARG struct sockaddr *__restrict
|
||||
# define __CONST_SOCKADDR_ARG const struct sockaddr *
|
||||
#else
|
||||
/* Add more `struct sockaddr_AF' types here as necessary.
|
||||
These are all the ones I found on NetBSD and Linux. */
|
||||
# define __SOCKADDR_ALLTYPES \
|
||||
__SOCKADDR_ONETYPE (sockaddr) \
|
||||
__SOCKADDR_ONETYPE (sockaddr_at) \
|
||||
__SOCKADDR_ONETYPE (sockaddr_ax25) \
|
||||
__SOCKADDR_ONETYPE (sockaddr_dl) \
|
||||
__SOCKADDR_ONETYPE (sockaddr_eon) \
|
||||
__SOCKADDR_ONETYPE (sockaddr_in) \
|
||||
__SOCKADDR_ONETYPE (sockaddr_in6) \
|
||||
__SOCKADDR_ONETYPE (sockaddr_inarp) \
|
||||
__SOCKADDR_ONETYPE (sockaddr_ipx) \
|
||||
__SOCKADDR_ONETYPE (sockaddr_iso) \
|
||||
__SOCKADDR_ONETYPE (sockaddr_ns) \
|
||||
__SOCKADDR_ONETYPE (sockaddr_un) \
|
||||
__SOCKADDR_ONETYPE (sockaddr_x25)
|
||||
|
||||
# define __SOCKADDR_ONETYPE(type) struct type *__restrict __##type##__;
|
||||
typedef union { __SOCKADDR_ALLTYPES
|
||||
} __SOCKADDR_ARG __attribute__ ((__transparent_union__));
|
||||
# undef __SOCKADDR_ONETYPE
|
||||
# define __SOCKADDR_ONETYPE(type) const struct type *__restrict __##type##__;
|
||||
typedef union { __SOCKADDR_ALLTYPES
|
||||
} __CONST_SOCKADDR_ARG __attribute__ ((__transparent_union__));
|
||||
# undef __SOCKADDR_ONETYPE
|
||||
#endif
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* For `recvmmsg' and `sendmmsg'. */
|
||||
struct mmsghdr
|
||||
{
|
||||
struct msghdr msg_hdr; /* Actual message header. */
|
||||
unsigned int msg_len; /* Number of received or sent bytes for the
|
||||
entry. */
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
/* Create a new socket of type TYPE in domain DOMAIN, using
|
||||
protocol PROTOCOL. If PROTOCOL is zero, one is chosen automatically.
|
||||
Returns a file descriptor for the new socket, or -1 for errors. */
|
||||
extern int socket (int __domain, int __type, int __protocol) __THROW;
|
||||
|
||||
/* Create two new sockets, of type TYPE in domain DOMAIN and using
|
||||
protocol PROTOCOL, which are connected to each other, and put file
|
||||
descriptors for them in FDS[0] and FDS[1]. If PROTOCOL is zero,
|
||||
one will be chosen automatically. Returns 0 on success, -1 for errors. */
|
||||
extern int socketpair (int __domain, int __type, int __protocol,
|
||||
int __fds[2]) __THROW;
|
||||
|
||||
/* Give the socket FD the local address ADDR (which is LEN bytes long). */
|
||||
extern int bind (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len)
|
||||
__THROW;
|
||||
|
||||
/* Put the local address of FD into *ADDR and its length in *LEN. */
|
||||
extern int getsockname (int __fd, __SOCKADDR_ARG __addr,
|
||||
socklen_t *__restrict __len) __THROW;
|
||||
|
||||
/* Open a connection on socket FD to peer at ADDR (which LEN bytes long).
|
||||
For connectionless socket types, just set the default address to send to
|
||||
and the only address from which to accept transmissions.
|
||||
Return 0 on success, -1 for errors.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern int connect (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len);
|
||||
|
||||
/* Put the address of the peer connected to socket FD into *ADDR
|
||||
(which is *LEN bytes long), and its actual length into *LEN. */
|
||||
extern int getpeername (int __fd, __SOCKADDR_ARG __addr,
|
||||
socklen_t *__restrict __len) __THROW;
|
||||
|
||||
|
||||
/* Send N bytes of BUF to socket FD. Returns the number sent or -1.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern ssize_t send (int __fd, const void *__buf, size_t __n, int __flags);
|
||||
|
||||
/* Read N bytes into BUF from socket FD.
|
||||
Returns the number read or -1 for errors.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern ssize_t recv (int __fd, void *__buf, size_t __n, int __flags);
|
||||
|
||||
/* Send N bytes of BUF on socket FD to peer at address ADDR (which is
|
||||
ADDR_LEN bytes long). Returns the number sent, or -1 for errors.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern ssize_t sendto (int __fd, const void *__buf, size_t __n,
|
||||
int __flags, __CONST_SOCKADDR_ARG __addr,
|
||||
socklen_t __addr_len);
|
||||
|
||||
/* Read N bytes into BUF through socket FD.
|
||||
If ADDR is not NULL, fill in *ADDR_LEN bytes of it with the address of
|
||||
the sender, and store the actual size of the address in *ADDR_LEN.
|
||||
Returns the number of bytes read or -1 for errors.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern ssize_t recvfrom (int __fd, void *__restrict __buf, size_t __n,
|
||||
int __flags, __SOCKADDR_ARG __addr,
|
||||
socklen_t *__restrict __addr_len);
|
||||
|
||||
|
||||
/* Send a message described MESSAGE on socket FD.
|
||||
Returns the number of bytes sent, or -1 for errors.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
#ifndef __USE_TIME64_REDIRECTS
|
||||
extern ssize_t sendmsg (int __fd, const struct msghdr *__message,
|
||||
int __flags);
|
||||
#else
|
||||
# ifdef __REDIRECT
|
||||
extern ssize_t __REDIRECT (sendmsg, (int __fd, const struct msghdr *__message,
|
||||
int __flags),
|
||||
__sendmsg64);
|
||||
# else
|
||||
extern ssize_t __sendmsg64 (int __fd, const struct msghdr *__message,
|
||||
int __flags);
|
||||
# define sendmsg __sendmsg64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Send a VLEN messages as described by VMESSAGES to socket FD.
|
||||
Returns the number of datagrams successfully written or -1 for errors.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
extern int sendmmsg (int __fd, struct mmsghdr *__vmessages,
|
||||
unsigned int __vlen, int __flags);
|
||||
# else
|
||||
# ifdef __REDIRECT
|
||||
extern int __REDIRECT (sendmmsg, (int __fd, struct mmsghdr *__vmessages,
|
||||
unsigned int __vlen, int __flags),
|
||||
__sendmmsg64);
|
||||
# else
|
||||
extern int __sendmmsg64 (int __fd, struct mmsghdr *__vmessages,
|
||||
unsigned int __vlen, int __flags);
|
||||
# define sendmmsg __sendmmsg64
|
||||
# endif
|
||||
# endif /* __USE_TIME64_REDIRECTS */
|
||||
#endif /* __USE_GNU */
|
||||
|
||||
/* Receive a message as described by MESSAGE from socket FD.
|
||||
Returns the number of bytes read or -1 for errors.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
#ifndef __USE_TIME64_REDIRECTS
|
||||
extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags);
|
||||
#else
|
||||
# ifdef __REDIRECT
|
||||
extern ssize_t __REDIRECT (recvmsg,
|
||||
(int __fd, struct msghdr *__message, int __flags),
|
||||
__recvmsg64);
|
||||
# else
|
||||
extern ssize_t __recvmsg64 (int __fd, struct msghdr *__message, int __flags);
|
||||
# define recvmsg __recvmsg64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Receive up to VLEN messages as described by VMESSAGES from socket FD.
|
||||
Returns the number of messages received or -1 for errors.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
extern int recvmmsg (int __fd, struct mmsghdr *__vmessages,
|
||||
unsigned int __vlen, int __flags,
|
||||
struct timespec *__tmo);
|
||||
# else
|
||||
# ifdef __REDIRECT
|
||||
extern int __REDIRECT (recvmmsg, (int __fd, struct mmsghdr *__vmessages,
|
||||
unsigned int __vlen, int __flags,
|
||||
struct timespec *__tmo),
|
||||
__recvmmsg64);
|
||||
# else
|
||||
# define recvmmsg __recvmmsg64
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Put the current value for socket FD's option OPTNAME at protocol level LEVEL
|
||||
into OPTVAL (which is *OPTLEN bytes long), and set *OPTLEN to the value's
|
||||
actual length. Returns 0 on success, -1 for errors. */
|
||||
#ifndef __USE_TIME64_REDIRECTS
|
||||
extern int getsockopt (int __fd, int __level, int __optname,
|
||||
void *__restrict __optval,
|
||||
socklen_t *__restrict __optlen) __THROW;
|
||||
#else
|
||||
# ifdef __REDIRECT
|
||||
extern int __REDIRECT_NTH (getsockopt,
|
||||
(int __fd, int __level, int __optname,
|
||||
void *__restrict __optval,
|
||||
socklen_t *__restrict __optlen),
|
||||
__getsockopt64);
|
||||
# else
|
||||
extern int __getsockopt64 (int __fd, int __level, int __optname,
|
||||
void *__restrict __optval,
|
||||
socklen_t *__restrict __optlen) __THROW;
|
||||
# define getsockopt __getsockopt64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Set socket FD's option OPTNAME at protocol level LEVEL
|
||||
to *OPTVAL (which is OPTLEN bytes long).
|
||||
Returns 0 on success, -1 for errors. */
|
||||
#ifndef __USE_TIME64_REDIRECTS
|
||||
extern int setsockopt (int __fd, int __level, int __optname,
|
||||
const void *__optval, socklen_t __optlen) __THROW;
|
||||
#else
|
||||
# ifdef __REDIRECT
|
||||
extern int __REDIRECT_NTH (setsockopt,
|
||||
(int __fd, int __level, int __optname,
|
||||
const void *__optval, socklen_t __optlen),
|
||||
__setsockopt64);
|
||||
# else
|
||||
extern int __setsockopt64 (int __fd, int __level, int __optname,
|
||||
const void *__optval, socklen_t __optlen) __THROW;
|
||||
# define setsockopt __setsockopt64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Prepare to accept connections on socket FD.
|
||||
N connection requests will be queued before further requests are refused.
|
||||
Returns 0 on success, -1 for errors. */
|
||||
extern int listen (int __fd, int __n) __THROW;
|
||||
|
||||
/* Await a connection on socket FD.
|
||||
When a connection arrives, open a new socket to communicate with it,
|
||||
set *ADDR (which is *ADDR_LEN bytes long) to the address of the connecting
|
||||
peer and *ADDR_LEN to the address's actual length, and return the
|
||||
new socket's descriptor, or -1 for errors.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern int accept (int __fd, __SOCKADDR_ARG __addr,
|
||||
socklen_t *__restrict __addr_len);
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Similar to 'accept' but takes an additional parameter to specify flags.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern int accept4 (int __fd, __SOCKADDR_ARG __addr,
|
||||
socklen_t *__restrict __addr_len, int __flags);
|
||||
#endif
|
||||
|
||||
/* Shut down all or part of the connection open on socket FD.
|
||||
HOW determines what to shut down:
|
||||
SHUT_RD = No more receptions;
|
||||
SHUT_WR = No more transmissions;
|
||||
SHUT_RDWR = No more receptions or transmissions.
|
||||
Returns 0 on success, -1 for errors. */
|
||||
extern int shutdown (int __fd, int __how) __THROW;
|
||||
|
||||
|
||||
#ifdef __USE_XOPEN2K
|
||||
/* Determine whether socket is at a out-of-band mark. */
|
||||
extern int sockatmark (int __fd) __THROW;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* FDTYPE is S_IFSOCK or another S_IF* macro defined in <sys/stat.h>;
|
||||
returns 1 if FD is open on an object of the indicated type, 0 if not,
|
||||
or -1 for errors (setting errno). */
|
||||
extern int isfdtype (int __fd, int __fdtype) __THROW;
|
||||
#endif
|
||||
|
||||
|
||||
/* Define some macros helping to catch buffer overflows. */
|
||||
#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
|
||||
# include <bits/socket2.h>
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/socket.h */
|
||||
3
board/mentalnet/overlay/usr/include/sys/socketvar.h
Normal file
3
board/mentalnet/overlay/usr/include/sys/socketvar.h
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
/* This header is used on many systems but for GNU we have everything
|
||||
already defined in the standard header. */
|
||||
#include <sys/socket.h>
|
||||
1
board/mentalnet/overlay/usr/include/sys/soundcard.h
Normal file
1
board/mentalnet/overlay/usr/include/sys/soundcard.h
Normal file
|
|
@ -0,0 +1 @@
|
|||
#include <linux/soundcard.h>
|
||||
471
board/mentalnet/overlay/usr/include/sys/stat.h
Normal file
471
board/mentalnet/overlay/usr/include/sys/stat.h
Normal file
|
|
@ -0,0 +1,471 @@
|
|||
/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
/*
|
||||
* POSIX Standard: 5.6 File Characteristics <sys/stat.h>
|
||||
*/
|
||||
|
||||
#ifndef _SYS_STAT_H
|
||||
#define _SYS_STAT_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#include <bits/types.h> /* For __mode_t and __dev_t. */
|
||||
|
||||
#if defined(__USE_ATFILE) || defined(__USE_XOPEN2K8)
|
||||
# include <bits/types/struct_timespec.h>
|
||||
#endif
|
||||
|
||||
#if defined __USE_XOPEN || defined __USE_XOPEN2K
|
||||
/* The Single Unix specification says that some more types are
|
||||
available here. */
|
||||
|
||||
# include <bits/types/time_t.h>
|
||||
|
||||
# ifndef __dev_t_defined
|
||||
typedef __dev_t dev_t;
|
||||
# define __dev_t_defined
|
||||
# endif
|
||||
|
||||
# ifndef __gid_t_defined
|
||||
typedef __gid_t gid_t;
|
||||
# define __gid_t_defined
|
||||
# endif
|
||||
|
||||
# ifndef __ino_t_defined
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
typedef __ino_t ino_t;
|
||||
# else
|
||||
typedef __ino64_t ino_t;
|
||||
# endif
|
||||
# define __ino_t_defined
|
||||
# endif
|
||||
|
||||
# ifndef __mode_t_defined
|
||||
typedef __mode_t mode_t;
|
||||
# define __mode_t_defined
|
||||
# endif
|
||||
|
||||
# ifndef __nlink_t_defined
|
||||
typedef __nlink_t nlink_t;
|
||||
# define __nlink_t_defined
|
||||
# endif
|
||||
|
||||
# ifndef __off_t_defined
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
typedef __off_t off_t;
|
||||
# else
|
||||
typedef __off64_t off_t;
|
||||
# endif
|
||||
# define __off_t_defined
|
||||
# endif
|
||||
|
||||
# ifndef __uid_t_defined
|
||||
typedef __uid_t uid_t;
|
||||
# define __uid_t_defined
|
||||
# endif
|
||||
#endif /* X/Open */
|
||||
|
||||
#ifdef __USE_UNIX98
|
||||
# ifndef __blkcnt_t_defined
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
typedef __blkcnt_t blkcnt_t;
|
||||
# else
|
||||
typedef __blkcnt64_t blkcnt_t;
|
||||
# endif
|
||||
# define __blkcnt_t_defined
|
||||
# endif
|
||||
|
||||
# ifndef __blksize_t_defined
|
||||
typedef __blksize_t blksize_t;
|
||||
# define __blksize_t_defined
|
||||
# endif
|
||||
#endif /* Unix98 */
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#include <bits/stat.h>
|
||||
|
||||
#if defined __USE_MISC || defined __USE_XOPEN
|
||||
# define S_IFMT __S_IFMT
|
||||
# define S_IFDIR __S_IFDIR
|
||||
# define S_IFCHR __S_IFCHR
|
||||
# define S_IFBLK __S_IFBLK
|
||||
# define S_IFREG __S_IFREG
|
||||
# ifdef __S_IFIFO
|
||||
# define S_IFIFO __S_IFIFO
|
||||
# endif
|
||||
# ifdef __S_IFLNK
|
||||
# define S_IFLNK __S_IFLNK
|
||||
# endif
|
||||
# if (defined __USE_MISC || defined __USE_XOPEN_EXTENDED) \
|
||||
&& defined __S_IFSOCK
|
||||
# define S_IFSOCK __S_IFSOCK
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Test macros for file types. */
|
||||
|
||||
#define __S_ISTYPE(mode, mask) (((mode) & __S_IFMT) == (mask))
|
||||
|
||||
#define S_ISDIR(mode) __S_ISTYPE((mode), __S_IFDIR)
|
||||
#define S_ISCHR(mode) __S_ISTYPE((mode), __S_IFCHR)
|
||||
#define S_ISBLK(mode) __S_ISTYPE((mode), __S_IFBLK)
|
||||
#define S_ISREG(mode) __S_ISTYPE((mode), __S_IFREG)
|
||||
#ifdef __S_IFIFO
|
||||
# define S_ISFIFO(mode) __S_ISTYPE((mode), __S_IFIFO)
|
||||
#endif
|
||||
#ifdef __S_IFLNK
|
||||
# define S_ISLNK(mode) __S_ISTYPE((mode), __S_IFLNK)
|
||||
#endif
|
||||
|
||||
#if defined __USE_MISC && !defined __S_IFLNK
|
||||
# define S_ISLNK(mode) 0
|
||||
#endif
|
||||
|
||||
#if (defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K) \
|
||||
&& defined __S_IFSOCK
|
||||
# define S_ISSOCK(mode) __S_ISTYPE((mode), __S_IFSOCK)
|
||||
#elif defined __USE_XOPEN2K
|
||||
# define S_ISSOCK(mode) 0
|
||||
#endif
|
||||
|
||||
/* These are from POSIX.1b. If the objects are not implemented using separate
|
||||
distinct file types, the macros always will evaluate to zero. Unlike the
|
||||
other S_* macros the following three take a pointer to a `struct stat'
|
||||
object as the argument. */
|
||||
#ifdef __USE_POSIX199309
|
||||
# define S_TYPEISMQ(buf) __S_TYPEISMQ(buf)
|
||||
# define S_TYPEISSEM(buf) __S_TYPEISSEM(buf)
|
||||
# define S_TYPEISSHM(buf) __S_TYPEISSHM(buf)
|
||||
#endif
|
||||
|
||||
|
||||
/* Protection bits. */
|
||||
|
||||
#define S_ISUID __S_ISUID /* Set user ID on execution. */
|
||||
#define S_ISGID __S_ISGID /* Set group ID on execution. */
|
||||
|
||||
#if defined __USE_MISC || defined __USE_XOPEN
|
||||
/* Save swapped text after use (sticky bit). This is pretty well obsolete. */
|
||||
# define S_ISVTX __S_ISVTX
|
||||
#endif
|
||||
|
||||
#define S_IRUSR __S_IREAD /* Read by owner. */
|
||||
#define S_IWUSR __S_IWRITE /* Write by owner. */
|
||||
#define S_IXUSR __S_IEXEC /* Execute by owner. */
|
||||
/* Read, write, and execute by owner. */
|
||||
#define S_IRWXU (__S_IREAD|__S_IWRITE|__S_IEXEC)
|
||||
|
||||
#ifdef __USE_MISC
|
||||
# define S_IREAD S_IRUSR
|
||||
# define S_IWRITE S_IWUSR
|
||||
# define S_IEXEC S_IXUSR
|
||||
#endif
|
||||
|
||||
#define S_IRGRP (S_IRUSR >> 3) /* Read by group. */
|
||||
#define S_IWGRP (S_IWUSR >> 3) /* Write by group. */
|
||||
#define S_IXGRP (S_IXUSR >> 3) /* Execute by group. */
|
||||
/* Read, write, and execute by group. */
|
||||
#define S_IRWXG (S_IRWXU >> 3)
|
||||
|
||||
#define S_IROTH (S_IRGRP >> 3) /* Read by others. */
|
||||
#define S_IWOTH (S_IWGRP >> 3) /* Write by others. */
|
||||
#define S_IXOTH (S_IXGRP >> 3) /* Execute by others. */
|
||||
/* Read, write, and execute by others. */
|
||||
#define S_IRWXO (S_IRWXG >> 3)
|
||||
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* Macros for common mode bit masks. */
|
||||
# define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */
|
||||
# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)/* 07777 */
|
||||
# define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)/* 0666*/
|
||||
|
||||
# define S_BLKSIZE 512 /* Block size for `st_blocks'. */
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
/* Get file attributes for FILE and put them in BUF. */
|
||||
extern int stat (const char *__restrict __file,
|
||||
struct stat *__restrict __buf) __THROW __nonnull ((1, 2));
|
||||
|
||||
/* Get file attributes for the file, device, pipe, or socket
|
||||
that file descriptor FD is open on and put them in BUF. */
|
||||
extern int fstat (int __fd, struct stat *__buf) __THROW __nonnull ((2));
|
||||
#else
|
||||
# ifdef __USE_TIME64_REDIRECTS
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (stat, (const char *__restrict __file,
|
||||
struct stat *__restrict __buf),
|
||||
__stat64_time64)
|
||||
__nonnull ((1, 2));
|
||||
extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf),
|
||||
__fstat64_time64)
|
||||
__nonnull ((2));
|
||||
# else
|
||||
# define stat __stat64_time64
|
||||
# define fstat __fstat64_time64
|
||||
# endif
|
||||
# else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (stat, (const char *__restrict __file,
|
||||
struct stat *__restrict __buf), stat64)
|
||||
__nonnull ((1, 2));
|
||||
extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), fstat64)
|
||||
__nonnull ((2));
|
||||
# else
|
||||
# define stat stat64
|
||||
# define fstat fstat64
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
extern int stat64 (const char *__restrict __file,
|
||||
struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2));
|
||||
extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2));
|
||||
# else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (stat64, (const char *__restrict __file,
|
||||
struct stat64 *__restrict __buf),
|
||||
__stat64_time64)
|
||||
__nonnull ((1, 2));
|
||||
extern int __REDIRECT_NTH (fstat64, (int __fd, struct stat64 *__buf),
|
||||
__fstat64_time64)
|
||||
__nonnull ((2));
|
||||
# else
|
||||
# define stat64 __stat64_time64
|
||||
# define fstat64 __fstat64_time64
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __USE_ATFILE
|
||||
/* Similar to stat, get the attributes for FILE and put them in BUF.
|
||||
Relative path names are interpreted relative to FD unless FD is
|
||||
AT_FDCWD. */
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
extern int fstatat (int __fd, const char *__restrict __file,
|
||||
struct stat *__restrict __buf, int __flag)
|
||||
__THROW __nonnull ((3));
|
||||
# else
|
||||
# ifdef __USE_TIME64_REDIRECTS
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file,
|
||||
struct stat *__restrict __buf,
|
||||
int __flag),
|
||||
__fstatat64_time64) __nonnull ((3));
|
||||
# else
|
||||
# define fstatat __fstatat64_time64
|
||||
# endif
|
||||
# else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file,
|
||||
struct stat *__restrict __buf,
|
||||
int __flag),
|
||||
fstatat64) __nonnull ((3));
|
||||
# else
|
||||
# define fstatat fstatat64
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifdef __USE_LARGEFILE64
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
extern int fstatat64 (int __fd, const char *__restrict __file,
|
||||
struct stat64 *__restrict __buf, int __flag)
|
||||
__THROW __nonnull ((3));
|
||||
# else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (fstatat64, (int __fd,
|
||||
const char *__restrict __file,
|
||||
struct stat64 *__restrict __buf,
|
||||
int __flag),
|
||||
__fstatat64_time64)
|
||||
__nonnull ((3));
|
||||
# else
|
||||
# define fstatat64 __fstatat64_time64
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
/* Get file attributes about FILE and put them in BUF.
|
||||
If FILE is a symbolic link, do not follow it. */
|
||||
extern int lstat (const char *__restrict __file,
|
||||
struct stat *__restrict __buf) __THROW __nonnull ((1, 2));
|
||||
# else
|
||||
# ifdef __USE_TIME64_REDIRECTS
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (lstat,
|
||||
(const char *__restrict __file,
|
||||
struct stat *__restrict __buf), __lstat64_time64)
|
||||
__nonnull ((1, 2));
|
||||
# else
|
||||
# define lstat __lstat64_time64
|
||||
# endif
|
||||
# else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (lstat,
|
||||
(const char *__restrict __file,
|
||||
struct stat *__restrict __buf), lstat64)
|
||||
__nonnull ((1, 2));
|
||||
# else
|
||||
# define lstat lstat64
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# ifdef __USE_LARGEFILE64
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
extern int lstat64 (const char *__restrict __file,
|
||||
struct stat64 *__restrict __buf)
|
||||
__THROW __nonnull ((1, 2));
|
||||
# else
|
||||
extern int __REDIRECT_NTH (lstat64, (const char *__restrict __file,
|
||||
struct stat64 *__restrict __buf),
|
||||
__lstat64_time64)
|
||||
__nonnull ((1, 2));
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Set file access permissions for FILE to MODE.
|
||||
If FILE is a symbolic link, this affects its target instead. */
|
||||
extern int chmod (const char *__file, __mode_t __mode)
|
||||
__THROW __nonnull ((1));
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* Set file access permissions for FILE to MODE.
|
||||
If FILE is a symbolic link, this affects the link itself
|
||||
rather than its target. */
|
||||
extern int lchmod (const char *__file, __mode_t __mode)
|
||||
__THROW __nonnull ((1));
|
||||
#endif
|
||||
|
||||
/* Set file access permissions of the file FD is open on to MODE. */
|
||||
#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
|
||||
extern int fchmod (int __fd, __mode_t __mode) __THROW;
|
||||
#endif
|
||||
|
||||
#ifdef __USE_ATFILE
|
||||
/* Set file access permissions of FILE relative to
|
||||
the directory FD is open on. */
|
||||
extern int fchmodat (int __fd, const char *__file, __mode_t __mode,
|
||||
int __flag)
|
||||
__THROW __nonnull ((2)) __wur;
|
||||
#endif /* Use ATFILE. */
|
||||
|
||||
|
||||
|
||||
/* Set the file creation mask of the current process to MASK,
|
||||
and return the old creation mask. */
|
||||
extern __mode_t umask (__mode_t __mask) __THROW;
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Get the current `umask' value without changing it.
|
||||
This function is only available under the GNU Hurd. */
|
||||
extern __mode_t getumask (void) __THROW;
|
||||
#endif
|
||||
|
||||
/* Create a new directory named PATH, with permission bits MODE. */
|
||||
extern int mkdir (const char *__path, __mode_t __mode)
|
||||
__THROW __nonnull ((1));
|
||||
|
||||
#ifdef __USE_ATFILE
|
||||
/* Like mkdir, create a new directory with permission bits MODE. But
|
||||
interpret relative PATH names relative to the directory associated
|
||||
with FD. */
|
||||
extern int mkdirat (int __fd, const char *__path, __mode_t __mode)
|
||||
__THROW __nonnull ((2));
|
||||
#endif
|
||||
|
||||
/* Create a device file named PATH, with permission and special bits MODE
|
||||
and device number DEV (which can be constructed from major and minor
|
||||
device numbers with the `makedev' macro above). */
|
||||
#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
|
||||
extern int mknod (const char *__path, __mode_t __mode, __dev_t __dev)
|
||||
__THROW __nonnull ((1));
|
||||
|
||||
# ifdef __USE_ATFILE
|
||||
/* Like mknod, create a new device file with permission bits MODE and
|
||||
device number DEV. But interpret relative PATH names relative to
|
||||
the directory associated with FD. */
|
||||
extern int mknodat (int __fd, const char *__path, __mode_t __mode,
|
||||
__dev_t __dev) __THROW __nonnull ((2));
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Create a new FIFO named PATH, with permission bits MODE. */
|
||||
extern int mkfifo (const char *__path, __mode_t __mode)
|
||||
__THROW __nonnull ((1));
|
||||
|
||||
#ifdef __USE_ATFILE
|
||||
/* Like mkfifo, create a new FIFO with permission bits MODE. But
|
||||
interpret relative PATH names relative to the directory associated
|
||||
with FD. */
|
||||
extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
|
||||
__THROW __nonnull ((2));
|
||||
#endif
|
||||
|
||||
#ifdef __USE_ATFILE
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
/* Set file access and modification times relative to directory file
|
||||
descriptor. */
|
||||
extern int utimensat (int __fd, const char *__path,
|
||||
const struct timespec __times[2],
|
||||
int __flags)
|
||||
__THROW;
|
||||
# else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (utimensat, (int fd, const char *__path,
|
||||
const struct timespec __times[2],
|
||||
int flags),
|
||||
__utimensat64);
|
||||
# else
|
||||
# define utimensat __utimensat64
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __USE_XOPEN2K8
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
/* Set file access and modification times of the file associated with FD. */
|
||||
extern int futimens (int __fd, const struct timespec __times[2]) __THROW;
|
||||
|
||||
# else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (futimens, (int fd, const struct timespec __times[2]),
|
||||
__futimens64);
|
||||
# else
|
||||
# define futimens __futimens64
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __USE_GNU
|
||||
# include <bits/statx.h>
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
||||
#endif /* sys/stat.h */
|
||||
67
board/mentalnet/overlay/usr/include/sys/statfs.h
Normal file
67
board/mentalnet/overlay/usr/include/sys/statfs.h
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
/* Definitions for getting information about a filesystem.
|
||||
Copyright (C) 1996-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_STATFS_H
|
||||
#define _SYS_STATFS_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
/* Get the system-specific definition of `struct statfs'. */
|
||||
#include <bits/statfs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Return information about the filesystem on which FILE resides. */
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
extern int statfs (const char *__file, struct statfs *__buf)
|
||||
__THROW __nonnull ((1, 2));
|
||||
#else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (statfs,
|
||||
(const char *__file, struct statfs *__buf),
|
||||
statfs64) __nonnull ((1, 2));
|
||||
# else
|
||||
# define statfs statfs64
|
||||
# endif
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern int statfs64 (const char *__file, struct statfs64 *__buf)
|
||||
__THROW __nonnull ((1, 2));
|
||||
#endif
|
||||
|
||||
/* Return information about the filesystem containing the file FILDES
|
||||
refers to. */
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
extern int fstatfs (int __fildes, struct statfs *__buf)
|
||||
__THROW __nonnull ((2));
|
||||
#else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (fstatfs, (int __fildes, struct statfs *__buf),
|
||||
fstatfs64) __nonnull ((2));
|
||||
# else
|
||||
# define fstatfs fstatfs64
|
||||
# endif
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern int fstatfs64 (int __fildes, struct statfs64 *__buf)
|
||||
__THROW __nonnull ((2));
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/statfs.h */
|
||||
90
board/mentalnet/overlay/usr/include/sys/statvfs.h
Normal file
90
board/mentalnet/overlay/usr/include/sys/statvfs.h
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
/* Definitions for getting information about a filesystem.
|
||||
Copyright (C) 1998-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_STATVFS_H
|
||||
#define _SYS_STATVFS_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
/* Get the system-specific definition of `struct statvfs'. */
|
||||
#include <bits/statvfs.h>
|
||||
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
# ifndef __fsblkcnt_t_defined
|
||||
typedef __fsblkcnt_t fsblkcnt_t; /* Type to count file system blocks. */
|
||||
# define __fsblkcnt_t_defined
|
||||
# endif
|
||||
# ifndef __fsfilcnt_t_defined
|
||||
typedef __fsfilcnt_t fsfilcnt_t; /* Type to count file system inodes. */
|
||||
# define __fsfilcnt_t_defined
|
||||
# endif
|
||||
#else
|
||||
# ifndef __fsblkcnt_t_defined
|
||||
typedef __fsblkcnt64_t fsblkcnt_t; /* Type to count file system blocks. */
|
||||
# define __fsblkcnt_t_defined
|
||||
# endif
|
||||
# ifndef __fsfilcnt_t_defined
|
||||
typedef __fsfilcnt64_t fsfilcnt_t; /* Type to count file system inodes. */
|
||||
# define __fsfilcnt_t_defined
|
||||
# endif
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Return information about the filesystem on which FILE resides. */
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
extern int statvfs (const char *__restrict __file,
|
||||
struct statvfs *__restrict __buf)
|
||||
__THROW __nonnull ((1, 2));
|
||||
#else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (statvfs,
|
||||
(const char *__restrict __file,
|
||||
struct statvfs *__restrict __buf), statvfs64)
|
||||
__nonnull ((1, 2));
|
||||
# else
|
||||
# define statvfs statvfs64
|
||||
# endif
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern int statvfs64 (const char *__restrict __file,
|
||||
struct statvfs64 *__restrict __buf)
|
||||
__THROW __nonnull ((1, 2));
|
||||
#endif
|
||||
|
||||
/* Return information about the filesystem containing the file FILDES
|
||||
refers to. */
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
extern int fstatvfs (int __fildes, struct statvfs *__buf)
|
||||
__THROW __nonnull ((2));
|
||||
#else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (fstatvfs, (int __fildes, struct statvfs *__buf),
|
||||
fstatvfs64) __nonnull ((2));
|
||||
# else
|
||||
# define fstatvfs fstatvfs64
|
||||
# endif
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern int fstatvfs64 (int __fildes, struct statvfs64 *__buf)
|
||||
__THROW __nonnull ((2));
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/statvfs.h */
|
||||
43
board/mentalnet/overlay/usr/include/sys/swap.h
Normal file
43
board/mentalnet/overlay/usr/include/sys/swap.h
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
/* Calls to enable and disable swapping on specified locations. Linux version.
|
||||
Copyright (C) 1996-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_SWAP_H
|
||||
|
||||
#define _SYS_SWAP_H 1
|
||||
#include <features.h>
|
||||
|
||||
/* The swap priority is encoded as:
|
||||
(prio << SWAP_FLAG_PRIO_SHIFT) & SWAP_FLAG_PRIO_MASK
|
||||
*/
|
||||
#define SWAP_FLAG_PREFER 0x8000 /* Set if swap priority is specified. */
|
||||
#define SWAP_FLAG_PRIO_MASK 0x7fff
|
||||
#define SWAP_FLAG_PRIO_SHIFT 0
|
||||
#define SWAP_FLAG_DISCARD 0x10000 /* Discard swap cluster after use. */
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Make the block special device PATH available to the system for swapping.
|
||||
This call is restricted to the super-user. */
|
||||
extern int swapon (const char *__path, int __flags) __THROW;
|
||||
|
||||
/* Stop using block special device PATH for swapping. */
|
||||
extern int swapoff (const char *__path) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SYS_SWAP_H */
|
||||
31
board/mentalnet/overlay/usr/include/sys/syscall.h
Normal file
31
board/mentalnet/overlay/usr/include/sys/syscall.h
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
/* Copyright (C) 1995-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYSCALL_H
|
||||
#define _SYSCALL_H 1
|
||||
|
||||
/* This file should list the numbers of the system calls the system knows.
|
||||
But instead of duplicating this we use the information available
|
||||
from the kernel sources. */
|
||||
#include <asm/unistd.h>
|
||||
|
||||
/* The Linux kernel header file defines macros __NR_*, but some
|
||||
programs expect the traditional form SYS_*. <bits/syscall.h>
|
||||
defines SYS_* macros for __NR_* macros of known names. */
|
||||
#include <bits/syscall.h>
|
||||
|
||||
#endif
|
||||
47
board/mentalnet/overlay/usr/include/sys/sysinfo.h
Normal file
47
board/mentalnet/overlay/usr/include/sys/sysinfo.h
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
/* Copyright (C) 1996-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_SYSINFO_H
|
||||
#define _SYS_SYSINFO_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
/* Get sysinfo structure from kernel header. */
|
||||
#include <linux/kernel.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Returns information on overall system statistics. */
|
||||
extern int sysinfo (struct sysinfo *__info) __THROW;
|
||||
|
||||
|
||||
/* Return number of configured processors. */
|
||||
extern int get_nprocs_conf (void) __THROW;
|
||||
|
||||
/* Return number of available processors. */
|
||||
extern int get_nprocs (void) __THROW;
|
||||
|
||||
|
||||
/* Return number of physical pages of memory in the system. */
|
||||
extern long int get_phys_pages (void) __THROW;
|
||||
|
||||
/* Return number of available physical pages of memory in the system. */
|
||||
extern long int get_avphys_pages (void) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/sysinfo.h */
|
||||
217
board/mentalnet/overlay/usr/include/sys/syslog.h
Normal file
217
board/mentalnet/overlay/usr/include/sys/syslog.h
Normal file
|
|
@ -0,0 +1,217 @@
|
|||
/*
|
||||
* Copyright (c) 1982, 1986, 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.
|
||||
*
|
||||
* @(#)syslog.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
#ifndef _SYS_SYSLOG_H
|
||||
#define _SYS_SYSLOG_H 1
|
||||
|
||||
#include <features.h>
|
||||
#define __need___va_list
|
||||
#include <stdarg.h>
|
||||
|
||||
/* This file defines _PATH_LOG. */
|
||||
#include <bits/syslog-path.h>
|
||||
|
||||
/*
|
||||
* priorities/facilities are encoded into a single 32-bit quantity, where the
|
||||
* bottom 3 bits are the priority (0-7) and the top 28 bits are the facility
|
||||
* (0-big number). Both the priorities and the facilities map roughly
|
||||
* one-to-one to strings in the syslogd(8) source code. This mapping is
|
||||
* included in this file.
|
||||
*
|
||||
* priorities (these are ordered)
|
||||
*/
|
||||
#define LOG_EMERG 0 /* system is unusable */
|
||||
#define LOG_ALERT 1 /* action must be taken immediately */
|
||||
#define LOG_CRIT 2 /* critical conditions */
|
||||
#define LOG_ERR 3 /* error conditions */
|
||||
#define LOG_WARNING 4 /* warning conditions */
|
||||
#define LOG_NOTICE 5 /* normal but significant condition */
|
||||
#define LOG_INFO 6 /* informational */
|
||||
#define LOG_DEBUG 7 /* debug-level messages */
|
||||
|
||||
#define LOG_PRIMASK 0x07 /* mask to extract priority part (internal) */
|
||||
/* extract priority */
|
||||
#define LOG_PRI(p) ((p) & LOG_PRIMASK)
|
||||
#define LOG_MAKEPRI(fac, pri) ((fac) | (pri))
|
||||
|
||||
#if defined SYSLOG_NAMES && defined __USE_MISC
|
||||
#define INTERNAL_NOPRI 0x10 /* the "no priority" priority */
|
||||
/* mark "facility" */
|
||||
#define INTERNAL_MARK LOG_MAKEPRI(LOG_NFACILITIES << 3, 0)
|
||||
typedef struct _code {
|
||||
char *c_name;
|
||||
int c_val;
|
||||
} CODE;
|
||||
|
||||
CODE prioritynames[] =
|
||||
{
|
||||
{ "alert", LOG_ALERT },
|
||||
{ "crit", LOG_CRIT },
|
||||
{ "debug", LOG_DEBUG },
|
||||
{ "emerg", LOG_EMERG },
|
||||
{ "err", LOG_ERR },
|
||||
{ "error", LOG_ERR }, /* DEPRECATED */
|
||||
{ "info", LOG_INFO },
|
||||
{ "none", INTERNAL_NOPRI }, /* INTERNAL */
|
||||
{ "notice", LOG_NOTICE },
|
||||
{ "panic", LOG_EMERG }, /* DEPRECATED */
|
||||
{ "warn", LOG_WARNING }, /* DEPRECATED */
|
||||
{ "warning", LOG_WARNING },
|
||||
{ NULL, -1 }
|
||||
};
|
||||
#endif
|
||||
|
||||
/* facility codes */
|
||||
#define LOG_KERN (0<<3) /* kernel messages */
|
||||
#define LOG_USER (1<<3) /* random user-level messages */
|
||||
#define LOG_MAIL (2<<3) /* mail system */
|
||||
#define LOG_DAEMON (3<<3) /* system daemons */
|
||||
#define LOG_AUTH (4<<3) /* security/authorization messages */
|
||||
#define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */
|
||||
#define LOG_LPR (6<<3) /* line printer subsystem */
|
||||
#define LOG_NEWS (7<<3) /* network news subsystem */
|
||||
#define LOG_UUCP (8<<3) /* UUCP subsystem */
|
||||
#define LOG_CRON (9<<3) /* clock daemon */
|
||||
#define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */
|
||||
#define LOG_FTP (11<<3) /* ftp daemon */
|
||||
|
||||
/* other codes through 15 reserved for system use */
|
||||
#define LOG_LOCAL0 (16<<3) /* reserved for local use */
|
||||
#define LOG_LOCAL1 (17<<3) /* reserved for local use */
|
||||
#define LOG_LOCAL2 (18<<3) /* reserved for local use */
|
||||
#define LOG_LOCAL3 (19<<3) /* reserved for local use */
|
||||
#define LOG_LOCAL4 (20<<3) /* reserved for local use */
|
||||
#define LOG_LOCAL5 (21<<3) /* reserved for local use */
|
||||
#define LOG_LOCAL6 (22<<3) /* reserved for local use */
|
||||
#define LOG_LOCAL7 (23<<3) /* reserved for local use */
|
||||
|
||||
#define LOG_NFACILITIES 24 /* current number of facilities */
|
||||
#define LOG_FACMASK 0x03f8 /* mask to extract facility part */
|
||||
/* facility of pri */
|
||||
#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3)
|
||||
|
||||
#if defined SYSLOG_NAMES && defined __USE_MISC
|
||||
CODE facilitynames[] =
|
||||
{
|
||||
{ "auth", LOG_AUTH },
|
||||
{ "authpriv", LOG_AUTHPRIV },
|
||||
{ "cron", LOG_CRON },
|
||||
{ "daemon", LOG_DAEMON },
|
||||
{ "ftp", LOG_FTP },
|
||||
{ "kern", LOG_KERN },
|
||||
{ "lpr", LOG_LPR },
|
||||
{ "mail", LOG_MAIL },
|
||||
{ "mark", INTERNAL_MARK }, /* INTERNAL */
|
||||
{ "news", LOG_NEWS },
|
||||
{ "security", LOG_AUTH }, /* DEPRECATED */
|
||||
{ "syslog", LOG_SYSLOG },
|
||||
{ "user", LOG_USER },
|
||||
{ "uucp", LOG_UUCP },
|
||||
{ "local0", LOG_LOCAL0 },
|
||||
{ "local1", LOG_LOCAL1 },
|
||||
{ "local2", LOG_LOCAL2 },
|
||||
{ "local3", LOG_LOCAL3 },
|
||||
{ "local4", LOG_LOCAL4 },
|
||||
{ "local5", LOG_LOCAL5 },
|
||||
{ "local6", LOG_LOCAL6 },
|
||||
{ "local7", LOG_LOCAL7 },
|
||||
{ NULL, -1 }
|
||||
};
|
||||
#endif
|
||||
|
||||
/*
|
||||
* arguments to setlogmask.
|
||||
*/
|
||||
#define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */
|
||||
#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */
|
||||
|
||||
/*
|
||||
* Option flags for openlog.
|
||||
*
|
||||
* LOG_ODELAY no longer does anything.
|
||||
* LOG_NDELAY is the inverse of what it used to be.
|
||||
*/
|
||||
#define LOG_PID 0x01 /* log the pid with each message */
|
||||
#define LOG_CONS 0x02 /* log on the console if errors in sending */
|
||||
#define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */
|
||||
#define LOG_NDELAY 0x08 /* don't delay open */
|
||||
#define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */
|
||||
#define LOG_PERROR 0x20 /* log to stderr as well */
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Close descriptor used to write to system logger.
|
||||
|
||||
This function is a possible cancellation point and therefore not
|
||||
marked with __THROW. */
|
||||
extern void closelog (void);
|
||||
|
||||
/* Open connection to system logger.
|
||||
|
||||
This function is a possible cancellation point and therefore not
|
||||
marked with __THROW. */
|
||||
extern void openlog (const char *__ident, int __option, int __facility);
|
||||
|
||||
/* Set the log mask level. */
|
||||
extern int setlogmask (int __mask) __THROW;
|
||||
|
||||
/* Generate a log message using FMT string and option arguments.
|
||||
|
||||
This function is a possible cancellation point and therefore not
|
||||
marked with __THROW. */
|
||||
extern void syslog (int __pri, const char *__fmt, ...)
|
||||
__attribute__ ((__format__ (__printf__, 2, 3)));
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* Generate a log message using FMT and using arguments pointed to by AP.
|
||||
|
||||
This function is not part of POSIX and therefore no official
|
||||
cancellation point. But due to similarity with an POSIX interface
|
||||
or due to the implementation it is a cancellation point and
|
||||
therefore not marked with __THROW. */
|
||||
extern void vsyslog (int __pri, const char *__fmt, __gnuc_va_list __ap)
|
||||
__attribute__ ((__format__ (__printf__, 2, 0)));
|
||||
#endif
|
||||
|
||||
|
||||
/* Define some macros helping to catch buffer overflows. */
|
||||
#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
|
||||
# include <bits/syslog.h>
|
||||
#else
|
||||
# include <bits/floatn.h>
|
||||
# if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
|
||||
# include <bits/syslog-ldbl.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/syslog.h */
|
||||
64
board/mentalnet/overlay/usr/include/sys/sysmacros.h
Normal file
64
board/mentalnet/overlay/usr/include/sys/sysmacros.h
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
/* Definitions of macros to access `dev_t' values.
|
||||
Copyright (C) 1996-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_SYSMACROS_H
|
||||
#define _SYS_SYSMACROS_H 1
|
||||
|
||||
#include <features.h>
|
||||
#include <bits/types.h>
|
||||
#include <bits/sysmacros.h>
|
||||
|
||||
#define __SYSMACROS_DECL_TEMPL(rtype, name, proto) \
|
||||
extern rtype gnu_dev_##name proto __THROW __attribute_const__;
|
||||
|
||||
#define __SYSMACROS_IMPL_TEMPL(rtype, name, proto) \
|
||||
__extension__ __extern_inline __attribute_const__ rtype \
|
||||
__NTH (gnu_dev_##name proto)
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
__SYSMACROS_DECLARE_MAJOR (__SYSMACROS_DECL_TEMPL)
|
||||
__SYSMACROS_DECLARE_MINOR (__SYSMACROS_DECL_TEMPL)
|
||||
__SYSMACROS_DECLARE_MAKEDEV (__SYSMACROS_DECL_TEMPL)
|
||||
|
||||
#ifdef __USE_EXTERN_INLINES
|
||||
|
||||
__SYSMACROS_DEFINE_MAJOR (__SYSMACROS_IMPL_TEMPL)
|
||||
__SYSMACROS_DEFINE_MINOR (__SYSMACROS_IMPL_TEMPL)
|
||||
__SYSMACROS_DEFINE_MAKEDEV (__SYSMACROS_IMPL_TEMPL)
|
||||
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#ifndef __SYSMACROS_NEED_IMPLEMENTATION
|
||||
# undef __SYSMACROS_DECL_TEMPL
|
||||
# undef __SYSMACROS_IMPL_TEMPL
|
||||
# undef __SYSMACROS_DECLARE_MAJOR
|
||||
# undef __SYSMACROS_DECLARE_MINOR
|
||||
# undef __SYSMACROS_DECLARE_MAKEDEV
|
||||
# undef __SYSMACROS_DEFINE_MAJOR
|
||||
# undef __SYSMACROS_DEFINE_MINOR
|
||||
# undef __SYSMACROS_DEFINE_MAKEDEV
|
||||
#endif
|
||||
|
||||
#define major(dev) gnu_dev_major (dev)
|
||||
#define minor(dev) gnu_dev_minor (dev)
|
||||
#define makedev(maj, min) gnu_dev_makedev (maj, min)
|
||||
|
||||
#endif /* sys/sysmacros.h */
|
||||
4
board/mentalnet/overlay/usr/include/sys/termios.h
Normal file
4
board/mentalnet/overlay/usr/include/sys/termios.h
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef _SYS_TERMIOS_H
|
||||
#define _SYS_TERMIOS_H
|
||||
#include <termios.h>
|
||||
#endif
|
||||
260
board/mentalnet/overlay/usr/include/sys/time.h
Normal file
260
board/mentalnet/overlay/usr/include/sys/time.h
Normal file
|
|
@ -0,0 +1,260 @@
|
|||
/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_TIME_H
|
||||
#define _SYS_TIME_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#include <bits/types.h>
|
||||
#include <bits/types/time_t.h>
|
||||
#include <bits/types/struct_timeval.h>
|
||||
|
||||
#ifndef __suseconds_t_defined
|
||||
typedef __suseconds_t suseconds_t;
|
||||
# define __suseconds_t_defined
|
||||
#endif
|
||||
|
||||
#include <sys/select.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Macros for converting between `struct timeval' and `struct timespec'. */
|
||||
# define TIMEVAL_TO_TIMESPEC(tv, ts) { \
|
||||
(ts)->tv_sec = (tv)->tv_sec; \
|
||||
(ts)->tv_nsec = (tv)->tv_usec * 1000; \
|
||||
}
|
||||
# define TIMESPEC_TO_TIMEVAL(tv, ts) { \
|
||||
(tv)->tv_sec = (ts)->tv_sec; \
|
||||
(tv)->tv_usec = (ts)->tv_nsec / 1000; \
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* Structure crudely representing a timezone.
|
||||
This is obsolete and should never be used. */
|
||||
struct timezone
|
||||
{
|
||||
int tz_minuteswest; /* Minutes west of GMT. */
|
||||
int tz_dsttime; /* Nonzero if DST is ever in effect. */
|
||||
};
|
||||
#endif
|
||||
|
||||
/* Get the current time of day, putting it into *TV.
|
||||
If TZ is not null, *TZ must be a struct timezone, and both fields
|
||||
will be set to zero.
|
||||
Calling this function with a non-null TZ is obsolete;
|
||||
use localtime etc. instead.
|
||||
This function itself is semi-obsolete;
|
||||
most callers should use time or clock_gettime instead. */
|
||||
#ifndef __USE_TIME64_REDIRECTS
|
||||
extern int gettimeofday (struct timeval *__restrict __tv,
|
||||
void *__restrict __tz) __THROW __nonnull ((1));
|
||||
#else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (gettimeofday, (struct timeval *__restrict __tv,
|
||||
void *__restrict __tz),
|
||||
__gettimeofday64) __nonnull ((1));
|
||||
# else
|
||||
# define gettimeofday __gettimeofday64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __USE_MISC
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
/* Set the current time of day and timezone information.
|
||||
This call is restricted to the super-user.
|
||||
Setting the timezone in this way is obsolete, but we don't yet
|
||||
warn about it because it still has some uses for which there is
|
||||
no alternative. */
|
||||
extern int settimeofday (const struct timeval *__tv,
|
||||
const struct timezone *__tz)
|
||||
__THROW;
|
||||
|
||||
/* Adjust the current time of day by the amount in DELTA.
|
||||
If OLDDELTA is not NULL, it is filled in with the amount
|
||||
of time adjustment remaining to be done from the last `adjtime' call.
|
||||
This call is restricted to the super-user. */
|
||||
extern int adjtime (const struct timeval *__delta,
|
||||
struct timeval *__olddelta) __THROW;
|
||||
# else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (settimeofday, (const struct timeval *__tv,
|
||||
const struct timezone *__tz),
|
||||
__settimeofday64);
|
||||
|
||||
extern int __REDIRECT_NTH (adjtime, (const struct timeval *__delta,
|
||||
struct timeval *__olddelta),
|
||||
__adjtime64);
|
||||
# else
|
||||
# define settimeofday __settimeofday64
|
||||
# define adjtime __adjtime64
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Values for the first argument to `getitimer' and `setitimer'. */
|
||||
enum __itimer_which
|
||||
{
|
||||
/* Timers run in real time. */
|
||||
ITIMER_REAL = 0,
|
||||
#define ITIMER_REAL ITIMER_REAL
|
||||
/* Timers run only when the process is executing. */
|
||||
ITIMER_VIRTUAL = 1,
|
||||
#define ITIMER_VIRTUAL ITIMER_VIRTUAL
|
||||
/* Timers run when the process is executing and when
|
||||
the system is executing on behalf of the process. */
|
||||
ITIMER_PROF = 2
|
||||
#define ITIMER_PROF ITIMER_PROF
|
||||
};
|
||||
|
||||
/* Type of the second argument to `getitimer' and
|
||||
the second and third arguments `setitimer'. */
|
||||
struct itimerval
|
||||
{
|
||||
/* Value to put into `it_value' when the timer expires. */
|
||||
struct timeval it_interval;
|
||||
/* Time to the next timer expiration. */
|
||||
struct timeval it_value;
|
||||
};
|
||||
|
||||
#if defined __USE_GNU && !defined __cplusplus
|
||||
/* Use the nicer parameter type only in GNU mode and not for C++ since the
|
||||
strict C++ rules prevent the automatic promotion. */
|
||||
typedef enum __itimer_which __itimer_which_t;
|
||||
#else
|
||||
typedef int __itimer_which_t;
|
||||
#endif
|
||||
|
||||
#ifndef __USE_TIME64_REDIRECTS
|
||||
/* Set *VALUE to the current setting of timer WHICH.
|
||||
Return 0 on success, -1 on errors. */
|
||||
extern int getitimer (__itimer_which_t __which,
|
||||
struct itimerval *__value) __THROW;
|
||||
|
||||
/* Set the timer WHICH to *NEW. If OLD is not NULL,
|
||||
set *OLD to the old value of timer WHICH.
|
||||
Returns 0 on success, -1 on errors. */
|
||||
extern int setitimer (__itimer_which_t __which,
|
||||
const struct itimerval *__restrict __new,
|
||||
struct itimerval *__restrict __old) __THROW;
|
||||
|
||||
/* Change the access time of FILE to TVP[0] and the modification time of
|
||||
FILE to TVP[1]. If TVP is a null pointer, use the current time instead.
|
||||
Returns 0 on success, -1 on errors. */
|
||||
extern int utimes (const char *__file, const struct timeval __tvp[2])
|
||||
__THROW __nonnull ((1));
|
||||
|
||||
#else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (getitimer, (__itimer_which_t __which,
|
||||
struct itimerval *__value),
|
||||
__getitimer64);
|
||||
|
||||
extern int __REDIRECT_NTH (setitimer, (__itimer_which_t __which,
|
||||
const struct itimerval *__restrict __new,
|
||||
struct itimerval *__restrict __old),
|
||||
__setitimer64);
|
||||
|
||||
extern int __REDIRECT_NTH (utimes, (const char *__file,
|
||||
const struct timeval __tvp[2]),
|
||||
__utimes64) __nonnull ((1));
|
||||
# else
|
||||
# define getitimer __getitimer64
|
||||
# define setitimer __setitimer64
|
||||
# define utimes __utimes64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __USE_MISC
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
/* Same as `utimes', but does not follow symbolic links. */
|
||||
extern int lutimes (const char *__file, const struct timeval __tvp[2])
|
||||
__THROW __nonnull ((1));
|
||||
|
||||
/* Same as `utimes', but takes an open file descriptor instead of a name. */
|
||||
extern int futimes (int __fd, const struct timeval __tvp[2]) __THROW;
|
||||
# else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (lutimes, (const char *__file,
|
||||
const struct timeval __tvp[2]),
|
||||
__lutimes64) __nonnull ((1));
|
||||
|
||||
extern int __REDIRECT_NTH (futimes, (int __fd, const struct timeval __tvp[2]),
|
||||
__futimes64);
|
||||
# else
|
||||
# define lutimes __lutimes64
|
||||
# define futimes __futimes64
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __USE_GNU
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
/* Change the access time of FILE relative to FD to TVP[0] and the
|
||||
modification time of FILE to TVP[1]. If TVP is a null pointer, use
|
||||
the current time instead. Returns 0 on success, -1 on errors. */
|
||||
extern int futimesat (int __fd, const char *__file,
|
||||
const struct timeval __tvp[2]) __THROW;
|
||||
# else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (futimesat, (int __fd, const char *__file,
|
||||
const struct timeval __tvp[2]),
|
||||
__futimesat64);
|
||||
# else
|
||||
# define futimesat __futimesat64
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* Convenience macros for operations on timevals.
|
||||
NOTE: `timercmp' does not work for >= or <=. */
|
||||
# define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
|
||||
# define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0)
|
||||
# define timercmp(a, b, CMP) \
|
||||
(((a)->tv_sec == (b)->tv_sec) \
|
||||
? ((a)->tv_usec CMP (b)->tv_usec) \
|
||||
: ((a)->tv_sec CMP (b)->tv_sec))
|
||||
# define timeradd(a, b, result) \
|
||||
do { \
|
||||
(result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \
|
||||
(result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \
|
||||
if ((result)->tv_usec >= 1000000) \
|
||||
{ \
|
||||
++(result)->tv_sec; \
|
||||
(result)->tv_usec -= 1000000; \
|
||||
} \
|
||||
} while (0)
|
||||
# define timersub(a, b, result) \
|
||||
do { \
|
||||
(result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
|
||||
(result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
|
||||
if ((result)->tv_usec < 0) { \
|
||||
--(result)->tv_sec; \
|
||||
(result)->tv_usec += 1000000; \
|
||||
} \
|
||||
} while (0)
|
||||
#endif /* Misc. */
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/time.h */
|
||||
35
board/mentalnet/overlay/usr/include/sys/timeb.h
Normal file
35
board/mentalnet/overlay/usr/include/sys/timeb.h
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
/* Copyright (C) 1994-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_TIMEB_H
|
||||
#define _SYS_TIMEB_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
# include <bits/types/struct_timeb.h>
|
||||
|
||||
/* Fill in TIMEBUF with information about the current time. */
|
||||
|
||||
extern int ftime (struct timeb *__timebuf)
|
||||
__nonnull ((1))
|
||||
__attribute_deprecated_msg__ ("Use gettimeofday or clock_gettime instead");
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/timeb.h */
|
||||
77
board/mentalnet/overlay/usr/include/sys/timerfd.h
Normal file
77
board/mentalnet/overlay/usr/include/sys/timerfd.h
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
/* Copyright (C) 2008-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_TIMERFD_H
|
||||
#define _SYS_TIMERFD_H 1
|
||||
|
||||
#include <time.h>
|
||||
#include <bits/types/struct_itimerspec.h>
|
||||
|
||||
/* Get the platform-dependent flags. */
|
||||
#include <bits/timerfd.h>
|
||||
|
||||
|
||||
/* Bits to be set in the FLAGS parameter of `timerfd_settime'. */
|
||||
enum
|
||||
{
|
||||
TFD_TIMER_ABSTIME = 1 << 0,
|
||||
#define TFD_TIMER_ABSTIME TFD_TIMER_ABSTIME
|
||||
TFD_TIMER_CANCEL_ON_SET = 1 << 1
|
||||
#define TFD_TIMER_CANCEL_ON_SET TFD_TIMER_CANCEL_ON_SET
|
||||
};
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Return file descriptor for new interval timer source. */
|
||||
extern int timerfd_create (__clockid_t __clock_id, int __flags) __THROW;
|
||||
|
||||
/* Set next expiration time of interval timer source UFD to UTMR. If
|
||||
FLAGS has the TFD_TIMER_ABSTIME flag set the timeout value is
|
||||
absolute. Optionally return the old expiration time in OTMR. */
|
||||
extern int timerfd_settime (int __ufd, int __flags,
|
||||
const struct itimerspec *__utmr,
|
||||
struct itimerspec *__otmr) __THROW;
|
||||
|
||||
#ifdef __USE_TIME64_REDIRECTS
|
||||
# if defined(__REDIRECT_NTH)
|
||||
extern int __REDIRECT_NTH (timerfd_settime,
|
||||
(int __ufd, int __flags,
|
||||
const struct itimerspec *__restrict __value,
|
||||
struct itimerspec *__restrict __ovalue),
|
||||
__timerfd_settime64);
|
||||
# else
|
||||
# define timerfd_settime __timerfd_settime64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Return the next expiration time of UFD. */
|
||||
extern int timerfd_gettime (int __ufd, struct itimerspec *__otmr) __THROW;
|
||||
|
||||
#ifdef __USE_TIME64_REDIRECTS
|
||||
# if defined(__REDIRECT_NTH)
|
||||
extern int __REDIRECT_NTH (timerfd_gettime, (int __ufd,
|
||||
struct itimerspec *__otmr),
|
||||
__timerfd_gettime64);
|
||||
# else
|
||||
# define timerfd_gettime __timerfd_gettime64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/timerfd.h */
|
||||
50
board/mentalnet/overlay/usr/include/sys/times.h
Normal file
50
board/mentalnet/overlay/usr/include/sys/times.h
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
/*
|
||||
* POSIX Standard: 4.5.2 Process Times <sys/times.h>
|
||||
*/
|
||||
|
||||
#ifndef _SYS_TIMES_H
|
||||
#define _SYS_TIMES_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#include <bits/types/clock_t.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Structure describing CPU time used by a process and its children. */
|
||||
struct tms
|
||||
{
|
||||
clock_t tms_utime; /* User CPU time. */
|
||||
clock_t tms_stime; /* System CPU time. */
|
||||
|
||||
clock_t tms_cutime; /* User CPU time of dead children. */
|
||||
clock_t tms_cstime; /* System CPU time of dead children. */
|
||||
};
|
||||
|
||||
|
||||
/* Store the CPU time used by this process and all its
|
||||
dead children (and their dead children) in BUFFER.
|
||||
Return the elapsed real time, or (clock_t) -1 for errors.
|
||||
All times are in CLK_TCKths of a second. */
|
||||
extern clock_t times (struct tms *__buffer) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/times.h */
|
||||
88
board/mentalnet/overlay/usr/include/sys/timex.h
Normal file
88
board/mentalnet/overlay/usr/include/sys/timex.h
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
/* Copyright (C) 1995-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_TIMEX_H
|
||||
#define _SYS_TIMEX_H 1
|
||||
|
||||
#include <features.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
/* These definitions from linux/timex.h as of 2.6.30. */
|
||||
|
||||
#include <bits/timex.h>
|
||||
|
||||
#define NTP_API 4 /* NTP API version */
|
||||
|
||||
struct ntptimeval
|
||||
{
|
||||
struct timeval time; /* current time (ro) */
|
||||
long int maxerror; /* maximum error (us) (ro) */
|
||||
long int esterror; /* estimated error (us) (ro) */
|
||||
long int tai; /* TAI offset (ro) */
|
||||
|
||||
long int __glibc_reserved1;
|
||||
long int __glibc_reserved2;
|
||||
long int __glibc_reserved3;
|
||||
long int __glibc_reserved4;
|
||||
};
|
||||
|
||||
/* Clock states (time_state) */
|
||||
#define TIME_OK 0 /* clock synchronized, no leap second */
|
||||
#define TIME_INS 1 /* insert leap second */
|
||||
#define TIME_DEL 2 /* delete leap second */
|
||||
#define TIME_OOP 3 /* leap second in progress */
|
||||
#define TIME_WAIT 4 /* leap second has occurred */
|
||||
#define TIME_ERROR 5 /* clock not synchronized */
|
||||
#define TIME_BAD TIME_ERROR /* bw compat */
|
||||
|
||||
/* Maximum time constant of the PLL. */
|
||||
#define MAXTC 6
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#ifndef __USE_TIME64_REDIRECTS
|
||||
extern int adjtimex (struct timex *__ntx) __THROW __nonnull ((1));
|
||||
extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW __nonnull ((1));
|
||||
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv),
|
||||
ntp_gettimex) __nonnull ((1));
|
||||
# else
|
||||
# define ntp_gettime ntp_gettimex
|
||||
# endif
|
||||
extern int ntp_adjtime (struct timex *__tntx) __THROW __nonnull ((1));
|
||||
#else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (adjtimex, (struct timex *__ntx),
|
||||
___adjtimex64) __nonnull ((1));
|
||||
extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv),
|
||||
__ntp_gettime64) __nonnull ((1));
|
||||
extern int __REDIRECT_NTH (ntp_gettimex, (struct ntptimeval *__ntv),
|
||||
__ntp_gettimex64) __nonnull ((1));
|
||||
extern int __REDIRECT_NTH (ntp_adjtime, (struct timex *__ntx),
|
||||
___adjtimex64) __nonnull ((1));
|
||||
# else
|
||||
# define adjtimex ___adjtimex64
|
||||
# define ntp_adjtime ___adjtimex64
|
||||
# define ntp_gettime __ntp_gettime64
|
||||
# define ntp_gettimex __ntp_gettimex64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/timex.h */
|
||||
61
board/mentalnet/overlay/usr/include/sys/ttychars.h
Normal file
61
board/mentalnet/overlay/usr/include/sys/ttychars.h
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
/*-
|
||||
* Copyright (c) 1982, 1986, 1990, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 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.
|
||||
*
|
||||
* @(#)ttychars.h 8.2 (Berkeley) 1/4/94
|
||||
*/
|
||||
|
||||
/*
|
||||
* 4.3 COMPATIBILITY FILE
|
||||
*
|
||||
* User visible structures and constants related to terminal handling.
|
||||
*/
|
||||
#ifndef _SYS_TTYCHARS_H
|
||||
#define _SYS_TTYCHARS_H 1
|
||||
|
||||
struct ttychars {
|
||||
char tc_erase; /* erase last character */
|
||||
char tc_kill; /* erase entire line */
|
||||
char tc_intrc; /* interrupt */
|
||||
char tc_quitc; /* quit */
|
||||
char tc_startc; /* start output */
|
||||
char tc_stopc; /* stop output */
|
||||
char tc_eofc; /* end-of-file */
|
||||
char tc_brkc; /* input delimiter (like nl) */
|
||||
char tc_suspc; /* stop process signal */
|
||||
char tc_dsuspc; /* delayed stop process signal */
|
||||
char tc_rprntc; /* reprint line */
|
||||
char tc_flushc; /* flush output (toggles) */
|
||||
char tc_werasc; /* word erase */
|
||||
char tc_lnextc; /* literal next character */
|
||||
};
|
||||
|
||||
#ifdef __USE_OLD_TTY
|
||||
#include <sys/ttydefaults.h> /* to pick up character defaults */
|
||||
#endif
|
||||
|
||||
#endif /* sys/ttychars.h */
|
||||
100
board/mentalnet/overlay/usr/include/sys/ttydefaults.h
Normal file
100
board/mentalnet/overlay/usr/include/sys/ttydefaults.h
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
/*-
|
||||
* Copyright (c) 1982, 1986, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
* (c) UNIX System Laboratories, Inc.
|
||||
* All or some portions of this file are derived from material licensed
|
||||
* to the University of California by American Telephone and Telegraph
|
||||
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
|
||||
* the permission of UNIX System Laboratories, Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 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.
|
||||
*
|
||||
* @(#)ttydefaults.h 8.4 (Berkeley) 1/21/94
|
||||
*/
|
||||
|
||||
/*
|
||||
* System wide defaults for terminal state. Linux version.
|
||||
*/
|
||||
#ifndef _SYS_TTYDEFAULTS_H_
|
||||
#define _SYS_TTYDEFAULTS_H_
|
||||
|
||||
/*
|
||||
* Defaults on "first" open.
|
||||
*/
|
||||
#define TTYDEF_IFLAG (BRKINT | ISTRIP | ICRNL | IMAXBEL | IXON | IXANY)
|
||||
#define TTYDEF_OFLAG (OPOST | ONLCR | XTABS)
|
||||
#define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL)
|
||||
#define TTYDEF_CFLAG (CREAD | CS7 | PARENB | HUPCL)
|
||||
#define TTYDEF_SPEED (B9600)
|
||||
|
||||
/*
|
||||
* Control Character Defaults
|
||||
*/
|
||||
#define CTRL(x) (x&037)
|
||||
#define CEOF CTRL('d')
|
||||
#ifdef _POSIX_VDISABLE
|
||||
# define CEOL _POSIX_VDISABLE
|
||||
#else
|
||||
# define CEOL '\0' /* XXX avoid _POSIX_VDISABLE */
|
||||
#endif
|
||||
#define CERASE 0177
|
||||
#define CINTR CTRL('c')
|
||||
#ifdef _POSIX_VDISABLE
|
||||
# define CSTATUS _POSIX_VDISABLE
|
||||
#else
|
||||
# define CSTATUS '\0' /* XXX avoid _POSIX_VDISABLE */
|
||||
#endif
|
||||
#define CKILL CTRL('u')
|
||||
#define CMIN 1
|
||||
#define CQUIT 034 /* FS, ^\ */
|
||||
#define CSUSP CTRL('z')
|
||||
#define CTIME 0
|
||||
#define CDSUSP CTRL('y')
|
||||
#define CSTART CTRL('q')
|
||||
#define CSTOP CTRL('s')
|
||||
#define CLNEXT CTRL('v')
|
||||
#define CDISCARD CTRL('o')
|
||||
#define CWERASE CTRL('w')
|
||||
#define CREPRINT CTRL('r')
|
||||
#define CEOT CEOF
|
||||
/* compat */
|
||||
#define CBRK CEOL
|
||||
#define CRPRNT CREPRINT
|
||||
#define CFLUSH CDISCARD
|
||||
|
||||
/* PROTECTED INCLUSION ENDS HERE */
|
||||
#endif /* !_SYS_TTYDEFAULTS_H_ */
|
||||
|
||||
/*
|
||||
* #define TTYDEFCHARS to include an array of default control characters.
|
||||
*/
|
||||
#ifdef TTYDEFCHARS
|
||||
cc_t ttydefchars[NCCS] = {
|
||||
CEOF, CEOL, CEOL, CERASE, CWERASE, CKILL, CREPRINT,
|
||||
_POSIX_VDISABLE, CINTR, CQUIT, CSUSP, CDSUSP, CSTART, CSTOP, CLNEXT,
|
||||
CDISCARD, CMIN, CTIME, CSTATUS, _POSIX_VDISABLE
|
||||
};
|
||||
#undef TTYDEFCHARS
|
||||
#endif
|
||||
232
board/mentalnet/overlay/usr/include/sys/types.h
Normal file
232
board/mentalnet/overlay/usr/include/sys/types.h
Normal file
|
|
@ -0,0 +1,232 @@
|
|||
/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
/*
|
||||
* POSIX Standard: 2.6 Primitive System Data Types <sys/types.h>
|
||||
*/
|
||||
|
||||
#ifndef _SYS_TYPES_H
|
||||
#define _SYS_TYPES_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#include <bits/types.h>
|
||||
|
||||
#ifdef __USE_MISC
|
||||
# ifndef __u_char_defined
|
||||
typedef __u_char u_char;
|
||||
typedef __u_short u_short;
|
||||
typedef __u_int u_int;
|
||||
typedef __u_long u_long;
|
||||
typedef __quad_t quad_t;
|
||||
typedef __u_quad_t u_quad_t;
|
||||
typedef __fsid_t fsid_t;
|
||||
# define __u_char_defined
|
||||
# endif
|
||||
typedef __loff_t loff_t;
|
||||
#endif
|
||||
|
||||
#ifndef __ino_t_defined
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
typedef __ino_t ino_t;
|
||||
# else
|
||||
typedef __ino64_t ino_t;
|
||||
# endif
|
||||
# define __ino_t_defined
|
||||
#endif
|
||||
#if defined __USE_LARGEFILE64 && !defined __ino64_t_defined
|
||||
typedef __ino64_t ino64_t;
|
||||
# define __ino64_t_defined
|
||||
#endif
|
||||
|
||||
#ifndef __dev_t_defined
|
||||
typedef __dev_t dev_t;
|
||||
# define __dev_t_defined
|
||||
#endif
|
||||
|
||||
#ifndef __gid_t_defined
|
||||
typedef __gid_t gid_t;
|
||||
# define __gid_t_defined
|
||||
#endif
|
||||
|
||||
#ifndef __mode_t_defined
|
||||
typedef __mode_t mode_t;
|
||||
# define __mode_t_defined
|
||||
#endif
|
||||
|
||||
#ifndef __nlink_t_defined
|
||||
typedef __nlink_t nlink_t;
|
||||
# define __nlink_t_defined
|
||||
#endif
|
||||
|
||||
#ifndef __uid_t_defined
|
||||
typedef __uid_t uid_t;
|
||||
# define __uid_t_defined
|
||||
#endif
|
||||
|
||||
#ifndef __off_t_defined
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
typedef __off_t off_t;
|
||||
# else
|
||||
typedef __off64_t off_t;
|
||||
# endif
|
||||
# define __off_t_defined
|
||||
#endif
|
||||
#if defined __USE_LARGEFILE64 && !defined __off64_t_defined
|
||||
typedef __off64_t off64_t;
|
||||
# define __off64_t_defined
|
||||
#endif
|
||||
|
||||
#ifndef __pid_t_defined
|
||||
typedef __pid_t pid_t;
|
||||
# define __pid_t_defined
|
||||
#endif
|
||||
|
||||
#if (defined __USE_XOPEN || defined __USE_XOPEN2K8) \
|
||||
&& !defined __id_t_defined
|
||||
typedef __id_t id_t;
|
||||
# define __id_t_defined
|
||||
#endif
|
||||
|
||||
#ifndef __ssize_t_defined
|
||||
typedef __ssize_t ssize_t;
|
||||
# define __ssize_t_defined
|
||||
#endif
|
||||
|
||||
#ifdef __USE_MISC
|
||||
# ifndef __daddr_t_defined
|
||||
typedef __daddr_t daddr_t;
|
||||
typedef __caddr_t caddr_t;
|
||||
# define __daddr_t_defined
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if (defined __USE_MISC || defined __USE_XOPEN) && !defined __key_t_defined
|
||||
typedef __key_t key_t;
|
||||
# define __key_t_defined
|
||||
#endif
|
||||
|
||||
#if defined __USE_XOPEN || defined __USE_XOPEN2K8
|
||||
# include <bits/types/clock_t.h>
|
||||
#endif
|
||||
#include <bits/types/clockid_t.h>
|
||||
#include <bits/types/time_t.h>
|
||||
#include <bits/types/timer_t.h>
|
||||
|
||||
#ifdef __USE_XOPEN
|
||||
# ifndef __useconds_t_defined
|
||||
typedef __useconds_t useconds_t;
|
||||
# define __useconds_t_defined
|
||||
# endif
|
||||
# ifndef __suseconds_t_defined
|
||||
typedef __suseconds_t suseconds_t;
|
||||
# define __suseconds_t_defined
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define __need_size_t
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* Old compatibility names for C types. */
|
||||
typedef unsigned long int ulong;
|
||||
typedef unsigned short int ushort;
|
||||
typedef unsigned int uint;
|
||||
#endif
|
||||
|
||||
/* These size-specific names are used by some of the inet code. */
|
||||
|
||||
#include <bits/stdint-intn.h>
|
||||
|
||||
/* These were defined by ISO C without the first `_'. */
|
||||
typedef __uint8_t u_int8_t;
|
||||
typedef __uint16_t u_int16_t;
|
||||
typedef __uint32_t u_int32_t;
|
||||
typedef __uint64_t u_int64_t;
|
||||
|
||||
#if __GNUC_PREREQ (2, 7)
|
||||
typedef int register_t __attribute__ ((__mode__ (__word__)));
|
||||
#else
|
||||
typedef int register_t;
|
||||
#endif
|
||||
|
||||
/* Some code from BIND tests this macro to see if the types above are
|
||||
defined. */
|
||||
#define __BIT_TYPES_DEFINED__ 1
|
||||
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* In BSD <sys/types.h> is expected to define BYTE_ORDER. */
|
||||
# include <endian.h>
|
||||
|
||||
/* It also defines `fd_set' and the FD_* macros for `select'. */
|
||||
# include <sys/select.h>
|
||||
#endif /* Use misc. */
|
||||
|
||||
|
||||
#if (defined __USE_UNIX98 || defined __USE_XOPEN2K8) \
|
||||
&& !defined __blksize_t_defined
|
||||
typedef __blksize_t blksize_t;
|
||||
# define __blksize_t_defined
|
||||
#endif
|
||||
|
||||
/* Types from the Large File Support interface. */
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
# ifndef __blkcnt_t_defined
|
||||
typedef __blkcnt_t blkcnt_t; /* Type to count number of disk blocks. */
|
||||
# define __blkcnt_t_defined
|
||||
# endif
|
||||
# ifndef __fsblkcnt_t_defined
|
||||
typedef __fsblkcnt_t fsblkcnt_t; /* Type to count file system blocks. */
|
||||
# define __fsblkcnt_t_defined
|
||||
# endif
|
||||
# ifndef __fsfilcnt_t_defined
|
||||
typedef __fsfilcnt_t fsfilcnt_t; /* Type to count file system inodes. */
|
||||
# define __fsfilcnt_t_defined
|
||||
# endif
|
||||
#else
|
||||
# ifndef __blkcnt_t_defined
|
||||
typedef __blkcnt64_t blkcnt_t; /* Type to count number of disk blocks. */
|
||||
# define __blkcnt_t_defined
|
||||
# endif
|
||||
# ifndef __fsblkcnt_t_defined
|
||||
typedef __fsblkcnt64_t fsblkcnt_t; /* Type to count file system blocks. */
|
||||
# define __fsblkcnt_t_defined
|
||||
# endif
|
||||
# ifndef __fsfilcnt_t_defined
|
||||
typedef __fsfilcnt64_t fsfilcnt_t; /* Type to count file system inodes. */
|
||||
# define __fsfilcnt_t_defined
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __USE_LARGEFILE64
|
||||
typedef __blkcnt64_t blkcnt64_t; /* Type to count number of disk blocks. */
|
||||
typedef __fsblkcnt64_t fsblkcnt64_t; /* Type to count file system blocks. */
|
||||
typedef __fsfilcnt64_t fsfilcnt64_t; /* Type to count file system inodes. */
|
||||
#endif
|
||||
|
||||
|
||||
/* Now add the thread types. */
|
||||
#if defined __USE_POSIX199506 || defined __USE_UNIX98
|
||||
# include <bits/pthreadtypes.h>
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/types.h */
|
||||
262
board/mentalnet/overlay/usr/include/sys/ucontext.h
Normal file
262
board/mentalnet/overlay/usr/include/sys/ucontext.h
Normal file
|
|
@ -0,0 +1,262 @@
|
|||
/* Copyright (C) 2001-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_UCONTEXT_H
|
||||
#define _SYS_UCONTEXT_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#include <bits/types.h>
|
||||
#include <bits/types/sigset_t.h>
|
||||
#include <bits/types/stack_t.h>
|
||||
|
||||
|
||||
#ifdef __USE_MISC
|
||||
# define __ctx(fld) fld
|
||||
#else
|
||||
# define __ctx(fld) __ ## fld
|
||||
#endif
|
||||
|
||||
#ifdef __x86_64__
|
||||
|
||||
/* Type for general register. */
|
||||
__extension__ typedef long long int greg_t;
|
||||
|
||||
/* Number of general registers. */
|
||||
#define __NGREG 23
|
||||
#ifdef __USE_MISC
|
||||
# define NGREG __NGREG
|
||||
#endif
|
||||
|
||||
/* Container for all general registers. */
|
||||
typedef greg_t gregset_t[__NGREG];
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Number of each register in the `gregset_t' array. */
|
||||
enum
|
||||
{
|
||||
REG_R8 = 0,
|
||||
# define REG_R8 REG_R8
|
||||
REG_R9,
|
||||
# define REG_R9 REG_R9
|
||||
REG_R10,
|
||||
# define REG_R10 REG_R10
|
||||
REG_R11,
|
||||
# define REG_R11 REG_R11
|
||||
REG_R12,
|
||||
# define REG_R12 REG_R12
|
||||
REG_R13,
|
||||
# define REG_R13 REG_R13
|
||||
REG_R14,
|
||||
# define REG_R14 REG_R14
|
||||
REG_R15,
|
||||
# define REG_R15 REG_R15
|
||||
REG_RDI,
|
||||
# define REG_RDI REG_RDI
|
||||
REG_RSI,
|
||||
# define REG_RSI REG_RSI
|
||||
REG_RBP,
|
||||
# define REG_RBP REG_RBP
|
||||
REG_RBX,
|
||||
# define REG_RBX REG_RBX
|
||||
REG_RDX,
|
||||
# define REG_RDX REG_RDX
|
||||
REG_RAX,
|
||||
# define REG_RAX REG_RAX
|
||||
REG_RCX,
|
||||
# define REG_RCX REG_RCX
|
||||
REG_RSP,
|
||||
# define REG_RSP REG_RSP
|
||||
REG_RIP,
|
||||
# define REG_RIP REG_RIP
|
||||
REG_EFL,
|
||||
# define REG_EFL REG_EFL
|
||||
REG_CSGSFS, /* Actually short cs, gs, fs, __pad0. */
|
||||
# define REG_CSGSFS REG_CSGSFS
|
||||
REG_ERR,
|
||||
# define REG_ERR REG_ERR
|
||||
REG_TRAPNO,
|
||||
# define REG_TRAPNO REG_TRAPNO
|
||||
REG_OLDMASK,
|
||||
# define REG_OLDMASK REG_OLDMASK
|
||||
REG_CR2
|
||||
# define REG_CR2 REG_CR2
|
||||
};
|
||||
#endif
|
||||
|
||||
struct _libc_fpxreg
|
||||
{
|
||||
unsigned short int __ctx(significand)[4];
|
||||
unsigned short int __ctx(exponent);
|
||||
unsigned short int __glibc_reserved1[3];
|
||||
};
|
||||
|
||||
struct _libc_xmmreg
|
||||
{
|
||||
__uint32_t __ctx(element)[4];
|
||||
};
|
||||
|
||||
struct _libc_fpstate
|
||||
{
|
||||
/* 64-bit FXSAVE format. */
|
||||
__uint16_t __ctx(cwd);
|
||||
__uint16_t __ctx(swd);
|
||||
__uint16_t __ctx(ftw);
|
||||
__uint16_t __ctx(fop);
|
||||
__uint64_t __ctx(rip);
|
||||
__uint64_t __ctx(rdp);
|
||||
__uint32_t __ctx(mxcsr);
|
||||
__uint32_t __ctx(mxcr_mask);
|
||||
struct _libc_fpxreg _st[8];
|
||||
struct _libc_xmmreg _xmm[16];
|
||||
__uint32_t __glibc_reserved1[24];
|
||||
};
|
||||
|
||||
/* Structure to describe FPU registers. */
|
||||
typedef struct _libc_fpstate *fpregset_t;
|
||||
|
||||
/* Context to describe whole processor state. */
|
||||
typedef struct
|
||||
{
|
||||
gregset_t __ctx(gregs);
|
||||
/* Note that fpregs is a pointer. */
|
||||
fpregset_t __ctx(fpregs);
|
||||
__extension__ unsigned long long __reserved1 [8];
|
||||
} mcontext_t;
|
||||
|
||||
/* Userlevel context. */
|
||||
typedef struct ucontext_t
|
||||
{
|
||||
unsigned long int __ctx(uc_flags);
|
||||
struct ucontext_t *uc_link;
|
||||
stack_t uc_stack;
|
||||
mcontext_t uc_mcontext;
|
||||
sigset_t uc_sigmask;
|
||||
struct _libc_fpstate __fpregs_mem;
|
||||
__extension__ unsigned long long int __ssp[4];
|
||||
} ucontext_t;
|
||||
|
||||
#else /* !__x86_64__ */
|
||||
|
||||
/* Type for general register. */
|
||||
typedef int greg_t;
|
||||
|
||||
/* Number of general registers. */
|
||||
#define __NGREG 19
|
||||
#ifdef __USE_MISC
|
||||
# define NGREG __NGREG
|
||||
#endif
|
||||
|
||||
/* Container for all general registers. */
|
||||
typedef greg_t gregset_t[__NGREG];
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Number of each register is the `gregset_t' array. */
|
||||
enum
|
||||
{
|
||||
REG_GS = 0,
|
||||
# define REG_GS REG_GS
|
||||
REG_FS,
|
||||
# define REG_FS REG_FS
|
||||
REG_ES,
|
||||
# define REG_ES REG_ES
|
||||
REG_DS,
|
||||
# define REG_DS REG_DS
|
||||
REG_EDI,
|
||||
# define REG_EDI REG_EDI
|
||||
REG_ESI,
|
||||
# define REG_ESI REG_ESI
|
||||
REG_EBP,
|
||||
# define REG_EBP REG_EBP
|
||||
REG_ESP,
|
||||
# define REG_ESP REG_ESP
|
||||
REG_EBX,
|
||||
# define REG_EBX REG_EBX
|
||||
REG_EDX,
|
||||
# define REG_EDX REG_EDX
|
||||
REG_ECX,
|
||||
# define REG_ECX REG_ECX
|
||||
REG_EAX,
|
||||
# define REG_EAX REG_EAX
|
||||
REG_TRAPNO,
|
||||
# define REG_TRAPNO REG_TRAPNO
|
||||
REG_ERR,
|
||||
# define REG_ERR REG_ERR
|
||||
REG_EIP,
|
||||
# define REG_EIP REG_EIP
|
||||
REG_CS,
|
||||
# define REG_CS REG_CS
|
||||
REG_EFL,
|
||||
# define REG_EFL REG_EFL
|
||||
REG_UESP,
|
||||
# define REG_UESP REG_UESP
|
||||
REG_SS
|
||||
# define REG_SS REG_SS
|
||||
};
|
||||
#endif
|
||||
|
||||
/* Definitions taken from the kernel headers. */
|
||||
struct _libc_fpreg
|
||||
{
|
||||
unsigned short int __ctx(significand)[4];
|
||||
unsigned short int __ctx(exponent);
|
||||
};
|
||||
|
||||
struct _libc_fpstate
|
||||
{
|
||||
unsigned long int __ctx(cw);
|
||||
unsigned long int __ctx(sw);
|
||||
unsigned long int __ctx(tag);
|
||||
unsigned long int __ctx(ipoff);
|
||||
unsigned long int __ctx(cssel);
|
||||
unsigned long int __ctx(dataoff);
|
||||
unsigned long int __ctx(datasel);
|
||||
struct _libc_fpreg _st[8];
|
||||
unsigned long int __ctx(status);
|
||||
};
|
||||
|
||||
/* Structure to describe FPU registers. */
|
||||
typedef struct _libc_fpstate *fpregset_t;
|
||||
|
||||
/* Context to describe whole processor state. */
|
||||
typedef struct
|
||||
{
|
||||
gregset_t __ctx(gregs);
|
||||
/* Due to Linux's history we have to use a pointer here. The SysV/i386
|
||||
ABI requires a struct with the values. */
|
||||
fpregset_t __ctx(fpregs);
|
||||
unsigned long int __ctx(oldmask);
|
||||
unsigned long int __ctx(cr2);
|
||||
} mcontext_t;
|
||||
|
||||
/* Userlevel context. */
|
||||
typedef struct ucontext_t
|
||||
{
|
||||
unsigned long int __ctx(uc_flags);
|
||||
struct ucontext_t *uc_link;
|
||||
stack_t uc_stack;
|
||||
mcontext_t uc_mcontext;
|
||||
sigset_t uc_sigmask;
|
||||
struct _libc_fpstate __fpregs_mem;
|
||||
unsigned long int __ssp[4];
|
||||
} ucontext_t;
|
||||
|
||||
#endif /* !__x86_64__ */
|
||||
|
||||
#undef __ctx
|
||||
|
||||
#endif /* sys/ucontext.h */
|
||||
182
board/mentalnet/overlay/usr/include/sys/uio.h
Normal file
182
board/mentalnet/overlay/usr/include/sys/uio.h
Normal file
|
|
@ -0,0 +1,182 @@
|
|||
/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_UIO_H
|
||||
#define _SYS_UIO_H 1
|
||||
|
||||
#include <features.h>
|
||||
#include <sys/types.h>
|
||||
#include <bits/types/struct_iovec.h>
|
||||
#include <bits/uio_lim.h>
|
||||
#ifdef __IOV_MAX
|
||||
# define UIO_MAXIOV __IOV_MAX
|
||||
#else
|
||||
# undef UIO_MAXIOV
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Read data from file descriptor FD, and put the result in the
|
||||
buffers described by IOVEC, which is a vector of COUNT 'struct iovec's.
|
||||
The buffers are filled in the order specified.
|
||||
Operates just like 'read' (see <unistd.h>) except that data are
|
||||
put in IOVEC instead of a contiguous buffer.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern ssize_t readv (int __fd, const struct iovec *__iovec, int __count)
|
||||
__wur __attr_access ((__read_only__, 2, 3));
|
||||
|
||||
/* Write data pointed by the buffers described by IOVEC, which
|
||||
is a vector of COUNT 'struct iovec's, to file descriptor FD.
|
||||
The data is written in the order specified.
|
||||
Operates just like 'write' (see <unistd.h>) except that the data
|
||||
are taken from IOVEC instead of a contiguous buffer.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern ssize_t writev (int __fd, const struct iovec *__iovec, int __count)
|
||||
__wur __attr_access ((__read_only__, 2, 3));
|
||||
|
||||
|
||||
#ifdef __USE_MISC
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
/* Read data from file descriptor FD at the given position OFFSET
|
||||
without change the file pointer, and put the result in the buffers
|
||||
described by IOVEC, which is a vector of COUNT 'struct iovec's.
|
||||
The buffers are filled in the order specified. Operates just like
|
||||
'pread' (see <unistd.h>) except that data are put in IOVEC instead
|
||||
of a contiguous buffer.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern ssize_t preadv (int __fd, const struct iovec *__iovec, int __count,
|
||||
__off_t __offset)
|
||||
__wur __attr_access ((__read_only__, 2, 3));
|
||||
|
||||
/* Write data pointed by the buffers described by IOVEC, which is a
|
||||
vector of COUNT 'struct iovec's, to file descriptor FD at the given
|
||||
position OFFSET without change the file pointer. The data is
|
||||
written in the order specified. Operates just like 'pwrite' (see
|
||||
<unistd.h>) except that the data are taken from IOVEC instead of a
|
||||
contiguous buffer.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern ssize_t pwritev (int __fd, const struct iovec *__iovec, int __count,
|
||||
__off_t __offset)
|
||||
__wur __attr_access ((__read_only__, 2, 3));
|
||||
|
||||
# else
|
||||
# ifdef __REDIRECT
|
||||
extern ssize_t __REDIRECT (preadv, (int __fd, const struct iovec *__iovec,
|
||||
int __count, __off64_t __offset),
|
||||
preadv64)
|
||||
__wur __attr_access ((__read_only__, 2, 3));
|
||||
extern ssize_t __REDIRECT (pwritev, (int __fd, const struct iovec *__iovec,
|
||||
int __count, __off64_t __offset),
|
||||
pwritev64)
|
||||
__wur __attr_access ((__read_only__, 2, 3));
|
||||
# else
|
||||
# define preadv preadv64
|
||||
# define pwritev pwritev64
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifdef __USE_LARGEFILE64
|
||||
/* Read data from file descriptor FD at the given position OFFSET
|
||||
without change the file pointer, and put the result in the buffers
|
||||
described by IOVEC, which is a vector of COUNT 'struct iovec's.
|
||||
The buffers are filled in the order specified. Operates just like
|
||||
'pread' (see <unistd.h>) except that data are put in IOVEC instead
|
||||
of a contiguous buffer.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern ssize_t preadv64 (int __fd, const struct iovec *__iovec, int __count,
|
||||
__off64_t __offset)
|
||||
__wur __attr_access ((__read_only__, 2, 3));
|
||||
|
||||
/* Write data pointed by the buffers described by IOVEC, which is a
|
||||
vector of COUNT 'struct iovec's, to file descriptor FD at the given
|
||||
position OFFSET without change the file pointer. The data is
|
||||
written in the order specified. Operates just like 'pwrite' (see
|
||||
<unistd.h>) except that the data are taken from IOVEC instead of a
|
||||
contiguous buffer.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern ssize_t pwritev64 (int __fd, const struct iovec *__iovec, int __count,
|
||||
__off64_t __offset)
|
||||
__wur __attr_access ((__read_only__, 2, 3));
|
||||
# endif
|
||||
#endif /* Use misc. */
|
||||
|
||||
|
||||
#ifdef __USE_GNU
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
/* Same as preadv but with an additional flag argumenti defined at uio.h. */
|
||||
extern ssize_t preadv2 (int __fp, const struct iovec *__iovec, int __count,
|
||||
__off_t __offset, int ___flags)
|
||||
__wur __attr_access ((__read_only__, 2, 3));
|
||||
|
||||
/* Same as preadv but with an additional flag argument defined at uio.h. */
|
||||
extern ssize_t pwritev2 (int __fd, const struct iovec *__iodev, int __count,
|
||||
__off_t __offset, int __flags) __wur;
|
||||
|
||||
# else
|
||||
# ifdef __REDIRECT
|
||||
extern ssize_t __REDIRECT (pwritev2, (int __fd, const struct iovec *__iovec,
|
||||
int __count, __off64_t __offset,
|
||||
int __flags),
|
||||
pwritev64v2)
|
||||
__wur __attr_access ((__read_only__, 2, 3));
|
||||
extern ssize_t __REDIRECT (preadv2, (int __fd, const struct iovec *__iovec,
|
||||
int __count, __off64_t __offset,
|
||||
int __flags),
|
||||
preadv64v2)
|
||||
__wur __attr_access ((__read_only__, 2, 3));
|
||||
# else
|
||||
# define preadv2 preadv64v2
|
||||
# define pwritev2 pwritev64v2
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifdef __USE_LARGEFILE64
|
||||
/* Same as preadv but with an additional flag argumenti defined at uio.h. */
|
||||
extern ssize_t preadv64v2 (int __fp, const struct iovec *__iovec,
|
||||
int __count, __off64_t __offset,
|
||||
int ___flags)
|
||||
__wur __attr_access ((__read_only__, 2, 3));
|
||||
|
||||
/* Same as preadv but with an additional flag argument defined at uio.h. */
|
||||
extern ssize_t pwritev64v2 (int __fd, const struct iovec *__iodev,
|
||||
int __count, __off64_t __offset,
|
||||
int __flags)
|
||||
__wur __attr_access ((__read_only__, 2, 3));
|
||||
# endif
|
||||
#endif /* Use GNU. */
|
||||
|
||||
__END_DECLS
|
||||
|
||||
/* Some operating systems provide system-specific extensions to this
|
||||
header. */
|
||||
#ifdef __USE_GNU
|
||||
# include <bits/uio-ext.h>
|
||||
#endif
|
||||
|
||||
#endif /* sys/uio.h */
|
||||
47
board/mentalnet/overlay/usr/include/sys/un.h
Normal file
47
board/mentalnet/overlay/usr/include/sys/un.h
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_UN_H
|
||||
#define _SYS_UN_H 1
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
/* Get the definition of the macro to define the common sockaddr members. */
|
||||
#include <bits/sockaddr.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Structure describing the address of an AF_LOCAL (aka AF_UNIX) socket. */
|
||||
struct __attribute_struct_may_alias__ sockaddr_un
|
||||
{
|
||||
__SOCKADDR_COMMON (sun_);
|
||||
char sun_path[108]; /* Path name. */
|
||||
};
|
||||
|
||||
|
||||
#ifdef __USE_MISC
|
||||
# include <stddef.h>
|
||||
# include <string.h> /* For prototype of `strlen'. */
|
||||
|
||||
/* Evaluate to actual length of the `sockaddr_un' structure. */
|
||||
# define SUN_LEN(ptr) (offsetof (struct sockaddr_un, sun_path) \
|
||||
+ strlen ((ptr)->sun_path))
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/un.h */
|
||||
1
board/mentalnet/overlay/usr/include/sys/unistd.h
Normal file
1
board/mentalnet/overlay/usr/include/sys/unistd.h
Normal file
|
|
@ -0,0 +1 @@
|
|||
#include <unistd.h>
|
||||
180
board/mentalnet/overlay/usr/include/sys/user.h
Normal file
180
board/mentalnet/overlay/usr/include/sys/user.h
Normal file
|
|
@ -0,0 +1,180 @@
|
|||
/* Copyright (C) 2001-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_USER_H
|
||||
#define _SYS_USER_H 1
|
||||
|
||||
/* The whole purpose of this file is for GDB and GDB only. Don't read
|
||||
too much into it. Don't use it for anything other than GDB unless
|
||||
you know what you are doing. */
|
||||
|
||||
#ifdef __x86_64__
|
||||
|
||||
struct user_fpregs_struct
|
||||
{
|
||||
unsigned short int cwd;
|
||||
unsigned short int swd;
|
||||
unsigned short int ftw;
|
||||
unsigned short int fop;
|
||||
__extension__ unsigned long long int rip;
|
||||
__extension__ unsigned long long int rdp;
|
||||
unsigned int mxcsr;
|
||||
unsigned int mxcr_mask;
|
||||
unsigned int st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */
|
||||
unsigned int xmm_space[64]; /* 16*16 bytes for each XMM-reg = 256 bytes */
|
||||
unsigned int padding[24];
|
||||
};
|
||||
|
||||
struct user_regs_struct
|
||||
{
|
||||
__extension__ unsigned long long int r15;
|
||||
__extension__ unsigned long long int r14;
|
||||
__extension__ unsigned long long int r13;
|
||||
__extension__ unsigned long long int r12;
|
||||
__extension__ unsigned long long int rbp;
|
||||
__extension__ unsigned long long int rbx;
|
||||
__extension__ unsigned long long int r11;
|
||||
__extension__ unsigned long long int r10;
|
||||
__extension__ unsigned long long int r9;
|
||||
__extension__ unsigned long long int r8;
|
||||
__extension__ unsigned long long int rax;
|
||||
__extension__ unsigned long long int rcx;
|
||||
__extension__ unsigned long long int rdx;
|
||||
__extension__ unsigned long long int rsi;
|
||||
__extension__ unsigned long long int rdi;
|
||||
__extension__ unsigned long long int orig_rax;
|
||||
__extension__ unsigned long long int rip;
|
||||
__extension__ unsigned long long int cs;
|
||||
__extension__ unsigned long long int eflags;
|
||||
__extension__ unsigned long long int rsp;
|
||||
__extension__ unsigned long long int ss;
|
||||
__extension__ unsigned long long int fs_base;
|
||||
__extension__ unsigned long long int gs_base;
|
||||
__extension__ unsigned long long int ds;
|
||||
__extension__ unsigned long long int es;
|
||||
__extension__ unsigned long long int fs;
|
||||
__extension__ unsigned long long int gs;
|
||||
};
|
||||
|
||||
struct user
|
||||
{
|
||||
struct user_regs_struct regs;
|
||||
int u_fpvalid;
|
||||
struct user_fpregs_struct i387;
|
||||
__extension__ unsigned long long int u_tsize;
|
||||
__extension__ unsigned long long int u_dsize;
|
||||
__extension__ unsigned long long int u_ssize;
|
||||
__extension__ unsigned long long int start_code;
|
||||
__extension__ unsigned long long int start_stack;
|
||||
__extension__ long long int signal;
|
||||
int reserved;
|
||||
__extension__ union
|
||||
{
|
||||
struct user_regs_struct* u_ar0;
|
||||
__extension__ unsigned long long int __u_ar0_word;
|
||||
};
|
||||
__extension__ union
|
||||
{
|
||||
struct user_fpregs_struct* u_fpstate;
|
||||
__extension__ unsigned long long int __u_fpstate_word;
|
||||
};
|
||||
__extension__ unsigned long long int magic;
|
||||
char u_comm [32];
|
||||
__extension__ unsigned long long int u_debugreg [8];
|
||||
};
|
||||
|
||||
#else
|
||||
/* These are the 32-bit x86 structures. */
|
||||
struct user_fpregs_struct
|
||||
{
|
||||
long int cwd;
|
||||
long int swd;
|
||||
long int twd;
|
||||
long int fip;
|
||||
long int fcs;
|
||||
long int foo;
|
||||
long int fos;
|
||||
long int st_space [20];
|
||||
};
|
||||
|
||||
struct user_fpxregs_struct
|
||||
{
|
||||
unsigned short int cwd;
|
||||
unsigned short int swd;
|
||||
unsigned short int twd;
|
||||
unsigned short int fop;
|
||||
long int fip;
|
||||
long int fcs;
|
||||
long int foo;
|
||||
long int fos;
|
||||
long int mxcsr;
|
||||
long int reserved;
|
||||
long int st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */
|
||||
long int xmm_space[32]; /* 8*16 bytes for each XMM-reg = 128 bytes */
|
||||
long int padding[56];
|
||||
};
|
||||
|
||||
struct user_regs_struct
|
||||
{
|
||||
long int ebx;
|
||||
long int ecx;
|
||||
long int edx;
|
||||
long int esi;
|
||||
long int edi;
|
||||
long int ebp;
|
||||
long int eax;
|
||||
long int xds;
|
||||
long int xes;
|
||||
long int xfs;
|
||||
long int xgs;
|
||||
long int orig_eax;
|
||||
long int eip;
|
||||
long int xcs;
|
||||
long int eflags;
|
||||
long int esp;
|
||||
long int xss;
|
||||
};
|
||||
|
||||
struct user
|
||||
{
|
||||
struct user_regs_struct regs;
|
||||
int u_fpvalid;
|
||||
struct user_fpregs_struct i387;
|
||||
unsigned long int u_tsize;
|
||||
unsigned long int u_dsize;
|
||||
unsigned long int u_ssize;
|
||||
unsigned long int start_code;
|
||||
unsigned long int start_stack;
|
||||
long int signal;
|
||||
int reserved;
|
||||
struct user_regs_struct* u_ar0;
|
||||
struct user_fpregs_struct* u_fpstate;
|
||||
unsigned long int magic;
|
||||
char u_comm [32];
|
||||
int u_debugreg [8];
|
||||
};
|
||||
#endif /* __x86_64__ */
|
||||
|
||||
#define PAGE_SHIFT 12
|
||||
#define PAGE_SIZE (1UL << PAGE_SHIFT)
|
||||
#define PAGE_MASK (~(PAGE_SIZE-1))
|
||||
#define NBPG PAGE_SIZE
|
||||
#define UPAGES 1
|
||||
#define HOST_TEXT_START_ADDR (u.start_code)
|
||||
#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
|
||||
|
||||
#endif /* _SYS_USER_H */
|
||||
86
board/mentalnet/overlay/usr/include/sys/utsname.h
Normal file
86
board/mentalnet/overlay/usr/include/sys/utsname.h
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
/*
|
||||
* POSIX Standard: 4.4 System Identification <sys/utsname.h>
|
||||
*/
|
||||
|
||||
#ifndef _SYS_UTSNAME_H
|
||||
#define _SYS_UTSNAME_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#include <bits/utsname.h>
|
||||
|
||||
#ifndef _UTSNAME_SYSNAME_LENGTH
|
||||
# define _UTSNAME_SYSNAME_LENGTH _UTSNAME_LENGTH
|
||||
#endif
|
||||
#ifndef _UTSNAME_NODENAME_LENGTH
|
||||
# define _UTSNAME_NODENAME_LENGTH _UTSNAME_LENGTH
|
||||
#endif
|
||||
#ifndef _UTSNAME_RELEASE_LENGTH
|
||||
# define _UTSNAME_RELEASE_LENGTH _UTSNAME_LENGTH
|
||||
#endif
|
||||
#ifndef _UTSNAME_VERSION_LENGTH
|
||||
# define _UTSNAME_VERSION_LENGTH _UTSNAME_LENGTH
|
||||
#endif
|
||||
#ifndef _UTSNAME_MACHINE_LENGTH
|
||||
# define _UTSNAME_MACHINE_LENGTH _UTSNAME_LENGTH
|
||||
#endif
|
||||
|
||||
/* Structure describing the system and machine. */
|
||||
struct utsname
|
||||
{
|
||||
/* Name of the implementation of the operating system. */
|
||||
char sysname[_UTSNAME_SYSNAME_LENGTH];
|
||||
|
||||
/* Name of this node on the network. */
|
||||
char nodename[_UTSNAME_NODENAME_LENGTH];
|
||||
|
||||
/* Current release level of this implementation. */
|
||||
char release[_UTSNAME_RELEASE_LENGTH];
|
||||
/* Current version level of this release. */
|
||||
char version[_UTSNAME_VERSION_LENGTH];
|
||||
|
||||
/* Name of the hardware type the system is running on. */
|
||||
char machine[_UTSNAME_MACHINE_LENGTH];
|
||||
|
||||
#if _UTSNAME_DOMAIN_LENGTH - 0
|
||||
/* Name of the domain of this node on the network. */
|
||||
# ifdef __USE_GNU
|
||||
char domainname[_UTSNAME_DOMAIN_LENGTH];
|
||||
# else
|
||||
char __domainname[_UTSNAME_DOMAIN_LENGTH];
|
||||
# endif
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* Note that SVID assumes all members have the same size. */
|
||||
# define SYS_NMLN _UTSNAME_LENGTH
|
||||
#endif
|
||||
|
||||
|
||||
/* Put information about the system in NAME. */
|
||||
extern int uname (struct utsname *__name) __THROW;
|
||||
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/utsname.h */
|
||||
4
board/mentalnet/overlay/usr/include/sys/vfs.h
Normal file
4
board/mentalnet/overlay/usr/include/sys/vfs.h
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
/* Other systems declare `struct statfs' et al in <sys/vfs.h>,
|
||||
so we have this file to be compatible with programs expecting it. */
|
||||
|
||||
#include <sys/statfs.h>
|
||||
67
board/mentalnet/overlay/usr/include/sys/vlimit.h
Normal file
67
board/mentalnet/overlay/usr/include/sys/vlimit.h
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_VLIMIT_H
|
||||
#define _SYS_VLIMIT_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* This interface is obsolete, and is superseded by <sys/resource.h>. */
|
||||
|
||||
/* Kinds of resource limit. */
|
||||
enum __vlimit_resource
|
||||
{
|
||||
/* Setting this non-zero makes it impossible to raise limits.
|
||||
Only the super-use can set it to zero.
|
||||
|
||||
This is not implemented in recent versions of BSD, nor by
|
||||
the GNU C library. */
|
||||
LIM_NORAISE,
|
||||
|
||||
/* CPU time available for each process (seconds). */
|
||||
LIM_CPU,
|
||||
|
||||
/* Largest file which can be created (bytes). */
|
||||
LIM_FSIZE,
|
||||
|
||||
/* Maximum size of the data segment (bytes). */
|
||||
LIM_DATA,
|
||||
|
||||
/* Maximum size of the stack segment (bytes). */
|
||||
LIM_STACK,
|
||||
|
||||
/* Largest core file that will be created (bytes). */
|
||||
LIM_CORE,
|
||||
|
||||
/* Resident set size (bytes). */
|
||||
LIM_MAXRSS
|
||||
};
|
||||
|
||||
/* This means no limit. */
|
||||
#define INFINITY 0x7fffffff
|
||||
|
||||
|
||||
/* Set the soft limit for RESOURCE to be VALUE.
|
||||
Returns 0 for success, -1 for failure. */
|
||||
extern int vlimit (enum __vlimit_resource __resource, int __value) __THROW;
|
||||
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/vlimit.h */
|
||||
38
board/mentalnet/overlay/usr/include/sys/vm86.h
Normal file
38
board/mentalnet/overlay/usr/include/sys/vm86.h
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
/* Copyright (C) 1996-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_VM86_H
|
||||
|
||||
#define _SYS_VM86_H 1
|
||||
#include <features.h>
|
||||
|
||||
#ifdef __x86_64__
|
||||
# error This header is unsupported on x86-64.
|
||||
#else
|
||||
/* Get constants and data types from kernel header file. */
|
||||
# include <asm/vm86.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Enter virtual 8086 mode. */
|
||||
extern int vm86 (unsigned long int __subfunction,
|
||||
struct vm86plus_struct *__info) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
# endif
|
||||
|
||||
#endif /* _SYS_VM86_H */
|
||||
1
board/mentalnet/overlay/usr/include/sys/vt.h
Normal file
1
board/mentalnet/overlay/usr/include/sys/vt.h
Normal file
|
|
@ -0,0 +1 @@
|
|||
#include <linux/vt.h>
|
||||
175
board/mentalnet/overlay/usr/include/sys/wait.h
Normal file
175
board/mentalnet/overlay/usr/include/sys/wait.h
Normal file
|
|
@ -0,0 +1,175 @@
|
|||
/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
/*
|
||||
* POSIX Standard: 3.2.1 Wait for Process Termination <sys/wait.h>
|
||||
*/
|
||||
|
||||
#ifndef _SYS_WAIT_H
|
||||
#define _SYS_WAIT_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#include <bits/types.h>
|
||||
#ifndef __pid_t_defined
|
||||
typedef __pid_t pid_t;
|
||||
# define __pid_t_defined
|
||||
#endif
|
||||
|
||||
#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
|
||||
# include <signal.h>
|
||||
#endif
|
||||
|
||||
#if defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8
|
||||
/* Some older standards require the contents of struct rusage to be
|
||||
defined here. */
|
||||
# include <bits/types/struct_rusage.h>
|
||||
#endif
|
||||
|
||||
/* These macros could also be defined in <stdlib.h>. */
|
||||
#if !defined _STDLIB_H || (!defined __USE_XOPEN && !defined __USE_XOPEN2K8)
|
||||
/* This will define the `W*' macros for the flag
|
||||
bits to `waitpid', `wait3', and `wait4'. */
|
||||
# include <bits/waitflags.h>
|
||||
|
||||
/* This will define all the `__W*' macros. */
|
||||
# include <bits/waitstatus.h>
|
||||
|
||||
# define WEXITSTATUS(status) __WEXITSTATUS (status)
|
||||
# define WTERMSIG(status) __WTERMSIG (status)
|
||||
# define WSTOPSIG(status) __WSTOPSIG (status)
|
||||
# define WIFEXITED(status) __WIFEXITED (status)
|
||||
# define WIFSIGNALED(status) __WIFSIGNALED (status)
|
||||
# define WIFSTOPPED(status) __WIFSTOPPED (status)
|
||||
# ifdef __WIFCONTINUED
|
||||
# define WIFCONTINUED(status) __WIFCONTINUED (status)
|
||||
# endif
|
||||
#endif /* <stdlib.h> not included. */
|
||||
|
||||
#ifdef __USE_MISC
|
||||
# define WCOREFLAG __WCOREFLAG
|
||||
# define WCOREDUMP(status) __WCOREDUMP (status)
|
||||
# define W_EXITCODE(ret, sig) __W_EXITCODE (ret, sig)
|
||||
# define W_STOPCODE(sig) __W_STOPCODE (sig)
|
||||
#endif
|
||||
|
||||
/* The following values are used by the `waitid' function. */
|
||||
#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
|
||||
# include <bits/types/idtype_t.h>
|
||||
#endif
|
||||
|
||||
|
||||
/* Wait for a child to die. When one does, put its status in *STAT_LOC
|
||||
and return its process ID. For errors, return (pid_t) -1.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern __pid_t wait (int *__stat_loc);
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* Special values for the PID argument to `waitpid' and `wait4'. */
|
||||
# define WAIT_ANY (-1) /* Any process. */
|
||||
# define WAIT_MYPGRP 0 /* Any process in my process group. */
|
||||
#endif
|
||||
|
||||
/* Wait for a child matching PID to die.
|
||||
If PID is greater than 0, match any process whose process ID is PID.
|
||||
If PID is (pid_t) -1, match any process.
|
||||
If PID is (pid_t) 0, match any process with the
|
||||
same process group as the current process.
|
||||
If PID is less than -1, match any process whose
|
||||
process group is the absolute value of PID.
|
||||
If the WNOHANG bit is set in OPTIONS, and that child
|
||||
is not already dead, return (pid_t) 0. If successful,
|
||||
return PID and store the dead child's status in STAT_LOC.
|
||||
Return (pid_t) -1 for errors. If the WUNTRACED bit is
|
||||
set in OPTIONS, return status for stopped children; otherwise don't.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options);
|
||||
|
||||
#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
|
||||
# ifndef __id_t_defined
|
||||
typedef __id_t id_t;
|
||||
# define __id_t_defined
|
||||
# endif
|
||||
|
||||
# include <bits/types/siginfo_t.h>
|
||||
|
||||
/* Wait for a childing matching IDTYPE and ID to change the status and
|
||||
place appropriate information in *INFOP.
|
||||
If IDTYPE is P_PID, match any process whose process ID is ID.
|
||||
If IDTYPE is P_PGID, match any process whose process group is ID.
|
||||
If IDTYPE is P_ALL, match any process.
|
||||
If the WNOHANG bit is set in OPTIONS, and that child
|
||||
is not already dead, clear *INFOP and return 0. If successful, store
|
||||
exit code and status in *INFOP.
|
||||
|
||||
This function is a cancellation point and therefore not marked with
|
||||
__THROW. */
|
||||
extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop,
|
||||
int __options);
|
||||
#endif
|
||||
|
||||
#if defined __USE_MISC \
|
||||
|| (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K)
|
||||
/* This being here makes the prototypes valid whether or not
|
||||
we have already included <sys/resource.h> to define `struct rusage'. */
|
||||
struct rusage;
|
||||
|
||||
/* Wait for a child to exit. When one does, put its status in *STAT_LOC and
|
||||
return its process ID. For errors return (pid_t) -1. If USAGE is not
|
||||
nil, store information about the child's resource usage there. If the
|
||||
WUNTRACED bit is set in OPTIONS, return status for stopped children;
|
||||
otherwise don't. */
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
extern __pid_t wait3 (int *__stat_loc, int __options,
|
||||
struct rusage * __usage) __THROWNL;
|
||||
# else
|
||||
# ifdef __REDIRECT_NTHNL
|
||||
extern __pid_t __REDIRECT_NTHNL (wait3, (int *__stat_loc, int __options,
|
||||
struct rusage * __usage),
|
||||
__wait3_time64);
|
||||
# else
|
||||
# define wait3 __wait3_time64
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __USE_MISC
|
||||
# ifndef __USE_TIME64_REDIRECTS
|
||||
/* PID is like waitpid. Other args are like wait3. */
|
||||
extern __pid_t wait4 (__pid_t __pid, int *__stat_loc, int __options,
|
||||
struct rusage *__usage) __THROWNL;
|
||||
# else
|
||||
# ifdef __REDIRECT_NTHNL
|
||||
extern __pid_t __REDIRECT_NTHNL (wait4, (__pid_t __pid, int *__stat_loc,
|
||||
int __options, struct rusage *__usage),
|
||||
__wait4_time64);
|
||||
# else
|
||||
# define wait4 __wait4_time64
|
||||
# endif
|
||||
# endif
|
||||
#endif /* Use misc. */
|
||||
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/wait.h */
|
||||
109
board/mentalnet/overlay/usr/include/sys/xattr.h
Normal file
109
board/mentalnet/overlay/usr/include/sys/xattr.h
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
/* Copyright (C) 2002-2025 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_XATTR_H
|
||||
#define _SYS_XATTR_H 1
|
||||
|
||||
#include <features.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* The following constants should be used for the fifth parameter of
|
||||
`*setxattr'. */
|
||||
#ifndef __USE_KERNEL_XATTR_DEFS
|
||||
enum
|
||||
{
|
||||
XATTR_CREATE = 1, /* set value, fail if attr already exists. */
|
||||
#define XATTR_CREATE XATTR_CREATE
|
||||
XATTR_REPLACE = 2 /* set value, fail if attr does not exist. */
|
||||
#define XATTR_REPLACE XATTR_REPLACE
|
||||
};
|
||||
#endif
|
||||
|
||||
/* Set the attribute NAME of the file pointed to by PATH to VALUE (which
|
||||
is SIZE bytes long). Return 0 on success, -1 for errors. */
|
||||
extern int setxattr (const char *__path, const char *__name,
|
||||
const void *__value, size_t __size, int __flags)
|
||||
__THROW __attr_access ((__read_only__, 3, 4));
|
||||
|
||||
/* Set the attribute NAME of the file pointed to by PATH to VALUE (which is
|
||||
SIZE bytes long), not following symlinks for the last pathname component.
|
||||
Return 0 on success, -1 for errors. */
|
||||
extern int lsetxattr (const char *__path, const char *__name,
|
||||
const void *__value, size_t __size, int __flags)
|
||||
__THROW __attr_access ((__read_only__, 3, 4));
|
||||
|
||||
/* Set the attribute NAME of the file descriptor FD to VALUE (which is SIZE
|
||||
bytes long). Return 0 on success, -1 for errors. */
|
||||
extern int fsetxattr (int __fd, const char *__name, const void *__value,
|
||||
size_t __size, int __flags)
|
||||
__THROW __attr_access ((__read_only__, 3, 4));
|
||||
|
||||
/* Get the attribute NAME of the file pointed to by PATH to VALUE (which is
|
||||
SIZE bytes long). Return 0 on success, -1 for errors. */
|
||||
extern ssize_t getxattr (const char *__path, const char *__name,
|
||||
void *__value, size_t __size)
|
||||
__THROW __attr_access ((__write_only__, 3, 4));
|
||||
|
||||
/* Get the attribute NAME of the file pointed to by PATH to VALUE (which is
|
||||
SIZE bytes long), not following symlinks for the last pathname component.
|
||||
Return 0 on success, -1 for errors. */
|
||||
extern ssize_t lgetxattr (const char *__path, const char *__name,
|
||||
void *__value, size_t __size)
|
||||
__THROW __attr_access ((__write_only__, 3, 4));
|
||||
|
||||
/* Get the attribute NAME of the file descriptor FD to VALUE (which is SIZE
|
||||
bytes long). Return 0 on success, -1 for errors. */
|
||||
extern ssize_t fgetxattr (int __fd, const char *__name, void *__value,
|
||||
size_t __size)
|
||||
__THROW __attr_access ((__write_only__, 3, 4));
|
||||
|
||||
/* List attributes of the file pointed to by PATH into the user-supplied
|
||||
buffer LIST (which is SIZE bytes big). Return 0 on success, -1 for
|
||||
errors. */
|
||||
extern ssize_t listxattr (const char *__path, char *__list, size_t __size)
|
||||
__THROW __attr_access ((__write_only__, 2, 3));
|
||||
|
||||
/* List attributes of the file pointed to by PATH into the user-supplied
|
||||
buffer LIST (which is SIZE bytes big), not following symlinks for the
|
||||
last pathname component. Return 0 on success, -1 for errors. */
|
||||
extern ssize_t llistxattr (const char *__path, char *__list, size_t __size)
|
||||
__THROW __attr_access ((__write_only__, 2, 3));
|
||||
|
||||
/* List attributes of the file descriptor FD into the user-supplied buffer
|
||||
LIST (which is SIZE bytes big). Return 0 on success, -1 for errors. */
|
||||
extern ssize_t flistxattr (int __fd, char *__list, size_t __size)
|
||||
__THROW __attr_access ((__write_only__, 2, 3));
|
||||
|
||||
/* Remove the attribute NAME from the file pointed to by PATH. Return 0
|
||||
on success, -1 for errors. */
|
||||
extern int removexattr (const char *__path, const char *__name) __THROW;
|
||||
|
||||
/* Remove the attribute NAME from the file pointed to by PATH, not
|
||||
following symlinks for the last pathname component. Return 0 on
|
||||
success, -1 for errors. */
|
||||
extern int lremovexattr (const char *__path, const char *__name) __THROW;
|
||||
|
||||
/* Remove the attribute NAME from the file descriptor FD. Return 0 on
|
||||
success, -1 for errors. */
|
||||
extern int fremovexattr (int __fd, const char *__name) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/xattr.h */
|
||||
Loading…
Add table
Add a link
Reference in a new issue