forked from len0rd/rockbox
filesystem: implement os_modtime for unix
Change-Id: If030d526f29aa786b5a37402413d804752286cf5
This commit is contained in:
parent
8846e087c0
commit
fa743258ea
3 changed files with 14 additions and 0 deletions
|
@ -23,6 +23,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <utime.h>
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "file.h"
|
||||
|
@ -35,6 +36,17 @@
|
|||
#define SAME_FILE_INFO(sb1p, sb2p) \
|
||||
((sb1p)->st_dev == (sb2p)->st_dev && (sb1p)->st_ino == (sb2p)->st_ino)
|
||||
|
||||
int os_modtime(const char *path, time_t modtime)
|
||||
{
|
||||
struct utimbuf times =
|
||||
{
|
||||
.actime = modtime,
|
||||
.modtime = modtime,
|
||||
};
|
||||
|
||||
return utime(path, ×);
|
||||
}
|
||||
|
||||
off_t os_filesize(int osfd)
|
||||
{
|
||||
struct stat sb;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue