From bda32cdedb81270e319f4e7ee5f10f912000a9ea Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Mon, 11 Apr 2022 13:39:42 -0400 Subject: [libc] fix that some function cannot be found in unistd.h --- .../libc/compilers/common/extension/sys/unistd.h | 57 ---------------------- .../libc/compilers/common/extension/unistd.h | 10 ---- components/libc/compilers/common/sys/unistd.h | 57 ++++++++++++++++++++++ components/libc/compilers/common/unistd.h | 10 ++++ 4 files changed, 67 insertions(+), 67 deletions(-) delete mode 100644 components/libc/compilers/common/extension/sys/unistd.h delete mode 100644 components/libc/compilers/common/extension/unistd.h create mode 100644 components/libc/compilers/common/sys/unistd.h create mode 100644 components/libc/compilers/common/unistd.h diff --git a/components/libc/compilers/common/extension/sys/unistd.h b/components/libc/compilers/common/extension/sys/unistd.h deleted file mode 100644 index 2b8ca33260..0000000000 --- a/components/libc/compilers/common/extension/sys/unistd.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2020-12-16 Meco Man add usleep - * 2021-09-11 Meco Man move functions from dfs_posix.h to unistd.h - */ - -#ifndef __SYS_UNISTD_H__ -#define __SYS_UNISTD_H__ - -#include -#include "types.h" /* */ - -#ifdef __cplusplus -extern "C" { -#endif - -#define STDIN_FILENO 0 /* standard input file descriptor */ -#define STDOUT_FILENO 1 /* standard output file descriptor */ -#define STDERR_FILENO 2 /* standard error file descriptor */ - -unsigned alarm(unsigned __secs); -ssize_t read(int fd, void *buf, size_t len); -ssize_t write(int fd, const void *buf, size_t len); -off_t lseek(int fd, off_t offset, int whence); -int pause(void); -int fsync(int fildes); -long sysconf(int __name); -int unlink(const char *pathname); -int close(int d); -int ftruncate(int fd, off_t length); -int rmdir(const char *path); -int chdir(const char *path); -char *getcwd(char *buf, size_t size); -int access(const char *path, int amode); -int pipe(int fildes[2]); -int isatty(int fd); -char *ttyname(int desc); -unsigned int sleep(unsigned int seconds); -int usleep(useconds_t usec); -pid_t gettid(void); -pid_t getpid(void); -pid_t getppid(void); -uid_t getuid(void); -uid_t geteuid(void); -gid_t getgid(void); -gid_t getegid(void); - -#ifdef __cplusplus -} -#endif - -#endif /* _SYS_UNISTD_H */ diff --git a/components/libc/compilers/common/extension/unistd.h b/components/libc/compilers/common/extension/unistd.h deleted file mode 100644 index 4dd71c842e..0000000000 --- a/components/libc/compilers/common/extension/unistd.h +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - */ - -#include "sys/unistd.h" diff --git a/components/libc/compilers/common/sys/unistd.h b/components/libc/compilers/common/sys/unistd.h new file mode 100644 index 0000000000..fcf6e342e7 --- /dev/null +++ b/components/libc/compilers/common/sys/unistd.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2006-2021, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2020-12-16 Meco Man add usleep + * 2021-09-11 Meco Man move functions from dfs_posix.h to unistd.h + */ + +#ifndef __SYS_UNISTD_H__ +#define __SYS_UNISTD_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define STDIN_FILENO 0 /* standard input file descriptor */ +#define STDOUT_FILENO 1 /* standard output file descriptor */ +#define STDERR_FILENO 2 /* standard error file descriptor */ + +unsigned alarm(unsigned __secs); +ssize_t read(int fd, void *buf, size_t len); +ssize_t write(int fd, const void *buf, size_t len); +off_t lseek(int fd, off_t offset, int whence); +int pause(void); +int fsync(int fildes); +long sysconf(int __name); +int unlink(const char *pathname); +int close(int d); +int ftruncate(int fd, off_t length); +int rmdir(const char *path); +int chdir(const char *path); +char *getcwd(char *buf, size_t size); +int access(const char *path, int amode); +int pipe(int fildes[2]); +int isatty(int fd); +char *ttyname(int desc); +unsigned int sleep(unsigned int seconds); +int usleep(useconds_t usec); +pid_t gettid(void); +pid_t getpid(void); +pid_t getppid(void); +uid_t getuid(void); +uid_t geteuid(void); +gid_t getgid(void); +gid_t getegid(void); + +#ifdef __cplusplus +} +#endif + +#endif /* _SYS_UNISTD_H */ diff --git a/components/libc/compilers/common/unistd.h b/components/libc/compilers/common/unistd.h new file mode 100644 index 0000000000..4dd71c842e --- /dev/null +++ b/components/libc/compilers/common/unistd.h @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2006-2021, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + */ + +#include "sys/unistd.h" -- cgit v1.3.1