aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/string.h
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /include/linux/string.h
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'include/linux/string.h')
-rw-r--r--include/linux/string.h22
1 files changed, 6 insertions, 16 deletions
diff --git a/include/linux/string.h b/include/linux/string.h
index ac889c5ea11..a176db2f2c8 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -1,12 +1,16 @@
1#ifndef _LINUX_STRING_H_ 1#ifndef _LINUX_STRING_H_
2#define _LINUX_STRING_H_ 2#define _LINUX_STRING_H_
3 3
4/* We don't want strings.h stuff being used by user stuff by accident */
5
6#ifndef __KERNEL__
7#include <string.h>
8#else
4 9
5#include <linux/compiler.h> /* for inline */ 10#include <linux/compiler.h> /* for inline */
6#include <linux/types.h> /* for size_t */ 11#include <linux/types.h> /* for size_t */
7#include <linux/stddef.h> /* for NULL */ 12#include <linux/stddef.h> /* for NULL */
8#include <stdarg.h> 13#include <stdarg.h>
9#include <uapi/linux/string.h>
10 14
11extern char *strndup_user(const char __user *, long); 15extern char *strndup_user(const char __user *, long);
12extern void *memdup_user(const void __user *, size_t); 16extern void *memdup_user(const void __user *, size_t);
@@ -110,7 +114,6 @@ extern int memcmp(const void *,const void *,__kernel_size_t);
110#ifndef __HAVE_ARCH_MEMCHR 114#ifndef __HAVE_ARCH_MEMCHR
111extern void * memchr(const void *,int,__kernel_size_t); 115extern void * memchr(const void *,int,__kernel_size_t);
112#endif 116#endif
113void *memchr_inv(const void *s, int c, size_t n);
114 117
115extern char *kstrdup(const char *s, gfp_t gfp); 118extern char *kstrdup(const char *s, gfp_t gfp);
116extern char *kstrndup(const char *s, size_t len, gfp_t gfp); 119extern char *kstrndup(const char *s, size_t len, gfp_t gfp);
@@ -140,18 +143,5 @@ static inline bool strstarts(const char *str, const char *prefix)
140{ 143{
141 return strncmp(str, prefix, strlen(prefix)) == 0; 144 return strncmp(str, prefix, strlen(prefix)) == 0;
142} 145}
143 146#endif
144extern size_t memweight(const void *ptr, size_t bytes);
145
146/**
147 * kbasename - return the last part of a pathname.
148 *
149 * @path: path to extract the filename from.
150 */
151static inline const char *kbasename(const char *path)
152{
153 const char *tail = strrchr(path, '/');
154 return tail ? tail + 1 : path;
155}
156
157#endif /* _LINUX_STRING_H_ */ 147#endif /* _LINUX_STRING_H_ */