1 /* 2 Copyright (c) 2002 Jeff Johnston <jjohnstn@redhat.com> 3 */ 4 #include <stdlib.h> 5 #include <string.h> 6 7 char * _strdup_r(struct _reent * reent_ptr,const char * str)8_strdup_r (struct _reent *reent_ptr, 9 const char *str) 10 { 11 size_t len = strlen (str) + 1; 12 char *copy = _malloc_r (reent_ptr, len); 13 if (copy) 14 { 15 memcpy (copy, str, len); 16 } 17 return copy; 18 } 19