~ubuntu-branches/ubuntu/utopic/coreutils/utopic-proposed

« back to all changes in this revision

Viewing changes to lib/fseeko.c

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-11-28 03:03:42 UTC
  • mfrom: (8.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20121128030342-21zanj8354gas5gr
Tags: 8.20-3ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Make 'uname -i -p' return the real processor/hardware, instead of
    unknown.
  - Build-depend on gettext:any instead of on gettext, so that apt-get can
    properly resolve build-dependencies on the tool when cross-building.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- buffer-read-only: t -*- vi: set ro: */
2
 
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3
1
/* An fseeko() function that, together with fflush(), is POSIX compliant.
4
 
   Copyright (C) 2007-2011 Free Software Foundation, Inc.
 
2
   Copyright (C) 2007-2012 Free Software Foundation, Inc.
5
3
 
6
4
   This program is free software; you can redistribute it and/or modify
7
5
   it under the terms of the GNU General Public License as published by
14
12
   GNU General Public License for more details.
15
13
 
16
14
   You should have received a copy of the GNU General Public License along
17
 
   with this program; if not, write to the Free Software Foundation,
18
 
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
15
   with this program; if not, see <http://www.gnu.org/licenses/>.  */
19
16
 
20
17
#include <config.h>
21
18
 
34
31
# undef fseek
35
32
# define fseeko fseek
36
33
#endif
 
34
#if _GL_WINDOWS_64_BIT_OFF_T
 
35
# undef fseeko
 
36
# if HAVE__FSEEKI64 /* msvc, mingw64 */
 
37
#  define fseeko _fseeki64
 
38
# else /* mingw */
 
39
#  define fseeko fseeko64
 
40
# endif
 
41
#endif
37
42
{
38
43
#if LSEEK_PIPE_BROKEN
39
44
  /* mingw gives bogus answers rather than failure on non-seekable files.  */
46
51
  if (fp->_IO_read_end == fp->_IO_read_ptr
47
52
      && fp->_IO_write_ptr == fp->_IO_write_base
48
53
      && fp->_IO_save_base == NULL)
49
 
#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
 
54
#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
50
55
# if defined __SL64 && defined __SCLE /* Cygwin */
51
56
  if ((fp->_flags & __SL64) == 0)
52
57
    {
91
96
      && fp->__get_limit == fp->__bufp
92
97
      && fp->__put_limit == fp->__bufp
93
98
      && !fp->__pushed_back)
 
99
#elif defined EPLAN9                /* Plan9 */
 
100
  if (fp->rp == fp->buf
 
101
      && fp->wp == fp->buf)
94
102
#else
95
103
  #error "Please port gnulib fseeko.c to your platform! Look at the code in fpurge.c, then report this to bug-gnulib."
96
104
#endif
101
109
      off_t pos = lseek (fileno (fp), offset, whence);
102
110
      if (pos == -1)
103
111
        {
104
 
#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
 
112
#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
105
113
          fp_->_flags &= ~__SOFF;
106
114
#endif
107
115
          return -1;
110
118
#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
111
119
      fp->_flags &= ~_IO_EOF_SEEN;
112
120
      fp->_offset = pos;
113
 
#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
 
121
#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
114
122
# if defined __CYGWIN__
115
123
      /* fp_->_offset is typed as an integer.  */
116
124
      fp_->_offset = pos;