1 // SPDX-License-Identifier: GPL-2.0
6 * Copyright (C) 1991, 1992 Linus Torvalds
9 #include <linux/types.h>
10 #include <linux/string.h>
12 #ifndef __HAVE_ARCH_STRSTR
14 * strstr - Find the first substring in a %NUL terminated string
15 * @s1: The string to be searched
16 * @s2: The string to search for
18 char *strstr(const char *s1
, const char *s2
)
28 if (!memcmp(s1
, s2
, l2
))
36 #ifndef __HAVE_ARCH_STRNCMP
38 * strncmp - Compare two length-limited strings
41 * @count: The maximum number of bytes to compare
43 int strncmp(const char *cs
, const char *ct
, size_t count
)
51 return c1
< c2
? -1 : 1;