ia64/xen-unstable

changeset 11990:4dcf172e699e

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>
author Ian Campbell <ian.campbell@xensource.com>
date Wed Oct 25 13:58:30 2006 +0100 (2006-10-25)
parents 5d2f91f9b2f0
children ac6e4405ab6c
files unmodified_drivers/linux-2.6/platform-pci/platform-compat.c
line diff
     1.1 --- a/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c	Wed Oct 25 13:58:30 2006 +0100
     1.2 +++ b/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c	Wed Oct 25 13:58:30 2006 +0100
     1.3 @@ -9,3 +9,23 @@
     1.4  static int system_state = 1;
     1.5  EXPORT_SYMBOL(system_state);
     1.6  #endif
     1.7 +
     1.8 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8)
     1.9 +size_t strcspn(const char *s, const char *reject)
    1.10 +{
    1.11 +        const char *p;
    1.12 +        const char *r;
    1.13 +        size_t count = 0;
    1.14 +
    1.15 +        for (p = s; *p != '\0'; ++p) {
    1.16 +                for (r = reject; *r != '\0'; ++r) {
    1.17 +                        if (*p == *r)
    1.18 +                                return count;
    1.19 +                }
    1.20 +                ++count;
    1.21 +        }
    1.22 +
    1.23 +        return count;
    1.24 +}
    1.25 +EXPORT_SYMBOL(strcspn);
    1.26 +#endif