summaryrefslogtreecommitdiff
path: root/libio
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-10-12 04:05:44 +0000
committerUlrich Drepper <drepper@redhat.com>1997-10-12 04:05:44 +0000
commitdfd2257ad98eb0f6eab167e5fe5ff68ca87172e3 (patch)
tree598abc70247c1d029e6ac2ddb8cf127b81e442e4 /libio
parenta5a0310d8e9d7176bb17e91c916272006a871016 (diff)
downloadglibc-dfd2257ad98eb0f6eab167e5fe5ff68ca87172e3.tar.gz
1997-10-12 05:09 Ulrich Drepper <drepper@cygnus.com> * libio/Makefile (routines): Remove iofprintf. * stdio-common/fprintf.c [USE_IN_LIBIO]: Define _IO_fprintf. * libio/filedoalloc.c: Use _G_stat64 instead of stat. * libio/fileops.c (_IO_file_open): Change to take extra argument indicating whether 32 or 64 bit mode is wanted. * libio/iofopen.c: Call _IO_file_open with extra argument set to 0. * libio/iofopen64.c: Call _IO_file_open with extra argument set to 0. * libio/iolibio.h (_IO_freopen, _IO_freopen64): Likewise. * libio/iofgetpos.c: Pretty print. * libio/iofgetpos64.c: Use _IO_fpos64_t for local variable `pos'. * manual/conf.texi: Document all the _SC_ and _CS_ constants. * manual/creature.texi: Document _LARGEFILE_SOURCE, _LARGEFILE64_SOURCE and _FILE_OFFSET_BITS. * manual/llio.texi: Document truncate and ftruncate. * manual/stdio.texi: Document positional parameters for printf. * math/Makefile (headers): Add tgmath.h. (libm-support): Remove s_lrint, s_llrint, s_lround, and s_llround and move to ... (libm-calls): ... here. Add scalbln, s_nextafterx and s_fma. * math/libm-test.c (lround_test, llround_test): Test for all FP formats by using FUNC(). * math/libm.map: Add fma, fmaf, fmal, nextafterx, nextafterxf, nextafterxl, scalbln, scalblnf, scalblnl, lrintf, lrintl, llrintf, llrintl, lroundf, lroundl, llroundf, and llroundl. * math/math.h: Document new platform specific macros from mathdef.h. Remove declaration of lrint, llrint, lround, and llround. * math/test-double.c: Define TEST_DOUBLE. * math/test-idouble.c: Likewise. * math/test-float.c: Define TEST_FLOAT. * math/test-ifloat.c: Likewise. * math/tgmath.h: New file. * math/bits/mathcalls.h: Add nextafterx, scalbln, fma, lrint, llrint, lround, and llround. Change second argument of scalbn to `int'. * sysdeps/libm-ieee754/s_fma.S: New file. * sysdeps/libm-ieee754/s_fmaf.S: New file. * sysdeps/libm-ieee754/s_fmal.S: New file. * sysdeps/libm-i387/s_fma.S: New file. * sysdeps/libm-i387/s_fmaf.S: New file. * sysdeps/libm-i387/s_fmal.S: New file. * sysdeps/libm-i387/s_llrint.S: Change to take double argument. * sysdeps/libm-i387/s_lrint.S: Likewise. * sysdeps/libm-i387/s_llrintf.S: New file. * sysdeps/libm-i387/s_llrintl.S: New file. * sysdeps/libm-i387/s_lrintf.S: New file. * sysdeps/libm-i387/s_lrintl.S: New file. * sysdeps/libm-ieee754/s_llrint.c: Remove version which works on 80bit double. * sysdeps/libm-ieee754/s_lrint.c: Likewise. * sysdeps/libm-ieee754/s_llrintf.S: New file. * sysdeps/libm-ieee754/s_llrintl.S: New file. * sysdeps/libm-ieee754/s_lrintf.S: New file. * sysdeps/libm-ieee754/s_lrintl.S: New file. * sysdeps/libm-i387/s_scalbln.c: New file. Empty file. * sysdeps/libm-i387/s_scalblnf.c: New file. Empty file. * sysdeps/libm-i387/s_scalblnl.c: New file. Empty file. * sysdeps/libm-i387/s_scalbn.c: Add scalbln as alias. * sysdeps/libm-i387/s_scalbnf.c: Add scalblnf as alias. * sysdeps/libm-i387/s_scalbnl.c: Add scalblnl as alias. * sysdeps/libm-ieee754/s_llround.c: Remove version which works on 80bit double. * sysdeps/libm-ieee754/s_lround.c: Likewise. * sysdeps/libm-ieee754/s_llroundf.c: Likewise. * sysdeps/libm-ieee754/s_llroundl.c: Likewise. * sysdeps/libm-ieee754/s_lroundf.c: Likewise. * sysdeps/libm-ieee754/s_lroundl.c: Likewise. * sysdeps/libm-ieee754/s_nextafterl.c: Add alias fo nextafterxl. * sysdeps/libm-ieee754/s_nextafterx.c: New file. * sysdeps/libm-ieee754/s_nextafterxf.c: New file. * sysdeps/libm-ieee754/s_nextafterxl.c: New file. * sysdeps/libm-ieee754/s_scalbln.c: New file. * sysdeps/libm-ieee754/s_scalblnf.c: New file. * sysdeps/libm-ieee754/s_scalblnl.c: New file. * sysdeps/libm-ieee754/s_scalbn.c: Change to take `int' as second arg. * sysdeps/libm-ieee754/s_scalbnf.c: Likewise. * sysdeps/libm-ieee754/s_scalbnl.c: Likewise. * stdlib/stdlib.h: Protect declarations of __strto*l_internal functions by #ifdefs since they are duplicated in inttypes.h. * sysdeps/wordsize-32/inttypes.h: Add definition of strtoimax and strtoumax plus needed declarations. * sysdeps/generic/confname.h (_SC_AIO_LISTIO_MAX): Fix typo. 1997-10-09 Andreas Jaeger <aj@arthur.rhein-neckar.de> * locale/programs/locfile.c (locfile_read): Correct while loop. * db2/makedb.c (main): Add missing parameter for error output. (process_input): Likewise. * resolv/gethnamaddr.c (getanswer): Rewrite a bit to avoid warning. 1997-10-12 05:05 Ulrich Drepper <drepper@cygnus.com> * libc-map: Add __bzero, __mempcpy. 1997-10-10 18:51 David S. Miller <davem@tanya.rutgers.edu> * sysdeps/unix/sysv/linux/sparc/bits/ioctls.h: Remove dependencies on kernel_termios.h 1997-10-09 10:24 Thorsten Kukuk <kukuk@vt.uni-paderborn.de> Add the changes from the Solaris 2.6 header files, use the new public defines/functions. * nis/nis_addmember.c: Updated. * nis/nis_checkpoint.c: Updated. * nis/nis_creategroup.c: updated. * nis/nis_destroygroup.c: Updated. * nis/nis_getservlist.c: Updated. * nis/nis_ismember.c: Updated. * nis/nis_lookup.c: Updated. * nis/nis_modify.c: Updated. * nis/nis_ping.c: Updated. * nis/nis_print.c: Updated. * nis/nis_print_group_entry.c: Updated. * nis/nis_remove.c: Updated. * nis/nis_removemember.c: Updated. * nis/nis_xdr.c: Updated. * nis/nss_nisplus/nisplus-alias.c: Updated. * nis/nss_nisplus/nisplus-ethers.c: Updated. * nis/nss_nisplus/nisplus-hosts.c: Updated. * nis/nss_nisplus/nisplus-network.c: Updated. * nis/nss_nisplus/nisplus-parser.c: Updated. * nis/nss_nisplus/nisplus-proto.c: Updated. * nis/nss_nisplus/nisplus-rpc.c: Updated. * nis/nss_nisplus/nisplus-service.c: Updated. * nis/rpcsvc/nis.h: Updated. * nis/rpcsvc/nis.x: Updated. * nis/rpcsvc/nis_object.x: Updated. * nis/rpcsvc/nis_tags.h: Updated. * nis/rpcsvc/nislib.h: Updated. * nis/lckcache.c: Removed, since Sun has dropped the directory signatures. The old cache version is now a security risk and not longer supported by Sun. * nis/nis_cache.c: Likewise. * nis/rpcsvc/nis_cache.h: Likewise. * nis/rpcsvc/nis_cache.x: Likewise. * nis/nis_call.c: Remove calls to the cache functions. * nis/libnsl.map: Remove cache and depending functions. * nis/nis_intern.h: Likewise. * nis/nis_add.c: Remove #include <rpcsvc/nislib.h>. * nis/nis_domain_of.c: Likewise. * nis/nis_domain_of_r.c: Likewise. * nis/nis_error.c: Likewise. * nis/nis_file.c: Likewise. * nis/nis_local_names.c: Likewise. * nis/nis_mkdir.c: Likewise. * nis/nis_rmdir.c: Likewise. * nis/nis_subr.c: Likewise. * nis/nis_verifygroup.c: Likewise. * nis/nis_clone.c: Removed, replaced by ... * nis/nis_clone_dir.c: New. * nis/nis_clone_obj.c: New. * nis/nis_clone_res.c: New. * nis/nis_table.c: Fixed bugs shown through the new clone functions. * nis/nis_defaults.c: Fixed a lot of race conditions. * nis/nis_free.c: Rewritten. * sunrpc/auth_des.c: Fix use of free'ed pointer. * nis/Makefile (libnsl-routines): Remove nis_clone, nis_cache and lckcache. Add nis_clone_dir, nis_clone_obj, and nis_clone_res. 1997-10-09 Andreas Jaeger <aj@arthur.rhein-neckar.de> * wctype/test_wctype.c (TEST): Add parens to avoid ambiguity. 1997-10-08 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * include/features.h: Don't crash if _XOPEN_SOURCE is defined to be empty. 1997-10-09 05:54 Ulrich Drepper <drepper@cygnus.com> * nss/digits_dots.c: Place `result' in resbuf and not in `buffer'. * nss/getXXbyYY_r.c: Make sure digits_dots.c sees `resbuf' as struct and not a pointer. Little optimizations. 1997-10-09 05:00 Ulrich Drepper <drepper@cygnus.com> * sysdeps/stub/getenv.c: Remove unused file. * sysdeps/stub/lxstat.c: Likewise. * sysdeps/stub/morecore.c: Likewise. * sysdeps/stub/putenv.c: Likewise. * sysdeps/stub/sbrk.c: Likewise. * sysdeps/stub/setenv.c: Likewise. * sysdeps/stub/sysd-stdio.c: Likewise. * sysdeps/stub/sysdep.h: Likewise. Reported by Zack Weinberg <zack@rabi.phys.columbia.edu>. 1997-10-09 04:58 Ulrich Drepper <drepper@cygnus.com> * configure.in: Add __bzero definition to DWARF2 unwind test. Reported by David S. Miller <davem@caip.rutgers.edu>. 1997-10-07 Paul Eggert <eggert@twinsun.com> * intl/loadmsgcat.c (_nl_load_domain): Fix &&/|| typo when checking file size. Check for overflow when stuffing off_t into size_t. 1997-10-07 18:11 Ulrich Drepper <drepper@cygnus.com> * time/africa: Update from tzdata1997i. 1997-10-07 Andreas Jaeger <aj@arthur.rhein-neckar.de> * posix/globtest.sh: Add arguments for name of dynamic linker and call dynamic linker to execute globtest. * posix/Makefile (tests): Supply arguments to globtest.sh. 1997-10-07 Andreas Jaeger <aj@arthur.rhein-neckar.de> * nis/rpcsvc/ypupd.h: Add missing __END_DECLS. 1997-10-03 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * libc.map: Add mempcpy, prctl. 1997-09-30 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/memcmp.c: Avoid warnings. * sysdeps/generic/memset.c: Likewise. * sysdeps/generic/strchr.c: Likewise. * sysdeps/generic/strlen.c: Likewise. 1997-09-29 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * malloc/Makefile ($(objpfx)mtrace): Fix typo. 1997-09-29 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/m68k/dl-machine.h (elf_machine_rela): Fix last change. The R_68K_GLOB_DAT and R_68K_JMP_SLOT relocations really ignore the addend, Richard. (elf_machine_fixup_plt): Don't add the addend. (elf_machine_plt_value): New function. * sysdeps/alpha/dl-machine.h (elf_machine_plt_value): New function. * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_plt_value): New function. * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_plt_value): New function. * sysdeps/powerpc/dl-machine.h (elf_machine_plt_value): New function. * sysdeps/i386/dl-machine.h (elf_machine_plt_value): New function. * elf/dl-runtime.c (fixup, profile_fixup): Don't add in the addend, instead let the machine dependent setup decide. 1997-09-20 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/m68k/m68020/bits/string.h: New file. 1997-10-07 04:27 Richard Henderson <rth@cygnus.com> * Makeconfig (+includes): Add -I$(objpfx). * stdlib/longlong.h [__sparc__]: Prototype __udiv_qrnnd. * sysdeps/alpha/setjmp.S: __setjmp is the same as _setjmp. Make the former a strong symbol and the later a weak alias. * sysdeps/sparc/sparc32/setjmp.S: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/setjmp.S: Likewise. 1997-10-06 21:01 David S. Miller <davem@tanya.rutgers.edu> * sysdeps/unix/sysv/linux/sparc/sparc64/bits/types.h: Make ino_t 64-bits. * sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h: Make st_ino member 64-bits as well, to match the kernel. 1997-10-06 19:35 Ulrich Drepper <drepper@cygnus.com> * sysdeps/sparc/sparc64/sub_n.S: Fix typo. Patch by Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz>. 1997-10-06 01:09 Zack Weinberg <zack@rabi.phys.columbia.edu> * time/README: Correct list of files from tzcode package. Add contact information for tzcode/tzdata maintainers. Correct spelling of author's name. Compact lists. 1997-10-06 01:48 Ulrich Drepper <drepper@cygnus.com> * malloc/malloc.h: Remove hook definition without caller argument. * malloc/malloc.c: Likewise. * string/tester.c: Correct strsep test. * string/bits/string2.h: Define __string2_1bptr_p and use it. Patch by David S. Miller <davem@tanya.rutgers.edu>. * math/Makefile (routines): Add s_clog10. * math/libm-test.c: Add test for clog10. * math/libm.map: Add clog10{,f,l}. * math/bits/cmathcalls.h [__USE_GNU]: Add clog10. * sysdeps/libm-ieee754/s_clog10.c: New file. * sysdeps/libm-ieee754/s_clog10f.c: New file. * sysdeps/libm-ieee754/s_clog10l.c: New file. * manual/math.texi: Describe clog10. * config.h.in: Add USE_REGPARMS and define internal_function based on this. * configure.in: Define USE_REGPARMS for ix86 machines. * gmon/gmon.c: Mark write_hist, write_call_graph and write_bb_counts as internal functions. * inet/getnameinfo.c: Likewise for nrl_domainname. * inet/getnetgrent_r.c: Likewise for __internal_setnetgrent_reuse. * inet/rcmd.c: Likewise for __icheckhost. * intl/dcgettext.c: Likewise for category_to_name and guess_category_value. * intl/localealias.c: Likewise for read_alias_file. * io/fts.c: Likewise for fts_alloc, fts_build, fts_lfree, fts_maxarglen, fts_padjust, fts_palloc, fts_sort, and fts_stat. * libio/genops.c: Likewise for save_for_backup. * malloc/malloc.c (chunk_free, chunk_alloc, chunk_realloc, chunk_align, main_trim, heap_trim): Likewise. * malloc/mtrace.c (tr_where): Likewise. * misc/fstab.c (mnt2fs): Likewise. * misc/getttyent.c (skip, value): Likewise. * misc/syslog.c (openlog_internal): Likewise. * misc/tsearch.c (trecurse, tdestroy_internal): Likewise. * nss/nsswitch.c (nss_lookup_function, nss_parse_file, nss_getline, nss_parse_service_list, nss_new_service): Likewise. * posix/wordexp.c (parse_dollars, parse_backtick, eval_expr): Likewise. * resolv/inet_ntop.c (inet_ntop4, inet_ntop6): Likewise. * resolv/inet_pton.c (inet_pton4, inet_pton6): Likewise. * resolv/res_init.c (res_setoptions): Likewise. * stdio-common/printf_fp.c (group_number): Likewise. * stdio-common/vfprintf.c (buffered_vfprintf, group_number): Likewise. * stdlib/fmtmsg.c (internal_addseverity): Likewise. * sunrpc/auth_des.c (synchronize): Likewise. * sunrpc/auth_unix.c (marshal_new_auth): Likewise. * sunrpc/clnt_perr.c (auth_errmsg): Likewise. * sunrpc/key_call.c (key_call): Likewise. * sunprc/pmap_rmt.c (getbroadcastnets): Likewise. * sunrpc/svc_tcp.c (makefd_xprt): Likewise. * sunrpc/svcauth_des.c (cache_init, cache_spot, cache_ref, invalidate): Likewise. * sunrpc/xdr_rec.c (fix_buf_size, skip_input_bytes, flush_out, set_input_fragment, get_input_bytes): Likewise. * sysdeps/unix/sysv/linux/getsysstats.c (get_proc_path, phys_pages_info): Likewise. * sysdeps/unix/sysv/linux/if_index.c (opensock): Likewise. * sysdeps/unix/sysv/linux/poll.c (__emulate_poll): Likewise. * sysdeps/unix/sysv/linux/readv.c (__atomic_readv_replacement): Likewise. * sysdeps/unix/sysv/linux/readv.c (__atomic_writev_replacement): Likewise. * time/strptime.c (strptime_internal): Likewise. * time/tzfile.c (find_transition, compute_tzname_max): Likewise. * time/tzset.c (compute_change, tz_compute, tzset_internal): Likewise. * libc.map: Remove _libio_using_thunks, add _fp_hw and _dl_addr. * ctype/ctype.h: Pretty print. * grp/grp.h: Likewise. * include/libc-symbols.h: Likewise. * include/limits.h: Likewise. * include/values.h: Likewise. * io/fcntl.h: Likewise. * io/sys/stat.h: Likewise. * libio/stdio.h: Likewise. * malloc/malloc.h: Likewise. * misc/err.h: Likewise. * misc/regexp.h: Likewise. * misc/sys/cdefs.h: Likewise. * misc/sys/file.h: Likewise. * posix/sys/utsname.h: Likewise. * posix/sys/wait.h: Likewise. * pwd/pwd.h: Likewise. * resolv/netdb.h: Likewise. * signal/signal.h: Likewise. * stdlib/stdlib.h: Likewise. * string/endian.h: Likewise. * string/memory.h: Likewise. * sysdeps/mach/hurd/bits/fcntl.h: Likewise. * sysdeps/mach/hurd/sys/param.h: Likewise. * sysdeps/unix/sysv/linux/sys/param.h: Likewise. * termios/termios.h: Likewise. * wcsmbs/wchar.h: Likewise. * wctype/wctype.h: Likewise. * sysdeps/unix/bsd/bsd4.4/wait3.c: Use __WAIT_STATUS in definition. Implement Large File Support API. * include/features.h: Add suuport for _LARGEFILE_SOURCE, _LARGEFILE64_SOURCE, and _FILE_OFFSET_BITS. * libc.map: Add new functions for LFS. * dirent/Makefile (routines): Add readdir64 and readdir64_r. * dirent/dirent.h: Update readdir prototype for LFS and add new prototypes for above functions. * io/Makefile (routines): Add xstat64, fxstat64, lxstat64, statfs64, fstatfs64, lstat64, open64, lseek64, creat64, and ftw64. * io/creat64.c: New file. * io/fstat64.c: New file. * io/lstat64.c: New file. * io/stat64.c: New file. * io/ftw64.c: New file. * io/ftw.c: Rewrite to allow easy definition of ftw64. * io/ftw.h: Add LFS interface. * io/fcntl.h: Likewise. * io/sys/stat.h: Likewise. * io/sys/statfs.h: Likewise. * libio/Makefile (routines): Add iofgetpos64, iofopen64, iofsetpos64, freopen64, fseeko64, and ftello64. * libcio/fseeko64.c: New file. * libio/ftello64.c: New file. * libio/iofgetpos64.c: New file. * libio/iofopen64.c: New file. * libio/iofsetpos64.c: New file. * libio/fileops.c (_IO_file_fopen): Change to use _IO_off64_t. (_IO_file_attach): Likewise. (_IO_do_write): Likewise. (_IO_file_sync): Likewise. (_IO_file_seek): Likewise. (_IO_file_seekoff): Likewise. Use _G_stat64. (_IO_file_fopen64): New function. (_IO_file_jumps): Initialize showmanyc and imbue. * libio/genops.c (_IO_default_seekpos): Change to use _IO_fpos64_t. (_IO_default_seekoff): Likewise. (_IO_default_seek): Likewise. (_IO_default_showmanyc, _IO_default_imbue): New functions. * libio/iofopncook.c (_IO_cookie_seek): Change to use _IO_off64_t. * libio/iolibio.h: Add prototypes for LFS functions. * libio/ioseekoff.c: Change to use _IO_fpos64_t. * libio/ioseekpos.c: Likewise. * libio/libio.h: Define _IO_fpos64_t and _IO_off64_t. (_IO_FILE): Move _offset field to end and change type to _IO_off64_t. (_IO_seekoff, _IO_seekpos): Change prototype. * libio/libioP.h (_IO_seekoff_t, _IO_seekpos_t, _IO_seek_t): Change to use _IO_off64_t. Change prototypes for function from the *ops.c files. * libio/stdio.h: Add LFS interface definition. * libio/strops.c (_IO_str_seekoff): Change to use _IO_fpos64_t. * posix/Makefile (routines): Add pread64 and pwrite64. * posix/confstr.c: Handle _CS_LFS* requests. * posix/getconf.c: Handle LFS* requests. * sysdeps/generic/confname.h: Add _CS_LFS* constants. * posix/unistd.h: Document _LFS64_LARGEFILE and _LFS64_STDIO. Define off_t and off64_t appropriately. Change prototypes of LFS functions. * posix/sys/types.h: Add LFS types. * resources/Makefile (routines): Add getrlimit64 and setlimit64. * resource/sys/resource.h: Change prototypes of LFS functions. * stdio-common/Makefile (routines): Add tmpfile64. * stdio-common/tmpfile64.c: New file. * sysdeps/generic/_G_config.h: Define _G_fpos64_t and _G_off64_t. Define _G_OPEN64, _G_LSEEK64, _G_FSTAT64. * sysdeps/unix/sysv/linux/_G_config.h: Likewise. * sysdeps/generic/bits/resource.h: Add LFS definitions. * sysdeps/unix/bsd/sun/sunos4/bits/resource.h: Likewise. * sysdeps/unix/sysv/linux/bits/resource.h: Likewise. * sysdeps/generic/statfs.h: Use __fsblkcnt_t for some of the fields. * sysdeps/unix/sysv/linux/bits/statfs.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/statfs.h: Likewise. * sysdeps/generic/types.h: Define LFS types. * sysdeps/unix/sysv/linux/alpha/bits/types.h: Likewise. * sysdeps/unix/sysv/linux/bits/types.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/bits/types.h: Likewise. * sysdeps/generic/sys/mman.h: Add LFS definitions. * sysdeps/unix/sysv/linux/sys/mman.h: Likewise. * sysdeps/generic/mach/hurd/bits/fcntl.h: Add flock LFS extensions. * sysdeps/unix/bsd/bits/fcntl.h: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/fcntl.h: Likewise. * sysdeps/unix/sysv/linux/bits/fcntl.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/fcntl.h: Likewise. * sysdeps/generic/mach/hurd/bits/stat.h: Add stat LFS extensions. * sysdeps/unix/bsd/bits/stat.h: Likewise. * sysdeps/unix/bsd/osf/alpha/bits/stat.h: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/stat.h: Likewise. * sysdeps/unix/sysv/linux/bits/stat.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/stat.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/stat.h: Likewise. * sysdeps/unix/sysv/sysv4/i386/bits/stat.h: Likewise. * sysdeps/unix/sysv/sysv4/solaris2/bits/stat.h: Likewise. * sysdeps/posix/open64.c: New file. * sysdeps/stub/fstatfs64.c: New file. * sysdeps/stub/fxstat64.c: New file. * sysdeps/stub/getrlimit64.c: New file. * sysdeps/stub/lseek64.c: New file. * sysdeps/stub/lxstat64.c: New file. * sysdeps/stub/open64.c: New file. * sysdeps/stub/pread64.c: New file. * sysdeps/stub/pwrite64.c: New file. * sysdeps/stub/readdir64.c: New file. * sysdeps/stub/readdir64_r.c: New file. * sysdeps/stub/setrlimit64.c: New file. * sysdeps/stub/statfs64.c: New file. * sysdeps/stub/xstat64.c: New file. * sysdeps/unix/sysv/linux/llseek.c: Define as __llseek and make llseek and lseek64 weak aliases. * sysdeps/unix/sysv/linux/lseek64.c: New file. Empty. * sysdeps/unix/sysv/linux/alpha/bits/dirent.h: New file. * sysdeps/unix/sysv/linux/bits/dirent.h: Add LFS definitions. * sysdeps/posix/tempname.c: Add extra argument to trigger use of open64. * sysdeps/stub/tempname.c: Likewise. * stdio-common/tempnam.c: Call __stdio_gen_tempname with extra argument. * stdio-common/tmpfile.c: Likewise. * stdio-common/tmpnam.c: Likewise. * stdio-common/tmpnam_r.c: Likewise. * libio/libioP.h: Add definition ofr showmanyc and imbue callbacks. * libio/fileops.c (_IO_file_jumps): Initialize showmanyc and imbue. * libio/iofopncook.c (_IO_cookie_jumps): Likewise. * libio/iopopen.c (_IO_proc_jumps): Likewise. * libio/memstream.c (_IO_mem_jumps): Likewise. * libio/obprintf.c (_IO_obstack_jumps): Likewise. * libio/vsnprintf.c (_IO_strn_jumps): Likewise. * libio/strops.c (_IO_str_jumps): Likewise. * manual/arith.texi: Add a few words why cabs should be used. * manual/llio.texi: Describe sync, fsync, fdatasync. Tell about cleanup handlers & fcntl,lseek,write,read,close,open. * manual/process.texi: Tell about cleanup handlers & system,waitpid, wait. * manual/signal.texi: Likewise for pause. * manual/terminal.texi: Likewise for tcdrain. * manual/time.texi: Document nanosleep. * posix/exevp.c: Don't use nested function. * stdlib/ucontext.h: New file. * sysdeps/i386/sys/ucontext.h: New file. SysV/i386 API definitions. * sunrpc/xcrypt.c (hexval): Make a macro for efficiency. * sysdeps/i386/setjmp.h: Make `here` label local. * sysdeps/i386/elf/start.S: Define _fp_hw "variable". * sysdeps/stub/fstatfs.c: Correct warning. * sysdeps/stub/fxstat.c: Likewise. * sysdeps/stub/lxstat.c: Likewise. * sysdeps/unix/sysv/i386/i686/time.S: New file. 1997-10-03 20:56 Jason Merrill <jason@yorick.cygnus.com> * malloc/obstack.h (obstack_empty_p): New macro. 1997-10-04 17:41 Philip Blundell <Philip.Blundell@pobox.com> * inet/getnameinfo.c (getnameinfo): Remove spurious `#if INET6'. 1997-09-30 Zack Weinberg <zack@rabi.phys.columbia.edu> * maint.texi: Add copyright terms for libdb (Sleepycat, Harvard). Document new --with-binutils switch; delete reference to --with-gnu-as, --with-gnu-ld, --with-gnu-binutils. Add to description of --without-fp: a kernel FPU emulator is adequate (from FAQ) * INSTALL: Regenerated. 1997-09-30 17:29 Richard Henderson <rth@cygnus.com> * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_rela): Move _dl_hwcap declaration to ... (elf_machine_fixup_plt): ... here.
Diffstat (limited to 'libio')
-rw-r--r--libio/Makefile4
-rw-r--r--libio/filedoalloc.c2
-rw-r--r--libio/fileops.c51
-rw-r--r--libio/freopen64.c49
-rw-r--r--libio/fseeko64.c48
-rw-r--r--libio/ftello64.c55
-rw-r--r--libio/genops.c35
-rw-r--r--libio/iofgetpos.c2
-rw-r--r--libio/iofgetpos64.c61
-rw-r--r--libio/iofopen.c2
-rw-r--r--libio/iofopen64.c69
-rw-r--r--libio/iofopncook.c14
-rw-r--r--libio/iofsetpos64.c61
-rw-r--r--libio/iolibio.h7
-rw-r--r--libio/iopopen.c4
-rw-r--r--libio/ioseekoff.c6
-rw-r--r--libio/ioseekpos.c6
-rw-r--r--libio/libio.h10
-rw-r--r--libio/libioP.h67
-rw-r--r--libio/memstream.c4
-rw-r--r--libio/obprintf.c4
-rw-r--r--libio/stdio.h133
-rw-r--r--libio/strops.c10
-rw-r--r--libio/vsnprintf.c4
24 files changed, 607 insertions, 101 deletions
diff --git a/libio/Makefile b/libio/Makefile
index aea60f5226..4df874d722 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -25,14 +25,16 @@ headers := stdio.h libio.h _G_config.h
routines := \
filedoalloc iofclose iofdopen iofflush iofgetpos iofgets iofopen \
- iofopncook iofprintf iofputs iofread iofsetpos ioftell \
+ iofopncook iofputs iofread iofsetpos ioftell \
iofwrite iogetdelim iogetline iogets iopadn iopopen ioputs \
ioseekoff ioseekpos iosetbuffer iosetvbuf iosprintf ioungetc \
iovsprintf iovsscanf \
+ iofgetpos64 iofopen64 iofsetpos64 \
\
clearerr feof ferror fgetc fileno fputc freopen fseek getc getchar \
memstream pclose putc putchar rewind setbuf setlinebuf vasprintf \
iovdprintf vscanf vsnprintf obprintf fcloseall fseeko ftello \
+ freopen64 fseeko64 ftello64 \
\
libc_fatal
diff --git a/libio/filedoalloc.c b/libio/filedoalloc.c
index f1b781e8a0..6abab602d1 100644
--- a/libio/filedoalloc.c
+++ b/libio/filedoalloc.c
@@ -73,7 +73,7 @@ _IO_file_doallocate (fp)
_IO_size_t size;
int couldbetty;
char *p;
- struct stat st;
+ struct _G_stat64 st;
#ifndef _LIBC
/* If _IO_cleanup_registration_needed is non-zero, we should call the
diff --git a/libio/fileops.c b/libio/fileops.c
index 22feb74fdd..ccfce3c776 100644
--- a/libio/fileops.c
+++ b/libio/fileops.c
@@ -161,10 +161,11 @@ _IO_file_finish (fp, dummy)
}
_IO_FILE *
-_IO_file_fopen (fp, filename, mode)
+_IO_file_fopen (fp, filename, mode, is32not64)
_IO_FILE *fp;
const char *filename;
const char *mode;
+ int is32not64;
{
int oflags = 0, omode;
int read_write, fdesc;
@@ -196,13 +197,19 @@ _IO_file_fopen (fp, filename, mode)
omode = O_RDWR;
read_write &= _IO_IS_APPENDING;
}
+#ifdef _G_OPEN64
+ fdesc = (is32not64
+ ? open (filename, omode|oflags, oprot)
+ : _G_OPEN64 (filename, omode|oflags, oprot));
+#else
fdesc = open (filename, omode|oflags, oprot);
+#endif
if (fdesc < 0)
return NULL;
fp->_fileno = fdesc;
_IO_mask_flags (fp, read_write,_IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
if (read_write & _IO_IS_APPENDING)
- if (_IO_SEEKOFF (fp, (_IO_off_t)0, _IO_seek_end, _IOS_INPUT|_IOS_OUTPUT)
+ if (_IO_SEEKOFF (fp, (_IO_off64_t)0, _IO_seek_end, _IOS_INPUT|_IOS_OUTPUT)
== _IO_pos_BAD && errno != ESPIPE)
return NULL;
_IO_link_in (fp);
@@ -222,7 +229,7 @@ _IO_file_attach (fp, fd)
/* Get the current position of the file. */
/* We have to do that since that may be junk. */
fp->_offset = _IO_pos_BAD;
- if (_IO_SEEKOFF (fp, (_IO_off_t)0, _IO_seek_cur, _IOS_INPUT|_IOS_OUTPUT)
+ if (_IO_SEEKOFF (fp, (_IO_off64_t)0, _IO_seek_cur, _IOS_INPUT|_IOS_OUTPUT)
== _IO_pos_BAD && errno != ESPIPE)
return NULL;
return fp;
@@ -265,7 +272,7 @@ _IO_do_write (fp, data, to_do)
fp->_offset = _IO_pos_BAD;
else if (fp->_IO_read_end != fp->_IO_write_base)
{
- _IO_pos_t new_pos
+ _IO_fpos64_t new_pos
= _IO_SYSSEEK (fp, fp->_IO_write_base - fp->_IO_read_end, 1);
if (new_pos == _IO_pos_BAD)
return EOF;
@@ -406,8 +413,8 @@ _IO_file_sync (fp)
if (_IO_in_backup (fp))
delta -= eGptr () - Gbase ();
#endif
- _IO_off_t new_pos = _IO_SYSSEEK (fp, delta, 1);
- if (new_pos != (_IO_off_t) EOF)
+ _IO_off64_t new_pos = _IO_SYSSEEK (fp, delta, 1);
+ if (new_pos != (_IO_off64_t) EOF)
fp->_IO_read_end = fp->_IO_read_ptr;
#ifdef ESPIPE
else if (errno == ESPIPE)
@@ -424,15 +431,15 @@ _IO_file_sync (fp)
return retval;
}
-_IO_pos_t
+_IO_fpos64_t
_IO_file_seekoff (fp, offset, dir, mode)
_IO_FILE *fp;
- _IO_off_t offset;
+ _IO_off64_t offset;
int dir;
int mode;
{
- _IO_pos_t result;
- _IO_off_t delta, new_offset;
+ _IO_fpos64_t result;
+ _IO_off64_t delta, new_offset;
long count;
/* POSIX.1 8.2.3.7 says that after a call the fflush() the file
offset of the underlying file must be exact. */
@@ -477,7 +484,7 @@ _IO_file_seekoff (fp, offset, dir, mode)
break;
case _IO_seek_end:
{
- struct stat st;
+ struct _G_stat64 st;
if (_IO_SYSSTAT (fp, &st) == 0 && S_ISREG (st.st_mode))
{
offset += st.st_size;
@@ -494,8 +501,8 @@ _IO_file_seekoff (fp, offset, dir, mode)
&& !_IO_in_backup (fp))
{
/* Offset relative to start of main get area. */
- _IO_pos_t rel_offset = (offset - fp->_offset
- + (fp->_IO_read_end - fp->_IO_read_base));
+ _IO_fpos64_t rel_offset = (offset - fp->_offset
+ + (fp->_IO_read_end - fp->_IO_read_base));
if (rel_offset >= 0)
{
#if 0
@@ -592,13 +599,17 @@ _IO_file_read (fp, buf, size)
return read (fp->_fileno, buf, size);
}
-_IO_pos_t
+_IO_fpos64_t
_IO_file_seek (fp, offset, dir)
_IO_FILE *fp;
- _IO_off_t offset;
+ _IO_off64_t offset;
int dir;
{
+#ifdef _G_LSEEK64
+ return _G_LSEEK64 (fp->_fileno, offset, dir);
+#else
return lseek (fp->_fileno, offset, dir);
+#endif
}
int
@@ -606,7 +617,11 @@ _IO_file_stat (fp, st)
_IO_FILE *fp;
void *st;
{
- return fstat (fp->_fileno, (struct stat *) st);
+#ifdef _G_STAT64
+ return _G_FSTAT64 (fp->_fileno, (struct _G_stat64 *) st);
+#else
+ return fstat (fp->_fileno, (struct _G_stat64 *) st);
+#endif
}
int
@@ -812,5 +827,7 @@ struct _IO_jump_t _IO_file_jumps =
JUMP_INIT(write, _IO_file_write),
JUMP_INIT(seek, _IO_file_seek),
JUMP_INIT(close, _IO_file_close),
- JUMP_INIT(stat, _IO_file_stat)
+ JUMP_INIT(stat, _IO_file_stat),
+ JUMP_INIT(showmanyc, _IO_default_showmanyc),
+ JUMP_INIT(imbue, _IO_default_imbue)
};
diff --git a/libio/freopen64.c b/libio/freopen64.c
new file mode 100644
index 0000000000..78e994df46
--- /dev/null
+++ b/libio/freopen64.c
@@ -0,0 +1,49 @@
+/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU IO Library.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2, or (at
+ your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this library; see the file COPYING. If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+ MA 02111-1307, USA.
+
+ As a special exception, if you link this library with files
+ compiled with a GNU compiler to produce an executable, this does
+ not cause the resulting executable to be covered by the GNU General
+ Public License. This exception does not however invalidate any
+ other reasons why the executable file might be covered by the GNU
+ General Public License. */
+
+#include "libioP.h"
+#include "stdio.h"
+
+FILE *
+freopen64 (filename, mode, fp)
+ const char* filename;
+ const char* mode;
+ FILE *fp;
+{
+#ifdef _G_OPEN64
+ FILE *result;
+ CHECK_FILE (fp, NULL);
+ if (!(fp->_flags & _IO_IS_FILEBUF))
+ return NULL;
+ _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
+ _IO_flockfile (fp);
+ result = _IO_freopen64 (filename, mode, fp);
+ _IO_cleanup_region_end (1);
+ return result;
+#else
+ __set_errno (ENOSYS);
+ return NULL;
+#endif
+}
diff --git a/libio/fseeko64.c b/libio/fseeko64.c
new file mode 100644
index 0000000000..81c17b398c
--- /dev/null
+++ b/libio/fseeko64.c
@@ -0,0 +1,48 @@
+/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU IO Library.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2, or (at
+ your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this library; see the file COPYING. If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+ MA 02111-1307, USA.
+
+ As a special exception, if you link this library with files
+ compiled with a GNU compiler to produce an executable, this does
+ not cause the resulting executable to be covered by the GNU General
+ Public License. This exception does not however invalidate any
+ other reasons why the executable file might be covered by the GNU
+ General Public License. */
+
+#include <errno.h>
+#include "libioP.h"
+#include "stdio.h"
+
+int
+fseeko64 (fp, offset, whence)
+ _IO_FILE* fp;
+ __off64_t offset;
+ int whence;
+{
+#ifdef _G_LSEEK64
+ int result;
+ CHECK_FILE (fp, -1);
+ _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
+ _IO_flockfile (fp);
+ result = _IO_fseek (fp, offset, whence);
+ _IO_cleanup_region_end (1);
+ return result;
+#else
+ __set_errno (ENOSYS);
+ return -1;
+#endif
+}
diff --git a/libio/ftello64.c b/libio/ftello64.c
new file mode 100644
index 0000000000..886591dca9
--- /dev/null
+++ b/libio/ftello64.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU IO Library.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2, or (at
+ your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this library; see the file COPYING. If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+ MA 02111-1307, USA.
+
+ As a special exception, if you link this library with files
+ compiled with a GNU compiler to produce an executable, this does
+ not cause the resulting executable to be covered by the GNU General
+ Public License. This exception does not however invalidate any
+ other reasons why the executable file might be covered by the GNU
+ General Public License. */
+
+#include <stdio.h>
+#include <libioP.h>
+#include <errno.h>
+
+
+off64_t
+ftello64 (fp)
+ _IO_FILE *fp;
+{
+#ifdef _G_LSEEK64
+ _IO_pos_t pos;
+ CHECK_FILE (fp, -1L);
+ _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
+ _IO_flockfile (fp);
+ pos = _IO_seekoff (fp, 0, _IO_seek_cur, 0);
+ _IO_cleanup_region_end (1);
+ if (pos == _IO_pos_BAD)
+ {
+#ifdef EIO
+ if (errno == 0)
+ __set_errno (EIO);
+#endif
+ return -1L;
+ }
+ return _IO_pos_as_off (pos);
+#else
+ __set_errno (ENOSYS);
+ return -1;
+#endif
+}
diff --git a/libio/genops.c b/libio/genops.c
index de9c826b9f..71275da28c 100644
--- a/libio/genops.c
+++ b/libio/genops.c
@@ -180,9 +180,16 @@ __overflow (f, ch)
return _IO_OVERFLOW (f, ch);
}
-static int save_for_backup __P ((_IO_FILE *fp));
+static int save_for_backup __P ((_IO_FILE *fp))
+#ifdef _LIBC
+ internal_function
+#endif
+ ;
static int
+#ifdef _LIBC
+ internal_function
+#endif
save_for_backup (fp)
_IO_FILE *fp;
{
@@ -467,10 +474,10 @@ _IO_default_setbuf (fp, p, len)
return fp;
}
-_IO_pos_t
+_IO_fpos64_t
_IO_default_seekpos (fp, pos, mode)
_IO_FILE *fp;
- _IO_pos_t pos;
+ _IO_fpos64_t pos;
int mode;
{
return _IO_SEEKOFF (fp, _IO_pos_as_off (pos), 0, mode);
@@ -551,10 +558,10 @@ _IO_default_finish (fp, dummy)
_IO_un_link (fp);
}
-_IO_pos_t
+_IO_fpos64_t
_IO_default_seekoff (fp, offset, dir, mode)
_IO_FILE *fp;
- _IO_off_t offset;
+ _IO_off64_t offset;
int dir;
int mode;
{
@@ -882,10 +889,10 @@ _IO_default_pbackfail (fp, c)
return (unsigned char) *fp->_IO_read_ptr;
}
-_IO_pos_t
+_IO_fpos64_t
_IO_default_seek (fp, offset, dir)
_IO_FILE *fp;
- _IO_off_t offset;
+ _IO_off64_t offset;
int dir;
{
return _IO_pos_BAD;
@@ -917,6 +924,20 @@ _IO_default_write (fp, data, n)
return 0;
}
+int
+_IO_default_showmanyc (fp)
+ _IO_FILE *fp;
+{
+ return -1;
+}
+
+void
+_IO_default_imbue (fp, locale)
+ _IO_FILE *fp;
+ void *locale;
+{
+}
+
#ifdef TODO
#if defined(linux)
diff --git a/libio/iofgetpos.c b/libio/iofgetpos.c
index 08a3c20e86..6afc323136 100644
--- a/libio/iofgetpos.c
+++ b/libio/iofgetpos.c
@@ -28,7 +28,7 @@
int
_IO_fgetpos (fp, posp)
- _IO_FILE* fp;
+ _IO_FILE *fp;
_IO_fpos_t *posp;
{
_IO_fpos_t pos;
diff --git a/libio/iofgetpos64.c b/libio/iofgetpos64.c
new file mode 100644
index 0000000000..0cb79d6619
--- /dev/null
+++ b/libio/iofgetpos64.c
@@ -0,0 +1,61 @@
+/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU IO Library.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2, or (at
+ your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this library; see the file COPYING. If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+ MA 02111-1307, USA.
+
+ As a special exception, if you link this library with files
+ compiled with a GNU compiler to produce an executable, this does
+ not cause the resulting executable to be covered by the GNU General
+ Public License. This exception does not however invalidate any
+ other reasons why the executable file might be covered by the GNU
+ General Public License. */
+
+#include "libioP.h"
+#include <errno.h>
+
+int
+_IO_fgetpos64 (fp, posp)
+ _IO_FILE *fp;
+ _IO_fpos64_t *posp;
+{
+#ifdef _G_LSEEK64
+ _IO_fpos64_t pos;
+ CHECK_FILE (fp, EOF);
+ _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
+ _IO_flockfile (fp);
+ pos = _IO_seekoff (fp, 0, _IO_seek_cur, 0);
+ _IO_cleanup_region_end (1);
+ if (pos == _IO_pos_BAD)
+ {
+ /* ANSI explicitly requires setting errno to a positive value on
+ failure. */
+#ifdef EIO
+ if (errno == 0)
+ __set_errno (EIO);
+#endif
+ return EOF;
+ }
+ *posp = pos;
+ return 0;
+#else
+ __set_errno (ENOSYS);
+ return EOF;
+#endif
+}
+
+#ifdef weak_alias
+weak_alias (_IO_fgetpos64, fgetpos64)
+#endif
diff --git a/libio/iofopen.c b/libio/iofopen.c
index 1dbeccb81a..5019e9a798 100644
--- a/libio/iofopen.c
+++ b/libio/iofopen.c
@@ -52,7 +52,7 @@ _IO_fopen (filename, mode)
#if !_IO_UNIFIED_JUMPTABLES
new_f->fp.vtable = NULL;
#endif
- if (_IO_file_fopen (&new_f->fp.file, filename, mode) != NULL)
+ if (_IO_file_fopen (&new_f->fp.file, filename, mode, 0) != NULL)
return (_IO_FILE *) &new_f->fp;
_IO_un_link (&new_f->fp.file);
free (new_f);
diff --git a/libio/iofopen64.c b/libio/iofopen64.c
new file mode 100644
index 0000000000..cdd508d08a
--- /dev/null
+++ b/libio/iofopen64.c
@@ -0,0 +1,69 @@
+/* Copyright (C) 1993, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU IO Library.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2, or (at
+ your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this library; see the file COPYING. If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+ MA 02111-1307, USA.
+
+ As a special exception, if you link this library with files
+ compiled with a GNU compiler to produce an executable, this does
+ not cause the resulting executable to be covered by the GNU General
+ Public License. This exception does not however invalidate any
+ other reasons why the executable file might be covered by the GNU
+ General Public License. */
+
+#include "libioP.h"
+#ifdef __STDC__
+#include <stdlib.h>
+#endif
+
+_IO_FILE *
+_IO_fopen64 (filename, mode)
+ const char *filename;
+ const char *mode;
+{
+#ifdef _G_OPEN64
+ struct locked_FILE
+ {
+ struct _IO_FILE_plus fp;
+#ifdef _IO_MTSAFE_IO
+ _IO_lock_t lock;
+#endif
+ } *new_f = (struct locked_FILE *) malloc (sizeof (struct locked_FILE));
+
+ if (new_f == NULL)
+ return NULL;
+#ifdef _IO_MTSAFE_IO
+ new_f->fp.file._lock = &new_f->lock;
+#endif
+ _IO_init (&new_f->fp.file, 0);
+ _IO_JUMPS (&new_f->fp.file) = &_IO_file_jumps;
+ _IO_file_init (&new_f->fp.file);
+#if !_IO_UNIFIED_JUMPTABLES
+ new_f->fp.vtable = NULL;
+#endif
+ if (_IO_file_fopen (&new_f->fp.file, filename, mode, 1) != NULL)
+ return (_IO_FILE *) &new_f->fp;
+ _IO_un_link (&new_f->fp.file);
+ free (new_f);
+ return NULL;
+#else
+ __set_errno (ENOSYS);
+ return NULL;
+#endif
+}
+
+#ifdef weak_alias
+weak_alias (_IO_fopen64, fopen64)
+#endif
diff --git a/libio/iofopncook.c b/libio/iofopncook.c
index 9bf29e71ae..4f28ec20a8 100644
--- a/libio/iofopncook.c
+++ b/libio/iofopncook.c
@@ -33,8 +33,8 @@ static _IO_ssize_t _IO_cookie_read __P ((register _IO_FILE* fp, void* buf,
_IO_ssize_t size));
static _IO_ssize_t _IO_cookie_write __P ((register _IO_FILE* fp,
const void* buf, _IO_ssize_t size));
-static _IO_fpos_t _IO_cookie_seek __P ((_IO_FILE *fp, _IO_off_t offset,
- int dir));
+static _IO_fpos64_t _IO_cookie_seek __P ((_IO_FILE *fp, _IO_off64_t offset,
+ int dir));
static int _IO_cookie_close __P ((_IO_FILE* fp));
@@ -66,14 +66,14 @@ _IO_cookie_write (fp, buf, size)
return cfile->io_functions.write (cfile->cookie, buf, size);
}
-static _IO_fpos_t
+static _IO_fpos64_t
_IO_cookie_seek (fp, offset, dir)
_IO_FILE *fp;
- _IO_off_t offset;
+ _IO_off64_t offset;
int dir;
{
struct _IO_cookie_file *cfile = (struct _IO_cookie_file *) fp;
- _IO_fpos_t pos;
+ _IO_fpos64_t pos;
if (cfile->io_functions.seek == NULL)
return _IO_pos_BAD;
@@ -118,7 +118,9 @@ static struct _IO_jump_t _IO_cookie_jumps = {
JUMP_INIT(write, _IO_cookie_write),
JUMP_INIT(seek, _IO_cookie_seek),
JUMP_INIT(close, _IO_cookie_close),
- JUMP_INIT(stat, _IO_default_stat)
+ JUMP_INIT(stat, _IO_default_stat),
+ JUMP_INIT(showmanyc, _IO_default_showmanyc),
+ JUMP_INIT(imbue, _IO_default_imbue),
};
diff --git a/libio/iofsetpos64.c b/libio/iofsetpos64.c
new file mode 100644
index 0000000000..534e0cf3ca
--- /dev/null
+++ b/libio/iofsetpos64.c
@@ -0,0 +1,61 @@
+/* Copyright (C) 1993, 1995, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU IO Library.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2, or (at
+ your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this library; see the file COPYING. If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+ MA 02111-1307, USA.
+
+ As a special exception, if you link this library with files
+ compiled with a GNU compiler to produce an executable, this does
+ not cause the resulting executable to be covered by the GNU General
+ Public License. This exception does not however invalidate any
+ other reasons why the executable file might be covered by the GNU
+ General Public License. */
+
+#include <libioP.h>
+#include <errno.h>
+
+int
+_IO_fsetpos64 (fp, posp)
+ _IO_FILE *fp;
+ const _IO_fpos64_t *posp;
+{
+#ifdef _G_LSEEK64
+ int result;
+ CHECK_FILE (fp, EOF);
+ _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
+ _IO_flockfile (fp);
+ if (_IO_seekpos (fp, *posp, _IOS_INPUT|_IOS_OUTPUT) == _IO_pos_BAD)
+ {
+ /* ANSI explicitly requires setting errno to a positive value on
+ failure. */
+#ifdef EIO
+ if (errno == 0)
+ __set_errno (EIO);
+#endif
+ result = EOF;
+ }
+ else
+ result = 0;
+ _IO_cleanup_region_end (1);
+ return result;
+#else
+ __set_errno (ENOSYS);
+ return EOF;
+#endif
+}
+
+#ifdef weak_alias
+weak_alias (_IO_fsetpos64, fsetpos64)
+#endif
diff --git a/libio/iolibio.h b/libio/iolibio.h
index 92df6a6fd2..bcf8bbd775 100644
--- a/libio/iolibio.h
+++ b/libio/iolibio.h
@@ -11,11 +11,14 @@ extern int _IO_fclose __P((_IO_FILE*));
extern _IO_FILE *_IO_fdopen __P((int, const char*));
extern int _IO_fflush __P((_IO_FILE*));
extern int _IO_fgetpos __P((_IO_FILE*, _IO_fpos_t*));
+extern int _IO_fgetpos64 __P((_IO_FILE*, _IO_fpos64_t*));
extern char* _IO_fgets __P((char*, int, _IO_FILE*));
extern _IO_FILE *_IO_fopen __P((const char*, const char*));
+extern _IO_FILE *_IO_fopen64 __P((const char*, const char*));
extern int _IO_fprintf __P((_IO_FILE*, const char*, ...));
extern int _IO_fputs __P((const char*, _IO_FILE*));
extern int _IO_fsetpos __P((_IO_FILE*, const _IO_fpos_t *));
+extern int _IO_fsetpos64 __P((_IO_FILE*, const _IO_fpos64_t *));
extern long int _IO_ftell __P((_IO_FILE*));
extern _IO_size_t _IO_fread __P((void*, _IO_size_t, _IO_size_t, _IO_FILE*));
extern _IO_size_t _IO_fwrite __P((const void*,
@@ -46,7 +49,9 @@ extern int _IO_obstack_printf __P ((struct obstack *, const char *, ...));
#define _IO_rewind(FILE) (void)_IO_seekoff(FILE, 0, 0, _IOS_INPUT|_IOS_OUTPUT)
#define _IO_vprintf(FORMAT, ARGS) _IO_vfprintf(_IO_stdout, FORMAT, ARGS)
#define _IO_freopen(FILENAME, MODE, FP) \
- (_IO_file_close_it(FP), _IO_file_fopen(FP, FILENAME, MODE))
+ (_IO_file_close_it(FP), _IO_file_fopen(FP, FILENAME, MODE, 0))
+#define _IO_freopen64(FILENAME, MODE, FP) \
+ (_IO_file_close_it(FP), _IO_file_fopen(FP, FILENAME, MODE, 1))
#define _IO_fileno(FP) ((FP)->_fileno)
extern _IO_FILE* _IO_popen __P((const char*, const char*));
#define _IO_pclose _IO_fclose
diff --git a/libio/iopopen.c b/libio/iopopen.c
index 59d4fc3f0e..f0589bf184 100644
--- a/libio/iopopen.c
+++ b/libio/iopopen.c
@@ -247,5 +247,7 @@ struct _IO_jump_t _IO_proc_jumps = {
JUMP_INIT(write, _IO_file_write),
JUMP_INIT(seek, _IO_file_seek),
JUMP_INIT(close, _IO_proc_close),
- JUMP_INIT(stat, _IO_file_stat)
+ JUMP_INIT(stat, _IO_file_stat),
+ JUMP_INIT(showmanyc, _IO_default_showmanyc),
+ JUMP_INIT(imbue, _IO_default_imbue)
};
diff --git a/libio/ioseekoff.c b/libio/ioseekoff.c
index b1c4729b3d..13086ee912 100644
--- a/libio/ioseekoff.c
+++ b/libio/ioseekoff.c
@@ -25,14 +25,14 @@
#include <libioP.h>
-_IO_pos_t
+_IO_fpos64_t
_IO_seekoff (fp, offset, dir, mode)
_IO_FILE *fp;
- _IO_off_t offset;
+ _IO_off64_t offset;
int dir;
int mode;
{
- _IO_pos_t retval;
+ _IO_fpos64_t retval;
/* If we have a backup buffer, get rid of it, since the __seekoff
callback may not know to do the right thing about it.
diff --git a/libio/ioseekpos.c b/libio/ioseekpos.c
index 2ce0c2224e..5b59ed7d99 100644
--- a/libio/ioseekpos.c
+++ b/libio/ioseekpos.c
@@ -25,13 +25,13 @@
#include <libioP.h>
-_IO_pos_t
+_IO_fpos64_t
_IO_seekpos (fp, pos, mode)
_IO_FILE *fp;
- _IO_pos_t pos;
+ _IO_fpos64_t pos;
int mode;
{
- _IO_pos_t retval;
+ _IO_fpos64_t retval;
/* If we have a backup buffer, get rid of it, since the __seekoff
callback may not know to do the right thing about it.
diff --git a/libio/libio.h b/libio/libio.h
index 1dddaf27b7..ad5583f486 100644
--- a/libio/libio.h
+++ b/libio/libio.h
@@ -30,9 +30,11 @@
#include <_G_config.h>
#define _IO_pos_t _G_fpos_t /* obsolete */
#define _IO_fpos_t _G_fpos_t
+#define _IO_fpos64_t _G_fpos64_t
#define _IO_size_t _G_size_t
#define _IO_ssize_t _G_ssize_t
#define _IO_off_t _G_off_t
+#define _IO_off64_t _G_off64_t
#define _IO_pid_t _G_pid_t
#define _IO_uid_t _G_uid_t
#define _IO_HAVE_SYS_WAIT _G_HAVE_SYS_WAIT
@@ -205,7 +207,7 @@ struct _IO_FILE {
int _fileno;
int _blksize;
- _IO_off_t _offset;
+ _IO_off_t _unused2; /* This used to be _offset but it's too small. */
#define __HAVE_COLUMN /* temporary */
/* 1+column number of pbase(); 0 is unknown. */
@@ -216,6 +218,8 @@ struct _IO_FILE {
/* char* _save_gptr; char* _save_egptr; */
_IO_lock_t *_lock;
+
+ _IO_off64_t _offset;
};
#ifndef __cplusplus
@@ -303,8 +307,8 @@ extern int _IO_vfprintf __P ((_IO_FILE *, const char *, _IO_va_list));
extern _IO_ssize_t _IO_padn __P ((_IO_FILE *, int, _IO_ssize_t));
extern _IO_size_t _IO_sgetn __P ((_IO_FILE *, void *, _IO_size_t));
-extern _IO_fpos_t _IO_seekoff __P ((_IO_FILE *, _IO_off_t, int, int));
-extern _IO_fpos_t _IO_seekpos __P ((_IO_FILE *, _IO_fpos_t, int));
+extern _IO_fpos64_t _IO_seekoff __P ((_IO_FILE *, _IO_off64_t, int, int));
+extern _IO_fpos64_t _IO_seekpos __P ((_IO_FILE *, _IO_fpos64_t, int));
extern void _IO_free_backup_area __P ((_IO_FILE *));
diff --git a/libio/libioP.h b/libio/libioP.h
index 2337071d39..5fe9598c0d 100644
--- a/libio/libioP.h
+++ b/libio/libioP.h
@@ -134,16 +134,16 @@ typedef _IO_size_t (*_IO_xsgetn_t) __P ((_IO_FILE *FP, void *DATA,
(MODE==1), or the end of the file (MODE==2).
It matches the streambuf::seekoff virtual function.
It is also used for the ANSI fseek function. */
-typedef _IO_fpos_t (*_IO_seekoff_t) __P ((_IO_FILE *FP, _IO_off_t OFF,
+typedef _IO_fpos64_t (*_IO_seekoff_t) __P ((_IO_FILE *FP, _IO_off64_t OFF,
int DIR, int MODE));
#define _IO_SEEKOFF(FP, OFF, DIR, MODE) JUMP3 (__seekoff, FP, OFF, DIR, MODE)
/* The 'seekpos' hook also moves the stream position,
- but to an absolute position given by a fpos_t (seekpos).
+ but to an absolute position given by a fpos64_t (seekpos).
It matches the streambuf::seekpos virtual function.
It is also used for the ANSI fgetpos and fsetpos functions. */
/* The _IO_seek_cur and _IO_seek_end options are not allowed. */
-typedef _IO_fpos_t (*_IO_seekpos_t) __P ((_IO_FILE *, _IO_fpos_t, int));
+typedef _IO_fpos64_t (*_IO_seekpos_t) __P ((_IO_FILE *, _IO_fpos64_t, int));
#define _IO_SEEKPOS(FP, POS, FLAGS) JUMP2 (__seekpos, FP, POS, FLAGS)
/* The 'setbuf' hook gives a buffer to the file.
@@ -192,7 +192,7 @@ typedef _IO_ssize_t (*_IO_write_t) __P ((_IO_FILE *,const void *,_IO_ssize_t));
It generalizes the Unix lseek(2) function.
It matches the streambuf::sys_seek virtual function, which is
specific to this implementation. */
-typedef _IO_fpos_t (*_IO_seek_t) __P ((_IO_FILE *, _IO_off_t, int));
+typedef _IO_fpos64_t (*_IO_seek_t) __P ((_IO_FILE *, _IO_off64_t, int));
#define _IO_SYSSEEK(FP, OFFSET, MODE) JUMP2 (__seek, FP, OFFSET, MODE)
/* The 'sysclose' hook is used to finalize (close, finish up) an
@@ -209,6 +209,17 @@ typedef int (*_IO_close_t) __P ((_IO_FILE *)); /* finalize */
typedef int (*_IO_stat_t) __P ((_IO_FILE *, void *));
#define _IO_SYSSTAT(FP, BUF) JUMP1 (__stat, FP, BUF)
+/* The 'showmany' hook can be used to get an image how much input is
+ available. In many cases the answer will be 0 which means unknown
+ but some cases one can provide real information. */
+typedef int (*_IO_showmanyc_t) __P ((_IO_FILE *));
+#define _IO_SHOWMANYC(FP) JUMP0 (__showmanyc, FP)
+
+/* The 'imbue' hook is used to get information about the currently
+ installed locales. */
+typedef void (*_IO_imbue_t) __P ((_IO_FILE *, void *));
+#define _IO_IMBUE(FP, LOCALE) JUMP1 (__imbue, FP, LOCALE)
+
#define _IO_CHAR_TYPE char /* unsigned char ? */
#define _IO_INT_TYPE int
@@ -237,6 +248,8 @@ struct _IO_jump_t
JUMP_FIELD(_IO_seek_t, __seek);
JUMP_FIELD(_IO_close_t, __close);
JUMP_FIELD(_IO_stat_t, __stat);
+ JUMP_FIELD(_IO_showmanyc_t, __showmanyc);
+ JUMP_FIELD(_IO_imbue_t, __imbue);
#if 0
get_column;
set_column;
@@ -256,8 +269,8 @@ struct _IO_FILE_plus
/* Generic functions */
-extern _IO_fpos_t _IO_seekoff __P ((_IO_FILE *, _IO_off_t, int, int));
-extern _IO_fpos_t _IO_seekpos __P ((_IO_FILE *, _IO_fpos_t, int));
+extern _IO_fpos64_t _IO_seekoff __P ((_IO_FILE *, _IO_off64_t, int, int));
+extern _IO_fpos64_t _IO_seekpos __P ((_IO_FILE *, _IO_fpos64_t, int));
extern void _IO_switch_to_main_get_area __P ((_IO_FILE *));
extern void _IO_switch_to_backup_area __P ((_IO_FILE *));
@@ -293,15 +306,19 @@ extern _IO_FILE* _IO_default_setbuf __P ((_IO_FILE *, char *, _IO_ssize_t));
extern _IO_size_t _IO_default_xsputn __P ((_IO_FILE *, const void *,
_IO_size_t));
extern _IO_size_t _IO_default_xsgetn __P ((_IO_FILE *, void *, _IO_size_t));
-extern _IO_fpos_t _IO_default_seekoff __P ((_IO_FILE *, _IO_off_t, int, int));
-extern _IO_fpos_t _IO_default_seekpos __P ((_IO_FILE *, _IO_fpos_t, int));
+extern _IO_fpos64_t _IO_default_seekoff __P ((_IO_FILE *,
+ _IO_off64_t, int, int));
+extern _IO_fpos64_t _IO_default_seekpos __P ((_IO_FILE *,
+ _IO_fpos64_t, int));
extern _IO_ssize_t _IO_default_write __P ((_IO_FILE *, const void *,
_IO_ssize_t));
extern _IO_ssize_t _IO_default_read __P ((_IO_FILE *, void *, _IO_ssize_t));
extern int _IO_default_stat __P ((_IO_FILE *, void *));
-extern _IO_fpos_t _IO_default_seek __P ((_IO_FILE *, _IO_off_t, int));
+extern _IO_fpos64_t _IO_default_seek __P ((_IO_FILE *, _IO_off64_t, int));
extern int _IO_default_sync __P ((_IO_FILE *));
#define _IO_default_close ((_IO_close_t) _IO_default_sync)
+extern int _IO_default_showmanyc __P ((_IO_FILE *));
+extern void _IO_default_imbue __P ((_IO_FILE *, void *));
extern struct _IO_jump_t _IO_file_jumps;
extern struct _IO_jump_t _IO_streambuf_jumps;
@@ -331,7 +348,7 @@ extern void _IO_flush_all_linebuffered __P ((void));
extern int _IO_file_doallocate __P ((_IO_FILE *));
extern _IO_FILE* _IO_file_setbuf __P ((_IO_FILE *, char *, _IO_ssize_t));
-extern _IO_fpos_t _IO_file_seekoff __P ((_IO_FILE *, _IO_off_t, int, int));
+extern _IO_fpos64_t _IO_file_seekoff __P ((_IO_FILE *, _IO_off64_t, int, int));
extern _IO_size_t _IO_file_xsputn __P ((_IO_FILE *, const void *, _IO_size_t));
extern int _IO_file_stat __P ((_IO_FILE *, void *));
extern int _IO_file_close __P ((_IO_FILE *));
@@ -340,13 +357,14 @@ extern int _IO_file_overflow __P ((_IO_FILE *, int));
#define _IO_file_is_open(__fp) ((__fp)->_fileno >= 0)
extern void _IO_file_init __P ((_IO_FILE *));
extern _IO_FILE* _IO_file_attach __P ((_IO_FILE *, int));
-extern _IO_FILE* _IO_file_fopen __P ((_IO_FILE *, const char *, const char *));
+extern _IO_FILE* _IO_file_fopen __P ((_IO_FILE *, const char *, const char *,
+ int));
extern _IO_ssize_t _IO_file_write __P ((_IO_FILE *, const void *,
_IO_ssize_t));
extern _IO_ssize_t _IO_file_read __P ((_IO_FILE *, void *, _IO_ssize_t));
extern int _IO_file_sync __P ((_IO_FILE *));
extern int _IO_file_close_it __P ((_IO_FILE *));
-extern _IO_fpos_t _IO_file_seek __P ((_IO_FILE *, _IO_off_t, int));
+extern _IO_fpos64_t _IO_file_seek __P ((_IO_FILE *, _IO_off64_t, int));
extern void _IO_file_finish __P ((_IO_FILE *, int));
/* Jumptable functions for proc_files. */
@@ -357,7 +375,7 @@ extern int _IO_proc_close __P ((_IO_FILE *));
extern int _IO_str_underflow __P ((_IO_FILE *));
extern int _IO_str_overflow __P ((_IO_FILE *, int));
extern int _IO_str_pbackfail __P ((_IO_FILE *, int));
-extern _IO_fpos_t _IO_str_seekoff __P ((_IO_FILE *, _IO_off_t, int, int));
+extern _IO_fpos64_t _IO_str_seekoff __P ((_IO_FILE *, _IO_off64_t, int, int));
extern void _IO_str_finish __P ((_IO_FILE *, int));
/* Other strfile functions */
@@ -424,6 +442,7 @@ extern void (*_IO_cleanup_registration_needed) __P ((void));
/* When using this code in the GNU libc we must not pollute the name space. */
# define mmap __mmap
# define munmap __munmap
+# define ftruncate __ftruncate
# endif
# define ROUND_TO_PAGE(_S) \
@@ -459,31 +478,31 @@ extern void (*_IO_cleanup_registration_needed) __P ((void));
struct stat;
extern _IO_ssize_t _IO_read __P ((int, void *, _IO_size_t));
extern _IO_ssize_t _IO_write __P ((int, const void *, _IO_size_t));
-extern _IO_off_t _IO_lseek __P ((int, _IO_off_t, int));
+extern _IO_off64_t _IO_lseek __P ((int, _IO_off64_t, int));
extern int _IO_close __P ((int));
extern int _IO_fstat __P ((int, struct stat *));
extern int _IO_vscanf __P ((const char *, _IO_va_list));
-/* Operations on _IO_fpos_t.
+/* Operations on _IO_fpos64_t.
Normally, these are trivial, but we provide hooks for configurations
- where an _IO_fpos_t is a struct.
- Note that _IO_off_t must be an integral type. */
+ where an _IO_fpos64_t is a struct.
+ Note that _IO_off64_t must be an integral type. */
-/* _IO_pos_BAD is an _IO_fpos_t value indicating error, unknown, or EOF. */
+/* _IO_pos_BAD is an _IO_fpos64_t value indicating error, unknown, or EOF. */
#ifndef _IO_pos_BAD
-# define _IO_pos_BAD ((_IO_fpos_t) -1)
+# define _IO_pos_BAD ((_IO_fpos64_t) -1)
#endif
-/* _IO_pos_as_off converts an _IO_fpos_t value to an _IO_off_t value. */
+/* _IO_pos_as_off converts an _IO_fpos64_t value to an _IO_off64_t value. */
#ifndef _IO_pos_as_off
-# define _IO_pos_as_off(__pos) ((_IO_off_t) (__pos))
+# define _IO_pos_as_off(__pos) ((_IO_off64_t) (__pos))
#endif
-/* _IO_pos_adjust adjust an _IO_fpos_t by some number of bytes. */
+/* _IO_pos_adjust adjust an _IO_fpos64_t by some number of bytes. */
#ifndef _IO_pos_adjust
# define _IO_pos_adjust(__pos, __delta) ((__pos) += (__delta))
#endif
-/* _IO_pos_0 is an _IO_fpos_t value indicating beginning of file. */
+/* _IO_pos_0 is an _IO_fpos64_t value indicating beginning of file. */
#ifndef _IO_pos_0
-# define _IO_pos_0 ((_IO_fpos_t) 0)
+# define _IO_pos_0 ((_IO_fpos64_t) 0)
#endif
#ifdef __cplusplus
diff --git a/libio/memstream.c b/libio/memstream.c
index 7b9ccd3d37..71aab2f6ea 100644
--- a/libio/memstream.c
+++ b/libio/memstream.c
@@ -53,7 +53,9 @@ static const struct _IO_jump_t _IO_mem_jumps =
JUMP_INIT (write, _IO_default_write),
JUMP_INIT (seek, _IO_default_seek),
JUMP_INIT (close, _IO_default_close),
- JUMP_INIT (stat, _IO_default_stat)
+ JUMP_INIT (stat, _IO_default_stat),
+ JUMP_INIT(showmanyc, _IO_default_showmanyc),
+ JUMP_INIT(imbue, _IO_default_imbue)
};
/* Open a stream that writes into a malloc'd buffer that is expanded as
diff --git a/libio/obprintf.c b/libio/obprintf.c
index 6b959e455a..a0c4df6293 100644
--- a/libio/obprintf.c
+++ b/libio/obprintf.c
@@ -109,7 +109,9 @@ static struct _IO_jump_t _IO_obstack_jumps =
JUMP_INIT(write, NULL),
JUMP_INIT(seek, NULL),
JUMP_INIT(close, NULL),
- JUMP_INIT(stat, NULL)
+ JUMP_INIT(stat, NULL),
+ JUMP_INIT(showmanyc, NULL),
+ JUMP_INIT(imbue, NULL)
};
diff --git a/libio/stdio.h b/libio/stdio.h
index bbed294056..a835fed6cc 100644
--- a/libio/stdio.h
+++ b/libio/stdio.h
@@ -23,16 +23,16 @@
#ifndef _STDIO_H
#if !defined __need_FILE
-#define _STDIO_H 1
-#include <features.h>
+# define _STDIO_H 1
+# include <features.h>
__BEGIN_DECLS
-#define __need_size_t
-#define __need_NULL
-#include <stddef.h>
+# define __need_size_t
+# define __need_NULL
+# include <stddef.h>
-#include <bits/types.h>
+# include <bits/types.h>
#endif /* Don't need FILE. */
#undef __need_FILE
@@ -42,7 +42,7 @@ __BEGIN_DECLS
/* The opaque type of streams. */
typedef struct _IO_FILE FILE;
-#define __FILE_defined 1
+# define __FILE_defined 1
#endif /* FILE not defined. */
@@ -58,8 +58,14 @@ typedef struct _IO_FILE FILE;
#endif
/* The type of the second argument to `fgetpos' and `fsetpos'. */
+#ifndef __USE_FILE_OFFSET64
typedef _G_fpos_t fpos_t;
-
+#else
+typedef _G_fpos64_t fpos_t;
+#endif
+#ifdef __USE_LARGEFILE64
+typedef _G_fpos64_t fpos64_t;
+#endif
/* Generate a unique file name (and possibly open it with mode "w+b"). */
extern char *__stdio_gen_tempname __P ((char *__buf, size_t __bufsize,
@@ -67,7 +73,8 @@ extern char *__stdio_gen_tempname __P ((char *__buf, size_t __bufsize,
__const char *__pfx,
int __dir_search,
size_t *__lenptr,
- FILE **__streamptr));
+ FILE **__streamptr,
+ int __large_file));
/* Print out MESSAGE on the error output and abort. */
@@ -83,14 +90,14 @@ extern void __libc_fatal __P ((__const char *__message))
/* Default buffer size. */
#ifndef BUFSIZ
-#define BUFSIZ _IO_BUFSIZ
+# define BUFSIZ _IO_BUFSIZ
#endif
/* End of file character.
Some things throughout the library rely on this being -1. */
#ifndef EOF
-#define EOF (-1)
+# define EOF (-1)
#endif
@@ -103,7 +110,7 @@ extern void __libc_fatal __P ((__const char *__message))
#ifdef __USE_SVID
/* Default path prefix for `tempnam' and `tmpnam'. */
-#define P_tmpdir "/tmp"
+# define P_tmpdir "/tmp"
#endif
@@ -134,7 +141,14 @@ extern int rename __P ((__const char *__old, __const char *__new));
/* Create a temporary file and open it read/write. */
+#ifndef __USE_FILE_OFFSET64
extern FILE *tmpfile __P ((void));
+#else
+extern FILE *tmpfile __P ((void)) __asm__ ("tmpfile64");
+#endif
+#ifdef __USE_LARGEFILE64
+extern FILE *tmpfile64 __P ((void));
+#endif
/* Generate a temporary filename. */
extern char *tmpnam __P ((char *__s));
@@ -176,11 +190,30 @@ extern int fcloseall __P ((void));
/* Open a file and create a new stream for it. */
+#ifndef __USE_FILE_OFFSET64
extern FILE *fopen __P ((__const char *__filename, __const char *__modes));
+#else
+extern FILE *fopen __P ((__const char *__filename, __const char *__modes))
+ __asm__ ("fopen64");
+#endif
+#ifdef __USE_LARGEFILE64
+extern FILE *fopen64 __P ((__const char *__filename, __const char *__modes));
+#endif
/* Open a file, replacing an existing stream with it. */
+#ifndef __USE_FILE_OFFSET64
extern FILE *freopen __P ((__const char *__restrict __filename,
__const char *__restrict __modes,
FILE *__restrict __stream));
+#else
+extern FILE *freopen __P ((__const char *__restrict __filename,
+ __const char *__restrict __modes,
+ FILE *__restrict __stream)) __asm__ ("freopen64");
+#endif
+#ifdef __USE_LARGEFILE64
+extern FILE *freopen64 __P ((__const char *__restrict __filename,
+ __const char *__restrict __modes,
+ FILE *__restrict __stream));
+#endif
#ifdef __USE_POSIX
/* Create a new stream that refers to an existing system file descriptor. */
@@ -242,7 +275,7 @@ extern int vsprintf __P ((char *__restrict __s,
#ifdef __OPTIMIZE__
__STDIO_INLINE int
-vprintf (const char *__restrict __fmt, _G_va_list __arg)
+vprintf (__const char *__restrict __fmt, _G_va_list __arg)
{
return vfprintf (stdout, __fmt, __arg);
}
@@ -349,7 +382,7 @@ getchar (void)
extern int getc_unlocked __P ((FILE *__stream));
extern int getchar_unlocked __P ((void));
-#ifdef __OPTIMIZE__
+# ifdef __OPTIMIZE__
__STDIO_INLINE int
getc_unlocked (FILE *__fp)
{
@@ -361,7 +394,7 @@ getchar_unlocked (void)
{
return _IO_getc_unlocked (stdin);
}
-#endif /* Optimizing. */
+# endif /* Optimizing. */
#endif /* Use POSIX or MISC. */
@@ -388,13 +421,13 @@ putchar (int __c)
/* Faster version when locking is not necessary. */
extern int fputc_unlocked __P ((int __c, FILE *__stream));
-#ifdef __OPTIMIZE__
+# ifdef __OPTIMIZE__
__STDIO_INLINE int
fputc_unlocked (int __c, FILE *__stream)
{
return _IO_putc_unlocked (__c, __stream);
}
-#endif /* Optimizing. */
+# endif /* Optimizing. */
#endif /* Use MISC. */
#if defined __USE_POSIX || defined __USE_MISC
@@ -402,7 +435,7 @@ fputc_unlocked (int __c, FILE *__stream)
extern int putc_unlocked __P ((int __c, FILE *__stream));
extern int putchar_unlocked __P ((int __c));
-#ifdef __OPTIMIZE__
+# ifdef __OPTIMIZE__
__STDIO_INLINE int
putc_unlocked (int __c, FILE *__stream)
{
@@ -414,7 +447,7 @@ putchar_unlocked (int __c)
{
return _IO_putc_unlocked (__c, stdout);
}
-#endif /* Optimizing. */
+# endif /* Optimizing. */
#endif /* Use POSIX or MISc. */
@@ -451,13 +484,13 @@ _IO_ssize_t getdelim __P ((char **__lineptr, size_t *__n,
_IO_ssize_t __getline __P ((char **__lineptr, size_t *__n, FILE *__stream));
_IO_ssize_t getline __P ((char **__lineptr, size_t *__n, FILE *__stream));
-#ifdef __OPTIMIZE__
+# ifdef __OPTIMIZE__
__STDIO_INLINE _IO_ssize_t
getline (char **__lineptr, size_t *__n, FILE *__stream)
{
return __getdelim (__lineptr, __n, '\n', __stream);
}
-#endif /* Optimizing. */
+# endif /* Optimizing. */
#endif
@@ -496,22 +529,72 @@ extern long int ftell __P ((FILE *__stream));
/* Rewind to the beginning of STREAM. */
extern void rewind __P ((FILE *__stream));
-#ifdef __USE_UNIX98
+#if (defined __USE_LARGEFILE || defined __USE_LARGEFILE64 \
+ || defined __USE_FILE_OFFSET64)
/* The Single Unix Specification, Version 2, specifies an alternative,
more adequate interface for the two functions above which deal with
- file offset. `long int' is not the right type. */
+ file offset. `long int' is not the right type. These definitions
+ are originally defined in the Large File Support API. */
+
+/* Types needed in these functions. */
+# ifndef off_t
+# ifndef __USE_FILE_OFFSET64
+typedef __off_t off_t;
+# else
+typedef __off64_t off_t;
+# endif
+# define off_t off_t
+# endif
+
+# if defined __USE_LARGEFILE64 && !defined off64_t
+typedef __off64_t off64_t;
+# define off64_t off64_t
+# endif
/* Seek to a certain position on STREAM. */
+# ifndef __USE_FILE_OFFSET64
extern int fseeko __P ((FILE *__stream, __off_t __off, int __whence));
+# else
+extern int fseeko __P ((FILE *__stream, __off_t __off, int __whence))
+ __asm__ ("fseeko64");
+# endif
+# ifdef __USE_LARGEFILE64
+extern int fseeko64 __P ((FILE *__stream, __off64_t __off, int __whence));
+# endif
+
/* Return the current position of STREAM. */
+# ifndef __USE_FILE_OFFSET64
extern __off_t ftello __P ((FILE *__stream));
+# else
+extern __off_t ftello __P ((FILE *__stream)) __asm__ ("ftello");
+# endif
+# ifdef __USE_LARGEFILE64
+extern __off64_t ftello64 __P ((FILE *__stream));
+# endif
#endif
/* Get STREAM's position. */
+#ifndef __USE_FILE_OFFSET64
extern int fgetpos __P ((FILE *__restrict __stream,
fpos_t *__restrict __pos));
+#else
+extern int fgetpos __P ((FILE *__restrict __stream,
+ fpos_t *__restrict __pos)) __asm__ ("fgetpos64");
+#endif
+#ifdef __USE_LARGEFILE64
+extern int fgetpos64 __P ((FILE *__restrict __stream,
+ fpos64_t *__restrict __pos));
+#endif
/* Set STREAM's position. */
+#ifndef __USE_FILE_OFFSET64
extern int fsetpos __P ((FILE *__stream, __const fpos_t *__pos));
+#else
+extern int fsetpos __P ((FILE *__stream, __const fpos_t *__pos))
+ __asm__ ("fsetpos64");
+#endif
+#ifdef __USE_LARGEFILE64
+extern int fsetpos64 __P ((FILE *__stream, __const fpos64_t *__pos));
+#endif
/* Clear the error and EOF indicators for STREAM. */
@@ -527,7 +610,7 @@ extern void clearerr_unlocked __P ((FILE *__stream));
extern int feof_unlocked __P ((FILE *__stream));
extern int ferror_unlocked __P ((FILE *__stream));
-#ifdef __OPTIMIZE__
+# ifdef __OPTIMIZE__
__STDIO_INLINE int
feof_unlocked (FILE *__stream)
{
@@ -539,7 +622,7 @@ ferror_unlocked (FILE *__stream)
{
return _IO_ferror_unlocked (__stream);
}
-#endif /* Optimizing. */
+# endif /* Optimizing. */
#endif
diff --git a/libio/strops.c b/libio/strops.c
index a9f812e045..c596315b60 100644
--- a/libio/strops.c
+++ b/libio/strops.c
@@ -205,15 +205,15 @@ _IO_str_count (fp)
- fp->_IO_read_base);
}
-_IO_pos_t
+_IO_fpos64_t
_IO_str_seekoff (fp, offset, dir, mode)
_IO_FILE *fp;
- _IO_off_t offset;
+ _IO_off64_t offset;
int dir;
int mode;
{
_IO_ssize_t cur_size = _IO_str_count (fp);
- _IO_pos_t new_pos = EOF;
+ _IO_fpos64_t new_pos = EOF;
/* Move the get pointer, if requested. */
if (mode & _IOS_INPUT)
@@ -299,5 +299,7 @@ struct _IO_jump_t _IO_str_jumps =
JUMP_INIT(write, _IO_default_write),
JUMP_INIT(seek, _IO_default_seek),
JUMP_INIT(close, _IO_default_close),
- JUMP_INIT(stat, _IO_default_stat)
+ JUMP_INIT(stat, _IO_default_stat),
+ JUMP_INIT(showmanyc, _IO_default_showmanyc),
+ JUMP_INIT(imbue, _IO_default_imbue)
};
diff --git a/libio/vsnprintf.c b/libio/vsnprintf.c
index 3f35af299a..5ac2317579 100644
--- a/libio/vsnprintf.c
+++ b/libio/vsnprintf.c
@@ -94,7 +94,9 @@ static struct _IO_jump_t _IO_strn_jumps =
JUMP_INIT(write, _IO_default_write),
JUMP_INIT(seek, _IO_default_seek),
JUMP_INIT(close, _IO_default_close),
- JUMP_INIT(stat, _IO_default_stat)
+ JUMP_INIT(stat, _IO_default_stat),
+ JUMP_INIT(showmanyc, _IO_default_showmanyc),
+ JUMP_INIT(imbue, _IO_default_imbue)
};