mirror of
https://github.com/lkl/linux.git
synced 2025-12-19 16:13:19 +09:00
lkl: follow up fixes after v5.1 merge (y2038)
This commit fixups the 32-bit compat syscall to properly work under new time_t 64bit environment. Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
This commit is contained in:
@@ -413,7 +413,10 @@ static int do_entry(const char *_src, const char *_dst, const char *name)
|
||||
if (cptofs) {
|
||||
struct lkl_timespec lkl_ts[] = { atime, mtime };
|
||||
|
||||
ret = lkl_sys_utimensat(-1, dst, lkl_ts, LKL_AT_SYMLINK_NOFOLLOW);
|
||||
ret = lkl_sys_utimensat(-1, dst,
|
||||
(struct __lkl__kernel_timespec
|
||||
*)lkl_ts,
|
||||
LKL_AT_SYMLINK_NOFOLLOW);
|
||||
} else {
|
||||
struct timespec ts[] = {
|
||||
{ .tv_sec = atime.tv_sec, .tv_nsec = atime.tv_nsec, },
|
||||
|
||||
@@ -64,6 +64,14 @@ static inline int lkl_sys_fstatfs(unsigned int fd, struct lkl_statfs *buf)
|
||||
return lkl_sys_fstatfs64(fd, sizeof(*buf), buf);
|
||||
}
|
||||
|
||||
static inline int lkl_sys_nanosleep_time32(struct lkl_timespec *rqtp,
|
||||
struct lkl_timespec *rmtp)
|
||||
{
|
||||
long p[6] = {(long)rqtp, (long)rmtp, 0, 0, 0, 0};
|
||||
|
||||
return lkl_syscall(__lkl__NR_nanosleep, p);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static inline int lkl_sys_stat(const char *path, struct lkl_stat *buf)
|
||||
@@ -281,7 +289,8 @@ static inline long lkl_sys_select(int n, lkl_fd_set *rfds, lkl_fd_set *wfds,
|
||||
ts.tv_sec = extra_secs > max_time - tv->tv_sec ?
|
||||
max_time : tv->tv_sec + extra_secs;
|
||||
}
|
||||
return lkl_sys_pselect6(n, rfds, wfds, efds, tv ? &ts : 0, data);
|
||||
return lkl_sys_pselect6(n, rfds, wfds, efds, tv ?
|
||||
(struct __lkl__kernel_timespec *)&ts : 0, data);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -292,6 +301,7 @@ static inline long lkl_sys_select(int n, lkl_fd_set *rfds, lkl_fd_set *wfds,
|
||||
static inline long lkl_sys_poll(struct lkl_pollfd *fds, int n, int timeout)
|
||||
{
|
||||
return lkl_sys_ppoll(fds, n, timeout >= 0 ?
|
||||
(struct __lkl__kernel_timespec *)
|
||||
&((struct lkl_timespec){ .tv_sec = timeout/1000,
|
||||
.tv_nsec = timeout%1000*1000000 }) : 0,
|
||||
0, _LKL_NSIG/8);
|
||||
|
||||
@@ -275,7 +275,8 @@ long lkl_umount_timeout(char *path, int flags, long timeout_ms)
|
||||
do {
|
||||
err = lkl_sys_umount(path, flags);
|
||||
if (err == -LKL_EBUSY) {
|
||||
lkl_sys_nanosleep(&ts, NULL);
|
||||
lkl_sys_nanosleep((struct __lkl__kernel_timespec *)&ts,
|
||||
NULL);
|
||||
timeout_ms -= incr / 1000000;
|
||||
}
|
||||
} while (err == -LKL_EBUSY && timeout_ms > 0);
|
||||
|
||||
@@ -451,7 +451,8 @@ static int lklfuse_utimens(const char *path, const struct timespec tv[2])
|
||||
ts[1].tv_sec = tv[0].tv_sec;
|
||||
ts[1].tv_nsec = tv[0].tv_nsec;
|
||||
|
||||
return lkl_sys_utimensat(-1, path, ts, LKL_AT_SYMLINK_NOFOLLOW);
|
||||
return lkl_sys_utimensat(-1, path, (struct __lkl__kernel_timespec *)ts,
|
||||
LKL_AT_SYMLINK_NOFOLLOW);
|
||||
}
|
||||
|
||||
static int lklfuse_fallocate(const char *path, int mode, off_t offset,
|
||||
|
||||
@@ -34,7 +34,7 @@ int lkl_test_nanosleep(void)
|
||||
long ret;
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &start);
|
||||
ret = lkl_sys_nanosleep(&ts, NULL);
|
||||
ret = lkl_sys_nanosleep((struct __lkl__kernel_timespec *)&ts, NULL);
|
||||
clock_gettime(CLOCK_MONOTONIC, &stop);
|
||||
|
||||
delta = 1e9*(stop.tv_sec - start.tv_sec) +
|
||||
|
||||
@@ -87,7 +87,7 @@ static int lkl_test_sleep(void)
|
||||
};
|
||||
int ret;
|
||||
|
||||
ret = lkl_sys_nanosleep(&ts, NULL);
|
||||
ret = lkl_sys_nanosleep((struct __lkl__kernel_timespec *)&ts, NULL);
|
||||
if (ret < 0) {
|
||||
lkl_test_logf("nanosleep error: %s\n", lkl_strerror(ret));
|
||||
return TEST_FAILURE;
|
||||
|
||||
Reference in New Issue
Block a user