date and time created 92/06/03 16:37:34 by elan
authorElan Amir <elan@ucbvax.Berkeley.EDU>
Thu, 4 Jun 1992 07:37:34 +0000 (23:37 -0800)
committerElan Amir <elan@ucbvax.Berkeley.EDU>
Thu, 4 Jun 1992 07:37:34 +0000 (23:37 -0800)
SCCS-vsn: bin/test/stalloc.c 1.1

usr/src/bin/test/stalloc.c [new file with mode: 0644]

diff --git a/usr/src/bin/test/stalloc.c b/usr/src/bin/test/stalloc.c
new file mode 100644 (file)
index 0000000..73b35dd
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 1988 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Kenneth Almquist.
+ *
+ * %sccs.include.redist.c%
+ */
+
+#ifndef lint
+char copyright[] =
+"@(#) Copyright (c) 1988 The Regents of the University of California.\n\
+ All rights reserved.\n";
+#endif /* not lint */
+
+#ifndef lint
+static char sccsid[] = "@(#)stalloc.c  1.1 (Berkeley) %G%";
+#endif /* not lint */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+void *
+stalloc(nbytes) 
+       int nbytes;
+{
+      register void *p;
+
+      if ((p = malloc(nbytes)) == NULL)
+           error("Out of space");
+      return p;
+}