Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ppu/crt/crt1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions ppu/include/lv2/sysfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion ppu/librt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
33 changes: 33 additions & 0 deletions ppu/librt/utime.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#include <stdio.h>
#include <fcntl.h>
#include <_ansi.h>
#include <_syslist.h>
#include <sys/reent.h>
#include <sys/errno.h>
#include <sys/types.h>
#include <sys/lv2errno.h>

#include <sys/file.h>
#include <utime.h>

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));
}
1 change: 1 addition & 0 deletions ppu/sprx/libsysfs/exports.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down