Tom Lane writes:
> The Hermit Hacker <[EMAIL PROTECTED]> writes:
> > sendmail does it now, and, apparently relatively portable across OSs ...
>
> sendmail expects to be root. It's unlikely (and very undesirable) that
> postgres will be installed with adequate privileges to read /dev/kmem,
> which is what it'd take to run the sendmail loadaverage code on most
> platforms...
This program:
#include <stdio.h>
int main()
{
double la[3];
if (getloadavg(la, 3) == -1)
perror("getloadavg");
printf("%f %f %f\n", la[0], la[1], la[2]);
return 0;
}
works unprivileged on Linux 2.2 and FreeBSD 4.3. Rumour[*] also has it
that there is a way to do this on Solaris and HP-UX 9. So I think that
covers enough users to be worthwhile.
[*] - Autoconf AC_FUNC_GETLOADAVG
--
Peter Eisentraut [EMAIL PROTECTED] http://funkturm.homeip.net/~peter
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
- Re: [HACKERS] refusing connect... The Hermit Hacker
- Re: [HACKERS] refusing connect... Tom Lane
- Re: [HACKERS] refusing connect... The Hermit Hacker
- Re: [HACKERS] refusing connect... Tom Lane
- Re: [HACKERS] refusing connect... Vince Vielhaber
- Re: [HACKERS] refusing connect... The Hermit Hacker
- Re: [HACKERS] refusing connect... Vince Vielhaber
- Re: [HACKERS] refusing connect... The Hermit Hacker
- Re: [HACKERS] refusing connect... Vince Vielhaber
- Re: [HACKERS] refusing connect... Tom Lane
- Re: [HACKERS] refusing connections based on load ..... Peter Eisentraut
- Re: [HACKERS] refusing connections based on loa... The Hermit Hacker
- [HACKERS] Re: refusing connections based on load ... Lincoln Yeoh
- Re: [HACKERS] Re: refusing connections based on loa... Nathan Myers
- [HACKERS] Re: Re: refusing connections based on... Lincoln Yeoh
- Re: [HACKERS] Re: Re: refusing connections ... The Hermit Hacker
- [HACKERS] Re: Re: Re: refusing connecti... Lincoln Yeoh
- [HACKERS] Re: refusing connections base... Nathan Myers
- Re: [HACKERS] Re: refusing connect... The Hermit Hacker
- [HACKERS] tables/indexes/logs ... Nathan Myers
- Re: [HACKERS] refusing connections based on load ... Jan Wieck
