| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
#include "EXTERN.h" |
|
2
|
|
|
|
|
|
|
#include "perl.h" |
|
3
|
|
|
|
|
|
|
#include "XSUB.h" |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
#include "ppport.h" |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
#include |
|
8
|
|
|
|
|
|
|
#include |
|
9
|
|
|
|
|
|
|
#include |
|
10
|
|
|
|
|
|
|
#include |
|
11
|
|
|
|
|
|
|
#include |
|
12
|
|
|
|
|
|
|
#include |
|
13
|
|
|
|
|
|
|
#include |
|
14
|
|
|
|
|
|
|
#include |
|
15
|
|
|
|
|
|
|
|
|
16
|
4
|
|
|
|
|
|
struct timespec d2t (double d) |
|
17
|
|
|
|
|
|
|
{ |
|
18
|
|
|
|
|
|
|
struct timespec ts; |
|
19
|
4
|
|
|
|
|
|
ts.tv_sec = d; |
|
20
|
4
|
|
|
|
|
|
ts.tv_nsec = 1000000000 * (d - (unsigned long long)d); |
|
21
|
4
|
|
|
|
|
|
return ts; |
|
22
|
|
|
|
|
|
|
} |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
MODULE = utime2 PACKAGE = utime2 |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
int |
|
27
|
|
|
|
|
|
|
utime2 (atime, mtime, path) |
|
28
|
|
|
|
|
|
|
double atime |
|
29
|
|
|
|
|
|
|
double mtime |
|
30
|
|
|
|
|
|
|
const char * path |
|
31
|
|
|
|
|
|
|
INIT: |
|
32
|
|
|
|
|
|
|
struct timespec ts[2]; |
|
33
|
|
|
|
|
|
|
int fd; |
|
34
|
|
|
|
|
|
|
int rc; |
|
35
|
|
|
|
|
|
|
CODE: |
|
36
|
2
|
|
|
|
|
|
ts[0] = d2t (atime); |
|
37
|
2
|
|
|
|
|
|
ts[1] = d2t (mtime); |
|
38
|
|
|
|
|
|
|
|
|
39
|
2
|
|
|
|
|
|
rc = 0; |
|
40
|
|
|
|
|
|
|
|
|
41
|
2
|
100
|
|
|
|
|
if ((fd = open (path, O_RDONLY)) >= 0) |
|
42
|
|
|
|
|
|
|
{ |
|
43
|
1
|
50
|
|
|
|
|
if (futimens (fd, ts) == 0) |
|
44
|
1
|
|
|
|
|
|
rc = 1; |
|
45
|
1
|
|
|
|
|
|
close (fd); |
|
46
|
|
|
|
|
|
|
} |
|
47
|
|
|
|
|
|
|
|
|
48
|
2
|
100
|
|
|
|
|
RETVAL = rc; |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
OUTPUT: |
|
51
|
|
|
|
|
|
|
RETVAL |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|