diff options
Diffstat (limited to 'cpukit/libfs/src/jffs2/include/linux/kernel-rtems.h')
-rw-r--r-- | cpukit/libfs/src/jffs2/include/linux/kernel-rtems.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/cpukit/libfs/src/jffs2/include/linux/kernel-rtems.h b/cpukit/libfs/src/jffs2/include/linux/kernel-rtems.h new file mode 100644 index 0000000000..29c4f31869 --- /dev/null +++ b/cpukit/libfs/src/jffs2/include/linux/kernel-rtems.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2013 embedded brains GmbH. All rights reserved. + * + * embedded brains GmbH + * Dornierstr. 4 + * 82178 Puchheim + * Germany + * <rtems@embedded-brains.de> + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + */ + +#ifndef __LINUX_RTEMS_IMPL_H__ +#define __LINUX_RTEMS_IMPL_H__ + +static inline char *do_kmemdup(const char *s, size_t n) +{ + char *dup = malloc(n + 1); + + if (dup != 0) { + dup[n] = '\0'; + dup = memcpy(dup, s, n); + } + + return dup; +} + +#endif /* __LINUX_RTEMS_IMPL_H__ */ |