Misuse of the getrusage() function #573
Labels
(Duplicate)
An issue was already created for the described problem. Please also refer to the other issue.
(*WON'T FIX*)
The requested change was rejected or the described behavior is by design.
In my quest to make Hercules compile cleanly, I came across this compiler warning from gcc 10 on NetBSD:
According to my manual, the first argument to
getrusage()
should be an integer value, eitherRUSAGE_SELF
orRUSAGE_CHILDREN
. The specified value is of typeTID
, apparently a "CPU thread id". That can't work.The linux manual page at https://linux.die.net/man/2/getrusage shows a third possible value:
RUSAGE_THREAD (since Linux 2.6.26)
which indicates the current thread, not some random specified thread.This isn't fixable with a simple patch. The whole context (looping over threads and trying to obtain each of their resource usages) is inapplicable here.
hyperion/hsccmd.c
Lines 9402 to 9409 in 65c97fd
Whatever this function (which handles the qproc command) tries to do can't be done with
getrusage()
, if at all (within POSIX), and probably needs to be re-thought. Hence no patch, sorry about that.The text was updated successfully, but these errors were encountered: