Browse Source

Mount /proc and /sys when being init

libevent
Łukasz Magiera 7 years ago
parent
commit
21624f310c
  1. 1
      include/lupi.h
  2. 11
      src/c/init.c
  3. 1
      src/c/run.c

1
include/lupi.h

@ -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

@ -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);
}
}

1
src/c/run.c

@ -21,6 +21,7 @@ lua_State* getL() {
}
void run_init() {
lupi_init();
L = luaL_newstate();
luaL_openlibs (L);

Loading…
Cancel
Save