Commit | Line | Data |
---|---|---|
5d52f3dc JH |
1 | ?RCS: |
2 | ?RCS: Copyright (c) 1999, Jarkko Hietaniemi | |
0065f4af | 3 | ?RCS: |
5d52f3dc JH |
4 | ?RCS: You may redistribute only under the terms of the Artistic Licence, |
5 | ?RCS: as specified in the README file that comes with the distribution. | |
6 | ?RCS: You may reuse parts of this distribution only within the terms of | |
7 | ?RCS: that same Artistic Licence; a copy of which may be found at the root | |
8 | ?RCS: of the source tree for dist 3.0. | |
9 | ?RCS: | |
0f00356b | 10 | ?MAKE:pidsize: Myread Typedef pidtype Compile run |
5d52f3dc JH |
11 | ?MAKE: -pick add $@ %< |
12 | ?S:pidsize: | |
13 | ?S: This variable contains the size of a pidtype in bytes. | |
14 | ?S:. | |
d048fb47 | 15 | ?C:Pid_t_size: |
5d52f3dc JH |
16 | ?C: This symbol holds the size of a Pid_t in bytes. |
17 | ?C:. | |
d048fb47 | 18 | ?H:#define Pid_t_size $pidsize /* PID size */ |
5d52f3dc | 19 | ?H:. |
67d5479e | 20 | ?T:yyy zzz |
0065f4af | 21 | ?F:!try |
0065f4af | 22 | : Check size of PID |
5d52f3dc | 23 | echo " " |
67d5479e JH |
24 | case "$pidtype" in |
25 | *_t) zzz="$pidtype" ;; | |
26 | *) zzz="pid" ;; | |
27 | esac | |
0065f4af | 28 | echo "Checking the size of $zzz..." >&4 |
67d5479e | 29 | cat > try.c <<EOCP |
5d52f3dc JH |
30 | #include <sys/types.h> |
31 | #include <stdio.h> | |
32 | int main() { | |
37a56d0d | 33 | printf("%d\n", (int)sizeof($pidtype)); |
b8fb7a32 | 34 | exit(0); |
5d52f3dc JH |
35 | } |
36 | EOCP | |
384e0155 | 37 | set try |
65b9a706 | 38 | if eval $compile_ok; then |
0f00356b | 39 | yyy=`$run ./try` |
5d52f3dc JH |
40 | case "$yyy" in |
41 | '') pidsize=4 | |
42 | echo "(I can't execute the test program--guessing $pidsize.)" >&4 | |
43 | ;; | |
44 | *) pidsize=$yyy | |
67d5479e | 45 | echo "Your $zzz size is $pidsize bytes." |
5d52f3dc JH |
46 | ;; |
47 | esac | |
48 | else | |
49 | pidsize=4 | |
50 | echo "(I can't compile the test program--guessing $pidsize.)" >&4 | |
51 | fi | |
52 |