diff options
Diffstat (limited to 'newlib/libc/stdio64')
-rw-r--r-- | newlib/libc/stdio64/Makefile.am | 68 | ||||
-rw-r--r-- | newlib/libc/stdio64/Makefile.in | 597 | ||||
-rw-r--r-- | newlib/libc/stdio64/dummy.c | 1 | ||||
-rw-r--r-- | newlib/libc/stdio64/fdopen64.c | 118 | ||||
-rw-r--r-- | newlib/libc/stdio64/fgetpos64.c | 84 | ||||
-rw-r--r-- | newlib/libc/stdio64/fopen64.c | 140 | ||||
-rw-r--r-- | newlib/libc/stdio64/freopen64.c | 251 | ||||
-rw-r--r-- | newlib/libc/stdio64/fseeko64.c | 367 | ||||
-rw-r--r-- | newlib/libc/stdio64/fsetpos64.c | 79 | ||||
-rw-r--r-- | newlib/libc/stdio64/ftello64.c | 164 | ||||
-rw-r--r-- | newlib/libc/stdio64/stdio64.c | 81 | ||||
-rw-r--r-- | newlib/libc/stdio64/stdio64.tex | 42 | ||||
-rw-r--r-- | newlib/libc/stdio64/tmpfile64.c | 101 |
13 files changed, 0 insertions, 2093 deletions
diff --git a/newlib/libc/stdio64/Makefile.am b/newlib/libc/stdio64/Makefile.am deleted file mode 100644 index 60509de0a..000000000 --- a/newlib/libc/stdio64/Makefile.am +++ /dev/null @@ -1,68 +0,0 @@ -## Process this file with automake to generate Makefile.in - -AUTOMAKE_OPTIONS = cygnus - -INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) - -# need a dummy object so objectlist.awk.in will build every time -GENERAL_SOURCES = dummy.c local64.h - -## All interfaces are EL/IX level 2 -if ELIX_LEVEL_1 -ELIX_SOURCES = -else -ELIX_SOURCES = \ - fdopen64.c \ - fgetpos64.c \ - fopen64.c \ - freopen64.c \ - fseeko64.c \ - fsetpos64.c \ - ftello64.c \ - stdio64.c \ - tmpfile64.c -endif - -libstdio64_la_LDFLAGS = -Xcompiler -nostdlib - -if USE_LIBTOOL -noinst_LTLIBRARIES = libstdio64.la -libstdio64_la_SOURCES = $(GENERAL_SOURCES) $(ELIX_SOURCES) -LIB_COMPILE = $(LTCOMPILE) -noinst_DATA = objectlist.awk.in -else -noinst_LIBRARIES = lib.a -lib_a_SOURCES = $(GENERAL_SOURCES) $(ELIX_SOURCES) -lib_a_CFLAGS = $(AM_CFLAGS) -LIB_COMPILE = $(COMPILE) -noinst_DATA = -endif # USE_LIBTOOL - -include $(srcdir)/../../Makefile.shared - -AM_CFLAGS = -I $(srcdir)/../stdio - -CHEWOUT_FILES = \ - fgetpos64.def \ - fopen64.def \ - freopen64.def \ - fseeko64.def \ - fsetpos64.def \ - ftello64.def \ - tmpfile64.def - -SUFFIXES = .def - -CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str - -.c.def: - $(CHEW) < $< > $*.def 2> $*.ref - touch stmp-def - -TARGETDOC = ../tmp.texi - -doc: $(CHEWOUT_FILES) - cat $(srcdir)/stdio64.tex >> $(TARGETDOC) - -CLEANFILES = $(CHEWOUT_FILES) *.ref - diff --git a/newlib/libc/stdio64/Makefile.in b/newlib/libc/stdio64/Makefile.in deleted file mode 100644 index e155cd7e7..000000000 --- a/newlib/libc/stdio64/Makefile.in +++ /dev/null @@ -1,597 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - - - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -DIST_COMMON = $(srcdir)/../../Makefile.shared $(srcdir)/Makefile.in \ - $(srcdir)/Makefile.am -subdir = stdio64 -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \ - $(top_srcdir)/../../ltoptions.m4 \ - $(top_srcdir)/../../ltsugar.m4 \ - $(top_srcdir)/../../ltversion.m4 \ - $(top_srcdir)/../../lt~obsolete.m4 \ - $(top_srcdir)/../acinclude.m4 $(top_srcdir)/../confsubdir.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) -ARFLAGS = cru -lib_a_AR = $(AR) $(ARFLAGS) -lib_a_LIBADD = -am__objects_1 = lib_a-dummy.$(OBJEXT) -@ELIX_LEVEL_1_FALSE@am__objects_2 = lib_a-fdopen64.$(OBJEXT) \ -@ELIX_LEVEL_1_FALSE@ lib_a-fgetpos64.$(OBJEXT) \ -@ELIX_LEVEL_1_FALSE@ lib_a-fopen64.$(OBJEXT) \ -@ELIX_LEVEL_1_FALSE@ lib_a-freopen64.$(OBJEXT) \ -@ELIX_LEVEL_1_FALSE@ lib_a-fseeko64.$(OBJEXT) \ -@ELIX_LEVEL_1_FALSE@ lib_a-fsetpos64.$(OBJEXT) \ -@ELIX_LEVEL_1_FALSE@ lib_a-ftello64.$(OBJEXT) \ -@ELIX_LEVEL_1_FALSE@ lib_a-stdio64.$(OBJEXT) \ -@ELIX_LEVEL_1_FALSE@ lib_a-tmpfile64.$(OBJEXT) -@USE_LIBTOOL_FALSE@am_lib_a_OBJECTS = $(am__objects_1) \ -@USE_LIBTOOL_FALSE@ $(am__objects_2) -lib_a_OBJECTS = $(am_lib_a_OBJECTS) -LTLIBRARIES = $(noinst_LTLIBRARIES) -libstdio64_la_LIBADD = -am__objects_3 = dummy.lo -@ELIX_LEVEL_1_FALSE@am__objects_4 = fdopen64.lo fgetpos64.lo \ -@ELIX_LEVEL_1_FALSE@ fopen64.lo freopen64.lo fseeko64.lo \ -@ELIX_LEVEL_1_FALSE@ fsetpos64.lo ftello64.lo stdio64.lo \ -@ELIX_LEVEL_1_FALSE@ tmpfile64.lo -@USE_LIBTOOL_TRUE@am_libstdio64_la_OBJECTS = $(am__objects_3) \ -@USE_LIBTOOL_TRUE@ $(am__objects_4) -libstdio64_la_OBJECTS = $(am_libstdio64_la_OBJECTS) -@USE_LIBTOOL_TRUE@am_libstdio64_la_rpath = -DEFAULT_INCLUDES = -I. -I$(srcdir) -depcomp = -am__depfiles_maybe = -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(lib_a_SOURCES) $(libstdio64_la_SOURCES) -DATA = $(noinst_DATA) -ETAGS = etags -CTAGS = ctags -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CRT0 = @CRT0@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ELIX_LEVEL_0_FALSE = @ELIX_LEVEL_0_FALSE@ -ELIX_LEVEL_0_TRUE = @ELIX_LEVEL_0_TRUE@ -ELIX_LEVEL_1_FALSE = @ELIX_LEVEL_1_FALSE@ -ELIX_LEVEL_1_TRUE = @ELIX_LEVEL_1_TRUE@ -ELIX_LEVEL_2_FALSE = @ELIX_LEVEL_2_FALSE@ -ELIX_LEVEL_2_TRUE = @ELIX_LEVEL_2_TRUE@ -ELIX_LEVEL_3_FALSE = @ELIX_LEVEL_3_FALSE@ -ELIX_LEVEL_3_TRUE = @ELIX_LEVEL_3_TRUE@ -ELIX_LEVEL_4_FALSE = @ELIX_LEVEL_4_FALSE@ -ELIX_LEVEL_4_TRUE = @ELIX_LEVEL_4_TRUE@ -ENABLE_NEWLIB_ICONV_FALSE = @ENABLE_NEWLIB_ICONV_FALSE@ -ENABLE_NEWLIB_ICONV_TRUE = @ENABLE_NEWLIB_ICONV_TRUE@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GREP = @GREP@ -HAVE_POSIX_DIR_FALSE = @HAVE_POSIX_DIR_FALSE@ -HAVE_POSIX_DIR_TRUE = @HAVE_POSIX_DIR_TRUE@ -HAVE_SIGNAL_DIR_FALSE = @HAVE_SIGNAL_DIR_FALSE@ -HAVE_SIGNAL_DIR_TRUE = @HAVE_SIGNAL_DIR_TRUE@ -HAVE_STDIO64_DIR_FALSE = @HAVE_STDIO64_DIR_FALSE@ -HAVE_STDIO64_DIR_TRUE = @HAVE_STDIO64_DIR_TRUE@ -HAVE_STDIO_DIR_FALSE = @HAVE_STDIO_DIR_FALSE@ -HAVE_STDIO_DIR_TRUE = @HAVE_STDIO_DIR_TRUE@ -HAVE_SYSCALL_DIR_FALSE = @HAVE_SYSCALL_DIR_FALSE@ -HAVE_SYSCALL_DIR_TRUE = @HAVE_SYSCALL_DIR_TRUE@ -HAVE_UNIX_DIR_FALSE = @HAVE_UNIX_DIR_FALSE@ -HAVE_UNIX_DIR_TRUE = @HAVE_UNIX_DIR_TRUE@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBC_EXTRA_DEF = @LIBC_EXTRA_DEF@ -LIBC_EXTRA_LIB = @LIBC_EXTRA_LIB@ -LIBC_MACHINE_LIB = @LIBC_MACHINE_LIB@ -LIBC_POSIX_LIB = @LIBC_POSIX_LIB@ -LIBC_SIGNAL_DEF = @LIBC_SIGNAL_DEF@ -LIBC_SIGNAL_LIB = @LIBC_SIGNAL_LIB@ -LIBC_STDIO64_DEF = @LIBC_STDIO64_DEF@ -LIBC_STDIO64_LIB = @LIBC_STDIO64_LIB@ -LIBC_STDIO_DEF = @LIBC_STDIO_DEF@ -LIBC_STDIO_LIB = @LIBC_STDIO_LIB@ -LIBC_SYSCALL_LIB = @LIBC_SYSCALL_LIB@ -LIBC_SYS_LIB = @LIBC_SYS_LIB@ -LIBC_UNIX_LIB = @LIBC_UNIX_LIB@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MAY_SUPPLY_SYSCALLS_FALSE = @MAY_SUPPLY_SYSCALLS_FALSE@ -MAY_SUPPLY_SYSCALLS_TRUE = @MAY_SUPPLY_SYSCALLS_TRUE@ -NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -READELF = @READELF@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -USE_LIBTOOL_FALSE = @USE_LIBTOOL_FALSE@ -USE_LIBTOOL_TRUE = @USE_LIBTOOL_TRUE@ -VERSION = @VERSION@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_AS = @ac_ct_AS@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ -ac_ct_DSYMUTIL = @ac_ct_DSYMUTIL@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -ac_ct_LIPO = @ac_ct_LIPO@ -ac_ct_NMEDIT = @ac_ct_NMEDIT@ -ac_ct_OBJDUMP = @ac_ct_OBJDUMP@ -ac_ct_OTOOL = @ac_ct_OTOOL@ -ac_ct_OTOOL64 = @ac_ct_OTOOL64@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_READELF = @ac_ct_READELF@ -ac_ct_STRIP = @ac_ct_STRIP@ -aext = @aext@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -extra_dir = @extra_dir@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -libm_machine_dir = @libm_machine_dir@ -localstatedir = @localstatedir@ -lpfx = @lpfx@ -lt_ECHO = @lt_ECHO@ -machine_dir = @machine_dir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -newlib_basedir = @newlib_basedir@ -oext = @oext@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -subdirs = @subdirs@ -sys_dir = @sys_dir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -AUTOMAKE_OPTIONS = cygnus -INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) - -# need a dummy object so objectlist.awk.in will build every time -GENERAL_SOURCES = dummy.c local64.h -@ELIX_LEVEL_1_FALSE@ELIX_SOURCES = \ -@ELIX_LEVEL_1_FALSE@ fdopen64.c \ -@ELIX_LEVEL_1_FALSE@ fgetpos64.c \ -@ELIX_LEVEL_1_FALSE@ fopen64.c \ -@ELIX_LEVEL_1_FALSE@ freopen64.c \ -@ELIX_LEVEL_1_FALSE@ fseeko64.c \ -@ELIX_LEVEL_1_FALSE@ fsetpos64.c \ -@ELIX_LEVEL_1_FALSE@ ftello64.c \ -@ELIX_LEVEL_1_FALSE@ stdio64.c \ -@ELIX_LEVEL_1_FALSE@ tmpfile64.c - -@ELIX_LEVEL_1_TRUE@ELIX_SOURCES = -libstdio64_la_LDFLAGS = -Xcompiler -nostdlib -@USE_LIBTOOL_TRUE@noinst_LTLIBRARIES = libstdio64.la -@USE_LIBTOOL_TRUE@libstdio64_la_SOURCES = $(GENERAL_SOURCES) $(ELIX_SOURCES) -@USE_LIBTOOL_FALSE@LIB_COMPILE = $(COMPILE) -@USE_LIBTOOL_TRUE@LIB_COMPILE = $(LTCOMPILE) -@USE_LIBTOOL_FALSE@noinst_DATA = -@USE_LIBTOOL_TRUE@noinst_DATA = objectlist.awk.in -@USE_LIBTOOL_FALSE@noinst_LIBRARIES = lib.a -@USE_LIBTOOL_FALSE@lib_a_SOURCES = $(GENERAL_SOURCES) $(ELIX_SOURCES) -@USE_LIBTOOL_FALSE@lib_a_CFLAGS = $(AM_CFLAGS) -AM_CFLAGS = -I $(srcdir)/../stdio -CHEWOUT_FILES = \ - fgetpos64.def \ - fopen64.def \ - freopen64.def \ - fseeko64.def \ - fsetpos64.def \ - ftello64.def \ - tmpfile64.def - -SUFFIXES = .def -CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str -TARGETDOC = ../tmp.texi -CLEANFILES = $(CHEWOUT_FILES) *.ref -all: all-am - -.SUFFIXES: -.SUFFIXES: .def .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus stdio64/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --cygnus stdio64/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) -lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) - -rm -f lib.a - $(lib_a_AR) lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) - $(RANLIB) lib.a - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libstdio64.la: $(libstdio64_la_OBJECTS) $(libstdio64_la_DEPENDENCIES) - $(LINK) $(am_libstdio64_la_rpath) $(libstdio64_la_LDFLAGS) $(libstdio64_la_OBJECTS) $(libstdio64_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -.c.o: - $(COMPILE) -c $< - -.c.obj: - $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: - $(LTCOMPILE) -c -o $@ $< - -lib_a-dummy.o: dummy.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-dummy.o `test -f 'dummy.c' || echo '$(srcdir)/'`dummy.c - -lib_a-dummy.obj: dummy.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-dummy.obj `if test -f 'dummy.c'; then $(CYGPATH_W) 'dummy.c'; else $(CYGPATH_W) '$(srcdir)/dummy.c'; fi` - -lib_a-fdopen64.o: fdopen64.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fdopen64.o `test -f 'fdopen64.c' || echo '$(srcdir)/'`fdopen64.c - -lib_a-fdopen64.obj: fdopen64.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fdopen64.obj `if test -f 'fdopen64.c'; then $(CYGPATH_W) 'fdopen64.c'; else $(CYGPATH_W) '$(srcdir)/fdopen64.c'; fi` - -lib_a-fgetpos64.o: fgetpos64.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fgetpos64.o `test -f 'fgetpos64.c' || echo '$(srcdir)/'`fgetpos64.c - -lib_a-fgetpos64.obj: fgetpos64.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fgetpos64.obj `if test -f 'fgetpos64.c'; then $(CYGPATH_W) 'fgetpos64.c'; else $(CYGPATH_W) '$(srcdir)/fgetpos64.c'; fi` - -lib_a-fopen64.o: fopen64.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fopen64.o `test -f 'fopen64.c' || echo '$(srcdir)/'`fopen64.c - -lib_a-fopen64.obj: fopen64.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fopen64.obj `if test -f 'fopen64.c'; then $(CYGPATH_W) 'fopen64.c'; else $(CYGPATH_W) '$(srcdir)/fopen64.c'; fi` - -lib_a-freopen64.o: freopen64.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-freopen64.o `test -f 'freopen64.c' || echo '$(srcdir)/'`freopen64.c - -lib_a-freopen64.obj: freopen64.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-freopen64.obj `if test -f 'freopen64.c'; then $(CYGPATH_W) 'freopen64.c'; else $(CYGPATH_W) '$(srcdir)/freopen64.c'; fi` - -lib_a-fseeko64.o: fseeko64.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fseeko64.o `test -f 'fseeko64.c' || echo '$(srcdir)/'`fseeko64.c - -lib_a-fseeko64.obj: fseeko64.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fseeko64.obj `if test -f 'fseeko64.c'; then $(CYGPATH_W) 'fseeko64.c'; else $(CYGPATH_W) '$(srcdir)/fseeko64.c'; fi` - -lib_a-fsetpos64.o: fsetpos64.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fsetpos64.o `test -f 'fsetpos64.c' || echo '$(srcdir)/'`fsetpos64.c - -lib_a-fsetpos64.obj: fsetpos64.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fsetpos64.obj `if test -f 'fsetpos64.c'; then $(CYGPATH_W) 'fsetpos64.c'; else $(CYGPATH_W) '$(srcdir)/fsetpos64.c'; fi` - -lib_a-ftello64.o: ftello64.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ftello64.o `test -f 'ftello64.c' || echo '$(srcdir)/'`ftello64.c - -lib_a-ftello64.obj: ftello64.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ftello64.obj `if test -f 'ftello64.c'; then $(CYGPATH_W) 'ftello64.c'; else $(CYGPATH_W) '$(srcdir)/ftello64.c'; fi` - -lib_a-stdio64.o: stdio64.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-stdio64.o `test -f 'stdio64.c' || echo '$(srcdir)/'`stdio64.c - -lib_a-stdio64.obj: stdio64.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-stdio64.obj `if test -f 'stdio64.c'; then $(CYGPATH_W) 'stdio64.c'; else $(CYGPATH_W) '$(srcdir)/stdio64.c'; fi` - -lib_a-tmpfile64.o: tmpfile64.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-tmpfile64.o `test -f 'tmpfile64.c' || echo '$(srcdir)/'`tmpfile64.c - -lib_a-tmpfile64.obj: tmpfile64.c - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-tmpfile64.obj `if test -f 'tmpfile64.c'; then $(CYGPATH_W) 'tmpfile64.c'; else $(CYGPATH_W) '$(srcdir)/tmpfile64.c'; fi` - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -check-am: -check: check-am -all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(DATA) -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ - clean-noinstLTLIBRARIES mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLIBRARIES clean-noinstLTLIBRARIES \ - ctags distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags dvi dvi-am html html-am info \ - info-am install install-am install-data install-data-am \ - install-exec install-exec-am install-info install-info-am \ - install-man install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-info-am - -objectlist.awk.in: $(noinst_LTLIBRARIES) - -rm -f objectlist.awk.in - for i in `ls *.lo` ; \ - do \ - echo $$i `pwd`/$$i >> objectlist.awk.in ; \ - done - -.c.def: - $(CHEW) < $< > $*.def 2> $*.ref - touch stmp-def - -doc: $(CHEWOUT_FILES) - cat $(srcdir)/stdio64.tex >> $(TARGETDOC) -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/newlib/libc/stdio64/dummy.c b/newlib/libc/stdio64/dummy.c deleted file mode 100644 index 90d0120ed..000000000 --- a/newlib/libc/stdio64/dummy.c +++ /dev/null @@ -1 +0,0 @@ -/* empty stub so there's at least one file to put in objectlist.awk.in */ diff --git a/newlib/libc/stdio64/fdopen64.c b/newlib/libc/stdio64/fdopen64.c deleted file mode 100644 index 49d1f03aa..000000000 --- a/newlib/libc/stdio64/fdopen64.c +++ /dev/null @@ -1,118 +0,0 @@ -/* -FUNCTION -<<fdopen64>>---turn open file into a stream - -INDEX - fdopen64 -INDEX - _fdopen64_r - -SYNOPSIS - #include <stdio.h> - FILE *fdopen64(int <[fd]>, const char *<[mode]>); - FILE *_fdopen64_r(void *<[reent]>, - int <[fd]>, const char *<[mode]>); - -DESCRIPTION -<<fdopen64>> produces a file descriptor of type <<FILE *>>, from a -descriptor for an already-open file (returned, for example, by the -system subroutine <<open>> rather than by <<fopen>>). -The <[mode]> argument has the same meanings as in <<fopen>>. - -RETURNS -File pointer or <<NULL>>, as for <<fopen>>. -*/ - -#include <sys/types.h> -#include <sys/fcntl.h> - -#include <stdio.h> -#include <errno.h> -#include "local.h" -#include <_syslist.h> -#include <sys/lock.h> - -extern int __sflags (); - -FILE * -_DEFUN (_fdopen64_r, (ptr, fd, mode), - struct _reent *ptr _AND - int fd _AND - _CONST char *mode) -{ - register FILE *fp; - int flags, oflags; -#ifdef HAVE_FCNTL - int fdflags, fdmode; -#endif - - if ((flags = __sflags (ptr, mode, &oflags)) == 0) - return 0; - - /* make sure the mode the user wants is a subset of the actual mode */ -#ifdef HAVE_FCNTL - if ((fdflags = _fcntl_r (ptr, fd, F_GETFL, 0)) < 0) - return 0; - fdmode = fdflags & O_ACCMODE; - if (fdmode != O_RDWR && (fdmode != (oflags & O_ACCMODE))) - { - ptr->_errno = EBADF; - return 0; - } -#endif - - if ((fp = __sfp (ptr)) == 0) - return 0; - - _flockfile(fp); - - fp->_flags = flags; - /* POSIX recommends setting the O_APPEND bit on fd to match append - streams. Someone may later clear O_APPEND on fileno(fp), but the - stream must still remain in append mode. Rely on __sflags - setting __SAPP properly. */ -#ifdef HAVE_FCNTL - if ((oflags & O_APPEND) && !(fdflags & O_APPEND)) - _fcntl_r (ptr, fd, F_SETFL, fdflags | O_APPEND); -#endif - fp->_file = fd; - fp->_cookie = (_PTR) fp; - -#undef _read -#undef _write -#undef _seek -#undef _close - - fp->_read = __sread; - fp->_write = __swrite64; - fp->_seek = __sseek; - fp->_seek64 = __sseek64; - fp->_close = __sclose; - -#ifdef __SCLE - /* Explicit given mode results in explicit setting mode on fd */ - if (oflags & O_BINARY) - setmode(fp->_file, O_BINARY); - else if (oflags & O_TEXT) - setmode(fp->_file, O_TEXT); - if (__stextmode(fp->_file)) - fp->_flags |= __SCLE; -#endif - - fp->_flags |= __SL64; - - _funlockfile(fp); - return fp; -} - -#ifndef _REENT_ONLY - -FILE * -_DEFUN (fdopen64, (fd, mode), - int fd _AND - _CONST char *mode) -{ - return _fdopen64_r (_REENT, fd, mode); -} - -#endif diff --git a/newlib/libc/stdio64/fgetpos64.c b/newlib/libc/stdio64/fgetpos64.c deleted file mode 100644 index 36f7ec90b..000000000 --- a/newlib/libc/stdio64/fgetpos64.c +++ /dev/null @@ -1,84 +0,0 @@ -/* -FUNCTION -<<fgetpos64>>---record position in a large stream or file - -INDEX - fgetpos64 -INDEX - _fgetpos64_r - -ANSI_SYNOPSIS - #include <stdio.h> - int fgetpos64(FILE *<[fp]>, _fpos64_t *<[pos]>); - int _fgetpos64_r(struct _reent *<[ptr]>, FILE *<[fp]>, - _fpos64_t *<[pos]>); - -TRAD_SYNOPSIS - #include <stdio.h> - int fgetpos64(<[fp]>, <[pos]>) - FILE *<[fp]>; - _fpos64_t *<[pos]>; - - int _fgetpos64_r(<[ptr]>, <[fp]>, <[pos]>) - FILE *<[fp]>; - _fpos64_t *<[pos]>; - -DESCRIPTION -Objects of type <<FILE>> can have a ``position'' that records how much -of the file your program has already read. Many of the <<stdio>> functions -depend on this position, and many change it as a side effect. - -You can use <<fgetpos64>> to report on the current position for a file -identified by <[fp]> that was opened by <<fopen64>>; <<fgetpos>> will write -a value representing that position at <<*<[pos]>>>. Later, you can -use this value with <<fsetpos64>> to return the file to this -position. - -In the current implementation, <<fgetpos64>> simply uses a character -count to represent the file position; this is the same number that -would be returned by <<ftello64>>. - -RETURNS -<<fgetpos64>> returns <<0>> when successful. If <<fgetpos64>> fails, the -result is <<1>>. Failure occurs on streams that do not support -positioning or streams not opened via <<fopen64>>; the global <<errno>> -indicates these conditions with the value <<ESPIPE>>. - -PORTABILITY -<<fgetpos64>> is a glibc extension. - -No supporting OS subroutines are required. -*/ - -#include <stdio.h> - -#ifdef __LARGE64_FILES - -int -_DEFUN (_fgetpos64_r, (ptr, fp, pos), - struct _reent * ptr _AND - FILE * fp _AND - _fpos64_t * pos) -{ - *pos = (_fpos64_t)_ftello64_r (ptr, fp); - - if (*pos != -1) - { - return 0; - } - return 1; -} - -#ifndef _REENT_ONLY - -int -_DEFUN (fgetpos64, (fp, pos), - FILE * fp _AND - _fpos64_t * pos) -{ - return _fgetpos64_r (_REENT, fp, pos); -} - -#endif /* !_REENT_ONLY */ - -#endif /* __LARGE64_FILES */ diff --git a/newlib/libc/stdio64/fopen64.c b/newlib/libc/stdio64/fopen64.c deleted file mode 100644 index aa6775116..000000000 --- a/newlib/libc/stdio64/fopen64.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* -FUNCTION -<<fopen64>>---open a large file - -INDEX - fopen64 -INDEX - _fopen64_r - -ANSI_SYNOPSIS - #include <stdio.h> - FILE *fopen64(const char *<[file]>, const char *<[mode]>); - FILE *_fopen64_r(void *<[reent]>, - const char *<[file]>, const char *<[mode]>); - -TRAD_SYNOPSIS - #include <stdio.h> - FILE *fopen64(<[file]>, <[mode]>) - char *<[file]>; - char *<[mode]>; - - FILE *_fopen64_r(<[reent]>, <[file]>, <[mode]>) - char *<[reent]>; - char *<[file]>; - char *<[mode]>; - -DESCRIPTION -<<fopen64>> is identical to <<fopen>> except it opens a large file that -is potentially >2GB in size. See <<fopen>> for further details. - -RETURNS -<<fopen64>> return a file pointer which you can use for other file -operations, unless the file you requested could not be opened; in that -situation, the result is <<NULL>>. If the reason for failure was an -invalid string at <[mode]>, <<errno>> is set to <<EINVAL>>. - -PORTABILITY -<<fopen64>> is a glibc extension. - -Supporting OS subroutines required: <<close>>, <<fstat64>>, <<isatty>>, -<<lseek64>>, <<open64>>, <<read>>, <<sbrk>>, <<write>>. -*/ - -/* Copied from fopen.c */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "%W% (Berkeley) %G%"; -#endif /* LIBC_SCCS and not lint */ - -#include <stdio.h> -#include <errno.h> -#include "local.h" -#ifdef __CYGWIN__ -#include <fcntl.h> -#endif -#include <sys/lock.h> - -#ifdef __LARGE64_FILES - -FILE * -_DEFUN (_fopen64_r, (ptr, file, mode), - struct _reent *ptr _AND - _CONST char *file _AND - _CONST char *mode) -{ - register FILE *fp; - register int f; - int flags, oflags; - - if ((flags = __sflags (ptr, mode, &oflags)) == 0) - return NULL; - if ((fp = __sfp (ptr)) == NULL) - return NULL; - - if ((f = _open64_r (ptr, file, oflags, 0666)) < 0) - { - __sfp_lock_acquire (); - fp->_flags = 0; /* release */ -#ifndef __SINGLE_THREAD__ - __lock_close_recursive (fp->_lock); -#endif - __sfp_lock_release (); - return NULL; - } - - _flockfile(fp); - - fp->_file = f; - fp->_flags = flags; - fp->_cookie = (_PTR) fp; - fp->_read = __sread; - fp->_write = __swrite64; - fp->_seek = __sseek; - fp->_seek64 = __sseek64; - fp->_close = __sclose; - - if (fp->_flags & __SAPP) - _fseeko64_r (ptr, fp, 0, SEEK_END); - -#ifdef __SCLE - if (__stextmode (fp->_file)) - fp->_flags |= __SCLE; -#endif - - fp->_flags |= __SL64; - - _funlockfile(fp); - return fp; -} - -#ifndef _REENT_ONLY - -FILE * -_DEFUN (fopen64, (file, mode), - _CONST char *file _AND - _CONST char *mode) -{ - return _fopen64_r (_REENT, file, mode); -} - -#endif - -#endif /* __LARGE64_FILES */ diff --git a/newlib/libc/stdio64/freopen64.c b/newlib/libc/stdio64/freopen64.c deleted file mode 100644 index 866d8c943..000000000 --- a/newlib/libc/stdio64/freopen64.c +++ /dev/null @@ -1,251 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* -FUNCTION -<<freopen64>>---open a large file using an existing file descriptor - -INDEX - freopen64 -INDEX - _freopen64_r - -ANSI_SYNOPSIS - #include <stdio.h> - FILE *freopen64(const char *<[file]>, const char *<[mode]>, - FILE *<[fp]>); - FILE *_freopen64_r(struct _reent *<[ptr]>, const char *<[file]>, - const char *<[mode]>, FILE *<[fp]>); - -TRAD_SYNOPSIS - #include <stdio.h> - FILE *freopen64(<[file]>, <[mode]>, <[fp]>) - char *<[file]>; - char *<[mode]>; - FILE *<[fp]>; - - FILE *_freopen64_r(<[ptr]>, <[file]>, <[mode]>, <[fp]>) - struct _reent *<[ptr]>; - char *<[file]>; - char *<[mode]>; - FILE *<[fp]>; - -DESCRIPTION -Use this variant of <<fopen64>> if you wish to specify a particular file -descriptor <[fp]> (notably <<stdin>>, <<stdout>>, or <<stderr>>) for -the file. - -If <[fp]> was associated with another file or stream, <<freopen64>> -closes that other file or stream (but ignores any errors while closing -it). - -<[file]> and <[mode]> are used just as in <<fopen>>. - -If <[file]> is <<NULL>>, the underlying stream is modified rather than -closed. The file cannot be given a more permissive access mode (for -example, a <[mode]> of "w" will fail on a read-only file descriptor), -but can change status such as append or binary mode. If modification -is not possible, failure occurs. - -RETURNS -If successful, the result is the same as the argument <[fp]>. If the -file cannot be opened as specified, the result is <<NULL>>. - -PORTABILITY -<<freopen>> is a glibc extension. - -Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>, -<<lseek64>>, <<open64>>, <<read>>, <<sbrk>>, <<write>>. -*/ - -#include <time.h> -#include <stdio.h> -#include <errno.h> -#include <fcntl.h> -#include <stdlib.h> -#include <sys/lock.h> -#include "local.h" - -/* - * Re-direct an existing, open (probably) file to some other file. - */ - -#ifdef __LARGE64_FILES - -FILE * -_DEFUN (_freopen64_r, (ptr, file, mode, fp), - struct _reent *ptr _AND - _CONST char *file _AND - _CONST char *mode _AND - register FILE *fp) -{ - register int f; - int flags, oflags; - int e = 0; - - __sfp_lock_acquire (); - - CHECK_INIT (ptr, fp); - - _flockfile(fp); - - if ((flags = __sflags (ptr, mode, &oflags)) == 0) - { - _funlockfile(fp); - _fclose_r (ptr, fp); - __sfp_lock_release (); - return NULL; - } - - /* - * Remember whether the stream was open to begin with, and - * which file descriptor (if any) was associated with it. - * If it was attached to a descriptor, defer closing it, - * so that, e.g., freopen("/dev/stdin", "r", stdin) works. - * This is unnecessary if it was not a Unix file. - */ - - if (fp->_flags == 0) - fp->_flags = __SEOF; /* hold on to it */ - else - { - if (fp->_flags & __SWR) - _fflush_r (ptr, fp); - /* - * If close is NULL, closing is a no-op, hence pointless. - * If file is NULL, the file should not be closed. - */ - if (fp->_close != NULL && file != NULL) - fp->_close (ptr, fp->_cookie); - } - - /* - * Now get a new descriptor to refer to the new file, or reuse the - * existing file descriptor if file is NULL. - */ - - if (file != NULL) - { - f = _open64_r (ptr, (char *) file, oflags, 0666); - e = ptr->_errno; - } - else - { -#ifdef HAVE_FCNTL - int oldflags; - /* - * Reuse the file descriptor, but only if the new access mode is - * equal or less permissive than the old. F_SETFL correctly - * ignores creation flags. - */ - f = fp->_file; - if ((oldflags = _fcntl_r (ptr, f, F_GETFL, 0)) == -1 - || ! ((oldflags & O_ACCMODE) == O_RDWR - || ((oldflags ^ oflags) & O_ACCMODE) == 0) - || _fcntl_r (ptr, f, F_SETFL, oflags) == -1) - f = -1; -#else - /* We cannot modify without fcntl support. */ - f = -1; -#endif - -#ifdef __SCLE - /* - * F_SETFL doesn't change textmode. Don't mess with modes of ttys. - */ - if (0 <= f && ! isatty (f) - && setmode (f, oflags & (O_BINARY | O_TEXT)) == -1) - f = -1; -#endif - - if (f < 0) - { - e = EBADF; - if (fp->_close != NULL) - fp->_close (ptr, fp->_cookie); - } - } - - /* - * Finish closing fp. Even if the open succeeded above, - * we cannot keep fp->_base: it may be the wrong size. - * This loses the effect of any setbuffer calls, - * but stdio has always done this before. - */ - - if (fp->_flags & __SMBF) - _free_r (ptr, (char *) fp->_bf._base); - fp->_w = 0; - fp->_r = 0; - fp->_p = NULL; - fp->_bf._base = NULL; - fp->_bf._size = 0; - fp->_lbfsize = 0; - if (HASUB (fp)) - FREEUB (ptr, fp); - fp->_ub._size = 0; - if (HASLB (fp)) - FREELB (ptr, fp); - fp->_lb._size = 0; - - if (f < 0) - { /* did not get it after all */ - fp->_flags = 0; /* set it free */ - ptr->_errno = e; /* restore in case _close clobbered */ - _funlockfile(fp); -#ifndef __SINGLE_THREAD__ - __lock_close_recursive (fp->_lock); -#endif - __sfp_lock_release (); - return NULL; - } - - fp->_flags = flags; - fp->_file = f; - fp->_cookie = (_PTR) fp; - fp->_read = __sread; - fp->_write = __swrite64; - fp->_seek = __sseek; - fp->_seek64 = __sseek64; - fp->_close = __sclose; - -#ifdef __SCLE - if (__stextmode(fp->_file)) - fp->_flags |= __SCLE; -#endif - - fp->_flags |= __SL64; - - _funlockfile(fp); - __sfp_lock_release (); - return fp; -} - -#ifndef _REENT_ONLY - -FILE * -_DEFUN (freopen64, (file, mode, fp), - _CONST char *file _AND - _CONST char *mode _AND - register FILE *fp) -{ - return _freopen64_r (_REENT, file, mode, fp); -} - -#endif /* !_REENT_ONLY */ - -#endif /* __LARGE64_FILES */ diff --git a/newlib/libc/stdio64/fseeko64.c b/newlib/libc/stdio64/fseeko64.c deleted file mode 100644 index 280484e62..000000000 --- a/newlib/libc/stdio64/fseeko64.c +++ /dev/null @@ -1,367 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* -FUNCTION -<<fseeko64>>---set file position for large file - -INDEX - fseeko64 -INDEX - _fseeko64_r - -ANSI_SYNOPSIS - #include <stdio.h> - int fseeko64(FILE *<[fp]>, _off64_t <[offset]>, int <[whence]>) - int _fseeko64_r (struct _reent *<[ptr]>, FILE *<[fp]>, - _off64_t <[offset]>, int <[whence]>) -TRAD_SYNOPSIS - #include <stdio.h> - - int fseeko64(<[fp]>, <[offset]>, <[whence]>) - FILE *<[fp]>; - _off64_t <[offset]>; - int <[whence]>; - - int _fseeko64_r (<[ptr]>, <[fp]>, <[offset]>, <[whence]>) - struct _reent *<[ptr]>; - FILE *<[fp]>; - _off64_t <[offset]>; - int <[whence]>; - -DESCRIPTION -Objects of type <<FILE>> can have a ``position'' that records how much -of the file your program has already read. Many of the <<stdio>> functions -depend on this position, and many change it as a side effect. - -You can use <<fseeko64>> to set the position for the file identified by -<[fp]> that was opened via <<fopen64>>. The value of <[offset]> determines -the new position, in one of three ways selected by the value of <[whence]> -(defined as macros in `<<stdio.h>>'): - -<<SEEK_SET>>---<[offset]> is the absolute file position (an offset -from the beginning of the file) desired. <[offset]> must be positive. - -<<SEEK_CUR>>---<[offset]> is relative to the current file position. -<[offset]> can meaningfully be either positive or negative. - -<<SEEK_END>>---<[offset]> is relative to the current end of file. -<[offset]> can meaningfully be either positive (to increase the size -of the file) or negative. - -See <<ftello64>> to determine the current file position. - -RETURNS -<<fseeko64>> returns <<0>> when successful. On failure, the -result is <<EOF>>. The reason for failure is indicated in <<errno>>: -either <<ESPIPE>> (the stream identified by <[fp]> doesn't support -repositioning or wasn't opened via <<fopen64>>) or <<EINVAL>> -(invalid file position). - -PORTABILITY -<<fseeko64>> is a glibc extension. - -Supporting OS subroutines required: <<close>>, <<fstat64>>, <<isatty>>, -<<lseek64>>, <<read>>, <<sbrk>>, <<write>>. -*/ - -#include <stdio.h> -#include <time.h> -#include <fcntl.h> -#include <stdlib.h> -#include <errno.h> -#include <sys/types.h> -#include <sys/stat.h> -#include "local.h" - -#define POS_ERR (-(_fpos64_t)1) - -#ifdef __LARGE64_FILES - -/* - * Seek the given file to the given offset. - * `Whence' must be one of the three SEEK_* macros. - */ - -_off64_t -_DEFUN (_fseeko64_r, (ptr, fp, offset, whence), - struct _reent *ptr _AND - register FILE *fp _AND - _off64_t offset _AND - int whence) -{ - _fpos64_t _EXFUN ((*seekfn), (struct _reent *, void *, _fpos64_t, int)); - _fpos64_t target, curoff; - size_t n; - - struct stat64 st; - int havepos; - - /* Only do 64-bit seek on large file. */ - if (!(fp->_flags & __SL64)) - { - if ((_off_t) offset != offset) - { - ptr->_errno = EOVERFLOW; - return EOF; - } - return (_off64_t) _fseeko_r (ptr, fp, offset, whence); - } - - /* Make sure stdio is set up. */ - - CHECK_INIT (ptr, fp); - - _flockfile (fp); - - curoff = fp->_offset; - - /* If we've been doing some writing, and we're in append mode - then we don't really know where the filepos is. */ - - if (fp->_flags & __SAPP && fp->_flags & __SWR) - { - /* So flush the buffer and seek to the end. */ - _fflush_r (ptr, fp); - } - - /* Have to be able to seek. */ - - if ((seekfn = fp->_seek64) == NULL) - { - ptr->_errno = ESPIPE; /* ??? */ - _funlockfile(fp); - return EOF; - } - - /* - * Change any SEEK_CUR to SEEK_SET, and check `whence' argument. - * After this, whence is either SEEK_SET or SEEK_END. - */ - - switch (whence) - { - case SEEK_CUR: - /* - * In order to seek relative to the current stream offset, - * we have to first find the current stream offset a la - * ftell (see ftell for details). - */ - _fflush_r (ptr, fp); /* may adjust seek offset on append stream */ - if (fp->_flags & __SOFF) - curoff = fp->_offset; - else - { - curoff = seekfn (ptr, fp->_cookie, (_fpos64_t) 0, SEEK_CUR); - if (curoff == -1L) - { - _funlockfile(fp); - return EOF; - } - } - if (fp->_flags & __SRD) - { - curoff -= fp->_r; - if (HASUB (fp)) - curoff -= fp->_ur; - } - else if (fp->_flags & __SWR && fp->_p != NULL) - curoff += fp->_p - fp->_bf._base; - - offset += curoff; - whence = SEEK_SET; - havepos = 1; - break; - - case SEEK_SET: - case SEEK_END: - havepos = 0; - break; - - default: - ptr->_errno = EINVAL; - _funlockfile(fp); - return (EOF); - } - - /* - * Can only optimise if: - * reading (and not reading-and-writing); - * not unbuffered; and - * this is a `regular' Unix file (and hence seekfn==__sseek). - * We must check __NBF first, because it is possible to have __NBF - * and __SOPT both set. - */ - - if (fp->_bf._base == NULL) - __smakebuf_r (ptr, fp); - if (fp->_flags & (__SWR | __SRW | __SNBF | __SNPT)) - goto dumb; - if ((fp->_flags & __SOPT) == 0) - { - if (seekfn != __sseek64 - || fp->_file < 0 - || _fstat64_r (ptr, fp->_file, &st) - || (st.st_mode & S_IFMT) != S_IFREG) - { - fp->_flags |= __SNPT; - goto dumb; - } -#ifdef HAVE_BLKSIZE - fp->_blksize = st.st_blksize; -#else - fp->_blksize = 1024; -#endif - fp->_flags |= __SOPT; - } - - /* - * We are reading; we can try to optimise. - * Figure out where we are going and where we are now. - */ - - if (whence == SEEK_SET) - target = offset; - else - { - if (_fstat64_r (ptr, fp->_file, &st)) - goto dumb; - target = st.st_size + offset; - } - - if (!havepos) - { - if (fp->_flags & __SOFF) - curoff = fp->_offset; - else - { - curoff = seekfn (ptr, fp->_cookie, (_fpos64_t)0, SEEK_CUR); - if (curoff == POS_ERR) - goto dumb; - } - curoff -= fp->_r; - if (HASUB (fp)) - curoff -= fp->_ur; - } - - /* - * Compute the number of bytes in the input buffer (pretending - * that any ungetc() input has been discarded). Adjust current - * offset backwards by this count so that it represents the - * file offset for the first byte in the current input buffer. - */ - - if (HASUB (fp)) - { - curoff += fp->_r; /* kill off ungetc */ - n = fp->_up - fp->_bf._base; - curoff -= n; - n += fp->_ur; - } - else - { - n = fp->_p - fp->_bf._base; - curoff -= n; - n += fp->_r; - } - - /* - * If the target offset is within the current buffer, - * simply adjust the pointers, clear EOF, undo ungetc(), - * and return. (If the buffer was modified, we have to - * skip this; see fgetline.c.) - */ - - if ((fp->_flags & __SMOD) == 0 && - target >= curoff && target < curoff + n) - { - register int o = target - curoff; - - fp->_p = fp->_bf._base + o; - fp->_r = n - o; - if (HASUB (fp)) - FREEUB (ptr, fp); - fp->_flags &= ~__SEOF; - _funlockfile(fp); - return 0; - } - - /* - * The place we want to get to is not within the current buffer, - * but we can still be kind to the kernel copyout mechanism. - * By aligning the file offset to a block boundary, we can let - * the kernel use the VM hardware to map pages instead of - * copying bytes laboriously. Using a block boundary also - * ensures that we only read one block, rather than two. - */ - - curoff = target & ~((_fpos64_t)(fp->_blksize - 1)); - if (seekfn (ptr, fp->_cookie, curoff, SEEK_SET) == POS_ERR) - goto dumb; - fp->_r = 0; - fp->_p = fp->_bf._base; - if (HASUB (fp)) - FREEUB (ptr, fp); - fp->_flags &= ~__SEOF; - n = target - curoff; - if (n) - { - if (__srefill_r (ptr, fp) || fp->_r < n) - goto dumb; - fp->_p += n; - fp->_r -= n; - } - _funlockfile(fp); - return 0; - - /* - * We get here if we cannot optimise the seek ... just - * do it. Allow the seek function to change fp->_bf._base. - */ - -dumb: - if (_fflush_r (ptr, fp) - || seekfn (ptr, fp->_cookie, offset, whence) == POS_ERR) - { - _funlockfile(fp); - return EOF; - } - /* success: clear EOF indicator and discard ungetc() data */ - if (HASUB (fp)) - FREEUB (ptr, fp); - fp->_p = fp->_bf._base; - fp->_r = 0; - /* fp->_w = 0; *//* unnecessary (I think...) */ - fp->_flags &= ~__SEOF; - _funlockfile(fp); - return 0; -} - -#ifndef _REENT_ONLY - -_off64_t -_DEFUN (fseeko64, (fp, offset, whence), - register FILE *fp _AND - _off64_t offset _AND - int whence) -{ - return _fseeko64_r (_REENT, fp, offset, whence); -} - -#endif /* !_REENT_ONLY */ - -#endif /* __LARGE64_FILES */ diff --git a/newlib/libc/stdio64/fsetpos64.c b/newlib/libc/stdio64/fsetpos64.c deleted file mode 100644 index 046990d7a..000000000 --- a/newlib/libc/stdio64/fsetpos64.c +++ /dev/null @@ -1,79 +0,0 @@ -/* -FUNCTION -<<fsetpos64>>---restore position of a large stream or file - -INDEX - fsetpos64 -INDEX - _fsetpos64_r - -ANSI_SYNOPSIS - #include <stdio.h> - int fsetpos64(FILE *<[fp]>, const _fpos64_t *<[pos]>); - int _fsetpos64_r(struct _reent *<[ptr]>, FILE *<[fp]>, - const _fpos64_t *<[pos]>); - -TRAD_SYNOPSIS - #include <stdio.h> - int fsetpos64(<[fp]>, <[pos]>) - FILE *<[fp]>; - _fpos64_t *<[pos]>; - - int _fsetpos64_r(<[ptr]>, <[fp]>, <[pos]>) - struct _reent *<[ptr]>; - FILE *<[fp]>; - _fpos64_t *<[pos]>; - -DESCRIPTION -Objects of type <<FILE>> can have a ``position'' that records how much -of the file your program has already read. Many of the <<stdio>> functions -depend on this position, and many change it as a side effect. - -You can use <<fsetpos64>> to return the large file identified by <[fp]> to a -previous position <<*<[pos]>>> (after first recording it with <<fgetpos64>>). - -See <<fseeko64>> for a similar facility. - -RETURNS -<<fgetpos64>> returns <<0>> when successful. If <<fgetpos64>> fails, the -result is <<1>>. The reason for failure is indicated in <<errno>>: -either <<ESPIPE>> (the stream identified by <[fp]> doesn't support -64-bit repositioning) or <<EINVAL>> (invalid file position). - -PORTABILITY -<<fsetpos64>> is a glibc extension. - -Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>, -<<lseek64>>, <<read>>, <<sbrk>>, <<write>>. -*/ - -#include <stdio.h> - -#ifdef __LARGE64_FILES - -int -_DEFUN (_fsetpos64_r, (ptr, iop, pos), - struct _reent *ptr _AND - FILE * iop _AND - _CONST _fpos64_t * pos) -{ - int x = _fseeko64_r (ptr, iop, (_off64_t)(*pos), SEEK_SET); - - if (x != 0) - return 1; - return 0; -} - -#ifndef _REENT_ONLY - -int -_DEFUN (fsetpos64, (iop, pos), - FILE * iop _AND - _CONST _fpos64_t * pos) -{ - return _fsetpos64_r (_REENT, iop, pos); -} - -#endif /* !_REENT_ONLY */ - -#endif /* __LARGE64_FILES */ diff --git a/newlib/libc/stdio64/ftello64.c b/newlib/libc/stdio64/ftello64.c deleted file mode 100644 index 51dcd2796..000000000 --- a/newlib/libc/stdio64/ftello64.c +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* -FUNCTION -<<ftello64>>---return position in a stream or file - -INDEX - ftello64 -INDEX - _ftello64_r - -ANSI_SYNOPSIS - #include <stdio.h> - _off64_t ftello64(FILE *<[fp]>); - _off64_t _ftello64_r(struct _reent *<[ptr]>, FILE *<[fp]>); - -TRAD_SYNOPSIS - #include <stdio.h> - _off64_t ftello64(<[fp]>) - FILE *<[fp]>; - - _off64_t _ftello64_r(<[ptr]>, <[fp]>) - struct _reent *<[ptr]>; - FILE *<[fp]>; - -DESCRIPTION -Objects of type <<FILE>> can have a ``position'' that records how much -of the file your program has already read. Many of the <<stdio>> functions -depend on this position, and many change it as a side effect. - -The result of <<ftello64>> is the current position for a large file -identified by <[fp]>. If you record this result, you can later -use it with <<fseeko64>> to return the file to this -position. The difference between <<ftello>> and <<ftello64>> is that -<<ftello>> returns <<off_t>> and <<ftello64>> is designed to work -for large files (>2GB) and returns <<_off64_t>>. - -In the current implementation, <<ftello64>> simply uses a character -count to represent the file position; this is the same number that -would be recorded by <<fgetpos64>>. - -The function exists only if the __LARGE64_FILES flag is defined. -An error occurs if the <[fp]> was not opened via <<fopen64>>. - -RETURNS -<<ftello64>> returns the file position, if possible. If it cannot do -this, it returns <<-1>>. Failure occurs on streams that do not support -positioning or not opened via <<fopen64>>; the global <<errno>> indicates -this condition with the value <<ESPIPE>>. - -PORTABILITY -<<ftello64>> is a glibc extension. - -No supporting OS subroutines are required. -*/ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "%W% (Berkeley) %G%"; -#endif /* LIBC_SCCS and not lint */ - -/* - * ftello64: return current offset. - */ - -#include <stdio.h> -#include <errno.h> - -#include "local.h" - -#ifdef __LARGE64_FILES - -_off64_t -_DEFUN (_ftello64_r, (ptr, fp), - struct _reent *ptr _AND - register FILE * fp) -{ - _fpos64_t pos; - - /* Only do 64-bit tell on large file. */ - if (!(fp->_flags & __SL64)) - return (_off64_t) _ftello_r (ptr, fp); - - /* Ensure stdio is set up. */ - - CHECK_INIT (ptr, fp); - - _flockfile(fp); - - if (fp->_seek64 == NULL) - { - ptr->_errno = ESPIPE; - _funlockfile(fp); - return -1L; - } - - /* Find offset of underlying I/O object, then adjust for buffered - bytes. Flush a write stream, since the offset may be altered if - the stream is appending. Do not flush a read stream, since we - must not lose the ungetc buffer. */ - if (fp->_flags & __SWR) - _fflush_r (ptr, fp); - if (fp->_flags & __SOFF) - pos = fp->_offset; - else - { - pos = fp->_seek64 (ptr, fp->_cookie, (_fpos64_t) 0, SEEK_CUR); - if (pos == -1L) - { - _funlockfile(fp); - return pos; - } - } - if (fp->_flags & __SRD) - { - /* - * Reading. Any unread characters (including - * those from ungetc) cause the position to be - * smaller than that in the underlying object. - */ - pos -= fp->_r; - if (HASUB (fp)) - pos -= fp->_ur; - } - else if (fp->_flags & __SWR && fp->_p != NULL) - { - /* - * Writing. Any buffered characters cause the - * position to be greater than that in the - * underlying object. - */ - pos += fp->_p - fp->_bf._base; - } - - _funlockfile(fp); - return pos; -} - -#ifndef _REENT_ONLY - -_off64_t -_DEFUN (ftello64, (fp), - register FILE * fp) -{ - return _ftello64_r (_REENT, fp); -} - -#endif /* !_REENT_ONLY */ - -#endif /* __LARGE64_FILES */ diff --git a/newlib/libc/stdio64/stdio64.c b/newlib/libc/stdio64/stdio64.c deleted file mode 100644 index f33a394a7..000000000 --- a/newlib/libc/stdio64/stdio64.c +++ /dev/null @@ -1,81 +0,0 @@ -/* No user fns here. Pesch 15apr92. */ - -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#include <stdio.h> -#include <sys/types.h> -#include <fcntl.h> -#include <sys/unistd.h> -#include <errno.h> -#include "local.h" - -#ifdef __LARGE64_FILES -_fpos64_t -_DEFUN(__sseek64, (ptr, cookie, offset, whence), - struct _reent *ptr _AND - void *cookie _AND - _fpos64_t offset _AND - int whence) -{ - register FILE *fp = (FILE *) cookie; - register _off64_t ret; - - ret = _lseek64_r (ptr, fp->_file, (_off64_t) offset, whence); - if (ret == (_fpos64_t)-1L) - fp->_flags &= ~__SOFF; - else - { - fp->_flags |= __SOFF; - fp->_offset = ret; - } - return ret; -} - -_READ_WRITE_RETURN_TYPE -_DEFUN(__swrite64, (ptr, cookie, buf, n), - struct _reent *ptr _AND - void *cookie _AND - char const *buf _AND - int n) -{ - register FILE *fp = (FILE *) cookie; - int w; -#ifdef __SCLE - int oldmode=0; -#endif - - if (fp->_flags & __SAPP) - (void) _lseek64_r (ptr, fp->_file, (_off64_t)0, SEEK_END); - fp->_flags &= ~__SOFF; /* in case O_APPEND mode is set */ - -#ifdef __SCLE - if (fp->_flags & __SCLE) - oldmode = setmode(fp->_file, O_BINARY); -#endif - - w = _write_r (ptr, fp->_file, buf, n); - -#ifdef __SCLE - if (oldmode) - setmode(fp->_file, oldmode); -#endif - - return w; -} - -#endif /* __LARGE64_FILES */ diff --git a/newlib/libc/stdio64/stdio64.tex b/newlib/libc/stdio64/stdio64.tex deleted file mode 100644 index 55818c354..000000000 --- a/newlib/libc/stdio64/stdio64.tex +++ /dev/null @@ -1,42 +0,0 @@ -@node Stdio64 -@chapter Large File Input and Output (@file{stdio.h}) - -This chapter comprises additional functions to manage large files which -are potentially larger than 2GB. - -The underlying facilities for input and output depend on the host -system, but these functions provide a uniform interface. - -The corresponding declarations are in @file{stdio.h}. - -@menu -* fopen64:: Open a large file -* freopen64:: Open a large file using an existing file descriptor -* fsetpos64:: Restore position of a large stream or file -* fgetpos64:: Get position of a large stream or file -* ftello64:: Return position in a large stream or file -* fseeko64:: Set large file position -* tmpfile64:: Create a temporary large file -@end menu - -@page -@include stdio64/fopen64.def - -@page -@include stdio64/freopen64.def - -@page -@include stdio64/ftello64.def - -@page -@include stdio64/fseeko64.def - -@page -@include stdio64/fgetpos64.def - -@page -@include stdio64/fsetpos64.def - -@page -@include stdio64/tmpfile64.def - diff --git a/newlib/libc/stdio64/tmpfile64.c b/newlib/libc/stdio64/tmpfile64.c deleted file mode 100644 index 98a7d7817..000000000 --- a/newlib/libc/stdio64/tmpfile64.c +++ /dev/null @@ -1,101 +0,0 @@ -/* -FUNCTION -<<tmpfile64>>---create a large temporary file - -INDEX - tmpfile64 -INDEX - _tmpfile64_r - -ANSI_SYNOPSIS - #include <stdio.h> - FILE *tmpfile64(void); - - FILE *_tmpfile64_r(void *<[reent]>); - -TRAD_SYNOPSIS - #include <stdio.h> - FILE *tmpfile64(); - - FILE *_tmpfile64_r(<[reent]>) - char *<[reent]>; - -DESCRIPTION -Create a large temporary file (a file which will be deleted automatically), -using a name generated by <<tmpnam>>. The temporary file is opened with -the mode <<"wb+">>, permitting you to read and write anywhere in it -as a binary file (without any data transformations the host system may -perform for text files). The file may be larger than 2GB. - -The alternate function <<_tmpfile64_r>> is a reentrant version. The -argument <[reent]> is a pointer to a reentrancy structure. - -Both <<tmpfile64>> and <<_tmpfile64_r>> are only defined if __LARGE64_FILES -is defined. - -RETURNS -<<tmpfile64>> normally returns a pointer to the temporary file. If no -temporary file could be created, the result is NULL, and <<errno>> -records the reason for failure. - -PORTABILITY -<<tmpfile64>> is a glibc extension. - -Supporting OS subroutines required: <<close>>, <<fstat>>, <<getpid>>, -<<isatty>>, <<lseek64>>, <<open64>>, <<read>>, <<sbrk>>, <<write>>. - -<<tmpfile64>> also requires the global pointer <<environ>>. -*/ - -#include <stdio.h> -#include <reent.h> -#include <errno.h> -#include <fcntl.h> -#include <sys/stat.h> - -#ifndef O_BINARY -# define O_BINARY 0 -#endif - -#ifdef __LARGE64_FILES - -FILE * -_DEFUN (_tmpfile64_r, (ptr), - struct _reent *ptr) -{ - FILE *fp; - int e; - char *f; - char buf[L_tmpnam]; - int fd; - - do - { - if ((f = _tmpnam_r (ptr, buf)) == NULL) - return NULL; - fd = _open64_r (ptr, f, O_RDWR | O_CREAT | O_EXCL | O_BINARY, - S_IRUSR | S_IWUSR); - } - while (fd < 0 && ptr->_errno == EEXIST); - if (fd < 0) - return NULL; - fp = _fdopen64_r (ptr, fd, "wb+"); - e = ptr->_errno; - if (!fp) - _close_r (ptr, fd); - _CAST_VOID _remove_r (ptr, f); - ptr->_errno = e; - return fp; -} - -#ifndef _REENT_ONLY - -FILE * -_DEFUN_VOID (tmpfile64) -{ - return _tmpfile64_r (_REENT); -} - -#endif - -#endif /* __LARGE64_FILES */ |