mk-standalone

standalone mk from 9base
git clone git://git.evenfri.xyz/mk-standalone.git
Log | Files | Refs | README

mallocz.c (189B)


      1 #include <u.h>
      2 #include <unistd.h>
      3 #include <string.h>
      4 #include <libc.h>
      5 
      6 void*
      7 mallocz(unsigned long n, int clr)
      8 {
      9 	void *v;
     10 
     11 	v = malloc(n);
     12 	if(clr && v)
     13 		memset(v, 0, n);
     14 	return v;
     15 }