rt_stubs.c 786 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * system call not available stub
  3. * based on libc's stubs.c
  4. *
  5. * Copyright (C) 2009 Analog Devices Inc.
  6. *
  7. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  8. */
  9. #include <errno.h>
  10. #include <sys/syscall.h>
  11. #ifdef __UCLIBC_HAS_STUBS__
  12. static int rt_enosys_stub(void) __attribute_used__;
  13. static int rt_enosys_stub(void)
  14. {
  15. __set_errno(ENOSYS);
  16. return -1;
  17. }
  18. #define make_stub(stub) \
  19. link_warning(stub, #stub ": this function is not implemented") \
  20. strong_alias(rt_enosys_stub, stub)
  21. #ifndef __NR_mq_timedreceive
  22. make_stub(mq_receive)
  23. # ifdef __UCLIBC_HAS_ADVANCED_REALTIME__
  24. make_stub(mq_timedreceive)
  25. # endif
  26. #endif
  27. #ifndef __NR_mq_timedsend
  28. make_stub(mq_send)
  29. # ifdef __UCLIBC_HAS_ADVANCED_REALTIME__
  30. make_stub(mq_timedsend)
  31. # endif
  32. #endif
  33. #endif