Re: [PATCH] posix-timers: omit posix_cpu_timers_init_group when CONFIG_POSIX_TIMERS is disabled

From: 1425075683
Date: Thu Jun 12 2025 - 09:39:39 EST


Hi all,

My apologies—I neglected to CC both of you on my last submission. Please find below the same patch, now with the correct CC list.

---
diff --git a/kernel/fork.c b/kernel/fork.c
index 168681fc4b25a9fddcb90ce155c027551455f4ee..9632e863c17b44424fadc40b2445034ec5cd20d6 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1883,6 +1883,7 @@ void __cleanup_sighand(struct sighand_struct *sighand)
}
}

+#ifdef CONFIG_POSIX_TIMERS
/*
* Initialize POSIX timer handling for a thread group.
*/
@@ -1894,6 +1895,9 @@ static void posix_cpu_timers_init_group(struct signal_struct *sig)
cpu_limit = READ_ONCE(sig->rlim[RLIMIT_CPU].rlim_cur);
posix_cputimers_group_init(pct, cpu_limit);
}
+#else
+static inline void posix_cpu_timers_init_group(struct signal_struct *sig) { }
+#endif

static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
{

---

Thanks for your understanding!
–-
Liya Huang <1425075683@xxxxxx>