2014-06-21 14:26:21 +02:00
|
|
|
// Copyright (c) 2009-2014 The Bitcoin developers
|
|
|
|
// Distributed under the MIT/X11 software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
|
|
|
#if defined(HAVE_CONFIG_H)
|
2014-04-10 04:40:33 +02:00
|
|
|
#include "bitcoin-config.h"
|
2014-06-21 14:26:21 +02:00
|
|
|
#endif
|
|
|
|
|
2014-04-10 04:40:33 +02:00
|
|
|
#include <cstddef>
|
2014-06-21 14:26:21 +02:00
|
|
|
#if defined(HAVE_SYS_SELECT_H)
|
2014-04-10 04:40:33 +02:00
|
|
|
#include <sys/select.h>
|
2014-06-21 14:26:21 +02:00
|
|
|
#endif
|
2014-04-10 04:40:33 +02:00
|
|
|
|
|
|
|
// Prior to GLIBC_2.14, memcpy was aliased to memmove.
|
|
|
|
extern "C" void* memmove(void* a, const void* b, size_t c);
|
|
|
|
extern "C" void* memcpy(void* a, const void* b, size_t c)
|
|
|
|
{
|
2014-06-21 14:26:21 +02:00
|
|
|
return memmove(a, b, c);
|
2014-04-10 04:40:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
extern "C" void __chk_fail (void) __attribute__((__noreturn__));
|
|
|
|
extern "C" FDELT_TYPE __fdelt_warn(FDELT_TYPE a)
|
|
|
|
{
|
2014-06-21 14:26:21 +02:00
|
|
|
if (a >= FD_SETSIZE)
|
|
|
|
__chk_fail ();
|
|
|
|
return a / __NFDBITS;
|
2014-04-10 04:40:33 +02:00
|
|
|
}
|
|
|
|
extern "C" FDELT_TYPE __fdelt_chk(FDELT_TYPE) __attribute__((weak, alias("__fdelt_warn")));
|