diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2023-08-31 13:20:45 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2023-08-31 13:20:45 -0400 |
commit | 1814db83c049f3ab3e9a185b57a82f0ab53e58d3 (patch) | |
tree | f9f2314b23fa64888caada4972978c0411ca2265 /tools/testing/selftests/kvm/lib/string_override.c | |
parent | 0d15bf966d7d47ba9630c4fc6e04860449cc2aab (diff) | |
parent | c92b922a8c526e1bb11945a703cba9f85976de7e (diff) |
Merge tag 'kvm-x86-selftests-6.6' of https://github.com/kvm-x86/linux into HEAD
KVM: x86: Selftests changes for 6.6:
- Add testcases to x86's sync_regs_test for detecting KVM TOCTOU bugs
- Add support for printf() in guest code and covert all guest asserts to use
printf-based reporting
- Clean up the PMU event filter test and add new testcases
- Include x86 selftests in the KVM x86 MAINTAINERS entry
Diffstat (limited to 'tools/testing/selftests/kvm/lib/string_override.c')
-rw-r--r-- | tools/testing/selftests/kvm/lib/string_override.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/testing/selftests/kvm/lib/string_override.c b/tools/testing/selftests/kvm/lib/string_override.c index 632398adc229..5d1c87277c49 100644 --- a/tools/testing/selftests/kvm/lib/string_override.c +++ b/tools/testing/selftests/kvm/lib/string_override.c @@ -37,3 +37,12 @@ void *memset(void *s, int c, size_t count) *xs++ = c; return s; } + +size_t strnlen(const char *s, size_t count) +{ + const char *sc; + + for (sc = s; count-- && *sc != '\0'; ++sc) + /* nothing */; + return sc - s; +} |