[ac7d5ef0] | 1 | #if !defined(RTEMS_UNIX) |
---|
| 2 | |
---|
| 3 | /* |
---|
| 4 | * RTEMS Fake System Calls |
---|
| 5 | * |
---|
| 6 | * This file contains "fake" versions of the system call routines |
---|
| 7 | * which are reference by many libc implementations. Once a routine |
---|
| 8 | * has been implemented in terms of RTEMS services, it should be |
---|
| 9 | * taken out of this file. |
---|
| 10 | * |
---|
| 11 | * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. |
---|
| 12 | * On-Line Applications Research Corporation (OAR). |
---|
| 13 | * All rights assigned to U.S. Government, 1994. |
---|
| 14 | * |
---|
| 15 | * This material may be reproduced by or for the U.S. Government pursuant |
---|
| 16 | * to the copyright license under the clause at DFARS 252.227-7013. This |
---|
| 17 | * notice must appear in all copies of this file and its derivatives. |
---|
| 18 | * |
---|
| 19 | * $Id$ |
---|
| 20 | * |
---|
| 21 | */ |
---|
| 22 | |
---|
| 23 | #include <sys/types.h> |
---|
| 24 | #include <sys/stat.h> |
---|
[331d9e3b] | 25 | #include <assert.h> |
---|
[ac7d5ef0] | 26 | |
---|
[217e398] | 27 | /* |
---|
| 28 | * fstat, stat, and isatty must lie consistently and report that everything |
---|
| 29 | * is a tty or stdout will not be line buffered. |
---|
| 30 | */ |
---|
| 31 | |
---|
| 32 | int __fstat(int _fd, struct stat* _sbuf) |
---|
[ac7d5ef0] | 33 | { |
---|
[331d9e3b] | 34 | if ( _fd > 2 ) { |
---|
| 35 | puts( "__fstat -- only stdio supported" ); |
---|
| 36 | assert( 0 ); |
---|
| 37 | } |
---|
[217e398] | 38 | _sbuf->st_mode = S_IFCHR; |
---|
| 39 | #ifdef HAVE_BLKSIZE |
---|
| 40 | _sbuf->st_blksize = 0; |
---|
| 41 | #endif |
---|
| 42 | return 0; |
---|
[ac7d5ef0] | 43 | } |
---|
| 44 | |
---|
[217e398] | 45 | int __isatty(int _fd) |
---|
[ac7d5ef0] | 46 | { |
---|
| 47 | return 1; |
---|
| 48 | } |
---|
| 49 | |
---|
| 50 | int stat( const char *path, struct stat *buf ) |
---|
| 51 | { |
---|
[331d9e3b] | 52 | if ( strncmp( "/dev/", path, 5 ) ) { |
---|
[c6126e57] | 53 | return -1; |
---|
[331d9e3b] | 54 | } |
---|
[217e398] | 55 | return __fstat( 0, buf ); |
---|
[ac7d5ef0] | 56 | } |
---|
| 57 | |
---|
| 58 | int link( const char *existing, const char *new ) |
---|
| 59 | { |
---|
| 60 | /* always fail */ |
---|
| 61 | return -1; |
---|
| 62 | } |
---|
| 63 | |
---|
| 64 | int unlink( const char *path ) |
---|
| 65 | { |
---|
| 66 | /* always fail */ |
---|
| 67 | return -1; |
---|
| 68 | } |
---|
| 69 | |
---|
| 70 | #endif |
---|