Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2006-08-17 01:45:53 +0400
committerJeff Johnston <jjohnstn@redhat.com>2006-08-17 01:45:53 +0400
commit1641d724b8817ec2d68d06e6674cd56f3c01360b (patch)
treedc5e519f88c4addbee05abffe042ff6e63619bd9 /libgloss
parent734e8414355b9e4c3c95ccfc9c72aa813d83d89a (diff)
2006-08-16 Joel Schopp <jschopp@austin.ibm.com>
* spu/jsre.h(JSRE_STAT): New define. (syscall_stat_t): New type. * spu/syscalls.c(stat): New syscall.
Diffstat (limited to 'libgloss')
-rw-r--r--libgloss/ChangeLog30
-rw-r--r--libgloss/spu/jsre.h8
-rw-r--r--libgloss/spu/syscalls.c31
3 files changed, 57 insertions, 12 deletions
diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog
index f88f8cc83..efb0091e7 100644
--- a/libgloss/ChangeLog
+++ b/libgloss/ChangeLog
@@ -1,17 +1,23 @@
2006-08-16 Joel Schopp <jschopp@austin.ibm.com>
- * configure.in: Add spu support.
- * configure: Regenerated.
- * spu/Makefile.in: New file.
- * spu/aclocal.m4: Ditto.
- * spu/configure: Ditto.
- * spu/configure.in: Ditto.
- * spu/crt0.c: Ditto.
- * spu/exit.c: Ditto.
- * spu/init.c: Ditto.
- * spu/jsre.h: Ditto.
- * spu/sbrk.c: Ditto.
- * spu/syscalls.c: Ditto.
+ * spu/jsre.h(JSRE_STAT): New define.
+ (syscall_stat_t): New type.
+ * spu/syscalls.c(stat): New syscall.
+
+2006-08-16 Joel Schopp <jschopp@austin.ibm.com>
+
+ * configure.in: Add spu support.
+ * configure: Regenerated.
+ * spu/Makefile.in: New file.
+ * spu/aclocal.m4: Ditto.
+ * spu/configure: Ditto.
+ * spu/configure.in: Ditto.
+ * spu/crt0.c: Ditto.
+ * spu/exit.c: Ditto.
+ * spu/init.c: Ditto.
+ * spu/jsre.h: Ditto.
+ * spu/sbrk.c: Ditto.
+ * spu/syscalls.c: Ditto.
2006-07-05 Shaun Jackman <sjackman@gmail.com>
diff --git a/libgloss/spu/jsre.h b/libgloss/spu/jsre.h
index ab7ba17e2..5f575577b 100644
--- a/libgloss/spu/jsre.h
+++ b/libgloss/spu/jsre.h
@@ -57,6 +57,7 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com)
#define JSRE_LSEEK 9
#define JSRE_OPEN 15
#define JSRE_READ 16
+#define JSRE_STAT 23
#define JSRE_UNLINK 24
#define JSRE_WRITE 27
@@ -120,6 +121,13 @@ typedef struct
unsigned int pad1[ 3 ];
} syscall_fstat_t;
+typedef struct
+{
+ unsigned int pathname;
+ unsigned int pad0[ 3 ];
+ unsigned int ptr;
+ unsigned int pad1[ 3 ];
+} syscall_stat_t;
typedef struct
{
diff --git a/libgloss/spu/syscalls.c b/libgloss/spu/syscalls.c
index bca23aaba..20aabb79c 100644
--- a/libgloss/spu/syscalls.c
+++ b/libgloss/spu/syscalls.c
@@ -243,6 +243,37 @@ fstat (int file, struct stat *pstat)
}
int
+stat (const char *pathname, struct stat *pstat)
+{
+ syscall_stat_t sys;
+ syscall_out_t *psys_out = ( syscall_out_t* )&sys;
+ jsre_stat_t pjstat;
+
+ sys.pathname = pathname;
+ sys.ptr = ( unsigned int )&pjstat;
+
+ send_to_ppe_0x2101 (JSRE_STAT, &sys);
+
+ pstat->st_dev = pjstat.dev;
+ pstat->st_ino = pjstat.ino;
+ pstat->st_mode = pjstat.mode;
+ pstat->st_nlink = pjstat.nlink;
+ pstat->st_uid = pjstat.uid;
+ pstat->st_gid = pjstat.gid;
+ pstat->st_rdev = pjstat.rdev;
+ pstat->st_size = pjstat.size;
+ pstat->st_blksize = pjstat.blksize;
+ pstat->st_blocks = pjstat.blocks;
+ pstat->st_atime = pjstat.atime;
+ pstat->st_mtime = pjstat.mtime;
+ pstat->st_ctime = pjstat.ctime;
+
+ errno = psys_out->err;
+ return( psys_out->rc );
+}
+
+
+int
unlink (const char *pathname)
{
int rc;