1 /* -*- buffer-read-only: t -*- vi: set ro: */
2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3 /* Copyright (C) 1991, 1996, 1997, 1998, 2002, 2003, 2004, 2006, 2007, 2009,
4 2010 Free Software Foundation, Inc.
6 This file is part of the GNU C Library.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License along
19 with this program; if not, write to the Free Software Foundation,
20 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
26 /* Get specification. */
37 # define __strdup strdup
40 /* Duplicate S, returning an identical malloc'd string. */
42 __strdup (const char *s)
44 size_t len = strlen (s) + 1;
45 void *new = malloc (len);
50 return (char *) memcpy (new, s, len);
52 #ifdef libc_hidden_def
53 libc_hidden_def (__strdup)
56 weak_alias (__strdup, strdup)