NetBSD prefers reallocarr(3) for predictable zero-sized
allocation behavior; but no other OS seems to have reallocarr(3).
reallocarray(3) appears in by OpenBSD, FreeBSD, glibc, and musl,
so continue to go with that.
#ifndef _ALL_SOURCE
# define _ALL_SOURCE
#endif
+#if defined(__NetBSD__) && !defined(_OPENBSD_SOURCE) // for reallocarray(3)
+# define _OPENBSD_SOURCE
+#endif
#include <sys/file.h>
#include <sys/mman.h>
#include <sys/resource.h>