/*
 **    Name: rmacalloc.c
 **
 **    Date: Sun Jan  5 16:31:45 2003
 **
 */

#include "rmamem.h"
#include <string.h>
#include "cserrno.h"

char *rmacalloc(size_t nmemb,size_t size)
{
    char *ptr;

    if (size != 0 && nmemb > (size_t)-1 / size)
    {
        errno = ENOMEM;
        return NULL;
    }

    ptr = rmamalloc(nmemb * size);
    if (ptr != NULL)
    {
        memset(ptr,0,nmemb * size);
    }

    return ptr;
}
