Module Name: src
Committed By: christos
Date: Sun Jan 22 18:36:19 UTC 2012
Modified Files:
src/bin/csh: csh.c
src/distrib/sets/lists/base: ad.mips64eb ad.mips64el md.amd64
md.sparc64 shl.mi
src/distrib/sets/lists/comp: ad.mips64eb ad.mips64el md.amd64
md.sparc64 shl.mi
src/include: stdio.h
src/lib/libc: shlib_version
src/lib/libc/compat: Makefile Makefile.inc
src/lib/libc/stdio: fgetpos.c findfp.c fmemopen.c fopen.c freopen.c
fseek.3 fseeko.c fsetpos.c ftell.c ftello.c funopen.3 funopen.c
local.h stdio.c
src/tests/fs/nfs/nfsservice: mountd.c
Added Files:
src/lib/libc/compat/include: stdio.h
src/lib/libc/compat/stdio: Makefile.inc compat_fgetpos.c
compat_fsetpos.c
Log Message:
>From tsutsui@: make fpos_t a complex object that keeps track of the parse
state of the stream. Change argument of the seek function to funopen() from
fpos_t to off_t. Make f{g,s}etpos() use the new fpos_t struct, while providing
backwards compatible entry points. Approved by releng@
To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/bin/csh/csh.c
cvs rdiff -u -r1.77 -r1.78 src/distrib/sets/lists/base/ad.mips64eb
cvs rdiff -u -r1.76 -r1.77 src/distrib/sets/lists/base/ad.mips64el
cvs rdiff -u -r1.149 -r1.150 src/distrib/sets/lists/base/md.amd64
cvs rdiff -u -r1.142 -r1.143 src/distrib/sets/lists/base/md.sparc64
cvs rdiff -u -r1.611 -r1.612 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.64 -r1.65 src/distrib/sets/lists/comp/ad.mips64eb \
src/distrib/sets/lists/comp/ad.mips64el
cvs rdiff -u -r1.150 -r1.151 src/distrib/sets/lists/comp/md.amd64
cvs rdiff -u -r1.133 -r1.134 src/distrib/sets/lists/comp/md.sparc64
cvs rdiff -u -r1.204 -r1.205 src/distrib/sets/lists/comp/shl.mi
cvs rdiff -u -r1.79 -r1.80 src/include/stdio.h
cvs rdiff -u -r1.225 -r1.226 src/lib/libc/shlib_version
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/compat/Makefile
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/compat/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/compat/include/stdio.h
cvs rdiff -u -r0 -r1.1 src/lib/libc/compat/stdio/Makefile.inc \
src/lib/libc/compat/stdio/compat_fgetpos.c \
src/lib/libc/compat/stdio/compat_fsetpos.c
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/stdio/fgetpos.c
cvs rdiff -u -r1.25 -r1.26 src/lib/libc/stdio/findfp.c \
src/lib/libc/stdio/fseek.3
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/stdio/fmemopen.c
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/stdio/fopen.c
cvs rdiff -u -r1.16 -r1.17 src/lib/libc/stdio/freopen.c \
src/lib/libc/stdio/funopen.3 src/lib/libc/stdio/stdio.c
cvs rdiff -u -r1.8 -r1.9 src/lib/libc/stdio/fseeko.c
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/stdio/fsetpos.c \
src/lib/libc/stdio/funopen.c
cvs rdiff -u -r1.17 -r1.18 src/lib/libc/stdio/ftell.c
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/stdio/ftello.c
cvs rdiff -u -r1.30 -r1.31 src/lib/libc/stdio/local.h
cvs rdiff -u -r1.6 -r1.7 src/tests/fs/nfs/nfsservice/mountd.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/bin/csh/csh.c
diff -u src/bin/csh/csh.c:1.42 src/bin/csh/csh.c:1.43
--- src/bin/csh/csh.c:1.42 Mon Aug 29 10:51:17 2011
+++ src/bin/csh/csh.c Sun Jan 22 13:36:14 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: csh.c,v 1.42 2011/08/29 14:51:17 joerg Exp $ */
+/* $NetBSD: csh.c,v 1.43 2012/01/22 18:36:14 christos Exp $ */
/*-
* Copyright (c) 1980, 1991, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
#if 0
static char sccsid[] = "@(#)csh.c 8.2 (Berkeley) 10/12/93";
#else
-__RCSID("$NetBSD: csh.c,v 1.42 2011/08/29 14:51:17 joerg Exp $");
+__RCSID("$NetBSD: csh.c,v 1.43 2012/01/22 18:36:14 christos Exp $");
#endif
#endif /* not lint */
@@ -94,7 +94,7 @@ int reenter = 0;
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 @@ writef(void *oreo, const char *buf, int
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: src/distrib/sets/lists/base/ad.mips64eb
diff -u src/distrib/sets/lists/base/ad.mips64eb:1.77 src/distrib/sets/lists/base/ad.mips64eb:1.78
--- src/distrib/sets/lists/base/ad.mips64eb:1.77 Mon Jan 9 10:24:37 2012
+++ src/distrib/sets/lists/base/ad.mips64eb Sun Jan 22 13:36:14 2012
@@ -1,4 +1,4 @@
-# $NetBSD: ad.mips64eb,v 1.77 2012/01/09 15:24:37 dholland Exp $
+# $NetBSD: ad.mips64eb,v 1.78 2012/01/22 18:36:14 christos Exp $
./libexec/ld.elf_so-64 base-compat-shlib compat,pic
./libexec/ld.elf_so-o32 base-sysutil-bin compat,pic
./usr/lib/64 base-compat-lib
@@ -66,7 +66,7 @@
./usr/lib/64/libbz2.so.1 base-compat-shlib compat,pic
./usr/lib/64/libbz2.so.1.1 base-compat-shlib compat,pic
./usr/lib/64/libc.so.12 base-compat-shlib compat,pic
-./usr/lib/64/libc.so.12.179 base-compat-shlib compat,pic
+./usr/lib/64/libc.so.12.180 base-compat-shlib compat,pic
./usr/lib/64/libcom_err.so.7 base-compat-shlib compat,pic,kerberos
./usr/lib/64/libcom_err.so.7.0 base-compat-shlib compat,pic,kerberos
./usr/lib/64/libcrypt.so.1 base-compat-shlib compat,pic
@@ -362,7 +362,7 @@
./usr/lib/o32/libbz2.so.1 base-compat-shlib compat,pic
./usr/lib/o32/libbz2.so.1.1 base-compat-shlib compat,pic
./usr/lib/o32/libc.so.12 base-compat-shlib compat,pic
-./usr/lib/o32/libc.so.12.179 base-compat-shlib compat,pic
+./usr/lib/o32/libc.so.12.180 base-compat-shlib compat,pic
./usr/lib/o32/libcom_err.so.7 base-compat-shlib compat,pic,kerberos
./usr/lib/o32/libcom_err.so.7.0 base-compat-shlib compat,pic,kerberos
./usr/lib/o32/libcrypt.so.1 base-compat-shlib compat,pic
Index: src/distrib/sets/lists/base/ad.mips64el
diff -u src/distrib/sets/lists/base/ad.mips64el:1.76 src/distrib/sets/lists/base/ad.mips64el:1.77
--- src/distrib/sets/lists/base/ad.mips64el:1.76 Mon Jan 9 10:24:37 2012
+++ src/distrib/sets/lists/base/ad.mips64el Sun Jan 22 13:36:15 2012
@@ -1,4 +1,4 @@
-# $NetBSD: ad.mips64el,v 1.76 2012/01/09 15:24:37 dholland Exp $
+# $NetBSD: ad.mips64el,v 1.77 2012/01/22 18:36:15 christos Exp $
./libexec/ld.elf_so-64 base-compat-shlib compat,pic
./libexec/ld.elf_so-o32 base-sysutil-bin compat,pic
./usr/lib/64 base-compat-lib
@@ -66,7 +66,7 @@
./usr/lib/64/libbz2.so.1 base-compat-shlib compat,pic
./usr/lib/64/libbz2.so.1.1 base-compat-shlib compat,pic
./usr/lib/64/libc.so.12 base-compat-shlib compat,pic
-./usr/lib/64/libc.so.12.179 base-compat-shlib compat,pic
+./usr/lib/64/libc.so.12.180 base-compat-shlib compat,pic
./usr/lib/64/libcom_err.so.7 base-compat-shlib compat,pic,kerberos
./usr/lib/64/libcom_err.so.7.0 base-compat-shlib compat,pic,kerberos
./usr/lib/64/libcrypt.so.1 base-compat-shlib compat,pic
@@ -362,7 +362,7 @@
./usr/lib/o32/libbz2.so.1 base-compat-shlib compat,pic
./usr/lib/o32/libbz2.so.1.1 base-compat-shlib compat,pic
./usr/lib/o32/libc.so.12 base-compat-shlib compat,pic
-./usr/lib/o32/libc.so.12.179 base-compat-shlib compat,pic
+./usr/lib/o32/libc.so.12.180 base-compat-shlib compat,pic
./usr/lib/o32/libcom_err.so.7 base-compat-shlib compat,pic,kerberos
./usr/lib/o32/libcom_err.so.7.0 base-compat-shlib compat,pic,kerberos
./usr/lib/o32/libcrypt.so.1 base-compat-shlib compat,pic
Index: src/distrib/sets/lists/base/md.amd64
diff -u src/distrib/sets/lists/base/md.amd64:1.149 src/distrib/sets/lists/base/md.amd64:1.150
--- src/distrib/sets/lists/base/md.amd64:1.149 Mon Jan 9 10:24:37 2012
+++ src/distrib/sets/lists/base/md.amd64 Sun Jan 22 13:36:15 2012
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.149 2012/01/09 15:24:37 dholland Exp $
+# $NetBSD: md.amd64,v 1.150 2012/01/22 18:36:15 christos Exp $
./dev/lms0 base-obsolete obsolete
./dev/mms0 base-obsolete obsolete
./libexec/ld.elf_so-i386 base-sys-shlib compat,pic
@@ -69,7 +69,7 @@
./usr/lib/i386/libbz2.so.1 base-compat-shlib compat,pic
./usr/lib/i386/libbz2.so.1.1 base-compat-shlib compat,pic
./usr/lib/i386/libc.so.12 base-compat-shlib compat,pic
-./usr/lib/i386/libc.so.12.179 base-compat-shlib compat,pic
+./usr/lib/i386/libc.so.12.180 base-compat-shlib compat,pic
./usr/lib/i386/libcom_err.so.7 base-compat-shlib compat,pic,kerberos
./usr/lib/i386/libcom_err.so.7.0 base-compat-shlib compat,pic,kerberos
./usr/lib/i386/libcrypt.so.1 base-compat-shlib compat,pic
Index: src/distrib/sets/lists/base/md.sparc64
diff -u src/distrib/sets/lists/base/md.sparc64:1.142 src/distrib/sets/lists/base/md.sparc64:1.143
--- src/distrib/sets/lists/base/md.sparc64:1.142 Mon Jan 9 10:24:37 2012
+++ src/distrib/sets/lists/base/md.sparc64 Sun Jan 22 13:36:15 2012
@@ -1,4 +1,4 @@
-# $NetBSD: md.sparc64,v 1.142 2012/01/09 15:24:37 dholland Exp $
+# $NetBSD: md.sparc64,v 1.143 2012/01/22 18:36:15 christos Exp $
./libexec/ld.elf_so-sparc base-sysutil-bin compat,pic
./sbin/edlabel base-sysutil-root obsolete
./usr/bin/fdformat base-util-bin
@@ -67,7 +67,7 @@
./usr/lib/sparc/libbz2.so.1 base-compat-shlib compat,pic
./usr/lib/sparc/libbz2.so.1.1 base-compat-shlib compat,pic
./usr/lib/sparc/libc.so.12 base-compat-shlib compat,pic
-./usr/lib/sparc/libc.so.12.179 base-compat-shlib compat,pic
+./usr/lib/sparc/libc.so.12.180 base-compat-shlib compat,pic
./usr/lib/sparc/libcom_err.so.7 base-compat-shlib compat,pic,kerberos
./usr/lib/sparc/libcom_err.so.7.0 base-compat-shlib compat,pic,kerberos
./usr/lib/sparc/libcrypt.so.1 base-compat-shlib compat,pic
Index: src/distrib/sets/lists/base/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.611 src/distrib/sets/lists/base/shl.mi:1.612
--- src/distrib/sets/lists/base/shl.mi:1.611 Mon Jan 9 10:24:37 2012
+++ src/distrib/sets/lists/base/shl.mi Sun Jan 22 13:36:15 2012
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.611 2012/01/09 15:24:37 dholland Exp $
+# $NetBSD: shl.mi,v 1.612 2012/01/22 18:36:15 christos Exp $
#
# Note: Don't delete entries from here - mark them as "obsolete" instead,
# unless otherwise stated below.
@@ -15,7 +15,7 @@
#
./lib/libc.so base-sys-shlib dynamicroot
./lib/libc.so.12 base-sys-shlib dynamicroot
-./lib/libc.so.12.179 base-sys-shlib dynamicroot
+./lib/libc.so.12.180 base-sys-shlib dynamicroot
./lib/libcrypt.so base-sys-shlib dynamicroot
./lib/libcrypt.so.1 base-sys-shlib dynamicroot
./lib/libcrypt.so.1.0 base-sys-shlib dynamicroot
@@ -173,7 +173,7 @@
./usr/lib/libbz2.so.1.1 base-sys-shlib
./usr/lib/libc.so base-sys-shlib
./usr/lib/libc.so.12 base-sys-shlib
-./usr/lib/libc.so.12.179 base-sys-shlib
+./usr/lib/libc.so.12.180 base-sys-shlib
./usr/lib/libcdk.so base-obsolete obsolete
./usr/lib/libcom_err.so base-krb5-shlib kerberos
./usr/lib/libcom_err.so.7 base-krb5-shlib kerberos
Index: src/distrib/sets/lists/comp/ad.mips64eb
diff -u src/distrib/sets/lists/comp/ad.mips64eb:1.64 src/distrib/sets/lists/comp/ad.mips64eb:1.65
--- src/distrib/sets/lists/comp/ad.mips64eb:1.64 Mon Jan 9 10:24:37 2012
+++ src/distrib/sets/lists/comp/ad.mips64eb Sun Jan 22 13:36:15 2012
@@ -1,4 +1,4 @@
-# $NetBSD: ad.mips64eb,v 1.64 2012/01/09 15:24:37 dholland Exp $
+# $NetBSD: ad.mips64eb,v 1.65 2012/01/22 18:36:15 christos Exp $
./usr/bin/elf2aout comp-obsolete obsolete
./usr/bin/elf2ecoff comp-sysutil-bin
./usr/include/gcc-4.5/loongson.h comp-c-include gcccmds,gcc=45
@@ -1266,7 +1266,7 @@
./usr/libdata/debug/usr/lib/64/libbluetooth.so.4.2.debug comp-sys-debug debug,compat
./usr/libdata/debug/usr/lib/64/libbsdmalloc.so.0.0.debug comp-sys-debug debug,compat
./usr/libdata/debug/usr/lib/64/libbz2.so.1.1.debug comp-sys-debug debug,compat
-./usr/libdata/debug/usr/lib/64/libc.so.12.179.debug comp-sys-debug debug,compat
+./usr/libdata/debug/usr/lib/64/libc.so.12.180.debug comp-sys-debug debug,compat
./usr/libdata/debug/usr/lib/64/libcom_err.so.6.0.debug comp-compat-shlib compat,pic,kerberos,debug,obsolete
./usr/libdata/debug/usr/lib/64/libcom_err.so.7.0.debug comp-compat-shlib compat,pic,kerberos,debug
./usr/libdata/debug/usr/lib/64/libcrypt.so.1.0.debug comp-sys-debug debug,compat
@@ -1418,7 +1418,7 @@
./usr/libdata/debug/usr/lib/o32/libbluetooth.so.4.2.debug comp-sys-debug debug,compat
./usr/libdata/debug/usr/lib/o32/libbsdmalloc.so.0.0.debug comp-sys-debug debug,compat
./usr/libdata/debug/usr/lib/o32/libbz2.so.1.1.debug comp-sys-debug debug,compat
-./usr/libdata/debug/usr/lib/o32/libc.so.12.179.debug comp-sys-debug debug,compat
+./usr/libdata/debug/usr/lib/o32/libc.so.12.180.debug comp-sys-debug debug,compat
./usr/libdata/debug/usr/lib/o32/libcom_err.so.6.0.debug comp-compat-shlib compat,pic,kerberos,debug,obsolete
./usr/libdata/debug/usr/lib/o32/libcom_err.so.7.0.debug comp-compat-shlib compat,pic,kerberos,debug
./usr/libdata/debug/usr/lib/o32/libcrypt.so.1.0.debug comp-sys-debug debug,compat
Index: src/distrib/sets/lists/comp/ad.mips64el
diff -u src/distrib/sets/lists/comp/ad.mips64el:1.64 src/distrib/sets/lists/comp/ad.mips64el:1.65
--- src/distrib/sets/lists/comp/ad.mips64el:1.64 Mon Jan 9 10:24:37 2012
+++ src/distrib/sets/lists/comp/ad.mips64el Sun Jan 22 13:36:16 2012
@@ -1,4 +1,4 @@
-# $NetBSD: ad.mips64el,v 1.64 2012/01/09 15:24:37 dholland Exp $
+# $NetBSD: ad.mips64el,v 1.65 2012/01/22 18:36:16 christos Exp $
./usr/bin/elf2aout comp-obsolete obsolete
./usr/bin/elf2ecoff comp-sysutil-bin
./usr/include/gcc-4.5/loongson.h comp-c-include gcccmds,gcc=45
@@ -1266,7 +1266,7 @@
./usr/libdata/debug/usr/lib/64/libbluetooth.so.4.2.debug comp-sys-debug debug,compat
./usr/libdata/debug/usr/lib/64/libbsdmalloc.so.0.0.debug comp-sys-debug debug,compat
./usr/libdata/debug/usr/lib/64/libbz2.so.1.1.debug comp-sys-debug debug,compat
-./usr/libdata/debug/usr/lib/64/libc.so.12.179.debug comp-sys-debug debug,compat
+./usr/libdata/debug/usr/lib/64/libc.so.12.180.debug comp-sys-debug debug,compat
./usr/libdata/debug/usr/lib/64/libcom_err.so.6.0.debug comp-compat-shlib compat,pic,kerberos,debug,obsolete
./usr/libdata/debug/usr/lib/64/libcom_err.so.7.0.debug comp-compat-shlib compat,pic,kerberos,debug
./usr/libdata/debug/usr/lib/64/libcrypt.so.1.0.debug comp-sys-debug debug,compat
@@ -1418,7 +1418,7 @@
./usr/libdata/debug/usr/lib/o32/libbluetooth.so.4.2.debug comp-sys-debug debug,compat
./usr/libdata/debug/usr/lib/o32/libbsdmalloc.so.0.0.debug comp-sys-debug debug,compat
./usr/libdata/debug/usr/lib/o32/libbz2.so.1.1.debug comp-sys-debug debug,compat
-./usr/libdata/debug/usr/lib/o32/libc.so.12.179.debug comp-sys-debug debug,compat
+./usr/libdata/debug/usr/lib/o32/libc.so.12.180.debug comp-sys-debug debug,compat
./usr/libdata/debug/usr/lib/o32/libcom_err.so.6.0.debug comp-compat-shlib compat,pic,kerberos,debug,obsolete
./usr/libdata/debug/usr/lib/o32/libcom_err.so.7.0.debug comp-compat-shlib compat,pic,kerberos,debug
./usr/libdata/debug/usr/lib/o32/libcrypt.so.1.0.debug comp-sys-debug debug,compat
Index: src/distrib/sets/lists/comp/md.amd64
diff -u src/distrib/sets/lists/comp/md.amd64:1.150 src/distrib/sets/lists/comp/md.amd64:1.151
--- src/distrib/sets/lists/comp/md.amd64:1.150 Wed Jan 18 12:32:41 2012
+++ src/distrib/sets/lists/comp/md.amd64 Sun Jan 22 13:36:16 2012
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.150 2012/01/18 17:32:41 riz Exp $
+# $NetBSD: md.amd64,v 1.151 2012/01/22 18:36:16 christos Exp $
./usr/include/amd64 comp-c-include
./usr/include/amd64/ansi.h comp-c-include
./usr/include/amd64/aout_machdep.h comp-c-include
@@ -1048,7 +1048,7 @@
./usr/libdata/debug/usr/lib/i386/libbluetooth.so.4.2.debug comp-compat-shlib compat,pic,debug
./usr/libdata/debug/usr/lib/i386/libbsdmalloc.so.0.0.debug comp-compat-shlib compat,pic,debug
./usr/libdata/debug/usr/lib/i386/libbz2.so.1.1.debug comp-compat-shlib compat,pic,debug
-./usr/libdata/debug/usr/lib/i386/libc.so.12.179.debug comp-compat-shlib compat,pic,debug
+./usr/libdata/debug/usr/lib/i386/libc.so.12.180.debug comp-compat-shlib compat,pic,debug
./usr/libdata/debug/usr/lib/i386/libcom_err.so.6.0.debug comp-compat-shlib compat,pic,kerberos,debug,obsolete
./usr/libdata/debug/usr/lib/i386/libcom_err.so.7.0.debug comp-compat-shlib compat,pic,kerberos,debug
./usr/libdata/debug/usr/lib/i386/libcrypt.so.1.0.debug comp-compat-shlib compat,pic,debug
Index: src/distrib/sets/lists/comp/md.sparc64
diff -u src/distrib/sets/lists/comp/md.sparc64:1.133 src/distrib/sets/lists/comp/md.sparc64:1.134
--- src/distrib/sets/lists/comp/md.sparc64:1.133 Mon Jan 9 10:24:37 2012
+++ src/distrib/sets/lists/comp/md.sparc64 Sun Jan 22 13:36:16 2012
@@ -1,4 +1,4 @@
-# $NetBSD: md.sparc64,v 1.133 2012/01/09 15:24:37 dholland Exp $
+# $NetBSD: md.sparc64,v 1.134 2012/01/22 18:36:16 christos Exp $
./usr/include/gcc-4.5/tgmath.h comp-c-include gcccmds,gcc=45
./usr/include/ieeefp.h comp-c-include
./usr/include/sparc comp-c-include
@@ -891,7 +891,7 @@
./usr/libdata/debug/usr/lib/sparc/libbluetooth.so.4.2.debug comp-compat-shlib compat,pic,debug
./usr/libdata/debug/usr/lib/sparc/libbsdmalloc.so.0.0.debug comp-compat-shlib compat,pic,debug
./usr/libdata/debug/usr/lib/sparc/libbz2.so.1.1.debug comp-compat-shlib compat,pic,debug
-./usr/libdata/debug/usr/lib/sparc/libc.so.12.179.debug comp-compat-shlib compat,pic,debug
+./usr/libdata/debug/usr/lib/sparc/libc.so.12.180.debug comp-compat-shlib compat,pic,debug
./usr/libdata/debug/usr/lib/sparc/libcom_err.so.6.0.debug comp-compat-shlib compat,pic,kerberos,debug,obsolete
./usr/libdata/debug/usr/lib/sparc/libcom_err.so.7.0.debug comp-compat-shlib compat,pic,kerberos,debug
./usr/libdata/debug/usr/lib/sparc/libcrypt.so.1.0.debug comp-compat-shlib compat,pic,debug
Index: src/distrib/sets/lists/comp/shl.mi
diff -u src/distrib/sets/lists/comp/shl.mi:1.204 src/distrib/sets/lists/comp/shl.mi:1.205
--- src/distrib/sets/lists/comp/shl.mi:1.204 Mon Jan 9 10:24:37 2012
+++ src/distrib/sets/lists/comp/shl.mi Sun Jan 22 13:36:16 2012
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.204 2012/01/09 15:24:37 dholland Exp $
+# $NetBSD: shl.mi,v 1.205 2012/01/22 18:36:16 christos Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -248,7 +248,7 @@
./usr/libdata/debug/usr/lib/libbluetooth.so.4.2.debug comp-sys-debug debug
./usr/libdata/debug/usr/lib/libbsdmalloc.so.0.0.debug comp-sys-debug debug
./usr/libdata/debug/usr/lib/libbz2.so.1.1.debug comp-sys-debug debug
-./usr/libdata/debug/usr/lib/libc.so.12.179.debug comp-sys-debug debug
+./usr/libdata/debug/usr/lib/libc.so.12.180.debug comp-sys-debug debug
./usr/libdata/debug/usr/lib/libcom_err.so.7.0.debug comp-krb5-debug kerberos,debug
./usr/libdata/debug/usr/lib/libcrypt.so.1.0.debug comp-sys-debug debug
./usr/libdata/debug/usr/lib/libcrypto.so.7.0.debug comp-crypto-debug crypto,debug
Index: src/include/stdio.h
diff -u src/include/stdio.h:1.79 src/include/stdio.h:1.80
--- src/include/stdio.h:1.79 Sun Jul 17 16:54:34 2011
+++ src/include/stdio.h Sun Jan 22 13:36:16 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: stdio.h,v 1.79 2011/07/17 20:54:34 joerg Exp $ */
+/* $NetBSD: stdio.h,v 1.80 2012/01/22 18:36:16 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -64,13 +64,10 @@ typedef __va_list va_list;
* 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. */
@@ -125,7 +122,7 @@ typedef struct __sFILE {
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 */
@@ -144,7 +141,7 @@ typedef struct __sFILE {
/* 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
@@ -228,7 +225,6 @@ int feof(FILE *);
int ferror(FILE *);
int fflush(FILE *);
int fgetc(FILE *);
-int fgetpos(FILE * __restrict, fpos_t * __restrict);
char *fgets(char * __restrict, int, FILE * __restrict);
FILE *fopen(const char * __restrict , const char * __restrict);
int fprintf(FILE * __restrict , const char * __restrict, ...)
@@ -241,7 +237,6 @@ FILE *freopen(const char * __restrict, c
int fscanf(FILE * __restrict, const char * __restrict, ...)
__scanflike(2, 3);
int fseek(FILE *, long, int);
-int fsetpos(FILE *, const fpos_t *);
long ftell(FILE *);
size_t fwrite(const void * __restrict, size_t, size_t, FILE * __restrict);
int getc(FILE *);
@@ -287,6 +282,10 @@ int rename (const char *, const char *)
#endif
__END_DECLS
+#ifndef __LIBC12_SOURCE__
+int fgetpos(FILE * __restrict, fpos_t * __restrict) __RENAME(__fgetpos50);
+int fsetpos(FILE *, const fpos_t *) __RENAME(__fsetpos50);
+#endif
/*
* IEEE Std 1003.1-90
*/
@@ -430,7 +429,7 @@ __BEGIN_DECLS
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: src/lib/libc/shlib_version
diff -u src/lib/libc/shlib_version:1.225 src/lib/libc/shlib_version:1.226
--- src/lib/libc/shlib_version:1.225 Tue Nov 8 11:25:25 2011
+++ src/lib/libc/shlib_version Sun Jan 22 13:36:16 2012
@@ -1,4 +1,4 @@
-# $NetBSD: shlib_version,v 1.225 2011/11/08 16:25:25 joerg Exp $
+# $NetBSD: shlib_version,v 1.226 2012/01/22 18:36:16 christos Exp $
# Remember to update distrib/sets/lists/base/shl.* when changing
#
# things we wish to do on next major version bump:
@@ -17,9 +17,6 @@
# - libc/db/hash/ndbm.c: remove; __ndbm13 -> ndbm
# - libc/net/getnet{ent,namadr}.c, netdb.h: remove __n_pad0
# - libc/stdio: make _file an int, hide struct FILE, stdin, stdout, stderr impls
-# - libc/stdio: make fpos_t larger. see BUGS section in fgetpos(3).
-# probably s/fpos_t/off_t/ in __sFILE and __sseek(). it involves
-# funopen(3) api change.
# - remove frexp, ldexp, modf: they belong to libm.
# - make sure we can support thread local [on arm don't use r9 for example,
# consider other risc architectures: mips, powerpc, sparc, etc]
@@ -32,4 +29,4 @@
# it's insufficient bitwidth to implement all ctype class.
# see isblank's comment in ctype.h.
major=12
-minor=179
+minor=180
Index: src/lib/libc/compat/Makefile
diff -u src/lib/libc/compat/Makefile:1.5 src/lib/libc/compat/Makefile:1.6
--- src/lib/libc/compat/Makefile:1.5 Mon Jun 7 09:52:29 2010
+++ src/lib/libc/compat/Makefile Sun Jan 22 13:36:16 2012
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2010/06/07 13:52:29 tnozaki Exp $
+# $NetBSD: Makefile,v 1.6 2012/01/22 18:36:16 christos Exp $
# @(#)Makefile 8.2 (Berkeley) 2/3/94
#
@@ -17,6 +17,7 @@ COMPATDIR=${.CURDIR}
.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: src/lib/libc/compat/Makefile.inc
diff -u src/lib/libc/compat/Makefile.inc:1.6 src/lib/libc/compat/Makefile.inc:1.7
--- src/lib/libc/compat/Makefile.inc:1.6 Mon Jun 7 09:52:29 2010
+++ src/lib/libc/compat/Makefile.inc Sun Jan 22 13:36:16 2012
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.6 2010/06/07 13:52:29 tnozaki Exp $
+# $NetBSD: Makefile.inc,v 1.7 2012/01/22 18:36:16 christos Exp $
CPPFLAGS+= -I${NETBSDSRCDIR}/sys
@@ -10,6 +10,7 @@ COMPATARCHDIR=${COMPATDIR}/arch/${ARCHSU
.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: src/lib/libc/stdio/fgetpos.c
diff -u src/lib/libc/stdio/fgetpos.c:1.11 src/lib/libc/stdio/fgetpos.c:1.12
--- src/lib/libc/stdio/fgetpos.c:1.11 Thu Aug 7 12:43:23 2003
+++ src/lib/libc/stdio/fgetpos.c Sun Jan 22 13:36:17 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: fgetpos.c,v 1.11 2003/08/07 16:43:23 agc Exp $ */
+/* $NetBSD: fgetpos.c,v 1.12 2012/01/22 18:36:17 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)fgetpos.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: fgetpos.c,v 1.11 2003/08/07 16:43:23 agc Exp $");
+__RCSID("$NetBSD: fgetpos.c,v 1.12 2012/01/22 18:36:17 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -45,14 +45,23 @@ __RCSID("$NetBSD: fgetpos.c,v 1.11 2003/
#include <assert.h>
#include <errno.h>
#include <stdio.h>
+#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: src/lib/libc/stdio/findfp.c
diff -u src/lib/libc/stdio/findfp.c:1.25 src/lib/libc/stdio/findfp.c:1.26
--- src/lib/libc/stdio/findfp.c:1.25 Mon Sep 6 10:52:55 2010
+++ src/lib/libc/stdio/findfp.c Sun Jan 22 13:36:17 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: findfp.c,v 1.25 2010/09/06 14:52:55 christos Exp $ */
+/* $NetBSD: findfp.c,v 1.26 2012/01/22 18:36:17 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)findfp.c 8.2 (Berkeley) 1/4/94";
#else
-__RCSID("$NetBSD: findfp.c,v 1.25 2010/09/06 14:52:55 christos Exp $");
+__RCSID("$NetBSD: findfp.c,v 1.26 2012/01/22 18:36:17 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -62,7 +62,7 @@ int __sdidinit;
/* 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: src/lib/libc/stdio/fseek.3
diff -u src/lib/libc/stdio/fseek.3:1.25 src/lib/libc/stdio/fseek.3:1.26
--- src/lib/libc/stdio/fseek.3:1.25 Fri Oct 22 17:29:31 2010
+++ src/lib/libc/stdio/fseek.3 Sun Jan 22 13:36:17 2012
@@ -1,4 +1,4 @@
-.\" $NetBSD: fseek.3,v 1.25 2010/10/22 21:29:31 christos Exp $
+.\" $NetBSD: fseek.3,v 1.26 2012/01/22 18:36:17 christos Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -33,7 +33,7 @@
.\"
.\" @(#)fseek.3 8.1 (Berkeley) 6/4/93
.\"
-.Dd October 22, 2010
+.Dd January 21, 2012
.Dt FSEEK 3
.Os
.Sh NAME
@@ -127,26 +127,18 @@ except that the error indicator for the
(see
.Xr clearerr 3 ) .
.Pp
-In this implementation, the
-.Fn fgetpos
-and
-.Fn fsetpos
-functions
-are alternative interfaces equivalent to
-.Fn ftell ,
-.Fn ftello ,
-.Fn fseek ,
-and
-.Fn fseeko
-(with whence set to
-.Dv SEEK_SET ) ,
-setting and storing the current value of
-the file offset into or from the object referenced by
-.Fa pos .
-In others implementations, an
+In this implementations, an
.Dq Fa fpos_t
-object may be a complex object
-and these routines may be the only way to portably reposition a text stream.
+object is a complex object that represents both the position and the parse
+state of the stream making these routines are the only way to portably
+reposition a text stream.
+The
+.Ar pos
+argument of
+.Fn fsetpos
+must always be initialized by
+a call to
+.Fn fgetpos .
.Sh RETURN VALUES
The
.Fn rewind
Index: src/lib/libc/stdio/fmemopen.c
diff -u src/lib/libc/stdio/fmemopen.c:1.5 src/lib/libc/stdio/fmemopen.c:1.6
--- src/lib/libc/stdio/fmemopen.c:1.5 Mon Sep 27 13:08:29 2010
+++ src/lib/libc/stdio/fmemopen.c Sun Jan 22 13:36:17 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: fmemopen.c,v 1.5 2010/09/27 17:08:29 tnozaki Exp $ */
+/* $NetBSD: fmemopen.c,v 1.6 2012/01/22 18:36:17 christos Exp $ */
/*-
* Copyright (c)2007, 2010 Takehiko NOZAKI,
@@ -29,7 +29,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fmemopen.c,v 1.5 2010/09/27 17:08:29 tnozaki Exp $");
+__RCSID("$NetBSD: fmemopen.c,v 1.6 2012/01/22 18:36:17 christos Exp $");
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
@@ -97,8 +97,8 @@ ok:
return (int)(p->cur - s);
}
-static fpos_t
-fmemopen_seek(void *cookie, fpos_t offset, int whence)
+static off_t
+fmemopen_seek(void *cookie, off_t offset, int whence)
{
struct fmemopen_cookie *p;
@@ -118,12 +118,12 @@ fmemopen_seek(void *cookie, fpos_t offse
errno = EINVAL;
goto error;
}
- if (offset >= (fpos_t)0 && offset <= p->tail - p->head) {
+ if (offset >= (off_t)0 && offset <= p->tail - p->head) {
p->cur = p->head + (ptrdiff_t)offset;
- return (fpos_t)(p->cur - p->head);
+ return (off_t)(p->cur - p->head);
}
error:
- return (fpos_t)-1;
+ return (off_t)-1;
}
static int
Index: src/lib/libc/stdio/fopen.c
diff -u src/lib/libc/stdio/fopen.c:1.13 src/lib/libc/stdio/fopen.c:1.14
--- src/lib/libc/stdio/fopen.c:1.13 Thu Mar 13 11:40:00 2008
+++ src/lib/libc/stdio/fopen.c Sun Jan 22 13:36:17 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: fopen.c,v 1.13 2008/03/13 15:40:00 christos Exp $ */
+/* $NetBSD: fopen.c,v 1.14 2012/01/22 18:36:17 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)fopen.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: fopen.c,v 1.13 2008/03/13 15:40:00 christos Exp $");
+__RCSID("$NetBSD: fopen.c,v 1.14 2012/01/22 18:36:17 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -111,7 +111,7 @@ fopen(file, mode)
* 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: src/lib/libc/stdio/freopen.c
diff -u src/lib/libc/stdio/freopen.c:1.16 src/lib/libc/stdio/freopen.c:1.17
--- src/lib/libc/stdio/freopen.c:1.16 Mon Jan 11 15:39:29 2010
+++ src/lib/libc/stdio/freopen.c Sun Jan 22 13:36:17 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: freopen.c,v 1.16 2010/01/11 20:39:29 joerg Exp $ */
+/* $NetBSD: freopen.c,v 1.17 2012/01/22 18:36:17 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)freopen.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: freopen.c,v 1.16 2010/01/11 20:39:29 joerg Exp $");
+__RCSID("$NetBSD: freopen.c,v 1.17 2012/01/22 18:36:17 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -200,6 +200,6 @@ freopen(file, mode, fp)
* 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: src/lib/libc/stdio/funopen.3
diff -u src/lib/libc/stdio/funopen.3:1.16 src/lib/libc/stdio/funopen.3:1.17
--- src/lib/libc/stdio/funopen.3:1.16 Sun Sep 11 03:37:06 2011
+++ src/lib/libc/stdio/funopen.3 Sun Jan 22 13:36:17 2012
@@ -1,4 +1,4 @@
-.\" $NetBSD: funopen.3,v 1.16 2011/09/11 07:37:06 jruoho Exp $
+.\" $NetBSD: funopen.3,v 1.17 2012/01/22 18:36:17 christos Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -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 @@ except that they are passed the
.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: src/lib/libc/stdio/stdio.c
diff -u src/lib/libc/stdio/stdio.c:1.16 src/lib/libc/stdio/stdio.c:1.17
--- src/lib/libc/stdio/stdio.c:1.16 Sun Oct 25 16:44:13 2009
+++ src/lib/libc/stdio/stdio.c Sun Jan 22 13:36:17 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: stdio.c,v 1.16 2009/10/25 20:44:13 christos Exp $ */
+/* $NetBSD: stdio.c,v 1.17 2012/01/22 18:36:17 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)stdio.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: stdio.c,v 1.16 2009/10/25 20:44:13 christos Exp $");
+__RCSID("$NetBSD: stdio.c,v 1.17 2012/01/22 18:36:17 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -94,10 +94,10 @@ __swrite(cookie, buf, n)
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 @@ __sseek(cookie, offset, whence)
_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: src/lib/libc/stdio/fseeko.c
diff -u src/lib/libc/stdio/fseeko.c:1.8 src/lib/libc/stdio/fseeko.c:1.9
--- src/lib/libc/stdio/fseeko.c:1.8 Fri Jan 30 19:08:05 2009
+++ src/lib/libc/stdio/fseeko.c Sun Jan 22 13:36:17 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: fseeko.c,v 1.8 2009/01/31 00:08:05 lukem Exp $ */
+/* $NetBSD: fseeko.c,v 1.9 2012/01/22 18:36:17 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -34,7 +34,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fseeko.c,v 1.8 2009/01/31 00:08:05 lukem Exp $");
+__RCSID("$NetBSD: fseeko.c,v 1.9 2012/01/22 18:36:17 christos Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@@ -53,7 +53,7 @@ __RCSID("$NetBSD: fseeko.c,v 1.8 2009/01
__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 @@ __weak_alias(fseeko, _fseeko)
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 @@ fseeko(FILE *fp, off_t offset, int whenc
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 @@ fseeko(FILE *fp, off_t offset, int whenc
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 @@ fseeko(FILE *fp, off_t offset, int whenc
* 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 @@ fseeko(FILE *fp, off_t offset, int whenc
*/
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: src/lib/libc/stdio/fsetpos.c
diff -u src/lib/libc/stdio/fsetpos.c:1.10 src/lib/libc/stdio/fsetpos.c:1.11
--- src/lib/libc/stdio/fsetpos.c:1.10 Thu Aug 7 12:43:25 2003
+++ src/lib/libc/stdio/fsetpos.c Sun Jan 22 13:36:17 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: fsetpos.c,v 1.10 2003/08/07 16:43:25 agc Exp $ */
+/* $NetBSD: fsetpos.c,v 1.11 2012/01/22 18:36:17 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)fsetpos.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: fsetpos.c,v 1.10 2003/08/07 16:43:25 agc Exp $");
+__RCSID("$NetBSD: fsetpos.c,v 1.11 2012/01/22 18:36:17 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -45,17 +45,26 @@ __RCSID("$NetBSD: fsetpos.c,v 1.10 2003/
#include <assert.h>
#include <errno.h>
#include <stdio.h>
+#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: src/lib/libc/stdio/funopen.c
diff -u src/lib/libc/stdio/funopen.c:1.10 src/lib/libc/stdio/funopen.c:1.11
--- src/lib/libc/stdio/funopen.c:1.10 Mon Nov 28 22:12:00 2005
+++ src/lib/libc/stdio/funopen.c Sun Jan 22 13:36:17 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: funopen.c,v 1.10 2005/11/29 03:12:00 christos Exp $ */
+/* $NetBSD: funopen.c,v 1.11 2012/01/22 18:36:17 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)funopen.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: funopen.c,v 1.10 2005/11/29 03:12:00 christos Exp $");
+__RCSID("$NetBSD: funopen.c,v 1.11 2012/01/22 18:36:17 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -51,7 +51,7 @@ funopen(cookie, readfn, writefn, seekfn,
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: src/lib/libc/stdio/ftell.c
diff -u src/lib/libc/stdio/ftell.c:1.17 src/lib/libc/stdio/ftell.c:1.18
--- src/lib/libc/stdio/ftell.c:1.17 Sun Oct 24 13:44:32 2010
+++ src/lib/libc/stdio/ftell.c Sun Jan 22 13:36:17 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: ftell.c,v 1.17 2010/10/24 17:44:32 tron Exp $ */
+/* $NetBSD: ftell.c,v 1.18 2012/01/22 18:36:17 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)ftell.c 8.2 (Berkeley) 5/4/95";
#else
-__RCSID("$NetBSD: ftell.c,v 1.17 2010/10/24 17:44:32 tron Exp $");
+__RCSID("$NetBSD: ftell.c,v 1.18 2012/01/22 18:36:17 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -54,7 +54,7 @@ long
ftell(fp)
FILE *fp;
{
- fpos_t pos;
+ off_t pos;
FLOCKFILE(fp);
@@ -73,7 +73,7 @@ ftell(fp)
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);
@@ -98,7 +98,7 @@ ftell(fp)
}
FUNLOCKFILE(fp);
- if (__fpos_overflow(pos)) {
+ if (__long_overflow(pos)) {
errno = EOVERFLOW;
return -1L;
}
Index: src/lib/libc/stdio/ftello.c
diff -u src/lib/libc/stdio/ftello.c:1.4 src/lib/libc/stdio/ftello.c:1.5
--- src/lib/libc/stdio/ftello.c:1.4 Thu Aug 7 12:43:26 2003
+++ src/lib/libc/stdio/ftello.c Sun Jan 22 13:36:17 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: ftello.c,v 1.4 2003/08/07 16:43:26 agc Exp $ */
+/* $NetBSD: ftello.c,v 1.5 2012/01/22 18:36:17 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -34,7 +34,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: ftello.c,v 1.4 2003/08/07 16:43:26 agc Exp $");
+__RCSID("$NetBSD: ftello.c,v 1.5 2012/01/22 18:36:17 christos Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@@ -55,7 +55,7 @@ off_t
ftello(fp)
FILE *fp;
{
- fpos_t pos;
+ off_t pos;
FLOCKFILE(fp);
@@ -74,8 +74,8 @@ ftello(fp)
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: src/lib/libc/stdio/local.h
diff -u src/lib/libc/stdio/local.h:1.30 src/lib/libc/stdio/local.h:1.31
--- src/lib/libc/stdio/local.h:1.30 Sun Jul 17 16:54:34 2011
+++ src/lib/libc/stdio/local.h Sun Jan 22 13:36:17 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: local.h,v 1.30 2011/07/17 20:54:34 joerg Exp $ */
+/* $NetBSD: local.h,v 1.31 2012/01/22 18:36:17 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -52,7 +52,7 @@ extern void __sfpinit __P((FILE *));
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));
@@ -123,7 +123,7 @@ extern void __funlockfile_internal __P((
*/
static __inline bool
-__fpos_overflow(fpos_t pos)
+__long_overflow(off_t pos)
{
- return (pos < LONG_MIN) || (pos > LONG_MAX);
+ return (pos < LONG_MIN) || (pos > LONG_MAX);
}
Index: src/tests/fs/nfs/nfsservice/mountd.c
diff -u src/tests/fs/nfs/nfsservice/mountd.c:1.6 src/tests/fs/nfs/nfsservice/mountd.c:1.7
--- src/tests/fs/nfs/nfsservice/mountd.c:1.6 Tue Aug 30 13:06:21 2011
+++ src/tests/fs/nfs/nfsservice/mountd.c Sun Jan 22 13:36:17 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: mountd.c,v 1.6 2011/08/30 17:06:21 plunky Exp $ */
+/* $NetBSD: mountd.c,v 1.7 2012/01/22 18:36:17 christos Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19
#if 0
static char sccsid[] = "@(#)mountd.c 8.15 (Berkeley) 5/1/95";
#else
-__RCSID("$NetBSD: mountd.c,v 1.6 2011/08/30 17:06:21 plunky Exp $");
+__RCSID("$NetBSD: mountd.c,v 1.7 2012/01/22 18:36:17 christos Exp $");
#endif
#endif /* not lint */
@@ -278,8 +278,8 @@ rumpwrite(void *cookie, const char *buf,
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);
Added files:
Index: src/lib/libc/compat/include/stdio.h
diff -u /dev/null src/lib/libc/compat/include/stdio.h:1.1
--- /dev/null Sun Jan 22 13:36:19 2012
+++ src/lib/libc/compat/include/stdio.h Sun Jan 22 13:36:14 2012
@@ -0,0 +1,46 @@
+/* $NetBSD: stdio.h,v 1.1 2012/01/22 18:36:14 christos Exp $ */
+
+/*-
+ * 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_
+
+__BEGIN_DECLS
+int fgetpos(FILE * __restrict, off_t * __restrict);
+int fsetpos(FILE *, const off_t *);
+__END_DECLS
+
+#endif /* _COMPAT_STDIO_H_ */
Index: src/lib/libc/compat/stdio/Makefile.inc
diff -u /dev/null src/lib/libc/compat/stdio/Makefile.inc:1.1
--- /dev/null Sun Jan 22 13:36:19 2012
+++ src/lib/libc/compat/stdio/Makefile.inc Sun Jan 22 13:36:18 2012
@@ -0,0 +1,23 @@
+# $NetBSD: Makefile.inc,v 1.1 2012/01/22 18:36:18 christos Exp $
+
+.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
+# $NetBSD: Makefile.inc,v 1.1 2012/01/22 18:36:18 christos Exp $
+
+.ifndef ABSTOP
+ABSTOP!= cd ${.PARSEDIR}; pwd
+
+.if (${.PARSEDIR} == ${.CURDIR})
+RELTOP:= .
+.else
+RELTOP:= ${.PARSEDIR:S,^${.CURDIR},,}
+.endif
+
+# you can set BSD{SRC,OBJ}DIR in Makefile.local.inc
+.if exists(${ABSTOP}/Makefile.local.inc)
+.include "${ABSTOP}/Makefile.local.inc"
+.endif
+.endif
Index: src/lib/libc/compat/stdio/compat_fgetpos.c
diff -u /dev/null src/lib/libc/compat/stdio/compat_fgetpos.c:1.1
--- /dev/null Sun Jan 22 13:36:19 2012
+++ src/lib/libc/compat/stdio/compat_fgetpos.c Sun Jan 22 13:36:18 2012
@@ -0,0 +1,64 @@
+/* $NetBSD: compat_fgetpos.c,v 1.1 2012/01/22 18:36:18 christos Exp $ */
+
+/*-
+ * 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 <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: compat_fgetpos.c,v 1.1 2012/01/22 18:36:18 christos Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#define __LIBC12_SOURCE__
+
+#include "namespace.h"
+#include <sys/types.h>
+
+#include <assert.h>
+#include <stdio.h>
+#include <compat/include/stdio.h>
+
+#ifdef __warn_references
+__warn_references(fgetpos,
+ "warning: reference to compatibility fgetpos(); include <stdio.h> for correct reference")
+#endif
+
+int
+fgetpos(FILE * __restrict fp, off_t * __restrict pos)
+{
+ _DIAGASSERT(fp != NULL);
+ _DIAGASSERT(pos != NULL);
+
+ return (*pos = ftello(fp)) == (off_t)-1;
+}
Index: src/lib/libc/compat/stdio/compat_fsetpos.c
diff -u /dev/null src/lib/libc/compat/stdio/compat_fsetpos.c:1.1
--- /dev/null Sun Jan 22 13:36:19 2012
+++ src/lib/libc/compat/stdio/compat_fsetpos.c Sun Jan 22 13:36:19 2012
@@ -0,0 +1,68 @@
+/* $NetBSD: compat_fsetpos.c,v 1.1 2012/01/22 18:36:19 christos Exp $ */
+
+/*-
+ * 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 <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: compat_fsetpos.c,v 1.1 2012/01/22 18:36:19 christos Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#define __LIBC12_SOURCE__
+
+#include "namespace.h"
+#include <sys/types.h>
+
+#include <assert.h>
+#include <stdio.h>
+#include <compat/include/stdio.h>
+
+#ifdef __warn_references
+__warn_references(fsetpos,
+ "warning: reference to compatibility fsetpos(); include <stdio.h> for correc t reference")
+#endif
+
+
+/*
+ * 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;
+}