mirror of
https://github.com/Stichting-MINIX-Research-Foundation/netbsd.git
synced 2025-08-09 05:59:13 -04:00
22 lines
358 B
C
22 lines
358 B
C
/* $NetBSD: calloc.c,v 1.2 2009/03/18 16:00:12 cegger Exp $ */
|
|
|
|
#include <sys/cdefs.h>
|
|
#include <sys/types.h>
|
|
|
|
#include <lib/libsa/stand.h>
|
|
|
|
void *
|
|
calloc(u_int size1, u_int size2)
|
|
{
|
|
u_int total_size = size1 * size2;
|
|
void *ptr;
|
|
|
|
if(( (ptr = alloc(total_size)) != NULL)) {
|
|
memset(ptr, 0, total_size);
|
|
}
|
|
|
|
/* alloc will crib for me. */
|
|
|
|
return(ptr);
|
|
}
|