summaryrefslogtreecommitdiffstats
path: root/newlib/libc/sys/arm/syscalls.c
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2002-03-12 21:25:12 +0000
committerJeff Johnston <jjohnstn@redhat.com>2002-03-12 21:25:12 +0000
commitd2a246ad722cc6df6005b8a1c42489bc839eb0d0 (patch)
tree72677c4e833faf495ae22638ad5855eff777fc14 /newlib/libc/sys/arm/syscalls.c
parentcb4589f49d8de32d27cd5c69274b4b8cd23d3351 (diff)
downloadcygnal-d2a246ad722cc6df6005b8a1c42489bc839eb0d0.tar.gz
cygnal-d2a246ad722cc6df6005b8a1c42489bc839eb0d0.tar.bz2
cygnal-d2a246ad722cc6df6005b8a1c42489bc839eb0d0.zip
2002-03-12 Richard Earnshaw <rearnsha@arm.com>
* libc/sys/arm/access.c: New file. * libc/sys/arm/Makefile.am (lib_a_SOURCES): Add access.c. * libc/sys/arm/Makefile.in: Regenerate. * libc/sys/arm/syscalls.c (_stat): New function.
Diffstat (limited to 'newlib/libc/sys/arm/syscalls.c')
-rw-r--r--newlib/libc/sys/arm/syscalls.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/newlib/libc/sys/arm/syscalls.c b/newlib/libc/sys/arm/syscalls.c
index 0483d4893..3662a4687 100644
--- a/newlib/libc/sys/arm/syscalls.c
+++ b/newlib/libc/sys/arm/syscalls.c
@@ -21,6 +21,7 @@ int _gettimeofday _PARAMS ((struct timeval *, struct timezone *));
void _raise _PARAMS ((void));
int _unlink _PARAMS ((void));
int _link _PARAMS ((void));
+int _stat _PARAMS ((const char *, struct stat *));
int _fstat _PARAMS ((int, struct stat *));
caddr_t _sbrk _PARAMS ((int));
int _getpid _PARAMS ((int));
@@ -515,6 +516,22 @@ _fstat (int file, struct stat * st)
file = file;
}
+int _stat (const char *fname, struct stat *st)
+{
+ int file;
+
+ /* The best we can do is try to open the file readonly. If it exists,
+ then we can guess a few things about it. */
+ if ((file = _open (fname, O_RDONLY)) < 0)
+ return -1;
+
+ memset (st, 0, sizeof (* st));
+ st->st_mode = S_IFREG | S_IREAD;
+ st->st_blksize = 1024;
+ _swiclose (file); /* Not interested in the error. */
+ return 0;
+}
+
int
_link (void)
{