source: rtems/cpukit/libdl/rtl-string.c @ 990adc5

5
Last change on this file since 990adc5 was 990adc5, checked in by Sebastian Huber <sebastian.huber@…>, on 12/13/17 at 07:20:30

libdl: Include <rtems/rtl/rtl-*.h>

Prepare for header file move to common include directory.

Update #3254.

  • Property mode set to 100644
File size: 627 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 <rtems/rtl/rtl-allocator.h>
19#include "rtl-string.h"
20
21char*
22rtems_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.