erluv
erluv library implementation based on c-node.
build
to build the erlang code:
rebar3 compile
to build the C code:
# on OpenBSD
cd c_src
alias make="make -f Makefile.openbsd"
make
test
rebar3 eunit
rebar3 ct
goal
-
fully implement libuv on erlang
-
create a portable interface
-
create strong abstraction
-
use specific functions/lib based on different systems
design
erluv supports 3 implementations, the default one is with c-node, and permits to create a really strong isolation between different context. The c-node is a slave and will receive the action to execute on the underlying system.
___________ _________________________
| | | |
| main node | | different user context |
|___________| | ________ __________ |
| | | | | | |
| erluv_app |<-----| c-node | liberluv | |
|___________| | |________|__________| |
| | | |
| | system | |
| |__________| |
| _| |_ |
| \ / |
| ____\ /___ |
| | | |
| | process | |
| |__________| |
|_________________________|
The two other implementation are using liberluv as erlang nif and
ports. Those two are not recommanded due to the lack of isolation. In
case of nif and ports implementation, you can't use privilege
separation even with sudo or doas.
Issues
-
OpenBSD: both erlang package (erlang-19 and erlang-21) present in the ports tree don't export
ei.hheaders. -
OpenBSD: support on OpenBSD can, at this time, only be made for erlang-19 and erlang-21. Ports erlang-22 and erlang-23 are in progress state.
-
libuv: is not thread safe. That means we need to isolate the communication between the different subprocesses managed by c-node, nif and ports.