forked from Cpp2Rust/cpp2rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsrc.cpp
More file actions
29 lines (21 loc) · 772 Bytes
/
Copy pathsrc.cpp
File metadata and controls
29 lines (21 loc) · 772 Bytes
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
// Copyright (c) 2022-present INESC-ID.
// Distributed under the MIT license that can be found in the LICENSE file.
#include <sys/time.h>
#include <time.h>
time_t f1(time_t *tloc) { return time(tloc); }
int f2(struct timeval *tv, struct timezone *tz) {
return gettimeofday(tv, tz);
}
int f3(clockid_t clk_id, struct timespec *tp) { return clock_gettime(clk_id, tp); }
struct tm *f4(const time_t *timep, struct tm *result) {
return localtime_r(timep, result);
}
struct tm *f5(const time_t *timep, struct tm *result) {
return gmtime_r(timep, result);
}
size_t f6(char *s, size_t max, const char *fmt, const struct tm *tm) {
return strftime(s, max, fmt, tm);
}
int f7(const char *filename, const struct timeval times[2]) {
return utimes(filename, times);
}