File: uptime.c

package info (click to toggle)
procps 1%3A3.2.7-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,388 kB
  • ctags: 1,759
  • sloc: ansic: 14,645; sh: 1,811; makefile: 188
file content (17 lines) | stat: -rw-r--r-- 385 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdio.h>
#include <string.h>
#include "proc/whattime.h"
#include "proc/version.h"

int main(int argc, char *argv[]) {
    if(argc == 1) {
        print_uptime();
        return 0;
    }
    if((argc == 2) && (!strcmp(argv[1], "-V"))) {
        display_version();
        return 0;
    }
    fprintf(stderr, "usage: uptime [-V]\n    -V    display version\n");
    return 1;
}