summaryrefslogtreecommitdiffstats
path: root/cpukit/libfs/src/jffs2/include/linux/kernel-rtems.h
blob: 29c4f31869a84d32709e2c93d385f4dbdf6b032c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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__ */