mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-06 09:21:49 +00:00
lxip: provide strncpy and strstr (for ipconfig)
This commit is contained in:
parent
2f0d90e0e1
commit
4bc34f73f3
@ -466,6 +466,7 @@ DUMMY(-1, static_key_enabled)
|
|||||||
DUMMY(-1, static_key_slow_dec)
|
DUMMY(-1, static_key_slow_dec)
|
||||||
DUMMY(-1, static_key_slow_inc)
|
DUMMY(-1, static_key_slow_inc)
|
||||||
DUMMY(-1, strcat)
|
DUMMY(-1, strcat)
|
||||||
|
DUMMY(-1, strsep)
|
||||||
DUMMY(-1, strncpy_from_user)
|
DUMMY(-1, strncpy_from_user)
|
||||||
DUMMY(-1, synchronize_rcu_expedited)
|
DUMMY(-1, synchronize_rcu_expedited)
|
||||||
DUMMY(-1, sysctl_igmp_max_msf)
|
DUMMY(-1, sysctl_igmp_max_msf)
|
||||||
|
@ -166,6 +166,12 @@ char *strcpy(char *to, const char *from)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
char *strncpy(char *dst, const char* src, size_t n)
|
||||||
|
{
|
||||||
|
return Genode::strncpy(dst, src, n);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
char *strchr(const char *p, int ch)
|
char *strchr(const char *p, int ch)
|
||||||
{
|
{
|
||||||
char c;
|
char c;
|
||||||
@ -247,6 +253,30 @@ size_t strlcpy(char *dest, const char *src, size_t size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* from linux/lib/string.c */
|
||||||
|
char *strstr(char const *s1, char const *s2)
|
||||||
|
{
|
||||||
|
size_t l1, l2;
|
||||||
|
|
||||||
|
l2 = strlen(s2);
|
||||||
|
if (!l2)
|
||||||
|
return (char *)s1;
|
||||||
|
l1 = strlen(s1);
|
||||||
|
while (l1 >= l2) {
|
||||||
|
l1--;
|
||||||
|
if (!memcmp(s1, s2, l2))
|
||||||
|
return (char *)s1;
|
||||||
|
s1++;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void *memset(void *s, int c, size_t n)
|
||||||
|
{
|
||||||
|
return Genode::memset(s, c, n);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void *memcpy(void *d, const void *s, size_t n)
|
void *memcpy(void *d, const void *s, size_t n)
|
||||||
{
|
{
|
||||||
return Genode::memcpy(d, s, n);
|
return Genode::memcpy(d, s, n);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user