minimal plan9port to cross-build Jehanne
This commit is contained in:
15
lib/lib9/mallocz.c
Normal file
15
lib/lib9/mallocz.c
Normal file
@ -0,0 +1,15 @@
|
||||
#include <u.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <libc.h>
|
||||
|
||||
void*
|
||||
mallocz(unsigned long n, int clr)
|
||||
{
|
||||
void *v;
|
||||
|
||||
v = malloc(n);
|
||||
if(clr && v)
|
||||
memset(v, 0, n);
|
||||
return v;
|
||||
}
|
Reference in New Issue
Block a user