Back to index

glibc  2.9
Defines | Functions
strdup.c File Reference

Go to the source code of this file.

Defines

#define __strdup   strdup

Functions

char * malloc ()
char * memcpy ()
char * __strdup (const char *s)

Define Documentation

#define __strdup   strdup

Definition at line 35 of file strdup.c.


Function Documentation

char* __strdup ( const char *  s)

Definition at line 40 of file strdup.c.

{
  size_t len = strlen (s) + 1;
  void *new = malloc (len);

  if (new == NULL)
    return NULL;

  return (char *) memcpy (new, s, len);
}

Here is the call graph for this function:

char* malloc ( )
char* memcpy ( )