Commit | Line | Data |
---|---|---|
863963f1 JH |
1 | ?RCS: $Id$ |
2 | ?RCS: | |
3 | ?RCS: Copyright (c) 2000 Jarkko Hietaniemi | |
4 | ?RCS: | |
5 | ?RCS: You may distribute under the terms of either the GNU General Public | |
6 | ?RCS: License or the Artistic License, as specified in the README file. | |
7 | ?RCS: | |
55f714b6 | 8 | ?MAKE:d_futimes: Compile cat rm run |
863963f1 JH |
9 | ?MAKE: -pick add $@ %< |
10 | ?S:d_futimes: | |
11 | ?S: This variable conditionally defines the HAS_FUTIMES symbol, which | |
12 | ?S: indicates to the C program that the futimes() routine is available. | |
13 | ?S:. | |
14 | ?C:HAS_FUTIMES: | |
15 | ?C: This symbol, if defined, indicates that the futimes routine is | |
16 | ?C: available to change file descriptor time stamps with struct timevals. | |
17 | ?C:. | |
18 | ?H:#$d_futimes HAS_FUTIMES /**/ | |
19 | ?H:. | |
20 | ?LINT:set d_futimes | |
55f714b6 SP |
21 | ?T:rc |
22 | d_futimes="$undef" | |
23 | : check for a working futimes | |
24 | echo " " | |
25 | echo "Checking for a working futimes()" >&4 | |
26 | $cat >try.c <<EOCP | |
27 | #include <stdio.h> | |
28 | #include <sys/time.h> | |
29 | #include <errno.h> | |
30 | #include <fcntl.h> | |
31 | ||
32 | int main () | |
33 | { | |
34 | int fd, rv; | |
35 | fd = open ("try.c", O_RDWR); | |
36 | if (-1 == fd) exit (1); | |
37 | rv = futimes (fd, NULL); | |
38 | exit (rv == -1 ? errno : 0); | |
39 | } | |
40 | EOCP | |
41 | set try | |
42 | if eval $compile; then | |
43 | `$run ./try` | |
44 | rc=$? | |
45 | case "$rc" in | |
46 | 0) echo "Yes, it does" >&4 | |
47 | d_futimes="$define" | |
48 | ;; | |
914abcdc | 49 | *) echo "No, it has futimes, but it isn't working ($rc) (probably harmless)" >&4 |
55f714b6 SP |
50 | ;; |
51 | esac | |
52 | else | |
914abcdc | 53 | echo "No, it does not (probably harmless)" >&4 |
55f714b6 SP |
54 | fi |
55 | $rm -f try.* try core core.try.* | |
863963f1 | 56 |