40 lines
1.3 KiB
Diff
40 lines
1.3 KiB
Diff
# HG changeset patch
|
|
# User Ian Campbell <ian.campbell@xensource.com>
|
|
# Date Wed Oct 25 13:58:30 2006 +0100
|
|
# Node ID 4dcf172e699e094bc772baa66b9dc93083332941
|
|
# parent: 5d2f91f9b2f09fc57d24ef44f3ce31a4f0a9adfb
|
|
PV-on-HVM: Kernels prior to 2.6.8 did not export strcspn to modules
|
|
therefore implement our own and export it.
|
|
|
|
Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
|
|
Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com>
|
|
Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
|
|
|
|
--- a/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c Wed Oct 25 13:58:30 2006 +0100
|
|
+++ b/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c Wed Oct 25 13:58:30 2006 +0100
|
|
@@ -9,3 +9,23 @@ static int system_state = 1;
|
|
static int system_state = 1;
|
|
EXPORT_SYMBOL(system_state);
|
|
#endif
|
|
+
|
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8)
|
|
+size_t strcspn(const char *s, const char *reject)
|
|
+{
|
|
+ const char *p;
|
|
+ const char *r;
|
|
+ size_t count = 0;
|
|
+
|
|
+ for (p = s; *p != '\0'; ++p) {
|
|
+ for (r = reject; *r != '\0'; ++r) {
|
|
+ if (*p == *r)
|
|
+ return count;
|
|
+ }
|
|
+ ++count;
|
|
+ }
|
|
+
|
|
+ return count;
|
|
+}
|
|
+EXPORT_SYMBOL(strcspn);
|
|
+#endif
|
|
|