On Sat, Jul 18, 2020 at 06:41:31PM -0000, Dimitri Karamazov wrote:
> I guess this is another deprecated api that is removed in OpenBSD,
> can anyone suggest a replacement for this? I've attached the code
> which utilizes it below.
>
> normalize.cpp:557:3: error: use of undeclared identifier 'sigset'
> sigset(SIGUSR1, increase_verbosity);
> ^
> normalize.cpp:558:3: error: use of undeclared identifier 'sigset'
> sigset(SIGUSR2, decrease_verbosity);
> ^
> 2 errors generated.
> Error while executing c++ -DHAVE_CONFIG_H -I. -I../../../code -I../../../code
> -I./.. -DINSTALLDIR="/usr/local/bin"
> -I/usr/local/include -D__STDC_LIMIT_MACROS -D_4ti2_GMP_ -O2 -pipe -MT
> normalize.lo -MD -MP -MF .deps/normalize.Tpo -c
> normalize.cpp -fPIC -DPIC -o .libs/normalize.o
> *** Error 1 in code/latte/normalize (Makefile:1050 'normalize.lo')
> *** Error 1 in code/latte (Makefile:2538 'all-recursive': @fail=; if
> (target_option=k; case ${target_option-} in ?)
> ;; *) echo "am__make_...)
> *** Error 1 in code (Makefile:870 'all-recursive': @fail=; if
> (target_option=k; case ${target_option-} in ?) ;; *)
> echo "am__make_running...)
> *** Error 2 in code (Makefile:782 'all')
> *** Error 1 in /usr/ports/pobj/latte-integrale/latte-version_1_7_5
> (Makefile:939 'all-recursive': @fail=; if
> (target_option=k; case ${targe...)
> *** Error 2 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2925
> '/usr/ports/pobj/latte-integrale/.build_done': @cd
> /usr/ports/pobj/latte-int...)
> *** Error 2 in /usr/ports/mystuff/math/latte-integrale
> (/usr/ports/infrastructure/mk/bsd.port.mk:2584 'build':
> @lock=latte-integrale; expor...)
>
> ----> only part which references sigset
>
> #include <signal.h>
>
> static void increase_verbosity(int sig)
> {
> verbosity++;
> cerr << "Increased verbosity to " << verbosity << endl;
> }
>
> static void decrease_verbosity(int sig)
> {
> verbosity--;
> cerr << "Decreased verbosity to " << verbosity << endl;
> }
>
> void install_verbosity_control_signal_handlers()
> {
> sigset(SIGUSR1, increase_verbosity);
> sigset(SIGUSR2, decrease_verbosity);
> }
>
>
this is an old System V idiom. See e.g.
https://man7.org/linux/man-pages/man3/sigset.3.html
-Otto