2014-12-17 02:47:57 +01:00
|
|
|
// Copyright (c) 2009-2014 The Bitcoin Core developers
|
2014-09-27 13:49:21 +02:00
|
|
|
// Distributed under the MIT software license, see the accompanying
|
2014-06-21 14:26:21 +02:00
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
|
|
|
#if defined(HAVE_CONFIG_H)
|
2014-06-23 20:04:24 +02:00
|
|
|
#include "config/bitcoin-config.h"
|
2014-06-21 14:26:21 +02:00
|
|
|
#endif
|
|
|
|
|
2014-04-10 04:40:33 +02:00
|
|
|
#include <cstddef>
|
2014-09-27 13:49:21 +02:00
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2014-09-25 08:23:32 +02:00
|
|
|
extern "C" void __chk_fail(void) __attribute__((__noreturn__));
|
2014-04-10 04:40:33 +02:00
|
|
|
extern "C" FDELT_TYPE __fdelt_warn(FDELT_TYPE a)
|
|
|
|
{
|
2014-06-21 14:26:21 +02:00
|
|
|
if (a >= FD_SETSIZE)
|
2014-09-25 08:23:32 +02:00
|
|
|
__chk_fail();
|
2014-06-21 14:26:21 +02:00
|
|
|
return a / __NFDBITS;
|
2014-04-10 04:40:33 +02:00
|
|
|
}
|
|
|
|
extern "C" FDELT_TYPE __fdelt_chk(FDELT_TYPE) __attribute__((weak, alias("__fdelt_warn")));
|