From d6dcb996847b547e1e980884fbc06966293a7f6a Mon Sep 17 00:00:00 2001 From: James Buren Date: Sun, 11 Jul 2021 13:48:26 +0000 Subject: [PATCH] uisimulator: implement sim_modtime Change-Id: I1094632df092ba63605631333e939cf30b585a59 --- uisimulator/common/filesystem-sim.c | 10 ++++++++++ uisimulator/common/filesystem-sim.h | 1 + 2 files changed, 11 insertions(+) diff --git a/uisimulator/common/filesystem-sim.c b/uisimulator/common/filesystem-sim.c index 766beb3fda..8d7fb14931 100644 --- a/uisimulator/common/filesystem-sim.c +++ b/uisimulator/common/filesystem-sim.c @@ -569,6 +569,16 @@ int sim_rename(const char *old, const char *new) return rc; } +int sim_modtime(const char *path, time_t modtime) +{ + char ospath[SIM_TMPBUF_MAX_PATH]; + + if (sim_get_os_path(ospath, path, sizeof (ospath)) < 0) + return false; + + return os_modtime(ospath, modtime); +} + off_t sim_filesize(int fildes) { struct filestr_desc *filestr = get_filestr(fildes); diff --git a/uisimulator/common/filesystem-sim.h b/uisimulator/common/filesystem-sim.h index 7c46c449d8..346d6fa74e 100644 --- a/uisimulator/common/filesystem-sim.h +++ b/uisimulator/common/filesystem-sim.h @@ -68,6 +68,7 @@ ssize_t sim_read(int fildes, void *buf, size_t nbyte); ssize_t sim_write(int fildes, const void *buf, size_t nbyte); int sim_remove(const char *path); int sim_rename(const char *old, const char *new); +int sim_modtime(const char *path, time_t modtime); off_t sim_filesize(int fildes); int sim_fsamefile(int fildes1, int fildes2); int sim_relate(const char *path1, const char *path2);