Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * bpf-script-test-kbuild.c
0004  * Test include from kernel header
0005  */
0006 #ifndef LINUX_VERSION_CODE
0007 # error Need LINUX_VERSION_CODE
0008 # error Example: for 4.2 kernel, put 'clang-opt="-DLINUX_VERSION_CODE=0x40200" into llvm section of ~/.perfconfig'
0009 #endif
0010 #define SEC(NAME) __attribute__((section(NAME), used))
0011 
0012 #include <uapi/linux/fs.h>
0013 
0014 SEC("func=vfs_llseek")
0015 int bpf_func__vfs_llseek(void *ctx)
0016 {
0017     return 0;
0018 }
0019 
0020 char _license[] SEC("license") = "GPL";
0021 int _version SEC("version") = LINUX_VERSION_CODE;