~ubuntu-branches/ubuntu/vivid/gzip/vivid

« back to all changes in this revision

Viewing changes to lib/freadahead.c

  • Committer: Steve Langasek
  • Date: 2012-06-29 02:07:40 UTC
  • mfrom: (4.1.9 sid)
  • Revision ID: steve.langasek@canonical.com-20120629020740-qqikrblzana08v2y
Merge version 1.5-1.1 from Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Retrieve information about a FILE stream.
2
 
   Copyright (C) 2007-2010 Free Software Foundation, Inc.
 
2
   Copyright (C) 2007-2012 Free Software Foundation, Inc.
3
3
 
4
4
   This program is free software: you can redistribute it and/or modify
5
5
   it under the terms of the GNU General Public License as published by
48
48
  /* equivalent to
49
49
     (fp->_ungetc_count == 0 ? fp->_rcount : fp->_ungetc_count - fp->_rcount) */
50
50
  return (fp->_rcount > 0 ? fp->_rcount : fp->_ungetc_count - fp->_rcount);
51
 
#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
 
51
#elif defined __minix               /* Minix */
 
52
  if ((fp_->_flags & _IOWRITING) != 0)
 
53
    return 0;
 
54
  return fp_->_count;
 
55
#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, NonStop Kernel */
52
56
  if ((fp_->_flag & _IOWRT) != 0)
53
57
    return 0;
54
58
  return fp_->_cnt;
76
80
  return (fp->__pushed_back
77
81
          ? fp->__get_limit - fp->__pushback_bufp + 1
78
82
          : fp->__get_limit - fp->__bufp);
 
83
#elif defined EPLAN9                /* Plan9 */
 
84
  if (fp->state == 4 /* WR */ || fp->rp >= fp->wp)
 
85
    return 0;
 
86
  return fp->wp - fp->rp;
79
87
#elif defined SLOW_BUT_NO_HACKS     /* users can define this */
80
88
  abort ();
81
89
  return 0;