shithub: unionfs

ref: ce768a70c40c96c6e6dbd1018306a122a4eeec43
dir: /util.c/

View raw version
#include <u.h>
#include <libc.h>
#include <thread.h>
#include "unionfs.h"

void
usage(void)
{
	fprint(2, "%s [-abiC] [-m mtpt] [-s srv] [-c] path ...\n", argv0);
	exits("usage");
}

void*
emalloc(ulong sz)
{
	void *v;

	if((v = malloc(sz)) == nil)
		sysfatal("emalloc: %r");
	memset(v, 0, sz);
	setmalloctag(v, getcallerpc(&sz));
	return v;
}

char*
estrdup(char *s)
{
	char *p;

	if((p = strdup(s)) == nil)
		sysfatal("estrdup: %r");
	setmalloctag(p, getcallerpc(&s));
	return p;
}