kernel: fix compile err on lower kernel

This commit is contained in:
weishu
2023-06-27 20:46:09 +08:00
parent 0bfd6d9e30
commit da959b4e17
3 changed files with 12 additions and 16 deletions

View File

@@ -4,6 +4,15 @@
#include "linux/fs.h"
#include "linux/key.h"
#include "linux/version.h"
#include "linux/uaccess.h"
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
#define ksu_strncpy_from_user_nofault strncpy_from_user_nofault
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)
#define ksu_strncpy_from_user_nofault strncpy_from_unsafe_user
#else
#define ksu_strncpy_from_user_nofault strncpy_from_user
#endif
extern struct key *init_session_keyring;