David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 2 | /* |
| 3 | * bpf-script-test-kbuild.c |
| 4 | * Test include from kernel header |
| 5 | */ |
| 6 | #ifndef LINUX_VERSION_CODE |
| 7 | # error Need LINUX_VERSION_CODE |
| 8 | # error Example: for 4.2 kernel, put 'clang-opt="-DLINUX_VERSION_CODE=0x40200" into llvm section of ~/.perfconfig' |
| 9 | #endif |
| 10 | #define SEC(NAME) __attribute__((section(NAME), used)) |
| 11 | |
| 12 | #include <uapi/linux/fs.h> |
| 13 | |
| 14 | SEC("func=vfs_llseek") |
| 15 | int bpf_func__vfs_llseek(void *ctx) |
| 16 | { |
| 17 | return 0; |
| 18 | } |
| 19 | |
| 20 | char _license[] SEC("license") = "GPL"; |
| 21 | int _version SEC("version") = LINUX_VERSION_CODE; |