diff options
-rw-r--r-- | example.lua | 5 | ||||
-rw-r--r-- | modules/mymod.lua | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/example.lua b/example.lua index 324df49..91ce5ff 100644 --- a/example.lua +++ b/example.lua @@ -1,9 +1,14 @@ + privsep = require("privsep") +posix = require("posix") mymod = privsep.wrap("mymod", "mysessionid") print(mymod.myfunc("foo", false)) +print("posix.getpid:", posix.getpid().pid) +print("mymod.getpid:", mymod.getpid().pid) + diff --git a/modules/mymod.lua b/modules/mymod.lua index 1f5de06..c42b05b 100644 --- a/modules/mymod.lua +++ b/modules/mymod.lua @@ -1,7 +1,13 @@ local mymod = {} +posix = require("posix") + function mymod.myfunc(arg1, arg2) return "hello from mymod.myfunc. arg1 is '"..tostring(arg1).."' and arg2 is '"..tostring(arg2).."'" end +function mymod.getpid(...) + return posix.getpid(...) +end + return mymod |