Re: Load average

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Jon Peatfield
日付:  
To: Philip Hazel
CC: exim-users, jp107
題目: Re: Load average
> Anyway, I now have code that works for all the OS that Exim supports
> except Ultrix, AIX, and SCO. Any offers? (Top marks to BSDI, NetBSD, &
> FreeBSD, which *do* have a getloadavg() function.) I'll code it so the
> facility just isn't available on any OS for which I don't have code.


I'm sure that there is an autoconf option to work all this out :-)

> The point of the post, however, is to ask a question. The code for Sun,
> IRIX and HP-UX request an "open" operation on a kernel "file" and a
> subsequent "read" to get the data. Root privilege is required for the
> open.


It only needs to be setgid kmem or equiv in fact. Mark the fd closeonexec so
noone else can get hold of it and you should be safe.

Of course that's what we thought when we added the load average code to xdm,
but xdm explicitly un-sets closeonexec on all it's fd's later...

-- Jon