On Fri, Aug 23, 2019 at 04:55:19PM +0200, Henry Jensen wrote: > Not sure if ports@ is correct for this. I am trying to build e2guardian[0] > 5.3.3 on OpenBSD in order to replace dansguardian[1], which does exists > in ports but is derelict. > > > There is one obstacle. In FatController.cpp the program uses > sigtimedwait(), which doesn't exist on OpenBSD. The code snippet reads: > > timeout.tv_sec = 5; > timeout.tv_nsec = (long) 0; > rc = sigtimedwait(&signal_set, NULL, &timeout); > if (rc < 0) { > if (errno != EAGAIN) { > syslog(LOG_INFO, "%sUnexpected error from sigtimedwait() %d > %s", thread_id.c_str(), errno, strerror(errno)); > } > } else { > if (rc == SIGUSR1) > gentlereload = true; > if (rc == SIGTERM) > ttg = true; > if (rc == SIGHUP) > gentlereload = true; > #ifdef DGDEBUG > std::cerr << "signal:" << rc << std::endl; > #endif > if (o.logconerror) { > syslog(LOG_INFO, "%ssigtimedwait() signal %d recd:", > thread_id.c_str(), rc); > } > } > > > I am able to read code, but I am not a programmer. What would be the > appropriate way to replace sigtimedwait() here? > > > Henry > > [0] http://e2guardian.org/cms/index.php > [1] https://openports.pl/path/www/dansguardian
Hi, We have sigtimedwait disabled in the kernel. What is left is to gather what info userland expects to be given back from the kernel. I started on this quest a while ago, but for now I suspended it. 99% of the use-cases I found had NULL for info (just like you do bellow) and just like I did in mine. So I enabled that in a custom kernel as a temporary fix for my personal use. The point of this being that what we have works just fine for NULL info. Paul