saleyn / erlexec

Execute and control OS processes from Erlang/OTP
https://hexdocs.pm/erlexec/readme.html
Other
525 stars 139 forks source link

USE_POLL is not set #172

Closed joaohf closed 8 months ago

joaohf commented 8 months ago

Hi,

I think there is an inconsistence about the USE_POLL build flag:

For example, the following build (https://github.com/saleyn/erlexec/actions/runs/7079424945/job/19266043032#step:6:24)

g++ -g -std=c++11 -finline-functions -Wall -DHAVE_PTRACE -MMD -O3 -DNDEBUG -mavx2 -DHAVE_SETRESUID -DHAVE_PIPE2   -I/usr/local/lib/erlang/erts-13.2.2.3/include -I/usr/local/lib/erlang/lib/erl_interface-5.3.2/include  -c -o ei++.o ei++.cpp
g++ -g -std=c++11 -finline-functions -Wall -DHAVE_PTRACE -MMD -O3 -DNDEBUG -mavx2 -DHAVE_SETRESUID -DHAVE_PIPE2   -I/usr/local/lib/erlang/erts-13.2.2.3/include -I/usr/local/lib/erlang/lib/erl_interface-5.3.2/include  -c -o exec.o exec.cpp
g++ -g -std=c++11 -finline-functions -Wall -DHAVE_PTRACE -MMD -O3 -DNDEBUG -mavx2 -DHAVE_SETRESUID -DHAVE_PIPE2   -I/usr/local/lib/erlang/erts-13.2.2.3/include -I/usr/local/lib/erlang/lib/erl_interface-5.3.2/include  -c -o exec_impl.o exec_impl.cpp

I can't see the flag USE_POLL, so that means the build will use select(2) not poll(2). Is my assumption correct here ?

The readme says ( https://github.com/saleyn/erlexec?tab=readme-ov-file#building-from-source ):

By default port program's implementation uses poll(2) call for event demultiplexing. If you prefer to use select(2), set the following environment variable

However the c_src/Makefile (https://github.com/saleyn/erlexec/blob/master/c_src/Makefile#L29) does not set USE_POLL=1 as expected when I call: make

Thanks.

saleyn commented 8 months ago

Fixed