2021-02-23 10:28:13 +08:00

32 lines
590 B
C

/*
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2021-02-23 Meco Man first version
*/
#include <reent.h>
#include <rtthread.h>
void * _sbrk_r(struct _reent *ptr, ptrdiff_t incr)
{
/* no use this routine to get memory */
return RT_NULL;
}
#ifdef RT_USING_HEAP
char *strdup(const char *s)
{
size_t len = strlen(s) + 1;
char *tmp = (char *)rt_malloc(len);
if(!tmp) return NULL;
rt_memcpy(tmp, s, len);
return tmp;
}
#endif /*RT_USING_HEAP*/