summaryrefslogtreecommitdiff
path: root/sys/modules/lua/stdlib.h
diff options
context:
space:
mode:
authormbalmer <mbalmer@NetBSD.org>2013-10-16 19:44:57 +0000
committermbalmer <mbalmer@NetBSD.org>2013-10-16 19:44:57 +0000
commite0fe45ce9c35c204a7c19d5a5291ca64b47b2452 (patch)
treee871dc37f16f51aff76180bb26119b0ced6630a4 /sys/modules/lua/stdlib.h
parenta1bd524499a4e93e3f6f934dc1e6f644595e0a89 (diff)
welcome lua(4), a devide driver that can create and control Lua states inside the kernel
Diffstat (limited to 'sys/modules/lua/stdlib.h')
-rw-r--r--sys/modules/lua/stdlib.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/sys/modules/lua/stdlib.h b/sys/modules/lua/stdlib.h
new file mode 100644
index 00000000000..b67b5419878
--- /dev/null
+++ b/sys/modules/lua/stdlib.h
@@ -0,0 +1,48 @@
+/* $NetBSD */
+
+/*
+ * Copyright (c) 2011, Lourival Neto <lneto@NetBSD.org>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the Author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * This file is a placeholder only, to allow Lua to be compiled from
+ * unchanged sources.
+ */
+
+#include <sys/param.h>
+#include <sys/kmem.h>
+
+#ifndef _LUA_INCLUDE_STDLIB
+#define _LUA_INCLUDE_STDLIB
+
+#define realloc(ptr, nsize) kmem_alloc(nsize, KM_SLEEP)
+#define free(ptr) kmem_free(ptr, osize)
+
+#define exit(EXIT_FAILURE) return
+
+#endif
+