[zeromq-dev] How to catch SIGUSR1 in czmq?

Michael Haberler mail17 at mah.priv.at
Tue Aug 9 01:38:49 CEST 2016

> Am 06.08.2016 um 09:00 schrieb yaqian wu <yaqianwu08 at outlook.com>:
> Hi
>      I want to catch and handle SIGUSR1 to interrupt zstr_recv function to terminate my child process.In ZSYS,I only find method to catch SIGINT and SIGTERM.
>      Can anyone help,ths.

Use signalfd() and monitor that file descriptor in the event loop. Then it's all in-band, not with the crazy signal handler semantics which is asking for trouble.

See https://github.com/machinekit/machinekit/blob/master/src/machinetalk/haltalk/haltalk_main.cc for example usage.


> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev

More information about the zeromq-dev mailing list