newlib_stub.c 471 B

1234567891011121314151617181920212223242526272829303132
  1. #include <rtthread.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <sys/time.h>
  5. /* some newlib leaked function in CodeSourcery G++ Lite for MIPS version */
  6. int
  7. getpid()
  8. {
  9. return 0;
  10. }
  11. int
  12. gettimeofday(struct timeval *__tp, void *__tzp)
  13. {
  14. struct timespec tp;
  15. if (libc_get_time(&tp) == 0)
  16. {
  17. if (__tp != RT_NULL)
  18. {
  19. __tp->tv_sec = tp.tv_sec;
  20. __tp->tv_usec = tp.tv_nsec * 1000UL;
  21. }
  22. return tp.tv_sec;
  23. }
  24. return 0;
  25. }