You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

glibc_compat.cpp 834B

1234567891011121314151617181920212223242526272829
  1. // Copyright (c) 2009-2014 The Starwels developers
  2. // Distributed under the MIT software license, see the accompanying
  3. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
  4. #if defined(HAVE_CONFIG_H)
  5. #include "config/starwels-config.h"
  6. #endif
  7. #include <cstddef>
  8. #if defined(HAVE_SYS_SELECT_H)
  9. #include <sys/select.h>
  10. #endif
  11. // Prior to GLIBC_2.14, memcpy was aliased to memmove.
  12. extern "C" void* memmove(void* a, const void* b, size_t c);
  13. extern "C" void* memcpy(void* a, const void* b, size_t c)
  14. {
  15. return memmove(a, b, c);
  16. }
  17. extern "C" void __chk_fail(void) __attribute__((__noreturn__));
  18. extern "C" FDELT_TYPE __fdelt_warn(FDELT_TYPE a)
  19. {
  20. if (a >= FD_SETSIZE)
  21. __chk_fail();
  22. return a / __NFDBITS;
  23. }
  24. extern "C" FDELT_TYPE __fdelt_chk(FDELT_TYPE) __attribute__((weak, alias("__fdelt_warn")));