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