diff options
| author | Bernard Xiong <[email protected]> | 2020-12-17 11:39:51 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-12-17 11:39:51 +0800 |
| commit | 932bbc29c63b7375bc46837b99ae6fda117a9ba0 (patch) | |
| tree | 98c0003bd99f85a1bfa25aefa15d625507e15df1 /components/libc/compilers/dlib | |
| parent | 59d964aec6d6ac142680a5f27e5774ba6ef46271 (diff) | |
| parent | ab754255407c2af40d6cea61dae1a314947d0886 (diff) | |
Merge pull request #4171 from mysterywolf/master
[emergency][posix] 实现usleep函数
Diffstat (limited to 'components/libc/compilers/dlib')
| -rw-r--r-- | components/libc/compilers/dlib/sys/types.h | 13 | ||||
| -rw-r--r-- | components/libc/compilers/dlib/sys/unistd.h | 5 |
2 files changed, 12 insertions, 6 deletions
diff --git a/components/libc/compilers/dlib/sys/types.h b/components/libc/compilers/dlib/sys/types.h index 001ace4dd2..7dbeddcaa9 100644 --- a/components/libc/compilers/dlib/sys/types.h +++ b/components/libc/compilers/dlib/sys/types.h @@ -5,20 +5,21 @@ * * Change Logs: * Date Author Notes + * 2020-12-16 Meco Man add useconds_t */ #ifndef __TYPES_H__ #define __TYPES_H__ #include <stdint.h> -#include <rtthread.h> -typedef rt_int32_t clockid_t; -typedef rt_int32_t key_t; /* Used for interprocess communication. */ -typedef rt_int32_t pid_t; /* Used for process IDs and process group IDs. */ +typedef int32_t clockid_t; +typedef int32_t key_t; /* Used for interprocess communication. */ +typedef int32_t pid_t; /* Used for process IDs and process group IDs. */ #ifndef ARCH_CPU_64BIT -typedef signed int ssize_t; /* Used for a count of bytes or an error indication. */ +typedef signed int ssize_t; /* Used for a count of bytes or an error indication. */ #else -typedef long signed int ssize_t; /* Used for a count of bytes or an error indication. */ +typedef long signed int ssize_t; /* Used for a count of bytes or an error indication. */ #endif +typedef unsigned long useconds_t; /* microseconds (unsigned) */ #endif diff --git a/components/libc/compilers/dlib/sys/unistd.h b/components/libc/compilers/dlib/sys/unistd.h index 982a29135d..6d99cd6c55 100644 --- a/components/libc/compilers/dlib/sys/unistd.h +++ b/components/libc/compilers/dlib/sys/unistd.h @@ -5,10 +5,14 @@ * * Change Logs: * Date Author Notes + * 2020-12-16 Meco Man add usleep */ #ifndef _SYS_UNISTD_H #define _SYS_UNISTD_H +#include <rtconfig.h> +#include "types.h" + #ifdef RT_USING_DFS #define STDIN_FILENO 0 /* standard input file descriptor */ @@ -41,5 +45,6 @@ int isatty (int fd); char * ttyname (int desc); unsigned int sleep(unsigned int seconds); +int usleep(useconds_t usec); #endif /* _SYS_UNISTD_H */ |
