~ubuntu-branches/debian/squeeze/ntp/squeeze-201010051545

« back to all changes in this revision

Viewing changes to util/timetrim.c

  • Committer: Bazaar Package Importer
  • Author(s): Matt Zimmerman
  • Date: 2004-10-11 16:10:27 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20041011161027-icyjbji8ujym633o
Tags: 1:4.2.0a-10ubuntu2
Use ntp.ubuntulinux.org instead of pool.ntp.org

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifdef sgi
 
1
#if defined(sgi) || defined(_UNICOSMP)
2
2
/*
3
3
 * timetrim.c
4
4
 * 
31
31
#ifdef HAVE_SYS_SYSSGI_H
32
32
# include <sys/syssgi.h>
33
33
#endif
 
34
#ifdef HAVE_SYS_SYSTUNE_H
 
35
# include <sys/systune.h>
 
36
#endif
34
37
 
35
38
#define abs(X) (((X) < 0) ? -(X) : (X))
36
39
#define USAGE "usage: timetrim [-n] [[-i] value]\n"
62
65
                }
63
66
        }
64
67
 
 
68
#ifdef HAVE_SYS_SYSSGI_H
65
69
        if (syssgi(SGI_GETTIMETRIM, &timetrim) < 0) {
66
70
                perror("syssgi");
67
71
                exit(2);
68
72
        }
 
73
#endif
 
74
#ifdef HAVE_SYS_SYSTUNE_H
 
75
        if (systune(SYSTUNE_GET, "timetrim", &timetrim) < 0) {
 
76
                perror("systune");
 
77
                exit(2);
 
78
        }
 
79
#endif
69
80
 
70
81
        if (argc == 0) {
71
82
                if (ntpunits)
87
98
                    timetrim += value;
88
99
                else
89
100
                    timetrim = value;
 
101
#ifdef HAVE_SYS_SYSSGI_H
90
102
                if (syssgi(SGI_SETTIMETRIM, timetrim) < 0) {
91
103
                        perror("syssgi");
92
104
                        exit(2);
93
105
                }
 
106
#endif
 
107
#ifdef HAVE_SYS_SYSTUNE_H
 
108
                if (systune(SYSTUNE_SET, "timer", "timetrim", &timetrim) < 0) {
 
109
                        perror("systune");
 
110
                        exit(2);
 
111
                }
 
112
#endif
94
113
        }
95
114
        return 0;
96
115
}