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
8 changes: 8 additions & 0 deletions ppu/crt/crt1.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ extern int __librt_fstat_r(struct _reent *r,int fd,struct stat *st);
extern int __librt_fstat64_r(struct _reent *r,int fd,struct stat *st);
extern int __librt_stat_r(struct _reent *r,const char *path,struct stat *st);
extern int __librt_stat64_r(struct _reent *r,const char *path,struct stat *st);
extern int __librt_ftruncate_r(struct _reent *r,int fd,off_t len);
extern int __librt_truncate_r(struct _reent *r,const char *path,off_t len);
extern int __librt_fsync_r(struct _reent *r,int fd);
extern _ssize_t __librt_read_r(struct _reent *r,int fd,void *ptr,size_t len);
extern _ssize_t __librt_write_r(struct _reent *r,int fd,const void *ptr,size_t len);
extern _off_t __librt_lseek_r(struct _reent *r,int fd,_off_t pos,int dir);
Expand All @@ -32,6 +35,7 @@ extern long int __librt_telldir_r(struct _reent *r,DIR *dirp);
extern void __librt_rewinddir_r(struct _reent *r,DIR *dirp);
extern void __librt_seekdir_r(struct _reent *r,DIR *dirp,long int loc);
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);

Expand Down Expand Up @@ -65,6 +69,9 @@ static void __syscalls_init(void)
__syscalls.fstat64_r = __librt_fstat64_r;
__syscalls.stat_r = __librt_stat_r;
__syscalls.stat64_r = __librt_stat64_r;
__syscalls.ftruncate_r = __librt_ftruncate_r;
__syscalls.truncate_r = __librt_truncate_r;
__syscalls.fsync_r = __librt_fsync_r;
__syscalls.chmod_r = __librt_chmod_r;
__syscalls.rename_r = __librt_rename_r;
__syscalls.isatty_r = __librt_isatty_r;
Expand All @@ -78,6 +85,7 @@ static void __syscalls_init(void)
__syscalls.rewinddir_r = __librt_rewinddir_r;
__syscalls.seekdir_r = __librt_seekdir_r;
__syscalls.rmdir_r = __librt_rmdir_r;
__syscalls.link_r = __librt_link_r;
__syscalls.unlink_r = __librt_unlink_r;
__syscalls.access_r = __librt_access_r;

Expand Down
3 changes: 2 additions & 1 deletion ppu/librt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ VPATH := $(BASEDIR)
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
chmod.o rename.o rmdir.o isatty.o gettod.o settod.o unlink.o access.o \
link.o truncate.o fsync.o

all: ppu

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

#include <sys/file.h>

int
_DEFUN(__librt_fsync_r,(ptr,fd),
struct _reent *ptr _AND
int fd)
{
return lv2errno_r(ptr,sysLv2FsFsync(fd));
}
19 changes: 19 additions & 0 deletions ppu/librt/link.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#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>

int
_DEFUN(__librt_link_r,(r,old,new),
struct _reent *r _AND
const char *old _AND
const char *new)
{
return lv2errno_r(r,sysLv2FsLink(old,new));
}
28 changes: 28 additions & 0 deletions ppu/librt/truncate.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#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>

int
_DEFUN(__librt_truncate_r,(r,path,len),
struct _reent *r _AND
const char *path _AND
off_t len)
{
return lv2errno_r(r,sysLv2FsTruncate(path,len));
}

int
_DEFUN(__librt_ftruncate_r,(r,fd,len),
struct _reent *r _AND
int fd _AND
off_t len)
{
return lv2errno_r(r,sysLv2FsFtruncate(fd,len));
}