summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libc/syscalls.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1996-11-08 20:08:52 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1996-11-08 20:08:52 +0000
commit331d9e3b91c21b3c592882ac90df0c6210868d8c (patch)
treedf295a5be77f983e1cf0c35263b62eff8739ebaf /c/src/lib/libc/syscalls.c
parentadded ENOSYS support (diff)
downloadrtems-331d9e3b91c21b3c592882ac90df0c6210868d8c.tar.bz2
Added asserts for unhandled conditions which need to result in error
statuses being returned to gnat runtime in order for it to raise use_errors. This was needed to identify the places in gnat's runtime which needed to be addressed.
Diffstat (limited to 'c/src/lib/libc/syscalls.c')
-rw-r--r--c/src/lib/libc/syscalls.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/c/src/lib/libc/syscalls.c b/c/src/lib/libc/syscalls.c
index 9c59933769..1128d09f53 100644
--- a/c/src/lib/libc/syscalls.c
+++ b/c/src/lib/libc/syscalls.c
@@ -22,6 +22,7 @@
#include <sys/types.h>
#include <sys/stat.h>
+#include <assert.h>
/*
* fstat, stat, and isatty must lie consistently and report that everything
@@ -30,6 +31,10 @@
int __fstat(int _fd, struct stat* _sbuf)
{
+ if ( _fd > 2 ) {
+ puts( "__fstat -- only stdio supported" );
+ assert( 0 );
+ }
_sbuf->st_mode = S_IFCHR;
#ifdef HAVE_BLKSIZE
_sbuf->st_blksize = 0;
@@ -44,6 +49,10 @@ int __isatty(int _fd)
int stat( const char *path, struct stat *buf )
{
+ if ( strncmp( "/dev/", path, 5 ) ) {
+ puts( "stat -- non-devices not supported" );
+ assert( 0 );
+ }
return __fstat( 0, buf );
}