diff mbox

[1/2] Change some head files in cpuidle_kill.c for pm-qa in Android system.

Message ID 1338446897-1967-1-git-send-email-kejun.zhou@linaro.org
State New
Headers show

Commit Message

Kejun ZHOU May 31, 2012, 6:48 a.m. UTC
Signed-off-by: kejun.zhou <kejun.zhou@linaro.org>
---
 cpuidle/cpuidle_killer.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/cpuidle/cpuidle_killer.c b/cpuidle/cpuidle_killer.c
index 67a675e..5e7320f 100644
--- a/cpuidle/cpuidle_killer.c
+++ b/cpuidle/cpuidle_killer.c
@@ -2,7 +2,19 @@ 
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
+#ifndef ANDROID
 #include <sys/timex.h>
+#else
+/* 
+* As of 4.0.4, Bionic doesn't provide the timex/adjtimex interface However, the kernel does.
+*/
+#include <linux/timex.h> /* for struct timex */
+#include <asm/unistd.h> /* for __NR_adjtimex */
+static int adjtimex(struct timex *buf)
+{
+	return syscall(__NR_adjtimex, buf);
+}
+#endif
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <sys/param.h>