forked from izaya/LuPPC
Mount /proc and /sys when being init
This commit is contained in:
parent
8820138c3c
commit
21624f310c
@ -22,6 +22,7 @@ void logm(const char *message);
|
||||
lua_State* getL();
|
||||
|
||||
void run_init();
|
||||
void lupi_init();
|
||||
void luanative_start(lua_State *L);
|
||||
void setup_modules(lua_State *L);
|
||||
void termutils_start(lua_State *L);
|
||||
|
11
src/c/init.c
Normal file
11
src/c/init.c
Normal file
@ -0,0 +1,11 @@
|
||||
#include "lupi.h"
|
||||
#include <sys/mount.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
void lupi_init() {
|
||||
if(getpid() == 1) {
|
||||
mount(NULL, "/sys", "sysfs", 0, NULL);
|
||||
mount(NULL, "/proc", "procfs", 0, NULL);
|
||||
}
|
||||
}
|
@ -21,6 +21,7 @@ lua_State* getL() {
|
||||
}
|
||||
|
||||
void run_init() {
|
||||
lupi_init();
|
||||
L = luaL_newstate();
|
||||
|
||||
luaL_openlibs (L);
|
||||
|
Loading…
Reference in New Issue
Block a user