! \brief sigio rt version has no repeat (it doesn't make sense)*/
| 387 | #ifdef HAVE_SIGIO_RT |
| 388 | /*! \brief sigio rt version has no repeat (it doesn't make sense)*/ |
| 389 | inline static int io_wait_loop_sigio_rt(io_wait_h* h, int t) |
| 390 | { |
| 391 | int n; |
| 392 | int ret; |
| 393 | struct timespec ts; |
| 394 | siginfo_t siginfo; |
| 395 | int sigio_band; |
| 396 | int sigio_fd; |
| 397 | struct fd_map* fm; |
| 398 | |
| 399 | ret=1; /* 1 event per call normally */ |
| 400 | ts.tv_sec=t; |
| 401 | ts.tv_nsec=0; |
| 402 | if (!sigismember(&h->sset, h->signo) || !sigismember(&h->sset, SIGIO)){ |
| 403 | LM_CRIT("[%s] the signal mask is not properly set!\n",h->name); |
| 404 | goto error; |
| 405 | } |
| 406 | |
| 407 | again: |
| 408 | n=sigtimedwait(&h->sset, &siginfo, &ts); |
| 409 | if (n==-1){ |
| 410 | if (errno==EINTR) goto again; /* some other signal, ignore it */ |
| 411 | else if (errno==EAGAIN){ /* timeout */ |
| 412 | ret=0; |
| 413 | goto end; |
| 414 | }else{ |
| 415 | LM_ERR("[%s] sigtimed_wait %s [%d]\n",h->name, |
| 416 | strerror(errno), errno); |
| 417 | goto error; |
| 418 | } |
| 419 | } |
| 420 | if (n!=SIGIO){ |
| 421 | #ifdef SIGINFO64_WORKARROUND |
| 422 | /* on linux siginfo.si_band is defined as long in userspace |
| 423 | * and as int kernel => on 64 bits things will break! |
| 424 | * (si_band will include si_fd, and si_fd will contain |
| 425 | * garbage) |
| 426 | * see /usr/src/linux/include/asm-generic/siginfo.h and |
| 427 | * /usr/include/bits/siginfo.h |
| 428 | * -- andrei */ |
| 429 | if (sizeof(siginfo.si_band)>sizeof(int)){ |
| 430 | sigio_band=*((int*)&siginfo.si_band); |
| 431 | sigio_fd=*(((int*)&siginfo.si_band)+1); |
| 432 | }else |
| 433 | #endif |
| 434 | { |
| 435 | sigio_band=siginfo.si_band; |
| 436 | sigio_fd=siginfo.si_fd; |
| 437 | } |
| 438 | if (siginfo.si_code==SI_SIGIO){ |
| 439 | /* old style, we don't know the event (linux 2.2.?) */ |
| 440 | LM_WARN("[%s] old style sigio interface\n",h->name); |
| 441 | fm=get_fd_map(h, sigio_fd); |
| 442 | /* we can have queued signals generated by fds not watched |
| 443 | * any more, or by fds in transition, to a child => ignore them*/ |
| 444 | if (fm->type) |
| 445 | handle_io(fm, -1,IO_WATCH_READ); |
| 446 | }else{ |
nothing calls this directly
no test coverage detected