fix signal handler, ringbuffer for native FreeBSD