mirror of
https://github.com/Wind4/vlmcsd.git
synced 2025-07-03 17:27:56 +08:00
vlmcsd-svn1065-2016-10-12-Hotbird64
This commit is contained in:
@ -0,0 +1,108 @@
|
||||
/* Copyright (C) 1996-2016 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
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_ACCT_H
|
||||
#define _SYS_ACCT_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#include <endian.h>
|
||||
#define __need_time_t
|
||||
#include <time.h>
|
||||
#include <sys/types.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 u_int16_t comp_t;
|
||||
|
||||
struct acct
|
||||
{
|
||||
char ac_flag; /* Flags. */
|
||||
u_int16_t ac_uid; /* Real user ID. */
|
||||
u_int16_t ac_gid; /* Real group ID. */
|
||||
u_int16_t ac_tty; /* Controlling terminal. */
|
||||
u_int32_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. */
|
||||
u_int32_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 */
|
||||
u_int16_t ac_tty; /* Control Terminal */
|
||||
u_int32_t ac_exitcode; /* Exitcode */
|
||||
u_int32_t ac_uid; /* Real User ID */
|
||||
u_int32_t ac_gid; /* Real Group ID */
|
||||
u_int32_t ac_pid; /* Process ID */
|
||||
u_int32_t ac_ppid; /* Parent Process ID */
|
||||
u_int32_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. */
|
||||
};
|
||||
|
||||
#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 */
|
@ -0,0 +1,130 @@
|
||||
/*
|
||||
File: sys/acl.h
|
||||
|
||||
(C) 1999 Andreas Gruenbacher, <a.gruenbacher@computer.org>
|
||||
|
||||
This program 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.
|
||||
|
||||
This program 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. the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __SYS_ACL_H
|
||||
#define __SYS_ACL_H
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*=== Data types ===*/
|
||||
|
||||
struct __acl_ext;
|
||||
struct __acl_entry_ext;
|
||||
struct __acl_permset_ext;
|
||||
|
||||
typedef unsigned int acl_type_t;
|
||||
typedef int acl_tag_t;
|
||||
typedef unsigned int acl_perm_t;
|
||||
|
||||
typedef struct __acl_ext *acl_t;
|
||||
typedef struct __acl_entry_ext *acl_entry_t;
|
||||
typedef struct __acl_permset_ext *acl_permset_t;
|
||||
|
||||
/*=== Constants ===*/
|
||||
|
||||
/* 23.2.2 acl_perm_t values */
|
||||
|
||||
#define ACL_READ (0x04)
|
||||
#define ACL_WRITE (0x02)
|
||||
#define ACL_EXECUTE (0x01)
|
||||
//#define ACL_ADD (0x08)
|
||||
//#define ACL_DELETE (0x10)
|
||||
|
||||
/* 23.2.5 acl_tag_t values */
|
||||
|
||||
#define ACL_UNDEFINED_TAG (0x00)
|
||||
#define ACL_USER_OBJ (0x01)
|
||||
#define ACL_USER (0x02)
|
||||
#define ACL_GROUP_OBJ (0x04)
|
||||
#define ACL_GROUP (0x08)
|
||||
#define ACL_MASK (0x10)
|
||||
#define ACL_OTHER (0x20)
|
||||
|
||||
/* 23.3.6 acl_type_t values */
|
||||
|
||||
#define ACL_TYPE_ACCESS (0x8000)
|
||||
#define ACL_TYPE_DEFAULT (0x4000)
|
||||
|
||||
/* 23.2.7 ACL qualifier constants */
|
||||
|
||||
#define ACL_UNDEFINED_ID ((id_t)-1)
|
||||
|
||||
/* 23.2.8 ACL Entry Constants */
|
||||
|
||||
#define ACL_FIRST_ENTRY 0
|
||||
#define ACL_NEXT_ENTRY 1
|
||||
|
||||
/*=== ACL manipulation ===*/
|
||||
|
||||
extern acl_t acl_init(int count);
|
||||
extern acl_t acl_dup(acl_t acl);
|
||||
extern int acl_free(void *obj_p);
|
||||
extern int acl_valid(acl_t acl);
|
||||
|
||||
/*=== Entry manipulation ===*/
|
||||
|
||||
extern int
|
||||
acl_copy_entry(acl_entry_t dest_d, acl_entry_t src_d);
|
||||
extern int acl_create_entry(acl_t *acl_p, acl_entry_t *entry_p);
|
||||
extern int acl_delete_entry(acl_t acl, acl_entry_t entry_d);
|
||||
extern int acl_get_entry(acl_t acl, int entry_id, acl_entry_t *entry_p);
|
||||
|
||||
/* Manipulate ACL entry permissions */
|
||||
|
||||
extern int acl_add_perm(acl_permset_t permset_d, acl_perm_t perm);
|
||||
extern int acl_calc_mask(acl_t *acl_p);
|
||||
extern int acl_clear_perms(acl_permset_t permset_d);
|
||||
extern int acl_delete_perm(acl_permset_t permset_d, acl_perm_t perm);
|
||||
extern int acl_get_permset(acl_entry_t entry_d, acl_permset_t *permset_p);
|
||||
extern int acl_set_permset(acl_entry_t entry_d, acl_permset_t permset_d);
|
||||
|
||||
/* Manipulate ACL entry tag type and qualifier */
|
||||
|
||||
extern void * acl_get_qualifier(acl_entry_t entry_d);
|
||||
extern int acl_get_tag_type(acl_entry_t entry_d, acl_tag_t *tag_type_p);
|
||||
extern int acl_set_qualifier(acl_entry_t entry_d, const void *tag_qualifier_p);
|
||||
extern int acl_set_tag_type(acl_entry_t entry_d, acl_tag_t tag_type);
|
||||
|
||||
/*=== Format translation ===*/
|
||||
|
||||
extern ssize_t acl_copy_ext(void *buf_p, acl_t acl, ssize_t size);
|
||||
extern acl_t acl_copy_int(const void *buf_p);
|
||||
extern acl_t acl_from_text(const char *buf_p);
|
||||
extern ssize_t acl_size(acl_t acl);
|
||||
extern char *acl_to_text(acl_t acl, ssize_t *len_p);
|
||||
|
||||
/*=== Object manipulation ===*/
|
||||
|
||||
extern int acl_delete_def_file(const char *path_p);
|
||||
extern acl_t acl_get_fd(int fd);
|
||||
extern acl_t acl_get_file(const char *path_p, acl_type_t type);
|
||||
extern int acl_set_fd(int fd, acl_t acl);
|
||||
extern int acl_set_file(const char *path_p, acl_type_t type, acl_t acl);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __SYS_ACL_H */
|
||||
|
@ -0,0 +1,2 @@
|
||||
#warning This header is deprecated, use <alsa/asoundlib.h> instead.
|
||||
#include <alsa/asoundlib.h>
|
@ -0,0 +1,37 @@
|
||||
/* Access to the auxiliary vector.
|
||||
Copyright (C) 2012-2016 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
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_AUXV_H
|
||||
#define _SYS_AUXV_H 1
|
||||
|
||||
#include <elf.h>
|
||||
#include <bits/auxv.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 */
|
@ -0,0 +1,3 @@
|
||||
/* The GNU <sys/types.h> defines all the necessary types. */
|
||||
|
||||
#include <sys/types.h>
|
@ -0,0 +1,128 @@
|
||||
/*
|
||||
* <sys/capability.h>
|
||||
*
|
||||
* Copyright (C) 1997 Aleph One
|
||||
* Copyright (C) 1997-8,2008 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
|
||||
|
||||
/*
|
||||
* This file complements the kernel file by providing prototype
|
||||
* information for the user library.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#ifndef __user
|
||||
#define __user
|
||||
#endif
|
||||
#include <linux/capability.h>
|
||||
#include <sys/xattr.h>
|
||||
#include <linux/xattr.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;
|
||||
|
||||
/*
|
||||
* 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;
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* libcap/cap_alloc.c */
|
||||
extern cap_t cap_dup(cap_t);
|
||||
extern int cap_free(void *);
|
||||
extern cap_t cap_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);
|
||||
|
||||
/* libcap/cap_file.c */
|
||||
extern cap_t cap_get_fd(int);
|
||||
extern cap_t cap_get_file(const char *);
|
||||
extern int cap_set_fd(int, cap_t);
|
||||
extern int cap_set_file(const char *, cap_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)
|
||||
|
||||
/* libcap/cap_extint.c */
|
||||
extern ssize_t cap_size(cap_t);
|
||||
extern ssize_t cap_copy_ext(void *, cap_t, ssize_t);
|
||||
extern cap_t cap_copy_int(const void *);
|
||||
|
||||
/* 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);
|
||||
|
||||
#define CAP_DIFFERS(result, flag) (((result) & (1 << (flag))) != 0)
|
||||
extern int cap_compare(cap_t, cap_t);
|
||||
|
||||
/* system calls - look to libc for function to system call mapping */
|
||||
extern int capset(cap_user_header_t header, cap_user_data_t data);
|
||||
extern int capget(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 */
|
@ -0,0 +1,444 @@
|
||||
/* Copyright (C) 1992-2016 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
|
||||
<http://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
|
||||
anymore supported. */
|
||||
#if defined __GNUC__ && !defined __STDC__
|
||||
# error "You need a ISO C conforming compiler to use the glibc headers"
|
||||
#endif
|
||||
|
||||
/* Some user header file might have defined this before. */
|
||||
#undef __P
|
||||
#undef __PMT
|
||||
|
||||
#ifdef __GNUC__
|
||||
|
||||
/* 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 works only with
|
||||
gcc 2.8.x and egcs. For gcc 3.2 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, 3)
|
||||
# define __THROW __attribute__ ((__nothrow__ __LEAF))
|
||||
# define __THROWNL __attribute__ ((__nothrow__))
|
||||
# define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct
|
||||
# else
|
||||
# if defined __cplusplus && __GNUC_PREREQ (2,8)
|
||||
# define __THROW throw ()
|
||||
# define __THROWNL throw ()
|
||||
# define __NTH(fct) __LEAF_ATTR fct throw ()
|
||||
# else
|
||||
# define __THROW
|
||||
# define __THROWNL
|
||||
# define __NTH(fct) fct
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#else /* Not GCC. */
|
||||
|
||||
# define __inline /* No inline functions. */
|
||||
|
||||
# define __THROW
|
||||
# define __THROWNL
|
||||
# define __NTH(fct) fct
|
||||
|
||||
#endif /* GCC. */
|
||||
|
||||
/* 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 *
|
||||
#define __long_double_t long double
|
||||
|
||||
|
||||
/* 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 standard library needs the functions from the ISO C90 standard
|
||||
in the std namespace. At the same time we want to be safe for
|
||||
future changes and we include the ISO C99 code in the non-standard
|
||||
namespace __c99. The C++ wrapper header take case of adding the
|
||||
definitions to the global namespace. */
|
||||
#if defined __cplusplus && defined _GLIBCPP_USE_NAMESPACES
|
||||
# define __BEGIN_NAMESPACE_STD namespace std {
|
||||
# define __END_NAMESPACE_STD }
|
||||
# define __USING_NAMESPACE_STD(name) using std::name;
|
||||
# define __BEGIN_NAMESPACE_C99 namespace __c99 {
|
||||
# define __END_NAMESPACE_C99 }
|
||||
# define __USING_NAMESPACE_C99(name) using __c99::name;
|
||||
#else
|
||||
/* For compatibility we do not add the declarations into any
|
||||
namespace. They will end up in the global namespace which is what
|
||||
old code expects. */
|
||||
# define __BEGIN_NAMESPACE_STD
|
||||
# define __END_NAMESPACE_STD
|
||||
# define __USING_NAMESPACE_STD(name)
|
||||
# define __BEGIN_NAMESPACE_C99
|
||||
# define __END_NAMESPACE_C99
|
||||
# define __USING_NAMESPACE_C99(name)
|
||||
#endif
|
||||
|
||||
|
||||
/* Fortify support. */
|
||||
#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
|
||||
#define __bos0(ptr) __builtin_object_size (ptr, 0)
|
||||
|
||||
#if __GNUC_PREREQ (4,3)
|
||||
# define __warndecl(name, msg) \
|
||||
extern void name (void) __attribute__((__warning__ (msg)))
|
||||
# define __warnattr(msg) __attribute__((__warning__ (msg)))
|
||||
# define __errordecl(name, msg) \
|
||||
extern void name (void) __attribute__((__error__ (msg)))
|
||||
#else
|
||||
# define __warndecl(name, msg) extern void name (void)
|
||||
# define __warnattr(msg)
|
||||
# define __errordecl(name, msg) extern void name (void)
|
||||
#endif
|
||||
|
||||
/* Support for flexible arrays. */
|
||||
#if __GNUC_PREREQ (2,97)
|
||||
/* GCC 2.97 supports C99 flexible array members. */
|
||||
# define __flexarr []
|
||||
#else
|
||||
# ifdef __GNUC__
|
||||
# define __flexarr [0]
|
||||
# else
|
||||
# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
|
||||
# define __flexarr []
|
||||
# else
|
||||
/* Some other non-C99 compiler. Approximate with [1]. */
|
||||
# define __flexarr [1]
|
||||
# endif
|
||||
# endif
|
||||
#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
|
||||
|
||||
# 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
|
||||
|
||||
/*
|
||||
#elif __SOME_OTHER_COMPILER__
|
||||
|
||||
# define __REDIRECT(name, proto, alias) name proto; \
|
||||
_Pragma("let " #name " = " #alias)
|
||||
*/
|
||||
#endif
|
||||
|
||||
/* GCC has 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__ || __GNUC__ < 2
|
||||
# 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)
|
||||
# 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
|
||||
|
||||
/* 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)
|
||||
# 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)
|
||||
# define __attribute_const__ __attribute__ ((__const__))
|
||||
#else
|
||||
# define __attribute_const__ /* 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)
|
||||
# define __attribute_used__ __attribute__ ((__used__))
|
||||
# define __attribute_noinline__ __attribute__ ((__noinline__))
|
||||
#else
|
||||
# define __attribute_used__ __attribute__ ((__unused__))
|
||||
# define __attribute_noinline__ /* Ignore */
|
||||
#endif
|
||||
|
||||
/* gcc allows marking deprecated functions. */
|
||||
#if __GNUC_PREREQ (3,2)
|
||||
# define __attribute_deprecated__ __attribute__ ((__deprecated__))
|
||||
#else
|
||||
# define __attribute_deprecated__ /* Ignore */
|
||||
#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)
|
||||
# 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)
|
||||
# define __attribute_format_strfmon__(a,b) \
|
||||
__attribute__ ((__format__ (__strfmon__, a, b)))
|
||||
#else
|
||||
# define __attribute_format_strfmon__(a,b) /* Ignore */
|
||||
#endif
|
||||
|
||||
/* The nonull function attribute allows to mark pointer parameters which
|
||||
must not be NULL. */
|
||||
#if __GNUC_PREREQ (3,3)
|
||||
# define __nonnull(params) __attribute__ ((__nonnull__ params))
|
||||
#else
|
||||
# define __nonnull(params)
|
||||
#endif
|
||||
|
||||
/* If fortification mode, we warn about unused results of certain
|
||||
function calls which can lead to problems. */
|
||||
#if __GNUC_PREREQ (3,4)
|
||||
# define __attribute_warn_unused_result__ \
|
||||
__attribute__ ((__warn_unused_result__))
|
||||
# if __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)
|
||||
# define __always_inline __inline __attribute__ ((__always_inline__))
|
||||
#else
|
||||
# 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)
|
||||
# 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 fot 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)
|
||||
# define __extension__ /* Ignore */
|
||||
#endif
|
||||
|
||||
/* __restrict is known in EGCS 1.2 and above. */
|
||||
#if !__GNUC_PREREQ (2,92)
|
||||
# define __restrict /* Ignore */
|
||||
#endif
|
||||
|
||||
/* ISO C99 also allows to declare arrays as non-overlapping. The syntax is
|
||||
array_name[restrict]
|
||||
GCC 3.1 supports this. */
|
||||
#if __GNUC_PREREQ (3,1) && !defined __GNUG__
|
||||
# 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
|
||||
# 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))
|
||||
# if __GNUC_PREREQ (2,8)
|
||||
# define _Noreturn __attribute__ ((__noreturn__))
|
||||
# else
|
||||
# define _Noreturn
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if (!defined _Static_assert && !defined __cplusplus \
|
||||
&& (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \
|
||||
&& (!__GNUC_PREREQ (4, 6) || defined __STRICT_ANSI__))
|
||||
# define _Static_assert(expr, diagnostic) \
|
||||
extern int (*__Static_assert_function (void)) \
|
||||
[!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })]
|
||||
#endif
|
||||
|
||||
#include <bits/wordsize.h>
|
||||
|
||||
#if 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_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 || !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_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
|
||||
|
||||
#endif /* sys/cdefs.h */
|
@ -0,0 +1,88 @@
|
||||
/* Copyright (C) 2001-2016 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
|
||||
<http://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 */
|
@ -0,0 +1,27 @@
|
||||
/* Copyright (C) 1991-2016 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
|
||||
<http://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 */
|
@ -0,0 +1,29 @@
|
||||
/* Copyright (C) 1998-2016 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
|
||||
<http://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 */
|
@ -0,0 +1,142 @@
|
||||
/* Copyright (C) 2002-2016 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
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_EPOLL_H
|
||||
#define _SYS_EPOLL_H 1
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
/* Get __sigset_t. */
|
||||
#include <bits/sigset.h>
|
||||
|
||||
#ifndef __sigset_t_defined
|
||||
# define __sigset_t_defined
|
||||
typedef __sigset_t sigset_t;
|
||||
#endif
|
||||
|
||||
/* 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
|
||||
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;
|
||||
|
||||
|
||||
__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);
|
||||
|
||||
|
||||
/* 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);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/epoll.h */
|
@ -0,0 +1 @@
|
||||
#include <errno.h>
|
@ -0,0 +1,44 @@
|
||||
/* Copyright (C) 2007-2016 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
|
||||
<http://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 */
|
@ -0,0 +1,38 @@
|
||||
/* Copyright (C) 2010-2016 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
|
||||
<http://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 */
|
@ -0,0 +1 @@
|
||||
#include <fcntl.h>
|
@ -0,0 +1,56 @@
|
||||
/* Copyright (C) 1991-2016 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
|
||||
<http://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. */
|
||||
#define __LOCK_ATOMIC 16 /* Atomic update. */
|
||||
|
||||
/* 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 */
|
@ -0,0 +1,35 @@
|
||||
/* Copyright (C) 1997-2016 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
|
||||
<http://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 */
|
@ -0,0 +1,201 @@
|
||||
/*-
|
||||
* 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.
|
||||
*/
|
||||
#define MINARCS 50
|
||||
|
||||
/*
|
||||
* The type used to represent indices into gmonparam.tos[].
|
||||
*/
|
||||
#define ARCINDEX u_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.
|
||||
* The old value of 1<<16 wasn't high enough in practice for large C++
|
||||
* programs; will 1<<20 be adequate for long? FIXME
|
||||
*/
|
||||
#define MAXARCS (1 << 20)
|
||||
|
||||
struct tostruct {
|
||||
u_long selfpc;
|
||||
long count;
|
||||
ARCINDEX link;
|
||||
};
|
||||
|
||||
/*
|
||||
* a raw arc, with pointers to the calling site and
|
||||
* the called site and a count.
|
||||
*/
|
||||
struct rawarc {
|
||||
u_long raw_frompc;
|
||||
u_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;
|
||||
u_short *kcount;
|
||||
u_long kcountsize;
|
||||
ARCINDEX *froms;
|
||||
u_long fromssize;
|
||||
struct tostruct *tos;
|
||||
u_long tossize;
|
||||
long tolimit;
|
||||
u_long lowpc;
|
||||
u_long highpc;
|
||||
u_long textsize;
|
||||
u_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 (u_long __lowpc, u_long __highpc) __THROW;
|
||||
extern void monstartup (u_long __lowpc, u_long __highpc) __THROW;
|
||||
|
||||
/* Clean up profiling and write out gmon.out. */
|
||||
extern void _mcleanup (void) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/gmon.h */
|
@ -0,0 +1,79 @@
|
||||
/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by David Mosberger <davidm@cs.arizona.edu>.
|
||||
|
||||
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
|
||||
<http://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 */
|
@ -0,0 +1,99 @@
|
||||
/* Copyright (C) 2005-2016 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
|
||||
<http://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_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 */
|
@ -0,0 +1,183 @@
|
||||
/* Copyright (C) 1996-2016 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
|
||||
<http://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 */
|
@ -0,0 +1,45 @@
|
||||
/* Copyright (C) 1991-2016 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
|
||||
<http://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. */
|
||||
extern int ioctl (int __fd, unsigned long int __request, ...) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/ioctl.h */
|
@ -0,0 +1,58 @@
|
||||
/* Copyright (C) 1995-2016 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
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_IPC_H
|
||||
#define _SYS_IPC_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#if !defined __USE_MISC && !defined __USE_XOPEN && __GNUC__ >= 2
|
||||
# warning "Files using this header must be compiled with _GNU_SOURCE or _XOPEN_SOURCE"
|
||||
#endif
|
||||
|
||||
/* 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 */
|
@ -0,0 +1,34 @@
|
||||
/* Copyright (C) 1996-2016 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
|
||||
<http://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 */
|
@ -0,0 +1,33 @@
|
||||
/* Copyright (C) 1996-2016 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
|
||||
<http://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 */
|
@ -0,0 +1,151 @@
|
||||
/* Definitions for BSD-style memory management.
|
||||
Copyright (C) 1994-2016 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
|
||||
<http://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;
|
||||
|
||||
/* Unlock whole pages previously mapped by the range [ADDR,ADDR+LEN). */
|
||||
extern int munlock (const void *__addr, size_t __len) __THROW;
|
||||
|
||||
/* 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);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/mman.h */
|
@ -0,0 +1,150 @@
|
||||
/* Header file for mounting/unmount Linux filesystems.
|
||||
Copyright (C) 1996-2016 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
|
||||
<http://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 <sys/ioctl.h>
|
||||
|
||||
#define BLOCK_SIZE 1024
|
||||
#define BLOCK_SIZE_BITS 10
|
||||
|
||||
|
||||
/* These are the fs-independent mount-flags: up to 16 flags are
|
||||
supported */
|
||||
enum
|
||||
{
|
||||
MS_RDONLY = 1, /* Mount read-only. */
|
||||
#define MS_RDONLY MS_RDONLY
|
||||
MS_NOSUID = 2, /* Ignore suid and sgid bits. */
|
||||
#define MS_NOSUID MS_NOSUID
|
||||
MS_NODEV = 4, /* Disallow access to device special files. */
|
||||
#define MS_NODEV MS_NODEV
|
||||
MS_NOEXEC = 8, /* Disallow program execution. */
|
||||
#define MS_NOEXEC MS_NOEXEC
|
||||
MS_SYNCHRONOUS = 16, /* Writes are synced at once. */
|
||||
#define MS_SYNCHRONOUS MS_SYNCHRONOUS
|
||||
MS_REMOUNT = 32, /* Alter flags of a mounted FS. */
|
||||
#define MS_REMOUNT MS_REMOUNT
|
||||
MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
|
||||
#define MS_MANDLOCK MS_MANDLOCK
|
||||
MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
|
||||
#define MS_DIRSYNC MS_DIRSYNC
|
||||
MS_NOATIME = 1024, /* Do not update access times. */
|
||||
#define MS_NOATIME MS_NOATIME
|
||||
MS_NODIRATIME = 2048, /* Do not update directory access times. */
|
||||
#define MS_NODIRATIME MS_NODIRATIME
|
||||
MS_BIND = 4096, /* Bind directory at different place. */
|
||||
#define MS_BIND MS_BIND
|
||||
MS_MOVE = 8192,
|
||||
#define MS_MOVE MS_MOVE
|
||||
MS_REC = 16384,
|
||||
#define MS_REC MS_REC
|
||||
MS_SILENT = 32768,
|
||||
#define MS_SILENT MS_SILENT
|
||||
MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
|
||||
#define MS_POSIXACL MS_POSIXACL
|
||||
MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
|
||||
#define MS_UNBINDABLE MS_UNBINDABLE
|
||||
MS_PRIVATE = 1 << 18, /* Change to private. */
|
||||
#define MS_PRIVATE MS_PRIVATE
|
||||
MS_SLAVE = 1 << 19, /* Change to slave. */
|
||||
#define MS_SLAVE MS_SLAVE
|
||||
MS_SHARED = 1 << 20, /* Change to shared. */
|
||||
#define MS_SHARED MS_SHARED
|
||||
MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
|
||||
#define MS_RELATIME MS_RELATIME
|
||||
MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
|
||||
#define MS_KERNMOUNT MS_KERNMOUNT
|
||||
MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
|
||||
#define MS_I_VERSION MS_I_VERSION
|
||||
MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
|
||||
#define MS_STRICTATIME MS_STRICTATIME
|
||||
MS_LAZYTIME = 1 << 25, /* Update the on-disk [acm]times lazily. */
|
||||
#define MS_LAZYTIME MS_LAZYTIME
|
||||
MS_ACTIVE = 1 << 30,
|
||||
#define MS_ACTIVE MS_ACTIVE
|
||||
MS_NOUSER = 1 << 31
|
||||
#define MS_NOUSER MS_NOUSER
|
||||
};
|
||||
|
||||
/* Flags that can be altered by MS_REMOUNT */
|
||||
#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. */
|
||||
|
||||
#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. */
|
||||
|
||||
#define BLKROSET _IO(0x12, 93) /* Set device read-only (0 = read-write). */
|
||||
#define BLKROGET _IO(0x12, 94) /* Get read-only status (0 = read_write). */
|
||||
#define BLKRRPART _IO(0x12, 95) /* Re-read partition table. */
|
||||
#define BLKGETSIZE _IO(0x12, 96) /* Return device size. */
|
||||
#define BLKFLSBUF _IO(0x12, 97) /* Flush buffer cache. */
|
||||
#define BLKRASET _IO(0x12, 98) /* Set read ahead for block device. */
|
||||
#define BLKRAGET _IO(0x12, 99) /* Get current read ahead setting. */
|
||||
#define BLKFRASET _IO(0x12,100) /* Set filesystem read-ahead. */
|
||||
#define BLKFRAGET _IO(0x12,101) /* Get filesystem read-ahead. */
|
||||
#define BLKSECTSET _IO(0x12,102) /* Set max sectors per request. */
|
||||
#define BLKSECTGET _IO(0x12,103) /* Get max sectors per request. */
|
||||
#define BLKSSZGET _IO(0x12,104) /* Get block device sector size. */
|
||||
#define BLKBSZGET _IOR(0x12,112,size_t)
|
||||
#define BLKBSZSET _IOW(0x12,113,size_t)
|
||||
#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
|
||||
};
|
||||
|
||||
|
||||
__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;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SYS_MOUNT_H */
|
@ -0,0 +1,83 @@
|
||||
/* Copyright (C) 1995-2016 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
|
||||
<http://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. */
|
||||
#define __need_time_t
|
||||
#include <time.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. */
|
||||
extern int msgctl (int __msqid, int __cmd, struct msqid_ds *__buf) __THROW;
|
||||
|
||||
/* 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 */
|
@ -0,0 +1,276 @@
|
||||
/* Structures and definitions for magnetic tape I/O control commands.
|
||||
Copyright (C) 1996-2016 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
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by H. Bergman <hennus@cybercomm.nl>. */
|
||||
|
||||
#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 */
|
@ -0,0 +1,106 @@
|
||||
/* Compatibility header for old-style Unix parameters and limits.
|
||||
Copyright (C) 1995-2016 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
|
||||
<http://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 */
|
@ -0,0 +1,24 @@
|
||||
/* Copyright (C) 1997-2016 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
|
||||
<http://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 */
|
@ -0,0 +1,35 @@
|
||||
/* Copyright (C) 1996-2016 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
|
||||
<http://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 */
|
@ -0,0 +1,80 @@
|
||||
/* Copyright (C) 2002-2016 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
|
||||
<http://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 */
|
@ -0,0 +1,79 @@
|
||||
/* Compatibility definitions for System V `poll' interface.
|
||||
Copyright (C) 1994-2016 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
|
||||
<http://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
|
||||
/* Get the __sigset_t definition. */
|
||||
# include <bits/sigset.h>
|
||||
/* Get the timespec definition. */
|
||||
# define __need_timespec
|
||||
# include <time.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);
|
||||
|
||||
#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);
|
||||
#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 */
|
@ -0,0 +1,31 @@
|
||||
/* Copyright (C) 1997-2016 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
|
||||
<http://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 */
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Control process execution. */
|
||||
extern int prctl (int __option, ...) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/prctl.h */
|
@ -0,0 +1,145 @@
|
||||
/* Copyright (C) 2001-2016 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
|
||||
<http://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>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Type for a general-purpose register. */
|
||||
#ifdef __x86_64__
|
||||
__extension__ typedef unsigned long long elf_greg_t;
|
||||
#else
|
||||
typedef unsigned long elf_greg_t;
|
||||
#endif
|
||||
|
||||
/* And the whole bunch of them. We could have used `struct
|
||||
user_regs_struct' directly in the typedef, but tradition says that
|
||||
the register set is an array, which does have some peculiar
|
||||
semantics, so leave it that way. */
|
||||
#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
|
||||
typedef elf_greg_t elf_gregset_t[ELF_NGREG];
|
||||
|
||||
#ifndef __x86_64__
|
||||
/* Register set for the floating-point registers. */
|
||||
typedef struct user_fpregs_struct elf_fpregset_t;
|
||||
|
||||
/* Register set for the extended floating-point registers. Includes
|
||||
the Pentium III SSE registers in addition to the classic
|
||||
floating-point stuff. */
|
||||
typedef struct user_fpxregs_struct elf_fpxregset_t;
|
||||
#else
|
||||
/* Register set for the extended floating-point registers. Includes
|
||||
the Pentium III SSE registers in addition to the classic
|
||||
floating-point stuff. */
|
||||
typedef struct user_fpregs_struct elf_fpregset_t;
|
||||
#endif
|
||||
|
||||
/* 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. */
|
||||
#if __WORDSIZE == 32
|
||||
unsigned short int pr_uid;
|
||||
unsigned short int pr_gid;
|
||||
#else
|
||||
unsigned int pr_uid;
|
||||
unsigned int pr_gid;
|
||||
#endif
|
||||
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;
|
||||
|
||||
/* Register sets. Linux has different names. */
|
||||
typedef elf_gregset_t prgregset_t;
|
||||
typedef elf_fpregset_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
|
||||
|
||||
#endif /* sys/procfs.h */
|
@ -0,0 +1,60 @@
|
||||
/* Copyright (C) 2001-2016 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
|
||||
<http://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 */
|
@ -0,0 +1,227 @@
|
||||
/* `ptrace' debugger support interface. Linux version.
|
||||
Copyright (C) 1996-2016 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
|
||||
<http://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.
|
||||
This is not supported on all machines. */
|
||||
PTRACE_SINGLESTEP = 9,
|
||||
#define PT_STEP PTRACE_SINGLESTEP
|
||||
|
||||
/* Get all general purpose registers used by a processes.
|
||||
This is not supported on all machines. */
|
||||
PTRACE_GETREGS = 12,
|
||||
#define PT_GETREGS PTRACE_GETREGS
|
||||
|
||||
/* Set all general purpose registers used by a processes.
|
||||
This is not supported on all machines. */
|
||||
PTRACE_SETREGS = 13,
|
||||
#define PT_SETREGS PTRACE_SETREGS
|
||||
|
||||
/* Get all floating point registers used by a processes.
|
||||
This is not supported on all machines. */
|
||||
PTRACE_GETFPREGS = 14,
|
||||
#define PT_GETFPREGS PTRACE_GETFPREGS
|
||||
|
||||
/* Set all floating point registers used by a processes.
|
||||
This is not supported on all machines. */
|
||||
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.
|
||||
This is not supported on all machines. */
|
||||
PTRACE_GETFPXREGS = 18,
|
||||
#define PT_GETFPXREGS PTRACE_GETFPXREGS
|
||||
|
||||
/* Set all extended floating point registers used by a processes.
|
||||
This is not supported on all machines. */
|
||||
PTRACE_SETFPXREGS = 19,
|
||||
#define PT_SETFPXREGS PTRACE_SETFPXREGS
|
||||
|
||||
/* Continue and stop at the next (return from) syscall. */
|
||||
PTRACE_SYSCALL = 24,
|
||||
#define PT_SYSCALL PTRACE_SYSCALL
|
||||
|
||||
/* 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
|
||||
|
||||
PTRACE_PEEKSIGINFO = 0x4209,
|
||||
#define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO
|
||||
|
||||
PTRACE_GETSIGMASK = 0x420a,
|
||||
#define PTRACE_GETSIGMASK PTRACE_GETSIGMASK
|
||||
|
||||
PTRACE_SETSIGMASK = 0x420b,
|
||||
#define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
|
||||
|
||||
PTRACE_SECCOMP_GET_FILTER = 0x420c
|
||||
#define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
|
||||
};
|
||||
|
||||
|
||||
/* Flag for PTRACE_LISTEN. */
|
||||
enum __ptrace_flags
|
||||
{
|
||||
PTRACE_SEIZE_DEVEL = 0x80000000
|
||||
};
|
||||
|
||||
/* Options set using PTRACE_SETOPTIONS. */
|
||||
enum __ptrace_setoptions
|
||||
{
|
||||
PTRACE_O_TRACESYSGOOD = 0x00000001,
|
||||
PTRACE_O_TRACEFORK = 0x00000002,
|
||||
PTRACE_O_TRACEVFORK = 0x00000004,
|
||||
PTRACE_O_TRACECLONE = 0x00000008,
|
||||
PTRACE_O_TRACEEXEC = 0x00000010,
|
||||
PTRACE_O_TRACEVFORKDONE = 0x00000020,
|
||||
PTRACE_O_TRACEEXIT = 0x00000040,
|
||||
PTRACE_O_TRACESECCOMP = 0x00000080,
|
||||
PTRACE_O_EXITKILL = 0x00100000,
|
||||
PTRACE_O_SUSPEND_SECCOMP = 0x00200000,
|
||||
PTRACE_O_MASK = 0x003000ff
|
||||
};
|
||||
|
||||
/* Wait extended result codes for the above trace options. */
|
||||
enum __ptrace_eventcodes
|
||||
{
|
||||
PTRACE_EVENT_FORK = 1,
|
||||
PTRACE_EVENT_VFORK = 2,
|
||||
PTRACE_EVENT_CLONE = 3,
|
||||
PTRACE_EVENT_EXEC = 4,
|
||||
PTRACE_EVENT_VFORK_DONE = 5,
|
||||
PTRACE_EVENT_EXIT = 6,
|
||||
PTRACE_EVENT_SECCOMP = 7
|
||||
};
|
||||
|
||||
/* Arguments for PTRACE_PEEKSIGINFO. */
|
||||
struct __ptrace_peeksiginfo_args
|
||||
{
|
||||
__uint64_t off; /* From which siginfo to start. */
|
||||
__uint32_t flags; /* Flags for peeksiginfo. */
|
||||
__int32_t nr; /* How many siginfos to take. */
|
||||
};
|
||||
|
||||
enum __ptrace_peeksiginfo_flags
|
||||
{
|
||||
/* Read signals from a shared (process wide) queue. */
|
||||
PTRACE_PEEKSIGINFO_SHARED = (1 << 0)
|
||||
};
|
||||
|
||||
/* Perform process tracing functions. REQUEST is one of the values
|
||||
above, and determines the action to be taken.
|
||||
For all requests except PTRACE_TRACEME, PID specifies the process to be
|
||||
traced.
|
||||
|
||||
PID and the other arguments described above for the various requests should
|
||||
appear (those that are used for the particular request) as:
|
||||
pid_t PID, void *ADDR, int DATA, void *ADDR2
|
||||
after REQUEST. */
|
||||
extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SYS_PTRACE_H */
|
@ -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 */
|
@ -0,0 +1,225 @@
|
||||
/* This just represents the non-kernel parts of <linux/quota.h>.
|
||||
*
|
||||
* here's the corresponding copyright:
|
||||
* 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>
|
||||
|
||||
/*
|
||||
* Select between different incompatible quota versions.
|
||||
* Default to the version used by Linux kernel version 2.4.22
|
||||
* or later. */
|
||||
#ifndef _LINUX_QUOTA_VERSION
|
||||
# define _LINUX_QUOTA_VERSION 2
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 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 != BLOCK_SIZE
|
||||
*/
|
||||
#define fs_to_dq_blocks(num, blksize) (((num) * (blksize)) / BLOCK_SIZE)
|
||||
|
||||
/*
|
||||
* 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 MAXQUOTAS 2
|
||||
#define USRQUOTA 0 /* element used for user quotas */
|
||||
#define GRPQUOTA 1 /* element used for group quotas */
|
||||
|
||||
/*
|
||||
* Definitions for the default names of the quotas files.
|
||||
*/
|
||||
#define INITQFNAMES { \
|
||||
"user", /* USRQUOTA */ \
|
||||
"group", /* GRPQUOTA */ \
|
||||
"undefined", \
|
||||
};
|
||||
|
||||
#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 */
|
||||
|
||||
/*
|
||||
* Command definitions for the 'quotactl' system call.
|
||||
* The commands are broken into a main command defined below
|
||||
* and a subcommand that is used to convey the type of
|
||||
* quota that is being manipulated (see above).
|
||||
*/
|
||||
#define SUBCMDMASK 0x00ff
|
||||
#define SUBCMDSHIFT 8
|
||||
#define QCMD(cmd, type) (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))
|
||||
|
||||
#if _LINUX_QUOTA_VERSION < 2
|
||||
# define Q_QUOTAON 0x0100 /* enable quotas */
|
||||
# define Q_QUOTAOFF 0x0200 /* disable quotas */
|
||||
# define Q_GETQUOTA 0x0300 /* get limits and usage */
|
||||
# define Q_SETQUOTA 0x0400 /* set limits and usage */
|
||||
# define Q_SETUSE 0x0500 /* set usage */
|
||||
# define Q_SYNC 0x0600 /* sync disk copy of a filesystems quotas */
|
||||
# define Q_SETQLIM 0x0700 /* set limits */
|
||||
# define Q_GETSTATS 0x0800 /* get collected stats */
|
||||
# define Q_RSQUASH 0x1000 /* set root_squash option */
|
||||
#else
|
||||
# define Q_SYNC 0x800001 /* sync disk copy of a filesystems quotas */
|
||||
# define Q_QUOTAON 0x800002 /* turn quotas on */
|
||||
# define Q_QUOTAOFF 0x800003 /* turn quotas off */
|
||||
# define Q_GETFMT 0x800004 /* get quota format used on given filesystem */
|
||||
# define Q_GETINFO 0x800005 /* get information about quota files */
|
||||
# define Q_SETINFO 0x800006 /* set information about quota files */
|
||||
# define Q_GETQUOTA 0x800007 /* get user quota structure */
|
||||
# define Q_SETQUOTA 0x800008 /* set user quota structure */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The following structure defines the format of the disk quota file
|
||||
* (as it appears on disk) - the file is an array of these structures
|
||||
* indexed by user or group number.
|
||||
*/
|
||||
#if _LINUX_QUOTA_VERSION < 2
|
||||
struct dqblk
|
||||
{
|
||||
u_int32_t dqb_bhardlimit; /* absolute limit on disk blks alloc */
|
||||
u_int32_t dqb_bsoftlimit; /* preferred limit on disk blks */
|
||||
u_int32_t dqb_curblocks; /* current block count */
|
||||
u_int32_t dqb_ihardlimit; /* maximum # allocated inodes */
|
||||
u_int32_t dqb_isoftlimit; /* preferred inode limit */
|
||||
u_int32_t dqb_curinodes; /* current # allocated inodes */
|
||||
time_t dqb_btime; /* time limit for excessive disk use */
|
||||
time_t dqb_itime; /* time limit for excessive files */
|
||||
};
|
||||
#else
|
||||
|
||||
/* Flags that indicate which fields in dqblk structure are valid. */
|
||||
#define QIF_BLIMITS 1
|
||||
#define QIF_SPACE 2
|
||||
#define QIF_ILIMITS 4
|
||||
#define QIF_INODES 8
|
||||
#define QIF_BTIME 16
|
||||
#define QIF_ITIME 32
|
||||
#define QIF_LIMITS (QIF_BLIMITS | QIF_ILIMITS)
|
||||
#define QIF_USAGE (QIF_SPACE | QIF_INODES)
|
||||
#define QIF_TIMES (QIF_BTIME | QIF_ITIME)
|
||||
#define QIF_ALL (QIF_LIMITS | QIF_USAGE | QIF_TIMES)
|
||||
|
||||
struct dqblk
|
||||
{
|
||||
u_int64_t dqb_bhardlimit; /* absolute limit on disk quota blocks alloc */
|
||||
u_int64_t dqb_bsoftlimit; /* preferred limit on disk quota blocks */
|
||||
u_int64_t dqb_curspace; /* current quota block count */
|
||||
u_int64_t dqb_ihardlimit; /* maximum # allocated inodes */
|
||||
u_int64_t dqb_isoftlimit; /* preferred inode limit */
|
||||
u_int64_t dqb_curinodes; /* current # allocated inodes */
|
||||
u_int64_t dqb_btime; /* time limit for excessive disk use */
|
||||
u_int64_t dqb_itime; /* time limit for excessive files */
|
||||
u_int32_t dqb_valid; /* bitmask of QIF_* constants */
|
||||
};
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Shorthand notation.
|
||||
*/
|
||||
#define dq_bhardlimit dq_dqb.dqb_bhardlimit
|
||||
#define dq_bsoftlimit dq_dqb.dqb_bsoftlimit
|
||||
#if _LINUX_QUOTA_VERSION < 2
|
||||
# define dq_curblocks dq_dqb.dqb_curblocks
|
||||
#else
|
||||
# define dq_curspace dq_dqb.dqb_curspace
|
||||
# define dq_valid dq_dqb.dqb_valid
|
||||
#endif
|
||||
#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)))
|
||||
|
||||
#if _LINUX_QUOTA_VERSION < 2
|
||||
struct dqstats
|
||||
{
|
||||
u_int32_t lookups;
|
||||
u_int32_t drops;
|
||||
u_int32_t reads;
|
||||
u_int32_t writes;
|
||||
u_int32_t cache_hits;
|
||||
u_int32_t pages_allocated;
|
||||
u_int32_t allocated_dquots;
|
||||
u_int32_t free_dquots;
|
||||
u_int32_t syncs;
|
||||
};
|
||||
#else
|
||||
|
||||
/* Flags that indicate which fields in dqinfo structure are valid. */
|
||||
# define IIF_BGRACE 1
|
||||
# define IIF_IGRACE 2
|
||||
# define IIF_FLAGS 4
|
||||
# define IIF_ALL (IIF_BGRACE | IIF_IGRACE | IIF_FLAGS)
|
||||
|
||||
struct dqinfo
|
||||
{
|
||||
u_int64_t dqi_bgrace;
|
||||
u_int64_t dqi_igrace;
|
||||
u_int32_t dqi_flags;
|
||||
u_int32_t dqi_valid;
|
||||
};
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
extern int quotactl (int __cmd, const char *__special, int __id,
|
||||
caddr_t __addr) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/quota.h */
|
@ -0,0 +1,38 @@
|
||||
/* Copyright (C) 1999-2016 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
|
||||
<http://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 */
|
@ -0,0 +1,54 @@
|
||||
/* Copyright (C) 1996-2016 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
|
||||
<http://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 */
|
@ -0,0 +1,77 @@
|
||||
/* Copyright (C) 2001-2016 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
|
||||
<http://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
|
@ -0,0 +1,102 @@
|
||||
/* Copyright (C) 1992-2016 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
|
||||
<http://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;
|
||||
#else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (getrlimit, (__rlimit_resource_t __resource,
|
||||
struct rlimit *__rlimits), getrlimit64);
|
||||
# else
|
||||
# define getrlimit getrlimit64
|
||||
# endif
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern int getrlimit64 (__rlimit_resource_t __resource,
|
||||
struct rlimit64 *__rlimits) __THROW;
|
||||
#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;
|
||||
#else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (setrlimit, (__rlimit_resource_t __resource,
|
||||
const struct rlimit *__rlimits),
|
||||
setrlimit64);
|
||||
# else
|
||||
# define setrlimit setrlimit64
|
||||
# endif
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern int setrlimit64 (__rlimit_resource_t __resource,
|
||||
const struct rlimit64 *__rlimits) __THROW;
|
||||
#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;
|
||||
|
||||
/* 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 */
|
@ -0,0 +1,133 @@
|
||||
/* `fd_set' type and related macros, and `select'/`pselect' declarations.
|
||||
Copyright (C) 1996-2016 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
|
||||
<http://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/sigset.h>
|
||||
|
||||
#ifndef __sigset_t_defined
|
||||
# define __sigset_t_defined
|
||||
typedef __sigset_t sigset_t;
|
||||
#endif
|
||||
|
||||
/* Get definition of timer specification structures. */
|
||||
#define __need_time_t
|
||||
#define __need_timespec
|
||||
#include <time.h>
|
||||
#define __need_timeval
|
||||
#include <bits/time.h>
|
||||
|
||||
#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. */
|
||||
extern int select (int __nfds, fd_set *__restrict __readfds,
|
||||
fd_set *__restrict __writefds,
|
||||
fd_set *__restrict __exceptfds,
|
||||
struct timeval *__restrict __timeout);
|
||||
|
||||
#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. */
|
||||
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);
|
||||
#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 */
|
@ -0,0 +1,68 @@
|
||||
/* Copyright (C) 1995-2016 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
|
||||
<http://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
|
||||
# define __need_timespec
|
||||
# include <time.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. */
|
||||
extern int semctl (int __semid, int __semnum, int __cmd, ...) __THROW;
|
||||
|
||||
/* 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. */
|
||||
extern int semtimedop (int __semid, struct sembuf *__sops, size_t __nsops,
|
||||
const struct timespec *__timeout) __THROW;
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/sem.h */
|
@ -0,0 +1,51 @@
|
||||
/* sendfile -- copy data directly from one file descriptor to another
|
||||
Copyright (C) 1998-2016 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
|
||||
<http://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 */
|
@ -0,0 +1,64 @@
|
||||
/* Copyright (C) 1995-2016 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
|
||||
<http://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. */
|
||||
#define __need_time_t
|
||||
#include <time.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. */
|
||||
extern int shmctl (int __shmid, int __cmd, struct shmid_ds *__buf) __THROW;
|
||||
|
||||
/* 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 */
|
@ -0,0 +1 @@
|
||||
#include <signal.h>
|
@ -0,0 +1,58 @@
|
||||
/* Copyright (C) 2007-2016 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
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_SIGNALFD_H
|
||||
#define _SYS_SIGNALFD_H 1
|
||||
|
||||
#define __need_sigset_t
|
||||
#include <signal.h>
|
||||
#include <stdint.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;
|
||||
uint8_t __pad[48];
|
||||
};
|
||||
|
||||
__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 */
|
@ -0,0 +1,285 @@
|
||||
/* Declarations of socket constants, types, and functions.
|
||||
Copyright (C) 1991-2016 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
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_SOCKET_H
|
||||
#define _SYS_SOCKET_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#include <sys/uio.h>
|
||||
#define __need_size_t
|
||||
#include <stddef.h>
|
||||
#ifdef __USE_GNU
|
||||
/* Get the __sigset_t definition. */
|
||||
# include <bits/sigset.h>
|
||||
#endif
|
||||
|
||||
|
||||
/* 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
|
||||
/* This is the 4.3 BSD `struct sockaddr' format, which is used as wire
|
||||
format in the grotty old 4.3 `talk' protocol. */
|
||||
struct osockaddr
|
||||
{
|
||||
unsigned short int sa_family;
|
||||
unsigned char sa_data[14];
|
||||
};
|
||||
#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 tha 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. */
|
||||
extern ssize_t sendmsg (int __fd, const struct msghdr *__message,
|
||||
int __flags);
|
||||
|
||||
#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. */
|
||||
extern int sendmmsg (int __fd, struct mmsghdr *__vmessages,
|
||||
unsigned int __vlen, int __flags);
|
||||
#endif
|
||||
|
||||
/* 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. */
|
||||
extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags);
|
||||
|
||||
#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. */
|
||||
extern int recvmmsg (int __fd, struct mmsghdr *__vmessages,
|
||||
unsigned int __vlen, int __flags,
|
||||
struct timespec *__tmo);
|
||||
#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. */
|
||||
extern int getsockopt (int __fd, int __level, int __optname,
|
||||
void *__restrict __optval,
|
||||
socklen_t *__restrict __optlen) __THROW;
|
||||
|
||||
/* Set socket FD's option OPTNAME at protocol level LEVEL
|
||||
to *OPTVAL (which is OPTLEN bytes long).
|
||||
Returns 0 on success, -1 for errors. */
|
||||
extern int setsockopt (int __fd, int __level, int __optname,
|
||||
const void *__optval, socklen_t __optlen) __THROW;
|
||||
|
||||
|
||||
/* 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 wheter 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 */
|
@ -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>
|
@ -0,0 +1 @@
|
||||
#include <linux/soundcard.h>
|
@ -0,0 +1,536 @@
|
||||
/* Copyright (C) 1991-2016 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
|
||||
<http://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_XOPEN || defined __USE_XOPEN2K || defined __USE_ATFILE
|
||||
# if defined __USE_XOPEN || defined __USE_XOPEN2K
|
||||
# define __need_time_t
|
||||
# endif
|
||||
# ifdef __USE_ATFILE
|
||||
# define __need_timespec
|
||||
# endif
|
||||
# include <time.h> /* For time_t resp. timespec. */
|
||||
#endif
|
||||
|
||||
#if defined __USE_XOPEN || defined __USE_XOPEN2K
|
||||
/* The Single Unix specification says that some more types are
|
||||
available here. */
|
||||
# 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_UNIX98) \
|
||||
&& 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_UNIX98 || 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 __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
|
||||
#ifdef __USE_LARGEFILE64
|
||||
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));
|
||||
#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 ((2, 3));
|
||||
# else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file,
|
||||
struct stat *__restrict __buf,
|
||||
int __flag),
|
||||
fstatat64) __nonnull ((2, 3));
|
||||
# else
|
||||
# define fstatat fstatat64
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifdef __USE_LARGEFILE64
|
||||
extern int fstatat64 (int __fd, const char *__restrict __file,
|
||||
struct stat64 *__restrict __buf, int __flag)
|
||||
__THROW __nonnull ((2, 3));
|
||||
# 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 __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
|
||||
# ifdef __USE_LARGEFILE64
|
||||
extern int lstat64 (const char *__restrict __file,
|
||||
struct stat64 *__restrict __buf)
|
||||
__THROW __nonnull ((1, 2));
|
||||
# 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. */
|
||||
#ifdef __USE_POSIX
|
||||
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
|
||||
/* 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 __nonnull ((2));
|
||||
#endif
|
||||
|
||||
#ifdef __USE_XOPEN2K8
|
||||
/* Set file access and modification times of the file associated with FD. */
|
||||
extern int futimens (int __fd, const struct timespec __times[2]) __THROW;
|
||||
#endif
|
||||
|
||||
/* To allow the `struct stat' structure and the file type `mode_t'
|
||||
bits to vary without changing shared library major version number,
|
||||
the `stat' family of functions and `mknod' are in fact inline
|
||||
wrappers around calls to `xstat', `fxstat', `lxstat', and `xmknod',
|
||||
which all take a leading version-number argument designating the
|
||||
data structure and bits used. <bits/stat.h> defines _STAT_VER with
|
||||
the version number corresponding to `struct stat' as defined in
|
||||
that file; and _MKNOD_VER with the version number corresponding to
|
||||
the S_IF* macros defined therein. It is arranged that when not
|
||||
inlined these function are always statically linked; that way a
|
||||
dynamically-linked executable always encodes the version number
|
||||
corresponding to the data structures it uses, so the `x' functions
|
||||
in the shared library can adapt without needing to recompile all
|
||||
callers. */
|
||||
|
||||
#ifndef _STAT_VER
|
||||
# define _STAT_VER 0
|
||||
#endif
|
||||
#ifndef _MKNOD_VER
|
||||
# define _MKNOD_VER 0
|
||||
#endif
|
||||
|
||||
/* Wrappers for stat and mknod system calls. */
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
extern int __fxstat (int __ver, int __fildes, struct stat *__stat_buf)
|
||||
__THROW __nonnull ((3));
|
||||
extern int __xstat (int __ver, const char *__filename,
|
||||
struct stat *__stat_buf) __THROW __nonnull ((2, 3));
|
||||
extern int __lxstat (int __ver, const char *__filename,
|
||||
struct stat *__stat_buf) __THROW __nonnull ((2, 3));
|
||||
extern int __fxstatat (int __ver, int __fildes, const char *__filename,
|
||||
struct stat *__stat_buf, int __flag)
|
||||
__THROW __nonnull ((3, 4));
|
||||
#else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (__fxstat, (int __ver, int __fildes,
|
||||
struct stat *__stat_buf), __fxstat64)
|
||||
__nonnull ((3));
|
||||
extern int __REDIRECT_NTH (__xstat, (int __ver, const char *__filename,
|
||||
struct stat *__stat_buf), __xstat64)
|
||||
__nonnull ((2, 3));
|
||||
extern int __REDIRECT_NTH (__lxstat, (int __ver, const char *__filename,
|
||||
struct stat *__stat_buf), __lxstat64)
|
||||
__nonnull ((2, 3));
|
||||
extern int __REDIRECT_NTH (__fxstatat, (int __ver, int __fildes,
|
||||
const char *__filename,
|
||||
struct stat *__stat_buf, int __flag),
|
||||
__fxstatat64) __nonnull ((3, 4));
|
||||
|
||||
# else
|
||||
# define __fxstat __fxstat64
|
||||
# define __xstat __xstat64
|
||||
# define __lxstat __lxstat64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern int __fxstat64 (int __ver, int __fildes, struct stat64 *__stat_buf)
|
||||
__THROW __nonnull ((3));
|
||||
extern int __xstat64 (int __ver, const char *__filename,
|
||||
struct stat64 *__stat_buf) __THROW __nonnull ((2, 3));
|
||||
extern int __lxstat64 (int __ver, const char *__filename,
|
||||
struct stat64 *__stat_buf) __THROW __nonnull ((2, 3));
|
||||
extern int __fxstatat64 (int __ver, int __fildes, const char *__filename,
|
||||
struct stat64 *__stat_buf, int __flag)
|
||||
__THROW __nonnull ((3, 4));
|
||||
#endif
|
||||
extern int __xmknod (int __ver, const char *__path, __mode_t __mode,
|
||||
__dev_t *__dev) __THROW __nonnull ((2, 4));
|
||||
|
||||
extern int __xmknodat (int __ver, int __fd, const char *__path,
|
||||
__mode_t __mode, __dev_t *__dev)
|
||||
__THROW __nonnull ((3, 5));
|
||||
|
||||
#ifdef __USE_EXTERN_INLINES
|
||||
/* Inlined versions of the real stat and mknod functions. */
|
||||
|
||||
__extern_inline int
|
||||
__NTH (stat (const char *__path, struct stat *__statbuf))
|
||||
{
|
||||
return __xstat (_STAT_VER, __path, __statbuf);
|
||||
}
|
||||
|
||||
# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
|
||||
__extern_inline int
|
||||
__NTH (lstat (const char *__path, struct stat *__statbuf))
|
||||
{
|
||||
return __lxstat (_STAT_VER, __path, __statbuf);
|
||||
}
|
||||
# endif
|
||||
|
||||
__extern_inline int
|
||||
__NTH (fstat (int __fd, struct stat *__statbuf))
|
||||
{
|
||||
return __fxstat (_STAT_VER, __fd, __statbuf);
|
||||
}
|
||||
|
||||
# ifdef __USE_ATFILE
|
||||
__extern_inline int
|
||||
__NTH (fstatat (int __fd, const char *__filename, struct stat *__statbuf,
|
||||
int __flag))
|
||||
{
|
||||
return __fxstatat (_STAT_VER, __fd, __filename, __statbuf, __flag);
|
||||
}
|
||||
# endif
|
||||
|
||||
# ifdef __USE_MISC
|
||||
__extern_inline int
|
||||
__NTH (mknod (const char *__path, __mode_t __mode, __dev_t __dev))
|
||||
{
|
||||
return __xmknod (_MKNOD_VER, __path, __mode, &__dev);
|
||||
}
|
||||
# endif
|
||||
|
||||
# ifdef __USE_ATFILE
|
||||
__extern_inline int
|
||||
__NTH (mknodat (int __fd, const char *__path, __mode_t __mode,
|
||||
__dev_t __dev))
|
||||
{
|
||||
return __xmknodat (_MKNOD_VER, __fd, __path, __mode, &__dev);
|
||||
}
|
||||
# endif
|
||||
|
||||
# if defined __USE_LARGEFILE64 \
|
||||
&& (! defined __USE_FILE_OFFSET64 \
|
||||
|| (defined __REDIRECT_NTH && defined __OPTIMIZE__))
|
||||
__extern_inline int
|
||||
__NTH (stat64 (const char *__path, struct stat64 *__statbuf))
|
||||
{
|
||||
return __xstat64 (_STAT_VER, __path, __statbuf);
|
||||
}
|
||||
|
||||
# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
|
||||
__extern_inline int
|
||||
__NTH (lstat64 (const char *__path, struct stat64 *__statbuf))
|
||||
{
|
||||
return __lxstat64 (_STAT_VER, __path, __statbuf);
|
||||
}
|
||||
# endif
|
||||
|
||||
__extern_inline int
|
||||
__NTH (fstat64 (int __fd, struct stat64 *__statbuf))
|
||||
{
|
||||
return __fxstat64 (_STAT_VER, __fd, __statbuf);
|
||||
}
|
||||
|
||||
# ifdef __USE_ATFILE
|
||||
__extern_inline int
|
||||
__NTH (fstatat64 (int __fd, const char *__filename, struct stat64 *__statbuf,
|
||||
int __flag))
|
||||
{
|
||||
return __fxstatat64 (_STAT_VER, __fd, __filename, __statbuf, __flag);
|
||||
}
|
||||
# endif
|
||||
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
||||
#endif /* sys/stat.h */
|
@ -0,0 +1,67 @@
|
||||
/* Definitions for getting information about a filesystem.
|
||||
Copyright (C) 1996-2016 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
|
||||
<http://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 */
|
@ -0,0 +1,90 @@
|
||||
/* Definitions for getting information about a filesystem.
|
||||
Copyright (C) 1998-2016 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
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_STATVFS_H
|
||||
#define _SYS_STATVFS_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
/* Get the system-specific definition of `struct statfs'. */
|
||||
#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 */
|
@ -0,0 +1 @@
|
||||
#include <stropts.h>
|
@ -0,0 +1,43 @@
|
||||
/* Calls to enable and disable swapping on specified locations. Linux version.
|
||||
Copyright (C) 1996-2016 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
|
||||
<http://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 */
|
@ -0,0 +1,34 @@
|
||||
/* Copyright (C) 1995-2016 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
|
||||
<http://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>
|
||||
|
||||
#ifndef _LIBC
|
||||
/* The Linux kernel header file defines macros `__NR_<name>', but some
|
||||
programs expect the traditional form `SYS_<name>'. So in building libc
|
||||
we scan the kernel's list and produce <bits/syscall.h> with macros for
|
||||
all the `SYS_' names. */
|
||||
# include <bits/syscall.h>
|
||||
#endif
|
||||
|
||||
#endif
|
@ -0,0 +1,73 @@
|
||||
/* Copyright (C) 1996-2016 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
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_SYSCTL_H
|
||||
#define _SYS_SYSCTL_H 1
|
||||
|
||||
#include <features.h>
|
||||
#define __need_size_t
|
||||
#include <stddef.h>
|
||||
/* Prevent more kernel headers than necessary to be included. */
|
||||
#ifndef _LINUX_KERNEL_H
|
||||
# define _LINUX_KERNEL_H 1
|
||||
# define __undef_LINUX_KERNEL_H
|
||||
#endif
|
||||
#ifndef _LINUX_TYPES_H
|
||||
# define _LINUX_TYPES_H 1
|
||||
# define __undef_LINUX_TYPES_H
|
||||
#endif
|
||||
#ifndef _LINUX_LIST_H
|
||||
# define _LINUX_LIST_H 1
|
||||
# define __undef_LINUX_LIST_H
|
||||
#endif
|
||||
#ifndef __LINUX_COMPILER_H
|
||||
# define __LINUX_COMPILER_H 1
|
||||
# define __user
|
||||
# define __undef__LINUX_COMPILER_H
|
||||
#endif
|
||||
|
||||
#include <linux/sysctl.h>
|
||||
|
||||
#ifdef __undef_LINUX_KERNEL_H
|
||||
# undef _LINUX_KERNEL_H
|
||||
# undef __undef_LINUX_KERNEL_H
|
||||
#endif
|
||||
#ifdef __undef_LINUX_TYPES_H
|
||||
# undef _LINUX_TYPES_H
|
||||
# undef __undef_LINUX_TYPES_H
|
||||
#endif
|
||||
#ifdef __undef_LINUX_LIST_H
|
||||
# undef _LINUX_LIST_H
|
||||
# undef __undef_LINUX_LIST_H
|
||||
#endif
|
||||
#ifdef __undef__LINUX_COMPILER_H
|
||||
# undef __LINUX_COMPILER_H
|
||||
# undef __user
|
||||
# undef __undef__LINUX_COMPILER_H
|
||||
#endif
|
||||
|
||||
#include <bits/sysctl.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Read or write system parameters. */
|
||||
extern int sysctl (int *__name, int __nlen, void *__oldval,
|
||||
size_t *__oldlenp, void *__newval, size_t __newlen) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SYS_SYSCTL_H */
|
@ -0,0 +1,47 @@
|
||||
/* Copyright (C) 1996-2016 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
|
||||
<http://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 */
|
@ -0,0 +1,215 @@
|
||||
/*
|
||||
* 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))
|
||||
|
||||
#ifdef SYSLOG_NAMES
|
||||
#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)
|
||||
|
||||
#ifdef SYSLOG_NAMES
|
||||
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>
|
||||
#endif
|
||||
#ifdef __LDBL_COMPAT
|
||||
# include <bits/syslog-ldbl.h>
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/syslog.h */
|
@ -0,0 +1,65 @@
|
||||
/* Definitions of macros to access `dev_t' values.
|
||||
Copyright (C) 1996-2016 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
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_SYSMACROS_H
|
||||
#define _SYS_SYSMACROS_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
__extension__
|
||||
extern unsigned int gnu_dev_major (unsigned long long int __dev)
|
||||
__THROW __attribute_const__;
|
||||
__extension__
|
||||
extern unsigned int gnu_dev_minor (unsigned long long int __dev)
|
||||
__THROW __attribute_const__;
|
||||
__extension__
|
||||
extern unsigned long long int gnu_dev_makedev (unsigned int __major,
|
||||
unsigned int __minor)
|
||||
__THROW __attribute_const__;
|
||||
|
||||
#ifdef __USE_EXTERN_INLINES
|
||||
__extension__ __extern_inline __attribute_const__ unsigned int
|
||||
__NTH (gnu_dev_major (unsigned long long int __dev))
|
||||
{
|
||||
return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
|
||||
}
|
||||
|
||||
__extension__ __extern_inline __attribute_const__ unsigned int
|
||||
__NTH (gnu_dev_minor (unsigned long long int __dev))
|
||||
{
|
||||
return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
|
||||
}
|
||||
|
||||
__extension__ __extern_inline __attribute_const__ unsigned long long int
|
||||
__NTH (gnu_dev_makedev (unsigned int __major, unsigned int __minor))
|
||||
{
|
||||
return ((__minor & 0xff) | ((__major & 0xfff) << 8)
|
||||
| (((unsigned long long int) (__minor & ~0xff)) << 12)
|
||||
| (((unsigned long long int) (__major & ~0xfff)) << 32));
|
||||
}
|
||||
#endif
|
||||
__END_DECLS
|
||||
|
||||
/* Access the functions with their traditional names. */
|
||||
#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 */
|
@ -0,0 +1,4 @@
|
||||
#ifndef _SYS_TERMIOS_H
|
||||
#define _SYS_TERMIOS_H
|
||||
#include <termios.h>
|
||||
#endif
|
@ -0,0 +1,191 @@
|
||||
/* Copyright (C) 1991-2016 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
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_TIME_H
|
||||
#define _SYS_TIME_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#include <bits/types.h>
|
||||
#define __need_time_t
|
||||
#include <time.h>
|
||||
#define __need_timeval
|
||||
#include <bits/time.h>
|
||||
|
||||
#include <sys/select.h>
|
||||
|
||||
#ifndef __suseconds_t_defined
|
||||
typedef __suseconds_t suseconds_t;
|
||||
# define __suseconds_t_defined
|
||||
#endif
|
||||
|
||||
|
||||
__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. */
|
||||
};
|
||||
|
||||
typedef struct timezone *__restrict __timezone_ptr_t;
|
||||
#else
|
||||
typedef void *__restrict __timezone_ptr_t;
|
||||
#endif
|
||||
|
||||
/* Get the current time of day and timezone information,
|
||||
putting it into *TV and *TZ. If TZ is NULL, *TZ is not filled.
|
||||
Returns 0 on success, -1 on errors.
|
||||
NOTE: This form of timezone information is obsolete.
|
||||
Use the functions and variables declared in <time.h> instead. */
|
||||
extern int gettimeofday (struct timeval *__restrict __tv,
|
||||
__timezone_ptr_t __tz) __THROW __nonnull ((1));
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* Set the current time of day and timezone information.
|
||||
This call is restricted to the super-user. */
|
||||
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;
|
||||
#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
|
||||
|
||||
/* 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));
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* 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;
|
||||
#endif
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* 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;
|
||||
#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 */
|
@ -0,0 +1,45 @@
|
||||
/* Copyright (C) 1994-2016 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
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_TIMEB_H
|
||||
#define _SYS_TIMEB_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#define __need_time_t
|
||||
#include <time.h>
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Structure returned by the `ftime' function. */
|
||||
|
||||
struct timeb
|
||||
{
|
||||
time_t time; /* Seconds since epoch, as from `time'. */
|
||||
unsigned short int millitm; /* Additional milliseconds. */
|
||||
short int timezone; /* Minutes west of GMT. */
|
||||
short int dstflag; /* Nonzero if Daylight Savings Time used. */
|
||||
};
|
||||
|
||||
/* Fill in TIMEBUF with information about the current time. */
|
||||
|
||||
extern int ftime (struct timeb *__timebuf);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/timeb.h */
|
@ -0,0 +1,52 @@
|
||||
/* Copyright (C) 2008-2016 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
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_TIMERFD_H
|
||||
#define _SYS_TIMERFD_H 1
|
||||
|
||||
#include <time.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
|
||||
};
|
||||
|
||||
|
||||
__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;
|
||||
|
||||
/* Return the next expiration time of UFD. */
|
||||
extern int timerfd_gettime (int __ufd, struct itimerspec *__otmr) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/timerfd.h */
|
@ -0,0 +1,52 @@
|
||||
/* Copyright (C) 1991-2016 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
|
||||
<http://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>
|
||||
|
||||
#define __need_clock_t
|
||||
#include <time.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 */
|
@ -0,0 +1,71 @@
|
||||
/* Copyright (C) 1995-2016 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
|
||||
<http://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
|
||||
|
||||
extern int __adjtimex (struct timex *__ntx) __THROW;
|
||||
extern int adjtimex (struct timex *__ntx) __THROW;
|
||||
|
||||
#ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv),
|
||||
ntp_gettimex);
|
||||
#else
|
||||
extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW;
|
||||
# define ntp_gettime ntp_gettimex
|
||||
#endif
|
||||
extern int ntp_adjtime (struct timex *__tntx) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/timex.h */
|
@ -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 */
|
@ -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
|
@ -0,0 +1,275 @@
|
||||
/* Copyright (C) 1991-2016 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
|
||||
<http://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
|
||||
#endif
|
||||
|
||||
typedef __loff_t loff_t;
|
||||
|
||||
#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
|
||||
# define __need_clock_t
|
||||
#endif
|
||||
#define __need_time_t
|
||||
#define __need_timer_t
|
||||
#define __need_clockid_t
|
||||
#include <time.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. */
|
||||
|
||||
#if !__GNUC_PREREQ (2, 7)
|
||||
|
||||
/* These types are defined by the ISO C99 header <inttypes.h>. */
|
||||
# ifndef __int8_t_defined
|
||||
# define __int8_t_defined
|
||||
typedef char int8_t;
|
||||
typedef short int int16_t;
|
||||
typedef int int32_t;
|
||||
# if __WORDSIZE == 64
|
||||
typedef long int int64_t;
|
||||
# else
|
||||
__extension__ typedef long long int int64_t;
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* But these were defined by ISO C without the first `_'. */
|
||||
typedef unsigned char u_int8_t;
|
||||
typedef unsigned short int u_int16_t;
|
||||
typedef unsigned int u_int32_t;
|
||||
# if __WORDSIZE == 64
|
||||
typedef unsigned long int u_int64_t;
|
||||
# else
|
||||
__extension__ typedef unsigned long long int u_int64_t;
|
||||
# endif
|
||||
|
||||
typedef int register_t;
|
||||
|
||||
#else
|
||||
|
||||
/* For GCC 2.7 and later, we can use specific type-size attributes. */
|
||||
# define __intN_t(N, MODE) \
|
||||
typedef int int##N##_t __attribute__ ((__mode__ (MODE)))
|
||||
# define __u_intN_t(N, MODE) \
|
||||
typedef unsigned int u_int##N##_t __attribute__ ((__mode__ (MODE)))
|
||||
|
||||
# ifndef __int8_t_defined
|
||||
# define __int8_t_defined
|
||||
__intN_t (8, __QI__);
|
||||
__intN_t (16, __HI__);
|
||||
__intN_t (32, __SI__);
|
||||
__intN_t (64, __DI__);
|
||||
# endif
|
||||
|
||||
__u_intN_t (8, __QI__);
|
||||
__u_intN_t (16, __HI__);
|
||||
__u_intN_t (32, __SI__);
|
||||
__u_intN_t (64, __DI__);
|
||||
|
||||
typedef int register_t __attribute__ ((__mode__ (__word__)));
|
||||
|
||||
|
||||
/* Some code from BIND tests this macro to see if the types above are
|
||||
defined. */
|
||||
#endif
|
||||
#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>
|
||||
|
||||
/* BSD defines these symbols, so we follow. */
|
||||
# include <sys/sysmacros.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 */
|
@ -0,0 +1,246 @@
|
||||
/* Copyright (C) 2001-2016 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
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_UCONTEXT_H
|
||||
#define _SYS_UCONTEXT_H 1
|
||||
|
||||
#include <features.h>
|
||||
#include <signal.h>
|
||||
|
||||
/* We need the signal context definitions even if they are not used
|
||||
included in <signal.h>. */
|
||||
#include <bits/sigcontext.h>
|
||||
|
||||
#ifdef __x86_64__
|
||||
|
||||
/* Type for general register. */
|
||||
__extension__ typedef long long int greg_t;
|
||||
|
||||
/* Number of general registers. */
|
||||
#define NGREG 23
|
||||
|
||||
/* 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 significand[4];
|
||||
unsigned short int exponent;
|
||||
unsigned short int padding[3];
|
||||
};
|
||||
|
||||
struct _libc_xmmreg
|
||||
{
|
||||
__uint32_t element[4];
|
||||
};
|
||||
|
||||
struct _libc_fpstate
|
||||
{
|
||||
/* 64-bit FXSAVE format. */
|
||||
__uint16_t cwd;
|
||||
__uint16_t swd;
|
||||
__uint16_t ftw;
|
||||
__uint16_t fop;
|
||||
__uint64_t rip;
|
||||
__uint64_t rdp;
|
||||
__uint32_t mxcsr;
|
||||
__uint32_t mxcr_mask;
|
||||
struct _libc_fpxreg _st[8];
|
||||
struct _libc_xmmreg _xmm[16];
|
||||
__uint32_t padding[24];
|
||||
};
|
||||
|
||||
/* Structure to describe FPU registers. */
|
||||
typedef struct _libc_fpstate *fpregset_t;
|
||||
|
||||
/* Context to describe whole processor state. */
|
||||
typedef struct
|
||||
{
|
||||
gregset_t gregs;
|
||||
/* Note that fpregs is a pointer. */
|
||||
fpregset_t fpregs;
|
||||
__extension__ unsigned long long __reserved1 [8];
|
||||
} mcontext_t;
|
||||
|
||||
/* Userlevel context. */
|
||||
typedef struct ucontext
|
||||
{
|
||||
unsigned long int uc_flags;
|
||||
struct ucontext *uc_link;
|
||||
stack_t uc_stack;
|
||||
mcontext_t uc_mcontext;
|
||||
__sigset_t uc_sigmask;
|
||||
struct _libc_fpstate __fpregs_mem;
|
||||
} ucontext_t;
|
||||
|
||||
#else /* !__x86_64__ */
|
||||
|
||||
/* Type for general register. */
|
||||
typedef int greg_t;
|
||||
|
||||
/* Number of general registers. */
|
||||
#define NGREG 19
|
||||
|
||||
/* 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 significand[4];
|
||||
unsigned short int exponent;
|
||||
};
|
||||
|
||||
struct _libc_fpstate
|
||||
{
|
||||
unsigned long int cw;
|
||||
unsigned long int sw;
|
||||
unsigned long int tag;
|
||||
unsigned long int ipoff;
|
||||
unsigned long int cssel;
|
||||
unsigned long int dataoff;
|
||||
unsigned long int datasel;
|
||||
struct _libc_fpreg _st[8];
|
||||
unsigned long int status;
|
||||
};
|
||||
|
||||
/* Structure to describe FPU registers. */
|
||||
typedef struct _libc_fpstate *fpregset_t;
|
||||
|
||||
/* Context to describe whole processor state. */
|
||||
typedef struct
|
||||
{
|
||||
gregset_t 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 fpregs;
|
||||
unsigned long int oldmask;
|
||||
unsigned long int cr2;
|
||||
} mcontext_t;
|
||||
|
||||
/* Userlevel context. */
|
||||
typedef struct ucontext
|
||||
{
|
||||
unsigned long int uc_flags;
|
||||
struct ucontext *uc_link;
|
||||
stack_t uc_stack;
|
||||
mcontext_t uc_mcontext;
|
||||
__sigset_t uc_sigmask;
|
||||
struct _libc_fpstate __fpregs_mem;
|
||||
} ucontext_t;
|
||||
|
||||
#endif /* !__x86_64__ */
|
||||
|
||||
#endif /* sys/ucontext.h */
|
@ -0,0 +1,122 @@
|
||||
/* Copyright (C) 1991-2016 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
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_UIO_H
|
||||
#define _SYS_UIO_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* This file defines `struct iovec'. */
|
||||
#include <bits/uio.h>
|
||||
|
||||
|
||||
/* 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;
|
||||
|
||||
/* 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;
|
||||
|
||||
|
||||
#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;
|
||||
|
||||
/* 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;
|
||||
# else
|
||||
# ifdef __REDIRECT
|
||||
extern ssize_t __REDIRECT (preadv, (int __fd, const struct iovec *__iovec,
|
||||
int __count, __off64_t __offset),
|
||||
preadv64) __wur;
|
||||
extern ssize_t __REDIRECT (pwritev, (int __fd, const struct iovec *__iovec,
|
||||
int __count, __off64_t __offset),
|
||||
pwritev64) __wur;
|
||||
# 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;
|
||||
|
||||
/* 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;
|
||||
# endif
|
||||
#endif /* Use misc. */
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/uio.h */
|
@ -0,0 +1 @@
|
||||
#include <linux/ultrasound.h>
|
@ -0,0 +1,46 @@
|
||||
/* Copyright (C) 1991-2016 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
|
||||
<http://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 sockaddr_un
|
||||
{
|
||||
__SOCKADDR_COMMON (sun_);
|
||||
char sun_path[108]; /* Path name. */
|
||||
};
|
||||
|
||||
|
||||
#ifdef __USE_MISC
|
||||
# include <string.h> /* For prototype of `strlen'. */
|
||||
|
||||
/* Evaluate to actual length of the `sockaddr_un' structure. */
|
||||
# define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \
|
||||
+ strlen ((ptr)->sun_path))
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/un.h */
|
@ -0,0 +1 @@
|
||||
#include <unistd.h>
|
@ -0,0 +1,180 @@
|
||||
/* Copyright (C) 2001-2016 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
|
||||
<http://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 */
|
@ -0,0 +1,37 @@
|
||||
/* Header describing obsolete `ustat' interface.
|
||||
Copyright (C) 1996-2016 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
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/*
|
||||
* This interface is obsolete. Use <sys/statfs.h> instead.
|
||||
*/
|
||||
|
||||
#ifndef _SYS_USTAT_H
|
||||
#define _SYS_USTAT_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <bits/ustat.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
extern int ustat (__dev_t __dev, struct ustat *__ubuf) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/ustat.h */
|
@ -0,0 +1,86 @@
|
||||
/* Copyright (C) 1991-2016 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
|
||||
<http://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 */
|
@ -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>
|
@ -0,0 +1,67 @@
|
||||
/* Copyright (C) 1991-2016 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
|
||||
<http://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 */
|
@ -0,0 +1,38 @@
|
||||
/* Copyright (C) 1996-2016 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
|
||||
<http://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 */
|
@ -0,0 +1 @@
|
||||
#include <linux/vt.h>
|
@ -0,0 +1,68 @@
|
||||
/* Copyright (C) 1991-2016 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
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_VTIMES_H
|
||||
#define _SYS_VTIMES_H 1
|
||||
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* This interface is obsolete; use `getrusage' instead. */
|
||||
|
||||
/* Granularity of the `vm_utime' and `vm_stime' fields of a `struct vtimes'.
|
||||
(This is the frequency of the machine's power supply, in Hz.) */
|
||||
#define VTIMES_UNITS_PER_SECOND 60
|
||||
|
||||
struct vtimes
|
||||
{
|
||||
/* User time used in units of 1/VTIMES_UNITS_PER_SECOND seconds. */
|
||||
int vm_utime;
|
||||
/* System time used in units of 1/VTIMES_UNITS_PER_SECOND seconds. */
|
||||
int vm_stime;
|
||||
|
||||
/* Amount of data and stack memory used (kilobyte-seconds). */
|
||||
unsigned int vm_idsrss;
|
||||
/* Amount of text memory used (kilobyte-seconds). */
|
||||
unsigned int vm_ixrss;
|
||||
/* Maximum resident set size (text, data, and stack) (kilobytes). */
|
||||
int vm_maxrss;
|
||||
|
||||
/* Number of hard page faults (i.e. those that required I/O). */
|
||||
int vm_majflt;
|
||||
/* Number of soft page faults (i.e. those serviced by reclaiming
|
||||
a page from the list of pages awaiting reallocation. */
|
||||
int vm_minflt;
|
||||
|
||||
/* Number of times a process was swapped out of physical memory. */
|
||||
int vm_nswap;
|
||||
|
||||
/* Number of input operations via the file system. Note: This
|
||||
and `ru_oublock' do not include operations with the cache. */
|
||||
int vm_inblk;
|
||||
/* Number of output operations via the file system. */
|
||||
int vm_oublk;
|
||||
};
|
||||
|
||||
/* If CURRENT is not NULL, write statistics for the current process into
|
||||
*CURRENT. If CHILD is not NULL, write statistics for all terminated child
|
||||
processes into *CHILD. Returns 0 for success, -1 for failure. */
|
||||
extern int vtimes (struct vtimes * __current, struct vtimes * __child) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/vtimes.h */
|
@ -0,0 +1,175 @@
|
||||
/* Copyright (C) 1991-2016 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
|
||||
<http://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 <signal.h>
|
||||
|
||||
/* 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>
|
||||
|
||||
# ifdef __USE_MISC
|
||||
|
||||
/* Lots of hair to allow traditional BSD use of `union wait'
|
||||
as well as POSIX.1 use of `int' for the status word. */
|
||||
|
||||
# if defined __GNUC__ && !defined __cplusplus
|
||||
# define __WAIT_INT(status) \
|
||||
(__extension__ (((union { __typeof(status) __in; int __i; }) \
|
||||
{ .__in = (status) }).__i))
|
||||
# else
|
||||
# define __WAIT_INT(status) (*(const int *) &(status))
|
||||
# endif
|
||||
|
||||
/* This is the type of the argument to `wait'. The funky union
|
||||
causes redeclarations with either `int *' or `union wait *' to be
|
||||
allowed without complaint. __WAIT_STATUS_DEFN is the type used in
|
||||
the actual function definitions. */
|
||||
|
||||
# if !defined __GNUC__ || __GNUC__ < 2 || defined __cplusplus
|
||||
# define __WAIT_STATUS void *
|
||||
# define __WAIT_STATUS_DEFN void *
|
||||
# else
|
||||
/* This works in GCC 2.6.1 and later. */
|
||||
typedef union
|
||||
{
|
||||
union wait *__uptr;
|
||||
int *__iptr;
|
||||
} __WAIT_STATUS __attribute__ ((__transparent_union__));
|
||||
# define __WAIT_STATUS_DEFN int *
|
||||
# endif
|
||||
|
||||
# else /* Don't use misc. */
|
||||
|
||||
# define __WAIT_INT(status) (status)
|
||||
# define __WAIT_STATUS int *
|
||||
# define __WAIT_STATUS_DEFN int *
|
||||
|
||||
# endif /* Use misc. */
|
||||
|
||||
/* This will define all the `__W*' macros. */
|
||||
# include <bits/waitstatus.h>
|
||||
|
||||
# define WEXITSTATUS(status) __WEXITSTATUS (__WAIT_INT (status))
|
||||
# define WTERMSIG(status) __WTERMSIG (__WAIT_INT (status))
|
||||
# define WSTOPSIG(status) __WSTOPSIG (__WAIT_INT (status))
|
||||
# define WIFEXITED(status) __WIFEXITED (__WAIT_INT (status))
|
||||
# define WIFSIGNALED(status) __WIFSIGNALED (__WAIT_INT (status))
|
||||
# define WIFSTOPPED(status) __WIFSTOPPED (__WAIT_INT (status))
|
||||
# ifdef __WIFCONTINUED
|
||||
# define WIFCONTINUED(status) __WIFCONTINUED (__WAIT_INT (status))
|
||||
# endif
|
||||
#endif /* <stdlib.h> not included. */
|
||||
|
||||
#ifdef __USE_MISC
|
||||
# define WCOREFLAG __WCOREFLAG
|
||||
# define WCOREDUMP(status) __WCOREDUMP (__WAIT_INT (status))
|
||||
# define W_EXITCODE(ret, sig) __W_EXITCODE (ret, sig)
|
||||
# define W_STOPCODE(sig) __W_STOPCODE (sig)
|
||||
#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 (__WAIT_STATUS __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 || defined __USE_XOPEN2K8
|
||||
# ifndef __id_t_defined
|
||||
# include <bits/types.h>
|
||||
typedef __id_t id_t;
|
||||
# define __id_t_defined
|
||||
# endif
|
||||
|
||||
# define __need_siginfo_t
|
||||
# include <bits/siginfo.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
|
||||
/* 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. */
|
||||
extern __pid_t wait3 (__WAIT_STATUS __stat_loc, int __options,
|
||||
struct rusage * __usage) __THROWNL;
|
||||
#endif
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* PID is like waitpid. Other args are like wait3. */
|
||||
extern __pid_t wait4 (__pid_t __pid, __WAIT_STATUS __stat_loc, int __options,
|
||||
struct rusage *__usage) __THROWNL;
|
||||
#endif /* Use misc. */
|
||||
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/wait.h */
|
@ -0,0 +1,105 @@
|
||||
/* Copyright (C) 2002-2016 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
|
||||
<http://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;
|
||||
|
||||
/* 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;
|
||||
|
||||
/* 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;
|
||||
|
||||
/* 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;
|
||||
|
||||
/* 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;
|
||||
|
||||
/* 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;
|
||||
|
||||
/* 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;
|
||||
|
||||
/* 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;
|
||||
|
||||
/* 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;
|
||||
|
||||
/* 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 */
|
Reference in New Issue
Block a user