Commit | Line | Data |
---|---|---|
d8875586 MBT |
1 | ?RCS: $Id: d_times.U 1 2006-08-24 12:32:52Z rmanfredi $ |
2 | ?RCS: | |
3 | ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi | |
4 | ?RCS: | |
5 | ?RCS: You may redistribute only under the terms of the Artistic Licence, | |
6 | ?RCS: as specified in the README file that comes with the distribution. | |
7 | ?RCS: You may reuse parts of this distribution only within the terms of | |
8 | ?RCS: that same Artistic Licence; a copy of which may be found at the root | |
9 | ?RCS: of the source tree for dist 4.0. | |
10 | ?RCS: | |
11 | ?RCS: $Log: d_times.U,v $ | |
12 | ?RCS: Revision 3.0.1.2 1995/07/25 14:07:50 ram | |
13 | ?RCS: patch56: typo fix, sytem -> system | |
14 | ?RCS: | |
15 | ?RCS: Revision 3.0.1.1 1994/08/29 16:14:00 ram | |
16 | ?RCS: patch32: now uses new Typedef unit to compute type information | |
17 | ?RCS: | |
18 | ?RCS: Revision 3.0 1993/08/18 12:07:46 ram | |
19 | ?RCS: Baseline for dist 3.0 netwide release. | |
20 | ?RCS: | |
21 | ?X: | |
22 | ?X: What is the type returned by times() ? | |
23 | ?X: | |
24 | ?X: Force inclusion of <sys/types.h> | |
25 | ?X:INC: i_systypes | |
26 | ?MAKE:d_times clocktype: Csym Myread Typedef i_systimes | |
27 | ?MAKE: -pick add $@ %< | |
28 | ?S:d_times: | |
29 | ?S: This variable conditionally defines the HAS_TIMES symbol, which indicates | |
30 | ?S: that the times() routine exists. The times() routine is normaly | |
31 | ?S: provided on UNIX systems. You may have to include <sys/times.h>. | |
32 | ?S:. | |
33 | ?S:clocktype: | |
34 | ?S: This variable holds the type returned by times(). It can be long, | |
35 | ?S: or clock_t on BSD sites (in which case <sys/types.h> should be | |
36 | ?S: included). | |
37 | ?S:. | |
38 | ?C:HAS_TIMES (TIMES): | |
39 | ?C: This symbol, if defined, indicates that the times() routine exists. | |
40 | ?C: Note that this became obsolete on some systems (SUNOS), which now | |
41 | ?C: use getrusage(). It may be necessary to include <sys/times.h>. | |
42 | ?C:. | |
43 | ?C:Clock_t (CLOCKTYPE): | |
44 | ?C: This symbol holds the type returned by times(). It can be long, | |
45 | ?C: or clock_t on BSD sites (in which case <sys/types.h> should be | |
46 | ?C: included). | |
47 | ?C:. | |
48 | ?H:#$d_times HAS_TIMES /**/ | |
49 | ?H:#define Clock_t $clocktype /* Clock time */ | |
50 | ?H:. | |
51 | ?T:val inc | |
52 | : see if times exists | |
53 | echo " " | |
54 | if set times val -f d_times; eval $csym; $val; then | |
55 | echo 'times() found.' >&4 | |
56 | d_times="$define" | |
57 | inc='' | |
58 | case "$i_systimes" in | |
59 | "$define") inc='sys/times.h';; | |
60 | esac | |
61 | set clock_t clocktype long stdio.h sys/types.h $inc | |
62 | eval $typedef | |
63 | dflt="$clocktype" | |
64 | echo " " | |
65 | rp="What type is returned by times() on this system?" | |
66 | . ./myread | |
67 | clocktype="$ans" | |
68 | else | |
69 | echo 'times() NOT found, hope that will do.' >&4 | |
70 | d_times="$undef" | |
71 | ?X: The following is needed for typedef (won't like an empty variable) | |
72 | clocktype='int' | |
73 | fi | |
74 |