1
0

syscall.c 685 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright (c) 2006-2023, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2023-05-17 Flybreak the first version
  9. */
  10. #include <rtthread.h>
  11. int pico_get_errno(void)
  12. {
  13. return rt_get_errno();
  14. }
  15. #ifdef RT_USING_HEAP /* Memory routine */
  16. void *malloc(size_t n)
  17. {
  18. return rt_malloc(n);
  19. }
  20. RTM_EXPORT(malloc);
  21. void *realloc(void *rmem, size_t newsize)
  22. {
  23. return rt_realloc(rmem, newsize);
  24. }
  25. RTM_EXPORT(realloc);
  26. void *calloc(size_t nelem, size_t elsize)
  27. {
  28. return rt_calloc(nelem, elsize);
  29. }
  30. RTM_EXPORT(calloc);
  31. void free(void *rmem)
  32. {
  33. rt_free(rmem);
  34. }
  35. RTM_EXPORT(free);
  36. #endif