summaryrefslogtreecommitdiff
path: root/components/libc/compilers/common/sys
diff options
context:
space:
mode:
Diffstat (limited to 'components/libc/compilers/common/sys')
-rw-r--r--components/libc/compilers/common/sys/ioctl.h2
-rw-r--r--components/libc/compilers/common/sys/select.h49
-rw-r--r--components/libc/compilers/common/sys/statfs.h15
-rw-r--r--components/libc/compilers/common/sys/time.h6
-rw-r--r--components/libc/compilers/common/sys/vfs.h15
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