aditya0yadav commented on code in PR #18331:
URL: https://github.com/apache/nuttx/pull/18331#discussion_r2760499335
##########
arch/sim/src/sim/posix/sim_hosttime.c:
##########
@@ -119,19 +133,36 @@ void host_sleepuntil(uint64_t nsec)
int host_settimer(uint64_t nsec)
{
- struct itimerspec tspec =
- {
- 0
- };
+#ifdef NUTTX_DARWIN
+ /* macOS implementation using setitimer() */
+
+ struct itimerval it;
+ uint64_t usec = nsec / 1000;
+
+ it.it_value.tv_sec = usec / 1000000;
+ it.it_value.tv_usec = usec % 1000000;
+
+ /* One-shot timer */
+ it.it_interval.tv_sec = 0;
+ it.it_interval.tv_usec = 0;
+
+ return setitimer(ITIMER_REAL, &it, NULL);
Review Comment:
@xiaoxiang781216 Ok i will do that
Any suggestion about linker
for to use sim in macos , we need to disable the gcov
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]