From 22972409d4efd9ea2d8248024a88307615a0ca6c Mon Sep 17 00:00:00 2001 From: zhkag Date: Wed, 7 Jun 2023 11:46:18 +0800 Subject: [simulator] 修复 linux simulator 编译运行失败 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../libc/compilers/common/include/sys/time.h | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'components/libc/compilers/common/include') diff --git a/components/libc/compilers/common/include/sys/time.h b/components/libc/compilers/common/include/sys/time.h index 87be959715..7cf4c8c0d8 100644 --- a/components/libc/compilers/common/include/sys/time.h +++ b/components/libc/compilers/common/include/sys/time.h @@ -48,6 +48,33 @@ struct timezone int tz_dsttime; /* type of dst correction */ }; +#if defined(_GNU_SOURCE) && (defined(__x86_64__) || defined(__i386__)) +/* linux x86 platform gcc use! */ +#define _TIMEVAL_DEFINED +/* Values for the first argument to `getitimer' and `setitimer'. */ +enum __itimer_which +{ + /* Timers run in real time. */ + ITIMER_REAL = 0, +#define ITIMER_REAL ITIMER_REAL + /* Timers run only when the process is executing. */ + ITIMER_VIRTUAL = 1, +#define ITIMER_VIRTUAL ITIMER_VIRTUAL + /* Timers run when the process is executing and when + the system is executing on behalf of the process. */ + ITIMER_PROF = 2 +#define ITIMER_PROF ITIMER_PROF +}; + +struct itimerval +{ + /* Value to put into `it_value' when the timer expires. */ + struct timeval it_interval; + /* Time to the next timer expiration. */ + struct timeval it_value; +}; +#endif /* defined(_GNU_SOURCE) && (defined(__x86_64__) || defined(__i386__)) */ + #ifndef _TIMEVAL_DEFINED #define _TIMEVAL_DEFINED struct timeval -- cgit v1.3.1