smalloc: add zeroing scalloc() variant

Signed-off-by: Jens Axboe <axboe@fb.com>
diff --git a/smalloc.c b/smalloc.c
index 5fe0b6f..1ba9353 100644
--- a/smalloc.c
+++ b/smalloc.c
@@ -479,6 +479,17 @@
 	return NULL;
 }
 
+void *scalloc(size_t nmemb, size_t size)
+{
+	void *ret;
+
+	ret = smalloc(nmemb * size);
+	if (ret)
+		memset(ret, 0, nmemb * size);
+
+	return ret;
+}
+
 char *smalloc_strdup(const char *str)
 {
 	char *ptr;
diff --git a/smalloc.h b/smalloc.h
index f9a5e41..4b551e3 100644
--- a/smalloc.h
+++ b/smalloc.h
@@ -2,6 +2,7 @@
 #define FIO_SMALLOC_H
 
 extern void *smalloc(size_t);
+extern void *scalloc(size_t, size_t);
 extern void sfree(void *);
 extern char *smalloc_strdup(const char *);
 extern void sinit(void);