You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kmod-anbox/SOURCES/0001-Fix-build-on-RedHat-9....

95 lines
3.4 KiB

From 92371030adbe10c12861ff9917fd251b51618fa8 Mon Sep 17 00:00:00 2001
From: tigro <tigro@msvsphere-os.ru>
Date: Mon, 21 Oct 2024 12:06:03 +0300
Subject: [PATCH] Fix build on RedHat 9.3 kernel
---
ashmem/ashmem.c | 4 ++--
binder/binder.c | 2 +-
binder/binder_alloc.c | 2 +-
binder/deps.c | 6 +++---
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/ashmem/ashmem.c b/ashmem/ashmem.c
index df9cf90..009a04e 100644
--- a/ashmem/ashmem.c
+++ b/ashmem/ashmem.c
@@ -390,7 +390,7 @@ static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
ret = -EPERM;
goto out;
}
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 14, 0)
vm_flags_clear(vma, calc_vm_may_flags(~asma->prot_mask));
#else
vma->vm_flags &= ~calc_vm_may_flags(~asma->prot_mask);
@@ -897,7 +897,7 @@ static int __init ashmem_init(void)
} else {
return -ENOMEM;
}
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(6,0,0))
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
register_shrinker(&ashmem_shrinker, "android-ashmem");
#else
register_shrinker(&ashmem_shrinker);
diff --git a/binder/binder.c b/binder/binder.c
index c0f6f12..45fa723 100644
--- a/binder/binder.c
+++ b/binder/binder.c
@@ -2238,7 +2238,7 @@ static void binder_deferred_fd_close(int fd)
init_task_work(&twcb->twork, binder_do_fd_close);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0))
twcb->file = file_close_fd(fd);
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0))
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
twcb->file = close_fd_get_file(fd);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0))
close_fd_get_file(fd, &twcb->file);
diff --git a/binder/binder_alloc.c b/binder/binder_alloc.c
index bfdec52..4663c2a 100644
--- a/binder/binder_alloc.c
+++ b/binder/binder_alloc.c
@@ -1110,7 +1110,7 @@ int binder_alloc_shrinker_init(void)
} else {
ret = -ENOMEM;
}
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(6,0,0))
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
ret = register_shrinker(&binder_shrinker, "android-binder");
#else
ret = register_shrinker(&binder_shrinker);
diff --git a/binder/deps.c b/binder/deps.c
index 63accc0..c77e720 100644
--- a/binder/deps.c
+++ b/binder/deps.c
@@ -70,7 +70,7 @@ static unsigned long kallsyms_lookup_name_wrapper(const char *name)
#endif
}
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
static struct file *(*close_fd_get_file_ptr)(unsigned int fd)
#else
static int (*close_fd_get_file_ptr)(unsigned int fd, struct file **res)
@@ -79,7 +79,7 @@ static int (*close_fd_get_file_ptr)(unsigned int fd, struct file **res)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0))
struct file *file_close_fd(unsigned int fd)
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0))
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
struct file *close_fd_get_file(unsigned int fd)
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0))
int close_fd_get_file(unsigned int fd, struct file **res)
@@ -96,7 +96,7 @@ int __close_fd_get_file(unsigned int fd, struct file **res)
close_fd_get_file_ptr = kallsyms_lookup_name_wrapper("__close_fd_get_file");
#endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
return close_fd_get_file_ptr(fd);
#else
return close_fd_get_file_ptr(fd, res);
--
2.47.0