5
Last change
on this file since c130387 was
ae5fe7e6,
checked in by Chris Johns <chrisj@…>, on 10/27/14 at 01:09:41
|
cpukit: Add libdl with the Runtime Loader (RTL) code.
This is a merge of the RTL project.
|
-
Property mode set to
100644
|
File size:
617 bytes
|
Line | |
---|
1 | /* |
---|
2 | * COPYRIGHT (c) 2012 Chris Johns <chrisj@rtems.org> |
---|
3 | * |
---|
4 | * The license and distribution terms for this file may be |
---|
5 | * found in the file LICENSE in this distribution or at |
---|
6 | * http://www.rtems.org/license/LICENSE. |
---|
7 | */ |
---|
8 | /** |
---|
9 | * @file |
---|
10 | * |
---|
11 | * @ingroup rtems_rtl |
---|
12 | * |
---|
13 | * @brief RTEMS Run-Time Linker String managment. |
---|
14 | */ |
---|
15 | |
---|
16 | #include <string.h> |
---|
17 | |
---|
18 | #include "rtl-allocator.h" |
---|
19 | #include "rtl-string.h" |
---|
20 | |
---|
21 | char* |
---|
22 | rtems_rtl_strdup (const char *s1) |
---|
23 | { |
---|
24 | size_t len = strlen (s1); |
---|
25 | char* s2 = rtems_rtl_alloc_new (RTEMS_RTL_ALLOC_OBJECT, len + 1, false); |
---|
26 | if (s2) |
---|
27 | { |
---|
28 | memcpy (s2, s1, len); |
---|
29 | s2[len] = '\0'; |
---|
30 | } |
---|
31 | return s2; |
---|
32 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.