cregit-Linux how code gets into the kernel

Release 4.14 tools/include/linux/string.h

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _TOOLS_LINUX_STRING_H_

#define _TOOLS_LINUX_STRING_H_

#include <linux/types.h>	/* for size_t */
#include <string.h>

void *memdup(const void *src, size_t len);

int strtobool(const char *s, bool *res);

/*
 * glibc based builds needs the extern while uClibc doesn't.
 * However uClibc headers also define __GLIBC__ hence the hack below
 */
#if defined(__GLIBC__) && !defined(__UCLIBC__)
extern size_t strlcpy(char *dest, const char *src, size_t size);
#endif

char *str_error_r(int errnum, char *buf, size_t buflen);

/**
 * strstarts - does @str start with @prefix?
 * @str: string to examine
 * @prefix: prefix to look for.
 */

static inline bool strstarts(const char *str, const char *prefix) { return strncmp(str, prefix, strlen(prefix)) == 0; }

Contributors

PersonTokensPropCommitsCommitProp
Arnaldo Carvalho de Melo32100.00%2100.00%
Total32100.00%2100.00%

#endif /* _LINUX_STRING_H_ */

Overall Contributors

PersonTokensPropCommitsCommitProp
Arnaldo Carvalho de Melo7863.41%555.56%
Josh Poimboeuf1915.45%111.11%
Wang Nan1310.57%111.11%
Vineet Gupta129.76%111.11%
Greg Kroah-Hartman10.81%111.11%
Total123100.00%9100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.