import RT-Thread@9217865c without bsp, libcpu and components/net
This commit is contained in:
commit
e2376a3709
1414 changed files with 390370 additions and 0 deletions
21
components/libc/compilers/common/extension/SConscript
Normal file
21
components/libc/compilers/common/extension/SConscript
Normal file
|
@ -0,0 +1,21 @@
|
|||
import os
|
||||
from building import *
|
||||
Import('rtconfig')
|
||||
|
||||
src = []
|
||||
cwd = GetCurrentDir()
|
||||
CPPPATH = [cwd]
|
||||
group = []
|
||||
|
||||
src += Glob('*.c')
|
||||
|
||||
if rtconfig.PLATFORM not in ['gcc', 'llvm-arm']:
|
||||
group = DefineGroup('Compiler', src, depend = [''], CPPPATH = CPPPATH)
|
||||
|
||||
list = os.listdir(cwd)
|
||||
for d in list:
|
||||
path = os.path.join(cwd, d)
|
||||
if os.path.isfile(os.path.join(path, 'SConscript')):
|
||||
group = group + SConscript(os.path.join(d, 'SConscript'))
|
||||
|
||||
Return('group')
|
|
@ -0,0 +1,4 @@
|
|||
Because of the history issue, flags in fcntl.h, such as O_CREAT, have difference types of value. Some OS use hex flags and others use octal flags.
|
||||
|
||||
In terms of RT-Thread, Keil, IAR and MSVC use octal flags, which is located in the `tcntl/octal` folder; newlib uses hex flags; musl uses octal flags.
|
||||
|
15
components/libc/compilers/common/extension/fcntl/SConscript
Normal file
15
components/libc/compilers/common/extension/fcntl/SConscript
Normal file
|
@ -0,0 +1,15 @@
|
|||
# RT-Thread building script for bridge
|
||||
|
||||
import os
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
objs = []
|
||||
list = os.listdir(cwd)
|
||||
|
||||
for d in list:
|
||||
path = os.path.join(cwd, d)
|
||||
if os.path.isfile(os.path.join(path, 'SConscript')):
|
||||
objs = objs + SConscript(os.path.join(d, 'SConscript'))
|
||||
|
||||
Return('objs')
|
|
@ -0,0 +1,11 @@
|
|||
from building import *
|
||||
Import('rtconfig')
|
||||
|
||||
src = []
|
||||
cwd = GetCurrentDir()
|
||||
CPPPATH = [cwd]
|
||||
group = []
|
||||
|
||||
if rtconfig.CROSS_TOOL == 'msvc':
|
||||
group = DefineGroup('Compiler', src, depend = [''], CPPPATH = CPPPATH)
|
||||
Return('group')
|
|
@ -0,0 +1,74 @@
|
|||
/*
|
||||
* Copyright (c) 2006-2022, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2022-09-02 Meco Man First version
|
||||
*/
|
||||
|
||||
#ifndef __FCNTL_H__
|
||||
#define __FCNTL_H__
|
||||
|
||||
#include "sys/types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* VS fcntl.h interent */
|
||||
#define O_RDONLY 0x0000 /* open for reading only */
|
||||
#define O_WRONLY 0x0001 /* open for writing only */
|
||||
#define O_RDWR 0x0002 /* open for reading and writing */
|
||||
#define O_APPEND 0x0008 /* writes done at eof */
|
||||
|
||||
#define O_CREAT 0x0100 /* create and open file */
|
||||
#define O_TRUNC 0x0200 /* open and truncate */
|
||||
#define O_EXCL 0x0400 /* open only if file doesn't already exist */
|
||||
|
||||
// O_TEXT files have <cr><lf> sequences translated to <lf> on read()'s and <lf>
|
||||
// sequences translated to <cr><lf> on write()'s
|
||||
#define O_TEXT 0x4000 /* file mode is text (translated) */
|
||||
|
||||
#define O_BINARY 0x8000 /* file mode is binary (untranslated) */
|
||||
#define O_RAW O_BINARY
|
||||
#define O_TEMPORARY 0x0040 /* temporary file bit (file is deleted when last handle is closed) */
|
||||
#define O_NOINHERIT 0x0080 /* child process doesn't inherit file */
|
||||
#define O_SEQUENTIAL 0x0020 /* file access is primarily sequential */
|
||||
#define O_RANDOM 0x0010 /* file access is primarily random */
|
||||
|
||||
/* extension */
|
||||
#define O_ACCMODE 0x0003 /* mask for above modes, from 4.4BSD https://minnie.tuhs.org/cgi-bin/utree.pl?file=4.4BSD/usr/include/sys/fcntl.h */
|
||||
#define O_NONBLOCK 0x0004 /* non blocking I/O, from BSD apple https://opensource.apple.com/source/xnu/xnu-1228.0.2/bsd/sys/fcntl.h */
|
||||
#define O_DIRECTORY 0x200000 /* from Newlib */
|
||||
|
||||
#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
|
||||
|
||||
int open(const char *file, int flags, ...);
|
||||
int fcntl(int fildes, int cmd, ...);
|
||||
int creat(const char *path, mode_t mode);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,11 @@
|
|||
from building import *
|
||||
Import('rtconfig')
|
||||
|
||||
src = []
|
||||
cwd = GetCurrentDir()
|
||||
CPPPATH = [cwd]
|
||||
group = []
|
||||
|
||||
if rtconfig.PLATFORM in ['armcc', 'armclang', 'iccarm']:
|
||||
group = DefineGroup('Compiler', src, depend = [''], CPPPATH = CPPPATH)
|
||||
Return('group')
|
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
* Copyright (c) 2006-2022, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2021-09-02 Meco Man First version
|
||||
*/
|
||||
|
||||
#ifndef __FCNTL_H__
|
||||
#define __FCNTL_H__
|
||||
|
||||
#include "sys/types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define O_RDONLY 00
|
||||
#define O_WRONLY 01
|
||||
#define O_RDWR 02
|
||||
|
||||
#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_BINARY 0100000
|
||||
#define O_DIRECTORY 0200000
|
||||
#define O_NOFOLLOW 0400000
|
||||
#define O_CLOEXEC 02000000
|
||||
|
||||
#define O_ASYNC 020000
|
||||
#define O_DIRECT 040000
|
||||
#define O_LARGEFILE 0100000
|
||||
#define O_NOATIME 01000000
|
||||
#define O_PATH 010000000
|
||||
#define O_TMPFILE 020200000
|
||||
#define O_NDELAY O_NONBLOCK
|
||||
|
||||
#define O_SEARCH O_PATH
|
||||
#define O_EXEC O_PATH
|
||||
|
||||
#define O_ACCMODE (03|O_SEARCH)
|
||||
|
||||
#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
|
||||
|
||||
int open(const char *file, int flags, ...);
|
||||
int fcntl(int fildes, int cmd, ...);
|
||||
int creat(const char *path, mode_t mode);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
4
components/libc/compilers/common/extension/readme.md
Normal file
4
components/libc/compilers/common/extension/readme.md
Normal file
|
@ -0,0 +1,4 @@
|
|||
## Attentions
|
||||
|
||||
This folder is "common" for toolchains, which only support ISO C, as an extension part, such as Keil-MDK and IAR.
|
||||
|
585
components/libc/compilers/common/extension/sys/errno.h
Normal file
585
components/libc/compilers/common/extension/sys/errno.h
Normal file
|
@ -0,0 +1,585 @@
|
|||
/*
|
||||
* Copyright (c) 2006-2022, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2021-05-22 Meco Man The first version.
|
||||
*/
|
||||
|
||||
#ifndef __SYS_ERRNO_H__
|
||||
#define __SYS_ERRNO_H__
|
||||
|
||||
#if defined(__ARMCC_VERSION)
|
||||
/*
|
||||
defined in armcc/errno.h
|
||||
|
||||
#define EDOM 1
|
||||
#define ERANGE 2
|
||||
#define EILSEQ 4
|
||||
#define ESIGNUM 3
|
||||
#define EINVAL 5
|
||||
#define ENOMEM 6
|
||||
*/
|
||||
|
||||
#define ERROR_BASE_NO 7
|
||||
|
||||
#elif defined(__IAR_SYSTEMS_ICC__)
|
||||
/* defined in iar/errno.h
|
||||
#define EDOM 33
|
||||
#define ERANGE 34
|
||||
#define EFPOS 35
|
||||
#define EILSEQ 36
|
||||
*/
|
||||
#define ERROR_BASE_NO 36
|
||||
|
||||
#else
|
||||
#define ERROR_BASE_NO 0
|
||||
#endif
|
||||
|
||||
#if defined(__ARMCC_VERSION) || defined(__IAR_SYSTEMS_ICC__)
|
||||
#include <errno.h>
|
||||
|
||||
#ifndef EPERM
|
||||
#define EPERM (ERROR_BASE_NO + 1)
|
||||
#endif
|
||||
|
||||
#ifndef ENOENT
|
||||
#define ENOENT (ERROR_BASE_NO + 2)
|
||||
#endif
|
||||
|
||||
#ifndef ESRCH
|
||||
#define ESRCH (ERROR_BASE_NO + 3)
|
||||
#endif
|
||||
|
||||
#ifndef EINTR
|
||||
#define EINTR (ERROR_BASE_NO + 4)
|
||||
#endif
|
||||
|
||||
#ifndef EIO
|
||||
#define EIO (ERROR_BASE_NO + 5)
|
||||
#endif
|
||||
|
||||
#ifndef ENXIO
|
||||
#define ENXIO (ERROR_BASE_NO + 6)
|
||||
#endif
|
||||
|
||||
#ifndef E2BIG
|
||||
#define E2BIG (ERROR_BASE_NO + 7)
|
||||
#endif
|
||||
|
||||
#ifndef ENOEXEC
|
||||
#define ENOEXEC (ERROR_BASE_NO + 8)
|
||||
#endif
|
||||
|
||||
#ifndef EBADF
|
||||
#define EBADF (ERROR_BASE_NO + 9)
|
||||
#endif
|
||||
|
||||
#ifndef ECHILD
|
||||
#define ECHILD (ERROR_BASE_NO + 10)
|
||||
#endif
|
||||
|
||||
#ifndef EAGAIN
|
||||
#define EAGAIN (ERROR_BASE_NO + 11)
|
||||
#endif
|
||||
|
||||
#ifndef ENOMEM
|
||||
#define ENOMEM (ERROR_BASE_NO + 12)
|
||||
#endif
|
||||
|
||||
#ifndef EACCES
|
||||
#define EACCES (ERROR_BASE_NO + 13)
|
||||
#endif
|
||||
|
||||
#ifndef EFAULT
|
||||
#define EFAULT (ERROR_BASE_NO + 14)
|
||||
#endif
|
||||
|
||||
#ifndef ENOTBLK
|
||||
#define ENOTBLK (ERROR_BASE_NO + 15)
|
||||
#endif
|
||||
|
||||
#ifndef EBUSY
|
||||
#define EBUSY (ERROR_BASE_NO + 16)
|
||||
#endif
|
||||
|
||||
#ifndef EEXIST
|
||||
#define EEXIST (ERROR_BASE_NO + 17)
|
||||
#endif
|
||||
|
||||
#ifndef EXDEV
|
||||
#define EXDEV (ERROR_BASE_NO + 18)
|
||||
#endif
|
||||
|
||||
#ifndef ENODEV
|
||||
#define ENODEV (ERROR_BASE_NO + 19)
|
||||
#endif
|
||||
|
||||
#ifndef ENOTDIR
|
||||
#define ENOTDIR (ERROR_BASE_NO + 20)
|
||||
#endif
|
||||
|
||||
#ifndef EISDIR
|
||||
#define EISDIR (ERROR_BASE_NO + 21)
|
||||
#endif
|
||||
|
||||
#ifndef EINVAL
|
||||
#define EINVAL (ERROR_BASE_NO + 22)
|
||||
#endif
|
||||
|
||||
#ifndef ENFILE
|
||||
#define ENFILE (ERROR_BASE_NO + 23)
|
||||
#endif
|
||||
|
||||
#ifndef EMFILE
|
||||
#define EMFILE (ERROR_BASE_NO + 24)
|
||||
#endif
|
||||
|
||||
#ifndef ENOTTY
|
||||
#define ENOTTY (ERROR_BASE_NO + 25)
|
||||
#endif
|
||||
|
||||
#ifndef ETXTBSY
|
||||
#define ETXTBSY (ERROR_BASE_NO + 26)
|
||||
#endif
|
||||
|
||||
#ifndef EFBIG
|
||||
#define EFBIG (ERROR_BASE_NO + 27)
|
||||
#endif
|
||||
|
||||
#ifndef ENOSPC
|
||||
#define ENOSPC (ERROR_BASE_NO + 28)
|
||||
#endif
|
||||
|
||||
#ifndef ESPIPE
|
||||
#define ESPIPE (ERROR_BASE_NO + 29)
|
||||
#endif
|
||||
|
||||
#ifndef EROFS
|
||||
#define EROFS (ERROR_BASE_NO + 30)
|
||||
#endif
|
||||
|
||||
#ifndef EMLINK
|
||||
#define EMLINK (ERROR_BASE_NO + 31)
|
||||
#endif
|
||||
|
||||
#ifndef EPIPE
|
||||
#define EPIPE (ERROR_BASE_NO + 32)
|
||||
#endif
|
||||
|
||||
#ifndef EDOM
|
||||
#define EDOM (ERROR_BASE_NO + 33)
|
||||
#endif
|
||||
|
||||
#ifndef ERANGE
|
||||
#define ERANGE (ERROR_BASE_NO + 34)
|
||||
#endif
|
||||
|
||||
#ifndef EDEADLK
|
||||
#define EDEADLK (ERROR_BASE_NO + 35)
|
||||
#endif
|
||||
|
||||
#ifndef ENAMETOOLONG
|
||||
#define ENAMETOOLONG (ERROR_BASE_NO + 36)
|
||||
#endif
|
||||
|
||||
#ifndef ENOLCK
|
||||
#define ENOLCK (ERROR_BASE_NO + 37)
|
||||
#endif
|
||||
|
||||
#ifndef ENOSYS
|
||||
#define ENOSYS (ERROR_BASE_NO + 38)
|
||||
#endif
|
||||
|
||||
#ifndef ENOTEMPTY
|
||||
#define ENOTEMPTY (ERROR_BASE_NO + 39)
|
||||
#endif
|
||||
|
||||
#ifndef ELOOP
|
||||
#define ELOOP (ERROR_BASE_NO + 40)
|
||||
#endif
|
||||
|
||||
#ifndef EWOULDBLOCK
|
||||
#define EWOULDBLOCK EAGAIN
|
||||
#endif
|
||||
|
||||
#ifndef ENOMSG
|
||||
#define ENOMSG (ERROR_BASE_NO + 42)
|
||||
#endif
|
||||
|
||||
#ifndef EIDRM
|
||||
#define EIDRM (ERROR_BASE_NO + 43)
|
||||
#endif
|
||||
|
||||
#ifndef ECHRNG
|
||||
#define ECHRNG (ERROR_BASE_NO + 44)
|
||||
#endif
|
||||
|
||||
#ifndef EL2NSYNC
|
||||
#define EL2NSYNC (ERROR_BASE_NO + 45)
|
||||
#endif
|
||||
|
||||
#ifndef EL3HLT
|
||||
#define EL3HLT (ERROR_BASE_NO + 46)
|
||||
#endif
|
||||
|
||||
#ifndef EL3RST
|
||||
#define EL3RST (ERROR_BASE_NO + 47)
|
||||
#endif
|
||||
|
||||
#ifndef ELNRNG
|
||||
#define ELNRNG (ERROR_BASE_NO + 48)
|
||||
#endif
|
||||
|
||||
#ifndef EUNATCH
|
||||
#define EUNATCH (ERROR_BASE_NO + 49)
|
||||
#endif
|
||||
|
||||
#ifndef ENOCSI
|
||||
#define ENOCSI (ERROR_BASE_NO + 50)
|
||||
#endif
|
||||
|
||||
#ifndef EL2HLT
|
||||
#define EL2HLT (ERROR_BASE_NO + 51)
|
||||
#endif
|
||||
|
||||
#ifndef EBADE
|
||||
#define EBADE (ERROR_BASE_NO + 52)
|
||||
#endif
|
||||
|
||||
#ifndef EBADR
|
||||
#define EBADR (ERROR_BASE_NO + 53)
|
||||
#endif
|
||||
|
||||
#ifndef EXFULL
|
||||
#define EXFULL (ERROR_BASE_NO + 54)
|
||||
#endif
|
||||
|
||||
#ifndef ENOANO
|
||||
#define ENOANO (ERROR_BASE_NO + 55)
|
||||
#endif
|
||||
|
||||
#ifndef EBADRQC
|
||||
#define EBADRQC (ERROR_BASE_NO + 56)
|
||||
#endif
|
||||
|
||||
#ifndef EBADSLT
|
||||
#define EBADSLT (ERROR_BASE_NO + 57)
|
||||
#endif
|
||||
|
||||
#ifndef EDEADLOCK
|
||||
#define EDEADLOCK EDEADLK
|
||||
#endif
|
||||
|
||||
#ifndef EBFONT
|
||||
#define EBFONT (ERROR_BASE_NO + 59)
|
||||
#endif
|
||||
|
||||
#ifndef ENOSTR
|
||||
#define ENOSTR (ERROR_BASE_NO + 60)
|
||||
#endif
|
||||
|
||||
#ifndef ENODATA
|
||||
#define ENODATA (ERROR_BASE_NO + 61)
|
||||
#endif
|
||||
|
||||
#ifndef ETIME
|
||||
#define ETIME (ERROR_BASE_NO + 62)
|
||||
#endif
|
||||
|
||||
#ifndef ENOSR
|
||||
#define ENOSR (ERROR_BASE_NO + 63)
|
||||
#endif
|
||||
|
||||
#ifndef ENONET
|
||||
#define ENONET (ERROR_BASE_NO + 64)
|
||||
#endif
|
||||
|
||||
#ifndef ENOPKG
|
||||
#define ENOPKG (ERROR_BASE_NO + 65)
|
||||
#endif
|
||||
|
||||
#ifndef EREMOTE
|
||||
#define EREMOTE (ERROR_BASE_NO + 66)
|
||||
#endif
|
||||
|
||||
#ifndef ENOLINK
|
||||
#define ENOLINK (ERROR_BASE_NO + 67)
|
||||
#endif
|
||||
|
||||
#ifndef EADV
|
||||
#define EADV (ERROR_BASE_NO + 68)
|
||||
#endif
|
||||
|
||||
#ifndef ESRMNT
|
||||
#define ESRMNT (ERROR_BASE_NO + 69)
|
||||
#endif
|
||||
|
||||
#ifndef ECOMM
|
||||
#define ECOMM (ERROR_BASE_NO + 70)
|
||||
#endif
|
||||
|
||||
#ifndef EPROTO
|
||||
#define EPROTO (ERROR_BASE_NO + 71)
|
||||
#endif
|
||||
|
||||
#ifndef EMULTIHOP
|
||||
#define EMULTIHOP (ERROR_BASE_NO + 72)
|
||||
#endif
|
||||
|
||||
#ifndef EDOTDOT
|
||||
#define EDOTDOT (ERROR_BASE_NO + 73)
|
||||
#endif
|
||||
|
||||
#ifndef EBADMSG
|
||||
#define EBADMSG (ERROR_BASE_NO + 74)
|
||||
#endif
|
||||
|
||||
#ifndef EOVERFLOW
|
||||
#define EOVERFLOW (ERROR_BASE_NO + 75)
|
||||
#endif
|
||||
|
||||
#ifndef ENOTUNIQ
|
||||
#define ENOTUNIQ (ERROR_BASE_NO + 76)
|
||||
#endif
|
||||
|
||||
#ifndef EBADFD
|
||||
#define EBADFD (ERROR_BASE_NO + 77)
|
||||
#endif
|
||||
|
||||
#ifndef EREMCHG
|
||||
#define EREMCHG (ERROR_BASE_NO + 78)
|
||||
#endif
|
||||
|
||||
#ifndef ELIBACC
|
||||
#define ELIBACC (ERROR_BASE_NO + 79)
|
||||
#endif
|
||||
|
||||
#ifndef ELIBBAD
|
||||
#define ELIBBAD (ERROR_BASE_NO + 80)
|
||||
#endif
|
||||
|
||||
#ifndef ELIBSCN
|
||||
#define ELIBSCN (ERROR_BASE_NO + 81)
|
||||
#endif
|
||||
|
||||
#ifndef ELIBMAX
|
||||
#define ELIBMAX (ERROR_BASE_NO + 82)
|
||||
#endif
|
||||
|
||||
#ifndef ELIBEXEC
|
||||
#define ELIBEXEC (ERROR_BASE_NO + 83)
|
||||
#endif
|
||||
|
||||
#ifndef EILSEQ
|
||||
#define EILSEQ (ERROR_BASE_NO + 84)
|
||||
#endif
|
||||
|
||||
#ifndef ERESTART
|
||||
#define ERESTART (ERROR_BASE_NO + 85)
|
||||
#endif
|
||||
|
||||
#ifndef ESTRPIPE
|
||||
#define ESTRPIPE (ERROR_BASE_NO + 86)
|
||||
#endif
|
||||
|
||||
#ifndef EUSERS
|
||||
#define EUSERS (ERROR_BASE_NO + 87)
|
||||
#endif
|
||||
|
||||
#ifndef ENOTSOCK
|
||||
#define ENOTSOCK (ERROR_BASE_NO + 88)
|
||||
#endif
|
||||
|
||||
#ifndef EDESTADDRREQ
|
||||
#define EDESTADDRREQ (ERROR_BASE_NO + 89)
|
||||
#endif
|
||||
|
||||
#ifndef EMSGSIZE
|
||||
#define EMSGSIZE (ERROR_BASE_NO + 90)
|
||||
#endif
|
||||
|
||||
#ifndef EPROTOTYPE
|
||||
#define EPROTOTYPE (ERROR_BASE_NO + 91)
|
||||
#endif
|
||||
|
||||
#ifndef ENOPROTOOPT
|
||||
#define ENOPROTOOPT (ERROR_BASE_NO + 92)
|
||||
#endif
|
||||
|
||||
#ifndef EPROTONOSUPPORT
|
||||
#define EPROTONOSUPPORT (ERROR_BASE_NO + 93)
|
||||
#endif
|
||||
|
||||
#ifndef ESOCKTNOSUPPORT
|
||||
#define ESOCKTNOSUPPORT (ERROR_BASE_NO + 94)
|
||||
#endif
|
||||
|
||||
#ifndef EOPNOTSUPP
|
||||
#define EOPNOTSUPP (ERROR_BASE_NO + 95)
|
||||
#endif
|
||||
|
||||
#ifndef ENOTSUP
|
||||
#define ENOTSUP EOPNOTSUPP
|
||||
#endif
|
||||
|
||||
#ifndef EPFNOSUPPORT
|
||||
#define EPFNOSUPPORT (ERROR_BASE_NO + 96)
|
||||
#endif
|
||||
|
||||
#ifndef EAFNOSUPPORT
|
||||
#define EAFNOSUPPORT (ERROR_BASE_NO + 97)
|
||||
#endif
|
||||
|
||||
#ifndef EADDRINUSE
|
||||
#define EADDRINUSE (ERROR_BASE_NO + 98)
|
||||
#endif
|
||||
|
||||
#ifndef EADDRNOTAVAIL
|
||||
#define EADDRNOTAVAIL (ERROR_BASE_NO + 99)
|
||||
#endif
|
||||
|
||||
#ifndef ENETDOWN
|
||||
#define ENETDOWN (ERROR_BASE_NO + 100)
|
||||
#endif
|
||||
|
||||
#ifndef ENETUNREACH
|
||||
#define ENETUNREACH (ERROR_BASE_NO + 101)
|
||||
#endif
|
||||
|
||||
#ifndef ENETRESET
|
||||
#define ENETRESET (ERROR_BASE_NO + 102)
|
||||
#endif
|
||||
|
||||
#ifndef ECONNABORTED
|
||||
#define ECONNABORTED (ERROR_BASE_NO + 103)
|
||||
#endif
|
||||
|
||||
#ifndef ECONNRESET
|
||||
#define ECONNRESET (ERROR_BASE_NO + 104)
|
||||
#endif
|
||||
|
||||
#ifndef ENOBUFS
|
||||
#define ENOBUFS (ERROR_BASE_NO + 105)
|
||||
#endif
|
||||
|
||||
#ifndef EISCONN
|
||||
#define EISCONN (ERROR_BASE_NO + 106)
|
||||
#endif
|
||||
|
||||
#ifndef ENOTCONN
|
||||
#define ENOTCONN (ERROR_BASE_NO + 107)
|
||||
#endif
|
||||
|
||||
#ifndef ESHUTDOWN
|
||||
#define ESHUTDOWN (ERROR_BASE_NO + 108)
|
||||
#endif
|
||||
|
||||
#ifndef ETOOMANYREFS
|
||||
#define ETOOMANYREFS (ERROR_BASE_NO + 109)
|
||||
#endif
|
||||
|
||||
#ifndef ETIMEDOUT
|
||||
#define ETIMEDOUT (ERROR_BASE_NO + 110)
|
||||
#endif
|
||||
|
||||
#ifndef ECONNREFUSED
|
||||
#define ECONNREFUSED (ERROR_BASE_NO + 111)
|
||||
#endif
|
||||
|
||||
#ifndef EHOSTDOWN
|
||||
#define EHOSTDOWN (ERROR_BASE_NO + 112)
|
||||
#endif
|
||||
|
||||
#ifndef EHOSTUNREACH
|
||||
#define EHOSTUNREACH (ERROR_BASE_NO + 113)
|
||||
#endif
|
||||
|
||||
#ifndef EALREADY
|
||||
#define EALREADY (ERROR_BASE_NO + 114)
|
||||
#endif
|
||||
|
||||
#ifndef EINPROGRESS
|
||||
#define EINPROGRESS (ERROR_BASE_NO + 115)
|
||||
#endif
|
||||
|
||||
#ifndef ESTALE
|
||||
#define ESTALE (ERROR_BASE_NO + 116)
|
||||
#endif
|
||||
|
||||
#ifndef EUCLEAN
|
||||
#define EUCLEAN (ERROR_BASE_NO + 117)
|
||||
#endif
|
||||
|
||||
#ifndef ENOTNAM
|
||||
#define ENOTNAM (ERROR_BASE_NO + 118)
|
||||
#endif
|
||||
|
||||
#ifndef ENAVAIL
|
||||
#define ENAVAIL (ERROR_BASE_NO + 119)
|
||||
#endif
|
||||
|
||||
#ifndef EISNAM
|
||||
#define EISNAM (ERROR_BASE_NO + 120)
|
||||
#endif
|
||||
|
||||
#ifndef EREMOTEIO
|
||||
#define EREMOTEIO (ERROR_BASE_NO + 121)
|
||||
#endif
|
||||
|
||||
#ifndef EDQUOT
|
||||
#define EDQUOT (ERROR_BASE_NO + 122)
|
||||
#endif
|
||||
|
||||
#ifndef ENOMEDIUM
|
||||
#define ENOMEDIUM (ERROR_BASE_NO + 123)
|
||||
#endif
|
||||
|
||||
#ifndef EMEDIUMTYPE
|
||||
#define EMEDIUMTYPE (ERROR_BASE_NO + 124)
|
||||
#endif
|
||||
|
||||
#ifndef ECANCELED
|
||||
#define ECANCELED (ERROR_BASE_NO + 125)
|
||||
#endif
|
||||
|
||||
#ifndef ENOKEY
|
||||
#define ENOKEY (ERROR_BASE_NO + 126)
|
||||
#endif
|
||||
|
||||
#ifndef EKEYEXPIRED
|
||||
#define EKEYEXPIRED (ERROR_BASE_NO + 127)
|
||||
#endif
|
||||
|
||||
#ifndef EKEYREVOKED
|
||||
#define EKEYREVOKED (ERROR_BASE_NO + 128)
|
||||
#endif
|
||||
|
||||
#ifndef EKEYREJECTED
|
||||
#define EKEYREJECTED (ERROR_BASE_NO + 129)
|
||||
#endif
|
||||
|
||||
#ifndef EOWNERDEAD
|
||||
#define EOWNERDEAD (ERROR_BASE_NO + 130)
|
||||
#endif
|
||||
|
||||
#ifndef ENOTRECOVERABLE
|
||||
#define ENOTRECOVERABLE (ERROR_BASE_NO + 131)
|
||||
#endif
|
||||
|
||||
#ifndef ERFKILL
|
||||
#define ERFKILL (ERROR_BASE_NO + 132)
|
||||
#endif
|
||||
|
||||
#ifndef EHWPOISON
|
||||
#define EHWPOISON (ERROR_BASE_NO + 133)
|
||||
#endif
|
||||
|
||||
#elif defined(_WIN32)
|
||||
#include <errno.h>
|
||||
|
||||
#endif /* defined(__ARMCC_VERSION) || defined(__IAR_SYSTEMS_ICC__) */
|
||||
|
||||
#endif /* __SYS_ERRNO_H__ */
|
91
components/libc/compilers/common/extension/sys/stat.h
Normal file
91
components/libc/compilers/common/extension/sys/stat.h
Normal file
|
@ -0,0 +1,91 @@
|
|||
/*
|
||||
* Copyright (c) 2006-2022, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2021-09-02 Meco Man First version
|
||||
*/
|
||||
|
||||
#ifndef __SYS_STAT_H__
|
||||
#define __SYS_STAT_H__
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define S_IFMT 00170000
|
||||
#define S_IFSOCK 0140000
|
||||
#define S_IFLNK 0120000
|
||||
#define S_IFREG 0100000
|
||||
#define S_IFBLK 0060000
|
||||
#define S_IFDIR 0040000
|
||||
#define S_IFCHR 0020000
|
||||
#define S_IFIFO 0010000
|
||||
#define S_ISUID 0004000
|
||||
#define S_ISGID 0002000
|
||||
#define S_ISVTX 0001000
|
||||
|
||||
#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
|
||||
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
|
||||
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
|
||||
#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
|
||||
#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
|
||||
#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
|
||||
|
||||
#define S_IRWXU 00700
|
||||
#define S_IRUSR 00400
|
||||
#define S_IWUSR 00200
|
||||
#define S_IXUSR 00100
|
||||
|
||||
#define S_IRWXG 00070
|
||||
#define S_IRGRP 00040
|
||||
#define S_IWGRP 00020
|
||||
#define S_IXGRP 00010
|
||||
|
||||
#define S_IRWXO 00007
|
||||
#define S_IROTH 00004
|
||||
#define S_IWOTH 00002
|
||||
#define S_IXOTH 00001
|
||||
|
||||
struct stat
|
||||
{
|
||||
struct rt_device *st_dev;
|
||||
uint16_t st_ino;
|
||||
uint16_t st_mode;
|
||||
uint16_t st_nlink;
|
||||
uint16_t st_uid;
|
||||
uint16_t st_gid;
|
||||
struct rt_device *st_rdev;
|
||||
uint32_t st_size;
|
||||
time_t st_atime;
|
||||
long st_spare1;
|
||||
time_t st_mtime;
|
||||
long st_spare2;
|
||||
time_t st_ctime;
|
||||
long st_spare3;
|
||||
uint32_t st_blksize;
|
||||
uint32_t st_blocks;
|
||||
long st_spare4[2];
|
||||
};
|
||||
|
||||
int chmod(const char *, mode_t);
|
||||
int fchmod(int, mode_t);
|
||||
int fstat(int, struct stat *);
|
||||
int lstat(const char *, struct stat *);
|
||||
int mkdir(const char *, mode_t);
|
||||
int mkfifo(const char *, mode_t);
|
||||
int mknod(const char *, mode_t, dev_t);
|
||||
int stat(const char *, struct stat *);
|
||||
mode_t umask(mode_t);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
46
components/libc/compilers/common/extension/sys/types.h
Normal file
46
components/libc/compilers/common/extension/sys/types.h
Normal file
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Copyright (c) 2006-2022, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2020-09-05 Meco Man fix bugs
|
||||
* 2020-12-16 Meco Man add useconds_t
|
||||
*/
|
||||
|
||||
#ifndef __SYS_TYPES_H__
|
||||
#define __SYS_TYPES_H__
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <time.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef int32_t clockid_t;
|
||||
typedef int32_t key_t; /* Used for interprocess communication. */
|
||||
typedef int pid_t; /* Used for process IDs and process group IDs. */
|
||||
typedef unsigned short uid_t;
|
||||
typedef unsigned short gid_t;
|
||||
typedef signed long off_t;
|
||||
typedef int mode_t;
|
||||
typedef signed long ssize_t; /* Used for a count of bytes or an error indication. */
|
||||
typedef unsigned long __timer_t;
|
||||
typedef __timer_t timer_t;
|
||||
typedef long suseconds_t; /* microseconds. */
|
||||
typedef unsigned long useconds_t; /* microseconds (unsigned) */
|
||||
|
||||
typedef unsigned long dev_t;
|
||||
|
||||
typedef unsigned int u_int;
|
||||
typedef unsigned char u_char;
|
||||
typedef unsigned long u_long;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue