diff --git a/ppu/crt/crt1.c b/ppu/crt/crt1.c index fdca7b25..278f680a 100644 --- a/ppu/crt/crt1.c +++ b/ppu/crt/crt1.c @@ -38,6 +38,7 @@ extern int __librt_rmdir_r(struct _reent *r,const char *dirname); extern int __librt_link_r(struct _reent *r,const char *old,const char *new); extern int __librt_unlink_r(struct _reent *r,const char *path); extern int __librt_access_r(struct _reent *r,const char *path,int amode); +extern int __librt_utime_r(struct _reent *r,const char *path,const struct utimbuf *times); extern int __librt_usleep_r(struct _reent *r,useconds_t usec); extern unsigned int __librt_sleep_r(struct _reent *r,unsigned int seconds); @@ -88,6 +89,7 @@ static void __syscalls_init(void) __syscalls.link_r = __librt_link_r; __syscalls.unlink_r = __librt_unlink_r; __syscalls.access_r = __librt_access_r; + __syscalls.utime_r = __librt_utime_r; __syscalls.sleep_r = __librt_sleep_r; __syscalls.usleep_r = __librt_usleep_r; diff --git a/ppu/include/lv2/sysfs.h b/ppu/include/lv2/sysfs.h index 327e9c4c..a6798e54 100644 --- a/ppu/include/lv2/sysfs.h +++ b/ppu/include/lv2/sysfs.h @@ -71,6 +71,7 @@ s32 sysFsMkdir(const char* path, s32 mode); s32 sysFsRmdir(const char *path); s32 sysFsUnlink(const char *path); s32 sysFsAccess(const char *path,s32 amode); +s32 sysFsUtime(const char *path, sysFSUtimbuf *times); s32 sysFsOpendir(const char *path, s32 *fd); s32 sysFsClosedir(s32 fd); diff --git a/ppu/librt/Makefile b/ppu/librt/Makefile index f1c73525..ae153d87 100644 --- a/ppu/librt/Makefile +++ b/ppu/librt/Makefile @@ -46,7 +46,7 @@ OBJS := \ sbrk.o exit.o close.o lseek.o read.o open.o sleep.o write.o fstat.o \ socket.o lock.o dirent.o mkdir.o times.o umask.o lv2errno.o heap.o \ chmod.o rename.o rmdir.o isatty.o gettod.o settod.o unlink.o access.o \ - link.o truncate.o fsync.o + link.o truncate.o fsync.o utime.o all: ppu diff --git a/ppu/librt/utime.c b/ppu/librt/utime.c new file mode 100644 index 00000000..23bad626 --- /dev/null +++ b/ppu/librt/utime.c @@ -0,0 +1,33 @@ +#include +#include +#include <_ansi.h> +#include <_syslist.h> +#include +#include +#include +#include + +#include +#include + +int +_DEFUN(__librt_utime_r,(r,path,times), + struct _reent *r _AND + const char *path _AND + const struct utimbuf *times) +{ + sysFSUtimbuf t; + if (times) + { + t.actime = times->actime; + t.modtime = times->modtime; + } + else + { + time_t now = time(NULL); + t.actime = now; + t.modtime = now; + } + + return lv2errno_r(r,sysLv2FsUtime(path,&t)); +} \ No newline at end of file diff --git a/ppu/sprx/libsysfs/exports.h b/ppu/sprx/libsysfs/exports.h index 90f8d08b..e55a207c 100644 --- a/ppu/sprx/libsysfs/exports.h +++ b/ppu/sprx/libsysfs/exports.h @@ -16,6 +16,7 @@ EXPORT(sysFsOpendir, 0x3F61245C); EXPORT(sysFsClosedir, 0xFF42DCC3); EXPORT(sysFsReaddir, 0x5C74903D); EXPORT(sysFsAccess, 0x06E681ED); +EXPORT(sysFsUtime, 0xBEF554A4); EXPORT(sysFsAioInit, 0xDB869F20); EXPORT(sysFsAioReadEx, 0xC1C507E7); EXPORT(sysFsAioWriteEx, 0x4CEF342E);