Forum > macOS / Mac OS X

Using getrusage on OSX (+linux)

(1/1)

Grahame Grieve:
I'd like to call getrusage on OSX, per https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/getrusage.2.html. Ideally, the code will also work on linux.

There's no system routine for getrusage, just an obscure message here: https://forum.lazarus.freepascal.org/index.php/topic,57914.msg431309.html#msg431309 about using syscall. I really don't know what that means.

Syscall on OSX is equally obscure... https://www.pilotlogic.com/sitejoom/index.php/forum/macos-development/5155-using-syscall-and-manipulating-file-permissions-on-macos.html - is that relevant?


How do I use either syscall or getrusage on OSX and linux? (or else, how do I get CPU usage by the process?)

thanks

Navigation

[0] Message Index

Go to full version