Project

General

Profile

« Previous | Next » 

Revision ef7ac247

Added by Nathan Scott over 17 years ago

  • ID ef7ac2472b53f760e8cc5710b5d9b2e16b238480

Replace sginap with nanosleep

Remove use of sginap from several tools. The sginap interface is
terrible for our needs in PCP - its argument is a number-of-jiffies
which means all tools using it have to multiply their time-to-sleep
by CLK_TCK at each call site. The non-IRIX implementations all then
promptly divide by CLK_TCK to get back to the parameter which they
pass to the underlying sleep routine.

Worse, since CLK_TCK is actually a large number, when using a pmie
rule with a relatively large delta (1 hour), the multiplication also
overflows, and incorrect values are reported.

This patch changes pmie and pmval (which were the tools I was using
at the time) to use the POSIX nanosleep(2) interface. Probably this
patch should go further and remove each and every reference to sginap
from the PCP source, but I've not done that at this stage. That may
also result in some autoconf cleanup, to rid us of all the usleep /
sleep / what-have-you platform-specific checks. AFAICT, nanosleep
seems to exist on every supported platform.

  • added
  • modified
  • copied
  • renamed
  • deleted