1. 21 9月, 2022 1 次提交
  2. 11 6月, 2021 1 次提交
  3. 11 3月, 2021 1 次提交
  4. 09 9月, 2020 1 次提交
  5. 04 9月, 2020 1 次提交
  6. 03 9月, 2020 1 次提交
  7. 17 8月, 2020 1 次提交
  8. 24 2月, 2015 1 次提交
    • R
      fix possible isatty false positives and unwanted device state changes · 2de85a98
      Rich Felker 提交于
      the equivalent checks for newly opened stdio output streams, used to
      determine buffering mode, are also fixed.
      
      on most archs, the TCGETS ioctl command shares a value with
      SNDCTL_TMR_TIMEBASE, part of the OSS sound API which was apparently
      used with certain MIDI and timer devices. for file descriptors
      referring to such a device, TCGETS will not fail with ENOTTY as
      expected; it may produce a different error, or may succeed, and if it
      succeeds it changes the mode of the device. while it's unlikely that
      such devices are in use, this is in principle very harmful behavior
      for an operation which is supposed to do nothing but query whether the
      fd refers to a tty.
      
      TIOCGWINSZ, used to query logical window size for a terminal, was
      chosen as an alternate ioctl to perform the isatty check. it does not
      share a value with any other ioctl commands, and it succeeds on any
      tty device.
      
      this change also cleans up strace output to be less ugly and
      misleading.
      2de85a98
  9. 09 11月, 2012 1 次提交
    • R
      clean up stdio_impl.h · 835f9f95
      Rich Felker 提交于
      this header evolved to facilitate the extremely lazy practice of
      omitting explicit includes of the necessary headers in individual
      stdio source files; not only was this sloppy, but it also increased
      build time.
      
      now, stdio_impl.h is only including the headers it needs for its own
      use; any further headers needed by source files are included directly
      where needed.
      835f9f95
  10. 16 4月, 2011 1 次提交
    • R
      avoid setting errno when checking for tty · 69cf09c8
      Rich Felker 提交于
      setting errno here is completely valid, but some programs, notably
      busybox printf, assume that errno will not be set during output and
      treat this as an error condition. in any case, skipping it slightly
      reduces code size and saves time.
      69cf09c8
  11. 28 3月, 2011 1 次提交
    • R
      major stdio overhaul, using readv/writev, plus other changes · e3cd6c5c
      Rich Felker 提交于
      the biggest change in this commit is that stdio now uses readv to fill
      the caller's buffer and the FILE buffer with a single syscall, and
      likewise writev to flush the FILE buffer and write out the caller's
      buffer in a single syscall.
      
      making this change required fundamental architectural changes to
      stdio, so i also made a number of other improvements in the process:
      
      - the implementation no longer assumes that further io will fail
        following errors, and no longer blocks io when the error flag is set
        (though the latter could easily be changed back if desired)
      
      - unbuffered mode is no longer implemented as a one-byte buffer. as a
        consequence, scanf unreading has to use ungetc, to the unget buffer
        has been enlarged to hold at least 2 wide characters.
      
      - the FILE structure has been rearranged to maintain the locations of
        the fields that might be used in glibc getc/putc type macros, while
        shrinking the structure to save some space.
      
      - error cases for fflush, fseek, etc. should be more correct.
      
      - library-internal macros are used for getc_unlocked and putc_unlocked
        now, eliminating some ugly code duplication. __uflow and __overflow
        are no longer used anywhere but these macros. switch to read or
        write mode is also separated so the code can be better shared, e.g.
        with ungetc.
      
      - lots of other small things.
      e3cd6c5c