From 4bfff95df70a42b4540928566e664c0349cbd8cc Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Wed, 25 Oct 2006 13:58:30 +0100 Subject: 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 Signed-off-by: K. Y. Srinivasan Signed-off-by: Tsunehisa Doi --- .../linux-2.6/platform-pci/platform-compat.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'unmodified_drivers') diff --git a/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c b/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c index c6fa5b81da..6538964ecf 100644 --- a/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c +++ b/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c @@ -9,3 +9,23 @@ 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 -- cgit v1.2.3