Changeset 217e398 in rtems


Ignore:
Timestamp:
01/17/96 20:13:01 (28 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
72c440e
Parents:
5d3e539
Message:

Modified fstat and stat to be consistent with isatty in that all three
now pretend that everything is a tty. This insures that newlib makes
the console output line buffered.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libc/syscalls.c

    r5d3e539 r217e398  
    2424#include <sys/stat.h>
    2525
    26 int
    27 __fstat(int _fd, struct stat* _sbuf)
     26/*
     27 *  check this newlib bug?:
     28 *
     29 *  newlib/libc/stdio/makebuf.c:
     30 *
     31 *  2nd ifdef uses 1024 instead of BUFSIZ
     32 *  2nd check lets fp blksize be 0
     33 *  finally look at the malloc
     34 */
     35
     36/*
     37 *  fstat, stat, and isatty must lie consistently and report that everything
     38 *  is a tty or stdout will not be line buffered.
     39 */
     40
     41int __fstat(int _fd, struct stat* _sbuf)
    2842{
    29   return -1;
     43  _sbuf->st_mode = S_IFCHR;
     44#ifdef HAVE_BLKSIZE
     45  _sbuf->st_blksize = 0;
     46#endif
     47  return 0;
    3048}
    3149
    32 int
    33 __isatty(int _fd)
     50int __isatty(int _fd)
    3451{
    3552  return 1;
     
    3855int stat( const char *path, struct stat *buf )
    3956{
    40   /* always fail */
    41   return -1;
     57  return __fstat( 0, buf );
    4258}
    4359
Note: See TracChangeset for help on using the changeset viewer.