summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/filesystem-unix.c
diff options
context:
space:
mode:
authorJames Buren <braewoods+rb@braewoods.net>2021-07-11 12:40:08 +0000
committerJames Buren <braewoods+rb@braewoods.net>2021-07-11 12:40:08 +0000
commitfa743258ea963b9b924204f0d80e077056cf9a6e (patch)
tree603c11a1d0e6013752e78539df43c062c58676e5 /firmware/target/hosted/filesystem-unix.c
parent8846e087c09c28a2dfb731d7c873f113bc899940 (diff)
downloadrockbox-fa743258ea963b9b924204f0d80e077056cf9a6e.tar.gz
rockbox-fa743258ea963b9b924204f0d80e077056cf9a6e.zip
filesystem: implement os_modtime for unix
Change-Id: If030d526f29aa786b5a37402413d804752286cf5
Diffstat (limited to 'firmware/target/hosted/filesystem-unix.c')
-rw-r--r--firmware/target/hosted/filesystem-unix.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/firmware/target/hosted/filesystem-unix.c b/firmware/target/hosted/filesystem-unix.c
index 177cb574e0..f0d7de640d 100644
--- a/firmware/target/hosted/filesystem-unix.c
+++ b/firmware/target/hosted/filesystem-unix.c
@@ -23,6 +23,7 @@
23#include <sys/stat.h> 23#include <sys/stat.h>
24#include <string.h> 24#include <string.h>
25#include <errno.h> 25#include <errno.h>
26#include <utime.h>
26#include "config.h" 27#include "config.h"
27#include "system.h" 28#include "system.h"
28#include "file.h" 29#include "file.h"
@@ -35,6 +36,17 @@
35#define SAME_FILE_INFO(sb1p, sb2p) \ 36#define SAME_FILE_INFO(sb1p, sb2p) \
36 ((sb1p)->st_dev == (sb2p)->st_dev && (sb1p)->st_ino == (sb2p)->st_ino) 37 ((sb1p)->st_dev == (sb2p)->st_dev && (sb1p)->st_ino == (sb2p)->st_ino)
37 38
39int os_modtime(const char *path, time_t modtime)
40{
41 struct utimbuf times =
42 {
43 .actime = modtime,
44 .modtime = modtime,
45 };
46
47 return utime(path, &times);
48}
49
38off_t os_filesize(int osfd) 50off_t os_filesize(int osfd)
39{ 51{
40 struct stat sb; 52 struct stat sb;