liblua: Add loader.machine and loader.machine_arch properties
Provisioned from MACHINE/MACHINE_ARCH on the system, expose loader.machine and loader.machine_arch respectively. These may be used to hide ACPI option on non-applicable archs. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D14446
This commit is contained in:
parent
0ff4ecf5bb
commit
9982f75418
@ -28,6 +28,8 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/param.h>
|
||||
|
||||
#include "lua.h"
|
||||
#include "lauxlib.h"
|
||||
#include "lstd.h"
|
||||
@ -263,6 +265,11 @@ int
|
||||
luaopen_loader(lua_State *L)
|
||||
{
|
||||
luaL_newlib(L, loaderlib);
|
||||
/* Add loader.machine and loader.machine_arch properties */
|
||||
lua_pushstring(L, MACHINE);
|
||||
lua_setfield(L, -2, "machine");
|
||||
lua_pushstring(L, MACHINE_ARCH);
|
||||
lua_setfield(L, -2, "machine_arch");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user