summaryrefslogtreecommitdiffstats
path: root/usr.sbin/xntpd/lib/machines.c
blob: f7a400c1d5dbc213655c5aee7414c0c90dca0576 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
 * provide special support for peculiar architectures
 *
 * Real bummers unite !
 */

#ifdef SYS_PTX
#include <sys/types.h>
#include <sys/procstats.h>
int settimeofday(tvp)
	struct timeval *tvp;
{
	return stime(&tvp->tv_sec);	/* lie as bad as SysVR4 */
}

int gettimeofday(tvp)
	struct timeval *tvp;
{
	/*
	 * hi, this is Sequents sneak path to get to a clock
	 * this is also the most logical syscall for such a function
	 */
	return get_process_stats(tvp, PS_SELF, (struct procstats *) 0,
				 (struct procstats *) 0);
}
#endif

#ifdef SYS_HPUX
/* hpux.c,v 3.1 1993/07/06 01:08:23 jbj Exp
 * hpux.c -- compatibility routines for HP-UX.
 * XXX many of these are not needed anymore.
 */
#include "ntp_machine.h"

#ifdef	HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <stdio.h>

#include "ntp_stdlib.h"

#if (SYS_HPUX < 8)
char 
*index(s, c)
register char *s;
register int c;
{
    return strchr (s, c);
}


char 
*rindex(s, c)
register char *s;
register int c;
{
    return strrchr (s, c);
}


int 
bcmp(a, b, count)
register char *a, *b;
register int count;
{
    return memcmp (a, b, count);
}


void 
bcopy(from, to, count)
register char *from;
register char *to;
register int count;
{
   if ((to == from) || (count <= 0))
       return;

   if ((to > from) && (to <= (from + count))) {
       to += count;
       from += count;

       do {
	   *--to = *--from;
       }   while (--count);
   }
   else {
       do {
	   *to++ = *from++;
       }   while (--count);
   }
}


void 
bzero(area, count)
register char *area;
register int count;
{
    memset(area, 0, count);
}
#endif


getdtablesize()
{
    return(sysconf(_SC_OPEN_MAX));
}


int 
setlinebuf(a_stream)
    FILE *a_stream;
{
    return setvbuf(a_stream, (char *) NULL, _IOLBF, 0);
}

#endif
OpenPOWER on IntegriCloud