is there a routine on sunos called uptime()? (as opposed to the shell
command). if not, is there a routine i can call in C to tell me the
number of users on a system?
regards,
tom
> is there a routine on sunos called uptime()? (as opposed to the shell
> command). if not, is there a routine i can call in C to tell me the
> number of users on a system?
stat(2) the utmp file. divide the size in bytes by the size of a
struct utmp (see utmp.h).
But this assumes that every active user on the system has exactly one
entry in the utmp file. This isn't necessarily so: some vendors leave
/etc/utmp world writeable! Also, many window systems like to create a
utmp entry for every "shell window" the user opens.
1. Uptime rollover, How to tell real uptime?
I have a linux system running 1.2.8 gcc 2.6.3 compiled Dec 28 95
According to the var/adm/messages file it was last booted on
Jan. 2, 1996. This would put the uptime at around 800 days.
Somewhere after 460 days the uptime counter must have rolled over
as the uptime given with "w" started again with low numbers.
I know it was not rebooted as there are daemons running that I started
by hand and are not in scripts.
Is there a way to get the real uptime?
Also I plan to shut it down soon as I am getting scared of fire
hazard due to lots of dust. The internal fan went out a year ago
and I have hung another fan on the back for cooling.
Is this maybe a record uptime??
Dale
=================================================================
Phone:(916)356-5332 I speak only for myself
=====================================================================
2. Installing Red Hat on Win98 box
3. How does uptime.netcraft.com know my uptime?
4. SCO 5.0 SUCKS! (OR IS IT JUST SCO?)
5. Segfaults on Server after long uptime using 2.2.x
8. "execute command" not working?
9. How to check for uptime in KDE ?
11. enable uptime display > 497 days
12. High uptimes
13. How to prevent "apm" from turning off hard drive during uptime?