1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
|
define FEATURE_TEST_TCP_REPAIR
#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
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
define FEATURE_TEST_LIBBSD_DEV
#include <bsd/string.h>
int main(void)
{
return 0;
}
endef
define FEATURE_TEST_STRLCPY
#include <string.h>
#ifdef CONFIG_HAS_LIBBSD
# include <bsd/string.h>
#endif
int main(void)
{
return strlcpy(NULL, NULL, 0);
}
endef
define FEATURE_TEST_STRLCAT
#include <string.h>
#ifdef CONFIG_HAS_LIBBSD
# include <bsd/string.h>
#endif
int main(void)
{
return strlcat(NULL, NULL, 0);
}
endef
define FEATURE_TEST_PTRACE_PEEKSIGINFO
#include <sys/ptrace.h>
int main(void)
{
struct ptrace_peeksiginfo_args args = {};
return 0;
}
endef
define FEATURE_TEST_SETPROCTITLE_INIT
#include <bsd/unistd.h>
int main(int argc, char *argv[], char *envp[])
{
setproctitle_init(argc, argv, envp);
return 0;
}
endef
define FEATURE_TEST_X86_COMPAT
#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)
/* Push return address and 64-bit segment descriptor */
sub \$$4, %rsp
movl \$$__USER_CS,(%rsp)
sub \$$4, %rsp
/* Using rip-relative addressing to get rid of R_X86_64_32S relocs */
leaq 2f(%rip),%r12
movl %r12d,(%rsp)
/* Switch into compatibility mode */
pushq \$$__USER32_CS
/* Using rip-relative addressing to get rid of R_X86_64_32S relocs */
leaq 1f(%rip), %r12
pushq %r12
lretq
1: .code32
/* Run function and switch back */
call *%esi
lret
2: .code64
/* Restore the stack */
mov (%rsp),%rsp
add \$$8, %rdi
END(call32_from_64)
ENTRY(main)
nop
END(main)
endef
define FEATURE_TEST_NFTABLES_LIB_API_0
#include <string.h>
#include <nftables/libnftables.h>
int main(int argc, char **argv)
{
return nft_run_cmd_from_buffer(nft_ctx_new(NFT_CTX_DEFAULT), \"cmd\", strlen(\"cmd\"));
}
endef
define FEATURE_TEST_NFTABLES_LIB_API_1
#include <nftables/libnftables.h>
int main(int argc, char **argv)
{
return nft_run_cmd_from_buffer(nft_ctx_new(NFT_CTX_DEFAULT), \"cmd\");
}
endef
define FEATURE_TEST_MEMFD_CREATE
#include <sys/mman.h>
#include <stddef.h>
int main(void)
{
return memfd_create(NULL, 0);
}
endef
define FEATURE_TEST_OPENAT2
#include <linux/openat2.h>
int main(void)
{
if (RESOLVE_NO_XDEV > 0)
return 0;
return 0;
}
endef
|