blob: c22c31f43fb07181427e03ad3edb9cb1ee0b0406 (
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
|
?RCS: $Id$
?RCS:
?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
?RCS:
?RCS: You may redistribute only under the terms of the Artistic Licence,
?RCS: as specified in the README file that comes with the distribution.
?RCS: You may reuse parts of this distribution only within the terms of
?RCS: that same Artistic Licence; a copy of which may be found at the root
?RCS: of the source tree for dist 4.0.
?RCS:
?RCS: $Log: d_times.U,v $
?RCS: Revision 3.0.1.2 1995/07/25 14:07:50 ram
?RCS: patch56: typo fix, sytem -> system
?RCS:
?RCS: Revision 3.0.1.1 1994/08/29 16:14:00 ram
?RCS: patch32: now uses new Typedef unit to compute type information
?RCS:
?RCS: Revision 3.0 1993/08/18 12:07:46 ram
?RCS: Baseline for dist 3.0 netwide release.
?RCS:
?X:
?X: What is the type returned by times() ?
?X:
?X: Force inclusion of <sys/types.h>
?X:INC: i_systypes
?MAKE:d_times clocktype: Csym Myread Typedef i_systimes
?MAKE: -pick add $@ %<
?S:d_times:
?S: This variable conditionally defines the HAS_TIMES symbol, which indicates
?S: that the times() routine exists. The times() routine is normaly
?S: provided on UNIX systems. You may have to include <sys/times.h>.
?S:.
?S:clocktype:
?S: This variable holds the type returned by times(). It can be long,
?S: or clock_t on BSD sites (in which case <sys/types.h> should be
?S: included).
?S:.
?C:HAS_TIMES (TIMES):
?C: This symbol, if defined, indicates that the times() routine exists.
?C: Note that this became obsolete on some systems (SUNOS), which now
?C: use getrusage(). It may be necessary to include <sys/times.h>.
?C:.
?C:Clock_t (CLOCKTYPE):
?C: This symbol holds the type returned by times(). It can be long,
?C: or clock_t on BSD sites (in which case <sys/types.h> should be
?C: included).
?C:.
?H:#$d_times HAS_TIMES /**/
?H:#define Clock_t $clocktype /* Clock time */
?H:.
?T:val inc
: see if times exists
echo " "
if set times val -f d_times; eval $csym; $val; then
echo 'times() found.' >&4
d_times="$define"
inc=''
case "$i_systimes" in
"$define") inc='sys/times.h';;
esac
set clock_t clocktype long stdio.h sys/types.h $inc
eval $typedef
dflt="$clocktype"
echo " "
rp="What type is returned by times() on this system?"
. ./myread
clocktype="$ans"
else
echo 'times() NOT found, hope that will do.' >&4
d_times="$undef"
?X: The following is needed for typedef (won't like an empty variable)
clocktype='int'
fi
|