--[[ Этот скрипт принимает данные от ipc_send и выводит в консоль ]] local syscalls = require("syscalls") -- Enable IPC event only syscalls.SetEventMask(1 << (syscalls.Event.IPC - 1)) -- write pid to /tmp0/1/lua_test_ipc_pid local pid = syscalls.ThreadInfo().PID local f = io.open("/tmp0/1/lua_test_ipc_pid", "w") if f then f:write(pid); f:close() end ------------ local buffer = syscalls.DefineIPCBuffer(4096) syscalls.IPC_buffer.Unlock(buffer) while true do print("buffer:", buffer.used .. '/' .. buffer.size, "Locked:" .. tostring(buffer.lock)) if syscalls.WaitEvent() == syscalls.Event.IPC then syscalls.IPC_buffer.Lock(buffer) print("message:", syscalls.IPC_buffer.GetLastMessage(buffer)) syscalls.IPC_buffer.Unlock(buffer) end end