stdlib.c 638 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (c) 2006-2018, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2021-02-15 Meco Man first version
  9. */
  10. #include <rtthread.h>
  11. void __rt_libc_exit(int status)
  12. {
  13. rt_thread_t self = rt_thread_self();
  14. #ifdef RT_USING_MODULE
  15. if (dlmodule_self())
  16. {
  17. dlmodule_exit(status);
  18. }
  19. #endif
  20. if (self != RT_NULL)
  21. {
  22. rt_kprintf("thread:%s exit:%d!\n", self->name, status);
  23. rt_thread_suspend(self);
  24. rt_schedule();
  25. }
  26. }
  27. int __rt_libc_system(const char *string)
  28. {
  29. /* TODO */
  30. return 0;
  31. }