[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] Källkoden till uptime.c



Kalle Andersson wrote:
> 
> # ifdef HAVE_PROC_UPTIME
>   FILE *fp;
>   double upsecs;
> 
>   fp = fopen ("/proc/uptime", "r");
>   if (fp != NULL)
>     {
>       char buf[BUFSIZ];
>       int res;
>       fgets(buf, BUFSIZ, fp);
>       res = sscanf (buf, "%lf", &upsecs);
>       if (res == 1)
>         uptime = (time_t) upsecs;
>       fclose (fp);
>     }

Tak, lige hvad jeg havde brug for. I nye versioner af procps er disse
funktioner vist gemt i nogle headerfiler.

/hroi


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:07 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *