Skip to content

Commit 441ed1e

Browse files
committed
added rename
Fixes ps3dev/ps3libraries#36
1 parent 84c7223 commit 441ed1e

3 files changed

Lines changed: 22 additions & 1 deletion

File tree

ppu/crt/crt1.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ extern _off_t __librt_lseek_r(struct _reent *r,int fd,_off_t pos,int dir);
2020
extern _off64_t __librt_lseek64_r(struct _reent *r,int fd,_off64_t pos,int dir);
2121
extern caddr_t __librt_sbrk_r(struct _reent *ptr,ptrdiff_t incr);
2222
extern int __librt_chmod_r(struct _reent *r,const char *path,mode_t mode);
23+
extern int __librt_rename_r(struct _reent *r,const char *old,const char *new);
2324
extern int __librt_isatty_r(struct _reent *r,int fd);
2425

2526
extern int __librt_mkdir_r(struct _reent *r,const char *path,mode_t mode);
@@ -63,6 +64,7 @@ static void __syscalls_init(void)
6364
__syscalls.stat_r = __librt_stat_r;
6465
__syscalls.stat64_r = __librt_stat64_r;
6566
__syscalls.chmod_r = __librt_chmod_r;
67+
__syscalls.rename_r = __librt_rename_r;
6668
__syscalls.isatty_r = __librt_isatty_r;
6769

6870
__syscalls.mkdir_r = __librt_mkdir_r;

ppu/librt/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ VPATH := $(BASEDIR)
4545
OBJS := \
4646
sbrk.o exit.o close.o lseek.o read.o open.o sleep.o write.o fstat.o \
4747
socket.o lock.o dirent.o mkdir.o times.o umask.o lv2errno.o heap.o \
48-
chmod.o rmdir.o isatty.o gettod.o settod.o
48+
chmod.o rename.o rmdir.o isatty.o gettod.o settod.o
4949

5050
all: ppu
5151

ppu/librt/rename.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <stdio.h>
2+
#include <fcntl.h>
3+
#include <_ansi.h>
4+
#include <_syslist.h>
5+
#include <sys/reent.h>
6+
#include <sys/errno.h>
7+
#include <sys/types.h>
8+
#include <sys/lv2errno.h>
9+
10+
#include <sys/file.h>
11+
12+
int
13+
_DEFUN(__librt_rename_r,(r,old,new),
14+
struct _reent *r _AND
15+
const char *old _AND
16+
const char *new)
17+
{
18+
return lv2errno_r(r,sysLv2FsRename(old,new));
19+
}

0 commit comments

Comments
 (0)