소스 검색

[keil][libc]防止开启pthread功能后 keil报错

mysterywolf 5 년 전
부모
커밋
1ad70b20ad
3개의 변경된 파일11개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      components/libc/compilers/armlibc/sys/unistd.h
  2. 7 0
      components/libc/compilers/common/sys/time.h
  3. 2 0
      components/libc/compilers/dlib/sys/unistd.h

+ 2 - 0
components/libc/compilers/armlibc/sys/unistd.h

@@ -68,4 +68,6 @@
 int     isatty      (int fd);
 char *  ttyname     (int desc);
 
+unsigned int sleep(unsigned int seconds);
+
 #endif /* _SYS_UNISTD_H */

+ 7 - 0
components/libc/compilers/common/sys/time.h

@@ -36,6 +36,13 @@ struct timeval {
 };
 #endif /* _TIMEVAL_DEFINED */
 
+#ifndef _TIMESPEC
+#define _TIMESPEC
+struct timespec {
+    time_t  tv_sec;     /* seconds */
+    long    tv_nsec;    /* and nanoseconds */
+};
+#endif
 
 struct timezone {
   int tz_minuteswest;   /* minutes west of Greenwich */

+ 2 - 0
components/libc/compilers/dlib/sys/unistd.h

@@ -40,4 +40,6 @@
 int     isatty      (int fd);
 char *  ttyname     (int desc);
 
+unsigned int sleep(unsigned int seconds);
+
 #endif /* _SYS_UNISTD_H */