kernel: Enable macro protection for sulog

- Only enabled on kernel versions greater than 5.10.245
This commit is contained in:
ShirkNeko
2025-10-25 00:48:02 +08:00
parent 163424673f
commit 1ea6af52a0
4 changed files with 73 additions and 27 deletions

View File

@@ -2,7 +2,15 @@
#define __KSU_SULOG_H
#include <linux/types.h>
#include <linux/version.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 245)
#define __SULOG_GATE 1
#else
#define __SULOG_GATE 0
#endif
#if __SULOG_GATE
extern struct timezone sys_tz;
#define SULOG_PATH "/data/adb/ksu/log/sulog.log"
@@ -49,5 +57,6 @@ void ksu_sulog_report_syscall(uid_t uid, const char *comm, const char *syscall,
int ksu_sulog_init(void);
void ksu_sulog_exit(void);
#endif // __SULOG_GATE
#endif /* __KSU_SULOG_H */