diff options
| author | liukangcc <[email protected]> | 2021-09-17 15:03:14 +0800 |
|---|---|---|
| committer | liukangcc <[email protected]> | 2021-09-17 15:03:14 +0800 |
| commit | 4b3df6010f7870aebcd1df20bbaabd5fe9212c6d (patch) | |
| tree | 95b0e12447425f803be46d16eaf6e7188c364fec /components/libc/compilers/common/sys | |
| parent | f07507a91310bc5696a08f5bbf6ab8679cfbcf73 (diff) | |
| parent | ef71de34f76d4403fcd2cddd21a17f3a53a40296 (diff) | |
Merge remote-tracking branch 'remotes/rtt_github/master'
Diffstat (limited to 'components/libc/compilers/common/sys')
| -rw-r--r-- | components/libc/compilers/common/sys/ioctl.h | 2 | ||||
| -rw-r--r-- | components/libc/compilers/common/sys/select.h | 49 | ||||
| -rw-r--r-- | components/libc/compilers/common/sys/statfs.h | 15 | ||||
| -rw-r--r-- | components/libc/compilers/common/sys/time.h | 6 | ||||
| -rw-r--r-- | components/libc/compilers/common/sys/vfs.h | 15 |
5 files changed, 29 insertions, 58 deletions
diff --git a/components/libc/compilers/common/sys/ioctl.h b/components/libc/compilers/common/sys/ioctl.h index 51f51f2ea4..b926a71875 100644 --- a/components/libc/compilers/common/sys/ioctl.h +++ b/components/libc/compilers/common/sys/ioctl.h @@ -235,4 +235,6 @@ struct winsize { #define SIOCDEVPRIVATE 0x89F0 #define SIOCPROTOPRIVATE 0x89E0 +int ioctl(int fildes, int cmd, ...); + #endif diff --git a/components/libc/compilers/common/sys/select.h b/components/libc/compilers/common/sys/select.h deleted file mode 100644 index db42b6ebcc..0000000000 --- a/components/libc/compilers/common/sys/select.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2021-07-21 Meco Man The first version - */ - -#ifndef __SYS_SELECT_H__ -#define __SYS_SELECT_H__ - -#include <rtconfig.h> -#include <sys/types.h> - -#ifndef FD_SETSIZE -#define FD_SETSIZE 32 -#endif - -#ifdef SAL_USING_POSIX -#ifdef FD_SETSIZE -#undef FD_SETSIZE -#endif -#define FD_SETSIZE DFS_FD_MAX -#endif /* SAL_USING_POSIX */ - -#define NBBY 8 /* number of bits in a byte */ - -typedef long fd_mask; - -#define NFDBITS (sizeof (fd_mask) * NBBY) /* bits per mask */ -#ifndef howmany -#define howmany(x,y) (((x)+((y)-1))/(y)) -#endif - -#ifndef _SYS_TYPES_FD_SET /* MIPS */ -typedef struct _types_fd_set { - fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; -} _types_fd_set; -#define fd_set _types_fd_set - -#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1L << ((n) % NFDBITS))) -#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1L << ((n) % NFDBITS))) -#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1L << ((n) % NFDBITS))) -#define FD_ZERO(p) memset((void*)(p), 0, sizeof(*(p))) -#endif /* _SYS_TYPES_FD_SET */ - -#endif /* __SYS_SELECT_H__ */ diff --git a/components/libc/compilers/common/sys/statfs.h b/components/libc/compilers/common/sys/statfs.h index 0996af9a18..0c6dc44df3 100644 --- a/components/libc/compilers/common/sys/statfs.h +++ b/components/libc/compilers/common/sys/statfs.h @@ -6,16 +6,19 @@ * Change Logs: * Date Author Notes */ -#ifndef __RTT_STATFS_H__ -#define __RTT_STATFS_H__ +#ifndef __SYS_STATFS_H__ +#define __SYS_STATFS_H__ -#include <rtthread.h> +#include <stddef.h> struct statfs { - rt_size_t f_bsize; /* block size */ - rt_size_t f_blocks; /* total data blocks in file system */ - rt_size_t f_bfree; /* free blocks in file system */ + size_t f_bsize; /* block size */ + size_t f_blocks; /* total data blocks in file system */ + size_t f_bfree; /* free blocks in file system */ }; +int statfs(const char *path, struct statfs *buf); +int fstatfs(int fd, struct statfs *buf); + #endif diff --git a/components/libc/compilers/common/sys/time.h b/components/libc/compilers/common/sys/time.h index 95605d47c7..ecf6e85ac6 100644 --- a/components/libc/compilers/common/sys/time.h +++ b/components/libc/compilers/common/sys/time.h @@ -8,8 +8,8 @@ * 2020-09-07 Meco Man combine gcc armcc iccarm * 2021-02-12 Meco Man move all definitions located in <clock_time.h> to this file */ -#ifndef _SYS_TIME_H_ -#define _SYS_TIME_H_ +#ifndef __SYS_TIME_H__ +#define __SYS_TIME_H__ #include <rtconfig.h> #include <rtdef.h> @@ -74,7 +74,7 @@ struct timespec { }; #endif -/* posix clock and timer */ +/* POSIX clock and timer */ #define MILLISECOND_PER_SECOND 1000UL #define MICROSECOND_PER_SECOND 1000000UL #define NANOSECOND_PER_SECOND 1000000000UL diff --git a/components/libc/compilers/common/sys/vfs.h b/components/libc/compilers/common/sys/vfs.h new file mode 100644 index 0000000000..00739ab1c6 --- /dev/null +++ b/components/libc/compilers/common/sys/vfs.h @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2006-2021, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2021-09-11 Meco Man First version + */ +#ifndef __SYS_VFS_H__ +#define __SYS_VFS_H__ + +#include "statfs.h" /* <sys/statfs.h> */ + +#endif |
