Description: add posix api header files from musl
CommitID:70a1d0d4761c478b6b33c3eb29af254a445ada74
This commit is contained in:
parent
c3a34f1b79
commit
d3e54ea9aa
|
@ -1,2 +1,28 @@
|
|||
** DO NOT EDIT FILES HERE **
|
||||
|
||||
These header files are copied from musl ("//third_party/musl") except `libc.h'.
|
||||
|
||||
musl as a whole is licensed under the following standard MIT license:
|
||||
|
||||
----------------------------------------------------------------------
|
||||
Copyright © 2005-2020 Rich Felker, et al.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
----------------------------------------------------------------------
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
#ifndef _AIO_H
|
||||
#define _AIO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <features.h>
|
||||
#include <signal.h>
|
||||
#include <time.h>
|
||||
|
||||
#define __NEED_ssize_t
|
||||
#define __NEED_off_t
|
||||
|
||||
#include <bits/alltypes.h>
|
||||
|
||||
struct aiocb {
|
||||
int aio_fildes, aio_lio_opcode, aio_reqprio;
|
||||
volatile void *aio_buf;
|
||||
size_t aio_nbytes;
|
||||
struct sigevent aio_sigevent;
|
||||
void *__td;
|
||||
int __lock[2];
|
||||
volatile int __err;
|
||||
ssize_t __ret;
|
||||
off_t aio_offset;
|
||||
void *__next, *__prev;
|
||||
char __dummy4[32-2*sizeof(void *)];
|
||||
};
|
||||
|
||||
#define AIO_CANCELED 0
|
||||
#define AIO_NOTCANCELED 1
|
||||
#define AIO_ALLDONE 2
|
||||
|
||||
#define LIO_READ 0
|
||||
#define LIO_WRITE 1
|
||||
#define LIO_NOP 2
|
||||
|
||||
#define LIO_WAIT 0
|
||||
#define LIO_NOWAIT 1
|
||||
|
||||
int aio_read(struct aiocb *);
|
||||
int aio_write(struct aiocb *);
|
||||
int aio_error(const struct aiocb *);
|
||||
ssize_t aio_return(struct aiocb *);
|
||||
int aio_cancel(int, struct aiocb *);
|
||||
int aio_suspend(const struct aiocb *const [], int, const struct timespec *);
|
||||
int aio_fsync(int, struct aiocb *);
|
||||
|
||||
int lio_listio(int, struct aiocb *__restrict const *__restrict, int, struct sigevent *__restrict);
|
||||
|
||||
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
|
||||
#define aiocb64 aiocb
|
||||
#define aio_read64 aio_read
|
||||
#define aio_write64 aio_write
|
||||
#define aio_error64 aio_error
|
||||
#define aio_return64 aio_return
|
||||
#define aio_cancel64 aio_cancel
|
||||
#define aio_suspend64 aio_suspend
|
||||
#define aio_fsync64 aio_fsync
|
||||
#define lio_listio64 lio_listio
|
||||
#define off64_t off_t
|
||||
#endif
|
||||
|
||||
#if _REDIR_TIME64
|
||||
__REDIR(aio_suspend, __aio_suspend_time64);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef _ALLOCA_H
|
||||
#define _ALLOCA_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define __NEED_size_t
|
||||
#include <bits/alltypes.h>
|
||||
|
||||
void *alloca(size_t);
|
||||
|
||||
#define alloca __builtin_alloca
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,25 @@
|
|||
#ifndef _AR_H
|
||||
#define _AR_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define ARMAG "!<arch>\n"
|
||||
#define SARMAG 8
|
||||
#define ARFMAG "`\n"
|
||||
|
||||
struct ar_hdr {
|
||||
char ar_name[16];
|
||||
char ar_date[12];
|
||||
char ar_uid[6], ar_gid[6];
|
||||
char ar_mode[8];
|
||||
char ar_size[10];
|
||||
char ar_fmag[2];
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,35 @@
|
|||
#ifndef _ARPA_FTP_H
|
||||
#define _ARPA_FTP_H
|
||||
#define PRELIM 1
|
||||
#define COMPLETE 2
|
||||
#define CONTINUE 3
|
||||
#define TRANSIENT 4
|
||||
#define ERROR 5
|
||||
#define TYPE_A 1
|
||||
#define TYPE_E 2
|
||||
#define TYPE_I 3
|
||||
#define TYPE_L 4
|
||||
#define FORM_N 1
|
||||
#define FORM_T 2
|
||||
#define FORM_C 3
|
||||
#define STRU_F 1
|
||||
#define STRU_R 2
|
||||
#define STRU_P 3
|
||||
#define MODE_S 1
|
||||
#define MODE_B 2
|
||||
#define MODE_C 3
|
||||
#define REC_ESC '\377'
|
||||
#define REC_EOR '\001'
|
||||
#define REC_EOF '\002'
|
||||
#define BLK_EOR 0x80
|
||||
#define BLK_EOF 0x40
|
||||
#define BLK_ERRORS 0x20
|
||||
#define BLK_RESTART 0x10
|
||||
#define BLK_BYTECOUNT 2
|
||||
#ifdef FTP_NAMES
|
||||
char *modenames[] = {"0", "Stream", "Block", "Compressed" };
|
||||
char *strunames[] = {"0", "File", "Record", "Page" };
|
||||
char *typenames[] = {"0", "ASCII", "EBCDIC", "Image", "Local" };
|
||||
char *formnames[] = {"0", "Nonprint", "Telnet", "Carriage-control" };
|
||||
#endif
|
||||
#endif
|
|
@ -0,0 +1,36 @@
|
|||
#ifndef _ARPA_INET_H
|
||||
#define _ARPA_INET_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <features.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
uint32_t htonl(uint32_t);
|
||||
uint16_t htons(uint16_t);
|
||||
uint32_t ntohl(uint32_t);
|
||||
uint16_t ntohs(uint16_t);
|
||||
|
||||
in_addr_t inet_addr (const char *);
|
||||
in_addr_t inet_network (const char *);
|
||||
char *inet_ntoa (struct in_addr);
|
||||
int inet_pton (int, const char *__restrict, void *__restrict);
|
||||
const char *inet_ntop (int, const void *__restrict, char *__restrict, socklen_t);
|
||||
|
||||
int inet_aton (const char *, struct in_addr *);
|
||||
struct in_addr inet_makeaddr(in_addr_t, in_addr_t);
|
||||
in_addr_t inet_lnaof(struct in_addr);
|
||||
in_addr_t inet_netof(struct in_addr);
|
||||
|
||||
#undef INET_ADDRSTRLEN
|
||||
#undef INET6_ADDRSTRLEN
|
||||
#define INET_ADDRSTRLEN 16
|
||||
#define INET6_ADDRSTRLEN 46
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,455 @@
|
|||
#ifndef _ARPA_NAMESER_H
|
||||
#define _ARPA_NAMESER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define __NAMESER 19991006
|
||||
#define NS_PACKETSZ 512
|
||||
#define NS_MAXDNAME 1025
|
||||
#define NS_MAXMSG 65535
|
||||
#define NS_MAXCDNAME 255
|
||||
#define NS_MAXLABEL 63
|
||||
#define NS_HFIXEDSZ 12
|
||||
#define NS_QFIXEDSZ 4
|
||||
#define NS_RRFIXEDSZ 10
|
||||
#define NS_INT32SZ 4
|
||||
#define NS_INT16SZ 2
|
||||
#define NS_INT8SZ 1
|
||||
#define NS_INADDRSZ 4
|
||||
#define NS_IN6ADDRSZ 16
|
||||
#define NS_CMPRSFLGS 0xc0
|
||||
#define NS_DEFAULTPORT 53
|
||||
|
||||
typedef enum __ns_sect {
|
||||
ns_s_qd = 0,
|
||||
ns_s_zn = 0,
|
||||
ns_s_an = 1,
|
||||
ns_s_pr = 1,
|
||||
ns_s_ns = 2,
|
||||
ns_s_ud = 2,
|
||||
ns_s_ar = 3,
|
||||
ns_s_max = 4
|
||||
} ns_sect;
|
||||
|
||||
typedef struct __ns_msg {
|
||||
const unsigned char *_msg, *_eom;
|
||||
uint16_t _id, _flags, _counts[ns_s_max];
|
||||
const unsigned char *_sections[ns_s_max];
|
||||
ns_sect _sect;
|
||||
int _rrnum;
|
||||
const unsigned char *_msg_ptr;
|
||||
} ns_msg;
|
||||
|
||||
struct _ns_flagdata { int mask, shift; };
|
||||
extern const struct _ns_flagdata _ns_flagdata[];
|
||||
|
||||
#define ns_msg_id(handle) ((handle)._id + 0)
|
||||
#define ns_msg_base(handle) ((handle)._msg + 0)
|
||||
#define ns_msg_end(handle) ((handle)._eom + 0)
|
||||
#define ns_msg_size(handle) ((handle)._eom - (handle)._msg)
|
||||
#define ns_msg_count(handle, section) ((handle)._counts[section] + 0)
|
||||
#define ns_msg_getflag(handle, flag) \
|
||||
(((handle)._flags & _ns_flagdata[flag].mask) >> _ns_flagdata[flag].shift)
|
||||
|
||||
typedef struct __ns_rr {
|
||||
char name[NS_MAXDNAME];
|
||||
uint16_t type;
|
||||
uint16_t rr_class;
|
||||
uint32_t ttl;
|
||||
uint16_t rdlength;
|
||||
const unsigned char *rdata;
|
||||
} ns_rr;
|
||||
|
||||
#define ns_rr_name(rr) (((rr).name[0] != '\0') ? (rr).name : ".")
|
||||
#define ns_rr_type(rr) ((ns_type)((rr).type + 0))
|
||||
#define ns_rr_class(rr) ((ns_class)((rr).rr_class + 0))
|
||||
#define ns_rr_ttl(rr) ((rr).ttl + 0)
|
||||
#define ns_rr_rdlen(rr) ((rr).rdlength + 0)
|
||||
#define ns_rr_rdata(rr) ((rr).rdata + 0)
|
||||
|
||||
typedef enum __ns_flag {
|
||||
ns_f_qr,
|
||||
ns_f_opcode,
|
||||
ns_f_aa,
|
||||
ns_f_tc,
|
||||
ns_f_rd,
|
||||
ns_f_ra,
|
||||
ns_f_z,
|
||||
ns_f_ad,
|
||||
ns_f_cd,
|
||||
ns_f_rcode,
|
||||
ns_f_max
|
||||
} ns_flag;
|
||||
|
||||
typedef enum __ns_opcode {
|
||||
ns_o_query = 0,
|
||||
ns_o_iquery = 1,
|
||||
ns_o_status = 2,
|
||||
ns_o_notify = 4,
|
||||
ns_o_update = 5,
|
||||
ns_o_max = 6
|
||||
} ns_opcode;
|
||||
|
||||
typedef enum __ns_rcode {
|
||||
ns_r_noerror = 0,
|
||||
ns_r_formerr = 1,
|
||||
ns_r_servfail = 2,
|
||||
ns_r_nxdomain = 3,
|
||||
ns_r_notimpl = 4,
|
||||
ns_r_refused = 5,
|
||||
ns_r_yxdomain = 6,
|
||||
ns_r_yxrrset = 7,
|
||||
ns_r_nxrrset = 8,
|
||||
ns_r_notauth = 9,
|
||||
ns_r_notzone = 10,
|
||||
ns_r_max = 11,
|
||||
ns_r_badvers = 16,
|
||||
ns_r_badsig = 16,
|
||||
ns_r_badkey = 17,
|
||||
ns_r_badtime = 18
|
||||
} ns_rcode;
|
||||
|
||||
typedef enum __ns_update_operation {
|
||||
ns_uop_delete = 0,
|
||||
ns_uop_add = 1,
|
||||
ns_uop_max = 2
|
||||
} ns_update_operation;
|
||||
|
||||
struct ns_tsig_key {
|
||||
char name[NS_MAXDNAME], alg[NS_MAXDNAME];
|
||||
unsigned char *data;
|
||||
int len;
|
||||
};
|
||||
typedef struct ns_tsig_key ns_tsig_key;
|
||||
|
||||
struct ns_tcp_tsig_state {
|
||||
int counter;
|
||||
struct dst_key *key;
|
||||
void *ctx;
|
||||
unsigned char sig[NS_PACKETSZ];
|
||||
int siglen;
|
||||
};
|
||||
typedef struct ns_tcp_tsig_state ns_tcp_tsig_state;
|
||||
|
||||
#define NS_TSIG_FUDGE 300
|
||||
#define NS_TSIG_TCP_COUNT 100
|
||||
#define NS_TSIG_ALG_HMAC_MD5 "HMAC-MD5.SIG-ALG.REG.INT"
|
||||
|
||||
#define NS_TSIG_ERROR_NO_TSIG -10
|
||||
#define NS_TSIG_ERROR_NO_SPACE -11
|
||||
#define NS_TSIG_ERROR_FORMERR -12
|
||||
|
||||
typedef enum __ns_type {
|
||||
ns_t_invalid = 0,
|
||||
ns_t_a = 1,
|
||||
ns_t_ns = 2,
|
||||
ns_t_md = 3,
|
||||
ns_t_mf = 4,
|
||||
ns_t_cname = 5,
|
||||
ns_t_soa = 6,
|
||||
ns_t_mb = 7,
|
||||
ns_t_mg = 8,
|
||||
ns_t_mr = 9,
|
||||
ns_t_null = 10,
|
||||
ns_t_wks = 11,
|
||||
ns_t_ptr = 12,
|
||||
ns_t_hinfo = 13,
|
||||
ns_t_minfo = 14,
|
||||
ns_t_mx = 15,
|
||||
ns_t_txt = 16,
|
||||
ns_t_rp = 17,
|
||||
ns_t_afsdb = 18,
|
||||
ns_t_x25 = 19,
|
||||
ns_t_isdn = 20,
|
||||
ns_t_rt = 21,
|
||||
ns_t_nsap = 22,
|
||||
ns_t_nsap_ptr = 23,
|
||||
ns_t_sig = 24,
|
||||
ns_t_key = 25,
|
||||
ns_t_px = 26,
|
||||
ns_t_gpos = 27,
|
||||
ns_t_aaaa = 28,
|
||||
ns_t_loc = 29,
|
||||
ns_t_nxt = 30,
|
||||
ns_t_eid = 31,
|
||||
ns_t_nimloc = 32,
|
||||
ns_t_srv = 33,
|
||||
ns_t_atma = 34,
|
||||
ns_t_naptr = 35,
|
||||
ns_t_kx = 36,
|
||||
ns_t_cert = 37,
|
||||
ns_t_a6 = 38,
|
||||
ns_t_dname = 39,
|
||||
ns_t_sink = 40,
|
||||
ns_t_opt = 41,
|
||||
ns_t_apl = 42,
|
||||
ns_t_tkey = 249,
|
||||
ns_t_tsig = 250,
|
||||
ns_t_ixfr = 251,
|
||||
ns_t_axfr = 252,
|
||||
ns_t_mailb = 253,
|
||||
ns_t_maila = 254,
|
||||
ns_t_any = 255,
|
||||
ns_t_zxfr = 256,
|
||||
ns_t_max = 65536
|
||||
} ns_type;
|
||||
|
||||
#define ns_t_qt_p(t) (ns_t_xfr_p(t) || (t) == ns_t_any || \
|
||||
(t) == ns_t_mailb || (t) == ns_t_maila)
|
||||
#define ns_t_mrr_p(t) ((t) == ns_t_tsig || (t) == ns_t_opt)
|
||||
#define ns_t_rr_p(t) (!ns_t_qt_p(t) && !ns_t_mrr_p(t))
|
||||
#define ns_t_udp_p(t) ((t) != ns_t_axfr && (t) != ns_t_zxfr)
|
||||
#define ns_t_xfr_p(t) ((t) == ns_t_axfr || (t) == ns_t_ixfr || \
|
||||
(t) == ns_t_zxfr)
|
||||
|
||||
typedef enum __ns_class {
|
||||
ns_c_invalid = 0,
|
||||
ns_c_in = 1,
|
||||
ns_c_2 = 2,
|
||||
ns_c_chaos = 3,
|
||||
ns_c_hs = 4,
|
||||
ns_c_none = 254,
|
||||
ns_c_any = 255,
|
||||
ns_c_max = 65536
|
||||
} ns_class;
|
||||
|
||||
typedef enum __ns_key_types {
|
||||
ns_kt_rsa = 1,
|
||||
ns_kt_dh = 2,
|
||||
ns_kt_dsa = 3,
|
||||
ns_kt_private = 254
|
||||
} ns_key_types;
|
||||
|
||||
typedef enum __ns_cert_types {
|
||||
cert_t_pkix = 1,
|
||||
cert_t_spki = 2,
|
||||
cert_t_pgp = 3,
|
||||
cert_t_url = 253,
|
||||
cert_t_oid = 254
|
||||
} ns_cert_types;
|
||||
|
||||
#define NS_KEY_TYPEMASK 0xC000
|
||||
#define NS_KEY_TYPE_AUTH_CONF 0x0000
|
||||
#define NS_KEY_TYPE_CONF_ONLY 0x8000
|
||||
#define NS_KEY_TYPE_AUTH_ONLY 0x4000
|
||||
#define NS_KEY_TYPE_NO_KEY 0xC000
|
||||
#define NS_KEY_NO_AUTH 0x8000
|
||||
#define NS_KEY_NO_CONF 0x4000
|
||||
#define NS_KEY_RESERVED2 0x2000
|
||||
#define NS_KEY_EXTENDED_FLAGS 0x1000
|
||||
#define NS_KEY_RESERVED4 0x0800
|
||||
#define NS_KEY_RESERVED5 0x0400
|
||||
#define NS_KEY_NAME_TYPE 0x0300
|
||||
#define NS_KEY_NAME_USER 0x0000
|
||||
#define NS_KEY_NAME_ENTITY 0x0200
|
||||
#define NS_KEY_NAME_ZONE 0x0100
|
||||
#define NS_KEY_NAME_RESERVED 0x0300
|
||||
#define NS_KEY_RESERVED8 0x0080
|
||||
#define NS_KEY_RESERVED9 0x0040
|
||||
#define NS_KEY_RESERVED10 0x0020
|
||||
#define NS_KEY_RESERVED11 0x0010
|
||||
#define NS_KEY_SIGNATORYMASK 0x000F
|
||||
#define NS_KEY_RESERVED_BITMASK ( NS_KEY_RESERVED2 | \
|
||||
NS_KEY_RESERVED4 | \
|
||||
NS_KEY_RESERVED5 | \
|
||||
NS_KEY_RESERVED8 | \
|
||||
NS_KEY_RESERVED9 | \
|
||||
NS_KEY_RESERVED10 | \
|
||||
NS_KEY_RESERVED11 )
|
||||
#define NS_KEY_RESERVED_BITMASK2 0xFFFF
|
||||
#define NS_ALG_MD5RSA 1
|
||||
#define NS_ALG_DH 2
|
||||
#define NS_ALG_DSA 3
|
||||
#define NS_ALG_DSS NS_ALG_DSA
|
||||
#define NS_ALG_EXPIRE_ONLY 253
|
||||
#define NS_ALG_PRIVATE_OID 254
|
||||
|
||||
#define NS_KEY_PROT_TLS 1
|
||||
#define NS_KEY_PROT_EMAIL 2
|
||||
#define NS_KEY_PROT_DNSSEC 3
|
||||
#define NS_KEY_PROT_IPSEC 4
|
||||
#define NS_KEY_PROT_ANY 255
|
||||
|
||||
#define NS_MD5RSA_MIN_BITS 512
|
||||
#define NS_MD5RSA_MAX_BITS 4096
|
||||
#define NS_MD5RSA_MAX_BYTES ((NS_MD5RSA_MAX_BITS+7/8)*2+3)
|
||||
#define NS_MD5RSA_MAX_BASE64 (((NS_MD5RSA_MAX_BYTES+2)/3)*4)
|
||||
#define NS_MD5RSA_MIN_SIZE ((NS_MD5RSA_MIN_BITS+7)/8)
|
||||
#define NS_MD5RSA_MAX_SIZE ((NS_MD5RSA_MAX_BITS+7)/8)
|
||||
|
||||
#define NS_DSA_SIG_SIZE 41
|
||||
#define NS_DSA_MIN_SIZE 213
|
||||
#define NS_DSA_MAX_BYTES 405
|
||||
|
||||
#define NS_SIG_TYPE 0
|
||||
#define NS_SIG_ALG 2
|
||||
#define NS_SIG_LABELS 3
|
||||
#define NS_SIG_OTTL 4
|
||||
#define NS_SIG_EXPIR 8
|
||||
#define NS_SIG_SIGNED 12
|
||||
#define NS_SIG_FOOT 16
|
||||
#define NS_SIG_SIGNER 18
|
||||
#define NS_NXT_BITS 8
|
||||
#define NS_NXT_BIT_SET( n,p) (p[(n)/NS_NXT_BITS] |= (0x80>>((n)%NS_NXT_BITS)))
|
||||
#define NS_NXT_BIT_CLEAR(n,p) (p[(n)/NS_NXT_BITS] &= ~(0x80>>((n)%NS_NXT_BITS)))
|
||||
#define NS_NXT_BIT_ISSET(n,p) (p[(n)/NS_NXT_BITS] & (0x80>>((n)%NS_NXT_BITS)))
|
||||
#define NS_NXT_MAX 127
|
||||
|
||||
#define NS_OPT_DNSSEC_OK 0x8000U
|
||||
#define NS_OPT_NSID 3
|
||||
|
||||
#define NS_GET16(s, cp) (void)((s) = ns_get16(((cp)+=2)-2))
|
||||
#define NS_GET32(l, cp) (void)((l) = ns_get32(((cp)+=4)-4))
|
||||
#define NS_PUT16(s, cp) ns_put16((s), ((cp)+=2)-2)
|
||||
#define NS_PUT32(l, cp) ns_put32((l), ((cp)+=4)-4)
|
||||
|
||||
unsigned ns_get16(const unsigned char *);
|
||||
unsigned long ns_get32(const unsigned char *);
|
||||
void ns_put16(unsigned, unsigned char *);
|
||||
void ns_put32(unsigned long, unsigned char *);
|
||||
|
||||
int ns_initparse(const unsigned char *, int, ns_msg *);
|
||||
int ns_parserr(ns_msg *, ns_sect, int, ns_rr *);
|
||||
int ns_skiprr(const unsigned char *, const unsigned char *, ns_sect, int);
|
||||
int ns_name_uncompress(const unsigned char *, const unsigned char *, const unsigned char *, char *, size_t);
|
||||
|
||||
|
||||
#define __BIND 19950621
|
||||
|
||||
typedef struct {
|
||||
unsigned id :16;
|
||||
#if __BYTE_ORDER == __BIG_ENDIAN
|
||||
unsigned qr: 1;
|
||||
unsigned opcode: 4;
|
||||
unsigned aa: 1;
|
||||
unsigned tc: 1;
|
||||
unsigned rd: 1;
|
||||
unsigned ra: 1;
|
||||
unsigned unused :1;
|
||||
unsigned ad: 1;
|
||||
unsigned cd: 1;
|
||||
unsigned rcode :4;
|
||||
#else
|
||||
unsigned rd :1;
|
||||
unsigned tc :1;
|
||||
unsigned aa :1;
|
||||
unsigned opcode :4;
|
||||
unsigned qr :1;
|
||||
unsigned rcode :4;
|
||||
unsigned cd: 1;
|
||||
unsigned ad: 1;
|
||||
unsigned unused :1;
|
||||
unsigned ra :1;
|
||||
#endif
|
||||
unsigned qdcount :16;
|
||||
unsigned ancount :16;
|
||||
unsigned nscount :16;
|
||||
unsigned arcount :16;
|
||||
} HEADER;
|
||||
|
||||
#define PACKETSZ NS_PACKETSZ
|
||||
#define MAXDNAME NS_MAXDNAME
|
||||
#define MAXCDNAME NS_MAXCDNAME
|
||||
#define MAXLABEL NS_MAXLABEL
|
||||
#define HFIXEDSZ NS_HFIXEDSZ
|
||||
#define QFIXEDSZ NS_QFIXEDSZ
|
||||
#define RRFIXEDSZ NS_RRFIXEDSZ
|
||||
#define INT32SZ NS_INT32SZ
|
||||
#define INT16SZ NS_INT16SZ
|
||||
#define INT8SZ NS_INT8SZ
|
||||
#define INADDRSZ NS_INADDRSZ
|
||||
#define IN6ADDRSZ NS_IN6ADDRSZ
|
||||
#define INDIR_MASK NS_CMPRSFLGS
|
||||
#define NAMESERVER_PORT NS_DEFAULTPORT
|
||||
|
||||
#define S_ZONE ns_s_zn
|
||||
#define S_PREREQ ns_s_pr
|
||||
#define S_UPDATE ns_s_ud
|
||||
#define S_ADDT ns_s_ar
|
||||
|
||||
#define QUERY ns_o_query
|
||||
#define IQUERY ns_o_iquery
|
||||
#define STATUS ns_o_status
|
||||
#define NS_NOTIFY_OP ns_o_notify
|
||||
#define NS_UPDATE_OP ns_o_update
|
||||
|
||||
#define NOERROR ns_r_noerror
|
||||
#define FORMERR ns_r_formerr
|
||||
#define SERVFAIL ns_r_servfail
|
||||
#define NXDOMAIN ns_r_nxdomain
|
||||
#define NOTIMP ns_r_notimpl
|
||||
#define REFUSED ns_r_refused
|
||||
#define YXDOMAIN ns_r_yxdomain
|
||||
#define YXRRSET ns_r_yxrrset
|
||||
#define NXRRSET ns_r_nxrrset
|
||||
#define NOTAUTH ns_r_notauth
|
||||
#define NOTZONE ns_r_notzone
|
||||
|
||||
#define DELETE ns_uop_delete
|
||||
#define ADD ns_uop_add
|
||||
|
||||
#define T_A ns_t_a
|
||||
#define T_NS ns_t_ns
|
||||
#define T_MD ns_t_md
|
||||
#define T_MF ns_t_mf
|
||||
#define T_CNAME ns_t_cname
|
||||
#define T_SOA ns_t_soa
|
||||
#define T_MB ns_t_mb
|
||||
#define T_MG ns_t_mg
|
||||
#define T_MR ns_t_mr
|
||||
#define T_NULL ns_t_null
|
||||
#define T_WKS ns_t_wks
|
||||
#define T_PTR ns_t_ptr
|
||||
#define T_HINFO ns_t_hinfo
|
||||
#define T_MINFO ns_t_minfo
|
||||
#define T_MX ns_t_mx
|
||||
#define T_TXT ns_t_txt
|
||||
#define T_RP ns_t_rp
|
||||
#define T_AFSDB ns_t_afsdb
|
||||
#define T_X25 ns_t_x25
|
||||
#define T_ISDN ns_t_isdn
|
||||
#define T_RT ns_t_rt
|
||||
#define T_NSAP ns_t_nsap
|
||||
#define T_NSAP_PTR ns_t_nsap_ptr
|
||||
#define T_SIG ns_t_sig
|
||||
#define T_KEY ns_t_key
|
||||
#define T_PX ns_t_px
|
||||
#define T_GPOS ns_t_gpos
|
||||
#define T_AAAA ns_t_aaaa
|
||||
#define T_LOC ns_t_loc
|
||||
#define T_NXT ns_t_nxt
|
||||
#define T_EID ns_t_eid
|
||||
#define T_NIMLOC ns_t_nimloc
|
||||
#define T_SRV ns_t_srv
|
||||
#define T_ATMA ns_t_atma
|
||||
#define T_NAPTR ns_t_naptr
|
||||
#define T_A6 ns_t_a6
|
||||
#define T_DNAME ns_t_dname
|
||||
#define T_TSIG ns_t_tsig
|
||||
#define T_IXFR ns_t_ixfr
|
||||
#define T_AXFR ns_t_axfr
|
||||
#define T_MAILB ns_t_mailb
|
||||
#define T_MAILA ns_t_maila
|
||||
#define T_ANY ns_t_any
|
||||
|
||||
#define C_IN ns_c_in
|
||||
#define C_CHAOS ns_c_chaos
|
||||
#define C_HS ns_c_hs
|
||||
#define C_NONE ns_c_none
|
||||
#define C_ANY ns_c_any
|
||||
|
||||
#define GETSHORT NS_GET16
|
||||
#define GETLONG NS_GET32
|
||||
#define PUTSHORT NS_PUT16
|
||||
#define PUTLONG NS_PUT32
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,2 @@
|
|||
#include <arpa/nameser.h>
|
||||
|
|
@ -0,0 +1,251 @@
|
|||
#ifndef _ARPA_TELNET_H
|
||||
#define _ARPA_TELNET_H
|
||||
|
||||
#define IAC 255
|
||||
#define DONT 254
|
||||
#define DO 253
|
||||
#define WONT 252
|
||||
#define WILL 251
|
||||
#define SB 250
|
||||
#define GA 249
|
||||
#define EL 248
|
||||
#define EC 247
|
||||
#define AYT 246
|
||||
#define AO 245
|
||||
#define IP 244
|
||||
#define BREAK 243
|
||||
#define DM 242
|
||||
#define NOP 241
|
||||
#define SE 240
|
||||
#define EOR 239
|
||||
#define ABORT 238
|
||||
#define SUSP 237
|
||||
#define xEOF 236
|
||||
|
||||
#define SYNCH 242
|
||||
|
||||
#define telcmds ((char [][6]){ "EOF", "SUSP", "ABORT", "EOR", "SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC", "EL", "GA", "SB", "WILL", "WONT", "DO", "DONT", "IAC", 0 })
|
||||
|
||||
#define TELCMD_FIRST xEOF
|
||||
#define TELCMD_LAST IAC
|
||||
#define TELCMD_OK(x) ((unsigned int)(x) <= TELCMD_LAST && \
|
||||
(unsigned int)(x) >= TELCMD_FIRST)
|
||||
#define TELCMD(x) telcmds[(x)-TELCMD_FIRST]
|
||||
|
||||
#define TELOPT_BINARY 0
|
||||
#define TELOPT_ECHO 1
|
||||
#define TELOPT_RCP 2
|
||||
#define TELOPT_SGA 3
|
||||
#define TELOPT_NAMS 4
|
||||
#define TELOPT_STATUS 5
|
||||
#define TELOPT_TM 6
|
||||
#define TELOPT_RCTE 7
|
||||
#define TELOPT_NAOL 8
|
||||
#define TELOPT_NAOP 9
|
||||
#define TELOPT_NAOCRD 10
|
||||
#define TELOPT_NAOHTS 11
|
||||
#define TELOPT_NAOHTD 12
|
||||
#define TELOPT_NAOFFD 13
|
||||
#define TELOPT_NAOVTS 14
|
||||
#define TELOPT_NAOVTD 15
|
||||
#define TELOPT_NAOLFD 16
|
||||
#define TELOPT_XASCII 17
|
||||
#define TELOPT_LOGOUT 18
|
||||
#define TELOPT_BM 19
|
||||
#define TELOPT_DET 20
|
||||
#define TELOPT_SUPDUP 21
|
||||
#define TELOPT_SUPDUPOUTPUT 22
|
||||
#define TELOPT_SNDLOC 23
|
||||
#define TELOPT_TTYPE 24
|
||||
#define TELOPT_EOR 25
|
||||
#define TELOPT_TUID 26
|
||||
#define TELOPT_OUTMRK 27
|
||||
#define TELOPT_TTYLOC 28
|
||||
#define TELOPT_3270REGIME 29
|
||||
#define TELOPT_X3PAD 30
|
||||
#define TELOPT_NAWS 31
|
||||
#define TELOPT_TSPEED 32
|
||||
#define TELOPT_LFLOW 33
|
||||
#define TELOPT_LINEMODE 34
|
||||
#define TELOPT_XDISPLOC 35
|
||||
#define TELOPT_OLD_ENVIRON 36
|
||||
#define TELOPT_AUTHENTICATION 37/* Authenticate */
|
||||
#define TELOPT_ENCRYPT 38
|
||||
#define TELOPT_NEW_ENVIRON 39
|
||||
#define TELOPT_EXOPL 255
|
||||
|
||||
|
||||
#define NTELOPTS (1+TELOPT_NEW_ENVIRON)
|
||||
#ifdef TELOPTS
|
||||
char *telopts[NTELOPTS+1] = {
|
||||
"BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME",
|
||||
"STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP",
|
||||
"NAOCRD", "NAOHTS", "NAOHTD", "NAOFFD", "NAOVTS",
|
||||
"NAOVTD", "NAOLFD", "EXTEND ASCII", "LOGOUT", "BYTE MACRO",
|
||||
"DATA ENTRY TERMINAL", "SUPDUP", "SUPDUP OUTPUT",
|
||||
"SEND LOCATION", "TERMINAL TYPE", "END OF RECORD",
|
||||
"TACACS UID", "OUTPUT MARKING", "TTYLOC",
|
||||
"3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW",
|
||||
"LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION",
|
||||
"ENCRYPT", "NEW-ENVIRON",
|
||||
0,
|
||||
};
|
||||
#define TELOPT_FIRST TELOPT_BINARY
|
||||
#define TELOPT_LAST TELOPT_NEW_ENVIRON
|
||||
#define TELOPT_OK(x) ((unsigned int)(x) <= TELOPT_LAST)
|
||||
#define TELOPT(x) telopts[(x)-TELOPT_FIRST]
|
||||
#endif
|
||||
|
||||
#define TELQUAL_IS 0
|
||||
#define TELQUAL_SEND 1
|
||||
#define TELQUAL_INFO 2
|
||||
#define TELQUAL_REPLY 2
|
||||
#define TELQUAL_NAME 3
|
||||
|
||||
#define LFLOW_OFF 0
|
||||
#define LFLOW_ON 1
|
||||
#define LFLOW_RESTART_ANY 2
|
||||
#define LFLOW_RESTART_XON 3
|
||||
|
||||
|
||||
#define LM_MODE 1
|
||||
#define LM_FORWARDMASK 2
|
||||
#define LM_SLC 3
|
||||
|
||||
#define MODE_EDIT 0x01
|
||||
#define MODE_TRAPSIG 0x02
|
||||
#define MODE_ACK 0x04
|
||||
#define MODE_SOFT_TAB 0x08
|
||||
#define MODE_LIT_ECHO 0x10
|
||||
|
||||
#define MODE_MASK 0x1f
|
||||
|
||||
#define MODE_FLOW 0x0100
|
||||
#define MODE_ECHO 0x0200
|
||||
#define MODE_INBIN 0x0400
|
||||
#define MODE_OUTBIN 0x0800
|
||||
#define MODE_FORCE 0x1000
|
||||
|
||||
#define SLC_SYNCH 1
|
||||
#define SLC_BRK 2
|
||||
#define SLC_IP 3
|
||||
#define SLC_AO 4
|
||||
#define SLC_AYT 5
|
||||
#define SLC_EOR 6
|
||||
#define SLC_ABORT 7
|
||||
#define SLC_EOF 8
|
||||
#define SLC_SUSP 9
|
||||
#define SLC_EC 10
|
||||
#define SLC_EL 11
|
||||
#define SLC_EW 12
|
||||
#define SLC_RP 13
|
||||
#define SLC_LNEXT 14
|
||||
#define SLC_XON 15
|
||||
#define SLC_XOFF 16
|
||||
#define SLC_FORW1 17
|
||||
#define SLC_FORW2 18
|
||||
|
||||
#define NSLC 18
|
||||
|
||||
#define SLC_NAMELIST "0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", \
|
||||
"ABORT", "EOF", "SUSP", "EC", "EL", "EW", "RP", \
|
||||
"LNEXT", "XON", "XOFF", "FORW1", "FORW2", 0,
|
||||
#ifdef SLC_NAMES
|
||||
char *slc_names[] = {
|
||||
SLC_NAMELIST
|
||||
};
|
||||
#else
|
||||
extern char *slc_names[];
|
||||
#define SLC_NAMES SLC_NAMELIST
|
||||
#endif
|
||||
|
||||
#define SLC_NAME_OK(x) ((unsigned int)(x) <= NSLC)
|
||||
#define SLC_NAME(x) slc_names[x]
|
||||
|
||||
#define SLC_NOSUPPORT 0
|
||||
#define SLC_CANTCHANGE 1
|
||||
#define SLC_VARIABLE 2
|
||||
#define SLC_DEFAULT 3
|
||||
#define SLC_LEVELBITS 0x03
|
||||
|
||||
#define SLC_FUNC 0
|
||||
#define SLC_FLAGS 1
|
||||
#define SLC_VALUE 2
|
||||
|
||||
#define SLC_ACK 0x80
|
||||
#define SLC_FLUSHIN 0x40
|
||||
#define SLC_FLUSHOUT 0x20
|
||||
|
||||
#define OLD_ENV_VAR 1
|
||||
#define OLD_ENV_VALUE 0
|
||||
#define NEW_ENV_VAR 0
|
||||
#define NEW_ENV_VALUE 1
|
||||
#define ENV_ESC 2
|
||||
#define ENV_USERVAR 3
|
||||
|
||||
#define AUTH_WHO_CLIENT 0
|
||||
#define AUTH_WHO_SERVER 1
|
||||
#define AUTH_WHO_MASK 1
|
||||
|
||||
#define AUTH_HOW_ONE_WAY 0
|
||||
#define AUTH_HOW_MUTUAL 2
|
||||
#define AUTH_HOW_MASK 2
|
||||
|
||||
#define AUTHTYPE_NULL 0
|
||||
#define AUTHTYPE_KERBEROS_V4 1
|
||||
#define AUTHTYPE_KERBEROS_V5 2
|
||||
#define AUTHTYPE_SPX 3
|
||||
#define AUTHTYPE_MINK 4
|
||||
#define AUTHTYPE_CNT 5
|
||||
|
||||
#define AUTHTYPE_TEST 99
|
||||
|
||||
#ifdef AUTH_NAMES
|
||||
char *authtype_names[] = {
|
||||
"NULL", "KERBEROS_V4", "KERBEROS_V5", "SPX", "MINK", 0,
|
||||
};
|
||||
#else
|
||||
extern char *authtype_names[];
|
||||
#endif
|
||||
|
||||
#define AUTHTYPE_NAME_OK(x) ((unsigned int)(x) < AUTHTYPE_CNT)
|
||||
#define AUTHTYPE_NAME(x) authtype_names[x]
|
||||
|
||||
#define ENCRYPT_IS 0
|
||||
#define ENCRYPT_SUPPORT 1
|
||||
#define ENCRYPT_REPLY 2
|
||||
#define ENCRYPT_START 3
|
||||
#define ENCRYPT_END 4
|
||||
#define ENCRYPT_REQSTART 5
|
||||
#define ENCRYPT_REQEND 6
|
||||
#define ENCRYPT_ENC_KEYID 7
|
||||
#define ENCRYPT_DEC_KEYID 8
|
||||
#define ENCRYPT_CNT 9
|
||||
|
||||
#define ENCTYPE_ANY 0
|
||||
#define ENCTYPE_DES_CFB64 1
|
||||
#define ENCTYPE_DES_OFB64 2
|
||||
#define ENCTYPE_CNT 3
|
||||
|
||||
#ifdef ENCRYPT_NAMES
|
||||
char *encrypt_names[] = {
|
||||
"IS", "SUPPORT", "REPLY", "START", "END",
|
||||
"REQUEST-START", "REQUEST-END", "ENC-KEYID", "DEC-KEYID",
|
||||
0,
|
||||
};
|
||||
char *enctype_names[] = {
|
||||
"ANY", "DES_CFB64", "DES_OFB64", 0,
|
||||
};
|
||||
#else
|
||||
extern char *encrypt_names[];
|
||||
extern char *enctype_names[];
|
||||
#endif
|
||||
|
||||
|
||||
#define ENCRYPT_NAME_OK(x) ((unsigned int)(x) < ENCRYPT_CNT)
|
||||
#define ENCRYPT_NAME(x) encrypt_names[x]
|
||||
|
||||
#define ENCTYPE_NAME_OK(x) ((unsigned int)(x) < ENCTYPE_CNT)
|
||||
#define ENCTYPE_NAME(x) enctype_names[x]
|
||||
|
||||
#endif
|
|
@ -0,0 +1,31 @@
|
|||
#ifndef _ARPA_TFTP_H
|
||||
#define _ARPA_TFTP_H
|
||||
#define SEGSIZE 512
|
||||
#define RRQ 01
|
||||
#define WRQ 02
|
||||
#define DATA 03
|
||||
#define ACK 04
|
||||
#define ERROR 05
|
||||
struct tftphdr {
|
||||
short th_opcode;
|
||||
union {
|
||||
unsigned short tu_block;
|
||||
short tu_code;
|
||||
char tu_stuff[1];
|
||||
} th_u;
|
||||
char th_data[1];
|
||||
};
|
||||
#define th_block th_u.tu_block
|
||||
#define th_code th_u.tu_code
|
||||
#define th_stuff th_u.tu_stuff
|
||||
#define th_msg th_data
|
||||
#define EUNDEF 0
|
||||
#define ENOTFOUND 1
|
||||
#define EACCESS 2
|
||||
#define ENOSPACE 3
|
||||
#define EBADOP 4
|
||||
#define EBADID 5
|
||||
#define EEXISTS 6
|
||||
#define ENOUSER 7
|
||||
#endif
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
* This header was generated from the Linux kernel headers by update_headers.py,
|
||||
* to provide necessary information from kernel to userspace, such as constants,
|
||||
* structures, and macros, and thus, contains no copyrightable information.
|
||||
*/
|
||||
#ifndef _UAPI__ASM_GENERIC_BITS_PER_LONG
|
||||
#define _UAPI__ASM_GENERIC_BITS_PER_LONG
|
||||
#ifndef __BITS_PER_LONG
|
||||
#define __BITS_PER_LONG 32
|
||||
#endif
|
||||
#endif
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* This header was generated from the Linux kernel headers by update_headers.py,
|
||||
* to provide necessary information from kernel to userspace, such as constants,
|
||||
* structures, and macros, and thus, contains no copyrightable information.
|
||||
*/
|
||||
#ifndef _UAPI_ASM_GENERIC_INT_LL64_H
|
||||
#define _UAPI_ASM_GENERIC_INT_LL64_H
|
||||
#include <asm/bitsperlong.h>
|
||||
#ifndef __ASSEMBLY__
|
||||
typedef __signed__ char __s8;
|
||||
typedef unsigned char __u8;
|
||||
typedef __signed__ short __s16;
|
||||
typedef unsigned short __u16;
|
||||
typedef __signed__ int __s32;
|
||||
typedef unsigned int __u32;
|
||||
#ifdef __GNUC__
|
||||
__extension__ typedef __signed__ long long __s64;
|
||||
__extension__ typedef unsigned long long __u64;
|
||||
#else
|
||||
typedef __signed__ long long __s64;
|
||||
typedef unsigned long long __u64;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
* This header was generated from the Linux kernel headers by update_headers.py,
|
||||
* to provide necessary information from kernel to userspace, such as constants,
|
||||
* structures, and macros, and thus, contains no copyrightable information.
|
||||
*/
|
||||
#ifndef __ASM_GENERIC_POSIX_TYPES_H
|
||||
#define __ASM_GENERIC_POSIX_TYPES_H
|
||||
#include <asm/bitsperlong.h>
|
||||
#ifndef __kernel_long_t
|
||||
typedef long __kernel_long_t;
|
||||
typedef unsigned long __kernel_ulong_t;
|
||||
#endif
|
||||
#ifndef __kernel_ino_t
|
||||
typedef __kernel_ulong_t __kernel_ino_t;
|
||||
#endif
|
||||
#ifndef __kernel_mode_t
|
||||
typedef unsigned int __kernel_mode_t;
|
||||
#endif
|
||||
#ifndef __kernel_pid_t
|
||||
typedef int __kernel_pid_t;
|
||||
#endif
|
||||
#ifndef __kernel_ipc_pid_t
|
||||
typedef int __kernel_ipc_pid_t;
|
||||
#endif
|
||||
#ifndef __kernel_uid_t
|
||||
typedef unsigned int __kernel_uid_t;
|
||||
typedef unsigned int __kernel_gid_t;
|
||||
#endif
|
||||
#ifndef __kernel_suseconds_t
|
||||
typedef __kernel_long_t __kernel_suseconds_t;
|
||||
#endif
|
||||
#ifndef __kernel_daddr_t
|
||||
typedef int __kernel_daddr_t;
|
||||
#endif
|
||||
#ifndef __kernel_uid32_t
|
||||
typedef unsigned int __kernel_uid32_t;
|
||||
typedef unsigned int __kernel_gid32_t;
|
||||
#endif
|
||||
#ifndef __kernel_old_uid_t
|
||||
typedef __kernel_uid_t __kernel_old_uid_t;
|
||||
typedef __kernel_gid_t __kernel_old_gid_t;
|
||||
#endif
|
||||
#ifndef __kernel_old_dev_t
|
||||
typedef unsigned int __kernel_old_dev_t;
|
||||
#endif
|
||||
#ifndef __kernel_size_t
|
||||
#if __BITS_PER_LONG != 64
|
||||
typedef unsigned int __kernel_size_t;
|
||||
typedef int __kernel_ssize_t;
|
||||
typedef int __kernel_ptrdiff_t;
|
||||
#else
|
||||
typedef __kernel_ulong_t __kernel_size_t;
|
||||
typedef __kernel_long_t __kernel_ssize_t;
|
||||
typedef __kernel_long_t __kernel_ptrdiff_t;
|
||||
#endif
|
||||
#endif
|
||||
#ifndef __kernel_fsid_t
|
||||
typedef struct {
|
||||
int val[2];
|
||||
} __kernel_fsid_t;
|
||||
#endif
|
||||
typedef __kernel_long_t __kernel_off_t;
|
||||
typedef long long __kernel_loff_t;
|
||||
typedef __kernel_long_t __kernel_time_t;
|
||||
typedef __kernel_long_t __kernel_clock_t;
|
||||
typedef int __kernel_timer_t;
|
||||
typedef int __kernel_clockid_t;
|
||||
typedef char * __kernel_caddr_t;
|
||||
typedef unsigned short __kernel_uid16_t;
|
||||
typedef unsigned short __kernel_gid16_t;
|
||||
#endif
|
|
@ -0,0 +1,6 @@
|
|||
/*
|
||||
* This header was generated from the Linux kernel headers by update_headers.py,
|
||||
* to provide necessary information from kernel to userspace, such as constants,
|
||||
* structures, and macros, and thus, contains no copyrightable information.
|
||||
*/
|
||||
#include <asm-generic/bitsperlong.h>
|
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* This header was generated from the Linux kernel headers by update_headers.py,
|
||||
* to provide necessary information from kernel to userspace, such as constants,
|
||||
* structures, and macros, and thus, contains no copyrightable information.
|
||||
*/
|
||||
#ifndef __ARCH_ARM_POSIX_TYPES_H
|
||||
#define __ARCH_ARM_POSIX_TYPES_H
|
||||
typedef unsigned short __kernel_mode_t;
|
||||
#define __kernel_mode_t __kernel_mode_t
|
||||
typedef unsigned short __kernel_ipc_pid_t;
|
||||
#define __kernel_ipc_pid_t __kernel_ipc_pid_t
|
||||
typedef unsigned short __kernel_uid_t;
|
||||
typedef unsigned short __kernel_gid_t;
|
||||
#define __kernel_uid_t __kernel_uid_t
|
||||
typedef unsigned short __kernel_old_dev_t;
|
||||
#define __kernel_old_dev_t __kernel_old_dev_t
|
||||
#include <asm-generic/posix_types.h>
|
||||
#endif
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* This header was generated from the Linux kernel headers by update_headers.py,
|
||||
* to provide necessary information from kernel to userspace, such as constants,
|
||||
* structures, and macros, and thus, contains no copyrightable information.
|
||||
*/
|
||||
#ifndef _ASM_TYPES_H
|
||||
#define _ASM_TYPES_H
|
||||
#include <asm-generic/int-ll64.h>
|
||||
#ifdef __INT32_TYPE__
|
||||
#undef __INT32_TYPE__
|
||||
#define __INT32_TYPE__ int
|
||||
#endif
|
||||
#ifdef __UINT32_TYPE__
|
||||
#undef __UINT32_TYPE__
|
||||
#define __UINT32_TYPE__ unsigned int
|
||||
#endif
|
||||
#ifdef __UINTPTR_TYPE__
|
||||
#undef __UINTPTR_TYPE__
|
||||
#define __UINTPTR_TYPE__ unsigned long
|
||||
#endif
|
||||
#endif
|
|
@ -0,0 +1,28 @@
|
|||
#ifdef __ICCARM__ /* for iar */
|
||||
#include_next <assert.h>
|
||||
#else
|
||||
#include <features.h>
|
||||
|
||||
#undef assert
|
||||
|
||||
#ifdef NDEBUG
|
||||
#define assert(x) (void)0
|
||||
#else
|
||||
#define assert(x) ((void)((x) || (__assert_fail(#x, __FILE__, __LINE__, __func__),0)))
|
||||
#endif
|
||||
|
||||
#if __STDC_VERSION__ >= 201112L && !defined(__cplusplus)
|
||||
#define static_assert _Static_assert
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
_Noreturn void __assert_fail (const char *, const char *, int, const char *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
#endif /* __ICCARM__ */
|
||||
#endif
|
|
@ -0,0 +1,534 @@
|
|||
/* The time64 has not been used yet in liteos_m */
|
||||
#define _REDIR_TIME64 0
|
||||
#define _Addr int
|
||||
#define _Int64 long long
|
||||
#define _Reg int
|
||||
|
||||
#if __ARMEB__
|
||||
#define __BYTE_ORDER 4321
|
||||
#else
|
||||
#define __BYTE_ORDER 1234
|
||||
#endif
|
||||
|
||||
#define __LONG_MAX 0x7fffffffL
|
||||
|
||||
#ifdef __ICCARM__
|
||||
#ifndef __cplusplus
|
||||
#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
|
||||
#include <stddef.h>
|
||||
#define __DEFINED_wchar_t
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
|
||||
#include <math.h>
|
||||
#define __DEFINED_float_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_double_t) && !defined(__DEFINED_double_t)
|
||||
#include <math.h>
|
||||
#define __DEFINED_double_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
|
||||
#include <stddef.h>
|
||||
#define __DEFINED_max_align_t
|
||||
#endif
|
||||
#endif /* __ICCARM__ */
|
||||
|
||||
#ifndef __cplusplus
|
||||
#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
|
||||
typedef unsigned wchar_t;
|
||||
#define __DEFINED_wchar_t
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
|
||||
typedef float float_t;
|
||||
#define __DEFINED_float_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_double_t) && !defined(__DEFINED_double_t)
|
||||
typedef double double_t;
|
||||
#define __DEFINED_double_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
|
||||
typedef struct { long long __ll; long double __ld; } max_align_t;
|
||||
#define __DEFINED_max_align_t
|
||||
#endif
|
||||
|
||||
#define __LITTLE_ENDIAN 1234
|
||||
#define __BIG_ENDIAN 4321
|
||||
#define __USE_TIME_BITS64 1
|
||||
|
||||
#ifdef __ICCARM__
|
||||
#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
|
||||
#include <stddef.h>
|
||||
#define __DEFINED_size_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
|
||||
#include <stdint.h>
|
||||
#define __DEFINED_uintptr_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
|
||||
#include <stddef.h>
|
||||
#define __DEFINED_ptrdiff_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
|
||||
#include <stdint.h>
|
||||
#define __DEFINED_intptr_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
|
||||
#include <time.h>
|
||||
#define __DEFINED_time_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
|
||||
#include <time.h>
|
||||
#define __DEFINED_clock_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
|
||||
#include <time.h>
|
||||
#define __DEFINED_struct_timespec
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
|
||||
#include <wchar.h>
|
||||
#define __DEFINED_wint_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
|
||||
#include <wchar.h>
|
||||
#define __DEFINED_wctype_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
|
||||
#include <stdarg.h>
|
||||
#define __DEFINED_va_list
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
|
||||
#include <wchar.h>
|
||||
#define __DEFINED_mbstate_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t) && defined(__INT8_T_TYPE__)
|
||||
#include <stdint.h>
|
||||
#define __DEFINED_int8_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t) && defined(__INT16_T_TYPE__)
|
||||
#include <stdint.h>
|
||||
#define __DEFINED_int16_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t) && defined(__INT32_T_TYPE__)
|
||||
#include <stdint.h>
|
||||
#define __DEFINED_int32_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t) && defined(__INT64_T_TYPE__)
|
||||
#include <stdint.h>
|
||||
#define __DEFINED_int64_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t) && defined(__UINT8_T_TYPE__)
|
||||
#include <stdint.h>
|
||||
#define __DEFINED_uint8_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t) && defined(__UINT16_T_TYPE__)
|
||||
#include <stdint.h>
|
||||
#define __DEFINED_uint16_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t) && defined(__UINT32_T_TYPE__)
|
||||
#include <stdint.h>
|
||||
#define __DEFINED_uint32_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t) && defined(__UINT64_T_TYPE__)
|
||||
#include <stdint.h>
|
||||
#define __DEFINED_uint64_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
|
||||
#include <stdint.h>
|
||||
#define __DEFINED_intmax_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
|
||||
#include <stdint.h>
|
||||
#define __DEFINED_uintmax_t
|
||||
#endif
|
||||
#endif /* __ICCARM__ */
|
||||
|
||||
#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
|
||||
typedef unsigned _Addr size_t;
|
||||
#define __DEFINED_size_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
|
||||
typedef unsigned _Addr uintptr_t;
|
||||
#define __DEFINED_uintptr_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
|
||||
typedef _Addr ptrdiff_t;
|
||||
#define __DEFINED_ptrdiff_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
|
||||
typedef _Addr ssize_t;
|
||||
#define __DEFINED_ssize_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
|
||||
typedef _Addr intptr_t;
|
||||
#define __DEFINED_intptr_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
|
||||
typedef _Addr regoff_t;
|
||||
#define __DEFINED_regoff_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
|
||||
typedef _Reg register_t;
|
||||
#define __DEFINED_register_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
|
||||
typedef _Int64 time_t;
|
||||
#define __DEFINED_time_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
|
||||
typedef _Int64 suseconds_t;
|
||||
#define __DEFINED_suseconds_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
|
||||
typedef signed char int8_t;
|
||||
#define __DEFINED_int8_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t)
|
||||
typedef signed short int16_t;
|
||||
#define __DEFINED_int16_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t)
|
||||
typedef signed int int32_t;
|
||||
#define __DEFINED_int32_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t)
|
||||
typedef signed _Int64 int64_t;
|
||||
#define __DEFINED_int64_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
|
||||
typedef signed _Int64 intmax_t;
|
||||
#define __DEFINED_intmax_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t)
|
||||
typedef unsigned char uint8_t;
|
||||
#define __DEFINED_uint8_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t)
|
||||
typedef unsigned short uint16_t;
|
||||
#define __DEFINED_uint16_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t)
|
||||
typedef unsigned int uint32_t;
|
||||
#define __DEFINED_uint32_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t)
|
||||
typedef unsigned _Int64 uint64_t;
|
||||
#define __DEFINED_uint64_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
|
||||
typedef unsigned _Int64 u_int64_t;
|
||||
#define __DEFINED_u_int64_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
|
||||
typedef unsigned _Int64 uintmax_t;
|
||||
#define __DEFINED_uintmax_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
|
||||
typedef unsigned mode_t;
|
||||
#define __DEFINED_mode_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
|
||||
typedef unsigned _Reg nlink_t;
|
||||
#define __DEFINED_nlink_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
|
||||
typedef _Int64 off_t;
|
||||
#define __DEFINED_off_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
|
||||
typedef unsigned _Int64 ino_t;
|
||||
#define __DEFINED_ino_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
|
||||
typedef unsigned _Int64 dev_t;
|
||||
#define __DEFINED_dev_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
|
||||
typedef long blksize_t;
|
||||
#define __DEFINED_blksize_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
|
||||
typedef _Int64 blkcnt_t;
|
||||
#define __DEFINED_blkcnt_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
|
||||
typedef unsigned _Int64 fsblkcnt_t;
|
||||
#define __DEFINED_fsblkcnt_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
|
||||
typedef unsigned _Int64 fsfilcnt_t;
|
||||
#define __DEFINED_fsfilcnt_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
|
||||
typedef unsigned wint_t;
|
||||
#define __DEFINED_wint_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
|
||||
typedef unsigned long wctype_t;
|
||||
#define __DEFINED_wctype_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
|
||||
typedef void * timer_t;
|
||||
#define __DEFINED_timer_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
|
||||
typedef int clockid_t;
|
||||
#define __DEFINED_clockid_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
|
||||
typedef long clock_t;
|
||||
#define __DEFINED_clock_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
|
||||
struct timeval { time_t tv_sec; suseconds_t tv_usec; };
|
||||
#define __DEFINED_struct_timeval
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
|
||||
struct timespec { time_t tv_sec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER==4321); long tv_nsec; int :8*(sizeof(time_t)-sizeof(long))*(__BYTE_ORDER!=4321); };
|
||||
#define __DEFINED_struct_timespec
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
|
||||
typedef int pid_t;
|
||||
#define __DEFINED_pid_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
|
||||
typedef unsigned id_t;
|
||||
#define __DEFINED_id_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
|
||||
typedef unsigned uid_t;
|
||||
#define __DEFINED_uid_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
|
||||
typedef unsigned gid_t;
|
||||
#define __DEFINED_gid_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
|
||||
typedef int key_t;
|
||||
#define __DEFINED_key_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
|
||||
typedef unsigned useconds_t;
|
||||
#define __DEFINED_useconds_t
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
|
||||
typedef unsigned long pthread_t;
|
||||
#define __DEFINED_pthread_t
|
||||
#endif
|
||||
|
||||
#else
|
||||
#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
|
||||
typedef struct __pthread * pthread_t;
|
||||
#define __DEFINED_pthread_t
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
|
||||
typedef int pthread_once_t;
|
||||
#define __DEFINED_pthread_once_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
|
||||
typedef unsigned pthread_key_t;
|
||||
#define __DEFINED_pthread_key_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
|
||||
typedef int pthread_spinlock_t;
|
||||
#define __DEFINED_pthread_spinlock_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
|
||||
typedef struct { unsigned __attr; } pthread_mutexattr_t;
|
||||
#define __DEFINED_pthread_mutexattr_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
|
||||
typedef struct { unsigned __attr; } pthread_condattr_t;
|
||||
#define __DEFINED_pthread_condattr_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
|
||||
typedef struct { unsigned __attr; } pthread_barrierattr_t;
|
||||
#define __DEFINED_pthread_barrierattr_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
|
||||
typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
|
||||
#define __DEFINED_pthread_rwlockattr_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_struct__IO_FILE) && !defined(__DEFINED_struct__IO_FILE)
|
||||
struct _IO_FILE { char __x; };
|
||||
#define __DEFINED_struct__IO_FILE
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
|
||||
typedef struct _IO_FILE FILE;
|
||||
#define __DEFINED_FILE
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
|
||||
typedef __builtin_va_list va_list;
|
||||
#define __DEFINED_va_list
|
||||
#endif
|
||||
|
||||
#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
|
||||
typedef __builtin_va_list __isoc_va_list;
|
||||
#define __DEFINED___isoc_va_list
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
|
||||
typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
|
||||
#define __DEFINED_mbstate_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
|
||||
typedef struct __locale_struct * locale_t;
|
||||
#define __DEFINED_locale_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
|
||||
typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
|
||||
#define __DEFINED_sigset_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
|
||||
struct iovec { void *iov_base; size_t iov_len; };
|
||||
#define __DEFINED_struct_iovec
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
|
||||
typedef unsigned socklen_t;
|
||||
#define __DEFINED_socklen_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
|
||||
typedef unsigned short sa_family_t;
|
||||
#define __DEFINED_sa_family_t
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
|
||||
typedef struct { union { int __i[sizeof(long)==8?14:9]; volatile int __vi[sizeof(long)==8?14:9]; unsigned long __s[sizeof(long)==8?7:9]; } __u; } pthread_attr_t;
|
||||
#define __DEFINED_pthread_attr_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
|
||||
typedef struct { unsigned int magic; unsigned int handle; } pthread_mutex_t;
|
||||
#define __DEFINED_pthread_mutex_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
|
||||
typedef struct { union { int __i[sizeof(long)==8?10:6]; volatile int __vi[sizeof(long)==8?10:6]; volatile void *volatile __p[sizeof(long)==8?5:6]; } __u; } mtx_t;
|
||||
#define __DEFINED_mtx_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
|
||||
typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } pthread_cond_t;
|
||||
#define __DEFINED_pthread_cond_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
|
||||
typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12*sizeof(int)/sizeof(void*)]; } __u; } cnd_t;
|
||||
#define __DEFINED_cnd_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
|
||||
typedef struct { union { int __i[sizeof(long)==8?14:8]; volatile int __vi[sizeof(long)==8?14:8]; void *__p[sizeof(long)==8?7:8]; } __u; } pthread_rwlock_t;
|
||||
#define __DEFINED_pthread_rwlock_t
|
||||
#endif
|
||||
|
||||
#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
|
||||
typedef struct { union { int __i[sizeof(long)==8?8:5]; volatile int __vi[sizeof(long)==8?8:5]; void *__p[sizeof(long)==8?4:5]; } __u; } pthread_barrier_t;
|
||||
#define __DEFINED_pthread_barrier_t
|
||||
#endif
|
||||
|
||||
|
||||
#undef _Addr
|
||||
#undef _Int64
|
||||
#undef _Reg
|
|
@ -0,0 +1,11 @@
|
|||
#define _DIRENT_HAVE_D_RECLEN
|
||||
#define _DIRENT_HAVE_D_OFF
|
||||
#define _DIRENT_HAVE_D_TYPE
|
||||
|
||||
struct dirent {
|
||||
ino_t d_ino;
|
||||
off_t d_off;
|
||||
unsigned short d_reclen;
|
||||
unsigned char d_type;
|
||||
char d_name[256];
|
||||
};
|
|
@ -0,0 +1,134 @@
|
|||
#define EPERM 1
|
||||
#define ENOENT 2
|
||||
#define ESRCH 3
|
||||
#define EINTR 4
|
||||
#define EIO 5
|
||||
#define ENXIO 6
|
||||
#define E2BIG 7
|
||||
#define ENOEXEC 8
|
||||
#define EBADF 9
|
||||
#define ECHILD 10
|
||||
#define EAGAIN 11
|
||||
#define ENOMEM 12
|
||||
#define EACCES 13
|
||||
#define EFAULT 14
|
||||
#define ENOTBLK 15
|
||||
#define EBUSY 16
|
||||
#define EEXIST 17
|
||||
#define EXDEV 18
|
||||
#define ENODEV 19
|
||||
#define ENOTDIR 20
|
||||
#define EISDIR 21
|
||||
#define EINVAL 22
|
||||
#define ENFILE 23
|
||||
#define EMFILE 24
|
||||
#define ENOTTY 25
|
||||
#define ETXTBSY 26
|
||||
#define EFBIG 27
|
||||
#define ENOSPC 28
|
||||
#define ESPIPE 29
|
||||
#define EROFS 30
|
||||
#define EMLINK 31
|
||||
#define EPIPE 32
|
||||
#define EDOM 33
|
||||
#define ERANGE 34
|
||||
#define EDEADLK 35
|
||||
#define ENAMETOOLONG 36
|
||||
#define ENOLCK 37
|
||||
#define ENOSYS 38
|
||||
#define ENOTEMPTY 39
|
||||
#define ELOOP 40
|
||||
#define EWOULDBLOCK EAGAIN
|
||||
#define ENOMSG 42
|
||||
#define EIDRM 43
|
||||
#define ECHRNG 44
|
||||
#define EL2NSYNC 45
|
||||
#define EL3HLT 46
|
||||
#define EL3RST 47
|
||||
#define ELNRNG 48
|
||||
#define EUNATCH 49
|
||||
#define ENOCSI 50
|
||||
#define EL2HLT 51
|
||||
#define EBADE 52
|
||||
#define EBADR 53
|
||||
#define EXFULL 54
|
||||
#define ENOANO 55
|
||||
#define EBADRQC 56
|
||||
#define EBADSLT 57
|
||||
#define EDEADLOCK EDEADLK
|
||||
#define EBFONT 59
|
||||
#define ENOSTR 60
|
||||
#define ENODATA 61
|
||||
#define ETIME 62
|
||||
#define ENOSR 63
|
||||
#define ENONET 64
|
||||
#define ENOPKG 65
|
||||
#define EREMOTE 66
|
||||
#define ENOLINK 67
|
||||
#define EADV 68
|
||||
#define ESRMNT 69
|
||||
#define ECOMM 70
|
||||
#define EPROTO 71
|
||||
#define EMULTIHOP 72
|
||||
#define EDOTDOT 73
|
||||
#define EBADMSG 74
|
||||
#define EOVERFLOW 75
|
||||
#define ENOTUNIQ 76
|
||||
#define EBADFD 77
|
||||
#define EREMCHG 78
|
||||
#define ELIBACC 79
|
||||
#define ELIBBAD 80
|
||||
#define ELIBSCN 81
|
||||
#define ELIBMAX 82
|
||||
#define ELIBEXEC 83
|
||||
#define EILSEQ 84
|
||||
#define ERESTART 85
|
||||
#define ESTRPIPE 86
|
||||
#define EUSERS 87
|
||||
#define ENOTSOCK 88
|
||||
#define EDESTADDRREQ 89
|
||||
#define EMSGSIZE 90
|
||||
#define EPROTOTYPE 91
|
||||
#define ENOPROTOOPT 92
|
||||
#define EPROTONOSUPPORT 93
|
||||
#define ESOCKTNOSUPPORT 94
|
||||
#define EOPNOTSUPP 95
|
||||
#define ENOTSUP EOPNOTSUPP
|
||||
#define EPFNOSUPPORT 96
|
||||
#define EAFNOSUPPORT 97
|
||||
#define EADDRINUSE 98
|
||||
#define EADDRNOTAVAIL 99
|
||||
#define ENETDOWN 100
|
||||
#define ENETUNREACH 101
|
||||
#define ENETRESET 102
|
||||
#define ECONNABORTED 103
|
||||
#define ECONNRESET 104
|
||||
#define ENOBUFS 105
|
||||
#define EISCONN 106
|
||||
#define ENOTCONN 107
|
||||
#define ESHUTDOWN 108
|
||||
#define ETOOMANYREFS 109
|
||||
#define ETIMEDOUT 110
|
||||
#define ECONNREFUSED 111
|
||||
#define EHOSTDOWN 112
|
||||
#define EHOSTUNREACH 113
|
||||
#define EALREADY 114
|
||||
#define EINPROGRESS 115
|
||||
#define ESTALE 116
|
||||
#define EUCLEAN 117
|
||||
#define ENOTNAM 118
|
||||
#define ENAVAIL 119
|
||||
#define EISNAM 120
|
||||
#define EREMOTEIO 121
|
||||
#define EDQUOT 122
|
||||
#define ENOMEDIUM 123
|
||||
#define EMEDIUMTYPE 124
|
||||
#define ECANCELED 125
|
||||
#define ENOKEY 126
|
||||
#define EKEYEXPIRED 127
|
||||
#define EKEYREVOKED 128
|
||||
#define EKEYREJECTED 129
|
||||
#define EOWNERDEAD 130
|
||||
#define ENOTRECOVERABLE 131
|
||||
#define ERFKILL 132
|
||||
#define EHWPOISON 133
|
|
@ -0,0 +1,40 @@
|
|||
#define O_CREAT 0100
|
||||
#define O_EXCL 0200
|
||||
#define O_NOCTTY 0400
|
||||
#define O_TRUNC 01000
|
||||
#define O_APPEND 02000
|
||||
#define O_NONBLOCK 04000
|
||||
#define O_DSYNC 010000
|
||||
#define O_SYNC 04010000
|
||||
#define O_RSYNC 04010000
|
||||
#define O_DIRECTORY 040000
|
||||
#define O_NOFOLLOW 0100000
|
||||
#define O_CLOEXEC 02000000
|
||||
|
||||
#define O_ASYNC 020000
|
||||
#define O_DIRECT 0200000
|
||||
#define O_LARGEFILE 0400000
|
||||
#define O_NOATIME 01000000
|
||||
#define O_PATH 010000000
|
||||
#define O_TMPFILE 020040000
|
||||
#define O_NDELAY O_NONBLOCK
|
||||
|
||||
#define F_DUPFD 0
|
||||
#define F_GETFD 1
|
||||
#define F_SETFD 2
|
||||
#define F_GETFL 3
|
||||
#define F_SETFL 4
|
||||
|
||||
#define F_SETOWN 8
|
||||
#define F_GETOWN 9
|
||||
#define F_SETSIG 10
|
||||
#define F_GETSIG 11
|
||||
|
||||
#define F_GETLK 12
|
||||
#define F_SETLK 13
|
||||
#define F_SETLKW 14
|
||||
|
||||
#define F_SETOWN_EX 15
|
||||
#define F_GETOWN_EX 16
|
||||
|
||||
#define F_GETOWNER_UIDS 17
|
|
@ -0,0 +1,23 @@
|
|||
#ifndef __ARM_PCS_VFP
|
||||
#define FE_ALL_EXCEPT 0
|
||||
#define FE_TONEAREST 0
|
||||
#else
|
||||
#define FE_INVALID 1
|
||||
#define FE_DIVBYZERO 2
|
||||
#define FE_OVERFLOW 4
|
||||
#define FE_UNDERFLOW 8
|
||||
#define FE_INEXACT 16
|
||||
#define FE_ALL_EXCEPT 31
|
||||
#define FE_TONEAREST 0
|
||||
#define FE_DOWNWARD 0x800000
|
||||
#define FE_UPWARD 0x400000
|
||||
#define FE_TOWARDZERO 0xc00000
|
||||
#endif
|
||||
|
||||
typedef unsigned long fexcept_t;
|
||||
|
||||
typedef struct {
|
||||
unsigned long __cw;
|
||||
} fenv_t;
|
||||
|
||||
#define FE_DFL_ENV ((const fenv_t *) -1)
|
|
@ -0,0 +1,16 @@
|
|||
#define FLT_EVAL_METHOD 0
|
||||
|
||||
#define LDBL_TRUE_MIN 4.94065645841246544177e-324L
|
||||
#define LDBL_MIN 2.22507385850720138309e-308L
|
||||
#define LDBL_MAX 1.79769313486231570815e+308L
|
||||
#define LDBL_EPSILON 2.22044604925031308085e-16L
|
||||
|
||||
#define LDBL_MANT_DIG 53
|
||||
#define LDBL_MIN_EXP (-1021)
|
||||
#define LDBL_MAX_EXP 1024
|
||||
|
||||
#define LDBL_DIG 15
|
||||
#define LDBL_MIN_10_EXP (-307)
|
||||
#define LDBL_MAX_10_EXP 308
|
||||
|
||||
#define DECIMAL_DIG 17
|
|
@ -0,0 +1,53 @@
|
|||
#define HWCAP_SWP (1 << 0)
|
||||
#define HWCAP_HALF (1 << 1)
|
||||
#define HWCAP_THUMB (1 << 2)
|
||||
#define HWCAP_26BIT (1 << 3)
|
||||
#define HWCAP_FAST_MULT (1 << 4)
|
||||
#define HWCAP_FPA (1 << 5)
|
||||
#define HWCAP_VFP (1 << 6)
|
||||
#define HWCAP_EDSP (1 << 7)
|
||||
#define HWCAP_JAVA (1 << 8)
|
||||
#define HWCAP_IWMMXT (1 << 9)
|
||||
#define HWCAP_CRUNCH (1 << 10)
|
||||
#define HWCAP_THUMBEE (1 << 11)
|
||||
#define HWCAP_NEON (1 << 12)
|
||||
#define HWCAP_VFPv3 (1 << 13)
|
||||
#define HWCAP_VFPv3D16 (1 << 14)
|
||||
#define HWCAP_TLS (1 << 15)
|
||||
#define HWCAP_VFPv4 (1 << 16)
|
||||
#define HWCAP_IDIVA (1 << 17)
|
||||
#define HWCAP_IDIVT (1 << 18)
|
||||
#define HWCAP_VFPD32 (1 << 19)
|
||||
#define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT)
|
||||
#define HWCAP_LPAE (1 << 20)
|
||||
#define HWCAP_EVTSTRM (1 << 21)
|
||||
|
||||
#define HWCAP2_AES (1 << 0)
|
||||
#define HWCAP2_PMULL (1 << 1)
|
||||
#define HWCAP2_SHA1 (1 << 2)
|
||||
#define HWCAP2_SHA2 (1 << 3)
|
||||
#define HWCAP2_CRC32 (1 << 4)
|
||||
|
||||
#define HWCAP_ARM_SWP (1 << 0)
|
||||
#define HWCAP_ARM_HALF (1 << 1)
|
||||
#define HWCAP_ARM_THUMB (1 << 2)
|
||||
#define HWCAP_ARM_26BIT (1 << 3)
|
||||
#define HWCAP_ARM_FAST_MULT (1 << 4)
|
||||
#define HWCAP_ARM_FPA (1 << 5)
|
||||
#define HWCAP_ARM_VFP (1 << 6)
|
||||
#define HWCAP_ARM_EDSP (1 << 7)
|
||||
#define HWCAP_ARM_JAVA (1 << 8)
|
||||
#define HWCAP_ARM_IWMMXT (1 << 9)
|
||||
#define HWCAP_ARM_CRUNCH (1 << 10)
|
||||
#define HWCAP_ARM_THUMBEE (1 << 11)
|
||||
#define HWCAP_ARM_NEON (1 << 12)
|
||||
#define HWCAP_ARM_VFPv3 (1 << 13)
|
||||
#define HWCAP_ARM_VFPv3D16 (1 << 14)
|
||||
#define HWCAP_ARM_TLS (1 << 15)
|
||||
#define HWCAP_ARM_VFPv4 (1 << 16)
|
||||
#define HWCAP_ARM_IDIVA (1 << 17)
|
||||
#define HWCAP_ARM_IDIVT (1 << 18)
|
||||
#define HWCAP_ARM_VFPD32 (1 << 19)
|
||||
#define HWCAP_ARM_IDIV (HWCAP_ARM_IDIVA | HWCAP_ARM_IDIVT)
|
||||
#define HWCAP_ARM_LPAE (1 << 20)
|
||||
#define HWCAP_ARM_EVTSTRM (1 << 21)
|
|
@ -0,0 +1,115 @@
|
|||
#define _IOC(a,b,c,d) ( ((a)<<30) | ((b)<<8) | (c) | ((d)<<16) )
|
||||
#define _IOC_NONE 0U
|
||||
#define _IOC_WRITE 1U
|
||||
#define _IOC_READ 2U
|
||||
|
||||
#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0)
|
||||
#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c))
|
||||
#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c))
|
||||
#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c))
|
||||
|
||||
#define TCGETS 0x5401
|
||||
#define TCSETS 0x5402
|
||||
#define TCSETSW 0x5403
|
||||
#define TCSETSF 0x5404
|
||||
#define TCGETA 0x5405
|
||||
#define TCSETA 0x5406
|
||||
#define TCSETAW 0x5407
|
||||
#define TCSETAF 0x5408
|
||||
#define TCSBRK 0x5409
|
||||
#define TCXONC 0x540A
|
||||
#define TCFLSH 0x540B
|
||||
#define TIOCEXCL 0x540C
|
||||
#define TIOCNXCL 0x540D
|
||||
#define TIOCSCTTY 0x540E
|
||||
#define TIOCGPGRP 0x540F
|
||||
#define TIOCSPGRP 0x5410
|
||||
#define TIOCOUTQ 0x5411
|
||||
#define TIOCSTI 0x5412
|
||||
#define TIOCGWINSZ 0x5413
|
||||
#define TIOCSWINSZ 0x5414
|
||||
#define TIOCMGET 0x5415
|
||||
#define TIOCMBIS 0x5416
|
||||
#define TIOCMBIC 0x5417
|
||||
#define TIOCMSET 0x5418
|
||||
#define TIOCGSOFTCAR 0x5419
|
||||
#define TIOCSSOFTCAR 0x541A
|
||||
#define FIONREAD 0x541B
|
||||
#define TIOCINQ FIONREAD
|
||||
#define TIOCLINUX 0x541C
|
||||
#define TIOCCONS 0x541D
|
||||
#define TIOCGSERIAL 0x541E
|
||||
#define TIOCSSERIAL 0x541F
|
||||
#define TIOCPKT 0x5420
|
||||
#define FIONBIO 0x5421
|
||||
#define TIOCNOTTY 0x5422
|
||||
#define TIOCSETD 0x5423
|
||||
#define TIOCGETD 0x5424
|
||||
#define TCSBRKP 0x5425
|
||||
#define TIOCSBRK 0x5427
|
||||
#define TIOCCBRK 0x5428
|
||||
#define TIOCGSID 0x5429
|
||||
#define TIOCGRS485 0x542E
|
||||
#define TIOCSRS485 0x542F
|
||||
#define TIOCGPTN 0x80045430
|
||||
#define TIOCSPTLCK 0x40045431
|
||||
#define TIOCGDEV 0x80045432
|
||||
#define TCGETX 0x5432
|
||||
#define TCSETX 0x5433
|
||||
#define TCSETXF 0x5434
|
||||
#define TCSETXW 0x5435
|
||||
#define TIOCSIG 0x40045436
|
||||
#define TIOCVHANGUP 0x5437
|
||||
#define TIOCGPKT 0x80045438
|
||||
#define TIOCGPTLCK 0x80045439
|
||||
#define TIOCGEXCL 0x80045440
|
||||
#define TIOCGPTPEER 0x5441
|
||||
#define TIOCGISO7816 0x80285442
|
||||
#define TIOCSISO7816 0xc0285443
|
||||
|
||||
#define FIONCLEX 0x5450
|
||||
#define FIOCLEX 0x5451
|
||||
#define FIOASYNC 0x5452
|
||||
#define TIOCSERCONFIG 0x5453
|
||||
#define TIOCSERGWILD 0x5454
|
||||
#define TIOCSERSWILD 0x5455
|
||||
#define TIOCGLCKTRMIOS 0x5456
|
||||
#define TIOCSLCKTRMIOS 0x5457
|
||||
#define TIOCSERGSTRUCT 0x5458
|
||||
#define TIOCSERGETLSR 0x5459
|
||||
#define TIOCSERGETMULTI 0x545A
|
||||
#define TIOCSERSETMULTI 0x545B
|
||||
|
||||
#define TIOCMIWAIT 0x545C
|
||||
#define TIOCGICOUNT 0x545D
|
||||
#define FIOQSIZE 0x5460
|
||||
|
||||
#define TIOCM_LE 0x001
|
||||
#define TIOCM_DTR 0x002
|
||||
#define TIOCM_RTS 0x004
|
||||
#define TIOCM_ST 0x008
|
||||
#define TIOCM_SR 0x010
|
||||
#define TIOCM_CTS 0x020
|
||||
#define TIOCM_CAR 0x040
|
||||
#define TIOCM_RNG 0x080
|
||||
#define TIOCM_DSR 0x100
|
||||
#define TIOCM_CD TIOCM_CAR
|
||||
#define TIOCM_RI TIOCM_RNG
|
||||
#define TIOCM_OUT1 0x2000
|
||||
#define TIOCM_OUT2 0x4000
|
||||
#define TIOCM_LOOP 0x8000
|
||||
|
||||
#define FIOSETOWN 0x8901
|
||||
#define SIOCSPGRP 0x8902
|
||||
#define FIOGETOWN 0x8903
|
||||
#define SIOCGPGRP 0x8904
|
||||
#define SIOCATMARK 0x8905
|
||||
#if __LONG_MAX == 0x7fffffff
|
||||
#define SIOCGSTAMP _IOR(0x89, 6, char[16])
|
||||
#define SIOCGSTAMPNS _IOR(0x89, 7, char[16])
|
||||
#else
|
||||
#define SIOCGSTAMP 0x8906
|
||||
#define SIOCGSTAMPNS 0x8907
|
||||
#endif
|
||||
|
||||
#include <bits/ioctl_fix.h>
|
|
@ -0,0 +1,2 @@
|
|||
#undef FIOQSIZE
|
||||
#define FIOQSIZE 0x545e
|
|
@ -0,0 +1,11 @@
|
|||
struct ipc_perm {
|
||||
key_t __ipc_perm_key;
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
uid_t cuid;
|
||||
gid_t cgid;
|
||||
mode_t mode;
|
||||
int __ipc_perm_seq;
|
||||
long __pad1;
|
||||
long __pad2;
|
||||
};
|
|
@ -0,0 +1 @@
|
|||
#define IPC_STAT 0x102
|
|
@ -0,0 +1 @@
|
|||
#include <linux/kd.h>
|
|
@ -0,0 +1 @@
|
|||
typedef uint32_t Elf_Symndx;
|
|
@ -0,0 +1,18 @@
|
|||
struct msqid_ds {
|
||||
struct ipc_perm msg_perm;
|
||||
unsigned long __msg_stime_lo;
|
||||
unsigned long __msg_stime_hi;
|
||||
unsigned long __msg_rtime_lo;
|
||||
unsigned long __msg_rtime_hi;
|
||||
unsigned long __msg_ctime_lo;
|
||||
unsigned long __msg_ctime_hi;
|
||||
unsigned long msg_cbytes;
|
||||
msgqnum_t msg_qnum;
|
||||
msglen_t msg_qbytes;
|
||||
pid_t msg_lspid;
|
||||
pid_t msg_lrpid;
|
||||
unsigned long __unused[2];
|
||||
time_t msg_stime;
|
||||
time_t msg_rtime;
|
||||
time_t msg_ctime;
|
||||
};
|
|
@ -0,0 +1,2 @@
|
|||
#define _POSIX_V6_ILP32_OFFBIG 1
|
||||
#define _POSIX_V7_ILP32_OFFBIG 1
|
|
@ -0,0 +1,25 @@
|
|||
#define PTRACE_GETWMMXREGS 18
|
||||
#define PTRACE_SETWMMXREGS 19
|
||||
#define PTRACE_GET_THREAD_AREA 22
|
||||
#define PTRACE_SET_SYSCALL 23
|
||||
#define PTRACE_GETCRUNCHREGS 25
|
||||
#define PTRACE_SETCRUNCHREGS 26
|
||||
#define PTRACE_GETVFPREGS 27
|
||||
#define PTRACE_SETVFPREGS 28
|
||||
#define PTRACE_GETHBPREGS 29
|
||||
#define PTRACE_SETHBPREGS 30
|
||||
#define PTRACE_GETFDPIC 31
|
||||
#define PTRACE_GETFDPIC_EXEC 0
|
||||
#define PTRACE_GETFDPIC_INTERP 1
|
||||
|
||||
#define PT_GETWMMXREGS PTRACE_GETWMMXREGS
|
||||
#define PT_SETWMMXREGS PTRACE_SETWMMXREGS
|
||||
#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA
|
||||
#define PT_SET_SYSCALL PTRACE_SET_SYSCALL
|
||||
#define PT_GETCRUNCHREGS PTRACE_GETCRUNCHREGS
|
||||
#define PT_SETCRUNCHREGS PTRACE_SETCRUNCHREGS
|
||||
#define PT_GETVFPREGS PTRACE_GETVFPREGS
|
||||
#define PT_SETVFPREGS PTRACE_SETVFPREGS
|
||||
#define PT_GETHBPREGS PTRACE_GETHBPREGS
|
||||
#define PT_SETHBPREGS PTRACE_SETHBPREGS
|
||||
#define PT_GETFDPIC PTRACE_GETFDPIC
|
|
@ -0,0 +1,3 @@
|
|||
#undef __WORDSIZE
|
||||
#define __WORDSIZE 32
|
||||
/* FIXME */
|
|
@ -0,0 +1,18 @@
|
|||
struct semid_ds {
|
||||
struct ipc_perm sem_perm;
|
||||
unsigned long __sem_otime_lo;
|
||||
unsigned long __sem_otime_hi;
|
||||
unsigned long __sem_ctime_lo;
|
||||
unsigned long __sem_ctime_hi;
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
unsigned short sem_nsems;
|
||||
char __sem_nsems_pad[sizeof(long)-sizeof(short)];
|
||||
#else
|
||||
char __sem_nsems_pad[sizeof(long)-sizeof(short)];
|
||||
unsigned short sem_nsems;
|
||||
#endif
|
||||
long __unused3;
|
||||
long __unused4;
|
||||
time_t sem_otime;
|
||||
time_t sem_ctime;
|
||||
};
|
|
@ -0,0 +1 @@
|
|||
typedef unsigned long long __jmp_buf[32];
|
|
@ -0,0 +1,31 @@
|
|||
#define SHMLBA 4096
|
||||
|
||||
struct shmid_ds {
|
||||
struct ipc_perm shm_perm;
|
||||
size_t shm_segsz;
|
||||
unsigned long __shm_atime_lo;
|
||||
unsigned long __shm_atime_hi;
|
||||
unsigned long __shm_dtime_lo;
|
||||
unsigned long __shm_dtime_hi;
|
||||
unsigned long __shm_ctime_lo;
|
||||
unsigned long __shm_ctime_hi;
|
||||
pid_t shm_cpid;
|
||||
pid_t shm_lpid;
|
||||
unsigned long shm_nattch;
|
||||
unsigned long __pad1;
|
||||
unsigned long __pad2;
|
||||
unsigned long __pad3;
|
||||
time_t shm_atime;
|
||||
time_t shm_dtime;
|
||||
time_t shm_ctime;
|
||||
};
|
||||
|
||||
struct shminfo {
|
||||
unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
|
||||
};
|
||||
|
||||
struct shm_info {
|
||||
int __used_ids;
|
||||
unsigned long shm_tot, shm_rss, shm_swp;
|
||||
unsigned long __swap_attempts, __swap_successes;
|
||||
};
|
|
@ -0,0 +1,86 @@
|
|||
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|
||||
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
|
||||
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
#define MINSIGSTKSZ 2048
|
||||
#define SIGSTKSZ 8192
|
||||
#endif
|
||||
|
||||
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
typedef int greg_t, gregset_t[18];
|
||||
typedef struct sigcontext {
|
||||
unsigned long trap_no, error_code, oldmask;
|
||||
unsigned long arm_r0, arm_r1, arm_r2, arm_r3;
|
||||
unsigned long arm_r4, arm_r5, arm_r6, arm_r7;
|
||||
unsigned long arm_r8, arm_r9, arm_r10, arm_fp;
|
||||
unsigned long arm_ip, arm_sp, arm_lr, arm_pc;
|
||||
unsigned long arm_cpsr, fault_address;
|
||||
} mcontext_t;
|
||||
#else
|
||||
typedef struct {
|
||||
unsigned long __regs[21];
|
||||
} mcontext_t;
|
||||
#endif
|
||||
|
||||
struct sigaltstack {
|
||||
void *ss_sp;
|
||||
int ss_flags;
|
||||
size_t ss_size;
|
||||
};
|
||||
|
||||
typedef struct __ucontext {
|
||||
unsigned long uc_flags;
|
||||
struct __ucontext *uc_link;
|
||||
stack_t uc_stack;
|
||||
mcontext_t uc_mcontext;
|
||||
sigset_t uc_sigmask;
|
||||
unsigned long long uc_regspace[64];
|
||||
} ucontext_t;
|
||||
|
||||
#define SA_NOCLDSTOP 1
|
||||
#define SA_NOCLDWAIT 2
|
||||
#define SA_SIGINFO 4
|
||||
#define SA_ONSTACK 0x08000000
|
||||
#define SA_RESTART 0x10000000
|
||||
#define SA_NODEFER 0x40000000
|
||||
#define SA_RESETHAND 0x80000000
|
||||
#define SA_RESTORER 0x04000000
|
||||
|
||||
#endif
|
||||
|
||||
#define SIGHUP 1
|
||||
#define SIGINT 2
|
||||
#define SIGQUIT 3
|
||||
#define SIGILL 4
|
||||
#define SIGTRAP 5
|
||||
#define SIGABRT 6
|
||||
#define SIGIOT SIGABRT
|
||||
#define SIGBUS 7
|
||||
#define SIGFPE 8
|
||||
#define SIGKILL 9
|
||||
#define SIGUSR1 10
|
||||
#define SIGSEGV 11
|
||||
#define SIGUSR2 12
|
||||
#define SIGPIPE 13
|
||||
#define SIGALRM 14
|
||||
#define SIGTERM 15
|
||||
#define SIGSTKFLT 16
|
||||
#define SIGCHLD 17
|
||||
#define SIGCONT 18
|
||||
#define SIGSTOP 19
|
||||
#define SIGTSTP 20
|
||||
#define SIGTTIN 21
|
||||
#define SIGTTOU 22
|
||||
#define SIGURG 23
|
||||
#define SIGXCPU 24
|
||||
#define SIGXFSZ 25
|
||||
#define SIGVTALRM 26
|
||||
#define SIGPROF 27
|
||||
#define SIGWINCH 28
|
||||
#define SIGIO 29
|
||||
#define SIGPOLL 29
|
||||
#define SIGPWR 30
|
||||
#define SIGSYS 31
|
||||
#define SIGUNUSED SIGSYS
|
||||
|
||||
#define _NSIG 65
|
|
@ -0,0 +1 @@
|
|||
#include <linux/soundcard.h>
|
|
@ -0,0 +1,25 @@
|
|||
/* copied from kernel definition, but with padding replaced
|
||||
* by the corresponding correctly-sized userspace types. */
|
||||
|
||||
struct stat {
|
||||
dev_t st_dev;
|
||||
int __st_dev_padding;
|
||||
long __st_ino_truncated;
|
||||
mode_t st_mode;
|
||||
nlink_t st_nlink;
|
||||
uid_t st_uid;
|
||||
gid_t st_gid;
|
||||
dev_t st_rdev;
|
||||
int __st_rdev_padding;
|
||||
off_t st_size;
|
||||
blksize_t st_blksize;
|
||||
blkcnt_t st_blocks;
|
||||
struct {
|
||||
long tv_sec;
|
||||
long tv_nsec;
|
||||
} __st_atim32, __st_mtim32, __st_ctim32;
|
||||
ino_t st_ino;
|
||||
struct timespec st_atim;
|
||||
struct timespec st_mtim;
|
||||
struct timespec st_ctim;
|
||||
};
|
|
@ -0,0 +1,7 @@
|
|||
struct statfs {
|
||||
unsigned long f_type, f_bsize;
|
||||
fsblkcnt_t f_blocks, f_bfree, f_bavail;
|
||||
fsfilcnt_t f_files, f_ffree;
|
||||
fsid_t f_fsid;
|
||||
unsigned long f_namelen, f_frsize, f_flags, f_spare[4];
|
||||
};
|
|
@ -0,0 +1,22 @@
|
|||
#ifndef __ICCARM__
|
||||
typedef int32_t int_fast16_t;
|
||||
typedef int32_t int_fast32_t;
|
||||
typedef uint32_t uint_fast16_t;
|
||||
typedef uint32_t uint_fast32_t;
|
||||
|
||||
#define INT_FAST16_MIN INT32_MIN
|
||||
#define INT_FAST32_MIN INT32_MIN
|
||||
|
||||
#define INT_FAST16_MAX INT32_MAX
|
||||
#define INT_FAST32_MAX INT32_MAX
|
||||
|
||||
#define UINT_FAST16_MAX UINT32_MAX
|
||||
#define UINT_FAST32_MAX UINT32_MAX
|
||||
|
||||
#define INTPTR_MIN INT32_MIN
|
||||
#define INTPTR_MAX INT32_MAX
|
||||
#define UINTPTR_MAX UINT32_MAX
|
||||
#define PTRDIFF_MIN INT32_MIN
|
||||
#define PTRDIFF_MAX INT32_MAX
|
||||
#define SIZE_MAX UINT32_MAX
|
||||
#endif
|
|
@ -0,0 +1,791 @@
|
|||
#define __NR_restart_syscall 0
|
||||
#define __NR_exit 1
|
||||
#define __NR_fork 2
|
||||
#define __NR_read 3
|
||||
#define __NR_write 4
|
||||
#define __NR_open 5
|
||||
#define __NR_close 6
|
||||
#define __NR_creat 8
|
||||
#define __NR_link 9
|
||||
#define __NR_unlink 10
|
||||
#define __NR_execve 11
|
||||
#define __NR_chdir 12
|
||||
#define __NR_mknod 14
|
||||
#define __NR_chmod 15
|
||||
#define __NR_lchown 16
|
||||
#define __NR_lseek 19
|
||||
#define __NR_getpid 20
|
||||
#define __NR_mount 21
|
||||
#define __NR_umount 22
|
||||
#define __NR_setuid 23
|
||||
#define __NR_getuid 24
|
||||
#define __NR_ptrace 26
|
||||
#define __NR_pause 29
|
||||
#define __NR_access 33
|
||||
#define __NR_nice 34
|
||||
#define __NR_sync 36
|
||||
#define __NR_kill 37
|
||||
#define __NR_rename 38
|
||||
#define __NR_mkdir 39
|
||||
#define __NR_rmdir 40
|
||||
#define __NR_dup 41
|
||||
#define __NR_pipe 42
|
||||
#define __NR_times 43
|
||||
#define __NR_brk 45
|
||||
#define __NR_setgid 46
|
||||
#define __NR_getgid 47
|
||||
#define __NR_geteuid 49
|
||||
#define __NR_getegid 50
|
||||
#define __NR_acct 51
|
||||
#define __NR_umount2 52
|
||||
#define __NR_ioctl 54
|
||||
#define __NR_fcntl 55
|
||||
#define __NR_setpgid 57
|
||||
#define __NR_umask 60
|
||||
#define __NR_chroot 61
|
||||
#define __NR_ustat 62
|
||||
#define __NR_dup2 63
|
||||
#define __NR_getppid 64
|
||||
#define __NR_getpgrp 65
|
||||
#define __NR_setsid 66
|
||||
#define __NR_sigaction 67
|
||||
#define __NR_setreuid 70
|
||||
#define __NR_setregid 71
|
||||
#define __NR_sigsuspend 72
|
||||
#define __NR_sigpending 73
|
||||
#define __NR_sethostname 74
|
||||
#define __NR_setrlimit 75
|
||||
#define __NR_getrusage 77
|
||||
#define __NR_gettimeofday_time32 78
|
||||
#define __NR_settimeofday_time32 79
|
||||
#define __NR_getgroups 80
|
||||
#define __NR_setgroups 81
|
||||
#define __NR_symlink 83
|
||||
#define __NR_readlink 85
|
||||
#define __NR_uselib 86
|
||||
#define __NR_swapon 87
|
||||
#define __NR_reboot 88
|
||||
#define __NR_munmap 91
|
||||
#define __NR_truncate 92
|
||||
#define __NR_ftruncate 93
|
||||
#define __NR_fchmod 94
|
||||
#define __NR_fchown 95
|
||||
#define __NR_getpriority 96
|
||||
#define __NR_setpriority 97
|
||||
#define __NR_statfs 99
|
||||
#define __NR_fstatfs 100
|
||||
#define __NR_syslog 103
|
||||
#define __NR_setitimer 104
|
||||
#define __NR_getitimer 105
|
||||
#define __NR_stat 106
|
||||
#define __NR_lstat 107
|
||||
#define __NR_fstat 108
|
||||
#define __NR_vhangup 111
|
||||
#define __NR_wait4 114
|
||||
#define __NR_swapoff 115
|
||||
#define __NR_sysinfo 116
|
||||
#define __NR_fsync 118
|
||||
#define __NR_sigreturn 119
|
||||
#define __NR_clone 120
|
||||
#define __NR_setdomainname 121
|
||||
#define __NR_uname 122
|
||||
#define __NR_adjtimex 124
|
||||
#define __NR_mprotect 125
|
||||
#define __NR_sigprocmask 126
|
||||
#define __NR_init_module 128
|
||||
#define __NR_delete_module 129
|
||||
#define __NR_quotactl 131
|
||||
#define __NR_getpgid 132
|
||||
#define __NR_fchdir 133
|
||||
#define __NR_bdflush 134
|
||||
#define __NR_sysfs 135
|
||||
#define __NR_personality 136
|
||||
#define __NR_setfsuid 138
|
||||
#define __NR_setfsgid 139
|
||||
#define __NR__llseek 140
|
||||
#define __NR_getdents 141
|
||||
#define __NR__newselect 142
|
||||
#define __NR_flock 143
|
||||
#define __NR_msync 144
|
||||
#define __NR_readv 145
|
||||
#define __NR_writev 146
|
||||
#define __NR_getsid 147
|
||||
#define __NR_fdatasync 148
|
||||
#define __NR__sysctl 149
|
||||
#define __NR_mlock 150
|
||||
#define __NR_munlock 151
|
||||
#define __NR_mlockall 152
|
||||
#define __NR_munlockall 153
|
||||
#define __NR_sched_setparam 154
|
||||
#define __NR_sched_getparam 155
|
||||
#define __NR_sched_setscheduler 156
|
||||
#define __NR_sched_getscheduler 157
|
||||
#define __NR_sched_yield 158
|
||||
#define __NR_sched_get_priority_max 159
|
||||
#define __NR_sched_get_priority_min 160
|
||||
#define __NR_sched_rr_get_interval 161
|
||||
#define __NR_nanosleep 162
|
||||
#define __NR_mremap 163
|
||||
#define __NR_setresuid 164
|
||||
#define __NR_getresuid 165
|
||||
#define __NR_poll 168
|
||||
#define __NR_nfsservctl 169
|
||||
#define __NR_setresgid 170
|
||||
#define __NR_getresgid 171
|
||||
#define __NR_prctl 172
|
||||
#define __NR_rt_sigreturn 173
|
||||
#define __NR_rt_sigaction 174
|
||||
#define __NR_rt_sigprocmask 175
|
||||
#define __NR_rt_sigpending 176
|
||||
#define __NR_rt_sigtimedwait 177
|
||||
#define __NR_rt_sigqueueinfo 178
|
||||
#define __NR_rt_sigsuspend 179
|
||||
#define __NR_pread64 180
|
||||
#define __NR_pwrite64 181
|
||||
#define __NR_chown 182
|
||||
#define __NR_getcwd 183
|
||||
#define __NR_capget 184
|
||||
#define __NR_capset 185
|
||||
#define __NR_sigaltstack 186
|
||||
#define __NR_sendfile 187
|
||||
#define __NR_vfork 190
|
||||
#define __NR_ugetrlimit 191
|
||||
#define __NR_mmap2 192
|
||||
#define __NR_truncate64 193
|
||||
#define __NR_ftruncate64 194
|
||||
#define __NR_stat64 195
|
||||
#define __NR_lstat64 196
|
||||
#define __NR_fstat64 197
|
||||
#define __NR_lchown32 198
|
||||
#define __NR_getuid32 199
|
||||
#define __NR_getgid32 200
|
||||
#define __NR_geteuid32 201
|
||||
#define __NR_getegid32 202
|
||||
#define __NR_setreuid32 203
|
||||
#define __NR_setregid32 204
|
||||
#define __NR_getgroups32 205
|
||||
#define __NR_setgroups32 206
|
||||
#define __NR_fchown32 207
|
||||
#define __NR_setresuid32 208
|
||||
#define __NR_getresuid32 209
|
||||
#define __NR_setresgid32 210
|
||||
#define __NR_getresgid32 211
|
||||
#define __NR_chown32 212
|
||||
#define __NR_setuid32 213
|
||||
#define __NR_setgid32 214
|
||||
#define __NR_setfsuid32 215
|
||||
#define __NR_setfsgid32 216
|
||||
#define __NR_getdents64 217
|
||||
#define __NR_pivot_root 218
|
||||
#define __NR_mincore 219
|
||||
#define __NR_madvise 220
|
||||
#define __NR_fcntl64 221
|
||||
#define __NR_gettid 224
|
||||
#define __NR_readahead 225
|
||||
#define __NR_setxattr 226
|
||||
#define __NR_lsetxattr 227
|
||||
#define __NR_fsetxattr 228
|
||||
#define __NR_getxattr 229
|
||||
#define __NR_lgetxattr 230
|
||||
#define __NR_fgetxattr 231
|
||||
#define __NR_listxattr 232
|
||||
#define __NR_llistxattr 233
|
||||
#define __NR_flistxattr 234
|
||||
#define __NR_removexattr 235
|
||||
#define __NR_lremovexattr 236
|
||||
#define __NR_fremovexattr 237
|
||||
#define __NR_tkill 238
|
||||
#define __NR_sendfile64 239
|
||||
#define __NR_futex 240
|
||||
#define __NR_sched_setaffinity 241
|
||||
#define __NR_sched_getaffinity 242
|
||||
#define __NR_io_setup 243
|
||||
#define __NR_io_destroy 244
|
||||
#define __NR_io_getevents 245
|
||||
#define __NR_io_submit 246
|
||||
#define __NR_io_cancel 247
|
||||
#define __NR_exit_group 248
|
||||
#define __NR_lookup_dcookie 249
|
||||
#define __NR_epoll_create 250
|
||||
#define __NR_epoll_ctl 251
|
||||
#define __NR_epoll_wait 252
|
||||
#define __NR_remap_file_pages 253
|
||||
#define __NR_set_thread_area 254
|
||||
#define __NR_get_thread_area 255
|
||||
#define __NR_set_tid_address 256
|
||||
#define __NR_timer_create 257
|
||||
#define __NR_timer_settime32 258
|
||||
#define __NR_timer_gettime32 259
|
||||
#define __NR_timer_getoverrun 260
|
||||
#define __NR_timer_delete 261
|
||||
#define __NR_clock_settime32 262
|
||||
#define __NR_clock_gettime32 263
|
||||
#define __NR_clock_getres_time32 264
|
||||
#define __NR_clock_nanosleep_time32 265
|
||||
#define __NR_statfs64 266
|
||||
#define __NR_fstatfs64 267
|
||||
#define __NR_tgkill 268
|
||||
#define __NR_utimes 269
|
||||
#define __NR_fadvise64_64 270
|
||||
#define __NR_arm_fadvise64_64 270
|
||||
#define __NR_pciconfig_iobase 271
|
||||
#define __NR_pciconfig_read 272
|
||||
#define __NR_pciconfig_write 273
|
||||
#define __NR_mq_open 274
|
||||
#define __NR_mq_unlink 275
|
||||
#define __NR_mq_timedsend 276
|
||||
#define __NR_mq_timedreceive 277
|
||||
#define __NR_mq_notify 278
|
||||
#define __NR_mq_getsetattr 279
|
||||
#define __NR_waitid 280
|
||||
#define __NR_socket 281
|
||||
#define __NR_bind 282
|
||||
#define __NR_connect 283
|
||||
#define __NR_listen 284
|
||||
#define __NR_accept 285
|
||||
#define __NR_getsockname 286
|
||||
#define __NR_getpeername 287
|
||||
#define __NR_socketpair 288
|
||||
#define __NR_send 289
|
||||
#define __NR_sendto 290
|
||||
#define __NR_recv 291
|
||||
#define __NR_recvfrom 292
|
||||
#define __NR_shutdown 293
|
||||
#define __NR_setsockopt 294
|
||||
#define __NR_getsockopt 295
|
||||
#define __NR_sendmsg 296
|
||||
#define __NR_recvmsg 297
|
||||
#define __NR_semop 298
|
||||
#define __NR_semget 299
|
||||
#define __NR_semctl 300
|
||||
#define __NR_msgsnd 301
|
||||
#define __NR_msgrcv 302
|
||||
#define __NR_msgget 303
|
||||
#define __NR_msgctl 304
|
||||
#define __NR_shmat 305
|
||||
#define __NR_shmdt 306
|
||||
#define __NR_shmget 307
|
||||
#define __NR_shmctl 308
|
||||
#define __NR_add_key 309
|
||||
#define __NR_request_key 310
|
||||
#define __NR_keyctl 311
|
||||
#define __NR_semtimedop 312
|
||||
#define __NR_vserver 313
|
||||
#define __NR_ioprio_set 314
|
||||
#define __NR_ioprio_get 315
|
||||
#define __NR_inotify_init 316
|
||||
#define __NR_inotify_add_watch 317
|
||||
#define __NR_inotify_rm_watch 318
|
||||
#define __NR_mbind 319
|
||||
#define __NR_get_mempolicy 320
|
||||
#define __NR_set_mempolicy 321
|
||||
#define __NR_openat 322
|
||||
#define __NR_mkdirat 323
|
||||
#define __NR_mknodat 324
|
||||
#define __NR_fchownat 325
|
||||
#define __NR_futimesat 326
|
||||
#define __NR_fstatat64 327
|
||||
#define __NR_unlinkat 328
|
||||
#define __NR_renameat 329
|
||||
#define __NR_linkat 330
|
||||
#define __NR_symlinkat 331
|
||||
#define __NR_readlinkat 332
|
||||
#define __NR_fchmodat 333
|
||||
#define __NR_faccessat 334
|
||||
#define __NR_pselect6 335
|
||||
#define __NR_ppoll 336
|
||||
#define __NR_unshare 337
|
||||
#define __NR_set_robust_list 338
|
||||
#define __NR_get_robust_list 339
|
||||
#define __NR_splice 340
|
||||
#define __NR_sync_file_range2 341
|
||||
#define __NR_arm_sync_file_range 341
|
||||
#define __NR_tee 342
|
||||
#define __NR_vmsplice 343
|
||||
#define __NR_move_pages 344
|
||||
#define __NR_getcpu 345
|
||||
#define __NR_epoll_pwait 346
|
||||
#define __NR_kexec_load 347
|
||||
#define __NR_utimensat 348
|
||||
#define __NR_signalfd 349
|
||||
#define __NR_timerfd_create 350
|
||||
#define __NR_eventfd 351
|
||||
#define __NR_fallocate 352
|
||||
#define __NR_timerfd_settime32 353
|
||||
#define __NR_timerfd_gettime32 354
|
||||
#define __NR_signalfd4 355
|
||||
#define __NR_eventfd2 356
|
||||
#define __NR_epoll_create1 357
|
||||
#define __NR_dup3 358
|
||||
#define __NR_pipe2 359
|
||||
#define __NR_inotify_init1 360
|
||||
#define __NR_preadv 361
|
||||
#define __NR_pwritev 362
|
||||
#define __NR_rt_tgsigqueueinfo 363
|
||||
#define __NR_perf_event_open 364
|
||||
#define __NR_recvmmsg 365
|
||||
#define __NR_accept4 366
|
||||
#define __NR_fanotify_init 367
|
||||
#define __NR_fanotify_mark 368
|
||||
#define __NR_prlimit64 369
|
||||
#define __NR_name_to_handle_at 370
|
||||
#define __NR_open_by_handle_at 371
|
||||
#define __NR_clock_adjtime 372
|
||||
#define __NR_syncfs 373
|
||||
#define __NR_sendmmsg 374
|
||||
#define __NR_setns 375
|
||||
#define __NR_process_vm_readv 376
|
||||
#define __NR_process_vm_writev 377
|
||||
#define __NR_kcmp 378
|
||||
#define __NR_finit_module 379
|
||||
#define __NR_sched_setattr 380
|
||||
#define __NR_sched_getattr 381
|
||||
#define __NR_renameat2 382
|
||||
#define __NR_seccomp 383
|
||||
#define __NR_getrandom 384
|
||||
#define __NR_memfd_create 385
|
||||
#define __NR_bpf 386
|
||||
#define __NR_execveat 387
|
||||
#define __NR_userfaultfd 388
|
||||
#define __NR_membarrier 389
|
||||
#define __NR_mlock2 390
|
||||
#define __NR_copy_file_range 391
|
||||
#define __NR_preadv2 392
|
||||
#define __NR_pwritev2 393
|
||||
#define __NR_pkey_mprotect 394
|
||||
#define __NR_pkey_alloc 395
|
||||
#define __NR_pkey_free 396
|
||||
#define __NR_statx 397
|
||||
#define __NR_rseq 398
|
||||
#define __NR_io_pgetevents 399
|
||||
#define __NR_migrate_pages 400
|
||||
#define __NR_kexec_file_load 401
|
||||
#define __NR_pidfd_send_signal 424
|
||||
#define __NR_io_uring_setup 425
|
||||
#define __NR_io_uring_enter 426
|
||||
#define __NR_io_uring_register 427
|
||||
#define __NR_open_tree 428
|
||||
#define __NR_move_mount 429
|
||||
#define __NR_fsopen 430
|
||||
#define __NR_fsconfig 431
|
||||
#define __NR_fsmount 432
|
||||
#define __NR_fspick 433
|
||||
#define __NR_pidfd_open 434
|
||||
#define __NR_clone3 435
|
||||
|
||||
/* OHOS customized syscalls, not compatible with ARM EABI */
|
||||
#define __NR_OHOS_BEGIN 500
|
||||
#define __NR_pthread_set_detach (__NR_OHOS_BEGIN + 0)
|
||||
#define __NR_pthread_join (__NR_OHOS_BEGIN + 1)
|
||||
#define __NR_pthread_deatch (__NR_OHOS_BEGIN + 2)
|
||||
#define __NR_creat_user_thread (__NR_OHOS_BEGIN + 3)
|
||||
#define __NR_processcreat (__NR_OHOS_BEGIN + 4)
|
||||
#define __NR_processtart (__NR_OHOS_BEGIN + 5)
|
||||
#define __NR_printf (__NR_OHOS_BEGIN + 6)
|
||||
#define __NR_dumpmemory (__NR_OHOS_BEGIN + 13)
|
||||
#define __NR_mkfifo (__NR_OHOS_BEGIN + 14)
|
||||
#define __NR_mqclose (__NR_OHOS_BEGIN + 15)
|
||||
#define __NR_realpath (__NR_OHOS_BEGIN + 16)
|
||||
#define __NR_format (__NR_OHOS_BEGIN + 17)
|
||||
#define __NR_shellexec (__NR_OHOS_BEGIN + 18)
|
||||
#define __NR_ohoscapget (__NR_OHOS_BEGIN + 19)
|
||||
#define __NR_ohoscapset (__NR_OHOS_BEGIN + 20)
|
||||
#define __NR_syscallend (__NR_OHOS_BEGIN + 21)
|
||||
|
||||
#define __ARM_NR_breakpoint 0x0f0001
|
||||
#define __ARM_NR_cacheflush 0x0f0002
|
||||
#define __ARM_NR_usr26 0x0f0003
|
||||
#define __ARM_NR_usr32 0x0f0004
|
||||
#define __ARM_NR_set_tls 0x0f0005
|
||||
#define __ARM_NR_get_tls 0x0f0006
|
||||
#define SYS_restart_syscall 0
|
||||
#define SYS_exit 1
|
||||
#define SYS_fork 2
|
||||
#define SYS_read 3
|
||||
#define SYS_write 4
|
||||
#define SYS_open 5
|
||||
#define SYS_close 6
|
||||
#define SYS_creat 8
|
||||
#define SYS_link 9
|
||||
#define SYS_unlink 10
|
||||
#define SYS_execve 11
|
||||
#define SYS_chdir 12
|
||||
#define SYS_mknod 14
|
||||
#define SYS_chmod 15
|
||||
#define SYS_lchown 16
|
||||
#define SYS_lseek 19
|
||||
#define SYS_getpid 20
|
||||
#define SYS_mount 21
|
||||
#define SYS_umount 22
|
||||
#define SYS_setuid 23
|
||||
#define SYS_getuid 24
|
||||
#define SYS_ptrace 26
|
||||
#define SYS_pause 29
|
||||
#define SYS_access 33
|
||||
#define SYS_nice 34
|
||||
#define SYS_sync 36
|
||||
#define SYS_kill 37
|
||||
#define SYS_rename 38
|
||||
#define SYS_mkdir 39
|
||||
#define SYS_rmdir 40
|
||||
#define SYS_dup 41
|
||||
#define SYS_pipe 42
|
||||
#define SYS_times 43
|
||||
#define SYS_brk 45
|
||||
#define SYS_setgid 46
|
||||
#define SYS_getgid 47
|
||||
#define SYS_geteuid 49
|
||||
#define SYS_getegid 50
|
||||
#define SYS_acct 51
|
||||
#define SYS_umount2 52
|
||||
#define SYS_ioctl 54
|
||||
#define SYS_fcntl 55
|
||||
#define SYS_setpgid 57
|
||||
#define SYS_umask 60
|
||||
#define SYS_chroot 61
|
||||
#define SYS_ustat 62
|
||||
#define SYS_dup2 63
|
||||
#define SYS_getppid 64
|
||||
#define SYS_getpgrp 65
|
||||
#define SYS_setsid 66
|
||||
#define SYS_sigaction 67
|
||||
#define SYS_setreuid 70
|
||||
#define SYS_setregid 71
|
||||
#define SYS_sigsuspend 72
|
||||
#define SYS_sigpending 73
|
||||
#define SYS_sethostname 74
|
||||
#define SYS_setrlimit 75
|
||||
#define SYS_getrusage 77
|
||||
#define SYS_gettimeofday_time32 78
|
||||
#define SYS_settimeofday_time32 79
|
||||
#define SYS_getgroups 80
|
||||
#define SYS_setgroups 81
|
||||
#define SYS_symlink 83
|
||||
#define SYS_readlink 85
|
||||
#define SYS_uselib 86
|
||||
#define SYS_swapon 87
|
||||
#define SYS_reboot 88
|
||||
#define SYS_munmap 91
|
||||
#define SYS_truncate 92
|
||||
#define SYS_ftruncate 93
|
||||
#define SYS_fchmod 94
|
||||
#define SYS_fchown 95
|
||||
#define SYS_getpriority 96
|
||||
#define SYS_setpriority 97
|
||||
#define SYS_statfs 99
|
||||
#define SYS_fstatfs 100
|
||||
#define SYS_syslog 103
|
||||
#define SYS_setitimer 104
|
||||
#define SYS_getitimer 105
|
||||
#define SYS_stat 106
|
||||
#define SYS_lstat 107
|
||||
#define SYS_fstat 108
|
||||
#define SYS_vhangup 111
|
||||
#define SYS_wait4 114
|
||||
#define SYS_swapoff 115
|
||||
#define SYS_sysinfo 116
|
||||
#define SYS_fsync 118
|
||||
#define SYS_sigreturn 119
|
||||
#define SYS_clone 120
|
||||
#define SYS_setdomainname 121
|
||||
#define SYS_uname 122
|
||||
#define SYS_adjtimex 124
|
||||
#define SYS_mprotect 125
|
||||
#define SYS_sigprocmask 126
|
||||
#define SYS_init_module 128
|
||||
#define SYS_delete_module 129
|
||||
#define SYS_quotactl 131
|
||||
#define SYS_getpgid 132
|
||||
#define SYS_fchdir 133
|
||||
#define SYS_bdflush 134
|
||||
#define SYS_sysfs 135
|
||||
#define SYS_personality 136
|
||||
#define SYS_setfsuid 138
|
||||
#define SYS_setfsgid 139
|
||||
#define SYS__llseek 140
|
||||
#define SYS_getdents 141
|
||||
#define SYS__newselect 142
|
||||
#define SYS_flock 143
|
||||
#define SYS_msync 144
|
||||
#define SYS_readv 145
|
||||
#define SYS_writev 146
|
||||
#define SYS_getsid 147
|
||||
#define SYS_fdatasync 148
|
||||
#define SYS__sysctl 149
|
||||
#define SYS_mlock 150
|
||||
#define SYS_munlock 151
|
||||
#define SYS_mlockall 152
|
||||
#define SYS_munlockall 153
|
||||
#define SYS_sched_setparam 154
|
||||
#define SYS_sched_getparam 155
|
||||
#define SYS_sched_setscheduler 156
|
||||
#define SYS_sched_getscheduler 157
|
||||
#define SYS_sched_yield 158
|
||||
#define SYS_sched_get_priority_max 159
|
||||
#define SYS_sched_get_priority_min 160
|
||||
#define SYS_sched_rr_get_interval 161
|
||||
#define SYS_nanosleep 162
|
||||
#define SYS_mremap 163
|
||||
#define SYS_setresuid 164
|
||||
#define SYS_getresuid 165
|
||||
#define SYS_poll 168
|
||||
#define SYS_nfsservctl 169
|
||||
#define SYS_setresgid 170
|
||||
#define SYS_getresgid 171
|
||||
#define SYS_prctl 172
|
||||
#define SYS_rt_sigreturn 173
|
||||
#define SYS_rt_sigaction 174
|
||||
#define SYS_rt_sigprocmask 175
|
||||
#define SYS_rt_sigpending 176
|
||||
#define SYS_rt_sigtimedwait 177
|
||||
#define SYS_rt_sigqueueinfo 178
|
||||
#define SYS_rt_sigsuspend 179
|
||||
#define SYS_pread64 180
|
||||
#define SYS_pwrite64 181
|
||||
#define SYS_chown 182
|
||||
#define SYS_getcwd 183
|
||||
#define SYS_capget 184
|
||||
#define SYS_capset 185
|
||||
#define SYS_sigaltstack 186
|
||||
#define SYS_sendfile 187
|
||||
#define SYS_vfork 190
|
||||
#define SYS_ugetrlimit 191
|
||||
#define SYS_mmap2 192
|
||||
#define SYS_truncate64 193
|
||||
#define SYS_ftruncate64 194
|
||||
#define SYS_stat64 195
|
||||
#define SYS_lstat64 196
|
||||
#define SYS_fstat64 197
|
||||
#define SYS_lchown32 198
|
||||
#define SYS_getuid32 199
|
||||
#define SYS_getgid32 200
|
||||
#define SYS_geteuid32 201
|
||||
#define SYS_getegid32 202
|
||||
#define SYS_setreuid32 203
|
||||
#define SYS_setregid32 204
|
||||
#define SYS_getgroups32 205
|
||||
#define SYS_setgroups32 206
|
||||
#define SYS_fchown32 207
|
||||
#define SYS_setresuid32 208
|
||||
#define SYS_getresuid32 209
|
||||
#define SYS_setresgid32 210
|
||||
#define SYS_getresgid32 211
|
||||
#define SYS_chown32 212
|
||||
#define SYS_setuid32 213
|
||||
#define SYS_setgid32 214
|
||||
#define SYS_setfsuid32 215
|
||||
#define SYS_setfsgid32 216
|
||||
#define SYS_getdents64 217
|
||||
#define SYS_pivot_root 218
|
||||
#define SYS_mincore 219
|
||||
#define SYS_madvise 220
|
||||
#define SYS_fcntl64 221
|
||||
#define SYS_gettid 224
|
||||
#define SYS_readahead 225
|
||||
#define SYS_setxattr 226
|
||||
#define SYS_lsetxattr 227
|
||||
#define SYS_fsetxattr 228
|
||||
#define SYS_getxattr 229
|
||||
#define SYS_lgetxattr 230
|
||||
#define SYS_fgetxattr 231
|
||||
#define SYS_listxattr 232
|
||||
#define SYS_llistxattr 233
|
||||
#define SYS_flistxattr 234
|
||||
#define SYS_removexattr 235
|
||||
#define SYS_lremovexattr 236
|
||||
#define SYS_fremovexattr 237
|
||||
#define SYS_tkill 238
|
||||
#define SYS_sendfile64 239
|
||||
#define SYS_futex 240
|
||||
#define SYS_sched_setaffinity 241
|
||||
#define SYS_sched_getaffinity 242
|
||||
#define SYS_io_setup 243
|
||||
#define SYS_io_destroy 244
|
||||
#define SYS_io_getevents 245
|
||||
#define SYS_io_submit 246
|
||||
#define SYS_io_cancel 247
|
||||
#define SYS_exit_group 248
|
||||
#define SYS_lookup_dcookie 249
|
||||
#define SYS_epoll_create 250
|
||||
#define SYS_epoll_ctl 251
|
||||
#define SYS_epoll_wait 252
|
||||
#define SYS_remap_file_pages 253
|
||||
#define SYS_set_thread_area 254
|
||||
#define SYS_get_thread_area 255
|
||||
#define SYS_set_tid_address 256
|
||||
#define SYS_timer_create 257
|
||||
#define SYS_timer_settime32 258
|
||||
#define SYS_timer_gettime32 259
|
||||
#define SYS_timer_getoverrun 260
|
||||
#define SYS_timer_delete 261
|
||||
#define SYS_clock_settime32 262
|
||||
#define SYS_clock_gettime32 263
|
||||
#define SYS_clock_getres_time32 264
|
||||
#define SYS_clock_nanosleep_time32 265
|
||||
#define SYS_statfs64 266
|
||||
#define SYS_fstatfs64 267
|
||||
#define SYS_tgkill 268
|
||||
#define SYS_utimes 269
|
||||
#define SYS_fadvise64_64 270
|
||||
#define SYS_arm_fadvise64_64 270
|
||||
#define SYS_pciconfig_iobase 271
|
||||
#define SYS_pciconfig_read 272
|
||||
#define SYS_pciconfig_write 273
|
||||
#define SYS_mq_open 274
|
||||
#define SYS_mq_unlink 275
|
||||
#define SYS_mq_timedsend 276
|
||||
#define SYS_mq_timedreceive 277
|
||||
#define SYS_mq_notify 278
|
||||
#define SYS_mq_getsetattr 279
|
||||
#define SYS_waitid 280
|
||||
#define SYS_socket 281
|
||||
#define SYS_bind 282
|
||||
#define SYS_connect 283
|
||||
#define SYS_listen 284
|
||||
#define SYS_accept 285
|
||||
#define SYS_getsockname 286
|
||||
#define SYS_getpeername 287
|
||||
#define SYS_socketpair 288
|
||||
#define SYS_send 289
|
||||
#define SYS_sendto 290
|
||||
#define SYS_recv 291
|
||||
#define SYS_recvfrom 292
|
||||
#define SYS_shutdown 293
|
||||
#define SYS_setsockopt 294
|
||||
#define SYS_getsockopt 295
|
||||
#define SYS_sendmsg 296
|
||||
#define SYS_recvmsg 297
|
||||
#define SYS_semop 298
|
||||
#define SYS_semget 299
|
||||
#define SYS_semctl 300
|
||||
#define SYS_msgsnd 301
|
||||
#define SYS_msgrcv 302
|
||||
#define SYS_msgget 303
|
||||
#define SYS_msgctl 304
|
||||
#define SYS_shmat 305
|
||||
#define SYS_shmdt 306
|
||||
#define SYS_shmget 307
|
||||
#define SYS_shmctl 308
|
||||
#define SYS_add_key 309
|
||||
#define SYS_request_key 310
|
||||
#define SYS_keyctl 311
|
||||
#define SYS_semtimedop 312
|
||||
#define SYS_vserver 313
|
||||
#define SYS_ioprio_set 314
|
||||
#define SYS_ioprio_get 315
|
||||
#define SYS_inotify_init 316
|
||||
#define SYS_inotify_add_watch 317
|
||||
#define SYS_inotify_rm_watch 318
|
||||
#define SYS_mbind 319
|
||||
#define SYS_get_mempolicy 320
|
||||
#define SYS_set_mempolicy 321
|
||||
#define SYS_openat 322
|
||||
#define SYS_mkdirat 323
|
||||
#define SYS_mknodat 324
|
||||
#define SYS_fchownat 325
|
||||
#define SYS_futimesat 326
|
||||
#define SYS_fstatat64 327
|
||||
#define SYS_unlinkat 328
|
||||
#define SYS_renameat 329
|
||||
#define SYS_linkat 330
|
||||
#define SYS_symlinkat 331
|
||||
#define SYS_readlinkat 332
|
||||
#define SYS_fchmodat 333
|
||||
#define SYS_faccessat 334
|
||||
#define SYS_pselect6 335
|
||||
#define SYS_ppoll 336
|
||||
#define SYS_unshare 337
|
||||
#define SYS_set_robust_list 338
|
||||
#define SYS_get_robust_list 339
|
||||
#define SYS_splice 340
|
||||
#define SYS_sync_file_range2 341
|
||||
#define SYS_arm_sync_file_range 341
|
||||
#define SYS_tee 342
|
||||
#define SYS_vmsplice 343
|
||||
#define SYS_move_pages 344
|
||||
#define SYS_getcpu 345
|
||||
#define SYS_epoll_pwait 346
|
||||
#define SYS_kexec_load 347
|
||||
#define SYS_utimensat 348
|
||||
#define SYS_signalfd 349
|
||||
#define SYS_timerfd_create 350
|
||||
#define SYS_eventfd 351
|
||||
#define SYS_fallocate 352
|
||||
#define SYS_timerfd_settime32 353
|
||||
#define SYS_timerfd_gettime32 354
|
||||
#define SYS_signalfd4 355
|
||||
#define SYS_eventfd2 356
|
||||
#define SYS_epoll_create1 357
|
||||
#define SYS_dup3 358
|
||||
#define SYS_pipe2 359
|
||||
#define SYS_inotify_init1 360
|
||||
#define SYS_preadv 361
|
||||
#define SYS_pwritev 362
|
||||
#define SYS_rt_tgsigqueueinfo 363
|
||||
#define SYS_perf_event_open 364
|
||||
#define SYS_recvmmsg 365
|
||||
#define SYS_accept4 366
|
||||
#define SYS_fanotify_init 367
|
||||
#define SYS_fanotify_mark 368
|
||||
#define SYS_prlimit64 369
|
||||
#define SYS_name_to_handle_at 370
|
||||
#define SYS_open_by_handle_at 371
|
||||
#define SYS_clock_adjtime 372
|
||||
#define SYS_syncfs 373
|
||||
#define SYS_sendmmsg 374
|
||||
#define SYS_setns 375
|
||||
#define SYS_process_vm_readv 376
|
||||
#define SYS_process_vm_writev 377
|
||||
#define SYS_kcmp 378
|
||||
#define SYS_finit_module 379
|
||||
#define SYS_sched_setattr 380
|
||||
#define SYS_sched_getattr 381
|
||||
#define SYS_renameat2 382
|
||||
#define SYS_seccomp 383
|
||||
#define SYS_getrandom 384
|
||||
#define SYS_memfd_create 385
|
||||
#define SYS_bpf 386
|
||||
#define SYS_execveat 387
|
||||
#define SYS_userfaultfd 388
|
||||
#define SYS_membarrier 389
|
||||
#define SYS_mlock2 390
|
||||
#define SYS_copy_file_range 391
|
||||
#define SYS_preadv2 392
|
||||
#define SYS_pwritev2 393
|
||||
#define SYS_pkey_mprotect 394
|
||||
#define SYS_pkey_alloc 395
|
||||
#define SYS_pkey_free 396
|
||||
#define SYS_statx 397
|
||||
#define SYS_rseq 398
|
||||
#define SYS_io_pgetevents 399
|
||||
#define SYS_migrate_pages 400
|
||||
#define SYS_kexec_file_load 401
|
||||
#define SYS_pidfd_send_signal 424
|
||||
#define SYS_io_uring_setup 425
|
||||
#define SYS_io_uring_enter 426
|
||||
#define SYS_io_uring_register 427
|
||||
#define SYS_open_tree 428
|
||||
#define SYS_move_mount 429
|
||||
#define SYS_fsopen 430
|
||||
#define SYS_fsconfig 431
|
||||
#define SYS_fsmount 432
|
||||
#define SYS_fspick 433
|
||||
#define SYS_pidfd_open 434
|
||||
#define SYS_clone3 435
|
||||
#define SYS_OHOS_BEGIN 500
|
||||
#define SYS_pthread_set_detach (__NR_OHOS_BEGIN + 0)
|
||||
#define SYS_pthread_join (__NR_OHOS_BEGIN + 1)
|
||||
#define SYS_pthread_deatch (__NR_OHOS_BEGIN + 2)
|
||||
#define SYS_creat_user_thread (__NR_OHOS_BEGIN + 3)
|
||||
#define SYS_processcreat (__NR_OHOS_BEGIN + 4)
|
||||
#define SYS_processtart (__NR_OHOS_BEGIN + 5)
|
||||
#define SYS_printf (__NR_OHOS_BEGIN + 6)
|
||||
#define SYS_dumpmemory (__NR_OHOS_BEGIN + 13)
|
||||
#define SYS_mkfifo (__NR_OHOS_BEGIN + 14)
|
||||
#define SYS_mqclose (__NR_OHOS_BEGIN + 15)
|
||||
#define SYS_realpath (__NR_OHOS_BEGIN + 16)
|
||||
#define SYS_format (__NR_OHOS_BEGIN + 17)
|
||||
#define SYS_shellexec (__NR_OHOS_BEGIN + 18)
|
||||
#define SYS_ohoscapget (__NR_OHOS_BEGIN + 19)
|
||||
#define SYS_ohoscapset (__NR_OHOS_BEGIN + 20)
|
||||
#define SYS_syscallend (__NR_OHOS_BEGIN + 21)
|
|
@ -0,0 +1,166 @@
|
|||
struct termios {
|
||||
tcflag_t c_iflag;
|
||||
tcflag_t c_oflag;
|
||||
tcflag_t c_cflag;
|
||||
tcflag_t c_lflag;
|
||||
cc_t c_line;
|
||||
cc_t c_cc[NCCS];
|
||||
speed_t __c_ispeed;
|
||||
speed_t __c_ospeed;
|
||||
};
|
||||
|
||||
#define VINTR 0
|
||||
#define VQUIT 1
|
||||
#define VERASE 2
|
||||
#define VKILL 3
|
||||
#define VEOF 4
|
||||
#define VTIME 5
|
||||
#define VMIN 6
|
||||
#define VSWTC 7
|
||||
#define VSTART 8
|
||||
#define VSTOP 9
|
||||
#define VSUSP 10
|
||||
#define VEOL 11
|
||||
#define VREPRINT 12
|
||||
#define VDISCARD 13
|
||||
#define VWERASE 14
|
||||
#define VLNEXT 15
|
||||
#define VEOL2 16
|
||||
|
||||
#define IGNBRK 0000001
|
||||
#define BRKINT 0000002
|
||||
#define IGNPAR 0000004
|
||||
#define PARMRK 0000010
|
||||
#define INPCK 0000020
|
||||
#define ISTRIP 0000040
|
||||
#define INLCR 0000100
|
||||
#define IGNCR 0000200
|
||||
#define ICRNL 0000400
|
||||
#define IUCLC 0001000
|
||||
#define IXON 0002000
|
||||
#define IXANY 0004000
|
||||
#define IXOFF 0010000
|
||||
#define IMAXBEL 0020000
|
||||
#define IUTF8 0040000
|
||||
|
||||
#define OPOST 0000001
|
||||
#define OLCUC 0000002
|
||||
#define ONLCR 0000004
|
||||
#define OCRNL 0000010
|
||||
#define ONOCR 0000020
|
||||
#define ONLRET 0000040
|
||||
#define OFILL 0000100
|
||||
#define OFDEL 0000200
|
||||
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_XOPEN_SOURCE)
|
||||
#define NLDLY 0000400
|
||||
#define NL0 0000000
|
||||
#define NL1 0000400
|
||||
#define CRDLY 0003000
|
||||
#define CR0 0000000
|
||||
#define CR1 0001000
|
||||
#define CR2 0002000
|
||||
#define CR3 0003000
|
||||
#define TABDLY 0014000
|
||||
#define TAB0 0000000
|
||||
#define TAB1 0004000
|
||||
#define TAB2 0010000
|
||||
#define TAB3 0014000
|
||||
#define BSDLY 0020000
|
||||
#define BS0 0000000
|
||||
#define BS1 0020000
|
||||
#define FFDLY 0100000
|
||||
#define FF0 0000000
|
||||
#define FF1 0100000
|
||||
#endif
|
||||
|
||||
#define VTDLY 0040000
|
||||
#define VT0 0000000
|
||||
#define VT1 0040000
|
||||
|
||||
#define B0 0000000
|
||||
#define B50 0000001
|
||||
#define B75 0000002
|
||||
#define B110 0000003
|
||||
#define B134 0000004
|
||||
#define B150 0000005
|
||||
#define B200 0000006
|
||||
#define B300 0000007
|
||||
#define B600 0000010
|
||||
#define B1200 0000011
|
||||
#define B1800 0000012
|
||||
#define B2400 0000013
|
||||
#define B4800 0000014
|
||||
#define B9600 0000015
|
||||
#define B19200 0000016
|
||||
#define B38400 0000017
|
||||
|
||||
#define B57600 0010001
|
||||
#define B115200 0010002
|
||||
#define B230400 0010003
|
||||
#define B460800 0010004
|
||||
#define B500000 0010005
|
||||
#define B576000 0010006
|
||||
#define B921600 0010007
|
||||
#define B1000000 0010010
|
||||
#define B1152000 0010011
|
||||
#define B1500000 0010012
|
||||
#define B2000000 0010013
|
||||
#define B2500000 0010014
|
||||
#define B3000000 0010015
|
||||
#define B3500000 0010016
|
||||
#define B4000000 0010017
|
||||
|
||||
#define CSIZE 0000060
|
||||
#define CS5 0000000
|
||||
#define CS6 0000020
|
||||
#define CS7 0000040
|
||||
#define CS8 0000060
|
||||
#define CSTOPB 0000100
|
||||
#define CREAD 0000200
|
||||
#define PARENB 0000400
|
||||
#define PARODD 0001000
|
||||
#define HUPCL 0002000
|
||||
#define CLOCAL 0004000
|
||||
|
||||
#define ISIG 0000001
|
||||
#define ICANON 0000002
|
||||
#define ECHO 0000010
|
||||
#define ECHOE 0000020
|
||||
#define ECHOK 0000040
|
||||
#define ECHONL 0000100
|
||||
#define NOFLSH 0000200
|
||||
#define TOSTOP 0000400
|
||||
#define IEXTEN 0100000
|
||||
|
||||
#define TCOOFF 0
|
||||
#define TCOON 1
|
||||
#define TCIOFF 2
|
||||
#define TCION 3
|
||||
|
||||
#define TCIFLUSH 0
|
||||
#define TCOFLUSH 1
|
||||
#define TCIOFLUSH 2
|
||||
|
||||
#define TCSANOW 0
|
||||
#define TCSADRAIN 1
|
||||
#define TCSAFLUSH 2
|
||||
|
||||
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
#define EXTA 0000016
|
||||
#define EXTB 0000017
|
||||
#define CBAUD 0010017
|
||||
#define CBAUDEX 0010000
|
||||
#define CIBAUD 002003600000
|
||||
#define CMSPAR 010000000000
|
||||
#define CRTSCTS 020000000000
|
||||
|
||||
#define XCASE 0000004
|
||||
#define ECHOCTL 0001000
|
||||
#define ECHOPRT 0002000
|
||||
#define ECHOKE 0004000
|
||||
#define FLUSHO 0010000
|
||||
#define PENDIN 0040000
|
||||
#define EXTPROC 0200000
|
||||
|
||||
#define XTABS 0014000
|
||||
#endif
|
|
@ -0,0 +1,36 @@
|
|||
typedef struct user_fpregs {
|
||||
struct fp_reg {
|
||||
unsigned sign1:1;
|
||||
unsigned unused:15;
|
||||
unsigned sign2:1;
|
||||
unsigned exponent:14;
|
||||
unsigned j:1;
|
||||
unsigned mantissa1:31;
|
||||
unsigned mantissa0:32;
|
||||
} fpregs[8];
|
||||
unsigned fpsr:32;
|
||||
unsigned fpcr:32;
|
||||
unsigned char ftype[8];
|
||||
unsigned int init_flag;
|
||||
} elf_fpregset_t;
|
||||
|
||||
struct user_regs {
|
||||
unsigned long uregs[18];
|
||||
};
|
||||
#define ELF_NGREG 18
|
||||
typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG];
|
||||
|
||||
struct user {
|
||||
struct user_regs regs;
|
||||
int u_fpvalid;
|
||||
unsigned long u_tsize, u_dsize, u_ssize;
|
||||
unsigned long start_code, start_stack;
|
||||
long signal;
|
||||
int reserved;
|
||||
struct user_regs *u_ar0;
|
||||
unsigned long magic;
|
||||
char u_comm[32];
|
||||
int u_debugreg[8];
|
||||
struct user_fpregs u_fp;
|
||||
struct user_fpregs *u_fp0;
|
||||
};
|
|
@ -0,0 +1 @@
|
|||
#include <linux/vt.h>
|
|
@ -0,0 +1,26 @@
|
|||
#ifndef _BYTESWAP_H
|
||||
#define _BYTESWAP_H
|
||||
|
||||
#include <features.h>
|
||||
#include <stdint.h>
|
||||
|
||||
static __inline uint16_t __bswap_16(uint16_t __x)
|
||||
{
|
||||
return __x<<8 | __x>>8;
|
||||
}
|
||||
|
||||
static __inline uint32_t __bswap_32(uint32_t __x)
|
||||
{
|
||||
return __x>>24 | __x>>8&0xff00 | __x<<8&0xff0000 | __x<<24;
|
||||
}
|
||||
|
||||
static __inline uint64_t __bswap_64(uint64_t __x)
|
||||
{
|
||||
return __bswap_32(__x)+0ULL<<32 | __bswap_32(__x>>32);
|
||||
}
|
||||
|
||||
#define bswap_16(x) __bswap_16(x)
|
||||
#define bswap_32(x) __bswap_32(x)
|
||||
#define bswap_64(x) __bswap_64(x)
|
||||
|
||||
#endif
|
|
@ -0,0 +1,139 @@
|
|||
#ifndef _COMPLEX_H
|
||||
#define _COMPLEX_H
|
||||
|
||||
#ifdef __ICCARM__ /* for iar */
|
||||
#include_next <complex.h>
|
||||
#else
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define complex _Complex
|
||||
#ifdef __GNUC__
|
||||
#define _Complex_I (__extension__ (0.0f+1.0fi))
|
||||
#else
|
||||
#define _Complex_I (0.0f+1.0fi)
|
||||
#endif
|
||||
#define I _Complex_I
|
||||
|
||||
double complex cacos(double complex);
|
||||
float complex cacosf(float complex);
|
||||
long double complex cacosl(long double complex);
|
||||
|
||||
double complex casin(double complex);
|
||||
float complex casinf(float complex);
|
||||
long double complex casinl(long double complex);
|
||||
|
||||
double complex catan(double complex);
|
||||
float complex catanf(float complex);
|
||||
long double complex catanl(long double complex);
|
||||
|
||||
double complex ccos(double complex);
|
||||
float complex ccosf(float complex);
|
||||
long double complex ccosl(long double complex);
|
||||
|
||||
double complex csin(double complex);
|
||||
float complex csinf(float complex);
|
||||
long double complex csinl(long double complex);
|
||||
|
||||
double complex ctan(double complex);
|
||||
float complex ctanf(float complex);
|
||||
long double complex ctanl(long double complex);
|
||||
|
||||
double complex cacosh(double complex);
|
||||
float complex cacoshf(float complex);
|
||||
long double complex cacoshl(long double complex);
|
||||
|
||||
double complex casinh(double complex);
|
||||
float complex casinhf(float complex);
|
||||
long double complex casinhl(long double complex);
|
||||
|
||||
double complex catanh(double complex);
|
||||
float complex catanhf(float complex);
|
||||
long double complex catanhl(long double complex);
|
||||
|
||||
double complex ccosh(double complex);
|
||||
float complex ccoshf(float complex);
|
||||
long double complex ccoshl(long double complex);
|
||||
|
||||
double complex csinh(double complex);
|
||||
float complex csinhf(float complex);
|
||||
long double complex csinhl(long double complex);
|
||||
|
||||
double complex ctanh(double complex);
|
||||
float complex ctanhf(float complex);
|
||||
long double complex ctanhl(long double complex);
|
||||
|
||||
double complex cexp(double complex);
|
||||
float complex cexpf(float complex);
|
||||
long double complex cexpl(long double complex);
|
||||
|
||||
double complex clog(double complex);
|
||||
float complex clogf(float complex);
|
||||
long double complex clogl(long double complex);
|
||||
|
||||
double cabs(double complex);
|
||||
float cabsf(float complex);
|
||||
long double cabsl(long double complex);
|
||||
|
||||
double complex cpow(double complex, double complex);
|
||||
float complex cpowf(float complex, float complex);
|
||||
long double complex cpowl(long double complex, long double complex);
|
||||
|
||||
double complex csqrt(double complex);
|
||||
float complex csqrtf(float complex);
|
||||
long double complex csqrtl(long double complex);
|
||||
|
||||
double carg(double complex);
|
||||
float cargf(float complex);
|
||||
long double cargl(long double complex);
|
||||
|
||||
double cimag(double complex);
|
||||
float cimagf(float complex);
|
||||
long double cimagl(long double complex);
|
||||
|
||||
double complex conj(double complex);
|
||||
float complex conjf(float complex);
|
||||
long double complex conjl(long double complex);
|
||||
|
||||
double complex cproj(double complex);
|
||||
float complex cprojf(float complex);
|
||||
long double complex cprojl(long double complex);
|
||||
|
||||
double creal(double complex);
|
||||
float crealf(float complex);
|
||||
long double creall(long double complex);
|
||||
|
||||
#ifndef __cplusplus
|
||||
#define __CIMAG(x, t) \
|
||||
(+(union { _Complex t __z; t __xy[2]; }){(_Complex t)(x)}.__xy[1])
|
||||
|
||||
#define creal(x) ((double)(x))
|
||||
#define crealf(x) ((float)(x))
|
||||
#define creall(x) ((long double)(x))
|
||||
|
||||
#define cimag(x) __CIMAG(x, double)
|
||||
#define cimagf(x) __CIMAG(x, float)
|
||||
#define cimagl(x) __CIMAG(x, long double)
|
||||
#endif
|
||||
|
||||
#if __STDC_VERSION__ >= 201112L
|
||||
#if defined(_Imaginary_I)
|
||||
#define __CMPLX(x, y, t) ((t)(x) + _Imaginary_I*(t)(y))
|
||||
#elif defined(__clang__)
|
||||
#define __CMPLX(x, y, t) (+(_Complex t){ (t)(x), (t)(y) })
|
||||
#else
|
||||
#define __CMPLX(x, y, t) (__builtin_complex((t)(x), (t)(y)))
|
||||
#endif
|
||||
#define CMPLX(x, y) __CMPLX(x, y, double)
|
||||
#define CMPLXF(x, y) __CMPLX(x, y, float)
|
||||
#define CMPLXL(x, y) __CMPLX(x, y, long double)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ICCARM__ */
|
||||
#endif
|
|
@ -0,0 +1,29 @@
|
|||
#ifndef _CPIO_H
|
||||
#define _CPIO_H
|
||||
|
||||
#define MAGIC "070707"
|
||||
|
||||
#define C_IRUSR 000400
|
||||
#define C_IWUSR 000200
|
||||
#define C_IXUSR 000100
|
||||
#define C_IRGRP 000040
|
||||
#define C_IWGRP 000020
|
||||
#define C_IXGRP 000010
|
||||
#define C_IROTH 000004
|
||||
#define C_IWOTH 000002
|
||||
#define C_IXOTH 000001
|
||||
|
||||
#define C_ISUID 004000
|
||||
#define C_ISGID 002000
|
||||
#define C_ISVTX 001000
|
||||
|
||||
#define C_ISBLK 060000
|
||||
#define C_ISCHR 020000
|
||||
#define C_ISDIR 040000
|
||||
#define C_ISFIFO 010000
|
||||
#define C_ISSOCK 0140000
|
||||
#define C_ISLNK 0120000
|
||||
#define C_ISCTG 0110000
|
||||
#define C_ISREG 0100000
|
||||
|
||||
#endif
|
|
@ -0,0 +1,20 @@
|
|||
#ifndef _CRYPT_H
|
||||
#define _CRYPT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct crypt_data {
|
||||
int initialized;
|
||||
char __buf[256];
|
||||
};
|
||||
|
||||
char *crypt(const char *, const char *);
|
||||
char *crypt_r(const char *, const char *, struct crypt_data *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,80 @@
|
|||
#ifndef _CTYPE_H
|
||||
#define _CTYPE_H
|
||||
|
||||
#ifdef __ICCARM__ /* for iar */
|
||||
#include_next <ctype.h>
|
||||
#else
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <features.h>
|
||||
|
||||
int isalnum(int);
|
||||
int isalpha(int);
|
||||
int isblank(int);
|
||||
int iscntrl(int);
|
||||
int isdigit(int);
|
||||
int isgraph(int);
|
||||
int islower(int);
|
||||
int isprint(int);
|
||||
int ispunct(int);
|
||||
int isspace(int);
|
||||
int isupper(int);
|
||||
int isxdigit(int);
|
||||
int tolower(int);
|
||||
int toupper(int);
|
||||
|
||||
#ifndef __cplusplus
|
||||
static __inline int __isspace(int _c)
|
||||
{
|
||||
return _c == ' ' || (unsigned)_c-'\t' < 5;
|
||||
}
|
||||
|
||||
#define isalpha(a) (0 ? isalpha(a) : (((unsigned)(a)|32)-'a') < 26)
|
||||
#define isdigit(a) (0 ? isdigit(a) : ((unsigned)(a)-'0') < 10)
|
||||
#define islower(a) (0 ? islower(a) : ((unsigned)(a)-'a') < 26)
|
||||
#define isupper(a) (0 ? isupper(a) : ((unsigned)(a)-'A') < 26)
|
||||
#define isprint(a) (0 ? isprint(a) : ((unsigned)(a)-0x20) < 0x5f)
|
||||
#define isgraph(a) (0 ? isgraph(a) : ((unsigned)(a)-0x21) < 0x5e)
|
||||
#define isspace(a) __isspace(a)
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|
||||
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
|
||||
|| defined(_BSD_SOURCE)
|
||||
|
||||
#define __NEED_locale_t
|
||||
#include <bits/alltypes.h>
|
||||
|
||||
int isalnum_l(int, locale_t);
|
||||
int isalpha_l(int, locale_t);
|
||||
int isblank_l(int, locale_t);
|
||||
int iscntrl_l(int, locale_t);
|
||||
int isdigit_l(int, locale_t);
|
||||
int isgraph_l(int, locale_t);
|
||||
int islower_l(int, locale_t);
|
||||
int isprint_l(int, locale_t);
|
||||
int ispunct_l(int, locale_t);
|
||||
int isspace_l(int, locale_t);
|
||||
int isupper_l(int, locale_t);
|
||||
int isxdigit_l(int, locale_t);
|
||||
int tolower_l(int, locale_t);
|
||||
int toupper_l(int, locale_t);
|
||||
|
||||
int isascii(int);
|
||||
int toascii(int);
|
||||
#define _tolower(a) ((a)|0x20)
|
||||
#define _toupper(a) ((a)&0x5f)
|
||||
#define isascii(a) (0 ? isascii(a) : (unsigned)(a) < 128)
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ICCARM__ */
|
||||
#endif
|
|
@ -0,0 +1,75 @@
|
|||
#ifndef _DIRENT_H
|
||||
#define _DIRENT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#define __NEED_ino_t
|
||||
#define __NEED_off_t
|
||||
#if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
|
||||
#define __NEED_size_t
|
||||
#endif
|
||||
|
||||
#include <bits/alltypes.h>
|
||||
|
||||
#include <bits/dirent.h>
|
||||
|
||||
typedef struct __dirstream DIR;
|
||||
|
||||
#define d_fileno d_ino
|
||||
|
||||
int closedir(DIR *);
|
||||
DIR *fdopendir(int);
|
||||
DIR *opendir(const char *);
|
||||
struct dirent *readdir(DIR *);
|
||||
int readdir_r(DIR *__restrict, struct dirent *__restrict, struct dirent **__restrict);
|
||||
void rewinddir(DIR *);
|
||||
int dirfd(DIR *);
|
||||
|
||||
int alphasort(const struct dirent **, const struct dirent **);
|
||||
int scandir(const char *, struct dirent ***, int (*)(const struct dirent *), int (*)(const struct dirent **, const struct dirent **));
|
||||
|
||||
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
void seekdir(DIR *, long);
|
||||
long telldir(DIR *);
|
||||
#endif
|
||||
|
||||
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
#define DT_UNKNOWN 0
|
||||
#define DT_FIFO 1
|
||||
#define DT_CHR 2
|
||||
#define DT_DIR 4
|
||||
#define DT_BLK 6
|
||||
#define DT_REG 8
|
||||
#define DT_LNK 10
|
||||
#define DT_SOCK 12
|
||||
#define DT_WHT 14
|
||||
#define IFTODT(x) ((x)>>12 & 017)
|
||||
#define DTTOIF(x) ((x)<<12)
|
||||
int getdents(int, struct dirent *, size_t);
|
||||
#endif
|
||||
|
||||
#ifdef _GNU_SOURCE
|
||||
int versionsort(const struct dirent **, const struct dirent **);
|
||||
#endif
|
||||
|
||||
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
|
||||
#define dirent64 dirent
|
||||
#define readdir64 readdir
|
||||
#define readdir64_r readdir_r
|
||||
#define scandir64 scandir
|
||||
#define alphasort64 alphasort
|
||||
#define versionsort64 versionsort
|
||||
#define off64_t off_t
|
||||
#define ino64_t ino_t
|
||||
#define getdents64 getdents
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,46 @@
|
|||
#ifndef _DLFCN_H
|
||||
#define _DLFCN_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#define RTLD_LAZY 1
|
||||
#define RTLD_NOW 2
|
||||
#define RTLD_NOLOAD 4
|
||||
#define RTLD_NODELETE 4096
|
||||
#define RTLD_GLOBAL 256
|
||||
#define RTLD_LOCAL 0
|
||||
|
||||
#define RTLD_NEXT ((void *)-1)
|
||||
#define RTLD_DEFAULT ((void *)0)
|
||||
|
||||
#define RTLD_DI_LINKMAP 2
|
||||
|
||||
int dlclose(void *);
|
||||
char *dlerror(void);
|
||||
void *dlopen(const char *, int);
|
||||
void *dlsym(void *__restrict, const char *__restrict);
|
||||
|
||||
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
typedef struct {
|
||||
const char *dli_fname;
|
||||
void *dli_fbase;
|
||||
const char *dli_sname;
|
||||
void *dli_saddr;
|
||||
} Dl_info;
|
||||
int dladdr(const void *, Dl_info *);
|
||||
int dlinfo(void *, int, void *);
|
||||
#endif
|
||||
|
||||
#if _REDIR_TIME64
|
||||
__REDIR(dlsym, __dlsym_time64);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,80 @@
|
|||
#ifndef _ENDIAN_H
|
||||
#define _ENDIAN_H
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#define __NEED_uint16_t
|
||||
#define __NEED_uint32_t
|
||||
#define __NEED_uint64_t
|
||||
|
||||
#include <bits/alltypes.h>
|
||||
|
||||
#define __PDP_ENDIAN 3412
|
||||
|
||||
#define BIG_ENDIAN __BIG_ENDIAN
|
||||
#define LITTLE_ENDIAN __LITTLE_ENDIAN
|
||||
#define PDP_ENDIAN __PDP_ENDIAN
|
||||
#define BYTE_ORDER __BYTE_ORDER
|
||||
|
||||
static __inline uint16_t __bswap16(uint16_t __x)
|
||||
{
|
||||
return __x<<8 | __x>>8;
|
||||
}
|
||||
|
||||
static __inline uint32_t __bswap32(uint32_t __x)
|
||||
{
|
||||
return __x>>24 | __x>>8&0xff00 | __x<<8&0xff0000 | __x<<24;
|
||||
}
|
||||
|
||||
static __inline uint64_t __bswap64(uint64_t __x)
|
||||
{
|
||||
return __bswap32(__x)+0ULL<<32 | __bswap32(__x>>32);
|
||||
}
|
||||
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
#define htobe16(x) __bswap16(x)
|
||||
#define be16toh(x) __bswap16(x)
|
||||
#define htobe32(x) __bswap32(x)
|
||||
#define be32toh(x) __bswap32(x)
|
||||
#define htobe64(x) __bswap64(x)
|
||||
#define be64toh(x) __bswap64(x)
|
||||
#define htole16(x) (uint16_t)(x)
|
||||
#define le16toh(x) (uint16_t)(x)
|
||||
#define htole32(x) (uint32_t)(x)
|
||||
#define le32toh(x) (uint32_t)(x)
|
||||
#define htole64(x) (uint64_t)(x)
|
||||
#define le64toh(x) (uint64_t)(x)
|
||||
#else
|
||||
#define htobe16(x) (uint16_t)(x)
|
||||
#define be16toh(x) (uint16_t)(x)
|
||||
#define htobe32(x) (uint32_t)(x)
|
||||
#define be32toh(x) (uint32_t)(x)
|
||||
#define htobe64(x) (uint64_t)(x)
|
||||
#define be64toh(x) (uint64_t)(x)
|
||||
#define htole16(x) __bswap16(x)
|
||||
#define le16toh(x) __bswap16(x)
|
||||
#define htole32(x) __bswap32(x)
|
||||
#define le32toh(x) __bswap32(x)
|
||||
#define htole64(x) __bswap64(x)
|
||||
#define le64toh(x) __bswap64(x)
|
||||
#endif
|
||||
|
||||
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
#define betoh16(x) __bswap16(x)
|
||||
#define betoh32(x) __bswap32(x)
|
||||
#define betoh64(x) __bswap64(x)
|
||||
#define letoh16(x) (uint16_t)(x)
|
||||
#define letoh32(x) (uint32_t)(x)
|
||||
#define letoh64(x) (uint64_t)(x)
|
||||
#else
|
||||
#define betoh16(x) (uint16_t)(x)
|
||||
#define betoh32(x) (uint32_t)(x)
|
||||
#define betoh64(x) (uint64_t)(x)
|
||||
#define letoh16(x) __bswap16(x)
|
||||
#define letoh32(x) __bswap32(x)
|
||||
#define letoh64(x) __bswap64(x)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,25 @@
|
|||
#ifndef _ERR_H
|
||||
#define _ERR_H
|
||||
|
||||
#include <features.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void warn(const char *, ...);
|
||||
void vwarn(const char *, va_list);
|
||||
void warnx(const char *, ...);
|
||||
void vwarnx(const char *, va_list);
|
||||
|
||||
_Noreturn void err(int, const char *, ...);
|
||||
_Noreturn void verr(int, const char *, va_list);
|
||||
_Noreturn void errx(int, const char *, ...);
|
||||
_Noreturn void verrx(int, const char *, va_list);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,76 @@
|
|||
#ifndef _ERRNO_H
|
||||
#define _ERRNO_H
|
||||
|
||||
#ifdef __ICCARM__ /* for iar */
|
||||
|
||||
#include_next <errno.h>
|
||||
|
||||
#ifdef errno
|
||||
#undef errno
|
||||
#endif
|
||||
|
||||
#ifdef EDOM
|
||||
#undef EDOM
|
||||
#endif
|
||||
|
||||
#ifdef ERANGE
|
||||
#undef ERANGE
|
||||
#endif
|
||||
|
||||
#ifdef EFPOS
|
||||
#undef EFPOS
|
||||
#endif
|
||||
|
||||
#ifdef EILSEQ
|
||||
#undef EILSEQ
|
||||
#endif
|
||||
|
||||
#ifdef _NERR
|
||||
#undef _NERR
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#include <bits/errno.h>
|
||||
|
||||
#ifdef __GNUC__
|
||||
__attribute__((const))
|
||||
#endif
|
||||
int *__errno_location(void);
|
||||
#define errno (*__errno_location())
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#include <bits/errno.h>
|
||||
|
||||
#ifdef __GNUC__
|
||||
__attribute__((const))
|
||||
#endif
|
||||
int *__errno_location(void);
|
||||
#define errno (*__errno_location())
|
||||
|
||||
#ifdef _GNU_SOURCE
|
||||
extern char *program_invocation_short_name, *program_invocation_name;
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ICCARM__ */
|
||||
#endif
|
||||
|
|
@ -0,0 +1,216 @@
|
|||
#ifndef _FCNTL_H
|
||||
#define _FCNTL_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#define __NEED_off_t
|
||||
#define __NEED_pid_t
|
||||
#define __NEED_mode_t
|
||||
|
||||
#ifdef _GNU_SOURCE
|
||||
#define __NEED_size_t
|
||||
#define __NEED_ssize_t
|
||||
#define __NEED_struct_iovec
|
||||
#endif
|
||||
|
||||
#include <bits/alltypes.h>
|
||||
|
||||
#include <bits/fcntl.h>
|
||||
|
||||
struct flock {
|
||||
short l_type;
|
||||
short l_whence;
|
||||
off_t l_start;
|
||||
off_t l_len;
|
||||
pid_t l_pid;
|
||||
};
|
||||
|
||||
int creat(const char *, mode_t);
|
||||
int fcntl(int, int, ...);
|
||||
int open(const char *, int, ...);
|
||||
int openat(int, const char *, int, ...);
|
||||
int posix_fadvise(int, off_t, off_t, int);
|
||||
int posix_fallocate(int, off_t, off_t);
|
||||
|
||||
#define O_SEARCH O_PATH
|
||||
#define O_EXEC O_PATH
|
||||
#define O_TTY_INIT 0
|
||||
|
||||
#define O_ACCMODE (03|O_SEARCH)
|
||||
#define O_RDONLY 00
|
||||
#define O_WRONLY 01
|
||||
#define O_RDWR 02
|
||||
|
||||
#define F_OFD_GETLK 36
|
||||
#define F_OFD_SETLK 37
|
||||
#define F_OFD_SETLKW 38
|
||||
|
||||
#define F_DUPFD_CLOEXEC 1030
|
||||
|
||||
#define F_RDLCK 0
|
||||
#define F_WRLCK 1
|
||||
#define F_UNLCK 2
|
||||
|
||||
#define FD_CLOEXEC 1
|
||||
|
||||
#define AT_FDCWD (-100)
|
||||
#define AT_SYMLINK_NOFOLLOW 0x100
|
||||
#define AT_REMOVEDIR 0x200
|
||||
#define AT_SYMLINK_FOLLOW 0x400
|
||||
#define AT_EACCESS 0x200
|
||||
|
||||
#define POSIX_FADV_NORMAL 0
|
||||
#define POSIX_FADV_RANDOM 1
|
||||
#define POSIX_FADV_SEQUENTIAL 2
|
||||
#define POSIX_FADV_WILLNEED 3
|
||||
#ifndef POSIX_FADV_DONTNEED
|
||||
#define POSIX_FADV_DONTNEED 4
|
||||
#define POSIX_FADV_NOREUSE 5
|
||||
#endif
|
||||
|
||||
#undef SEEK_SET
|
||||
#undef SEEK_CUR
|
||||
#undef SEEK_END
|
||||
#define SEEK_SET 0
|
||||
#define SEEK_CUR 1
|
||||
#define SEEK_END 2
|
||||
|
||||
#ifndef S_IRUSR
|
||||
#define S_ISUID 04000
|
||||
#define S_ISGID 02000
|
||||
#define S_ISVTX 01000
|
||||
#define S_IRUSR 0400
|
||||
#define S_IWUSR 0200
|
||||
#define S_IXUSR 0100
|
||||
#define S_IRWXU 0700
|
||||
#define S_IRGRP 0040
|
||||
#define S_IWGRP 0020
|
||||
#define S_IXGRP 0010
|
||||
#define S_IRWXG 0070
|
||||
#define S_IROTH 0004
|
||||
#define S_IWOTH 0002
|
||||
#define S_IXOTH 0001
|
||||
#define S_IRWXO 0007
|
||||
#endif
|
||||
|
||||
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
#define AT_NO_AUTOMOUNT 0x800
|
||||
#define AT_EMPTY_PATH 0x1000
|
||||
#define AT_STATX_SYNC_TYPE 0x6000
|
||||
#define AT_STATX_SYNC_AS_STAT 0x0000
|
||||
#define AT_STATX_FORCE_SYNC 0x2000
|
||||
#define AT_STATX_DONT_SYNC 0x4000
|
||||
#define AT_RECURSIVE 0x8000
|
||||
|
||||
#define FAPPEND O_APPEND
|
||||
#define FFSYNC O_SYNC
|
||||
#define FASYNC O_ASYNC
|
||||
#define FNONBLOCK O_NONBLOCK
|
||||
#define FNDELAY O_NDELAY
|
||||
|
||||
#define F_OK 0
|
||||
#define R_OK 4
|
||||
#define W_OK 2
|
||||
#define X_OK 1
|
||||
#define F_ULOCK 0
|
||||
#define F_LOCK 1
|
||||
#define F_TLOCK 2
|
||||
#define F_TEST 3
|
||||
|
||||
#define F_SETLEASE 1024
|
||||
#define F_GETLEASE 1025
|
||||
#define F_NOTIFY 1026
|
||||
#define F_CANCELLK 1029
|
||||
#define F_SETPIPE_SZ 1031
|
||||
#define F_GETPIPE_SZ 1032
|
||||
#define F_ADD_SEALS 1033
|
||||
#define F_GET_SEALS 1034
|
||||
|
||||
#define F_SEAL_SEAL 0x0001
|
||||
#define F_SEAL_SHRINK 0x0002
|
||||
#define F_SEAL_GROW 0x0004
|
||||
#define F_SEAL_WRITE 0x0008
|
||||
#define F_SEAL_FUTURE_WRITE 0x0010
|
||||
|
||||
#define F_GET_RW_HINT 1035
|
||||
#define F_SET_RW_HINT 1036
|
||||
#define F_GET_FILE_RW_HINT 1037
|
||||
#define F_SET_FILE_RW_HINT 1038
|
||||
|
||||
#define RWF_WRITE_LIFE_NOT_SET 0
|
||||
#define RWH_WRITE_LIFE_NONE 1
|
||||
#define RWH_WRITE_LIFE_SHORT 2
|
||||
#define RWH_WRITE_LIFE_MEDIUM 3
|
||||
#define RWH_WRITE_LIFE_LONG 4
|
||||
#define RWH_WRITE_LIFE_EXTREME 5
|
||||
|
||||
#define DN_ACCESS 0x00000001
|
||||
#define DN_MODIFY 0x00000002
|
||||
#define DN_CREATE 0x00000004
|
||||
#define DN_DELETE 0x00000008
|
||||
#define DN_RENAME 0x00000010
|
||||
#define DN_ATTRIB 0x00000020
|
||||
#define DN_MULTISHOT 0x80000000
|
||||
|
||||
int lockf(int, int, off_t);
|
||||
#endif
|
||||
|
||||
#if defined(_GNU_SOURCE)
|
||||
#define F_OWNER_TID 0
|
||||
#define F_OWNER_PID 1
|
||||
#define F_OWNER_PGRP 2
|
||||
#define F_OWNER_GID 2
|
||||
struct file_handle {
|
||||
unsigned handle_bytes;
|
||||
int handle_type;
|
||||
unsigned char f_handle[];
|
||||
};
|
||||
struct f_owner_ex {
|
||||
int type;
|
||||
pid_t pid;
|
||||
};
|
||||
#define FALLOC_FL_KEEP_SIZE 1
|
||||
#define FALLOC_FL_PUNCH_HOLE 2
|
||||
#define MAX_HANDLE_SZ 128
|
||||
#define SYNC_FILE_RANGE_WAIT_BEFORE 1
|
||||
#define SYNC_FILE_RANGE_WRITE 2
|
||||
#define SYNC_FILE_RANGE_WAIT_AFTER 4
|
||||
#define SPLICE_F_MOVE 1
|
||||
#define SPLICE_F_NONBLOCK 2
|
||||
#define SPLICE_F_MORE 4
|
||||
#define SPLICE_F_GIFT 8
|
||||
int fallocate(int, int, off_t, off_t);
|
||||
#define fallocate64 fallocate
|
||||
int name_to_handle_at(int, const char *, struct file_handle *, int *, int);
|
||||
int open_by_handle_at(int, struct file_handle *, int);
|
||||
ssize_t readahead(int, off_t, size_t);
|
||||
int sync_file_range(int, off_t, off_t, unsigned);
|
||||
ssize_t vmsplice(int, const struct iovec *, size_t, unsigned);
|
||||
ssize_t splice(int, off_t *, int, off_t *, size_t, unsigned);
|
||||
ssize_t tee(int, int, size_t, unsigned);
|
||||
#define loff_t off_t
|
||||
#endif
|
||||
|
||||
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
|
||||
#define F_GETLK64 F_GETLK
|
||||
#define F_SETLK64 F_SETLK
|
||||
#define F_SETLKW64 F_SETLKW
|
||||
#define flock64 flock
|
||||
#define open64 open
|
||||
#define openat64 openat
|
||||
#define creat64 creat
|
||||
#define lockf64 lockf
|
||||
#define posix_fadvise64 posix_fadvise
|
||||
#define posix_fallocate64 posix_fallocate
|
||||
#define off64_t off_t
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,46 @@
|
|||
#ifndef _FEATURES_H
|
||||
#define _FEATURES_H
|
||||
|
||||
#if defined(_ALL_SOURCE) && !defined(_GNU_SOURCE)
|
||||
#define _GNU_SOURCE 1
|
||||
#endif
|
||||
|
||||
#if defined(_DEFAULT_SOURCE) && !defined(_BSD_SOURCE)
|
||||
#define _BSD_SOURCE 1
|
||||
#endif
|
||||
|
||||
#if !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) \
|
||||
&& !defined(_XOPEN_SOURCE) && !defined(_GNU_SOURCE) \
|
||||
&& !defined(_BSD_SOURCE) && !defined(__STRICT_ANSI__)
|
||||
#define _BSD_SOURCE 1
|
||||
#define _XOPEN_SOURCE 700
|
||||
#endif
|
||||
|
||||
#if __STDC_VERSION__ >= 199901L && !defined(__cplusplus)
|
||||
#define __restrict restrict
|
||||
#elif !defined(__GNUC__)
|
||||
#define __restrict
|
||||
#endif
|
||||
|
||||
#if __STDC_VERSION__ >= 199901L || defined(__cplusplus)
|
||||
#define __inline inline
|
||||
#elif !defined(__GNUC__)
|
||||
#define __inline
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if __cplusplus >= 201103L
|
||||
#define _Noreturn [[ noreturn ]]
|
||||
#else
|
||||
#define _Noreturn
|
||||
#endif
|
||||
#elif __STDC_VERSION__ >= 201112L
|
||||
#elif defined(__GNUC__)
|
||||
#define _Noreturn __attribute__((__noreturn__))
|
||||
#else
|
||||
#define _Noreturn
|
||||
#endif
|
||||
|
||||
#define __REDIR(x,y) __typeof__(x) x __asm__(#y)
|
||||
|
||||
#endif
|
|
@ -0,0 +1,34 @@
|
|||
#ifndef _FENV_H
|
||||
#define _FENV_H
|
||||
|
||||
#ifdef __ICCARM__ /* for iar */
|
||||
#include_next <fenv.h>
|
||||
#else
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <bits/fenv.h>
|
||||
|
||||
int feclearexcept(int);
|
||||
int fegetexceptflag(fexcept_t *, int);
|
||||
int feraiseexcept(int);
|
||||
int fesetexceptflag(const fexcept_t *, int);
|
||||
int fetestexcept(int);
|
||||
|
||||
int fegetround(void);
|
||||
int fesetround(int);
|
||||
|
||||
int fegetenv(fenv_t *);
|
||||
int feholdexcept(fenv_t *);
|
||||
int fesetenv(const fenv_t *);
|
||||
int feupdateenv(const fenv_t *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ICCARM__ */
|
||||
#endif
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
#ifndef _FLOAT_H
|
||||
#define _FLOAT_H
|
||||
|
||||
#ifdef __ICCARM__ /* for iar */
|
||||
#include_next <float.h>
|
||||
#else
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int __flt_rounds(void);
|
||||
#define FLT_ROUNDS (__flt_rounds())
|
||||
|
||||
#define FLT_RADIX 2
|
||||
|
||||
#define FLT_TRUE_MIN 1.40129846432481707092e-45F
|
||||
#define FLT_MIN 1.17549435082228750797e-38F
|
||||
#define FLT_MAX 3.40282346638528859812e+38F
|
||||
#define FLT_EPSILON 1.1920928955078125e-07F
|
||||
|
||||
#define FLT_MANT_DIG 24
|
||||
#define FLT_MIN_EXP (-125)
|
||||
#define FLT_MAX_EXP 128
|
||||
#define FLT_HAS_SUBNORM 1
|
||||
|
||||
#define FLT_DIG 6
|
||||
#define FLT_DECIMAL_DIG 9
|
||||
#define FLT_MIN_10_EXP (-37)
|
||||
#define FLT_MAX_10_EXP 38
|
||||
|
||||
#define DBL_TRUE_MIN 4.94065645841246544177e-324
|
||||
#define DBL_MIN 2.22507385850720138309e-308
|
||||
#define DBL_MAX 1.79769313486231570815e+308
|
||||
#define DBL_EPSILON 2.22044604925031308085e-16
|
||||
|
||||
#define DBL_MANT_DIG 53
|
||||
#define DBL_MIN_EXP (-1021)
|
||||
#define DBL_MAX_EXP 1024
|
||||
#define DBL_HAS_SUBNORM 1
|
||||
|
||||
#define DBL_DIG 15
|
||||
#define DBL_DECIMAL_DIG 17
|
||||
#define DBL_MIN_10_EXP (-307)
|
||||
#define DBL_MAX_10_EXP 308
|
||||
|
||||
#define LDBL_HAS_SUBNORM 1
|
||||
#define LDBL_DECIMAL_DIG DECIMAL_DIG
|
||||
|
||||
#include <bits/float.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ICCARM__ */
|
||||
#endif
|
|
@ -0,0 +1,47 @@
|
|||
#ifndef _FMTMSG_H
|
||||
#define _FMTMSG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define MM_HARD 1
|
||||
#define MM_SOFT 2
|
||||
#define MM_FIRM 4
|
||||
|
||||
#define MM_APPL 8
|
||||
#define MM_UTIL 16
|
||||
#define MM_OPSYS 32
|
||||
|
||||
#define MM_RECOVER 64
|
||||
#define MM_NRECOV 128
|
||||
|
||||
#define MM_PRINT 256
|
||||
#define MM_CONSOLE 512
|
||||
|
||||
#define MM_NULLMC 0L
|
||||
|
||||
#define MM_HALT 1
|
||||
#define MM_ERROR 2
|
||||
#define MM_WARNING 3
|
||||
#define MM_INFO 4
|
||||
#define MM_NOSEV 0
|
||||
|
||||
#define MM_OK 0
|
||||
#define MM_NOTOK (-1)
|
||||
#define MM_NOMSG 1
|
||||
#define MM_NOCON 4
|
||||
|
||||
#define MM_NULLLBL ((char*)0)
|
||||
#define MM_NULLTXT ((char*)0)
|
||||
#define MM_NULLACT ((char*)0)
|
||||
#define MM_NULLTAG ((char*)0)
|
||||
#define MM_NULLSEV 0
|
||||
|
||||
int fmtmsg(long, const char *, int, const char *, const char *, const char *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,24 @@
|
|||
#ifndef _FNMATCH_H
|
||||
#define _FNMATCH_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define FNM_PATHNAME 0x1
|
||||
#define FNM_NOESCAPE 0x2
|
||||
#define FNM_PERIOD 0x4
|
||||
#define FNM_LEADING_DIR 0x8
|
||||
#define FNM_CASEFOLD 0x10
|
||||
#define FNM_FILE_NAME FNM_PATHNAME
|
||||
|
||||
#define FNM_NOMATCH 1
|
||||
#define FNM_NOSYS (-1)
|
||||
|
||||
int fnmatch(const char *, const char *, int);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,41 @@
|
|||
#ifndef _FTW_H
|
||||
#define _FTW_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <features.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#define FTW_F 1
|
||||
#define FTW_D 2
|
||||
#define FTW_DNR 3
|
||||
#define FTW_NS 4
|
||||
#define FTW_SL 5
|
||||
#define FTW_DP 6
|
||||
#define FTW_SLN 7
|
||||
|
||||
#define FTW_PHYS 1
|
||||
#define FTW_MOUNT 2
|
||||
#define FTW_CHDIR 4
|
||||
#define FTW_DEPTH 8
|
||||
|
||||
struct FTW {
|
||||
int base;
|
||||
int level;
|
||||
};
|
||||
|
||||
int ftw(const char *, int (*)(const char *, const struct stat *, int), int);
|
||||
int nftw(const char *, int (*)(const char *, const struct stat *, int, struct FTW *), int, int);
|
||||
|
||||
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
|
||||
#define ftw64 ftw
|
||||
#define nftw64 nftw
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,30 @@
|
|||
#ifndef _GETOPT_H
|
||||
#define _GETOPT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int getopt(int, char * const [], const char *);
|
||||
extern char *optarg;
|
||||
extern int optind, opterr, optopt, optreset;
|
||||
|
||||
struct option {
|
||||
const char *name;
|
||||
int has_arg;
|
||||
int *flag;
|
||||
int val;
|
||||
};
|
||||
|
||||
int getopt_long(int, char *const *, const char *, const struct option *, int *);
|
||||
int getopt_long_only(int, char *const *, const char *, const struct option *, int *);
|
||||
|
||||
#define no_argument 0
|
||||
#define required_argument 1
|
||||
#define optional_argument 2
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,52 @@
|
|||
#ifndef _GLOB_H
|
||||
#define _GLOB_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#define __NEED_size_t
|
||||
|
||||
#include <bits/alltypes.h>
|
||||
|
||||
typedef struct {
|
||||
size_t gl_pathc;
|
||||
char **gl_pathv;
|
||||
size_t gl_offs;
|
||||
int __dummy1;
|
||||
void *__dummy2[5];
|
||||
} glob_t;
|
||||
|
||||
int glob(const char *__restrict, int, int (*)(const char *, int), glob_t *__restrict);
|
||||
void globfree(glob_t *);
|
||||
|
||||
#define GLOB_ERR 0x01
|
||||
#define GLOB_MARK 0x02
|
||||
#define GLOB_NOSORT 0x04
|
||||
#define GLOB_DOOFFS 0x08
|
||||
#define GLOB_NOCHECK 0x10
|
||||
#define GLOB_APPEND 0x20
|
||||
#define GLOB_NOESCAPE 0x40
|
||||
#define GLOB_PERIOD 0x80
|
||||
|
||||
#define GLOB_TILDE 0x1000
|
||||
#define GLOB_TILDE_CHECK 0x4000
|
||||
|
||||
#define GLOB_NOSPACE 1
|
||||
#define GLOB_ABORTED 2
|
||||
#define GLOB_NOMATCH 3
|
||||
#define GLOB_NOSYS 4
|
||||
|
||||
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
|
||||
#define glob64 glob
|
||||
#define globfree64 globfree
|
||||
#define glob64_t glob_t
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,53 @@
|
|||
#ifndef _GRP_H
|
||||
#define _GRP_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#define __NEED_size_t
|
||||
#define __NEED_gid_t
|
||||
|
||||
#ifdef _GNU_SOURCE
|
||||
#define __NEED_FILE
|
||||
#endif
|
||||
|
||||
#include <bits/alltypes.h>
|
||||
|
||||
struct group {
|
||||
char *gr_name;
|
||||
char *gr_passwd;
|
||||
gid_t gr_gid;
|
||||
char **gr_mem;
|
||||
};
|
||||
|
||||
struct group *getgrgid(gid_t);
|
||||
struct group *getgrnam(const char *);
|
||||
|
||||
int getgrgid_r(gid_t, struct group *, char *, size_t, struct group **);
|
||||
int getgrnam_r(const char *, struct group *, char *, size_t, struct group **);
|
||||
|
||||
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
struct group *getgrent(void);
|
||||
void endgrent(void);
|
||||
void setgrent(void);
|
||||
#endif
|
||||
|
||||
#ifdef _GNU_SOURCE
|
||||
struct group *fgetgrent(FILE *);
|
||||
int putgrent(const struct group *, FILE *);
|
||||
#endif
|
||||
|
||||
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
int getgrouplist(const char *, gid_t, gid_t *, int *);
|
||||
int setgroups(size_t, const gid_t *);
|
||||
int initgroups(const char *, gid_t);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,24 @@
|
|||
#ifndef _ICONV_H
|
||||
#define _ICONV_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#define __NEED_size_t
|
||||
|
||||
#include <bits/alltypes.h>
|
||||
|
||||
typedef void *iconv_t;
|
||||
|
||||
iconv_t iconv_open(const char *, const char *);
|
||||
size_t iconv(iconv_t, char **__restrict, size_t *__restrict, char **__restrict, size_t *__restrict);
|
||||
int iconv_close(iconv_t);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,35 @@
|
|||
#ifndef _IFADDRS_H
|
||||
#define _IFADDRS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <features.h>
|
||||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
struct ifaddrs {
|
||||
struct ifaddrs *ifa_next;
|
||||
char *ifa_name;
|
||||
unsigned ifa_flags;
|
||||
struct sockaddr *ifa_addr;
|
||||
struct sockaddr *ifa_netmask;
|
||||
union {
|
||||
struct sockaddr *ifu_broadaddr;
|
||||
struct sockaddr *ifu_dstaddr;
|
||||
} ifa_ifu;
|
||||
void *ifa_data;
|
||||
};
|
||||
#define ifa_broadaddr ifa_ifu.ifu_broadaddr
|
||||
#define ifa_dstaddr ifa_ifu.ifu_dstaddr
|
||||
|
||||
void freeifaddrs(struct ifaddrs *);
|
||||
int getifaddrs(struct ifaddrs **);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,234 @@
|
|||
#ifndef _INTTYPES_H
|
||||
#define _INTTYPES_H
|
||||
|
||||
#ifdef __ICCARM__ /* for iar */
|
||||
#include_next <inttypes.h>
|
||||
#else
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <features.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define __NEED_wchar_t
|
||||
#include <bits/alltypes.h>
|
||||
|
||||
typedef struct { intmax_t quot, rem; } imaxdiv_t;
|
||||
|
||||
intmax_t imaxabs(intmax_t);
|
||||
imaxdiv_t imaxdiv(intmax_t, intmax_t);
|
||||
|
||||
intmax_t strtoimax(const char *__restrict, char **__restrict, int);
|
||||
uintmax_t strtoumax(const char *__restrict, char **__restrict, int);
|
||||
|
||||
intmax_t wcstoimax(const wchar_t *__restrict, wchar_t **__restrict, int);
|
||||
uintmax_t wcstoumax(const wchar_t *__restrict, wchar_t **__restrict, int);
|
||||
|
||||
#if UINTPTR_MAX == UINT64_MAX
|
||||
#define __PRI64 "l"
|
||||
#define __PRIPTR "l"
|
||||
#else
|
||||
#define __PRI64 "ll"
|
||||
#define __PRIPTR ""
|
||||
#endif
|
||||
|
||||
#define PRId8 "d"
|
||||
#define PRId16 "d"
|
||||
#define PRId32 "d"
|
||||
#define PRId64 __PRI64 "d"
|
||||
|
||||
#define PRIdLEAST8 "d"
|
||||
#define PRIdLEAST16 "d"
|
||||
#define PRIdLEAST32 "d"
|
||||
#define PRIdLEAST64 __PRI64 "d"
|
||||
|
||||
#define PRIdFAST8 "d"
|
||||
#define PRIdFAST16 "d"
|
||||
#define PRIdFAST32 "d"
|
||||
#define PRIdFAST64 __PRI64 "d"
|
||||
|
||||
#define PRIi8 "i"
|
||||
#define PRIi16 "i"
|
||||
#define PRIi32 "i"
|
||||
#define PRIi64 __PRI64 "i"
|
||||
|
||||
#define PRIiLEAST8 "i"
|
||||
#define PRIiLEAST16 "i"
|
||||
#define PRIiLEAST32 "i"
|
||||
#define PRIiLEAST64 __PRI64 "i"
|
||||
|
||||
#define PRIiFAST8 "i"
|
||||
#define PRIiFAST16 "i"
|
||||
#define PRIiFAST32 "i"
|
||||
#define PRIiFAST64 __PRI64 "i"
|
||||
|
||||
#define PRIo8 "o"
|
||||
#define PRIo16 "o"
|
||||
#define PRIo32 "o"
|
||||
#define PRIo64 __PRI64 "o"
|
||||
|
||||
#define PRIoLEAST8 "o"
|
||||
#define PRIoLEAST16 "o"
|
||||
#define PRIoLEAST32 "o"
|
||||
#define PRIoLEAST64 __PRI64 "o"
|
||||
|
||||
#define PRIoFAST8 "o"
|
||||
#define PRIoFAST16 "o"
|
||||
#define PRIoFAST32 "o"
|
||||
#define PRIoFAST64 __PRI64 "o"
|
||||
|
||||
#define PRIu8 "u"
|
||||
#define PRIu16 "u"
|
||||
#define PRIu32 "u"
|
||||
#define PRIu64 __PRI64 "u"
|
||||
|
||||
#define PRIuLEAST8 "u"
|
||||
#define PRIuLEAST16 "u"
|
||||
#define PRIuLEAST32 "u"
|
||||
#define PRIuLEAST64 __PRI64 "u"
|
||||
|
||||
#define PRIuFAST8 "u"
|
||||
#define PRIuFAST16 "u"
|
||||
#define PRIuFAST32 "u"
|
||||
#define PRIuFAST64 __PRI64 "u"
|
||||
|
||||
#define PRIx8 "x"
|
||||
#define PRIx16 "x"
|
||||
#define PRIx32 "x"
|
||||
#define PRIx64 __PRI64 "x"
|
||||
|
||||
#define PRIxLEAST8 "x"
|
||||
#define PRIxLEAST16 "x"
|
||||
#define PRIxLEAST32 "x"
|
||||
#define PRIxLEAST64 __PRI64 "x"
|
||||
|
||||
#define PRIxFAST8 "x"
|
||||
#define PRIxFAST16 "x"
|
||||
#define PRIxFAST32 "x"
|
||||
#define PRIxFAST64 __PRI64 "x"
|
||||
|
||||
#define PRIX8 "X"
|
||||
#define PRIX16 "X"
|
||||
#define PRIX32 "X"
|
||||
#define PRIX64 __PRI64 "X"
|
||||
|
||||
#define PRIXLEAST8 "X"
|
||||
#define PRIXLEAST16 "X"
|
||||
#define PRIXLEAST32 "X"
|
||||
#define PRIXLEAST64 __PRI64 "X"
|
||||
|
||||
#define PRIXFAST8 "X"
|
||||
#define PRIXFAST16 "X"
|
||||
#define PRIXFAST32 "X"
|
||||
#define PRIXFAST64 __PRI64 "X"
|
||||
|
||||
#define PRIdMAX __PRI64 "d"
|
||||
#define PRIiMAX __PRI64 "i"
|
||||
#define PRIoMAX __PRI64 "o"
|
||||
#define PRIuMAX __PRI64 "u"
|
||||
#define PRIxMAX __PRI64 "x"
|
||||
#define PRIXMAX __PRI64 "X"
|
||||
|
||||
#define PRIdPTR __PRIPTR "d"
|
||||
#define PRIiPTR __PRIPTR "i"
|
||||
#define PRIoPTR __PRIPTR "o"
|
||||
#define PRIuPTR __PRIPTR "u"
|
||||
#define PRIxPTR __PRIPTR "x"
|
||||
#define PRIXPTR __PRIPTR "X"
|
||||
|
||||
#define SCNd8 "hhd"
|
||||
#define SCNd16 "hd"
|
||||
#define SCNd32 "d"
|
||||
#define SCNd64 __PRI64 "d"
|
||||
|
||||
#define SCNdLEAST8 "hhd"
|
||||
#define SCNdLEAST16 "hd"
|
||||
#define SCNdLEAST32 "d"
|
||||
#define SCNdLEAST64 __PRI64 "d"
|
||||
|
||||
#define SCNdFAST8 "hhd"
|
||||
#define SCNdFAST16 "d"
|
||||
#define SCNdFAST32 "d"
|
||||
#define SCNdFAST64 __PRI64 "d"
|
||||
|
||||
#define SCNi8 "hhi"
|
||||
#define SCNi16 "hi"
|
||||
#define SCNi32 "i"
|
||||
#define SCNi64 __PRI64 "i"
|
||||
|
||||
#define SCNiLEAST8 "hhi"
|
||||
#define SCNiLEAST16 "hi"
|
||||
#define SCNiLEAST32 "i"
|
||||
#define SCNiLEAST64 __PRI64 "i"
|
||||
|
||||
#define SCNiFAST8 "hhi"
|
||||
#define SCNiFAST16 "i"
|
||||
#define SCNiFAST32 "i"
|
||||
#define SCNiFAST64 __PRI64 "i"
|
||||
|
||||
#define SCNu8 "hhu"
|
||||
#define SCNu16 "hu"
|
||||
#define SCNu32 "u"
|
||||
#define SCNu64 __PRI64 "u"
|
||||
|
||||
#define SCNuLEAST8 "hhu"
|
||||
#define SCNuLEAST16 "hu"
|
||||
#define SCNuLEAST32 "u"
|
||||
#define SCNuLEAST64 __PRI64 "u"
|
||||
|
||||
#define SCNuFAST8 "hhu"
|
||||
#define SCNuFAST16 "u"
|
||||
#define SCNuFAST32 "u"
|
||||
#define SCNuFAST64 __PRI64 "u"
|
||||
|
||||
#define SCNo8 "hho"
|
||||
#define SCNo16 "ho"
|
||||
#define SCNo32 "o"
|
||||
#define SCNo64 __PRI64 "o"
|
||||
|
||||
#define SCNoLEAST8 "hho"
|
||||
#define SCNoLEAST16 "ho"
|
||||
#define SCNoLEAST32 "o"
|
||||
#define SCNoLEAST64 __PRI64 "o"
|
||||
|
||||
#define SCNoFAST8 "hho"
|
||||
#define SCNoFAST16 "o"
|
||||
#define SCNoFAST32 "o"
|
||||
#define SCNoFAST64 __PRI64 "o"
|
||||
|
||||
#define SCNx8 "hhx"
|
||||
#define SCNx16 "hx"
|
||||
#define SCNx32 "x"
|
||||
#define SCNx64 __PRI64 "x"
|
||||
|
||||
#define SCNxLEAST8 "hhx"
|
||||
#define SCNxLEAST16 "hx"
|
||||
#define SCNxLEAST32 "x"
|
||||
#define SCNxLEAST64 __PRI64 "x"
|
||||
|
||||
#define SCNxFAST8 "hhx"
|
||||
#define SCNxFAST16 "x"
|
||||
#define SCNxFAST32 "x"
|
||||
#define SCNxFAST64 __PRI64 "x"
|
||||
|
||||
#define SCNdMAX __PRI64 "d"
|
||||
#define SCNiMAX __PRI64 "i"
|
||||
#define SCNoMAX __PRI64 "o"
|
||||
#define SCNuMAX __PRI64 "u"
|
||||
#define SCNxMAX __PRI64 "x"
|
||||
|
||||
#define SCNdPTR __PRIPTR "d"
|
||||
#define SCNiPTR __PRIPTR "i"
|
||||
#define SCNoPTR __PRIPTR "o"
|
||||
#define SCNuPTR __PRIPTR "u"
|
||||
#define SCNxPTR __PRIPTR "x"
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ICCARM__ */
|
||||
#endif
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
#ifndef _ISO646_H
|
||||
#define _ISO646_H
|
||||
|
||||
#ifdef __ICCARM__ /* for iar */
|
||||
#include_next <iso646.h>
|
||||
#else
|
||||
|
||||
#ifndef __cplusplus
|
||||
|
||||
#define and &&
|
||||
#define and_eq &=
|
||||
#define bitand &
|
||||
#define bitor |
|
||||
#define compl ~
|
||||
#define not !
|
||||
#define not_eq !=
|
||||
#define or ||
|
||||
#define or_eq |=
|
||||
#define xor ^
|
||||
#define xor_eq ^=
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __ICCARM__ */
|
||||
#endif
|
|
@ -0,0 +1,98 @@
|
|||
#ifndef _LANGINFO_H
|
||||
#define _LANGINFO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <features.h>
|
||||
#include <nl_types.h>
|
||||
|
||||
#define __NEED_locale_t
|
||||
|
||||
#include <bits/alltypes.h>
|
||||
|
||||
#define ABDAY_1 0x20000
|
||||
#define ABDAY_2 0x20001
|
||||
#define ABDAY_3 0x20002
|
||||
#define ABDAY_4 0x20003
|
||||
#define ABDAY_5 0x20004
|
||||
#define ABDAY_6 0x20005
|
||||
#define ABDAY_7 0x20006
|
||||
|
||||
#define DAY_1 0x20007
|
||||
#define DAY_2 0x20008
|
||||
#define DAY_3 0x20009
|
||||
#define DAY_4 0x2000A
|
||||
#define DAY_5 0x2000B
|
||||
#define DAY_6 0x2000C
|
||||
#define DAY_7 0x2000D
|
||||
|
||||
#define ABMON_1 0x2000E
|
||||
#define ABMON_2 0x2000F
|
||||
#define ABMON_3 0x20010
|
||||
#define ABMON_4 0x20011
|
||||
#define ABMON_5 0x20012
|
||||
#define ABMON_6 0x20013
|
||||
#define ABMON_7 0x20014
|
||||
#define ABMON_8 0x20015
|
||||
#define ABMON_9 0x20016
|
||||
#define ABMON_10 0x20017
|
||||
#define ABMON_11 0x20018
|
||||
#define ABMON_12 0x20019
|
||||
|
||||
#define MON_1 0x2001A
|
||||
#define MON_2 0x2001B
|
||||
#define MON_3 0x2001C
|
||||
#define MON_4 0x2001D
|
||||
#define MON_5 0x2001E
|
||||
#define MON_6 0x2001F
|
||||
#define MON_7 0x20020
|
||||
#define MON_8 0x20021
|
||||
#define MON_9 0x20022
|
||||
#define MON_10 0x20023
|
||||
#define MON_11 0x20024
|
||||
#define MON_12 0x20025
|
||||
|
||||
#define AM_STR 0x20026
|
||||
#define PM_STR 0x20027
|
||||
|
||||
#define D_T_FMT 0x20028
|
||||
#define D_FMT 0x20029
|
||||
#define T_FMT 0x2002A
|
||||
#define T_FMT_AMPM 0x2002B
|
||||
|
||||
#define ERA 0x2002C
|
||||
#define ERA_D_FMT 0x2002E
|
||||
#define ALT_DIGITS 0x2002F
|
||||
#define ERA_D_T_FMT 0x20030
|
||||
#define ERA_T_FMT 0x20031
|
||||
|
||||
#define CODESET 14
|
||||
|
||||
#define CRNCYSTR 0x4000F
|
||||
|
||||
#define RADIXCHAR 0x10000
|
||||
#define THOUSEP 0x10001
|
||||
#define YESEXPR 0x50000
|
||||
#define NOEXPR 0x50001
|
||||
|
||||
#define _NL_LOCALE_NAME(cat) (((cat)<<16) | 0xffff)
|
||||
|
||||
#if defined(_GNU_SOURCE)
|
||||
#define NL_LOCALE_NAME(cat) _NL_LOCALE_NAME(cat)
|
||||
#endif
|
||||
|
||||
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
#define YESSTR 0x50002
|
||||
#define NOSTR 0x50003
|
||||
#endif
|
||||
|
||||
char *nl_langinfo(nl_item);
|
||||
char *nl_langinfo_l(nl_item, locale_t);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1 @@
|
|||
#include <utmp.h>
|
|
@ -0,0 +1,15 @@
|
|||
#ifndef _LIBGEN_H
|
||||
#define _LIBGEN_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
char *dirname(char *);
|
||||
char *basename(char *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,33 @@
|
|||
#ifndef _LIBINTL_H
|
||||
#define _LIBINTL_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define __USE_GNU_GETTEXT 1
|
||||
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 1 : -1)
|
||||
|
||||
#if __GNUC__ >= 3
|
||||
#define __fa(n) __attribute__ ((__format_arg__ (n)))
|
||||
#else
|
||||
#define __fa(n)
|
||||
#endif
|
||||
|
||||
char *gettext(const char *) __fa(1);
|
||||
char *dgettext(const char *, const char *) __fa(2);
|
||||
char *dcgettext(const char *, const char *, int) __fa(2);
|
||||
char *ngettext(const char *, const char *, unsigned long) __fa(1) __fa(2);
|
||||
char *dngettext(const char *, const char *, const char *, unsigned long) __fa(2) __fa(3);
|
||||
char *dcngettext(const char *, const char *, const char *, unsigned long, int) __fa(2) __fa(3);
|
||||
char *textdomain(const char *);
|
||||
char *bindtextdomain (const char *, const char *);
|
||||
char *bind_textdomain_codeset(const char *, const char *);
|
||||
|
||||
#undef __fa
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,171 @@
|
|||
#ifndef _LIMITS_H
|
||||
#define _LIMITS_H
|
||||
|
||||
#ifdef __ICCARM__ /* for iar */
|
||||
#include_next <limits.h>
|
||||
#else
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#include <bits/alltypes.h> /* __LONG_MAX */
|
||||
|
||||
/* Support signed or unsigned plain-char */
|
||||
|
||||
#if '\xff' > 0
|
||||
#define CHAR_MIN 0
|
||||
#define CHAR_MAX 255
|
||||
#else
|
||||
#define CHAR_MIN (-128)
|
||||
#define CHAR_MAX 127
|
||||
#endif
|
||||
|
||||
#define CHAR_BIT 8
|
||||
#define SCHAR_MIN (-128)
|
||||
#define SCHAR_MAX 127
|
||||
#define UCHAR_MAX 255
|
||||
#define SHRT_MIN (-1-0x7fff)
|
||||
#define SHRT_MAX 0x7fff
|
||||
#define USHRT_MAX 0xffff
|
||||
#define INT_MIN (-1-0x7fffffff)
|
||||
#define INT_MAX 0x7fffffff
|
||||
#define UINT_MAX 0xffffffffU
|
||||
#define LONG_MIN (-LONG_MAX-1)
|
||||
#define LONG_MAX __LONG_MAX
|
||||
#define ULONG_MAX (2UL*LONG_MAX+1)
|
||||
#define LLONG_MIN (-LLONG_MAX-1)
|
||||
#define LLONG_MAX 0x7fffffffffffffffLL
|
||||
#define ULLONG_MAX (2ULL*LLONG_MAX+1)
|
||||
|
||||
#define MB_LEN_MAX 4
|
||||
|
||||
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|
||||
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
|
||||
#include <bits/limits.h>
|
||||
|
||||
#define PIPE_BUF 4096
|
||||
#define FILESIZEBITS 64
|
||||
#ifndef NAME_MAX
|
||||
#define NAME_MAX 255
|
||||
#endif
|
||||
#define PATH_MAX 4096
|
||||
#define NGROUPS_MAX 32
|
||||
#define ARG_MAX 131072
|
||||
#define IOV_MAX 1024
|
||||
#define SYMLOOP_MAX 40
|
||||
#define WORD_BIT 32
|
||||
#define SSIZE_MAX LONG_MAX
|
||||
#define TZNAME_MAX 6
|
||||
#define TTY_NAME_MAX 32
|
||||
#define HOST_NAME_MAX 255
|
||||
|
||||
#if LONG_MAX == 0x7fffffffL
|
||||
#define LONG_BIT 32
|
||||
#else
|
||||
#define LONG_BIT 64
|
||||
#endif
|
||||
|
||||
/* Implementation choices... */
|
||||
|
||||
#define PTHREAD_KEYS_MAX 128
|
||||
#define PTHREAD_STACK_MIN 2048
|
||||
#define PTHREAD_DESTRUCTOR_ITERATIONS 4
|
||||
#define SEM_VALUE_MAX 0x7fffffff
|
||||
#define SEM_NSEMS_MAX 256
|
||||
#define DELAYTIMER_MAX 0x7fffffff
|
||||
#define MQ_PRIO_MAX 32768
|
||||
#define LOGIN_NAME_MAX 256
|
||||
|
||||
/* Arbitrary numbers... */
|
||||
|
||||
#define BC_BASE_MAX 99
|
||||
#define BC_DIM_MAX 2048
|
||||
#define BC_SCALE_MAX 99
|
||||
#define BC_STRING_MAX 1000
|
||||
#define CHARCLASS_NAME_MAX 14
|
||||
#define COLL_WEIGHTS_MAX 2
|
||||
#define EXPR_NEST_MAX 32
|
||||
#define LINE_MAX 4096
|
||||
#define RE_DUP_MAX 255
|
||||
|
||||
#define NL_ARGMAX 9
|
||||
#define NL_MSGMAX 32767
|
||||
#define NL_SETMAX 255
|
||||
#define NL_TEXTMAX 2048
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_XOPEN_SOURCE)
|
||||
|
||||
#ifdef PAGESIZE
|
||||
#define PAGE_SIZE PAGESIZE
|
||||
#endif
|
||||
#define NZERO 20
|
||||
#define NL_LANGMAX 32
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) \
|
||||
|| (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE+0 < 700)
|
||||
|
||||
#define NL_NMAX 16
|
||||
|
||||
#endif
|
||||
|
||||
/* POSIX/SUS requirements follow. These numbers come directly
|
||||
* from SUS and have nothing to do with the host system. */
|
||||
|
||||
#define _POSIX_AIO_LISTIO_MAX 2
|
||||
#define _POSIX_AIO_MAX 1
|
||||
#define _POSIX_ARG_MAX 4096
|
||||
#define _POSIX_CHILD_MAX 25
|
||||
#define _POSIX_CLOCKRES_MIN 20000000
|
||||
#define _POSIX_DELAYTIMER_MAX 32
|
||||
#define _POSIX_HOST_NAME_MAX 255
|
||||
#define _POSIX_LINK_MAX 8
|
||||
#define _POSIX_LOGIN_NAME_MAX 9
|
||||
#define _POSIX_MAX_CANON 255
|
||||
#define _POSIX_MAX_INPUT 255
|
||||
#define _POSIX_MQ_OPEN_MAX 8
|
||||
#define _POSIX_MQ_PRIO_MAX 32
|
||||
#define _POSIX_NAME_MAX 14
|
||||
#define _POSIX_NGROUPS_MAX 8
|
||||
#define _POSIX_OPEN_MAX 20
|
||||
#define _POSIX_PATH_MAX 256
|
||||
#define _POSIX_PIPE_BUF 512
|
||||
#define _POSIX_RE_DUP_MAX 255
|
||||
#define _POSIX_RTSIG_MAX 8
|
||||
#define _POSIX_SEM_NSEMS_MAX 256
|
||||
#define _POSIX_SEM_VALUE_MAX 32767
|
||||
#define _POSIX_SIGQUEUE_MAX 32
|
||||
#define _POSIX_SSIZE_MAX 32767
|
||||
#define _POSIX_STREAM_MAX 8
|
||||
#define _POSIX_SS_REPL_MAX 4
|
||||
#define _POSIX_SYMLINK_MAX 255
|
||||
#define _POSIX_SYMLOOP_MAX 8
|
||||
#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
|
||||
#define _POSIX_THREAD_KEYS_MAX 128
|
||||
#define _POSIX_THREAD_THREADS_MAX 64
|
||||
#define _POSIX_TIMER_MAX 32
|
||||
#define _POSIX_TRACE_EVENT_NAME_MAX 30
|
||||
#define _POSIX_TRACE_NAME_MAX 8
|
||||
#define _POSIX_TRACE_SYS_MAX 8
|
||||
#define _POSIX_TRACE_USER_EVENT_MAX 32
|
||||
#define _POSIX_TTY_NAME_MAX 9
|
||||
#define _POSIX_TZNAME_MAX 6
|
||||
#define _POSIX2_BC_BASE_MAX 99
|
||||
#define _POSIX2_BC_DIM_MAX 2048
|
||||
#define _POSIX2_BC_SCALE_MAX 99
|
||||
#define _POSIX2_BC_STRING_MAX 1000
|
||||
#define _POSIX2_CHARCLASS_NAME_MAX 14
|
||||
#define _POSIX2_COLL_WEIGHTS_MAX 2
|
||||
#define _POSIX2_EXPR_NEST_MAX 32
|
||||
#define _POSIX2_LINE_MAX 2048
|
||||
#define _POSIX2_RE_DUP_MAX 255
|
||||
|
||||
#define _XOPEN_IOV_MAX 16
|
||||
#define _XOPEN_NAME_MAX 255
|
||||
#define _XOPEN_PATH_MAX 1024
|
||||
|
||||
#endif /* __ICCARM__ */
|
||||
#endif
|
|
@ -0,0 +1,53 @@
|
|||
#ifndef _LINK_H
|
||||
#define _LINK_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <elf.h>
|
||||
#define __NEED_size_t
|
||||
#define __NEED_uint32_t
|
||||
#include <bits/alltypes.h>
|
||||
|
||||
#if UINTPTR_MAX > 0xffffffff
|
||||
#define ElfW(type) Elf64_ ## type
|
||||
#else
|
||||
#define ElfW(type) Elf32_ ## type
|
||||
#endif
|
||||
|
||||
#include <bits/link.h>
|
||||
|
||||
struct dl_phdr_info {
|
||||
ElfW(Addr) dlpi_addr;
|
||||
const char *dlpi_name;
|
||||
const ElfW(Phdr) *dlpi_phdr;
|
||||
ElfW(Half) dlpi_phnum;
|
||||
unsigned long long int dlpi_adds;
|
||||
unsigned long long int dlpi_subs;
|
||||
size_t dlpi_tls_modid;
|
||||
void *dlpi_tls_data;
|
||||
};
|
||||
|
||||
struct link_map {
|
||||
ElfW(Addr) l_addr;
|
||||
char *l_name;
|
||||
ElfW(Dyn) *l_ld;
|
||||
struct link_map *l_next, *l_prev;
|
||||
};
|
||||
|
||||
struct r_debug {
|
||||
int r_version;
|
||||
struct link_map *r_map;
|
||||
ElfW(Addr) r_brk;
|
||||
enum { RT_CONSISTENT, RT_ADD, RT_DELETE } r_state;
|
||||
ElfW(Addr) r_ldbase;
|
||||
};
|
||||
|
||||
int dl_iterate_phdr(int (*)(struct dl_phdr_info *, size_t, void *), void *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,91 @@
|
|||
/*
|
||||
* This header was generated from the Linux kernel headers by update_headers.py,
|
||||
* to provide necessary information from kernel to userspace, such as constants,
|
||||
* structures, and macros, and thus, contains no copyrightable information.
|
||||
*/
|
||||
#ifndef _UAPI_LINUX_CAPABILITY_H
|
||||
#define _UAPI_LINUX_CAPABILITY_H
|
||||
#include <linux/types.h>
|
||||
struct task_struct;
|
||||
#define _LINUX_CAPABILITY_VERSION_1 0x19980330
|
||||
#define _LINUX_CAPABILITY_U32S_1 1
|
||||
#define _LINUX_CAPABILITY_VERSION_2 0x20071026
|
||||
#define _LINUX_CAPABILITY_U32S_2 2
|
||||
#define _LINUX_CAPABILITY_VERSION_3 0x20080522
|
||||
#define _LINUX_CAPABILITY_U32S_3 2
|
||||
typedef struct __user_cap_header_struct {
|
||||
__u32 version;
|
||||
int pid;
|
||||
} __user *cap_user_header_t;
|
||||
typedef struct __user_cap_data_struct {
|
||||
__u32 effective;
|
||||
__u32 permitted;
|
||||
__u32 inheritable;
|
||||
} __user *cap_user_data_t;
|
||||
#define VFS_CAP_REVISION_MASK 0xFF000000
|
||||
#define VFS_CAP_REVISION_SHIFT 24
|
||||
#define VFS_CAP_FLAGS_MASK ~VFS_CAP_REVISION_MASK
|
||||
#define VFS_CAP_FLAGS_EFFECTIVE 0x000001
|
||||
#define VFS_CAP_REVISION_1 0x01000000
|
||||
#define VFS_CAP_U32_1 1
|
||||
#define XATTR_CAPS_SZ_1 (sizeof(__le32)*(1 + 2*VFS_CAP_U32_1))
|
||||
#define VFS_CAP_REVISION_2 0x02000000
|
||||
#define VFS_CAP_U32_2 2
|
||||
#define XATTR_CAPS_SZ_2 (sizeof(__le32)*(1 + 2*VFS_CAP_U32_2))
|
||||
#define XATTR_CAPS_SZ XATTR_CAPS_SZ_2
|
||||
#define VFS_CAP_U32 VFS_CAP_U32_2
|
||||
#define VFS_CAP_REVISION VFS_CAP_REVISION_2
|
||||
struct vfs_cap_data {
|
||||
__le32 magic_etc;
|
||||
struct {
|
||||
__le32 permitted;
|
||||
__le32 inheritable;
|
||||
} data[VFS_CAP_U32];
|
||||
};
|
||||
#ifndef __KERNEL__
|
||||
#define _LINUX_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_1
|
||||
#define _LINUX_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_1
|
||||
#endif
|
||||
#define CAP_CHOWN 0
|
||||
#define CAP_DAC_OVERRIDE 1
|
||||
#define CAP_DAC_READ_SEARCH 2
|
||||
#define CAP_FOWNER 3
|
||||
#define CAP_FSETID 4
|
||||
#define CAP_KILL 5
|
||||
#define CAP_SETGID 6
|
||||
#define CAP_SETUID 7
|
||||
#define CAP_SETPCAP 8
|
||||
#define CAP_LINUX_IMMUTABLE 9
|
||||
#define CAP_NET_BIND_SERVICE 10
|
||||
#define CAP_NET_BROADCAST 11
|
||||
#define CAP_NET_ADMIN 12
|
||||
#define CAP_NET_RAW 13
|
||||
#define CAP_IPC_LOCK 14
|
||||
#define CAP_IPC_OWNER 15
|
||||
#define CAP_SYS_MODULE 16
|
||||
#define CAP_SYS_RAWIO 17
|
||||
#define CAP_SYS_CHROOT 18
|
||||
#define CAP_SYS_PTRACE 19
|
||||
#define CAP_SYS_PACCT 20
|
||||
#define CAP_SYS_ADMIN 21
|
||||
#define CAP_SYS_BOOT 22
|
||||
#define CAP_SYS_NICE 23
|
||||
#define CAP_SYS_RESOURCE 24
|
||||
#define CAP_SYS_TIME 25
|
||||
#define CAP_SYS_TTY_CONFIG 26
|
||||
#define CAP_MKNOD 27
|
||||
#define CAP_LEASE 28
|
||||
#define CAP_AUDIT_WRITE 29
|
||||
#define CAP_AUDIT_CONTROL 30
|
||||
#define CAP_SETFCAP 31
|
||||
#define CAP_MAC_OVERRIDE 32
|
||||
#define CAP_MAC_ADMIN 33
|
||||
#define CAP_SYSLOG 34
|
||||
#define CAP_WAKE_ALARM 35
|
||||
#define CAP_BLOCK_SUSPEND 36
|
||||
#define CAP_AUDIT_READ 37
|
||||
#define CAP_LAST_CAP CAP_AUDIT_READ
|
||||
#define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)
|
||||
#define CAP_TO_INDEX(x) ((x) >> 5)
|
||||
#define CAP_TO_MASK(x) (1 << ((x) & 31))
|
||||
#endif
|
|
@ -0,0 +1,9 @@
|
|||
/*
|
||||
* This header was generated from the Linux kernel headers by update_headers.py,
|
||||
* to provide necessary information from kernel to userspace, such as constants,
|
||||
* structures, and macros, and thus, contains no copyrightable information.
|
||||
*/
|
||||
#ifndef _UAPI_LINUX_COMPILER_H
|
||||
#define _UAPI_LINUX_COMPILER_H
|
||||
#define __user
|
||||
#endif
|
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* This header was generated from the Linux kernel headers by update_headers.py,
|
||||
* to provide necessary information from kernel to userspace, such as constants,
|
||||
* structures, and macros, and thus, contains no copyrightable information.
|
||||
*/
|
||||
#ifndef _LINUX_POSIX_TYPES_H
|
||||
#define _LINUX_POSIX_TYPES_H
|
||||
#include <linux/stddef.h>
|
||||
#undef __FD_SETSIZE
|
||||
#define __FD_SETSIZE 1024
|
||||
typedef struct {
|
||||
unsigned long fds_bits[__FD_SETSIZE / (8 * sizeof(long))];
|
||||
} __kernel_fd_set;
|
||||
typedef void (*__kernel_sighandler_t)(int);
|
||||
typedef int __kernel_key_t;
|
||||
typedef int __kernel_mqd_t;
|
||||
#include <asm/posix_types.h>
|
||||
#endif
|
|
@ -0,0 +1,6 @@
|
|||
/*
|
||||
* This header was generated from the Linux kernel headers by update_headers.py,
|
||||
* to provide necessary information from kernel to userspace, such as constants,
|
||||
* structures, and macros, and thus, contains no copyrightable information.
|
||||
*/
|
||||
#include <linux/compiler.h>
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* This header was generated from the Linux kernel headers by update_headers.py,
|
||||
* to provide necessary information from kernel to userspace, such as constants,
|
||||
* structures, and macros, and thus, contains no copyrightable information.
|
||||
*/
|
||||
#ifndef _UAPI_LINUX_TYPES_H
|
||||
#define _UAPI_LINUX_TYPES_H
|
||||
#include <asm/types.h>
|
||||
#ifndef __ASSEMBLY__
|
||||
#ifndef __KERNEL__
|
||||
#if 0
|
||||
#warning "Attempt to use kernel headers from user space, see http:
|
||||
#endif
|
||||
#endif
|
||||
#include <linux/posix_types.h>
|
||||
#if 0
|
||||
#define __bitwise__ __attribute__((bitwise))
|
||||
#else
|
||||
#define __bitwise__
|
||||
#endif
|
||||
#ifdef __CHECK_ENDIAN__
|
||||
#define __bitwise __bitwise__
|
||||
#else
|
||||
#define __bitwise
|
||||
#endif
|
||||
typedef __u16 __bitwise __le16;
|
||||
typedef __u16 __bitwise __be16;
|
||||
typedef __u32 __bitwise __le32;
|
||||
typedef __u32 __bitwise __be32;
|
||||
typedef __u64 __bitwise __le64;
|
||||
typedef __u64 __bitwise __be64;
|
||||
typedef __u16 __bitwise __sum16;
|
||||
typedef __u32 __bitwise __wsum;
|
||||
#define __aligned_u64 __u64 __attribute__((aligned(8)))
|
||||
#define __aligned_be64 __be64 __attribute__((aligned(8)))
|
||||
#define __aligned_le64 __le64 __attribute__((aligned(8)))
|
||||
#endif
|
||||
#endif
|
|
@ -0,0 +1,91 @@
|
|||
#ifndef _LOCALE_H
|
||||
#define _LOCALE_H
|
||||
|
||||
#ifdef __ICCARM__ /* for iar */
|
||||
#include_next <locale.h>
|
||||
#else
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define NULL 0L
|
||||
#else
|
||||
#define NULL ((void*)0)
|
||||
#endif
|
||||
|
||||
#define LC_CTYPE 0
|
||||
#define LC_NUMERIC 1
|
||||
#define LC_TIME 2
|
||||
#define LC_COLLATE 3
|
||||
#define LC_MONETARY 4
|
||||
#define LC_MESSAGES 5
|
||||
#define LC_ALL 6
|
||||
|
||||
struct lconv {
|
||||
char *decimal_point;
|
||||
char *thousands_sep;
|
||||
char *grouping;
|
||||
|
||||
char *int_curr_symbol;
|
||||
char *currency_symbol;
|
||||
char *mon_decimal_point;
|
||||
char *mon_thousands_sep;
|
||||
char *mon_grouping;
|
||||
char *positive_sign;
|
||||
char *negative_sign;
|
||||
char int_frac_digits;
|
||||
char frac_digits;
|
||||
char p_cs_precedes;
|
||||
char p_sep_by_space;
|
||||
char n_cs_precedes;
|
||||
char n_sep_by_space;
|
||||
char p_sign_posn;
|
||||
char n_sign_posn;
|
||||
char int_p_cs_precedes;
|
||||
char int_p_sep_by_space;
|
||||
char int_n_cs_precedes;
|
||||
char int_n_sep_by_space;
|
||||
char int_p_sign_posn;
|
||||
char int_n_sign_posn;
|
||||
};
|
||||
|
||||
|
||||
char *setlocale (int, const char *);
|
||||
struct lconv *localeconv(void);
|
||||
|
||||
|
||||
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|
||||
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
|
||||
#define __NEED_locale_t
|
||||
|
||||
#include <bits/alltypes.h>
|
||||
|
||||
#define LC_GLOBAL_LOCALE ((locale_t)-1)
|
||||
|
||||
#define LC_CTYPE_MASK (1<<LC_CTYPE)
|
||||
#define LC_NUMERIC_MASK (1<<LC_NUMERIC)
|
||||
#define LC_TIME_MASK (1<<LC_TIME)
|
||||
#define LC_COLLATE_MASK (1<<LC_COLLATE)
|
||||
#define LC_MONETARY_MASK (1<<LC_MONETARY)
|
||||
#define LC_MESSAGES_MASK (1<<LC_MESSAGES)
|
||||
#define LC_ALL_MASK 0x7fffffff
|
||||
|
||||
locale_t duplocale(locale_t);
|
||||
void freelocale(locale_t);
|
||||
locale_t newlocale(int, const char *, locale_t);
|
||||
locale_t uselocale(locale_t);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ICCARM__ */
|
||||
#endif
|
|
@ -0,0 +1,25 @@
|
|||
#ifndef _MALLOC_H
|
||||
#define _MALLOC_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define __NEED_size_t
|
||||
|
||||
#include <bits/alltypes.h>
|
||||
|
||||
void *malloc (size_t);
|
||||
void *calloc (size_t, size_t);
|
||||
void *realloc (void *, size_t);
|
||||
void free (void *);
|
||||
void *valloc (size_t);
|
||||
void *memalign(size_t, size_t);
|
||||
|
||||
size_t malloc_usable_size(void *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,447 @@
|
|||
#ifndef _MATH_H
|
||||
#define _MATH_H
|
||||
|
||||
#ifdef __ICCARM__ /* for iar */
|
||||
#include_next <math.h>
|
||||
#else
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#define __NEED_float_t
|
||||
#define __NEED_double_t
|
||||
#include <bits/alltypes.h>
|
||||
|
||||
#if 100*__GNUC__+__GNUC_MINOR__ >= 303
|
||||
#define NAN __builtin_nanf("")
|
||||
#define INFINITY __builtin_inff()
|
||||
#else
|
||||
#define NAN (0.0f/0.0f)
|
||||
#define INFINITY 1e5000f
|
||||
#endif
|
||||
|
||||
#define HUGE_VALF INFINITY
|
||||
#define HUGE_VAL ((double)INFINITY)
|
||||
#define HUGE_VALL ((long double)INFINITY)
|
||||
|
||||
#define MATH_ERRNO 1
|
||||
#define MATH_ERREXCEPT 2
|
||||
#define math_errhandling 2
|
||||
|
||||
#define FP_ILOGBNAN (-1-0x7fffffff)
|
||||
#define FP_ILOGB0 FP_ILOGBNAN
|
||||
|
||||
#define FP_NAN 0
|
||||
#define FP_INFINITE 1
|
||||
#define FP_ZERO 2
|
||||
#define FP_SUBNORMAL 3
|
||||
#define FP_NORMAL 4
|
||||
|
||||
#ifdef __FP_FAST_FMA
|
||||
#define FP_FAST_FMA 1
|
||||
#endif
|
||||
|
||||
#ifdef __FP_FAST_FMAF
|
||||
#define FP_FAST_FMAF 1
|
||||
#endif
|
||||
|
||||
#ifdef __FP_FAST_FMAL
|
||||
#define FP_FAST_FMAL 1
|
||||
#endif
|
||||
|
||||
int __fpclassify(double);
|
||||
int __fpclassifyf(float);
|
||||
int __fpclassifyl(long double);
|
||||
|
||||
static __inline unsigned __FLOAT_BITS(float __f)
|
||||
{
|
||||
union {float __f; unsigned __i;} __u;
|
||||
__u.__f = __f;
|
||||
return __u.__i;
|
||||
}
|
||||
static __inline unsigned long long __DOUBLE_BITS(double __f)
|
||||
{
|
||||
union {double __f; unsigned long long __i;} __u;
|
||||
__u.__f = __f;
|
||||
return __u.__i;
|
||||
}
|
||||
|
||||
#define fpclassify(x) ( \
|
||||
sizeof(x) == sizeof(float) ? __fpclassifyf(x) : \
|
||||
sizeof(x) == sizeof(double) ? __fpclassify(x) : \
|
||||
__fpclassifyl(x) )
|
||||
|
||||
#define isinf(x) ( \
|
||||
sizeof(x) == sizeof(float) ? (__FLOAT_BITS(x) & 0x7fffffff) == 0x7f800000 : \
|
||||
sizeof(x) == sizeof(double) ? (__DOUBLE_BITS(x) & -1ULL>>1) == 0x7ffULL<<52 : \
|
||||
__fpclassifyl(x) == FP_INFINITE)
|
||||
|
||||
#define isnan(x) ( \
|
||||
sizeof(x) == sizeof(float) ? (__FLOAT_BITS(x) & 0x7fffffff) > 0x7f800000 : \
|
||||
sizeof(x) == sizeof(double) ? (__DOUBLE_BITS(x) & -1ULL>>1) > 0x7ffULL<<52 : \
|
||||
__fpclassifyl(x) == FP_NAN)
|
||||
|
||||
#define isnormal(x) ( \
|
||||
sizeof(x) == sizeof(float) ? ((__FLOAT_BITS(x)+0x00800000) & 0x7fffffff) >= 0x01000000 : \
|
||||
sizeof(x) == sizeof(double) ? ((__DOUBLE_BITS(x)+(1ULL<<52)) & -1ULL>>1) >= 1ULL<<53 : \
|
||||
__fpclassifyl(x) == FP_NORMAL)
|
||||
|
||||
#define isfinite(x) ( \
|
||||
sizeof(x) == sizeof(float) ? (__FLOAT_BITS(x) & 0x7fffffff) < 0x7f800000 : \
|
||||
sizeof(x) == sizeof(double) ? (__DOUBLE_BITS(x) & -1ULL>>1) < 0x7ffULL<<52 : \
|
||||
__fpclassifyl(x) > FP_INFINITE)
|
||||
|
||||
int __signbit(double);
|
||||
int __signbitf(float);
|
||||
int __signbitl(long double);
|
||||
|
||||
#define signbit(x) ( \
|
||||
sizeof(x) == sizeof(float) ? (int)(__FLOAT_BITS(x)>>31) : \
|
||||
sizeof(x) == sizeof(double) ? (int)(__DOUBLE_BITS(x)>>63) : \
|
||||
__signbitl(x) )
|
||||
|
||||
#define isunordered(x,y) (isnan((x)) ? ((void)(y),1) : isnan((y)))
|
||||
|
||||
#define __ISREL_DEF(rel, op, type) \
|
||||
static __inline int __is##rel(type __x, type __y) \
|
||||
{ return !isunordered(__x,__y) && __x op __y; }
|
||||
|
||||
__ISREL_DEF(lessf, <, float_t)
|
||||
__ISREL_DEF(less, <, double_t)
|
||||
__ISREL_DEF(lessl, <, long double)
|
||||
__ISREL_DEF(lessequalf, <=, float_t)
|
||||
__ISREL_DEF(lessequal, <=, double_t)
|
||||
__ISREL_DEF(lessequall, <=, long double)
|
||||
__ISREL_DEF(lessgreaterf, !=, float_t)
|
||||
__ISREL_DEF(lessgreater, !=, double_t)
|
||||
__ISREL_DEF(lessgreaterl, !=, long double)
|
||||
__ISREL_DEF(greaterf, >, float_t)
|
||||
__ISREL_DEF(greater, >, double_t)
|
||||
__ISREL_DEF(greaterl, >, long double)
|
||||
__ISREL_DEF(greaterequalf, >=, float_t)
|
||||
__ISREL_DEF(greaterequal, >=, double_t)
|
||||
__ISREL_DEF(greaterequall, >=, long double)
|
||||
|
||||
#define __tg_pred_2(x, y, p) ( \
|
||||
sizeof((x)+(y)) == sizeof(float) ? p##f(x, y) : \
|
||||
sizeof((x)+(y)) == sizeof(double) ? p(x, y) : \
|
||||
p##l(x, y) )
|
||||
|
||||
#define isless(x, y) __tg_pred_2(x, y, __isless)
|
||||
#define islessequal(x, y) __tg_pred_2(x, y, __islessequal)
|
||||
#define islessgreater(x, y) __tg_pred_2(x, y, __islessgreater)
|
||||
#define isgreater(x, y) __tg_pred_2(x, y, __isgreater)
|
||||
#define isgreaterequal(x, y) __tg_pred_2(x, y, __isgreaterequal)
|
||||
|
||||
double acos(double);
|
||||
float acosf(float);
|
||||
long double acosl(long double);
|
||||
|
||||
double acosh(double);
|
||||
float acoshf(float);
|
||||
long double acoshl(long double);
|
||||
|
||||
double asin(double);
|
||||
float asinf(float);
|
||||
long double asinl(long double);
|
||||
|
||||
double asinh(double);
|
||||
float asinhf(float);
|
||||
long double asinhl(long double);
|
||||
|
||||
double atan(double);
|
||||
float atanf(float);
|
||||
long double atanl(long double);
|
||||
|
||||
double atan2(double, double);
|
||||
float atan2f(float, float);
|
||||
long double atan2l(long double, long double);
|
||||
|
||||
double atanh(double);
|
||||
float atanhf(float);
|
||||
long double atanhl(long double);
|
||||
|
||||
double cbrt(double);
|
||||
float cbrtf(float);
|
||||
long double cbrtl(long double);
|
||||
|
||||
double ceil(double);
|
||||
float ceilf(float);
|
||||
long double ceill(long double);
|
||||
|
||||
double copysign(double, double);
|
||||
float copysignf(float, float);
|
||||
long double copysignl(long double, long double);
|
||||
|
||||
double cos(double);
|
||||
float cosf(float);
|
||||
long double cosl(long double);
|
||||
|
||||
double cosh(double);
|
||||
float coshf(float);
|
||||
long double coshl(long double);
|
||||
|
||||
double erf(double);
|
||||
float erff(float);
|
||||
long double erfl(long double);
|
||||
|
||||
double erfc(double);
|
||||
float erfcf(float);
|
||||
long double erfcl(long double);
|
||||
|
||||
double exp(double);
|
||||
float expf(float);
|
||||
long double expl(long double);
|
||||
|
||||
double exp2(double);
|
||||
float exp2f(float);
|
||||
long double exp2l(long double);
|
||||
|
||||
double expm1(double);
|
||||
float expm1f(float);
|
||||
long double expm1l(long double);
|
||||
|
||||
double fabs(double);
|
||||
float fabsf(float);
|
||||
long double fabsl(long double);
|
||||
|
||||
double fdim(double, double);
|
||||
float fdimf(float, float);
|
||||
long double fdiml(long double, long double);
|
||||
|
||||
double floor(double);
|
||||
float floorf(float);
|
||||
long double floorl(long double);
|
||||
|
||||
double fma(double, double, double);
|
||||
float fmaf(float, float, float);
|
||||
long double fmal(long double, long double, long double);
|
||||
|
||||
double fmax(double, double);
|
||||
float fmaxf(float, float);
|
||||
long double fmaxl(long double, long double);
|
||||
|
||||
double fmin(double, double);
|
||||
float fminf(float, float);
|
||||
long double fminl(long double, long double);
|
||||
|
||||
double fmod(double, double);
|
||||
float fmodf(float, float);
|
||||
long double fmodl(long double, long double);
|
||||
|
||||
double frexp(double, int *);
|
||||
float frexpf(float, int *);
|
||||
long double frexpl(long double, int *);
|
||||
|
||||
double hypot(double, double);
|
||||
float hypotf(float, float);
|
||||
long double hypotl(long double, long double);
|
||||
|
||||
int ilogb(double);
|
||||
int ilogbf(float);
|
||||
int ilogbl(long double);
|
||||
|
||||
double ldexp(double, int);
|
||||
float ldexpf(float, int);
|
||||
long double ldexpl(long double, int);
|
||||
|
||||
double lgamma(double);
|
||||
float lgammaf(float);
|
||||
long double lgammal(long double);
|
||||
|
||||
long long llrint(double);
|
||||
long long llrintf(float);
|
||||
long long llrintl(long double);
|
||||
|
||||
long long llround(double);
|
||||
long long llroundf(float);
|
||||
long long llroundl(long double);
|
||||
|
||||
double log(double);
|
||||
float logf(float);
|
||||
long double logl(long double);
|
||||
|
||||
double log10(double);
|
||||
float log10f(float);
|
||||
long double log10l(long double);
|
||||
|
||||
double log1p(double);
|
||||
float log1pf(float);
|
||||
long double log1pl(long double);
|
||||
|
||||
double log2(double);
|
||||
float log2f(float);
|
||||
long double log2l(long double);
|
||||
|
||||
double logb(double);
|
||||
float logbf(float);
|
||||
long double logbl(long double);
|
||||
|
||||
long lrint(double);
|
||||
long lrintf(float);
|
||||
long lrintl(long double);
|
||||
|
||||
long lround(double);
|
||||
long lroundf(float);
|
||||
long lroundl(long double);
|
||||
|
||||
double modf(double, double *);
|
||||
float modff(float, float *);
|
||||
long double modfl(long double, long double *);
|
||||
|
||||
double nan(const char *);
|
||||
float nanf(const char *);
|
||||
long double nanl(const char *);
|
||||
|
||||
double nearbyint(double);
|
||||
float nearbyintf(float);
|
||||
long double nearbyintl(long double);
|
||||
|
||||
double nextafter(double, double);
|
||||
float nextafterf(float, float);
|
||||
long double nextafterl(long double, long double);
|
||||
|
||||
double nexttoward(double, long double);
|
||||
float nexttowardf(float, long double);
|
||||
long double nexttowardl(long double, long double);
|
||||
|
||||
double pow(double, double);
|
||||
float powf(float, float);
|
||||
long double powl(long double, long double);
|
||||
|
||||
double remainder(double, double);
|
||||
float remainderf(float, float);
|
||||
long double remainderl(long double, long double);
|
||||
|
||||
double remquo(double, double, int *);
|
||||
float remquof(float, float, int *);
|
||||
long double remquol(long double, long double, int *);
|
||||
|
||||
double rint(double);
|
||||
float rintf(float);
|
||||
long double rintl(long double);
|
||||
|
||||
double round(double);
|
||||
float roundf(float);
|
||||
long double roundl(long double);
|
||||
|
||||
double scalbln(double, long);
|
||||
float scalblnf(float, long);
|
||||
long double scalblnl(long double, long);
|
||||
|
||||
double scalbn(double, int);
|
||||
float scalbnf(float, int);
|
||||
long double scalbnl(long double, int);
|
||||
|
||||
double sin(double);
|
||||
float sinf(float);
|
||||
long double sinl(long double);
|
||||
|
||||
double sinh(double);
|
||||
float sinhf(float);
|
||||
long double sinhl(long double);
|
||||
|
||||
double sqrt(double);
|
||||
float sqrtf(float);
|
||||
long double sqrtl(long double);
|
||||
|
||||
double tan(double);
|
||||
float tanf(float);
|
||||
long double tanl(long double);
|
||||
|
||||
double tanh(double);
|
||||
float tanhf(float);
|
||||
long double tanhl(long double);
|
||||
|
||||
double tgamma(double);
|
||||
float tgammaf(float);
|
||||
long double tgammal(long double);
|
||||
|
||||
double trunc(double);
|
||||
float truncf(float);
|
||||
long double truncl(long double);
|
||||
|
||||
|
||||
#if defined(_XOPEN_SOURCE) || defined(_BSD_SOURCE)
|
||||
#undef MAXFLOAT
|
||||
#define MAXFLOAT 3.40282346638528859812e+38F
|
||||
#endif
|
||||
|
||||
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
#define M_E 2.7182818284590452354 /* e */
|
||||
#define M_LOG2E 1.4426950408889634074 /* log_2 e */
|
||||
#define M_LOG10E 0.43429448190325182765 /* log_10 e */
|
||||
#define M_LN2 0.69314718055994530942 /* log_e 2 */
|
||||
#define M_LN10 2.30258509299404568402 /* log_e 10 */
|
||||
#define M_PI 3.14159265358979323846 /* pi */
|
||||
#define M_PI_2 1.57079632679489661923 /* pi/2 */
|
||||
#define M_PI_4 0.78539816339744830962 /* pi/4 */
|
||||
#define M_1_PI 0.31830988618379067154 /* 1/pi */
|
||||
#define M_2_PI 0.63661977236758134308 /* 2/pi */
|
||||
#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
|
||||
#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
|
||||
#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
|
||||
|
||||
extern int signgam;
|
||||
|
||||
double j0(double);
|
||||
double j1(double);
|
||||
double jn(int, double);
|
||||
|
||||
double y0(double);
|
||||
double y1(double);
|
||||
double yn(int, double);
|
||||
#endif
|
||||
|
||||
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
#define HUGE 3.40282346638528859812e+38F
|
||||
|
||||
double drem(double, double);
|
||||
float dremf(float, float);
|
||||
|
||||
int finite(double);
|
||||
int finitef(float);
|
||||
|
||||
double scalb(double, double);
|
||||
float scalbf(float, float);
|
||||
|
||||
double significand(double);
|
||||
float significandf(float);
|
||||
|
||||
double lgamma_r(double, int*);
|
||||
float lgammaf_r(float, int*);
|
||||
|
||||
float j0f(float);
|
||||
float j1f(float);
|
||||
float jnf(int, float);
|
||||
|
||||
float y0f(float);
|
||||
float y1f(float);
|
||||
float ynf(int, float);
|
||||
#endif
|
||||
|
||||
#ifdef _GNU_SOURCE
|
||||
long double lgammal_r(long double, int*);
|
||||
|
||||
void sincos(double, double*, double*);
|
||||
void sincosf(float, float*, float*);
|
||||
void sincosl(long double, long double*, long double*);
|
||||
|
||||
double exp10(double);
|
||||
float exp10f(float);
|
||||
long double exp10l(long double);
|
||||
|
||||
double pow10(double);
|
||||
float pow10f(float);
|
||||
long double pow10l(long double);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ICCARM__ */
|
||||
#endif
|
|
@ -0,0 +1 @@
|
|||
#include <string.h>
|
|
@ -0,0 +1,43 @@
|
|||
#ifndef _MNTENT_H
|
||||
#define _MNTENT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define __NEED_FILE
|
||||
#include <bits/alltypes.h>
|
||||
|
||||
#define MOUNTED "/etc/mtab"
|
||||
|
||||
#define MNTTYPE_IGNORE "ignore"
|
||||
#define MNTTYPE_NFS "nfs"
|
||||
#define MNTTYPE_SWAP "swap"
|
||||
#define MNTOPT_DEFAULTS "defaults"
|
||||
#define MNTOPT_RO "ro"
|
||||
#define MNTOPT_RW "rw"
|
||||
#define MNTOPT_SUID "suid"
|
||||
#define MNTOPT_NOSUID "nosuid"
|
||||
#define MNTOPT_NOAUTO "noauto"
|
||||
|
||||
struct mntent {
|
||||
char *mnt_fsname;
|
||||
char *mnt_dir;
|
||||
char *mnt_type;
|
||||
char *mnt_opts;
|
||||
int mnt_freq;
|
||||
int mnt_passno;
|
||||
};
|
||||
|
||||
FILE *setmntent(const char *, const char *);
|
||||
int endmntent(FILE *);
|
||||
struct mntent *getmntent(FILE *);
|
||||
struct mntent *getmntent_r(FILE *, struct mntent *, char *, int);
|
||||
int addmntent(FILE *, const struct mntent *);
|
||||
char *hasmntopt(const struct mntent *, const char *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,23 @@
|
|||
#ifndef _MONETARY_H
|
||||
#define _MONETARY_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#define __NEED_ssize_t
|
||||
#define __NEED_size_t
|
||||
#define __NEED_locale_t
|
||||
|
||||
#include <bits/alltypes.h>
|
||||
|
||||
ssize_t strfmon(char *__restrict, size_t, const char *__restrict, ...);
|
||||
ssize_t strfmon_l(char *__restrict, size_t, locale_t, const char *__restrict, ...);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,41 @@
|
|||
#ifndef _MQUEUE_H
|
||||
#define _MQUEUE_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#define __NEED_size_t
|
||||
#define __NEED_ssize_t
|
||||
#define __NEED_pthread_attr_t
|
||||
#define __NEED_time_t
|
||||
#define __NEED_struct_timespec
|
||||
#include <bits/alltypes.h>
|
||||
|
||||
typedef int mqd_t;
|
||||
struct mq_attr {
|
||||
long mq_flags, mq_maxmsg, mq_msgsize, mq_curmsgs, __unused[4];
|
||||
};
|
||||
struct sigevent;
|
||||
|
||||
int mq_close(mqd_t);
|
||||
int mq_getattr(mqd_t, struct mq_attr *);
|
||||
int mq_notify(mqd_t, const struct sigevent *);
|
||||
mqd_t mq_open(const char *, int, ...);
|
||||
ssize_t mq_receive(mqd_t, char *, size_t, unsigned *);
|
||||
int mq_send(mqd_t, const char *, size_t, unsigned);
|
||||
int mq_setattr(mqd_t, const struct mq_attr *__restrict, struct mq_attr *__restrict);
|
||||
ssize_t mq_timedreceive(mqd_t, char *__restrict, size_t, unsigned *__restrict, const struct timespec *__restrict);
|
||||
int mq_timedsend(mqd_t, const char *, size_t, unsigned, const struct timespec *);
|
||||
int mq_unlink(const char *);
|
||||
|
||||
#if _REDIR_TIME64
|
||||
__REDIR(mq_timedreceive, __mq_timedreceive_time64);
|
||||
__REDIR(mq_timedsend, __mq_timedsend_time64);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
|
@ -0,0 +1,55 @@
|
|||
#ifndef _NET_ETHERNET_H
|
||||
#define _NET_ETHERNET_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
#include <netinet/if_ether.h>
|
||||
|
||||
struct ether_addr {
|
||||
uint8_t ether_addr_octet[ETH_ALEN];
|
||||
};
|
||||
|
||||
struct ether_header {
|
||||
uint8_t ether_dhost[ETH_ALEN];
|
||||
uint8_t ether_shost[ETH_ALEN];
|
||||
uint16_t ether_type;
|
||||
};
|
||||
|
||||
#define ETHERTYPE_PUP 0x0200
|
||||
#define ETHERTYPE_SPRITE 0x0500
|
||||
#define ETHERTYPE_IP 0x0800
|
||||
#define ETHERTYPE_ARP 0x0806
|
||||
#define ETHERTYPE_REVARP 0x8035
|
||||
#define ETHERTYPE_AT 0x809B
|
||||
#define ETHERTYPE_AARP 0x80F3
|
||||
#define ETHERTYPE_VLAN 0x8100
|
||||
#define ETHERTYPE_IPX 0x8137
|
||||
#define ETHERTYPE_IPV6 0x86dd
|
||||
#define ETHERTYPE_LOOPBACK 0x9000
|
||||
|
||||
|
||||
#define ETHER_ADDR_LEN ETH_ALEN
|
||||
#define ETHER_TYPE_LEN 2
|
||||
#define ETHER_CRC_LEN 4
|
||||
#define ETHER_HDR_LEN ETH_HLEN
|
||||
#define ETHER_MIN_LEN (ETH_ZLEN + ETHER_CRC_LEN)
|
||||
#define ETHER_MAX_LEN (ETH_FRAME_LEN + ETHER_CRC_LEN)
|
||||
|
||||
#define ETHER_IS_VALID_LEN(foo) \
|
||||
((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN)
|
||||
|
||||
#define ETHERTYPE_TRAIL 0x1000
|
||||
#define ETHERTYPE_NTRAILER 16
|
||||
|
||||
#define ETHERMTU ETH_DATA_LEN
|
||||
#define ETHERMIN (ETHER_MIN_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,141 @@
|
|||
#ifndef _NET_IF_H
|
||||
#define _NET_IF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#define IF_NAMESIZE 16
|
||||
|
||||
struct if_nameindex {
|
||||
unsigned int if_index;
|
||||
char *if_name;
|
||||
};
|
||||
|
||||
unsigned int if_nametoindex (const char *);
|
||||
char *if_indextoname (unsigned int, char *);
|
||||
struct if_nameindex *if_nameindex (void);
|
||||
void if_freenameindex (struct if_nameindex *);
|
||||
|
||||
|
||||
|
||||
|
||||
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
|
||||
#include <sys/socket.h>
|
||||
|
||||
#define IFF_UP 0x1
|
||||
#define IFF_BROADCAST 0x2
|
||||
#define IFF_DEBUG 0x4
|
||||
#define IFF_LOOPBACK 0x8
|
||||
#define IFF_POINTOPOINT 0x10
|
||||
#define IFF_NOTRAILERS 0x20
|
||||
#define IFF_RUNNING 0x40
|
||||
#define IFF_NOARP 0x80
|
||||
#define IFF_PROMISC 0x100
|
||||
#define IFF_ALLMULTI 0x200
|
||||
#define IFF_MASTER 0x400
|
||||
#define IFF_SLAVE 0x800
|
||||
#define IFF_MULTICAST 0x1000
|
||||
#define IFF_PORTSEL 0x2000
|
||||
#define IFF_AUTOMEDIA 0x4000
|
||||
#define IFF_DYNAMIC 0x8000
|
||||
#define IFF_LOWER_UP 0x10000
|
||||
#define IFF_DORMANT 0x20000
|
||||
#define IFF_ECHO 0x40000
|
||||
#define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST| \
|
||||
IFF_ECHO|IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT)
|
||||
|
||||
struct ifaddr {
|
||||
struct sockaddr ifa_addr;
|
||||
union {
|
||||
struct sockaddr ifu_broadaddr;
|
||||
struct sockaddr ifu_dstaddr;
|
||||
} ifa_ifu;
|
||||
struct iface *ifa_ifp;
|
||||
struct ifaddr *ifa_next;
|
||||
};
|
||||
|
||||
#define ifa_broadaddr ifa_ifu.ifu_broadaddr
|
||||
#define ifa_dstaddr ifa_ifu.ifu_dstaddr
|
||||
|
||||
struct ifmap {
|
||||
unsigned long int mem_start;
|
||||
unsigned long int mem_end;
|
||||
unsigned short int base_addr;
|
||||
unsigned char irq;
|
||||
unsigned char dma;
|
||||
unsigned char port;
|
||||
};
|
||||
|
||||
#define IFHWADDRLEN 6
|
||||
#define IFNAMSIZ IF_NAMESIZE
|
||||
|
||||
struct ifreq {
|
||||
union {
|
||||
char ifrn_name[IFNAMSIZ];
|
||||
} ifr_ifrn;
|
||||
union {
|
||||
struct sockaddr ifru_addr;
|
||||
struct sockaddr ifru_dstaddr;
|
||||
struct sockaddr ifru_broadaddr;
|
||||
struct sockaddr ifru_netmask;
|
||||
struct sockaddr ifru_hwaddr;
|
||||
short int ifru_flags;
|
||||
int ifru_ivalue;
|
||||
int ifru_mtu;
|
||||
struct ifmap ifru_map;
|
||||
char ifru_slave[IFNAMSIZ];
|
||||
char ifru_newname[IFNAMSIZ];
|
||||
char *ifru_data;
|
||||
} ifr_ifru;
|
||||
};
|
||||
|
||||
#define ifr_name ifr_ifrn.ifrn_name
|
||||
#define ifr_hwaddr ifr_ifru.ifru_hwaddr
|
||||
#define ifr_addr ifr_ifru.ifru_addr
|
||||
#define ifr_dstaddr ifr_ifru.ifru_dstaddr
|
||||
#define ifr_broadaddr ifr_ifru.ifru_broadaddr
|
||||
#define ifr_netmask ifr_ifru.ifru_netmask
|
||||
#define ifr_flags ifr_ifru.ifru_flags
|
||||
#define ifr_metric ifr_ifru.ifru_ivalue
|
||||
#define ifr_mtu ifr_ifru.ifru_mtu
|
||||
#define ifr_map ifr_ifru.ifru_map
|
||||
#define ifr_slave ifr_ifru.ifru_slave
|
||||
#define ifr_data ifr_ifru.ifru_data
|
||||
#define ifr_ifindex ifr_ifru.ifru_ivalue
|
||||
#define ifr_bandwidth ifr_ifru.ifru_ivalue
|
||||
#define ifr_qlen ifr_ifru.ifru_ivalue
|
||||
#define ifr_newname ifr_ifru.ifru_newname
|
||||
#define _IOT_ifreq _IOT(_IOTS(char),IFNAMSIZ,_IOTS(char),16,0,0)
|
||||
#define _IOT_ifreq_short _IOT(_IOTS(char),IFNAMSIZ,_IOTS(short),1,0,0)
|
||||
#define _IOT_ifreq_int _IOT(_IOTS(char),IFNAMSIZ,_IOTS(int),1,0,0)
|
||||
|
||||
struct ifconf {
|
||||
int ifc_len;
|
||||
union {
|
||||
char *ifcu_buf;
|
||||
struct ifreq *ifcu_req;
|
||||
} ifc_ifcu;
|
||||
};
|
||||
|
||||
#define ifc_buf ifc_ifcu.ifcu_buf
|
||||
#define ifc_req ifc_ifcu.ifcu_req
|
||||
#define _IOT_ifconf _IOT(_IOTS(struct ifconf),1,0,0,0,0)
|
||||
|
||||
#define __UAPI_DEF_IF_IFCONF 0
|
||||
#define __UAPI_DEF_IF_IFMAP 0
|
||||
#define __UAPI_DEF_IF_IFNAMSIZ 0
|
||||
#define __UAPI_DEF_IF_IFREQ 0
|
||||
#define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0
|
||||
#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,142 @@
|
|||
/* Nonstandard header */
|
||||
#ifndef _NET_IF_ARP_H
|
||||
#define _NET_IF_ARP_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#define MAX_ADDR_LEN 7
|
||||
|
||||
#define ARPOP_REQUEST 1
|
||||
#define ARPOP_REPLY 2
|
||||
#define ARPOP_RREQUEST 3
|
||||
#define ARPOP_RREPLY 4
|
||||
#define ARPOP_InREQUEST 8
|
||||
#define ARPOP_InREPLY 9
|
||||
#define ARPOP_NAK 10
|
||||
|
||||
struct arphdr {
|
||||
uint16_t ar_hrd;
|
||||
uint16_t ar_pro;
|
||||
uint8_t ar_hln;
|
||||
uint8_t ar_pln;
|
||||
uint16_t ar_op;
|
||||
};
|
||||
|
||||
|
||||
#define ARPHRD_NETROM 0
|
||||
#define ARPHRD_ETHER 1
|
||||
#define ARPHRD_EETHER 2
|
||||
#define ARPHRD_AX25 3
|
||||
#define ARPHRD_PRONET 4
|
||||
#define ARPHRD_CHAOS 5
|
||||
#define ARPHRD_IEEE802 6
|
||||
#define ARPHRD_ARCNET 7
|
||||
#define ARPHRD_APPLETLK 8
|
||||
#define ARPHRD_DLCI 15
|
||||
#define ARPHRD_ATM 19
|
||||
#define ARPHRD_METRICOM 23
|
||||
#define ARPHRD_IEEE1394 24
|
||||
#define ARPHRD_EUI64 27
|
||||
#define ARPHRD_INFINIBAND 32
|
||||
#define ARPHRD_SLIP 256
|
||||
#define ARPHRD_CSLIP 257
|
||||
#define ARPHRD_SLIP6 258
|
||||
#define ARPHRD_CSLIP6 259
|
||||
#define ARPHRD_RSRVD 260
|
||||
#define ARPHRD_ADAPT 264
|
||||
#define ARPHRD_ROSE 270
|
||||
#define ARPHRD_X25 271
|
||||
#define ARPHRD_HWX25 272
|
||||
#define ARPHRD_CAN 280
|
||||
#define ARPHRD_PPP 512
|
||||
#define ARPHRD_CISCO 513
|
||||
#define ARPHRD_HDLC ARPHRD_CISCO
|
||||
#define ARPHRD_LAPB 516
|
||||
#define ARPHRD_DDCMP 517
|
||||
#define ARPHRD_RAWHDLC 518
|
||||
#define ARPHRD_RAWIP 519
|
||||
|
||||
#define ARPHRD_TUNNEL 768
|
||||
#define ARPHRD_TUNNEL6 769
|
||||
#define ARPHRD_FRAD 770
|
||||
#define ARPHRD_SKIP 771
|
||||
#define ARPHRD_LOOPBACK 772
|
||||
#define ARPHRD_LOCALTLK 773
|
||||
#define ARPHRD_FDDI 774
|
||||
#define ARPHRD_BIF 775
|
||||
#define ARPHRD_SIT 776
|
||||
#define ARPHRD_IPDDP 777
|
||||
#define ARPHRD_IPGRE 778
|
||||
#define ARPHRD_PIMREG 779
|
||||
#define ARPHRD_HIPPI 780
|
||||
#define ARPHRD_ASH 781
|
||||
#define ARPHRD_ECONET 782
|
||||
#define ARPHRD_IRDA 783
|
||||
#define ARPHRD_FCPP 784
|
||||
#define ARPHRD_FCAL 785
|
||||
#define ARPHRD_FCPL 786
|
||||
#define ARPHRD_FCFABRIC 787
|
||||
#define ARPHRD_IEEE802_TR 800
|
||||
#define ARPHRD_IEEE80211 801
|
||||
#define ARPHRD_IEEE80211_PRISM 802
|
||||
#define ARPHRD_IEEE80211_RADIOTAP 803
|
||||
#define ARPHRD_IEEE802154 804
|
||||
#define ARPHRD_IEEE802154_MONITOR 805
|
||||
#define ARPHRD_PHONET 820
|
||||
#define ARPHRD_PHONET_PIPE 821
|
||||
#define ARPHRD_CAIF 822
|
||||
#define ARPHRD_IP6GRE 823
|
||||
#define ARPHRD_NETLINK 824
|
||||
#define ARPHRD_6LOWPAN 825
|
||||
#define ARPHRD_VSOCKMON 826
|
||||
|
||||
#define ARPHRD_VOID 0xFFFF
|
||||
#define ARPHRD_NONE 0xFFFE
|
||||
|
||||
struct arpreq {
|
||||
struct sockaddr arp_pa;
|
||||
struct sockaddr arp_ha;
|
||||
int arp_flags;
|
||||
struct sockaddr arp_netmask;
|
||||
char arp_dev[16];
|
||||
};
|
||||
|
||||
struct arpreq_old {
|
||||
struct sockaddr arp_pa;
|
||||
struct sockaddr arp_ha;
|
||||
int arp_flags;
|
||||
struct sockaddr arp_netmask;
|
||||
};
|
||||
|
||||
#define ATF_COM 0x02
|
||||
#define ATF_PERM 0x04
|
||||
#define ATF_PUBL 0x08
|
||||
#define ATF_USETRAILERS 0x10
|
||||
#define ATF_NETMASK 0x20
|
||||
#define ATF_DONTPUB 0x40
|
||||
#define ATF_MAGIC 0x80
|
||||
|
||||
#define ARPD_UPDATE 0x01
|
||||
#define ARPD_LOOKUP 0x02
|
||||
#define ARPD_FLUSH 0x03
|
||||
|
||||
struct arpd_request {
|
||||
unsigned short req;
|
||||
uint32_t ip;
|
||||
unsigned long dev;
|
||||
unsigned long stamp;
|
||||
unsigned long updated;
|
||||
unsigned char ha[MAX_ADDR_LEN];
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
|
@ -0,0 +1,124 @@
|
|||
#ifndef _NET_ROUTE_H
|
||||
#define _NET_ROUTE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
|
||||
struct rtentry {
|
||||
unsigned long int rt_pad1;
|
||||
struct sockaddr rt_dst;
|
||||
struct sockaddr rt_gateway;
|
||||
struct sockaddr rt_genmask;
|
||||
unsigned short int rt_flags;
|
||||
short int rt_pad2;
|
||||
unsigned long int rt_pad3;
|
||||
unsigned char rt_tos;
|
||||
unsigned char rt_class;
|
||||
short int rt_pad4[sizeof(long)/2-1];
|
||||
short int rt_metric;
|
||||
char *rt_dev;
|
||||
unsigned long int rt_mtu;
|
||||
unsigned long int rt_window;
|
||||
unsigned short int rt_irtt;
|
||||
};
|
||||
|
||||
#define rt_mss rt_mtu
|
||||
|
||||
|
||||
struct in6_rtmsg {
|
||||
struct in6_addr rtmsg_dst;
|
||||
struct in6_addr rtmsg_src;
|
||||
struct in6_addr rtmsg_gateway;
|
||||
uint32_t rtmsg_type;
|
||||
uint16_t rtmsg_dst_len;
|
||||
uint16_t rtmsg_src_len;
|
||||
uint32_t rtmsg_metric;
|
||||
unsigned long int rtmsg_info;
|
||||
uint32_t rtmsg_flags;
|
||||
int rtmsg_ifindex;
|
||||
};
|
||||
|
||||
|
||||
#define RTF_UP 0x0001
|
||||
#define RTF_GATEWAY 0x0002
|
||||
|
||||
#define RTF_HOST 0x0004
|
||||
#define RTF_REINSTATE 0x0008
|
||||
#define RTF_DYNAMIC 0x0010
|
||||
#define RTF_MODIFIED 0x0020
|
||||
#define RTF_MTU 0x0040
|
||||
#define RTF_MSS RTF_MTU
|
||||
#define RTF_WINDOW 0x0080
|
||||
#define RTF_IRTT 0x0100
|
||||
#define RTF_REJECT 0x0200
|
||||
#define RTF_STATIC 0x0400
|
||||
#define RTF_XRESOLVE 0x0800
|
||||
#define RTF_NOFORWARD 0x1000
|
||||
#define RTF_THROW 0x2000
|
||||
#define RTF_NOPMTUDISC 0x4000
|
||||
|
||||
#define RTF_DEFAULT 0x00010000
|
||||
#define RTF_ALLONLINK 0x00020000
|
||||
#define RTF_ADDRCONF 0x00040000
|
||||
|
||||
#define RTF_LINKRT 0x00100000
|
||||
#define RTF_NONEXTHOP 0x00200000
|
||||
|
||||
#define RTF_CACHE 0x01000000
|
||||
#define RTF_FLOW 0x02000000
|
||||
#define RTF_POLICY 0x04000000
|
||||
|
||||
#define RTCF_VALVE 0x00200000
|
||||
#define RTCF_MASQ 0x00400000
|
||||
#define RTCF_NAT 0x00800000
|
||||
#define RTCF_DOREDIRECT 0x01000000
|
||||
#define RTCF_LOG 0x02000000
|
||||
#define RTCF_DIRECTSRC 0x04000000
|
||||
|
||||
#define RTF_LOCAL 0x80000000
|
||||
#define RTF_INTERFACE 0x40000000
|
||||
#define RTF_MULTICAST 0x20000000
|
||||
#define RTF_BROADCAST 0x10000000
|
||||
#define RTF_NAT 0x08000000
|
||||
|
||||
#define RTF_ADDRCLASSMASK 0xF8000000
|
||||
#define RT_ADDRCLASS(flags) ((uint32_t) flags >> 23)
|
||||
|
||||
#define RT_TOS(tos) ((tos) & IPTOS_TOS_MASK)
|
||||
|
||||
#define RT_LOCALADDR(flags) ((flags & RTF_ADDRCLASSMASK) \
|
||||
== (RTF_LOCAL|RTF_INTERFACE))
|
||||
|
||||
#define RT_CLASS_UNSPEC 0
|
||||
#define RT_CLASS_DEFAULT 253
|
||||
|
||||
#define RT_CLASS_MAIN 254
|
||||
#define RT_CLASS_LOCAL 255
|
||||
#define RT_CLASS_MAX 255
|
||||
|
||||
|
||||
#define RTMSG_ACK NLMSG_ACK
|
||||
#define RTMSG_OVERRUN NLMSG_OVERRUN
|
||||
|
||||
#define RTMSG_NEWDEVICE 0x11
|
||||
#define RTMSG_DELDEVICE 0x12
|
||||
#define RTMSG_NEWROUTE 0x21
|
||||
#define RTMSG_DELROUTE 0x22
|
||||
#define RTMSG_NEWRULE 0x31
|
||||
#define RTMSG_DELRULE 0x32
|
||||
#define RTMSG_CONTROL 0x40
|
||||
|
||||
#define RTMSG_AR_FAILED 0x51
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,156 @@
|
|||
#ifndef _NETDB_H
|
||||
#define _NETDB_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <features.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
#define __NEED_size_t
|
||||
#include <bits/alltypes.h>
|
||||
#endif
|
||||
|
||||
struct addrinfo {
|
||||
int ai_flags;
|
||||
int ai_family;
|
||||
int ai_socktype;
|
||||
int ai_protocol;
|
||||
socklen_t ai_addrlen;
|
||||
struct sockaddr *ai_addr;
|
||||
char *ai_canonname;
|
||||
struct addrinfo *ai_next;
|
||||
};
|
||||
|
||||
#define AI_PASSIVE 0x01
|
||||
#define AI_CANONNAME 0x02
|
||||
#define AI_NUMERICHOST 0x04
|
||||
#define AI_V4MAPPED 0x08
|
||||
#define AI_ALL 0x10
|
||||
#define AI_ADDRCONFIG 0x20
|
||||
#define AI_NUMERICSERV 0x400
|
||||
|
||||
|
||||
#define NI_NUMERICHOST 0x01
|
||||
#define NI_NUMERICSERV 0x02
|
||||
#define NI_NOFQDN 0x04
|
||||
#define NI_NAMEREQD 0x08
|
||||
#define NI_DGRAM 0x10
|
||||
#define NI_NUMERICSCOPE 0x100
|
||||
|
||||
#define EAI_BADFLAGS -1
|
||||
#define EAI_NONAME -2
|
||||
#define EAI_AGAIN -3
|
||||
#define EAI_FAIL -4
|
||||
#define EAI_FAMILY -6
|
||||
#define EAI_SOCKTYPE -7
|
||||
#define EAI_SERVICE -8
|
||||
#define EAI_MEMORY -10
|
||||
#define EAI_SYSTEM -11
|
||||
#define EAI_OVERFLOW -12
|
||||
|
||||
int getaddrinfo (const char *__restrict, const char *__restrict, const struct addrinfo *__restrict, struct addrinfo **__restrict);
|
||||
void freeaddrinfo (struct addrinfo *);
|
||||
int getnameinfo (const struct sockaddr *__restrict, socklen_t, char *__restrict, socklen_t, char *__restrict, socklen_t, int);
|
||||
const char *gai_strerror(int);
|
||||
|
||||
|
||||
/* Legacy functions follow (marked OBsolete in SUS) */
|
||||
|
||||
struct netent {
|
||||
char *n_name;
|
||||
char **n_aliases;
|
||||
int n_addrtype;
|
||||
uint32_t n_net;
|
||||
};
|
||||
|
||||
struct hostent {
|
||||
char *h_name;
|
||||
char **h_aliases;
|
||||
int h_addrtype;
|
||||
int h_length;
|
||||
char **h_addr_list;
|
||||
};
|
||||
#define h_addr h_addr_list[0]
|
||||
|
||||
struct servent {
|
||||
char *s_name;
|
||||
char **s_aliases;
|
||||
int s_port;
|
||||
char *s_proto;
|
||||
};
|
||||
|
||||
struct protoent {
|
||||
char *p_name;
|
||||
char **p_aliases;
|
||||
int p_proto;
|
||||
};
|
||||
|
||||
void sethostent (int);
|
||||
void endhostent (void);
|
||||
struct hostent *gethostent (void);
|
||||
|
||||
void setnetent (int);
|
||||
void endnetent (void);
|
||||
struct netent *getnetent (void);
|
||||
struct netent *getnetbyaddr (uint32_t, int);
|
||||
struct netent *getnetbyname (const char *);
|
||||
|
||||
void setservent (int);
|
||||
void endservent (void);
|
||||
struct servent *getservent (void);
|
||||
struct servent *getservbyname (const char *, const char *);
|
||||
struct servent *getservbyport (int, const char *);
|
||||
|
||||
void setprotoent (int);
|
||||
void endprotoent (void);
|
||||
struct protoent *getprotoent (void);
|
||||
struct protoent *getprotobyname (const char *);
|
||||
struct protoent *getprotobynumber (int);
|
||||
|
||||
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_POSIX_SOURCE) \
|
||||
|| (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE+0 < 200809L) \
|
||||
|| (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE+0 < 700)
|
||||
struct hostent *gethostbyname (const char *);
|
||||
struct hostent *gethostbyaddr (const void *, socklen_t, int);
|
||||
#ifdef __GNUC__
|
||||
__attribute__((const))
|
||||
#endif
|
||||
int *__h_errno_location(void);
|
||||
#define h_errno (*__h_errno_location())
|
||||
#define HOST_NOT_FOUND 1
|
||||
#define TRY_AGAIN 2
|
||||
#define NO_RECOVERY 3
|
||||
#define NO_DATA 4
|
||||
#define NO_ADDRESS NO_DATA
|
||||
#endif
|
||||
|
||||
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||
void herror(const char *);
|
||||
const char *hstrerror(int);
|
||||
int gethostbyname_r(const char *, struct hostent *, char *, size_t, struct hostent **, int *);
|
||||
int gethostbyname2_r(const char *, int, struct hostent *, char *, size_t, struct hostent **, int *);
|
||||
struct hostent *gethostbyname2(const char *, int);
|
||||
int gethostbyaddr_r(const void *, socklen_t, int, struct hostent *, char *, size_t, struct hostent **, int *);
|
||||
int getservbyport_r(int, const char *, struct servent *, char *, size_t, struct servent **);
|
||||
int getservbyname_r(const char *, const char *, struct servent *, char *, size_t, struct servent **);
|
||||
#define EAI_NODATA -5
|
||||
#define EAI_ADDRFAMILY -9
|
||||
#define EAI_INPROGRESS -100
|
||||
#define EAI_CANCELED -101
|
||||
#define EAI_NOTCANCELED -102
|
||||
#define EAI_ALLDONE -103
|
||||
#define EAI_INTR -104
|
||||
#define EAI_IDN_ENCODE -105
|
||||
#define NI_MAXHOST 255
|
||||
#define NI_MAXSERV 32
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue