Back to index

glibc  2.9
Functions
tst-audit2.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Functions

void * calloc (size_t n, size_t m)
int main (void)

Function Documentation

void* calloc ( size_t  n,
size_t  m 
)

Definition at line 19 of file tst-audit2.c.

{
#if HAVE___THREAD
  if (magic[0] != MAGIC1 || magic[1] != MAGIC2)
    {
      printf ("{%x, %x} != {%x, %x}\n", magic[0], magic[1], MAGIC1, MAGIC2);
      abort ();
    }
  magic[0] = MAGIC2;
  magic[1] = MAGIC1;
#endif

  n *= m;
  void *ptr = malloc (n);
  if (ptr != NULL)
    memset (ptr, '\0', n);
  return ptr;
}

Here is the call graph for this function:

int main ( void  )

Definition at line 39 of file tst-audit2.c.

{
#if HAVE___THREAD
  if (magic[1] != MAGIC1 || magic[0] != MAGIC2)
    {
      printf ("{%x, %x} != {%x, %x}\n", magic[0], magic[1], MAGIC2, MAGIC1);
      return 1;
    }
#endif

  return 0;
}

Here is the call graph for this function: