Index: bin/csh/csh.c =================================================================== RCS file: /cvsroot/src/bin/csh/csh.c,v retrieving revision 1.41 diff -u -r1.41 csh.c --- bin/csh/csh.c 20 Jul 2008 00:52:39 -0000 1.41 +++ bin/csh/csh.c 14 Sep 2010 08:41:34 -0000 @@ -94,7 +94,7 @@ extern char **environ; static int readf(void *, char *, int); -static fpos_t seekf(void *, fpos_t, int); +static off_t seekf(void *, off_t, int); static int writef(void *, const char *, int); static int closef(void *); static int srccat(Char *, Char *); @@ -1245,8 +1245,8 @@ return write(DESC(oreo), buf, siz); } -static fpos_t -seekf(void *oreo, fpos_t off, int whence) +static off_t +seekf(void *oreo, off_t off, int whence) { return lseek(DESC(oreo), off, whence); } Index: include/stdio.h =================================================================== RCS file: /cvsroot/src/include/stdio.h,v retrieving revision 1.77 diff -u -r1.77 stdio.h --- include/stdio.h 6 Sep 2010 14:52:26 -0000 1.77 +++ include/stdio.h 14 Sep 2010 08:11:06 -0000 @@ -58,13 +58,10 @@ * innards of an fpos_t anyway. The library internally uses off_t, * which we assume is exactly as big as eight chars. */ -#if (!defined(_ANSI_SOURCE) && !defined(__STRICT_ANSI__)) || defined(_LIBC) -typedef __off_t fpos_t; -#else typedef struct __sfpos { __off_t _pos; + __mbstate_t _mbstate_in, _mbstate_out; } fpos_t; -#endif #define _FSTDIO /* Define for new stdio with functions. */ @@ -119,7 +116,7 @@ void *_cookie; /* cookie passed to io functions */ int (*_close)(void *); int (*_read) (void *, char *, int); - fpos_t (*_seek) (void *, fpos_t, int); + __off_t (*_seek) (void *, __off_t, int); int (*_write)(void *, const char *, int); /* file extension */ @@ -138,7 +135,7 @@ /* Unix stdio files get aligned to block boundaries on fseek() */ int _blksize; /* stat.st_blksize (may be != _bf._size) */ - fpos_t _offset; /* current lseek offset */ + __off_t _offset; /* current lseek offset */ } FILE; __BEGIN_DECLS @@ -222,7 +219,7 @@ int ferror(FILE *); int fflush(FILE *); int fgetc(FILE *); -int fgetpos(FILE * __restrict, fpos_t * __restrict); +int fgetpos(FILE * __restrict, fpos_t * __restrict) __RENAME(__fgetpos50); char *fgets(char * __restrict, int, FILE * __restrict); FILE *fopen(const char * __restrict , const char * __restrict); int fprintf(FILE * __restrict , const char * __restrict, ...) @@ -235,7 +232,7 @@ int fscanf(FILE * __restrict, const char * __restrict, ...) __scanflike(2, 3); int fseek(FILE *, long, int); -int fsetpos(FILE *, const fpos_t *); +int fsetpos(FILE *, const fpos_t *) __RENAME(__fsetpos50); long ftell(FILE *); size_t fwrite(const void * __restrict, size_t, size_t, FILE * __restrict); int getc(FILE *); @@ -424,7 +421,7 @@ FILE *funopen(const void *, int (*)(void *, char *, int), int (*)(void *, const char *, int), - fpos_t (*)(void *, fpos_t, int), + off_t (*)(void *, off_t, int), int (*)(void *)); __END_DECLS #define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0) Index: lib/libc/compat/Makefile =================================================================== RCS file: /cvsroot/src/lib/libc/compat/Makefile,v retrieving revision 1.5 diff -u -r1.5 Makefile --- lib/libc/compat/Makefile 7 Jun 2010 13:52:29 -0000 1.5 +++ lib/libc/compat/Makefile 14 Sep 2010 08:11:06 -0000 @@ -17,6 +17,7 @@ .include "${.CURDIR}/locale/Makefile.inc" .include "${.CURDIR}/net/Makefile.inc" .include "${.CURDIR}/rpc/Makefile.inc" +.include "${.CURDIR}/stdio/Makefile.inc" .include "${.CURDIR}/stdlib/Makefile.inc" .include "${.CURDIR}/sys/Makefile.inc" Index: lib/libc/compat/Makefile.inc =================================================================== RCS file: /cvsroot/src/lib/libc/compat/Makefile.inc,v retrieving revision 1.6 diff -u -r1.6 Makefile.inc --- lib/libc/compat/Makefile.inc 7 Jun 2010 13:52:29 -0000 1.6 +++ lib/libc/compat/Makefile.inc 14 Sep 2010 08:11:06 -0000 @@ -10,6 +10,7 @@ .include "${COMPATDIR}/gen/Makefile.inc" .include "${COMPATDIR}/net/Makefile.inc" .include "${COMPATDIR}/rpc/Makefile.inc" +.include "${COMPATDIR}/stdio/Makefile.inc" .include "${COMPATDIR}/stdlib/Makefile.inc" .include "${COMPATDIR}/sys/Makefile.inc" .include "${COMPATDIR}/time/Makefile.inc" Index: lib/libc/compat/include/stdio.h =================================================================== RCS file: lib/libc/compat/include/stdio.h diff -N lib/libc/compat/include/stdio.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lib/libc/compat/include/stdio.h 14 Sep 2010 08:11:06 -0000 @@ -0,0 +1,52 @@ +/* $NetBSD$ */ + +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)stdio.h 8.5 (Berkeley) 4/29/95 + * + */ + +#ifndef _COMPAT_STDIO_H_ +#define _COMPAT_STDIO_H_ + +#include + +typedef struct __sFILE *FILE; + +__BEGIN_DECLS +int fgetpos(FILE * __restrict, off_t * __restrict); +int fsetpos(FILE *, const off_t *); +int fseeko(FILE *, off_t, int); +off_t ftello(FILE *); +__END_DECLS + +#endif /* _STDIO_H_ */ Index: lib/libc/compat/stdio/Makefile.inc =================================================================== RCS file: lib/libc/compat/stdio/Makefile.inc diff -N lib/libc/compat/stdio/Makefile.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lib/libc/compat/stdio/Makefile.inc 14 Sep 2010 08:11:06 -0000 @@ -0,0 +1,7 @@ +# $NetBSD$ + +.PATH: ${COMPATDIR}/arch/${MACHINE_ARCH}/stdio ${COMPATDIR}/stdio + +SRCS+= compat_fgetpos.c compat_fsetpos.c +CPPFLAGS.compat_fgetpos.c+= -I${COMPATDIR}/../stdio +CPPFLAGS.compat_fsetpos.c+= -I${COMPATDIR}/../stdio Index: lib/libc/compat/stdio/compat_fgetpos.c =================================================================== RCS file: lib/libc/compat/stdio/compat_fgetpos.c diff -N lib/libc/compat/stdio/compat_fgetpos.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lib/libc/compat/stdio/compat_fgetpos.c 14 Sep 2010 08:11:06 -0000 @@ -0,0 +1,53 @@ +/* $NetBSD$ */ + +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Original version ID: + * NetBSD: fgetpos.c,v 1.11 2003/08/07 16:43:23 agc Exp + */ + +#include +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD$"); +#endif /* LIBC_SCCS and not lint */ + +#include +#include + +int +fgetpos(FILE * __restrict fp, off_t * __restrict pos) +{ + _DIAGASSERT(fp != NULL); + _DIAGASSERT(pos != NULL); + + return((*pos = ftello(fp)) == (off_t)-1); +} Index: lib/libc/compat/stdio/compat_fsetpos.c =================================================================== RCS file: lib/libc/compat/stdio/compat_fsetpos.c diff -N lib/libc/compat/stdio/compat_fsetpos.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lib/libc/compat/stdio/compat_fsetpos.c 14 Sep 2010 08:11:06 -0000 @@ -0,0 +1,57 @@ +/* $NetBSD$ */ + +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Original version ID: + * NetBSD: fsetpos.c,v 1.10 2003/08/07 16:43:25 agc Exp + */ + +#include +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD$"); +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include + +/* + * fsetpos: like fseek. + */ +int +fsetpos(FILE * __restrict iop, const off_t * __restrict pos) +{ + _DIAGASSERT(iop != NULL); + _DIAGASSERT(pos != NULL); + + return (fseeko(iop, *pos, SEEK_SET) == (off_t)-1); +} Index: lib/libc/stdio/fgetpos.c =================================================================== RCS file: /cvsroot/src/lib/libc/stdio/fgetpos.c,v retrieving revision 1.11 diff -u -r1.11 fgetpos.c --- lib/libc/stdio/fgetpos.c 7 Aug 2003 16:43:23 -0000 1.11 +++ lib/libc/stdio/fgetpos.c 14 Sep 2010 08:11:07 -0000 @@ -45,14 +45,23 @@ #include #include #include +#include "reentrant.h" +#include "local.h" int -fgetpos(fp, pos) - FILE *fp; - fpos_t *pos; +fgetpos(FILE * __restrict fp, fpos_t * __restrict pos) { + struct wchar_io_data *wcio; + _DIAGASSERT(fp != NULL); _DIAGASSERT(pos != NULL); - return((*pos = (off_t)ftello(fp)) == (off_t)-1); + wcio = WCIO_GET(fp); + if (wcio != NULL && wcio->wcio_mode > 0) { + if (fp->_write) + pos->_mbstate_in = wcio->wcio_mbstate_in; + if (fp->_read) + pos->_mbstate_out = wcio->wcio_mbstate_out; + } + return((pos->_pos = ftello(fp)) == (off_t)-1); } Index: lib/libc/stdio/findfp.c =================================================================== RCS file: /cvsroot/src/lib/libc/stdio/findfp.c,v retrieving revision 1.25 diff -u -r1.25 findfp.c --- lib/libc/stdio/findfp.c 6 Sep 2010 14:52:55 -0000 1.25 +++ lib/libc/stdio/findfp.c 14 Sep 2010 08:11:07 -0000 @@ -62,7 +62,7 @@ /* read seek write ext up */ \ __sread, __sseek, __swrite, { (void *)(__sFext + file), 0 }, NULL, \ /* ur ubuf, nbuf lb blksize offset */ \ - 0, { '\0', '\0', '\0' }, { '\0' }, { NULL, 0 }, 0, (fpos_t)0 } + 0, { '\0', '\0', '\0' }, { '\0' }, { NULL, 0 }, 0, (off_t)0 } /* the usual - (stdin + stdout + stderr) */ static FILE usual[FOPEN_MAX - 3]; Index: lib/libc/stdio/fopen.c =================================================================== RCS file: /cvsroot/src/lib/libc/stdio/fopen.c,v retrieving revision 1.13 diff -u -r1.13 fopen.c --- lib/libc/stdio/fopen.c 13 Mar 2008 15:40:00 -0000 1.13 +++ lib/libc/stdio/fopen.c 14 Sep 2010 08:11:07 -0000 @@ -111,7 +111,7 @@ * fseek and ftell.) */ if (oflags & O_APPEND) - (void) __sseek((void *)fp, (fpos_t)0, SEEK_END); + (void) __sseek((void *)fp, (off_t)0, SEEK_END); return (fp); release: fp->_flags = 0; /* release */ Index: lib/libc/stdio/freopen.c =================================================================== RCS file: /cvsroot/src/lib/libc/stdio/freopen.c,v retrieving revision 1.16 diff -u -r1.16 freopen.c --- lib/libc/stdio/freopen.c 11 Jan 2010 20:39:29 -0000 1.16 +++ lib/libc/stdio/freopen.c 14 Sep 2010 08:11:07 -0000 @@ -200,6 +200,6 @@ * fseek and ftell.) */ if (oflags & O_APPEND) - (void) __sseek((void *)fp, (fpos_t)0, SEEK_END); + (void) __sseek((void *)fp, (off_t)0, SEEK_END); return (fp); } Index: lib/libc/stdio/fseeko.c =================================================================== RCS file: /cvsroot/src/lib/libc/stdio/fseeko.c,v retrieving revision 1.8 diff -u -r1.8 fseeko.c --- lib/libc/stdio/fseeko.c 31 Jan 2009 00:08:05 -0000 1.8 +++ lib/libc/stdio/fseeko.c 14 Sep 2010 08:11:07 -0000 @@ -53,7 +53,7 @@ __weak_alias(fseeko, _fseeko) #endif -#define POS_ERR (-(fpos_t)1) +#define POS_ERR ((off_t)-1) /* * Seek the given file to the given offset. @@ -62,8 +62,8 @@ int fseeko(FILE *fp, off_t offset, int whence) { - fpos_t (*seekfn)(void *, fpos_t, int); - fpos_t target, curoff; + off_t (*seekfn)(void *, off_t, int); + off_t target, curoff; size_t n; struct stat st; int havepos; @@ -101,7 +101,7 @@ if (fp->_flags & __SOFF) curoff = fp->_offset; else { - curoff = (*seekfn)(fp->_cookie, (fpos_t)0, SEEK_CUR); + curoff = (*seekfn)(fp->_cookie, (off_t)0, SEEK_CUR); if (curoff == POS_ERR) { FUNLOCKFILE(fp); return (-1); @@ -170,7 +170,7 @@ if (fp->_flags & __SOFF) curoff = fp->_offset; else { - curoff = (*seekfn)(fp->_cookie, (fpos_t)0, SEEK_CUR); + curoff = (*seekfn)(fp->_cookie, (off_t)0, SEEK_CUR); if (curoff == POS_ERR) goto dumb; } @@ -203,7 +203,7 @@ * skip this; see fgetln.c.) */ if ((fp->_flags & __SMOD) == 0 && - target >= curoff && target < (fpos_t)(curoff + n)) { + target >= curoff && target < curoff + (off_t)n) { int o = (int)(target - curoff); fp->_p = fp->_bf._base + o; @@ -247,7 +247,7 @@ */ dumb: if (__sflush(fp) || - (*seekfn)(fp->_cookie, (fpos_t)offset, whence) == POS_ERR) { + (*seekfn)(fp->_cookie, offset, whence) == POS_ERR) { FUNLOCKFILE(fp); return (-1); } Index: lib/libc/stdio/fsetpos.c =================================================================== RCS file: /cvsroot/src/lib/libc/stdio/fsetpos.c,v retrieving revision 1.10 diff -u -r1.10 fsetpos.c --- lib/libc/stdio/fsetpos.c 7 Aug 2003 16:43:25 -0000 1.10 +++ lib/libc/stdio/fsetpos.c 14 Sep 2010 08:11:07 -0000 @@ -45,17 +45,26 @@ #include #include #include +#include "reentrant.h" +#include "local.h" /* * fsetpos: like fseek. */ int -fsetpos(iop, pos) - FILE *iop; - const fpos_t *pos; +fsetpos(FILE * __restrict fp, const fpos_t * __restrict pos) { - _DIAGASSERT(iop != NULL); + struct wchar_io_data *wcio; + + _DIAGASSERT(fp != NULL); _DIAGASSERT(pos != NULL); - return (fseeko(iop, (off_t)*pos, SEEK_SET)); + wcio = WCIO_GET(fp); + if (wcio != NULL && wcio->wcio_mode > 0) { + if (fp->_write) + wcio->wcio_mbstate_in = pos->_mbstate_in; + if (fp->_read) + wcio->wcio_mbstate_out = pos->_mbstate_out; + } + return (fseeko(fp, pos->_pos, SEEK_SET) == (off_t)-1); } Index: lib/libc/stdio/ftell.c =================================================================== RCS file: /cvsroot/src/lib/libc/stdio/ftell.c,v retrieving revision 1.15 diff -u -r1.15 ftell.c --- lib/libc/stdio/ftell.c 7 Aug 2003 16:43:25 -0000 1.15 +++ lib/libc/stdio/ftell.c 14 Sep 2010 08:11:07 -0000 @@ -54,7 +54,7 @@ ftell(fp) FILE *fp; { - fpos_t pos; + off_t pos; FLOCKFILE(fp); @@ -73,7 +73,7 @@ if (fp->_flags & __SOFF) pos = fp->_offset; else { - pos = (*fp->_seek)(fp->_cookie, (fpos_t)0, SEEK_CUR); + pos = (*fp->_seek)(fp->_cookie, (off_t)0, SEEK_CUR); if (pos == -1L) { FUNLOCKFILE(fp); return (long)(pos); Index: lib/libc/stdio/ftello.c =================================================================== RCS file: /cvsroot/src/lib/libc/stdio/ftello.c,v retrieving revision 1.4 diff -u -r1.4 ftello.c --- lib/libc/stdio/ftello.c 7 Aug 2003 16:43:26 -0000 1.4 +++ lib/libc/stdio/ftello.c 14 Sep 2010 08:11:07 -0000 @@ -55,7 +55,7 @@ ftello(fp) FILE *fp; { - fpos_t pos; + off_t pos; FLOCKFILE(fp); @@ -74,8 +74,8 @@ if (fp->_flags & __SOFF) pos = fp->_offset; else { - pos = (*fp->_seek)(fp->_cookie, (fpos_t)0, SEEK_CUR); - if (pos == (fpos_t)-1) { + pos = (*fp->_seek)(fp->_cookie, (off_t)0, SEEK_CUR); + if (pos == (off_t)-1) { FUNLOCKFILE(fp); return (pos); } Index: lib/libc/stdio/funopen.3 =================================================================== RCS file: /cvsroot/src/lib/libc/stdio/funopen.3,v retrieving revision 1.15 diff -u -r1.15 funopen.3 --- lib/libc/stdio/funopen.3 22 Mar 2010 19:30:54 -0000 1.15 +++ lib/libc/stdio/funopen.3 14 Sep 2010 08:11:07 -0000 @@ -44,7 +44,7 @@ .Sh SYNOPSIS .In stdio.h .Ft FILE * -.Fn funopen "void *cookie" "int (*readfn)(void *, char *, int)" "int (*writefn)(void *, const char *, int)" "fpos_t (*seekfn)(void *, fpos_t, int)" "int (*closefn)(void *)" +.Fn funopen "void *cookie" "int (*readfn)(void *, char *, int)" "int (*writefn)(void *, const char *, int)" "off_t (*seekfn)(void *, off_t, int)" "int (*closefn)(void *)" .Ft FILE * .Fn fropen "void *cookie" "int (*readfn)(void *, char *, int)" .Ft FILE * @@ -89,13 +89,7 @@ .Fa cookie argument specified to .Fn funopen -in place of the traditional file descriptor argument, -and -.Fa seekfn -uses -.Li fpos_t -instead of -.Li off_t . +in place of the traditional file descriptor argument. .Pp Read and write .Tn I/O Index: lib/libc/stdio/funopen.c =================================================================== RCS file: /cvsroot/src/lib/libc/stdio/funopen.c,v retrieving revision 1.10 diff -u -r1.10 funopen.c --- lib/libc/stdio/funopen.c 29 Nov 2005 03:12:00 -0000 1.10 +++ lib/libc/stdio/funopen.c 14 Sep 2010 08:11:07 -0000 @@ -51,7 +51,7 @@ const void *cookie; int (*readfn) __P((void *, char *, int)); int (*writefn) __P((void *, const char *, int)); - fpos_t (*seekfn) __P((void *, fpos_t, int)); + off_t (*seekfn) __P((void *, off_t, int)); int (*closefn) __P((void *)); { FILE *fp; Index: lib/libc/stdio/local.h =================================================================== RCS file: /cvsroot/src/lib/libc/stdio/local.h,v retrieving revision 1.25 diff -u -r1.25 local.h --- lib/libc/stdio/local.h 6 Sep 2010 14:52:55 -0000 1.25 +++ lib/libc/stdio/local.h 14 Sep 2010 08:11:07 -0000 @@ -48,7 +48,7 @@ extern int __srefill __P((FILE *)); extern int __sread __P((void *, char *, int)); extern int __swrite __P((void *, char const *, int)); -extern fpos_t __sseek __P((void *, fpos_t, int)); +extern off_t __sseek __P((void *, off_t, int)); extern int __sclose __P((void *)); extern void __sinit __P((void)); extern void _cleanup __P((void)); Index: lib/libc/stdio/stdio.c =================================================================== RCS file: /cvsroot/src/lib/libc/stdio/stdio.c,v retrieving revision 1.16 diff -u -r1.16 stdio.c --- lib/libc/stdio/stdio.c 25 Oct 2009 20:44:13 -0000 1.16 +++ lib/libc/stdio/stdio.c 14 Sep 2010 08:11:07 -0000 @@ -94,10 +94,10 @@ return write(__sfileno(fp), buf, (size_t)n); } -fpos_t +off_t __sseek(cookie, offset, whence) void *cookie; - fpos_t offset; + off_t offset; int whence; { FILE *fp = cookie; @@ -105,7 +105,7 @@ _DIAGASSERT(fp != NULL); - ret = lseek(__sfileno(fp), (off_t)offset, whence); + ret = lseek(__sfileno(fp), offset, whence); if (ret == -1L) fp->_flags &= ~__SOFF; else { Index: tests/fs/nfs/nfsservice/mountd.c =================================================================== RCS file: /cvsroot/src/tests/fs/nfs/nfsservice/mountd.c,v retrieving revision 1.4 diff -u -r1.4 mountd.c --- tests/fs/nfs/nfsservice/mountd.c 28 Jul 2010 15:15:22 -0000 1.4 +++ tests/fs/nfs/nfsservice/mountd.c 14 Sep 2010 08:40:28 -0000 @@ -276,8 +276,8 @@ return rump_sys_write(C2FD(cookie), buf, count); } -static fpos_t -rumpseek(void *cookie, fpos_t off, int whence) +static off_t +rumpseek(void *cookie, off_t off, int whence) { return rump_sys_lseek(C2FD(cookie), off, whence);