2016-02-19 17:34:47 +03:00
|
|
|
define FEATURE_TEST_TCP_REPAIR
|
2013-05-20 16:02:14 +04:00
|
|
|
|
|
|
|
#include <netinet/tcp.h>
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
struct tcp_repair_opt opts;
|
|
|
|
opts.opt_code = TCP_NO_QUEUE;
|
|
|
|
opts.opt_val = 0;
|
|
|
|
|
|
|
|
return opts.opt_val;
|
|
|
|
}
|
|
|
|
endef
|
2013-05-23 13:34:50 +04:00
|
|
|
|
2016-07-14 00:11:00 +03:00
|
|
|
define FEATURE_TEST_TCP_REPAIR_WINDOW
|
|
|
|
|
|
|
|
#include <netinet/tcp.h>
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
struct tcp_repair_window opts;
|
|
|
|
|
|
|
|
opts.snd_wl1 = 0;
|
|
|
|
|
|
|
|
return opts.snd_wl1;
|
|
|
|
}
|
|
|
|
endef
|
|
|
|
|
2016-02-19 17:34:47 +03:00
|
|
|
define FEATURE_TEST_LIBBSD_DEV
|
2014-03-25 01:30:11 +04:00
|
|
|
#include <bsd/string.h>
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
endef
|
|
|
|
|
2016-02-19 17:34:47 +03:00
|
|
|
define FEATURE_TEST_STRLCPY
|
2013-08-28 19:06:43 +04:00
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
2014-03-25 01:30:11 +04:00
|
|
|
#ifdef CONFIG_HAS_LIBBSD
|
|
|
|
# include <bsd/string.h>
|
|
|
|
#endif
|
|
|
|
|
2013-08-28 19:06:43 +04:00
|
|
|
int main(void)
|
|
|
|
{
|
2014-03-21 12:04:34 +04:00
|
|
|
return strlcpy(NULL, NULL, 0);
|
2013-08-28 19:06:43 +04:00
|
|
|
}
|
|
|
|
endef
|
2013-11-29 13:34:28 +04:00
|
|
|
|
2016-02-19 17:34:47 +03:00
|
|
|
define FEATURE_TEST_STRLCAT
|
2013-11-29 13:34:28 +04:00
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
2014-03-25 01:30:11 +04:00
|
|
|
#ifdef CONFIG_HAS_LIBBSD
|
|
|
|
# include <bsd/string.h>
|
|
|
|
#endif
|
|
|
|
|
2013-11-29 13:34:28 +04:00
|
|
|
int main(void)
|
|
|
|
{
|
2014-03-21 12:04:34 +04:00
|
|
|
return strlcat(NULL, NULL, 0);
|
2013-11-29 13:34:28 +04:00
|
|
|
}
|
|
|
|
endef
|
2014-02-03 18:40:00 +04:00
|
|
|
|
2016-02-19 17:34:47 +03:00
|
|
|
define FEATURE_TEST_PTRACE_PEEKSIGINFO
|
2014-02-03 18:40:00 +04:00
|
|
|
|
|
|
|
#include <sys/ptrace.h>
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
struct ptrace_peeksiginfo_args args = {};
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
endef
|
2014-08-06 21:56:23 +02:00
|
|
|
|
2016-02-19 17:34:47 +03:00
|
|
|
define FEATURE_TEST_SETPROCTITLE_INIT
|
2014-08-06 21:56:23 +02:00
|
|
|
|
|
|
|
#include <bsd/unistd.h>
|
|
|
|
|
|
|
|
int main(int argc, char *argv[], char *envp[])
|
|
|
|
{
|
|
|
|
setproctitle_init(argc, argv, envp);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
endef
|
2016-08-08 15:57:15 +03:00
|
|
|
|
|
|
|
define FEATURE_TEST_X86_COMPAT
|
2017-05-31 23:23:39 +03:00
|
|
|
#define __ALIGN .align 4, 0x90
|
|
|
|
#define ENTRY(name) \
|
|
|
|
.globl name; \
|
|
|
|
.type name, @function; \
|
|
|
|
__ALIGN; \
|
|
|
|
name:
|
|
|
|
|
|
|
|
#define END(sym) \
|
|
|
|
.size sym, . - sym
|
|
|
|
|
|
|
|
#define __USER32_CS 0x23
|
|
|
|
#define __USER_CS 0x33
|
|
|
|
|
|
|
|
.text
|
|
|
|
|
|
|
|
ENTRY(call32_from_64)
|
|
|
|
/* Switch into compatibility mode */
|
|
|
|
pushq \$$__USER32_CS
|
|
|
|
pushq \$$1f
|
|
|
|
lretq
|
|
|
|
1:
|
|
|
|
.code32
|
|
|
|
/* Run function and switch back */
|
|
|
|
call *%esi
|
|
|
|
jmp \$$__USER_CS,\$$1f
|
|
|
|
.code64
|
|
|
|
1:
|
|
|
|
END(call32_from_64)
|
|
|
|
|
|
|
|
ENTRY(main)
|
|
|
|
nop
|
|
|
|
END(main)
|
2016-08-08 15:57:15 +03:00
|
|
|
endef
|