RTEMS CPU Kit with SuperCore  4.11.3
kernel-rtems.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 embedded brains GmbH. All rights reserved.
3  *
4  * embedded brains GmbH
5  * Dornierstr. 4
6  * 82178 Puchheim
7  * Germany
8  * <rtems@embedded-brains.de>
9  *
10  * The license and distribution terms for this file may be
11  * found in the file LICENSE in this distribution or at
12  * http://www.rtems.org/license/LICENSE.
13  */
14 
15 #ifndef __LINUX_RTEMS_IMPL_H__
16 #define __LINUX_RTEMS_IMPL_H__
17 
18 static inline char *do_kmemdup(const char *s, size_t n)
19 {
20  char *dup = malloc(n + 1);
21 
22  if (dup != 0) {
23  dup[n] = '\0';
24  dup = memcpy(dup, s, n);
25  }
26 
27  return dup;
28 }
29 
30 #endif /* __LINUX_RTEMS_IMPL_H__ */