syscalls.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #include <string.h>
  15. #include <stdbool.h>
  16. #include <stdlib.h>
  17. #include <sys/types.h>
  18. #include <unistd.h>
  19. #include <errno.h>
  20. #include <sys/reent.h>
  21. int _system_r(struct _reent *r, const char *str)
  22. {
  23. __errno_r(r) = ENOSYS;
  24. return -1;
  25. }
  26. int _raise_r(struct _reent *r, int sig)
  27. {
  28. abort();
  29. }
  30. void* _sbrk_r(struct _reent *r, ptrdiff_t sz)
  31. {
  32. abort();
  33. }
  34. int _getpid_r(struct _reent *r)
  35. {
  36. __errno_r(r) = ENOSYS;
  37. return -1;
  38. }
  39. int _kill_r(struct _reent *r, int pid, int sig)
  40. {
  41. __errno_r(r) = ENOSYS;
  42. return -1;
  43. }
  44. void _exit(int __status)
  45. {
  46. abort();
  47. }
  48. /* No-op function, used to force linking this file,
  49. instead of the syscalls implementation from libgloss.
  50. */
  51. void newlib_include_syscalls_impl(void)
  52. {
  53. }