mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-21 12:30:06 +00:00
Update.
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.
This commit is contained in:
parent
a5a0310d8e
commit
dfd2257ad9
580
ChangeLog
580
ChangeLog
@ -1,3 +1,583 @@
|
||||
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.
|
||||
|
||||
1997-09-30 18:03 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* Makerules: Undo last change.
|
||||
|
5
FAQ
5
FAQ
@ -192,7 +192,8 @@ Library.
|
||||
|
||||
* plenty of time (approx 1h for i?86-linux on i586@133 or 2.5h on
|
||||
i486@66 or 4.5h on i486@33), both for shared and static only).
|
||||
For Hurd systems times are much higher.
|
||||
Multiply this by 1.5 or 2.0 if you build profiling and/or the highly
|
||||
optimized version as well. For Hurd systems times are much higher.
|
||||
|
||||
For Atari Falcon (Motorola 68030 @ 16 Mhz, 14 Mb memory) James Troup
|
||||
<J.J.Troup@comp.brad.ac.uk> reports for a full build (shared, static,
|
||||
@ -438,7 +439,7 @@ programs and source code. Until this law gets abolished we cannot
|
||||
ship the cryptographic function together with the libc.
|
||||
|
||||
But of course we provide the code and there is an very easy way to use
|
||||
this code. First get the extra package. People in the US way get it
|
||||
this code. First get the extra package. People in the US may get it
|
||||
from the same place they got the GNU libc from. People outside the US
|
||||
should get the code from ftp://ftp.ifi.uio.no/pub/gnu, or another
|
||||
archive site outside the USA. The README explains how to install the
|
||||
|
@ -507,8 +507,9 @@ endif # $(+cflags) == ""
|
||||
# files (including ones given in angle brackets) in the current directory,
|
||||
# in the parent library source directory and in the include directory.
|
||||
# `+sysdep-includes' will be defined by Makerules.
|
||||
+includes = -I. $(patsubst %/,-I%,$(..)) -I$(..)include $($(stdio)-include) \
|
||||
$(includes) $(+sysdep-includes) $(last-includes)
|
||||
+includes = -I. $(patsubst %/,-I%,$(objpfx)) $(patsubst %/,-I%,$(..)) \
|
||||
-I$(..)include $($(stdio)-include) $(includes) \
|
||||
$(+sysdep-includes) $(last-includes)
|
||||
|
||||
# Since libio has several internal header files, we use a -I instead
|
||||
# of many little headers in the include directory.
|
||||
|
91
NOTES
91
NOTES
@ -5,7 +5,7 @@ Feature Test Macros
|
||||
is controlled by which "feature test macros" you define.
|
||||
|
||||
If you compile your programs using `gcc -ansi', you get only the
|
||||
ANSI C library features, unless you explicitly request additional
|
||||
ISO C library features, unless you explicitly request additional
|
||||
features by defining one or more of the feature macros. *Note GNU CC
|
||||
Command Options: (gcc.info)Invoking GCC, for more information about GCC
|
||||
options.
|
||||
@ -21,7 +21,7 @@ self-contained way.
|
||||
- Macro: _POSIX_SOURCE
|
||||
If you define this macro, then the functionality from the POSIX.1
|
||||
standard (IEEE Standard 1003.1) is available, as well as all of the
|
||||
ANSI C facilities.
|
||||
ISO C facilities.
|
||||
|
||||
- Macro: _POSIX_C_SOURCE
|
||||
If you define this macro with a value of `1', then the
|
||||
@ -29,11 +29,11 @@ self-contained way.
|
||||
made available. If you define this macro with a value of `2',
|
||||
then both the functionality from the POSIX.1 standard and the
|
||||
functionality from the POSIX.2 standard (IEEE Standard 1003.2) are
|
||||
made available. This is in addition to the ANSI C facilities.
|
||||
made available. This is in addition to the ISO C facilities.
|
||||
|
||||
- Macro: _BSD_SOURCE
|
||||
If you define this macro, functionality derived from 4.3 BSD Unix
|
||||
is included as well as the ANSI C, POSIX.1, and POSIX.2 material.
|
||||
is included as well as the ISO C, POSIX.1, and POSIX.2 material.
|
||||
|
||||
Some of the features derived from 4.3 BSD Unix conflict with the
|
||||
corresponding features specified by the POSIX.1 standard. If this
|
||||
@ -53,26 +53,86 @@ self-contained way.
|
||||
|
||||
- Macro: _SVID_SOURCE
|
||||
If you define this macro, functionality derived from SVID is
|
||||
included as well as the ANSI C, POSIX.1, POSIX.2, and X/Open
|
||||
included as well as the ISO C, POSIX.1, POSIX.2, and X/Open
|
||||
material.
|
||||
|
||||
- Macro: _XOPEN_SOURCE
|
||||
If you define these macro, functionality described in the X/Open
|
||||
Portability Guide is included. This is an superset of the POSIX.1
|
||||
- Macro: _XOPEN_SOURCE_EXTENDED
|
||||
If you define this macro, functionality described in the X/Open
|
||||
Portability Guide is included. This is a superset of the POSIX.1
|
||||
and POSIX.2 functionality and in fact `_POSIX_SOURCE' and
|
||||
`_POSIX_C_SOURCE' get automatically be defined.
|
||||
`_POSIX_C_SOURCE' are automatically defined.
|
||||
|
||||
But as the great unifaction of all Unices there is also
|
||||
functionality only available in BSD and SVID is included.
|
||||
As the unification of all Unices, functionality only available in
|
||||
BSD and SVID is also included.
|
||||
|
||||
If the macro `_XOPEN_SOURCE_EXTENDED' is also defined, even more
|
||||
functionality is available. The extra functions will make all
|
||||
functions available which are necessary for the X/Open Unix brand.
|
||||
|
||||
If the macro `_XOPEN_SOURCE' has the value 500 this includes all
|
||||
functionality described so far plus some new definitions from the
|
||||
Single Unix specification, version 2.
|
||||
|
||||
- Macro: _LARGEFILE_SOURCE
|
||||
If this macro is defined some extra functions are available which
|
||||
rectify a few shortcomings in all previous standards. More
|
||||
concreten the functions `fseeko' and `ftello' are available.
|
||||
Without these functions the difference between the ISO C interface
|
||||
(`fseek', `ftell') and the low-level POSIX interface (`lseek')
|
||||
would lead to problems.
|
||||
|
||||
This macro was introduced as part of the Large File Support
|
||||
extension (LFS).
|
||||
|
||||
- Variable: Macro _LARGEFILE64_SOURCE
|
||||
If you define this macro an additional set of function gets
|
||||
available which enables to use on 32 bit systems to use files of
|
||||
sizes beyond the usual limit of 2GB. This interface is not
|
||||
available if the system does not support files that large. On
|
||||
systems where the natural file size limit is greater than 2GB
|
||||
(i.e., on 64 bit systems) the new functions are identical to the
|
||||
replaced functions.
|
||||
|
||||
The new functionality is made available by a new set of types and
|
||||
functions which replace existing. The names of these new objects
|
||||
contain `64' to indicate the intention, e.g., `off_t' vs.
|
||||
`off64_t' and `fseeko' vs. `fseeko64'.
|
||||
|
||||
This macro was introduced as part of the Large File Support
|
||||
extension (LFS). It is a transition interface for the time 64 bit
|
||||
offsets are not generally used (see `_FILE_OFFSET_BITS'.
|
||||
|
||||
- Variable: _FILE_OFFSET_BITS
|
||||
This macro lets decide which file system interface shall be used,
|
||||
one replacing the other. While `_LARGEFILE64_SOURCE' makes the
|
||||
64 bit interface available as an additional interface
|
||||
`_FILE_OFFSET_BITS' allows to use the 64 bit interface to replace
|
||||
the old interface.
|
||||
|
||||
If `_FILE_OFFSET_BITS' is undefined or if it is defined to the
|
||||
value `32' nothing changes. The 32 bit interface is used and
|
||||
types like `off_t' have a size of 32 bits on 32 bit systems.
|
||||
|
||||
If the macro is defined to the value `64' the large file interface
|
||||
replaces the old interface. I.e., the functions are not made
|
||||
available under different names as `_LARGEFILE64_SOURCE' does.
|
||||
Instead the old function names now reference the new functions,
|
||||
e.g., a call to `fseeko' now indeed calls `fseeko64'.
|
||||
|
||||
This macro should only be selected if the system provides
|
||||
mechanisms for handling large files. On 64 bit systems this macro
|
||||
has no effect since the `*64' functions are identical to the
|
||||
normal functions.
|
||||
|
||||
This macro was introduced as part of the Large File Support
|
||||
extension (LFS).
|
||||
|
||||
- Macro: _GNU_SOURCE
|
||||
If you define this macro, everything is included: ANSI C, POSIX.1,
|
||||
POSIX.2, BSD, SVID, X/Open, and GNU extensions. In the cases where
|
||||
POSIX.1 conflicts with BSD, the POSIX definitions take precedence.
|
||||
If you define this macro, everything is included: ISO C, POSIX.1,
|
||||
POSIX.2, BSD, SVID, X/Open, LFS, and GNU extensions. In the cases
|
||||
where POSIX.1 conflicts with BSD, the POSIX definitions take
|
||||
precedence.
|
||||
|
||||
If you want to get the full effect of `_GNU_SOURCE' but make the
|
||||
BSD definitions take precedence over the POSIX definitions, use
|
||||
@ -87,8 +147,9 @@ self-contained way.
|
||||
compiler or linker. *Note:* If you forget to do this, you may get
|
||||
very strange errors at run time.
|
||||
|
||||
- Macro: _REENTRANT,_THREAD_SAFE
|
||||
If you define one this macro, reentrant versions of several
|
||||
- Macro: _REENTRANT
|
||||
- Macro: _THREAD_SAFE
|
||||
If you define one of these macros, reentrant versions of several
|
||||
functions get declared. Some of the functions are specified in
|
||||
POSIX.1c but many others are only available on a few other systems
|
||||
or are unique to GNU libc. The problem is that the
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* `sysconf', `pathconf', and `confstr' NAME values. Generic version.
|
||||
Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -97,7 +97,7 @@ enum
|
||||
_SC_SHARED_MEMORY_OBJECTS,
|
||||
#define _SC_SHARED_MEMORY_OBJECTS _SC_SHARED_MEMORY_OBJECTS
|
||||
_SC_AIO_LISTIO_MAX,
|
||||
#define _SC_AIO_LIST_MAX _SC_AIO_LIST_MAX
|
||||
#define _SC_AIO_LISTIO_MAX _SC_AIO_LISTIO_MAX
|
||||
_SC_AIO_MAX,
|
||||
#define _SC_AIO_MAX _SC_AIO_MAX
|
||||
_SC_AIO_PRIO_DELTA_MAX,
|
||||
@ -316,10 +316,32 @@ enum
|
||||
#define _SC_NL_TEXTMAX _SC_NL_TEXTMAX
|
||||
};
|
||||
|
||||
#ifdef __USE_POSIX2
|
||||
#if (defined __USE_POSIX2 || defined __USE_FILE_OFFSET64 \
|
||||
|| defined __USE_LARGEFILE64 || defined __USE_LARGEFILE)
|
||||
/* Values for the NAME argument to `confstr'. */
|
||||
enum
|
||||
{
|
||||
_CS_PATH /* The default search path. */
|
||||
_CS_PATH, /* The default search path. */
|
||||
#define _CS_PATH _CS_PATH
|
||||
|
||||
#if (defined __USE_FILE_OFFSET64 || defined __USE_LARGEFILE64 \
|
||||
|| defined __USE_LARGEFILE)
|
||||
_CS_LFS_CFLAGS = 1000,
|
||||
# define _CS_LFS_CFLAGS _CS_LFS_CFLAGS
|
||||
_CS_LFS_LDFLAGS,
|
||||
# define _CS_LFS_LDFLAGS _CS_LFS_LDFLAGS
|
||||
_CS_LFS_LIBS,
|
||||
# define _CS_LFS_LIBS _CS_LFS_LIBS
|
||||
_CS_LFS_LINTFLAGS,
|
||||
# define _CS_LFS_LINTFLAGS _CS_LFS_LINTFLAGS
|
||||
_CS_LFS64_CFLAGS,
|
||||
# define _CS_LFS64_CFLAGS _CS_LFS64_CFLAGS
|
||||
_CS_LFS64_LDFLAGS,
|
||||
# define _CS_LFS64_LDFLAGS _CS_LFS64_LDFLAGS
|
||||
_CS_LFS64_LIBS,
|
||||
# define _CS_LFS64_LIBS _CS_LFS64_LIBS
|
||||
_CS_LFS64_LINTFLAGS
|
||||
# define _CS_LFS64_LINTFLAGS _CS_LFS64_LINTFLAGS
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Bit values & structures for resource limits. 4.4 BSD/generic GNU version.
|
||||
Copyright (C) 1994, 1996 Free Software Foundation, Inc.
|
||||
Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -65,14 +65,34 @@ enum __rlimit_resource
|
||||
#define RLIM_INFINITY RLIM_INFINITY
|
||||
};
|
||||
|
||||
/* Type for resource quantity measurement. */
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
typedef __rlim_t rlim_t;
|
||||
#else
|
||||
typedef __rlim64_t rlim_t;
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
typedef __rlim64_t rlim64_t;
|
||||
#endif
|
||||
|
||||
struct rlimit
|
||||
{
|
||||
/* The current (soft) limit. */
|
||||
int rlim_cur;
|
||||
rlim_t rlim_cur;
|
||||
/* The hard limit. */
|
||||
int rlim_max;
|
||||
rlim_t rlim_max;
|
||||
};
|
||||
|
||||
#ifdef __USE_LARGEFILE64
|
||||
struct rlimit64
|
||||
{
|
||||
/* The current (soft) limit. */
|
||||
rlim64_t rlim_cur;
|
||||
/* The hard limit. */
|
||||
rlim64_t rlim_max;
|
||||
};
|
||||
#endif
|
||||
|
||||
/* Whose usage statistics do you want? */
|
||||
enum __rusage_who
|
||||
/* The macro definitions are necessary because some programs want
|
||||
|
@ -38,11 +38,11 @@ struct statfs
|
||||
{
|
||||
unsigned int f_type;
|
||||
unsigned int f_bsize;
|
||||
unsigned int f_blocks;
|
||||
unsigned int f_bfree;
|
||||
unsigned int f_bavail;
|
||||
unsigned int f_files;
|
||||
unsigned int f_ffree;
|
||||
__fsblkcnt_t f_blocks;
|
||||
__fsblkcnt_t f_bfree;
|
||||
__fsblkcnt_t f_bavail;
|
||||
__fsblkcnt_t f_files;
|
||||
__fsblkcnt_t f_ffree;
|
||||
__fsid_t f_fsid;
|
||||
unsigned int f_namelen;
|
||||
unsigned int f_spare[6];
|
||||
|
17
bits/types.h
17
bits/types.h
@ -65,6 +65,8 @@ typedef int __pid_t; /* Type of process identifications. */
|
||||
typedef int __ssize_t; /* Type of a byte count, or error. */
|
||||
typedef __u_quad_t __fsid_t; /* Type of file system IDs. */
|
||||
typedef long int __clock_t; /* Type of CPU usage counts. */
|
||||
typedef long int __rlim_t; /* Type for resource measurement. */
|
||||
typedef __quad_t __rlim64_t; /* Type for resource measurement (LFS). */
|
||||
|
||||
/* Everythin' else. */
|
||||
typedef long int __daddr_t; /* The type of a disk address. */
|
||||
@ -91,4 +93,19 @@ typedef struct
|
||||
|
||||
typedef unsigned long int __fd_mask;
|
||||
|
||||
|
||||
/* Types from the Large File Support interface. */
|
||||
|
||||
/* Type to count number os disk blocks. */
|
||||
typedef long int __blkcnt_t;
|
||||
typedef __quad_t __blkcnt64_t;
|
||||
|
||||
/* Type to count file system blocks. */
|
||||
typedef unsigned int __fsblkcnt_t;
|
||||
typedef __u_quad_t __fsblkcnt64_t;
|
||||
|
||||
/* Type to count file system inodes. */
|
||||
typedef unsigned long int __fsfilcnt_t;
|
||||
typedef __u_quad_t __fsfilcnt64_t;
|
||||
|
||||
#endif /* bits/types.h */
|
||||
|
11
config.h.in
11
config.h.in
@ -52,6 +52,17 @@
|
||||
/* Define if gcc uses DWARF2 unwind information for exception support. */
|
||||
#undef HAVE_DWARF2_UNWIND_INFO
|
||||
|
||||
/* Define is the regparm attribute shall be used for local functions
|
||||
(gcc on ix86 only). */
|
||||
#undef USE_REGPARMS
|
||||
|
||||
|
||||
/* Defined to some form of __attribute__ ((...)) if the compiler supports
|
||||
a different, more efficient calling convention. */
|
||||
#ifdef USE_REGPARMS
|
||||
# define internal_function __attribute__ ((regparm (3), stdcall))
|
||||
#endif
|
||||
|
||||
/*
|
||||
*/
|
||||
|
||||
|
136
configure
vendored
136
configure
vendored
@ -863,11 +863,18 @@ sparc64 | ultrasparc)
|
||||
esac
|
||||
|
||||
|
||||
if test "$base_machine" = "i386"; then
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define USE_REGPARMS 1
|
||||
EOF
|
||||
|
||||
fi
|
||||
|
||||
# Compute the list of sysdep directories for this configuration.
|
||||
# This can take a while to compute.
|
||||
sysdep_dir=$srcdir/sysdeps
|
||||
echo $ac_n "checking sysdep dirs""... $ac_c" 1>&6
|
||||
echo "configure:871: checking sysdep dirs" >&5
|
||||
echo "configure:878: checking sysdep dirs" >&5
|
||||
# Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1.
|
||||
os="`echo $os | sed 's/\([0-9A-Z]\)[v_]\([0-9A-Z]\)/\1.\2/g'`"
|
||||
|
||||
@ -1068,7 +1075,7 @@ echo "$ac_t""sysdeps/generic sysdeps/stub" 1>&6
|
||||
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
|
||||
# ./install, which can be erroneously created by make from ./install.sh.
|
||||
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
|
||||
echo "configure:1072: checking for a BSD compatible install" >&5
|
||||
echo "configure:1079: checking for a BSD compatible install" >&5
|
||||
if test -z "$INSTALL"; then
|
||||
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
@ -1122,7 +1129,7 @@ if test "$INSTALL" = "${srcdir}/install-sh -c"; then
|
||||
INSTALL='\$(..)./install-sh -c'
|
||||
fi
|
||||
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
|
||||
echo "configure:1126: checking whether ln -s works" >&5
|
||||
echo "configure:1133: checking whether ln -s works" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1147,7 +1154,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1151: checking for $ac_word" >&5
|
||||
echo "configure:1158: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_MSGFMT'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1180,7 +1187,7 @@ test -n "$MSGFMT" || MSGFMT=":"
|
||||
# Extract the first word of "gcc", so it can be a program name with args.
|
||||
set dummy gcc; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1184: checking for $ac_word" >&5
|
||||
echo "configure:1191: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1209,7 +1216,7 @@ if test -z "$CC"; then
|
||||
# Extract the first word of "cc", so it can be a program name with args.
|
||||
set dummy cc; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1213: checking for $ac_word" >&5
|
||||
echo "configure:1220: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1257,7 +1264,7 @@ fi
|
||||
fi
|
||||
|
||||
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
|
||||
echo "configure:1261: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
|
||||
echo "configure:1268: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
|
||||
|
||||
ac_ext=c
|
||||
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
|
||||
@ -1267,11 +1274,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS
|
||||
cross_compiling=$ac_cv_prog_cc_cross
|
||||
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1271 "configure"
|
||||
#line 1278 "configure"
|
||||
#include "confdefs.h"
|
||||
main(){return(0);}
|
||||
EOF
|
||||
if { (eval echo configure:1275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:1282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
ac_cv_prog_cc_works=yes
|
||||
# If we can't run a trivial program, we are probably using a cross compiler.
|
||||
if (./conftest; exit) 2>/dev/null; then
|
||||
@ -1294,13 +1301,13 @@ else
|
||||
cross_linkable=yes
|
||||
fi
|
||||
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
|
||||
echo "configure:1298: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
|
||||
echo "configure:1305: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
|
||||
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
|
||||
|
||||
cross_compiling=$ac_cv_prog_cc_cross
|
||||
|
||||
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
|
||||
echo "configure:1304: checking whether we are using GNU C" >&5
|
||||
echo "configure:1311: checking whether we are using GNU C" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1309,7 +1316,7 @@ else
|
||||
yes;
|
||||
#endif
|
||||
EOF
|
||||
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1313: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1320: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
ac_cv_prog_gcc=yes
|
||||
else
|
||||
ac_cv_prog_gcc=no
|
||||
@ -1326,7 +1333,7 @@ if test $ac_cv_prog_gcc = yes; then
|
||||
yes;
|
||||
#endif
|
||||
EOF
|
||||
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1330: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1337: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
if test -z "$CFLAGS"; then
|
||||
CFLAGS="-g -O2"
|
||||
fi
|
||||
@ -1338,7 +1345,7 @@ else
|
||||
fi
|
||||
|
||||
echo $ac_n "checking build system type""... $ac_c" 1>&6
|
||||
echo "configure:1342: checking build system type" >&5
|
||||
echo "configure:1349: checking build system type" >&5
|
||||
|
||||
build_alias=$build
|
||||
case "$build_alias" in
|
||||
@ -1361,7 +1368,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1365: checking for $ac_word" >&5
|
||||
echo "configure:1372: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_BUILD_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1392,7 +1399,7 @@ done
|
||||
fi
|
||||
|
||||
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
|
||||
echo "configure:1396: checking how to run the C preprocessor" >&5
|
||||
echo "configure:1403: checking how to run the C preprocessor" >&5
|
||||
# On Suns, sometimes $CPP names a directory.
|
||||
if test -n "$CPP" && test -d "$CPP"; then
|
||||
CPP=
|
||||
@ -1407,13 +1414,13 @@ else
|
||||
# On the NeXT, cc -E runs the code through the compiler's parser,
|
||||
# not just through cpp.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1411 "configure"
|
||||
#line 1418 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1417: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1424: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
@ -1424,13 +1431,13 @@ else
|
||||
rm -rf conftest*
|
||||
CPP="${CC-cc} -E -traditional-cpp"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1428 "configure"
|
||||
#line 1435 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1434: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1441: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
@ -1463,7 +1470,7 @@ LD=`$CC -print-file-name=ld`
|
||||
|
||||
# Determine whether we are using GNU binutils.
|
||||
echo $ac_n "checking whether $AS is GNU as""... $ac_c" 1>&6
|
||||
echo "configure:1467: checking whether $AS is GNU as" >&5
|
||||
echo "configure:1474: checking whether $AS is GNU as" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_prog_as_gnu'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1481,7 +1488,7 @@ rm -f a.out
|
||||
gnu_as=$libc_cv_prog_as_gnu
|
||||
|
||||
echo $ac_n "checking whether $LD is GNU ld""... $ac_c" 1>&6
|
||||
echo "configure:1485: checking whether $LD is GNU ld" >&5
|
||||
echo "configure:1492: checking whether $LD is GNU ld" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_prog_ld_gnu'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1505,7 +1512,7 @@ fi
|
||||
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
|
||||
set dummy ${ac_tool_prefix}ar; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1509: checking for $ac_word" >&5
|
||||
echo "configure:1516: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1536,7 +1543,7 @@ fi
|
||||
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
|
||||
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1540: checking for $ac_word" >&5
|
||||
echo "configure:1547: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1567,7 +1574,7 @@ if test -n "$ac_tool_prefix"; then
|
||||
# Extract the first word of "ranlib", so it can be a program name with args.
|
||||
set dummy ranlib; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1571: checking for $ac_word" >&5
|
||||
echo "configure:1578: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1602,7 +1609,7 @@ fi
|
||||
# Extract the first word of "bash", so it can be a program name with args.
|
||||
set dummy bash; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1606: checking for $ac_word" >&5
|
||||
echo "configure:1613: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_BASH'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1643,7 +1650,7 @@ if test "$BASH" = no; then
|
||||
# Extract the first word of "ksh", so it can be a program name with args.
|
||||
set dummy ksh; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1647: checking for $ac_word" >&5
|
||||
echo "configure:1654: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_KSH'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1689,7 +1696,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1693: checking for $ac_word" >&5
|
||||
echo "configure:1700: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1724,7 +1731,7 @@ test -n "$PERL" || PERL="no"
|
||||
|
||||
|
||||
echo $ac_n "checking for signed size_t type""... $ac_c" 1>&6
|
||||
echo "configure:1728: checking for signed size_t type" >&5
|
||||
echo "configure:1735: checking for signed size_t type" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_signed_size_t'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1748,12 +1755,12 @@ EOF
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for libc-friendly stddef.h""... $ac_c" 1>&6
|
||||
echo "configure:1752: checking for libc-friendly stddef.h" >&5
|
||||
echo "configure:1759: checking for libc-friendly stddef.h" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_friendly_stddef'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1757 "configure"
|
||||
#line 1764 "configure"
|
||||
#include "confdefs.h"
|
||||
#define __need_size_t
|
||||
#define __need_wchar_t
|
||||
@ -1768,7 +1775,7 @@ size_t size; wchar_t wchar;
|
||||
if (&size == NULL || &wchar == NULL) abort ();
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1772: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1779: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
libc_cv_friendly_stddef=yes
|
||||
else
|
||||
@ -1787,7 +1794,7 @@ override stddef.h = # The installed <stddef.h> seems to be libc-friendly."
|
||||
fi
|
||||
|
||||
echo $ac_n "checking whether we need to use -P to assemble .S files""... $ac_c" 1>&6
|
||||
echo "configure:1791: checking whether we need to use -P to assemble .S files" >&5
|
||||
echo "configure:1798: checking whether we need to use -P to assemble .S files" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_need_minus_P'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1810,7 +1817,7 @@ asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives."
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for assembler global-symbol directive""... $ac_c" 1>&6
|
||||
echo "configure:1814: checking for assembler global-symbol directive" >&5
|
||||
echo "configure:1821: checking for assembler global-symbol directive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_global_directive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1840,7 +1847,7 @@ EOF
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for .set assembler directive""... $ac_c" 1>&6
|
||||
echo "configure:1844: checking for .set assembler directive" >&5
|
||||
echo "configure:1851: checking for .set assembler directive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_set_directive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1874,7 +1881,7 @@ EOF
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for .symver assembler directive""... $ac_c" 1>&6
|
||||
echo "configure:1878: checking for .symver assembler directive" >&5
|
||||
echo "configure:1885: checking for .symver assembler directive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_symver_directive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1893,7 +1900,7 @@ fi
|
||||
|
||||
echo "$ac_t""$libc_cv_asm_symver_directive" 1>&6
|
||||
echo $ac_n "checking for ld --version-script""... $ac_c" 1>&6
|
||||
echo "configure:1897: checking for ld --version-script" >&5
|
||||
echo "configure:1904: checking for ld --version-script" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_ld_version_script_option'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1912,7 +1919,7 @@ EOF
|
||||
if { ac_try='${CC-cc} $CFLAGS -shared -o conftest.so conftest.o
|
||||
-nostartfiles -nostdlib
|
||||
-Wl,--version-script,conftest.map
|
||||
1>&5'; { (eval echo configure:1916: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; };
|
||||
1>&5'; { (eval echo configure:1923: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; };
|
||||
then
|
||||
libc_cv_ld_version_script_option=yes
|
||||
else
|
||||
@ -1943,7 +1950,7 @@ fi
|
||||
|
||||
if test $elf = yes; then
|
||||
echo $ac_n "checking for .previous assembler directive""... $ac_c" 1>&6
|
||||
echo "configure:1947: checking for .previous assembler directive" >&5
|
||||
echo "configure:1954: checking for .previous assembler directive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_previous_directive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1951,7 +1958,7 @@ else
|
||||
.section foo_section
|
||||
.previous
|
||||
EOF
|
||||
if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:1955: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:1962: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
libc_cv_asm_previous_directive=yes
|
||||
else
|
||||
libc_cv_asm_previous_directive=no
|
||||
@ -1967,7 +1974,7 @@ EOF
|
||||
|
||||
else
|
||||
echo $ac_n "checking for .popsection assembler directive""... $ac_c" 1>&6
|
||||
echo "configure:1971: checking for .popsection assembler directive" >&5
|
||||
echo "configure:1978: checking for .popsection assembler directive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_popsection_directive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1975,7 +1982,7 @@ else
|
||||
.pushsection foo_section
|
||||
.popsection
|
||||
EOF
|
||||
if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:1979: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:1986: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
libc_cv_asm_popsection_directive=yes
|
||||
else
|
||||
libc_cv_asm_popsection_directive=no
|
||||
@ -1995,12 +2002,12 @@ fi
|
||||
|
||||
if test $elf != yes; then
|
||||
echo $ac_n "checking for .init and .fini sections""... $ac_c" 1>&6
|
||||
echo "configure:1999: checking for .init and .fini sections" >&5
|
||||
echo "configure:2006: checking for .init and .fini sections" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_have_initfini'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2004 "configure"
|
||||
#line 2011 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() {
|
||||
@ -2009,7 +2016,7 @@ asm (".section .init");
|
||||
asm (".text");
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:2013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:2020: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
libc_cv_have_initfini=yes
|
||||
else
|
||||
@ -2037,19 +2044,19 @@ if test $elf = yes; then
|
||||
else
|
||||
if test $ac_cv_prog_cc_works = yes; then
|
||||
echo $ac_n "checking for _ prefix on C symbol names""... $ac_c" 1>&6
|
||||
echo "configure:2041: checking for _ prefix on C symbol names" >&5
|
||||
echo "configure:2048: checking for _ prefix on C symbol names" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_underscores'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2046 "configure"
|
||||
#line 2053 "configure"
|
||||
#include "confdefs.h"
|
||||
asm ("_glibc_foobar:");
|
||||
int main() {
|
||||
glibc_foobar ();
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:2053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:2060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
libc_cv_asm_underscores=yes
|
||||
else
|
||||
@ -2064,17 +2071,17 @@ fi
|
||||
echo "$ac_t""$libc_cv_asm_underscores" 1>&6
|
||||
else
|
||||
echo $ac_n "checking for _ prefix on C symbol names""... $ac_c" 1>&6
|
||||
echo "configure:2068: checking for _ prefix on C symbol names" >&5
|
||||
echo "configure:2075: checking for _ prefix on C symbol names" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_underscores'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2073 "configure"
|
||||
#line 2080 "configure"
|
||||
#include "confdefs.h"
|
||||
void underscore_test(void) {
|
||||
return; }
|
||||
EOF
|
||||
if { (eval echo configure:2078: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:2085: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if grep _underscore_test conftest* >/dev/null; then
|
||||
rm -f conftest*
|
||||
libc_cv_asm_underscores=yes
|
||||
@ -2107,7 +2114,7 @@ if test $elf = yes; then
|
||||
libc_cv_asm_weakext_directive=no
|
||||
else
|
||||
echo $ac_n "checking for assembler .weak directive""... $ac_c" 1>&6
|
||||
echo "configure:2111: checking for assembler .weak directive" >&5
|
||||
echo "configure:2118: checking for assembler .weak directive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_weak_directive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2130,7 +2137,7 @@ echo "$ac_t""$libc_cv_asm_weak_directive" 1>&6
|
||||
|
||||
if test $libc_cv_asm_weak_directive = no; then
|
||||
echo $ac_n "checking for assembler .weakext directive""... $ac_c" 1>&6
|
||||
echo "configure:2134: checking for assembler .weakext directive" >&5
|
||||
echo "configure:2141: checking for assembler .weakext directive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_weakext_directive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2167,7 +2174,7 @@ EOF
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for ld --no-whole-archive""... $ac_c" 1>&6
|
||||
echo "configure:2171: checking for ld --no-whole-archive" >&5
|
||||
echo "configure:2178: checking for ld --no-whole-archive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_ld_no_whole_archive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2178,7 +2185,7 @@ __throw () {}
|
||||
EOF
|
||||
if { ac_try='${CC-cc} $CFLAGS
|
||||
-nostdlib -nostartfiles -Wl,--no-whole-archive
|
||||
-o conftest conftest.c 1>&5'; { (eval echo configure:2182: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
-o conftest conftest.c 1>&5'; { (eval echo configure:2189: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
libc_cv_ld_no_whole_archive=yes
|
||||
else
|
||||
libc_cv_ld_no_whole_archive=no
|
||||
@ -2189,7 +2196,7 @@ fi
|
||||
echo "$ac_t""$libc_cv_ld_no_whole_archive" 1>&6
|
||||
|
||||
echo $ac_n "checking for gcc -fno-exceptions""... $ac_c" 1>&6
|
||||
echo "configure:2193: checking for gcc -fno-exceptions" >&5
|
||||
echo "configure:2200: checking for gcc -fno-exceptions" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_gcc_no_exceptions'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2200,7 +2207,7 @@ __throw () {}
|
||||
EOF
|
||||
if { ac_try='${CC-cc} $CFLAGS
|
||||
-nostdlib -nostartfiles -fno-exceptions
|
||||
-o conftest conftest.c 1>&5'; { (eval echo configure:2204: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
-o conftest conftest.c 1>&5'; { (eval echo configure:2211: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
libc_cv_gcc_no_exceptions=yes
|
||||
else
|
||||
libc_cv_gcc_no_exceptions=no
|
||||
@ -2211,12 +2218,12 @@ fi
|
||||
echo "$ac_t""$libc_cv_gcc_no_exceptions" 1>&6
|
||||
|
||||
echo $ac_n "checking for DWARF2 unwind info support""... $ac_c" 1>&6
|
||||
echo "configure:2215: checking for DWARF2 unwind info support" >&5
|
||||
echo "configure:2222: checking for DWARF2 unwind info support" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_gcc_dwarf2_unwind_info'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.c <<EOF
|
||||
#line 2220 "configure"
|
||||
#line 2227 "configure"
|
||||
static char __EH_FRAME_BEGIN__;
|
||||
_start ()
|
||||
{
|
||||
@ -2233,10 +2240,11 @@ memcpy () {}
|
||||
memset () {}
|
||||
free () {}
|
||||
abort () {}
|
||||
__bzero () {}
|
||||
EOF
|
||||
if { ac_try='${CC-cc} $CFLAGS
|
||||
-nostdlib -nostartfiles
|
||||
-o conftest conftest.c -lgcc >&5'; { (eval echo configure:2240: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
-o conftest conftest.c -lgcc >&5'; { (eval echo configure:2248: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
libc_cv_gcc_dwarf2_unwind_info=yes
|
||||
else
|
||||
libc_cv_gcc_dwarf2_unwind_info=no
|
||||
@ -2294,7 +2302,7 @@ if test "$uname" = "sysdeps/generic"; then
|
||||
fi
|
||||
|
||||
echo $ac_n "checking OS release for uname""... $ac_c" 1>&6
|
||||
echo "configure:2298: checking OS release for uname" >&5
|
||||
echo "configure:2306: checking OS release for uname" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_uname_release'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2316,7 +2324,7 @@ echo "$ac_t""$libc_cv_uname_release" 1>&6
|
||||
uname_release="$libc_cv_uname_release"
|
||||
|
||||
echo $ac_n "checking OS version for uname""... $ac_c" 1>&6
|
||||
echo "configure:2320: checking OS version for uname" >&5
|
||||
echo "configure:2328: checking OS version for uname" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_uname_version'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2338,7 +2346,7 @@ else
|
||||
fi
|
||||
|
||||
echo $ac_n "checking stdio selection""... $ac_c" 1>&6
|
||||
echo "configure:2342: checking stdio selection" >&5
|
||||
echo "configure:2350: checking stdio selection" >&5
|
||||
|
||||
case $stdio in
|
||||
libio) cat >> confdefs.h <<\EOF
|
||||
@ -2350,7 +2358,7 @@ esac
|
||||
echo "$ac_t""$stdio" 1>&6
|
||||
|
||||
echo $ac_n "checking ldap selection""... $ac_c" 1>&6
|
||||
echo "configure:2354: checking ldap selection" >&5
|
||||
echo "configure:2362: checking ldap selection" >&5
|
||||
|
||||
case $add_ons in
|
||||
*ldap*)
|
||||
|
@ -193,6 +193,10 @@ esac
|
||||
changequote([,])dnl
|
||||
AC_SUBST(base_machine)
|
||||
|
||||
if test "$base_machine" = "i386"; then
|
||||
AC_DEFINE(USE_REGPARMS)
|
||||
fi
|
||||
|
||||
# Compute the list of sysdep directories for this configuration.
|
||||
# This can take a while to compute.
|
||||
sysdep_dir=$srcdir/sysdeps
|
||||
@ -779,6 +783,7 @@ memcpy () {}
|
||||
memset () {}
|
||||
free () {}
|
||||
abort () {}
|
||||
__bzero () {}
|
||||
EOF
|
||||
dnl No \ in command here because it ends up inside ''.
|
||||
if AC_TRY_COMMAND([${CC-cc} $CFLAGS
|
||||
|
@ -37,12 +37,12 @@ __BEGIN_DECLS
|
||||
endian). We define the bit value interpretations here dependent on the
|
||||
machine's byte order. */
|
||||
|
||||
#include <endian.h>
|
||||
#if __BYTE_ORDER == __BIG_ENDIAN
|
||||
#define _ISbit(bit) (1 << bit)
|
||||
#else /* __BYTE_ORDER == __LITTLE_ENDIAN */
|
||||
#define _ISbit(bit) (bit < 8 ? ((1 << bit) << 8) : ((1 << bit) >> 8))
|
||||
#endif
|
||||
# include <endian.h>
|
||||
# if __BYTE_ORDER == __BIG_ENDIAN
|
||||
# define _ISbit(bit) (1 << bit)
|
||||
# else /* __BYTE_ORDER == __LITTLE_ENDIAN */
|
||||
# define _ISbit(bit) (bit < 8 ? ((1 << bit) << 8) : ((1 << bit) >> 8))
|
||||
# endif
|
||||
|
||||
enum
|
||||
{
|
||||
@ -115,7 +115,7 @@ extern int tolower __P ((int __c));
|
||||
extern int toupper __P ((int __c));
|
||||
|
||||
|
||||
#if defined(__USE_SVID) || defined(__USE_MISC) || defined(__USE_XOPEN)
|
||||
#if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
|
||||
|
||||
/* Return nonzero iff C is in the ASCII set
|
||||
(i.e., is no more than 7 bits wide). */
|
||||
@ -127,35 +127,35 @@ extern int toascii __P ((int __c));
|
||||
|
||||
#endif /* Use SVID or use misc. */
|
||||
|
||||
#if defined(__USE_SVID) || defined(__USE_MISC) || defined(__USE_XOPEN)
|
||||
#if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
|
||||
/* These are the same as `toupper' and `tolower'. */
|
||||
__exctype (_toupper);
|
||||
__exctype (_tolower);
|
||||
#endif
|
||||
|
||||
#ifndef __NO_CTYPE
|
||||
#define isalnum(c) __isctype((c), _ISalnum)
|
||||
#define isalpha(c) __isctype((c), _ISalpha)
|
||||
#define iscntrl(c) __isctype((c), _IScntrl)
|
||||
#define isdigit(c) __isctype((c), _ISdigit)
|
||||
#define islower(c) __isctype((c), _ISlower)
|
||||
#define isgraph(c) __isctype((c), _ISgraph)
|
||||
#define isprint(c) __isctype((c), _ISprint)
|
||||
#define ispunct(c) __isctype((c), _ISpunct)
|
||||
#define isspace(c) __isctype((c), _ISspace)
|
||||
#define isupper(c) __isctype((c), _ISupper)
|
||||
#define isxdigit(c) __isctype((c), _ISxdigit)
|
||||
# define isalnum(c) __isctype((c), _ISalnum)
|
||||
# define isalpha(c) __isctype((c), _ISalpha)
|
||||
# define iscntrl(c) __isctype((c), _IScntrl)
|
||||
# define isdigit(c) __isctype((c), _ISdigit)
|
||||
# define islower(c) __isctype((c), _ISlower)
|
||||
# define isgraph(c) __isctype((c), _ISgraph)
|
||||
# define isprint(c) __isctype((c), _ISprint)
|
||||
# define ispunct(c) __isctype((c), _ISpunct)
|
||||
# define isspace(c) __isctype((c), _ISspace)
|
||||
# define isupper(c) __isctype((c), _ISupper)
|
||||
# define isxdigit(c) __isctype((c), _ISxdigit)
|
||||
|
||||
#ifdef __USE_GNU
|
||||
#define isblank(c) __isctype((c), _ISblank)
|
||||
# define isblank(c) __isctype((c), _ISblank)
|
||||
#endif
|
||||
|
||||
#define tolower(c) __tolower(c)
|
||||
#define toupper(c) __toupper(c)
|
||||
|
||||
#if defined(__USE_SVID) || defined(__USE_MISC) || defined(__USE_XOPEN)
|
||||
#define isascii(c) __isascii(c)
|
||||
#define toascii(c) __toascii(c)
|
||||
#if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
|
||||
# define isascii(c) __isascii(c)
|
||||
# define toascii(c) __toascii(c)
|
||||
#endif
|
||||
|
||||
#endif /* Not __NO_CTYPE. */
|
||||
@ -179,13 +179,13 @@ __exctype (_tolower);
|
||||
|
||||
/* These definitions are similar to the ones above but all functions
|
||||
take as an argument a handle for the locale which shall be used. */
|
||||
#define __isctype_l(c, type, locale) \
|
||||
# define __isctype_l(c, type, locale) \
|
||||
((locale)->__ctype_b[(int) (c)] & (unsigned short int) type)
|
||||
|
||||
#define __tolower_l(c, locale) ((int) (locale)->__ctype_tolower[(int) (c)])
|
||||
#define __toupper_l(c, locale) ((int) (locale)->__ctype_toupper[(int) (c)])
|
||||
# define __tolower_l(c, locale) ((int) (locale)->__ctype_tolower[(int) (c)])
|
||||
# define __toupper_l(c, locale) ((int) (locale)->__ctype_toupper[(int) (c)])
|
||||
|
||||
#define __exctype_l(name) extern int name __P ((int, __locale_t))
|
||||
# define __exctype_l(name) extern int name __P ((int, __locale_t))
|
||||
|
||||
/* The following names are all functions:
|
||||
int isCHARACTERISTIC(int c, locale_t *locale);
|
||||
@ -213,27 +213,27 @@ extern int __tolower_l __P ((int __c, __locale_t __l));
|
||||
extern int __toupper_l __P ((int __c, __locale_t __l));
|
||||
|
||||
|
||||
#ifndef __NO_CTYPE
|
||||
#define __isalnum_l(c,l) __isctype_l((c), _ISalnum, (l))
|
||||
#define __isalpha_l(c,l) __isctype_l((c), _ISalpha, (l))
|
||||
#define __iscntrl_l(c,l) __isctype_l((c), _IScntrl, (l))
|
||||
#define __isdigit_l(c,l) __isctype_l((c), _ISdigit, (l))
|
||||
#define __islower_l(c,l) __isctype_l((c), _ISlower, (l))
|
||||
#define __isgraph_l(c,l) __isctype_l((c), _ISgraph, (l))
|
||||
#define __isprint_l(c,l) __isctype_l((c), _ISprint, (l))
|
||||
#define __ispunct_l(c,l) __isctype_l((c), _ISpunct, (l))
|
||||
#define __isspace_l(c,l) __isctype_l((c), _ISspace, (l))
|
||||
#define __isupper_l(c,l) __isctype_l((c), _ISupper, (l))
|
||||
#define __isxdigit_l(c,l) __isctype_l((c), _ISxdigit, (l))
|
||||
# ifndef __NO_CTYPE
|
||||
# define __isalnum_l(c,l) __isctype_l((c), _ISalnum, (l))
|
||||
# define __isalpha_l(c,l) __isctype_l((c), _ISalpha, (l))
|
||||
# define __iscntrl_l(c,l) __isctype_l((c), _IScntrl, (l))
|
||||
# define __isdigit_l(c,l) __isctype_l((c), _ISdigit, (l))
|
||||
# define __islower_l(c,l) __isctype_l((c), _ISlower, (l))
|
||||
# define __isgraph_l(c,l) __isctype_l((c), _ISgraph, (l))
|
||||
# define __isprint_l(c,l) __isctype_l((c), _ISprint, (l))
|
||||
# define __ispunct_l(c,l) __isctype_l((c), _ISpunct, (l))
|
||||
# define __isspace_l(c,l) __isctype_l((c), _ISspace, (l))
|
||||
# define __isupper_l(c,l) __isctype_l((c), _ISupper, (l))
|
||||
# define __isxdigit_l(c,l) __isctype_l((c), _ISxdigit, (l))
|
||||
|
||||
#define __isblank_l(c,l) __isctype_l((c), _ISblank, (l))
|
||||
# define __isblank_l(c,l) __isctype_l((c), _ISblank, (l))
|
||||
|
||||
#if defined(__USE_SVID) || defined(__USE_MISC) || defined(__USE_XOPEN)
|
||||
#define __isascii_l(c,l) __isascii(c)
|
||||
#define __toascii_l(c,l) __toascii(c)
|
||||
#endif
|
||||
# if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
|
||||
# define __isascii_l(c,l) __isascii(c)
|
||||
# define __toascii_l(c,l) __toascii(c)
|
||||
# endif
|
||||
|
||||
#endif /* Not __NO_CTYPE. */
|
||||
# endif /* Not __NO_CTYPE. */
|
||||
|
||||
#endif /* Use GNU. */
|
||||
|
||||
|
@ -168,7 +168,8 @@ main (argc, argv)
|
||||
db_file = dbopen (output_name, O_CREAT | O_RDWR | O_TRUNC, 0666,
|
||||
DB_BTREE, NULL);
|
||||
if (db_file == NULL)
|
||||
error (EXIT_FAILURE, errno, gettext ("cannot open output file `%s'"));
|
||||
error (EXIT_FAILURE, errno, gettext ("cannot open output file `%s'"),
|
||||
output_name);
|
||||
|
||||
/* Start the real work. */
|
||||
status = process_input (input_file, input_name, db_file, to_lowercase,
|
||||
@ -328,7 +329,7 @@ process_input (input, inname, output, to_lowercase, be_quiet)
|
||||
|
||||
if (ferror (input))
|
||||
{
|
||||
error (0, 0, gettext ("problems while reading `%s'"));
|
||||
error (0, 0, gettext ("problems while reading `%s'"), inname);
|
||||
status = EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ subdir := dirent
|
||||
headers := dirent.h bits/dirent.h
|
||||
routines := opendir closedir readdir readdir_r rewinddir \
|
||||
seekdir telldir scandir alphasort versionsort \
|
||||
getdents dirfd
|
||||
getdents dirfd readdir64 readdir64_r
|
||||
distribute := dirstream.h
|
||||
|
||||
tests := list tst-seekdir
|
||||
|
@ -112,20 +112,42 @@ extern DIR *opendir __P ((__const char *__name));
|
||||
extern int __closedir __P ((DIR *__dirp));
|
||||
extern int closedir __P ((DIR *__dirp));
|
||||
|
||||
/* Read a directory entry from DIRP.
|
||||
Return a pointer to a `struct dirent' describing the entry,
|
||||
or NULL for EOF or error. The storage returned may be overwritten
|
||||
by a later readdir call on the same DIR stream. */
|
||||
/* Read a directory entry from DIRP. Return a pointer to a `struct
|
||||
dirent' describing the entry, or NULL for EOF or error. The
|
||||
storage returned may be overwritten by a later readdir call on the
|
||||
same DIR stream.
|
||||
|
||||
If the Large File Support API is selected we have to use the
|
||||
appropriate interface. */
|
||||
extern struct dirent *__readdir __P ((DIR *__dirp));
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
extern struct dirent *readdir __P ((DIR *__dirp));
|
||||
#else
|
||||
extern struct dirent64 *readdir __P ((DIR *__dirp)) __asm__ ("readdir64");
|
||||
#endif
|
||||
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern struct dirent64 *readdir64 __P ((DIR *__dirp));
|
||||
#endif
|
||||
|
||||
#if defined __USE_POSIX || defined __USE_MISC
|
||||
/* Reentrant version of `readdir'. Return in RESULT a pointer to the
|
||||
next entry. */
|
||||
extern int __readdir_r __P ((DIR *__dirp, struct dirent *__entry,
|
||||
struct dirent **__result));
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
extern int readdir_r __P ((DIR *__dirp, struct dirent *__entry,
|
||||
struct dirent **__result));
|
||||
# else
|
||||
extern int readdir_r __P ((DIR *__dirp, struct dirent64 *__entry,
|
||||
struct dirent64 **__result))
|
||||
__asm__ ("readdir64_r");
|
||||
# endif
|
||||
|
||||
# ifdef __USE_LARGEFILE64
|
||||
extern int readdir64_r __P ((DIR *__dirp, struct dirent64 *__entry,
|
||||
struct dirent64 **__result));
|
||||
# endif
|
||||
#endif /* POSIX or misc */
|
||||
|
||||
/* Rewind DIRP to the beginning of the directory. */
|
||||
|
@ -140,13 +140,8 @@ fixup (
|
||||
that defines sym. Now add in the symbol offset. */
|
||||
value = (sym ? value + sym->st_value : 0);
|
||||
|
||||
/* And now the relocation addend. */
|
||||
#ifndef ELF_MACHINE_NO_RELA
|
||||
if (l->l_info[DT_PLTRELSZ]->d_un.d_val == sizeof (ElfW(Rela)))
|
||||
value += reloc->r_addend;
|
||||
#elif ELF_MACHINE_NO_REL
|
||||
value += reloc->r_addend;
|
||||
#endif
|
||||
/* And now perhaps the relocation addend. */
|
||||
value = elf_machine_plt_value (l, reloc, value);
|
||||
|
||||
/* Finally, fix up the plt itself. */
|
||||
elf_machine_fixup_plt (l, reloc, rel_addr, value);
|
||||
@ -212,13 +207,8 @@ profile_fixup (
|
||||
that defines sym. Now add in the symbol offset. */
|
||||
value = (sym ? value + sym->st_value : 0);
|
||||
|
||||
/* And now the relocation addend. */
|
||||
#ifndef ELF_MACHINE_NO_RELA
|
||||
if (l->l_info[DT_PLTRELSZ]->d_un.d_val == sizeof (ElfW(Rela)))
|
||||
value += reloc->r_addend;
|
||||
#elif ELF_MACHINE_NO_REL
|
||||
value += reloc->r_addend;
|
||||
#endif
|
||||
/* And now perhaps the relocation addend. */
|
||||
value = elf_machine_plt_value (l, reloc, value);
|
||||
|
||||
*_dl_global_scope_end = NULL;
|
||||
(*mcount_fct) (retaddr, value);
|
||||
|
@ -64,9 +64,9 @@ static int s_scale;
|
||||
|
||||
void moncontrol __P ((int mode));
|
||||
void __moncontrol __P ((int mode));
|
||||
static void write_hist __P ((int fd));
|
||||
static void write_call_graph __P ((int fd));
|
||||
static void write_bb_counts __P ((int fd));
|
||||
static void write_hist __P ((int fd)) internal_function;
|
||||
static void write_call_graph __P ((int fd)) internal_function;
|
||||
static void write_bb_counts __P ((int fd)) internal_function;
|
||||
|
||||
/*
|
||||
* Control profiling
|
||||
@ -169,6 +169,7 @@ weak_alias(__monstartup, monstartup)
|
||||
|
||||
|
||||
static void
|
||||
internal_function
|
||||
write_hist (fd)
|
||||
int fd;
|
||||
{
|
||||
@ -198,6 +199,7 @@ write_hist (fd)
|
||||
|
||||
|
||||
static void
|
||||
internal_function
|
||||
write_call_graph (fd)
|
||||
int fd;
|
||||
{
|
||||
@ -251,6 +253,7 @@ write_call_graph (fd)
|
||||
|
||||
|
||||
static void
|
||||
internal_function
|
||||
write_bb_counts (fd)
|
||||
int fd;
|
||||
{
|
||||
|
26
grp/grp.h
26
grp/grp.h
@ -43,9 +43,9 @@ struct group
|
||||
};
|
||||
|
||||
|
||||
#if defined(__USE_SVID) || defined(__USE_GNU)
|
||||
#define __need_FILE
|
||||
#include <stdio.h>
|
||||
#if defined __USE_SVID || defined __USE_GNU
|
||||
# define __need_FILE
|
||||
# include <stdio.h>
|
||||
#endif
|
||||
|
||||
#ifdef __USE_GNU
|
||||
@ -66,7 +66,7 @@ extern struct group *__grpscan __P ((__ptr_t *__p,
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__USE_SVID) || defined (__USE_BSD) || defined(__USE_XOPEN_EXTENDED)
|
||||
#if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
|
||||
/* Rewind the group-file stream. */
|
||||
extern void setgrent __P ((void));
|
||||
|
||||
@ -90,11 +90,11 @@ extern struct group *getgrnam __P ((__const char *__name));
|
||||
|
||||
#if defined __USE_POSIX || defined __USE_MISC
|
||||
|
||||
#ifdef __USE_MISC
|
||||
# ifdef __USE_MISC
|
||||
/* Reasonable value for the buffer sized used in the reentrant
|
||||
functions below. But better use `sysconf'. */
|
||||
#define NSS_BUFLEN_GROUP 1024
|
||||
#endif
|
||||
# define NSS_BUFLEN_GROUP 1024
|
||||
# endif
|
||||
|
||||
/* Reentrant versions of some of the functions above.
|
||||
|
||||
@ -104,12 +104,12 @@ extern struct group *getgrnam __P ((__const char *__name));
|
||||
other reentrant functions so the chances are good this is what the
|
||||
POSIX people would choose. */
|
||||
|
||||
#if defined(__USE_SVID) || defined (__USE_BSD) || defined(__USE_XOPEN_EXTENDED)
|
||||
# if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
|
||||
extern int __getgrent_r __P ((struct group *__resultbuf, char *buffer,
|
||||
size_t __buflen, struct group **__result));
|
||||
extern int getgrent_r __P ((struct group *__resultbuf, char *buffer,
|
||||
size_t __buflen, struct group **__result));
|
||||
#endif
|
||||
# endif
|
||||
|
||||
/* Search for an entry with a matching group ID. */
|
||||
extern int getgrgid_r __P ((__gid_t __gid, struct group *__resultbuf,
|
||||
@ -121,7 +121,7 @@ extern int getgrnam_r __P ((__const char *__name, struct group *__resultbuf,
|
||||
char *buffer, size_t __buflen,
|
||||
struct group **__result));
|
||||
|
||||
#ifdef __USE_SVID
|
||||
# ifdef __USE_SVID
|
||||
/* Read a group entry from STREAM. This function is not standardized
|
||||
an probably never will. */
|
||||
extern int __fgetgrent_r __P ((FILE * __stream, struct group *__resultbuf,
|
||||
@ -130,15 +130,15 @@ extern int __fgetgrent_r __P ((FILE * __stream, struct group *__resultbuf,
|
||||
extern int fgetgrent_r __P ((FILE * __stream, struct group *__resultbuf,
|
||||
char *buffer, size_t __buflen,
|
||||
struct group **__result));
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#endif /* POSIX or reentrant */
|
||||
|
||||
|
||||
#ifdef __USE_BSD
|
||||
|
||||
#define __need_size_t
|
||||
#include <stddef.h>
|
||||
# define __need_size_t
|
||||
# include <stddef.h>
|
||||
|
||||
/* Set the group set for the current user to GROUPS (N of them). */
|
||||
extern int setgroups __P ((size_t __n, __const __gid_t *__groups));
|
||||
|
@ -30,6 +30,9 @@
|
||||
_XOPEN_SOURCE Includes POSIX and XPG things. Set to 500 if
|
||||
Single Unix conformance is wanted.
|
||||
_XOPEN_SOURCE_EXTENDED XPG things and X/Open Unix extensions.
|
||||
_LARGEFILE_SOURCE Some more functions for correct standard I/O.
|
||||
_LARGEFILE64_SOURCE Additional functionality from LFS for large files.
|
||||
_FILE_OFFSET_BITS=N Select default filesystem interface.
|
||||
_BSD_SOURCE ISO C, POSIX, and 4.3BSD things.
|
||||
_SVID_SOURCE ISO C, POSIX, and SVID things.
|
||||
_GNU_SOURCE All of the above, plus GNU extensions.
|
||||
@ -52,6 +55,8 @@
|
||||
__USE_XOPEN Define XPG things.
|
||||
__USE_XOPEN_EXTENDED Define X/Open Unix things.
|
||||
__USE_UNIX98 Define Single Unix V2 things.
|
||||
__USE_LARGEFILE64 Define LFS things with separate names.
|
||||
__USE_FILE_OFFSET64 Define 64bit interface as default.
|
||||
__USE_BSD Define 4.3BSD things.
|
||||
__USE_SVID Define SVID things.
|
||||
__USE_MISC Define things common to BSD and System V Unix.
|
||||
@ -78,6 +83,10 @@
|
||||
#undef __USE_POSIX199309
|
||||
#undef __USE_XOPEN
|
||||
#undef __USE_XOPEN_EXTENDED
|
||||
#undef __USE_UNIX98
|
||||
#undef __USE_LARGEFILE
|
||||
#undef __USE_LARGEFILE64
|
||||
#undef __USE_FILE_OFFSET64
|
||||
#undef __USE_BSD
|
||||
#undef __USE_SVID
|
||||
#undef __USE_MISC
|
||||
@ -100,6 +109,7 @@
|
||||
#if defined _BSD_SOURCE && \
|
||||
!(defined _POSIX_SOURCE || defined _POSIX_C_SOURCE || \
|
||||
defined _XOPEN_SOURCE || defined _XOPEN_SOURCE_EXTENDED || \
|
||||
defined _LARGEFILE64_SOURCE || defined _FILE_OFFSET_BITS || \
|
||||
defined _GNU_SOURCE || defined _SVID_SOURCE)
|
||||
# define __FAVOR_BSD 1
|
||||
#endif
|
||||
@ -116,6 +126,8 @@
|
||||
# define _XOPEN_SOURCE 500
|
||||
# undef _XOPEN_SOURCE_EXTENDED
|
||||
# define _XOPEN_SOURCE_EXTENDED 1
|
||||
# undef _LARGEFILE64_SOURCE
|
||||
# define _LARGEFILE64_SOURCE 1
|
||||
# undef _BSD_SOURCE
|
||||
# define _BSD_SOURCE 1
|
||||
# undef _SVID_SOURCE
|
||||
@ -127,6 +139,7 @@
|
||||
#if (!defined __STRICT_ANSI__ && !defined _ISOC9X_SOURCE && \
|
||||
!defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE && \
|
||||
!defined _XOPEN_SOURCE && !defined _XOPEN_SOURCE_EXTENDED && \
|
||||
!defined _LARGEFILE64_SOURCE && !defined _FILE_OFFSET_BITS && \
|
||||
!defined _BSD_SOURCE && !defined _SVID_SOURCE)
|
||||
# define _BSD_SOURCE 1
|
||||
# define _SVID_SOURCE 1
|
||||
@ -143,7 +156,7 @@
|
||||
#if (!defined __STRICT_ANSI__ && !defined _POSIX_SOURCE && \
|
||||
!defined _POSIX_C_SOURCE)
|
||||
# define _POSIX_SOURCE 1
|
||||
# if defined _XOPEN_SOURCE && _XOPEN_SOURCE != 500
|
||||
# if defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) != 500
|
||||
# define _POSIX_C_SOURCE 2
|
||||
# else
|
||||
# define _POSIX_C_SOURCE 199309L
|
||||
@ -164,9 +177,11 @@
|
||||
|
||||
#ifdef _XOPEN_SOURCE
|
||||
# define __USE_XOPEN 1
|
||||
# if _XOPEN_SOURCE == 500
|
||||
# if (_XOPEN_SOURCE - 0) == 500
|
||||
# define __USE_XOPEN_EXTENDED 1
|
||||
# define __USE_UNIX98 1
|
||||
# undef _LARGEFILE_SOURCE
|
||||
# define _LARGEFILE_SOURCE 1
|
||||
# else
|
||||
# ifdef _XOPEN_SOURCE_EXTENDED
|
||||
# define __USE_XOPEN_EXTENDED 1
|
||||
@ -174,6 +189,18 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef _LARGEFILE_SOURCE
|
||||
# define __USE_LARGEFILE 1
|
||||
#endif
|
||||
|
||||
#ifdef _LARGEFILE64_SOURCE
|
||||
# define __USE_LARGEFILE64 1
|
||||
#endif
|
||||
|
||||
#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
|
||||
# define __USE_FILE_OFFSET64 1
|
||||
#endif
|
||||
|
||||
#if defined _BSD_SOURCE || defined _SVID_SOURCE
|
||||
# define __USE_MISC 1
|
||||
#endif
|
||||
|
@ -61,19 +61,19 @@
|
||||
/* Define the macros `_' and `N_' for conveniently marking translatable
|
||||
strings in the libc source code. */
|
||||
|
||||
#define N_(msgid) msgid
|
||||
# define N_(msgid) msgid
|
||||
|
||||
#include <libintl.h>
|
||||
# include <libintl.h>
|
||||
extern const char _libc_intl_domainname[];
|
||||
|
||||
#ifdef dgettext
|
||||
# ifdef dgettext
|
||||
/* This is defined as an optimizing macro, so use it. */
|
||||
#define _(msgid) dgettext (_libc_intl_domainname, (msgid))
|
||||
#else
|
||||
# define _(msgid) dgettext (_libc_intl_domainname, (msgid))
|
||||
# else
|
||||
/* Be sure to use only the __ name when `dgettext' is a plain function
|
||||
instead of an optimizing macro. */
|
||||
#define _(msgid) __dgettext (_libc_intl_domainname, (msgid))
|
||||
#endif
|
||||
# define _(msgid) __dgettext (_libc_intl_domainname, (msgid))
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
@ -83,50 +83,50 @@ extern const char _libc_intl_domainname[];
|
||||
/* The symbols in all the user (non-_) macros are C symbols.
|
||||
HAVE_GNU_LD without HAVE_ELF implies a.out. */
|
||||
|
||||
#if defined (HAVE_ASM_WEAK_DIRECTIVE) || defined (HAVE_ASM_WEAKEXT_DIRECTIVE)
|
||||
#define HAVE_WEAK_SYMBOLS
|
||||
#if defined HAVE_ASM_WEAK_DIRECTIVE || defined HAVE_ASM_WEAKEXT_DIRECTIVE
|
||||
# define HAVE_WEAK_SYMBOLS
|
||||
#endif
|
||||
|
||||
#ifndef __SYMBOL_PREFIX
|
||||
#ifdef NO_UNDERSCORES
|
||||
#define __SYMBOL_PREFIX
|
||||
#else
|
||||
#define __SYMBOL_PREFIX "_"
|
||||
#endif
|
||||
# ifdef NO_UNDERSCORES
|
||||
# define __SYMBOL_PREFIX
|
||||
# else
|
||||
# define __SYMBOL_PREFIX "_"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef C_SYMBOL_NAME
|
||||
#ifdef NO_UNDERSCORES
|
||||
#define C_SYMBOL_NAME(name) name
|
||||
#else
|
||||
#define C_SYMBOL_NAME(name) _##name
|
||||
#endif
|
||||
# ifdef NO_UNDERSCORES
|
||||
# define C_SYMBOL_NAME(name) name
|
||||
# else
|
||||
# define C_SYMBOL_NAME(name) _##name
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Define ALIAS as a strong alias for ORIGINAL. */
|
||||
#ifdef HAVE_ASM_SET_DIRECTIVE
|
||||
#define strong_alias_asm(original, alias) \
|
||||
# define strong_alias_asm(original, alias) \
|
||||
ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias); \
|
||||
.set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original)
|
||||
#ifdef ASSEMBLER
|
||||
#define strong_alias(original, alias) strong_alias_asm (original, alias)
|
||||
#else
|
||||
#define strong_alias(original, alias) \
|
||||
# ifdef ASSEMBLER
|
||||
# define strong_alias(original, alias) strong_alias_asm (original, alias)
|
||||
# else
|
||||
# define strong_alias(original, alias) \
|
||||
asm (__string_1 (ASM_GLOBAL_DIRECTIVE) " " __SYMBOL_PREFIX #alias "\n" \
|
||||
".set " __SYMBOL_PREFIX #alias "," __SYMBOL_PREFIX #original);
|
||||
#endif
|
||||
# endif
|
||||
#else
|
||||
#define strong_alias_asm(original, alias) \
|
||||
# define strong_alias_asm(original, alias) \
|
||||
ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias); \
|
||||
C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
|
||||
#ifdef ASSEMBLER
|
||||
#define strong_alias(original, alias) strong_alias_asm (original, alias)
|
||||
#else
|
||||
#define strong_alias(original, alias) \
|
||||
# ifdef ASSEMBLER
|
||||
# define strong_alias(original, alias) strong_alias_asm (original, alias)
|
||||
# else
|
||||
# define strong_alias(original, alias) \
|
||||
asm (__string_1 (ASM_GLOBAL_DIRECTIVE) " " __SYMBOL_PREFIX #alias "\n" \
|
||||
__SYMBOL_PREFIX #alias " = " __SYMBOL_PREFIX #original);
|
||||
#endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Helper macros used above. */
|
||||
@ -136,77 +136,77 @@ extern const char _libc_intl_domainname[];
|
||||
|
||||
#ifdef HAVE_WEAK_SYMBOLS
|
||||
|
||||
#ifdef ASSEMBLER
|
||||
# ifdef ASSEMBLER
|
||||
|
||||
#ifdef HAVE_ASM_WEAKEXT_DIRECTIVE
|
||||
# ifdef HAVE_ASM_WEAKEXT_DIRECTIVE
|
||||
|
||||
/* Define ALIAS as a weak alias for ORIGINAL.
|
||||
If weak aliases are not available, this defines a strong alias. */
|
||||
#define weak_alias(original, alias) \
|
||||
# define weak_alias(original, alias) \
|
||||
.weakext C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original)
|
||||
|
||||
/* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined). */
|
||||
#define weak_extern(symbol) \
|
||||
# define weak_extern(symbol) \
|
||||
.weakext C_SYMBOL_NAME (symbol)
|
||||
|
||||
#else /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
|
||||
# else /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
|
||||
|
||||
/* Define ALIAS as a weak alias for ORIGINAL.
|
||||
If weak aliases are not available, this defines a strong alias. */
|
||||
#define weak_alias(original, alias) \
|
||||
# define weak_alias(original, alias) \
|
||||
.weak C_SYMBOL_NAME (alias); \
|
||||
C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
|
||||
|
||||
|
||||
/* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined). */
|
||||
#define weak_extern(symbol) \
|
||||
# define weak_extern(symbol) \
|
||||
.weak C_SYMBOL_NAME (symbol)
|
||||
|
||||
#endif /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
|
||||
# endif /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
|
||||
|
||||
#else /* ! ASSEMBLER */
|
||||
# else /* ! ASSEMBLER */
|
||||
|
||||
#ifdef HAVE_ASM_WEAKEXT_DIRECTIVE
|
||||
#define weak_extern_asm(symbol) asm (".weakext " __SYMBOL_PREFIX #symbol);
|
||||
#define weak_alias_asm(original, alias) \
|
||||
# ifdef HAVE_ASM_WEAKEXT_DIRECTIVE
|
||||
# define weak_extern_asm(symbol) asm (".weakext " __SYMBOL_PREFIX #symbol);
|
||||
# define weak_alias_asm(original, alias) \
|
||||
asm (".weakext " __SYMBOL_PREFIX #alias ", " __SYMBOL_PREFIX #original);
|
||||
#else /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
|
||||
#define weak_extern_asm(symbol) asm (".weak " __SYMBOL_PREFIX #symbol);
|
||||
#define weak_alias_asm(original, alias) \
|
||||
# else /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
|
||||
# define weak_extern_asm(symbol) asm (".weak " __SYMBOL_PREFIX #symbol);
|
||||
# define weak_alias_asm(original, alias) \
|
||||
asm (".weak " __SYMBOL_PREFIX #alias "\n" \
|
||||
__SYMBOL_PREFIX #alias " = " __SYMBOL_PREFIX #original);
|
||||
#endif /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
|
||||
# endif /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
|
||||
|
||||
#define weak_alias(o, a) weak_alias_asm (o, a)
|
||||
#define weak_extern(symbol) weak_extern_asm (symbol)
|
||||
# define weak_alias(o, a) weak_alias_asm (o, a)
|
||||
# define weak_extern(symbol) weak_extern_asm (symbol)
|
||||
|
||||
#endif /* ! ASSEMBLER */
|
||||
# endif /* ! ASSEMBLER */
|
||||
#else
|
||||
#define weak_alias(original, alias) strong_alias(original, alias)
|
||||
#define weak_extern(symbol) /* Do nothing; the ref will be strong. */
|
||||
# define weak_alias(original, alias) strong_alias(original, alias)
|
||||
# define weak_extern(symbol) /* Do nothing; the ref will be strong. */
|
||||
#endif
|
||||
|
||||
|
||||
#if (!defined (ASSEMBLER) && \
|
||||
#if (!defined ASSEMBLER && \
|
||||
(__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)))
|
||||
/* GCC 2.7 and later has special syntax for weak symbols and aliases.
|
||||
Using that is better when possible, because the compiler and assembler
|
||||
are better clued in to what we are doing. */
|
||||
#undef strong_alias
|
||||
#define strong_alias(name, aliasname) \
|
||||
# undef strong_alias
|
||||
# define strong_alias(name, aliasname) \
|
||||
extern __typeof (name) aliasname __attribute__ ((alias (#name)));
|
||||
|
||||
#ifdef HAVE_WEAK_SYMBOLS
|
||||
#undef weak_alias
|
||||
#define weak_alias(name, aliasname) \
|
||||
# ifdef HAVE_WEAK_SYMBOLS
|
||||
# undef weak_alias
|
||||
# define weak_alias(name, aliasname) \
|
||||
extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
|
||||
|
||||
/* This comes between the return type and function name in
|
||||
a function definition to make that definition weak. */
|
||||
#define weak_function __attribute__ ((weak))
|
||||
#define weak_const_function __attribute__ ((weak, __const__))
|
||||
# define weak_function __attribute__ ((weak))
|
||||
# define weak_const_function __attribute__ ((weak, __const__))
|
||||
|
||||
#endif /* HAVE_WEAK_SYMBOLS. */
|
||||
# endif /* HAVE_WEAK_SYMBOLS. */
|
||||
#endif /* Not ASSEMBLER, and GCC 2.7 or later. */
|
||||
|
||||
|
||||
@ -215,39 +215,45 @@ extern const char _libc_intl_domainname[];
|
||||
can define functions as weak symbols. The compiler will emit a `.globl'
|
||||
directive for the function symbol, and a `.weak' directive in addition
|
||||
will produce an error from the assembler. */
|
||||
#define weak_function /* empty */
|
||||
#define weak_const_function /* empty */
|
||||
# define weak_function /* empty */
|
||||
# define weak_const_function /* empty */
|
||||
#endif
|
||||
|
||||
/* On some platforms we can make internal function calls (i.e., calls of
|
||||
functions not exported) a bit faster by using a different calling
|
||||
convention. */
|
||||
#ifndef internal_function
|
||||
# define internal_function /* empty */
|
||||
#endif
|
||||
|
||||
/* When a reference to SYMBOL is encountered, the linker will emit a
|
||||
warning message MSG. */
|
||||
#ifdef HAVE_GNU_LD
|
||||
#ifdef HAVE_ELF
|
||||
# ifdef HAVE_ELF
|
||||
|
||||
/* We want the .gnu.warning.SYMBOL section to be unallocated. */
|
||||
#ifdef HAVE_ASM_PREVIOUS_DIRECTIVE
|
||||
#define __make_section_unallocated(section_string) \
|
||||
# ifdef HAVE_ASM_PREVIOUS_DIRECTIVE
|
||||
# define __make_section_unallocated(section_string) \
|
||||
asm(".section " section_string "; .previous");
|
||||
#elif defined (HAVE_ASM_POPSECTION_DIRECTIVE)
|
||||
#define __make_section_unallocated(section_string) \
|
||||
# elif defined (HAVE_ASM_POPSECTION_DIRECTIVE)
|
||||
# define __make_section_unallocated(section_string) \
|
||||
asm(".pushsection " section_string "; .popsection");
|
||||
#else
|
||||
#define __make_section_unallocated(section_string)
|
||||
#endif
|
||||
# else
|
||||
# define __make_section_unallocated(section_string)
|
||||
# endif
|
||||
|
||||
#define link_warning(symbol, msg) \
|
||||
# define link_warning(symbol, msg) \
|
||||
__make_section_unallocated (".gnu.warning." #symbol) \
|
||||
static const char __evoke_link_warning_##symbol[] \
|
||||
__attribute__ ((section (".gnu.warning." #symbol))) = msg;
|
||||
#else
|
||||
#define link_warning(symbol, msg) \
|
||||
# else
|
||||
# define link_warning(symbol, msg) \
|
||||
asm(".stabs \"" msg "\",30,0,0,0\n" \
|
||||
".stabs \"" __SYMBOL_PREFIX #symbol "\",1,0,0,0\n");
|
||||
#endif
|
||||
# endif
|
||||
#else
|
||||
/* We will never be heard; they will all die horribly. */
|
||||
#define link_warning(symbol, msg)
|
||||
# define link_warning(symbol, msg)
|
||||
#endif
|
||||
|
||||
/* A canned warning for sysdeps/stub functions. */
|
||||
@ -263,60 +269,60 @@ extern const char _libc_intl_domainname[];
|
||||
|
||||
/* Symbol set support macros. */
|
||||
|
||||
#ifdef HAVE_ELF
|
||||
# ifdef HAVE_ELF
|
||||
|
||||
/* Make SYMBOL, which is in the text segment, an element of SET. */
|
||||
#define text_set_element(set, symbol) _elf_set_element(set, symbol)
|
||||
# define text_set_element(set, symbol) _elf_set_element(set, symbol)
|
||||
/* Make SYMBOL, which is in the data segment, an element of SET. */
|
||||
#define data_set_element(set, symbol) _elf_set_element(set, symbol)
|
||||
# define data_set_element(set, symbol) _elf_set_element(set, symbol)
|
||||
/* Make SYMBOL, which is in the bss segment, an element of SET. */
|
||||
#define bss_set_element(set, symbol) _elf_set_element(set, symbol)
|
||||
# define bss_set_element(set, symbol) _elf_set_element(set, symbol)
|
||||
|
||||
/* These are all done the same way in ELF.
|
||||
There is a new section created for each set. */
|
||||
#ifdef PIC
|
||||
# ifdef PIC
|
||||
/* When building a shared library, make the set section writable,
|
||||
because it will need to be relocated at run time anyway. */
|
||||
#define _elf_set_element(set, symbol) \
|
||||
# define _elf_set_element(set, symbol) \
|
||||
static const void *__elf_set_##set##_element_##symbol##__ \
|
||||
__attribute__ ((unused, section (#set))) = &(symbol)
|
||||
#else
|
||||
#define _elf_set_element(set, symbol) \
|
||||
# else
|
||||
# define _elf_set_element(set, symbol) \
|
||||
static const void *const __elf_set_##set##_element_##symbol##__ \
|
||||
__attribute__ ((unused, section (#set))) = &(symbol)
|
||||
#endif
|
||||
# endif
|
||||
|
||||
/* Define SET as a symbol set. This may be required (it is in a.out) to
|
||||
be able to use the set's contents. */
|
||||
#define symbol_set_define(set) symbol_set_declare(set)
|
||||
# define symbol_set_define(set) symbol_set_declare(set)
|
||||
|
||||
/* Declare SET for use in this module, if defined in another module. */
|
||||
#define symbol_set_declare(set) \
|
||||
# define symbol_set_declare(set) \
|
||||
extern void *const __start_##set __attribute__ ((__weak__)); \
|
||||
extern void *const __stop_##set __attribute__ ((__weak__)); \
|
||||
weak_extern (__start_##set) weak_extern (__stop_##set)
|
||||
|
||||
/* Return a pointer (void *const *) to the first element of SET. */
|
||||
#define symbol_set_first_element(set) (&__start_##set)
|
||||
# define symbol_set_first_element(set) (&__start_##set)
|
||||
|
||||
/* Return true iff PTR (a void *const *) has been incremented
|
||||
past the last element in SET. */
|
||||
#define symbol_set_end_p(set, ptr) ((ptr) >= &__stop_##set)
|
||||
# define symbol_set_end_p(set, ptr) ((ptr) >= &__stop_##set)
|
||||
|
||||
#else /* Not ELF: a.out. */
|
||||
# else /* Not ELF: a.out. */
|
||||
|
||||
#define text_set_element(set, symbol) \
|
||||
# define text_set_element(set, symbol) \
|
||||
asm(".stabs \"" __SYMBOL_PREFIX #set "\",23,0,0," __SYMBOL_PREFIX #symbol)
|
||||
#define data_set_element(set, symbol) \
|
||||
# define data_set_element(set, symbol) \
|
||||
asm(".stabs \"" __SYMBOL_PREFIX #set "\",25,0,0," __SYMBOL_PREFIX #symbol)
|
||||
#define bss_set_element(set, symbol) ?error Must use initialized data.
|
||||
#define symbol_set_define(set) void *const (set)[1];
|
||||
#define symbol_set_declare(set) extern void *const (set)[1];
|
||||
# define bss_set_element(set, symbol) ?error Must use initialized data.
|
||||
# define symbol_set_define(set) void *const (set)[1];
|
||||
# define symbol_set_declare(set) extern void *const (set)[1];
|
||||
|
||||
#define symbol_set_first_element(set) &(set)[1]
|
||||
#define symbol_set_end_p(set, ptr) (*(ptr) == 0)
|
||||
# define symbol_set_first_element(set) &(set)[1]
|
||||
# define symbol_set_end_p(set, ptr) (*(ptr) == 0)
|
||||
|
||||
#endif /* ELF. */
|
||||
# endif /* ELF. */
|
||||
#endif /* Have GNU ld. */
|
||||
|
||||
#endif /* libc-symbols.h */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 1992, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -36,15 +36,15 @@
|
||||
#endif
|
||||
|
||||
|
||||
#if __GNUC__ >= 2
|
||||
#if __GNUC__ >= 2
|
||||
|
||||
/* Get the compiler's limits.h, which defines all the ANSI constants. */
|
||||
#ifndef _LIBC_LIMITS_H_
|
||||
#define _LIBC_LIMITS_H_ /* This tells it not to look for another. */
|
||||
#endif
|
||||
#ifndef _GCC_LIMITS_H_ /* This is what GCC's file defines. */
|
||||
#include_next <limits.h>
|
||||
#endif
|
||||
# ifndef _LIBC_LIMITS_H_
|
||||
# define _LIBC_LIMITS_H_ /* This tells it not to look for another. */
|
||||
# endif
|
||||
# ifndef _GCC_LIMITS_H_ /* This is what GCC's file defines. */
|
||||
# include_next <limits.h>
|
||||
# endif
|
||||
|
||||
#else /* Not GCC 2. */
|
||||
|
||||
|
@ -63,7 +63,7 @@
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* Some systems define this name instead of CHAR_BIT or CHARBITS. */
|
||||
#define BITSPERBYTE CHAR_BIT
|
||||
# define BITSPERBYTE CHAR_BIT
|
||||
#endif
|
||||
|
||||
#endif /* values.h */
|
||||
|
@ -63,6 +63,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
static char *
|
||||
internal_function
|
||||
nrl_domainname (void)
|
||||
{
|
||||
static char *domain = NULL;
|
||||
@ -258,13 +259,11 @@ getnameinfo (const struct sockaddr *sa, size_t addrlen, char *host,
|
||||
else
|
||||
{
|
||||
const char *c;
|
||||
#if INET6
|
||||
if (sa->sa_family == AF_INET6)
|
||||
c = inet_ntop (AF_INET6,
|
||||
(void *) &(((struct sockaddr_in6 *) sa)->sin6_addr),
|
||||
host, hostlen);
|
||||
else
|
||||
#endif /* INET6 */
|
||||
c = inet_ntop (AF_INET,
|
||||
(void *) &(((struct sockaddr_in *) sa)->sin_addr),
|
||||
host, hostlen);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -91,6 +91,7 @@ free_memory (struct __netgrent *data)
|
||||
}
|
||||
|
||||
static int
|
||||
internal_function
|
||||
__internal_setnetgrent_reuse (const char *group, struct __netgrent *datap)
|
||||
{
|
||||
enum nss_status (*fct) (const char *, struct __netgrent *);
|
||||
|
@ -55,7 +55,7 @@ static char sccsid[] = "@(#)rcmd.c 8.3 (Berkeley) 3/26/94";
|
||||
|
||||
|
||||
int __ivaliduser __P((FILE *, u_int32_t, const char *, const char *));
|
||||
static int __icheckhost __P((u_int32_t, char *));
|
||||
static int __icheckhost __P((u_int32_t, char *)) internal_function;
|
||||
|
||||
int
|
||||
rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
|
||||
@ -426,6 +426,7 @@ __ivaliduser(hostf, raddr, luser, ruser)
|
||||
* Returns "true" if match, 0 if no match.
|
||||
*/
|
||||
static int
|
||||
internal_function
|
||||
__icheckhost(raddr, lhost)
|
||||
u_int32_t raddr;
|
||||
register char *lhost;
|
||||
|
@ -142,6 +142,10 @@ static char *stpcpy PARAMS ((char *dest, const char *src));
|
||||
# define PATH_MAX _POSIX_PATH_MAX
|
||||
#endif
|
||||
|
||||
#ifndef internal_function
|
||||
# define internal_function
|
||||
#endif
|
||||
|
||||
/* XPG3 defines the result of `setlocale (category, NULL)' as:
|
||||
``Directs `setlocale()' to query `category' and return the current
|
||||
setting of `local'.''
|
||||
@ -168,10 +172,11 @@ struct binding *_nl_domain_bindings;
|
||||
|
||||
/* Prototypes for local functions. */
|
||||
static char *find_msg PARAMS ((struct loaded_l10nfile *domain_file,
|
||||
const char *msgid));
|
||||
static const char *category_to_name PARAMS ((int category));
|
||||
const char *msgid)) internal_function;
|
||||
static const char *category_to_name PARAMS ((int category)) internal_function;
|
||||
static const char *guess_category_value PARAMS ((int category,
|
||||
const char *categoryname));
|
||||
const char *categoryname))
|
||||
internal_function;
|
||||
|
||||
|
||||
/* For those loosing systems which don't have `alloca' we have to add
|
||||
@ -394,6 +399,7 @@ weak_alias (__dcgettext, dcgettext);
|
||||
|
||||
|
||||
static char *
|
||||
internal_function
|
||||
find_msg (domain_file, msgid)
|
||||
struct loaded_l10nfile *domain_file;
|
||||
const char *msgid;
|
||||
@ -482,6 +488,7 @@ find_msg (domain_file, msgid)
|
||||
|
||||
/* Return string representation of locale CATEGORY. */
|
||||
static const char *
|
||||
internal_function
|
||||
category_to_name (category)
|
||||
int category;
|
||||
{
|
||||
@ -541,6 +548,7 @@ category_to_name (category)
|
||||
|
||||
/* Guess value of current locale from value of the environment variables. */
|
||||
static const char *
|
||||
internal_function
|
||||
guess_category_value (category, categoryname)
|
||||
int category;
|
||||
const char *categoryname;
|
||||
|
@ -69,6 +69,7 @@ _nl_load_domain (domain_file)
|
||||
struct loaded_l10nfile *domain_file;
|
||||
{
|
||||
int fd;
|
||||
size_t size;
|
||||
struct stat st;
|
||||
struct mo_file_header *data = (struct mo_file_header *) -1;
|
||||
#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
|
||||
@ -94,7 +95,8 @@ _nl_load_domain (domain_file)
|
||||
|
||||
/* We must know about the size of the file. */
|
||||
if (fstat (fd, &st) != 0
|
||||
&& st.st_size < (off_t) sizeof (struct mo_file_header))
|
||||
|| (size = (size_t) st.st_size) != st.st_size
|
||||
|| size < sizeof (struct mo_file_header))
|
||||
{
|
||||
/* Something went wrong. */
|
||||
close (fd);
|
||||
@ -105,7 +107,7 @@ _nl_load_domain (domain_file)
|
||||
|| defined _LIBC
|
||||
/* Now we are ready to load the file. If mmap() is available we try
|
||||
this first. If not available or it failed we try to load it. */
|
||||
data = (struct mo_file_header *) mmap (NULL, st.st_size, PROT_READ,
|
||||
data = (struct mo_file_header *) mmap (NULL, size, PROT_READ,
|
||||
MAP_PRIVATE, fd, 0);
|
||||
|
||||
if (data != (struct mo_file_header *) -1)
|
||||
@ -120,14 +122,14 @@ _nl_load_domain (domain_file)
|
||||
it manually. */
|
||||
if (data == (struct mo_file_header *) -1)
|
||||
{
|
||||
off_t to_read;
|
||||
size_t to_read;
|
||||
char *read_ptr;
|
||||
|
||||
data = (struct mo_file_header *) malloc (st.st_size);
|
||||
data = (struct mo_file_header *) malloc (size);
|
||||
if (data == NULL)
|
||||
return;
|
||||
|
||||
to_read = st.st_size;
|
||||
to_read = size;
|
||||
read_ptr = (char *) data;
|
||||
do
|
||||
{
|
||||
@ -154,7 +156,7 @@ _nl_load_domain (domain_file)
|
||||
#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
|
||||
|| defined _LIBC
|
||||
if (use_mmap)
|
||||
munmap ((caddr_t) data, st.st_size);
|
||||
munmap ((caddr_t) data, size);
|
||||
else
|
||||
#endif
|
||||
free (data);
|
||||
@ -169,7 +171,7 @@ _nl_load_domain (domain_file)
|
||||
domain = (struct loaded_domain *) domain_file->data;
|
||||
domain->data = (char *) data;
|
||||
domain->use_mmap = use_mmap;
|
||||
domain->mmap_size = st.st_size;
|
||||
domain->mmap_size = size;
|
||||
domain->must_swap = data->magic != _MAGIC;
|
||||
|
||||
/* Fill in the information about the available tables. */
|
||||
@ -190,7 +192,7 @@ _nl_load_domain (domain_file)
|
||||
#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
|
||||
|| defined _LIBC
|
||||
if (use_mmap)
|
||||
munmap ((caddr_t) data, st.st_size);
|
||||
munmap ((caddr_t) data, size);
|
||||
else
|
||||
#endif
|
||||
free (data);
|
||||
|
@ -90,6 +90,9 @@ void free ();
|
||||
__libc_lock_define_initialized (static, lock);
|
||||
#endif
|
||||
|
||||
#ifndef internal_function
|
||||
# define internal_function
|
||||
#endif
|
||||
|
||||
/* For those loosing systems which don't have `alloca' we have to add
|
||||
some additional code emulating it. */
|
||||
@ -143,7 +146,8 @@ static size_t maxmap = 0;
|
||||
|
||||
|
||||
/* Prototypes for local functions. */
|
||||
static size_t read_alias_file PARAMS ((const char *fname, int fname_len));
|
||||
static size_t read_alias_file PARAMS ((const char *fname, int fname_len))
|
||||
internal_function;
|
||||
static void extend_alias_table PARAMS ((void));
|
||||
static int alias_compare PARAMS ((const struct alias_map *map1,
|
||||
const struct alias_map *map2));
|
||||
@ -212,6 +216,7 @@ _nl_expand_alias (name)
|
||||
|
||||
|
||||
static size_t
|
||||
internal_function
|
||||
read_alias_file (fname, fname_len)
|
||||
const char *fname;
|
||||
int fname_len;
|
||||
|
12
io/Makefile
12
io/Makefile
@ -29,21 +29,21 @@ headers := sys/stat.h bits/stat.h sys/statfs.h bits/statfs.h sys/vfs.h \
|
||||
routines := \
|
||||
utime \
|
||||
mkfifo \
|
||||
stat fstat lstat mknod \
|
||||
xstat fxstat lxstat xmknod \
|
||||
statfs fstatfs \
|
||||
stat fstat lstat mknod stat64 fstat64 lstat64 \
|
||||
xstat fxstat lxstat xmknod xstat64 fxstat64 lxstat64 \
|
||||
statfs fstatfs statfs64 fstatfs64 \
|
||||
umask chmod fchmod mkdir \
|
||||
open close read write lseek access euidaccess \
|
||||
open open64 close read write lseek lseek64 access euidaccess \
|
||||
fcntl flock lockf \
|
||||
dup dup2 pipe \
|
||||
creat \
|
||||
creat creat64 \
|
||||
chdir fchdir \
|
||||
getcwd getwd getdirname \
|
||||
chown fchown lchown \
|
||||
ttyname ttyname_r isatty \
|
||||
link symlink readlink \
|
||||
unlink rmdir \
|
||||
ftw fts poll
|
||||
ftw ftw64 fts poll
|
||||
|
||||
# These routines will be omitted from the libc shared object.
|
||||
# Instead the static object files will be included in a special archive
|
||||
|
31
io/creat64.c
Normal file
31
io/creat64.c
Normal file
@ -0,0 +1,31 @@
|
||||
/* Copyright (C) 1991, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#undef creat
|
||||
|
||||
/* Create FILE with protections MODE. */
|
||||
int
|
||||
creat64 (file, mode)
|
||||
const char *file;
|
||||
mode_t mode;
|
||||
{
|
||||
return __open64 (file, O_WRONLY|O_CREAT|O_TRUNC, mode);
|
||||
}
|
49
io/fcntl.h
49
io/fcntl.h
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 92, 94, 95, 96 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 92, 94, 95, 96, 97 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -33,14 +33,14 @@ __BEGIN_DECLS
|
||||
#include <bits/fcntl.h>
|
||||
|
||||
#ifdef __USE_MISC
|
||||
#ifndef R_OK /* Verbatim from <unistd.h>. Ugh. */
|
||||
# ifndef R_OK /* Verbatim from <unistd.h>. Ugh. */
|
||||
/* Values for the second argument to access.
|
||||
These may be OR'd together. */
|
||||
#define R_OK 4 /* Test for read permission. */
|
||||
#define W_OK 2 /* Test for write permission. */
|
||||
#define X_OK 1 /* Test for execute permission. */
|
||||
#define F_OK 0 /* Test for existence. */
|
||||
#endif
|
||||
# define R_OK 4 /* Test for read permission. */
|
||||
# define W_OK 2 /* Test for write permission. */
|
||||
# define X_OK 1 /* Test for execute permission. */
|
||||
# define F_OK 0 /* Test for existence. */
|
||||
# endif
|
||||
#endif /* Use misc. */
|
||||
|
||||
/* Do the file control operation described by CMD on FD.
|
||||
@ -52,14 +52,31 @@ extern int fcntl __P ((int __fd, int __cmd, ...));
|
||||
OFLAG determines the type of access used. If O_CREAT is on OFLAG,
|
||||
the third argument is taken as a `mode_t', the mode of the created file. */
|
||||
extern int __open __P ((__const char *__file, int __oflag, ...));
|
||||
extern int __open64 __P ((__const char *__file, int __oflag, ...));
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
extern int open __P ((__const char *__file, int __oflag, ...));
|
||||
#else
|
||||
extern int open __P ((__const char *__file, int __oflag, ...))
|
||||
__asm__ ("open64");
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern int open64 __P ((__const char *__file, int __oflag, ...));
|
||||
#endif
|
||||
|
||||
/* Create and open FILE, with mode MODE.
|
||||
This takes an `int' MODE argument because that is
|
||||
what `mode_t' will be widened to. */
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
extern int creat __P ((__const char *__file, __mode_t __mode));
|
||||
#else
|
||||
extern int creat __P ((__const char *__file, __mode_t __mode))
|
||||
__asm__ ("creat64");
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern int creat64 __P ((__const char *__file, __mode_t __mode));
|
||||
#endif
|
||||
|
||||
#if !defined(F_LOCK) && (defined(__USE_MISC) || defined(__USE_XOPEN_EXTENDED))
|
||||
#if !defined F_LOCK && (defined __USE_MISC || defined __USE_XOPEN_EXTENDED)
|
||||
/* NOTE: These declarations also appear in <unistd.h>; be sure to keep both
|
||||
files consistent. Some systems have them there and some here, and some
|
||||
software depends on the macros being defined without including both. */
|
||||
@ -68,12 +85,20 @@ extern int creat __P ((__const char *__file, __mode_t __mode));
|
||||
LEN is always relative to the current file position.
|
||||
The CMD argument is one of the following. */
|
||||
|
||||
#define F_ULOCK 0 /* Unlock a previously locked region. */
|
||||
#define F_LOCK 1 /* Lock a region for exclusive use. */
|
||||
#define F_TLOCK 2 /* Test and lock a region for exclusive use. */
|
||||
#define F_TEST 3 /* Test a region for other processes locks. */
|
||||
# define F_ULOCK 0 /* Unlock a previously locked region. */
|
||||
# define F_LOCK 1 /* Lock a region for exclusive use. */
|
||||
# define F_TLOCK 2 /* Test and lock a region for exclusive use. */
|
||||
# define F_TEST 3 /* Test a region for other processes locks. */
|
||||
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
extern int lockf __P ((int __fd, int __cmd, __off_t __len));
|
||||
# else
|
||||
extern int lockf __P ((int __fd, int __cmd, __off_t __len))
|
||||
__asm__ ("lockf64");
|
||||
# endif
|
||||
# ifdef __USE_LARGEFILE64
|
||||
extern int lockf64 __P ((int __fd, int __cmd, __off64_t __len));
|
||||
# endif
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
43
io/fstat64.c
Normal file
43
io/fstat64.c
Normal file
@ -0,0 +1,43 @@
|
||||
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
In addition to the permissions in the GNU Library General Public
|
||||
License, the Free Software Foundation gives you unlimited
|
||||
permission to link the compiled version of this file with other
|
||||
programs, and to distribute those programs without any restriction
|
||||
coming from the use of this file. (The Library General Public
|
||||
License restrictions do apply in other respects; for example, they
|
||||
cover modification of the file, and distribution when not linked
|
||||
into another program.)
|
||||
|
||||
The GNU C 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
/* This definition is only used if inlining fails for this function; see
|
||||
the last page of <sys/stat.h>. The real work is done by the `x'
|
||||
function which is passed a version number argument. We arrange in the
|
||||
makefile that when not inlined this function is always statically
|
||||
linked; that way a dynamically-linked executable always encodes the
|
||||
version number corresponding to the data structures it uses, so the `x'
|
||||
functions in the shared library can adapt without needing to recompile
|
||||
all callers. */
|
||||
|
||||
int
|
||||
fstat64 (int fd, struct stat64 *buf)
|
||||
{
|
||||
return __fxstat64 (_STAT_VER, fd, buf);
|
||||
}
|
24
io/fts.c
24
io/fts.c
@ -57,15 +57,15 @@ static char sccsid[] = "@(#)fts.c 8.2 (Berkeley) 1/2/94";
|
||||
#endif
|
||||
|
||||
|
||||
static FTSENT *fts_alloc __P((FTS *, const char *, int));
|
||||
static FTSENT *fts_build __P((FTS *, int));
|
||||
static void fts_lfree __P((FTSENT *));
|
||||
static FTSENT *fts_alloc __P((FTS *, const char *, int)) internal_function;
|
||||
static FTSENT *fts_build __P((FTS *, int)) internal_function;
|
||||
static void fts_lfree __P((FTSENT *)) internal_function;
|
||||
static void fts_load __P((FTS *, FTSENT *));
|
||||
static size_t fts_maxarglen __P((char * const *));
|
||||
static void fts_padjust __P((FTS *, void *));
|
||||
static int fts_palloc __P((FTS *, size_t));
|
||||
static FTSENT *fts_sort __P((FTS *, FTSENT *, int));
|
||||
static u_short fts_stat __P((FTS *, FTSENT *, int));
|
||||
static size_t fts_maxarglen __P((char * const *)) internal_function;
|
||||
static void fts_padjust __P((FTS *, void *)) internal_function;
|
||||
static int fts_palloc __P((FTS *, size_t)) internal_function;
|
||||
static FTSENT *fts_sort __P((FTS *, FTSENT *, int)) internal_function;
|
||||
static u_short fts_stat __P((FTS *, FTSENT *, int)) internal_function;
|
||||
|
||||
#ifndef MAX
|
||||
#define MAX(a, b) ({ __typeof__ (a) _a = (a); \
|
||||
@ -566,6 +566,7 @@ fts_children(sp, instr)
|
||||
* been found, cutting the stat calls by about 2/3.
|
||||
*/
|
||||
static FTSENT *
|
||||
internal_function
|
||||
fts_build(sp, type)
|
||||
register FTS *sp;
|
||||
int type;
|
||||
@ -780,6 +781,7 @@ mem1: saved_errno = errno;
|
||||
}
|
||||
|
||||
static u_short
|
||||
internal_function
|
||||
fts_stat(sp, p, follow)
|
||||
FTS *sp;
|
||||
register FTSENT *p;
|
||||
@ -852,6 +854,7 @@ err: bzero(sbp, sizeof(struct stat));
|
||||
}
|
||||
|
||||
static FTSENT *
|
||||
internal_function
|
||||
fts_sort(sp, head, nitems)
|
||||
FTS *sp;
|
||||
FTSENT *head;
|
||||
@ -884,6 +887,7 @@ fts_sort(sp, head, nitems)
|
||||
}
|
||||
|
||||
static FTSENT *
|
||||
internal_function
|
||||
fts_alloc(sp, name, namelen)
|
||||
FTS *sp;
|
||||
const char *name;
|
||||
@ -922,6 +926,7 @@ fts_alloc(sp, name, namelen)
|
||||
}
|
||||
|
||||
static void
|
||||
internal_function
|
||||
fts_lfree(head)
|
||||
register FTSENT *head;
|
||||
{
|
||||
@ -941,6 +946,7 @@ fts_lfree(head)
|
||||
* plus 256 bytes so don't realloc the path 2 bytes at a time.
|
||||
*/
|
||||
static int
|
||||
internal_function
|
||||
fts_palloc(sp, more)
|
||||
FTS *sp;
|
||||
size_t more;
|
||||
@ -955,6 +961,7 @@ fts_palloc(sp, more)
|
||||
* already returned.
|
||||
*/
|
||||
static void
|
||||
internal_function
|
||||
fts_padjust(sp, addr)
|
||||
FTS *sp;
|
||||
void *addr;
|
||||
@ -978,6 +985,7 @@ fts_padjust(sp, addr)
|
||||
}
|
||||
|
||||
static size_t
|
||||
internal_function
|
||||
fts_maxarglen(argv)
|
||||
char * const *argv;
|
||||
{
|
||||
|
61
io/ftw.c
61
io/ftw.c
@ -31,6 +31,19 @@
|
||||
/* #define NDEBUG 1 */
|
||||
#include <assert.h>
|
||||
|
||||
/* Support for the LFS API version. */
|
||||
#ifndef FTW_NAME
|
||||
# define FTW_NAME ftw
|
||||
# define NFTW_NAME nftw
|
||||
# define INO_T ino_t
|
||||
# define STAT stat
|
||||
# define DIRENT dirent
|
||||
# define READDIR readdir
|
||||
# define LXSTAT __lxstat
|
||||
# define XSTAT __xstat
|
||||
# define FTW_FUNC_T __ftw_func_t
|
||||
# define NFTW_FUNC_T __nftw_func_t
|
||||
#endif
|
||||
|
||||
struct dir_data
|
||||
{
|
||||
@ -41,7 +54,7 @@ struct dir_data
|
||||
struct known_object
|
||||
{
|
||||
dev_t dev;
|
||||
ino_t ino;
|
||||
INO_T ino;
|
||||
};
|
||||
|
||||
struct ftw_data
|
||||
@ -68,7 +81,7 @@ struct ftw_data
|
||||
int *cvt_arr;
|
||||
|
||||
/* Callback function. We always use the `nftw' form. */
|
||||
__nftw_func_t func;
|
||||
NFTW_FUNC_T func;
|
||||
|
||||
/* Device of starting point. Needed for FTW_MOUNT. */
|
||||
dev_t dev;
|
||||
@ -94,7 +107,7 @@ static int ftw_arr[] =
|
||||
|
||||
|
||||
/* Forward declarations of local functions. */
|
||||
static int ftw_dir (struct ftw_data *data, struct stat *st);
|
||||
static int ftw_dir (struct ftw_data *data, struct STAT *st) internal_function;
|
||||
|
||||
|
||||
static int
|
||||
@ -113,7 +126,7 @@ object_compare (const void *p1, const void *p2)
|
||||
|
||||
|
||||
static inline int
|
||||
add_object (struct ftw_data *data, struct stat *st)
|
||||
add_object (struct ftw_data *data, struct STAT *st)
|
||||
{
|
||||
struct known_object *newp = malloc (sizeof (struct known_object));
|
||||
if (newp == NULL)
|
||||
@ -125,7 +138,7 @@ add_object (struct ftw_data *data, struct stat *st)
|
||||
|
||||
|
||||
static inline int
|
||||
find_object (struct ftw_data *data, struct stat *st)
|
||||
find_object (struct ftw_data *data, struct STAT *st)
|
||||
{
|
||||
struct known_object obj = { dev: st->st_dev, ino: st->st_ino };
|
||||
return __tfind (&obj, &data->known_objects, object_compare) != NULL;
|
||||
@ -150,10 +163,10 @@ open_dir_stream (struct ftw_data *data, struct dir_data *dirp)
|
||||
else
|
||||
{
|
||||
DIR *st = data->dirstreams[data->actdir]->stream;
|
||||
struct dirent *d;
|
||||
struct DIRENT *d;
|
||||
size_t actsize = 0;
|
||||
|
||||
while ((d = readdir (st)) != NULL)
|
||||
while ((d = READDIR (st)) != NULL)
|
||||
{
|
||||
size_t this_len = _D_EXACT_NAMLEN (d);
|
||||
if (actsize + this_len + 2 >= bufsize)
|
||||
@ -225,7 +238,7 @@ static inline int
|
||||
process_entry (struct ftw_data *data, struct dir_data *dir, const char *name,
|
||||
size_t namlen)
|
||||
{
|
||||
struct stat st;
|
||||
struct STAT st;
|
||||
int result = 0;
|
||||
int flag;
|
||||
|
||||
@ -250,13 +263,13 @@ process_entry (struct ftw_data *data, struct dir_data *dir, const char *name,
|
||||
data->dirbuf[data->ftw.base + namlen] = '\0';
|
||||
|
||||
if (((data->flags & FTW_PHYS)
|
||||
? __lxstat (_STAT_VER, data->dirbuf, &st)
|
||||
: __xstat (_STAT_VER, data->dirbuf, &st)) < 0)
|
||||
? LXSTAT (_STAT_VER, data->dirbuf, &st)
|
||||
: XSTAT (_STAT_VER, data->dirbuf, &st)) < 0)
|
||||
{
|
||||
if (errno != EACCES && errno != ENOENT)
|
||||
result = -1;
|
||||
else if (!(data->flags & FTW_PHYS)
|
||||
&& __lxstat (_STAT_VER, data->dirbuf, &st) == 0
|
||||
&& LXSTAT (_STAT_VER, data->dirbuf, &st) == 0
|
||||
&& S_ISLNK (st.st_mode))
|
||||
flag = FTW_SLN;
|
||||
else
|
||||
@ -324,10 +337,11 @@ process_entry (struct ftw_data *data, struct dir_data *dir, const char *name,
|
||||
|
||||
|
||||
static int
|
||||
ftw_dir (struct ftw_data *data, struct stat *st)
|
||||
internal_function
|
||||
ftw_dir (struct ftw_data *data, struct STAT *st)
|
||||
{
|
||||
struct dir_data dir;
|
||||
struct dirent *d;
|
||||
struct DIRENT *d;
|
||||
int previous_base = data->ftw.base;
|
||||
int result;
|
||||
char *startp;
|
||||
@ -386,7 +400,7 @@ ftw_dir (struct ftw_data *data, struct stat *st)
|
||||
*startp++ = '/';
|
||||
data->ftw.base = startp - data->dirbuf;
|
||||
|
||||
while (dir.stream != NULL && (d = readdir (dir.stream)) != NULL)
|
||||
while (dir.stream != NULL && (d = READDIR (dir.stream)) != NULL)
|
||||
{
|
||||
result = process_entry (data, &dir, d->d_name, _D_EXACT_NAMLEN (d));
|
||||
if (result != 0)
|
||||
@ -445,11 +459,12 @@ ftw_dir (struct ftw_data *data, struct stat *st)
|
||||
|
||||
|
||||
static int
|
||||
internal_function
|
||||
ftw_startup (const char *dir, int is_nftw, void *func, int descriptors,
|
||||
int flags)
|
||||
{
|
||||
struct ftw_data data;
|
||||
struct stat st;
|
||||
struct STAT st;
|
||||
int result = 0;
|
||||
int save_err;
|
||||
char *cwd = NULL;
|
||||
@ -497,7 +512,7 @@ ftw_startup (const char *dir, int is_nftw, void *func, int descriptors,
|
||||
every case the callback using the format of the `nftw' version
|
||||
and get the correct result since the stack layout for a function
|
||||
call in C allows this. */
|
||||
data.func = (__nftw_func_t) func;
|
||||
data.func = (NFTW_FUNC_T) func;
|
||||
|
||||
/* Since we internally use the complete set of FTW_* values we need
|
||||
to reduce the value range before calling a `ftw' callback. */
|
||||
@ -534,14 +549,14 @@ ftw_startup (const char *dir, int is_nftw, void *func, int descriptors,
|
||||
/* Get stat info for start directory. */
|
||||
if (result == 0)
|
||||
if (((flags & FTW_PHYS)
|
||||
? __lxstat (_STAT_VER, data.dirbuf, &st)
|
||||
: __xstat (_STAT_VER, data.dirbuf, &st)) < 0)
|
||||
? LXSTAT (_STAT_VER, data.dirbuf, &st)
|
||||
: XSTAT (_STAT_VER, data.dirbuf, &st)) < 0)
|
||||
{
|
||||
if (errno == EACCES)
|
||||
result = (*data.func) (data.dirbuf, &st, FTW_NS, &data.ftw);
|
||||
else if (!(flags & FTW_PHYS)
|
||||
&& errno == ENOENT
|
||||
&& __lxstat (_STAT_VER, dir, &st) == 0
|
||||
&& LXSTAT (_STAT_VER, dir, &st) == 0
|
||||
&& S_ISLNK (st.st_mode))
|
||||
result = (*data.func) (data.dirbuf, &st, data.cvt_arr[FTW_SLN],
|
||||
&data.ftw);
|
||||
@ -597,18 +612,18 @@ ftw_startup (const char *dir, int is_nftw, void *func, int descriptors,
|
||||
/* Entry points. */
|
||||
|
||||
int
|
||||
ftw (path, func, descriptors)
|
||||
FTW_NAME (path, func, descriptors)
|
||||
const char *path;
|
||||
__ftw_func_t func;
|
||||
FTW_FUNC_T func;
|
||||
int descriptors;
|
||||
{
|
||||
return ftw_startup (path, 0, func, descriptors, 0);
|
||||
}
|
||||
|
||||
int
|
||||
nftw (path, func, descriptors, flags)
|
||||
NFTW_NAME (path, func, descriptors, flags)
|
||||
const char *path;
|
||||
__nftw_func_t func;
|
||||
NFTW_FUNC_T func;
|
||||
int descriptors;
|
||||
int flags;
|
||||
{
|
||||
|
24
io/ftw.h
24
io/ftw.h
@ -88,21 +88,45 @@ struct FTW
|
||||
/* Convenient types for callback functions. */
|
||||
typedef int (*__ftw_func_t) __P ((__const char *__filename,
|
||||
__const struct stat *__status, int __flag));
|
||||
typedef int (*__ftw64_func_t) __P ((__const char *__filename,
|
||||
__const struct stat64 *__status,
|
||||
int __flag));
|
||||
#ifdef __USE_XOPEN_EXTENDED
|
||||
typedef int (*__nftw_func_t) __P ((__const char *__filename,
|
||||
__const struct stat *__status, int __flag,
|
||||
struct FTW *__info));
|
||||
typedef int (*__nftw64_func_t) __P ((__const char *__filename,
|
||||
__const struct stat64 *__status,
|
||||
int __flag, struct FTW *__info));
|
||||
#endif
|
||||
|
||||
/* Call a function on every element in a directory tree. */
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
extern int ftw __P ((__const char *__dir, __ftw_func_t __func,
|
||||
int __descriptors));
|
||||
#else
|
||||
extern int ftw __P ((__const char *__dir, __ftw64_func_t __func,
|
||||
int __descriptors)) __asm__ ("ftw64");
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern int ftw64 __P ((__const char *__dir, __ftw64_func_t __func,
|
||||
int __descriptors));
|
||||
#endif
|
||||
|
||||
#ifdef __USE_XOPEN_EXTENDED
|
||||
/* Call a function on every element in a directory tree. FLAG allows
|
||||
to specify the behaviour more detailed. */
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
extern int nftw __P ((__const char *__dir, __nftw_func_t __func,
|
||||
int __descriptors, int __flag));
|
||||
# else
|
||||
extern int nftw __P ((__const char *__dir, __nftw64_func_t __func,
|
||||
int __descriptors, int __flag)) __asm__ ("nftw64");
|
||||
# endif
|
||||
# ifdef __USE_LARGEFILE64
|
||||
extern int nftw64 __P ((__const char *__dir, __nftw64_func_t __func,
|
||||
int __descriptors, int __flag));
|
||||
# endif
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
32
io/ftw64.c
Normal file
32
io/ftw64.c
Normal file
@ -0,0 +1,32 @@
|
||||
/* File tree walker functions. LFS version.
|
||||
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#define FTW_NAME ftw64
|
||||
#define NFTW_NAME nftw64
|
||||
#define INO_T ino64_t
|
||||
#define STAT stat64
|
||||
#define DIRENT dirent64
|
||||
#define READDIR readdir64
|
||||
#define LXSTAT __lxstat64
|
||||
#define XSTAT __xstat64
|
||||
#define FTW_FUNC_T __ftw64_func_t
|
||||
#define NFTW_FUNC_T __nftw64_func_t
|
||||
|
||||
#include "ftw.c"
|
43
io/lstat64.c
Normal file
43
io/lstat64.c
Normal file
@ -0,0 +1,43 @@
|
||||
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
In addition to the permissions in the GNU Library General Public
|
||||
License, the Free Software Foundation gives you unlimited
|
||||
permission to link the compiled version of this file with other
|
||||
programs, and to distribute those programs without any restriction
|
||||
coming from the use of this file. (The Library General Public
|
||||
License restrictions do apply in other respects; for example, they
|
||||
cover modification of the file, and distribution when not linked
|
||||
into another program.)
|
||||
|
||||
The GNU C 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
/* This definition is only used if inlining fails for this function; see
|
||||
the last page of <sys/stat.h>. The real work is done by the `x'
|
||||
function which is passed a version number argument. We arrange in the
|
||||
makefile that when not inlined this function is always statically
|
||||
linked; that way a dynamically-linked executable always encodes the
|
||||
version number corresponding to the data structures it uses, so the `x'
|
||||
functions in the shared library can adapt without needing to recompile
|
||||
all callers. */
|
||||
|
||||
int
|
||||
lstat64 (const char *file, struct stat64 *buf)
|
||||
{
|
||||
return __lxstat64 (_STAT_VER, file, buf);
|
||||
}
|
43
io/stat64.c
Normal file
43
io/stat64.c
Normal file
@ -0,0 +1,43 @@
|
||||
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
In addition to the permissions in the GNU Library General Public
|
||||
License, the Free Software Foundation gives you unlimited
|
||||
permission to link the compiled version of this file with other
|
||||
programs, and to distribute those programs without any restriction
|
||||
coming from the use of this file. (The Library General Public
|
||||
License restrictions do apply in other respects; for example, they
|
||||
cover modification of the file, and distribution when not linked
|
||||
into another program.)
|
||||
|
||||
The GNU C 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
/* This definition is only used if inlining fails for this function; see
|
||||
the last page of <sys/stat.h>. The real work is done by the `x'
|
||||
function which is passed a version number argument. We arrange in the
|
||||
makefile that when not inlined this function is always statically
|
||||
linked; that way a dynamically-linked executable always encodes the
|
||||
version number corresponding to the data structures it uses, so the `x'
|
||||
functions in the shared library can adapt without needing to recompile
|
||||
all callers. */
|
||||
|
||||
int
|
||||
stat64 (const char *file, struct stat64 *buf)
|
||||
{
|
||||
return __xstat64 (_STAT_VER, file, buf);
|
||||
}
|
196
io/sys/stat.h
196
io/sys/stat.h
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 1992, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -31,42 +31,42 @@ __BEGIN_DECLS
|
||||
|
||||
#include <bits/stat.h>
|
||||
|
||||
#if defined(__USE_BSD) || defined(__USE_MISC)
|
||||
#define S_IFMT __S_IFMT
|
||||
#define S_IFDIR __S_IFDIR
|
||||
#define S_IFCHR __S_IFCHR
|
||||
#define S_IFBLK __S_IFBLK
|
||||
#define S_IFREG __S_IFREG
|
||||
#ifdef __S_IFLNK
|
||||
#define S_IFLNK __S_IFLNK
|
||||
#endif
|
||||
#ifdef __S_IFSOCK
|
||||
#define S_IFSOCK __S_IFSOCK
|
||||
#endif
|
||||
#ifdef __S_IFIFO
|
||||
#define S_IFIFO __S_IFIFO
|
||||
#endif
|
||||
#if defined __USE_BSD || defined __USE_MISC
|
||||
# define S_IFMT __S_IFMT
|
||||
# define S_IFDIR __S_IFDIR
|
||||
# define S_IFCHR __S_IFCHR
|
||||
# define S_IFBLK __S_IFBLK
|
||||
# define S_IFREG __S_IFREG
|
||||
# ifdef __S_IFLNK
|
||||
# define S_IFLNK __S_IFLNK
|
||||
# endif
|
||||
# ifdef __S_IFSOCK
|
||||
# define S_IFSOCK __S_IFSOCK
|
||||
# endif
|
||||
# ifdef __S_IFIFO
|
||||
# define S_IFIFO __S_IFIFO
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Test macros for file types. */
|
||||
|
||||
#define __S_ISTYPE(mode, mask) (((mode) & __S_IFMT) == (mask))
|
||||
|
||||
#define S_ISDIR(mode) __S_ISTYPE((mode), __S_IFDIR)
|
||||
#define S_ISCHR(mode) __S_ISTYPE((mode), __S_IFCHR)
|
||||
#define S_ISBLK(mode) __S_ISTYPE((mode), __S_IFBLK)
|
||||
#define S_ISREG(mode) __S_ISTYPE((mode), __S_IFREG)
|
||||
#define S_ISDIR(mode) __S_ISTYPE((mode), __S_IFDIR)
|
||||
#define S_ISCHR(mode) __S_ISTYPE((mode), __S_IFCHR)
|
||||
#define S_ISBLK(mode) __S_ISTYPE((mode), __S_IFBLK)
|
||||
#define S_ISREG(mode) __S_ISTYPE((mode), __S_IFREG)
|
||||
#ifdef __S_IFIFO
|
||||
#define S_ISFIFO(mode) __S_ISTYPE((mode), __S_IFIFO)
|
||||
# define S_ISFIFO(mode) __S_ISTYPE((mode), __S_IFIFO)
|
||||
#endif
|
||||
|
||||
#ifdef __USE_BSD
|
||||
#ifdef __S_IFLNK
|
||||
#define S_ISLNK(mode) __S_ISTYPE((mode), __S_IFLNK)
|
||||
#endif
|
||||
#ifdef __S_IFSOCK
|
||||
#define S_ISSOCK(mode) __S_ISTYPE((mode), __S_IFSOCK)
|
||||
#endif
|
||||
# ifdef __S_IFLNK
|
||||
# define S_ISLNK(mode) __S_ISTYPE((mode), __S_IFLNK)
|
||||
# endif
|
||||
# ifdef __S_IFSOCK
|
||||
# define S_ISSOCK(mode) __S_ISTYPE((mode), __S_IFSOCK)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
@ -75,9 +75,9 @@ __BEGIN_DECLS
|
||||
#define S_ISUID __S_ISUID /* Set user ID on execution. */
|
||||
#define S_ISGID __S_ISGID /* Set group ID on execution. */
|
||||
|
||||
#if defined(__USE_BSD) || defined(__USE_MISC)
|
||||
#if defined __USE_BSD || defined __USE_MISC
|
||||
/* Save swapped text after use (sticky bit). This is pretty well obsolete. */
|
||||
#define S_ISVTX __S_ISVTX
|
||||
# define S_ISVTX __S_ISVTX
|
||||
#endif
|
||||
|
||||
#define S_IRUSR __S_IREAD /* Read by owner. */
|
||||
@ -86,10 +86,10 @@ __BEGIN_DECLS
|
||||
/* Read, write, and execute by owner. */
|
||||
#define S_IRWXU (__S_IREAD|__S_IWRITE|__S_IEXEC)
|
||||
|
||||
#if defined(__USE_MISC) && defined(__USE_BSD)
|
||||
#define S_IREAD S_IRUSR
|
||||
#define S_IWRITE S_IWUSR
|
||||
#define S_IEXEC S_IXUSR
|
||||
#if defined __USE_MISC && defined __USE_BSD
|
||||
# define S_IREAD S_IRUSR
|
||||
# define S_IWRITE S_IWUSR
|
||||
# define S_IEXEC S_IXUSR
|
||||
#endif
|
||||
|
||||
#define S_IRGRP (S_IRUSR >> 3) /* Read by group. */
|
||||
@ -107,28 +107,51 @@ __BEGIN_DECLS
|
||||
|
||||
#ifdef __USE_BSD
|
||||
/* Macros for common mode bit masks. */
|
||||
#define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */
|
||||
#define ALLPERMS (S_ISUID|S_ISGID|S_ISTXT|S_IRWXU|S_IRWXG|S_IRWXO)/* 07777 */
|
||||
#define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)/* 0666 */
|
||||
# define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */
|
||||
# define ALLPERMS (S_ISUID|S_ISGID|S_ISTXT|S_IRWXU|S_IRWXG|S_IRWXO)/* 07777 */
|
||||
# define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)/* 0666*/
|
||||
|
||||
#define S_BLKSIZE 512 /* Block size for `st_blocks'. */
|
||||
# define S_BLKSIZE 512 /* Block size for `st_blocks'. */
|
||||
#endif
|
||||
|
||||
|
||||
/* Get file attributes for FILE and put them in BUF. */
|
||||
extern int __stat __P ((__const char *__file, struct stat *__buf));
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
extern int stat __P ((__const char *__file, struct stat *__buf));
|
||||
#else
|
||||
extern int stat __P ((__const char *__file, struct stat *__buf))
|
||||
__asm__ ("stat64");
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern int stat64 __P ((__const char *__file, struct stat64 *__buf));
|
||||
#endif
|
||||
|
||||
/* Get file attributes for the file, device, pipe, or socket
|
||||
that file descriptor FD is open on and put them in BUF. */
|
||||
extern int __fstat __P ((int __fd, struct stat *__buf));
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
extern int fstat __P ((int __fd, struct stat *__buf));
|
||||
#else
|
||||
extern int fstat __P ((int __fd, struct stat *__buf)) __asm__ ("fstat64");
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern int fstat64 __P ((int __fd, struct stat64 *__buf));
|
||||
#endif
|
||||
|
||||
/* Get file attributes about FILE and put them in BUF.
|
||||
If FILE is a symbolic link, do not follow it. */
|
||||
extern int __lstat __P ((__const char *__file, struct stat *__buf));
|
||||
#if defined(__USE_BSD) || defined(__USE_XOPEN_EXTENDED)
|
||||
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
extern int lstat __P ((__const char *__file, struct stat *__buf));
|
||||
# else
|
||||
extern int lstat __P ((__const char *__file, struct stat *__buf))
|
||||
__asm__ ("lstat64");
|
||||
# endif
|
||||
# ifdef __USE_LARGEFILE64
|
||||
extern int lstat64 __P ((__const char *__file, struct stat64 *__buf));
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Set file access permissions for FILE to MODE.
|
||||
@ -139,7 +162,7 @@ extern int chmod __P ((__const char *__file, __mode_t __mode));
|
||||
|
||||
/* Set file access permissions of the file FD is open on to MODE. */
|
||||
extern int __fchmod __P ((int __fd, __mode_t __mode));
|
||||
#if defined(__USE_BSD) || defined(__USE_XOPEN_EXTENDED)
|
||||
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
|
||||
extern int fchmod __P ((int __fd, __mode_t __mode));
|
||||
#endif
|
||||
|
||||
@ -164,7 +187,7 @@ extern int mkdir __P ((__const char *__path, __mode_t __mode));
|
||||
device numbers with the `makedev' macro above). */
|
||||
extern int __mknod __P ((__const char *__path,
|
||||
__mode_t __mode, __dev_t __dev));
|
||||
#if defined(__USE_MISC) || defined(__USE_BSD) || defined(__USE_XOPEN_EXTENDED)
|
||||
#if defined __USE_MISC || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
|
||||
extern int mknod __P ((__const char *__path,
|
||||
__mode_t __mode, __dev_t __dev));
|
||||
#endif
|
||||
@ -189,10 +212,10 @@ extern int mkfifo __P ((__const char *__path, __mode_t __mode));
|
||||
callers. */
|
||||
|
||||
#ifndef _STAT_VER
|
||||
#define _STAT_VER 0
|
||||
# define _STAT_VER 0
|
||||
#endif
|
||||
#ifndef _MKNOD_VER
|
||||
#define _MKNOD_VER 0
|
||||
# define _MKNOD_VER 0
|
||||
#endif
|
||||
|
||||
/* Wrappers for stat and mknod system calls. */
|
||||
@ -204,35 +227,98 @@ extern int __lxstat __P ((int __ver, __const char *__filename,
|
||||
struct stat *__stat_buf));
|
||||
extern int __xmknod __P ((int __ver, __const char *__path,
|
||||
__mode_t __mode, __dev_t *__dev));
|
||||
#if defined __USE_LARGEFILE64 || defined __USE_FILE_OFFSET64
|
||||
extern int __fxstat64 __P ((int __ver, int __fildes,
|
||||
struct stat64 *__stat_buf));
|
||||
extern int __xstat64 __P ((int __ver, __const char *__filename,
|
||||
struct stat64 *__stat_buf));
|
||||
extern int __lxstat64 __P ((int __ver, __const char *__filename,
|
||||
struct stat64 *__stat_buf));
|
||||
#endif
|
||||
|
||||
#if defined (__GNUC__) && __GNUC__ >= 2
|
||||
#if defined __GNUC__ && __GNUC__ >= 2
|
||||
/* Inlined versions of the real stat and mknod functions. */
|
||||
|
||||
extern __inline__ int __stat (__const char *__path, struct stat *__statbuf)
|
||||
{ return __xstat (_STAT_VER, __path, __statbuf); }
|
||||
{
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
return __xstat (_STAT_VER, __path, __statbuf);
|
||||
# else
|
||||
return __xstat64 (_STAT_VER, __path, __statbuf);
|
||||
# endif
|
||||
}
|
||||
extern __inline__ int stat (__const char *__path, struct stat *__statbuf)
|
||||
{ return __xstat (_STAT_VER, __path, __statbuf); }
|
||||
{
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
return __xstat (_STAT_VER, __path, __statbuf);
|
||||
# else
|
||||
return __xstat64 (_STAT_VER, __path, __statbuf);
|
||||
# endif
|
||||
}
|
||||
|
||||
extern __inline__ int __lstat(__const char *__path, struct stat *__statbuf)
|
||||
{ return __lxstat (_STAT_VER, __path, __statbuf); }
|
||||
#if defined(__USE_BSD) || defined(__USE_XOPEN_EXTENDED)
|
||||
extern __inline__ int lstat(__const char *__path, struct stat *__statbuf)
|
||||
{ return __lxstat (_STAT_VER, __path, __statbuf); }
|
||||
#endif
|
||||
extern __inline__ int __lstat (__const char *__path, struct stat *__statbuf)
|
||||
{
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
return __lxstat (_STAT_VER, __path, __statbuf);
|
||||
# else
|
||||
return __lxstat64 (_STAT_VER, __path, __statbuf);
|
||||
# endif
|
||||
}
|
||||
# if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
|
||||
extern __inline__ int lstat (__const char *__path, struct stat *__statbuf)
|
||||
{
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
return __lxstat (_STAT_VER, __path, __statbuf);
|
||||
# else
|
||||
return __lxstat64 (_STAT_VER, __path, __statbuf);
|
||||
# endif
|
||||
}
|
||||
# endif
|
||||
|
||||
extern __inline__ int __fstat (int __fd, struct stat *__statbuf)
|
||||
{ return __fxstat (_STAT_VER, __fd, __statbuf); }
|
||||
{
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
return __fxstat (_STAT_VER, __fd, __statbuf);
|
||||
# else
|
||||
return __fxstat64 (_STAT_VER, __fd, __statbuf);
|
||||
# endif
|
||||
}
|
||||
extern __inline__ int fstat (int __fd, struct stat *__statbuf)
|
||||
{ return __fxstat (_STAT_VER, __fd, __statbuf); }
|
||||
{
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
return __fxstat (_STAT_VER, __fd, __statbuf);
|
||||
# else
|
||||
return __fxstat64 (_STAT_VER, __fd, __statbuf);
|
||||
# endif
|
||||
}
|
||||
|
||||
extern __inline__ int __mknod (__const char *__path, __mode_t __mode,
|
||||
__dev_t __dev)
|
||||
{ return __xmknod (_MKNOD_VER, __path, __mode, &__dev); }
|
||||
#if defined(__USE_MISC) || defined(__USE_BSD)
|
||||
# if defined __USE_MISC || defined __USE_BSD
|
||||
extern __inline__ int mknod (__const char *__path, __mode_t __mode,
|
||||
__dev_t __dev)
|
||||
{ return __xmknod (_MKNOD_VER, __path, __mode, &__dev); }
|
||||
#endif
|
||||
# endif
|
||||
|
||||
# ifdef __USE_LARGEFILE64
|
||||
extern __inline__ int stat64 (__const char *__path, struct stat64 *__statbuf)
|
||||
{
|
||||
return __xstat64 (_STAT_VER, __path, __statbuf);
|
||||
}
|
||||
|
||||
# if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
|
||||
extern __inline__ int lstat64 (__const char *__path, struct stat64 *__statbuf)
|
||||
{
|
||||
return __lxstat64 (_STAT_VER, __path, __statbuf);
|
||||
}
|
||||
# endif
|
||||
|
||||
extern __inline__ int fstat64 (int __fd, struct stat64 *__statbuf)
|
||||
{
|
||||
return __fxstat64 (_STAT_VER, __fd, __statbuf);
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Definitions for getting information about a filesystem.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -29,12 +29,28 @@ __BEGIN_DECLS
|
||||
|
||||
/* Return information about the filesystem on which FILE resides. */
|
||||
extern int __statfs __P ((__const char *__file, struct statfs *__buf));
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
extern int statfs __P ((__const char *__file, struct statfs *__buf));
|
||||
#else
|
||||
extern int statfs __P ((__const char *__file, struct statfs *__buf))
|
||||
__asm__ ("statfs64");
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern int statfs64 __P ((__const char *__file, struct statfs64 *__buf));
|
||||
#endif
|
||||
|
||||
/* Return information about the filesystem containing the file FILDES
|
||||
refers to. */
|
||||
extern int __fstatfs __P ((int __fildes, struct statfs *__buf));
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
extern int fstatfs __P ((int __fildes, struct statfs *__buf));
|
||||
#else
|
||||
extern int fstatfs __P ((int __fildes, struct statfs *__buf))
|
||||
__asm__ ("fstatfs64");
|
||||
#endif
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern int fstatfs64 __P ((int __fildes, struct statfs64 *__buf));
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
75
libc.map
75
libc.map
@ -11,9 +11,12 @@ GLIBC_2.0 {
|
||||
_nl_current_LC_COLLATE; __collate_element_hash;
|
||||
__collate_element_strings; __collate_symbol_classes;
|
||||
__collate_symbol_hash; __collate_symbol_strings;
|
||||
_obstack; _libio_using_thunks;
|
||||
_obstack;
|
||||
__progname_full; __progname;
|
||||
|
||||
# This is for ix86 only.
|
||||
_fp_hw;
|
||||
|
||||
# helper functions
|
||||
__errno_location; __libc_init_first; __h_errno_location;
|
||||
|
||||
@ -55,19 +58,19 @@ GLIBC_2.0 {
|
||||
_obstack_free; _obstack_memory_used; _obstack_newchunk;
|
||||
__assert_fail; __assert_perror_fail;
|
||||
_IO_getc; _IO_peekc_unlocked; _IO_putc; _IO_feof; _IO_ferror;
|
||||
__xstat; __fxstat; __lxstat; __xmknod; __dcgettext;
|
||||
__uflow; __underflow; __overflow; __iswctype; __sigpause;
|
||||
__ctype_get_mb_cur_max;
|
||||
__xstat; __fxstat; __lxstat; __xstat64; __fxstat64; __lxstat64; __xmknod;
|
||||
__dcgettext; __uflow; __underflow; __overflow; __iswctype; __sigpause;
|
||||
__ctype_get_mb_cur_max; __bzero;
|
||||
|
||||
# functions used in other libraries
|
||||
__printf_fp; __stpncpy; __stpcpy; __strdup;
|
||||
__printf_fp; __stpncpy; __stpcpy; __strdup; __mempcpy;
|
||||
_nss_files_parse_grent; _nss_files_parse_pwent; _nss_files_parse_spent;
|
||||
__nss_database_lookup; __internal_endnetgrent; __internal_getnetgrent_r;
|
||||
__internal_setnetgrent; __gmtime_r; __secure_getenv;
|
||||
__select; __sched_get_priority_max; __sched_get_priority_min;
|
||||
__sched_getparam; __sched_getscheduler; __sched_setscheduler;
|
||||
__sched_yield; __on_exit; __gettimeofday; __fork; __clone;
|
||||
__nss_configure_lookup; _dl_open; _dl_close; _IO_file_setbuf;
|
||||
__nss_configure_lookup; _dl_open; _dl_close; _dl_addr; _IO_file_setbuf;
|
||||
_IO_file_init; _IO_file_attach; _IO_do_write; _IO_seekoff;
|
||||
_IO_link_in; _IO_file_open; _IO_file_doallocate; _IO_file_fopen;
|
||||
_IO_file_overflow; _IO_file_underflow; _IO_file_sync; _IO_file_seekoff;
|
||||
@ -149,8 +152,8 @@ GLIBC_2.0 {
|
||||
clntraw_create; clnttcp_create; clntudp_bufcreate; clntudp_create;
|
||||
|
||||
clock; clone; close; closedir; closelog; confstr; connect; copysign;
|
||||
copysignf; copysignl; creat; create_module; ctermid; ctime; ctime_r;
|
||||
cuserid;
|
||||
copysignf; copysignl; creat; creat64; create_module; ctermid; ctime;
|
||||
ctime_r; cuserid;
|
||||
|
||||
# d*
|
||||
daemon; dcgettext; delete_module; des_setparity; dgettext;
|
||||
@ -173,13 +176,14 @@ GLIBC_2.0 {
|
||||
fchdir; fchflags; fchmod; fchown; fclose; fcloseall; fcntl; fcvt;
|
||||
fcvt_r; fdatasync; fdopen; feof; feof_unlocked; ferror;
|
||||
ferror_unlocked; fexecve; fflush; fflush_unlocked; ffs; fgetc;
|
||||
fgetgrent; fgetgrent_r; fgetpos; fgetpwent; fgetpwent_r; fgets;
|
||||
fgetgrent; fgetgrent_r; fgetpos; fgetpos64; fgetpwent; fgetpwent_r; fgets;
|
||||
fgetspent; fgetspent_r; fileno; fileno_unlocked; finite; finitef;
|
||||
finitel; flock; flockfile; fmtmsg; fnmatch; fopen; fopencookie; fork;
|
||||
fpathconf; fprintf; fputc; fputc_unlocked; fputs; fread; free;
|
||||
freeaddrinfo; freopen; frexp; frexpf; frexpl; fscanf; fseek; fseeko;
|
||||
fsetpos; fstatfs; fsync; ftell; ftello; ftime; ftok; ftruncate;
|
||||
ftrylockfile; fts_children; fts_close; fts_open; fts_read; fts_set; ftw;
|
||||
finitel; flock; flockfile; fmtmsg; fnmatch; fopen; fopen64; fopencookie;
|
||||
fork; fpathconf; fprintf; fputc; fputc_unlocked; fputs; fread; free;
|
||||
freeaddrinfo; freopen; freopen64; frexp; frexpf; frexpl; fscanf; fseek;
|
||||
fseeko; fseeko64; fsetpos; fsetpos64; fstatfs; fstatfs64; fsync; ftell;
|
||||
ftello; ftello64; ftime; ftok; ftruncate; ftruncate64; ftrylockfile;
|
||||
fts_children; fts_close; fts_open; fts_read; fts_set; ftw; ftw64;
|
||||
funlockfile; fwrite;
|
||||
|
||||
# g*
|
||||
@ -203,7 +207,7 @@ GLIBC_2.0 {
|
||||
getprotobynumber_r; getprotoent; getprotoent_r; getpublickey; getpw;
|
||||
getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r;
|
||||
getresgid; getresuid;
|
||||
getrlimit; getrpcbyname; getrpcbyname_r; getrpcbynumber;
|
||||
getrlimit; getrlimit64; getrpcbyname; getrpcbyname_r; getrpcbynumber;
|
||||
getrpcbynumber_r; getrpcent; getrpcent_r; getrpcport; getrusage; gets;
|
||||
getsecretkey; getservbyname; getservbyname_r; getservbyport;
|
||||
getservbyport_r; getservent; getservent_r; getsid; getsockname;
|
||||
@ -244,8 +248,8 @@ GLIBC_2.0 {
|
||||
# l*
|
||||
l64a; labs; lchown; lckpwdf; lcong48; lcong48_r; ldexp; ldexpf;
|
||||
ldexpl; ldiv; lfind; link; listen; llabs; lldiv; llseek; localeconv;
|
||||
localtime; localtime_r; lockf; longjmp; lrand48; lrand48_r; lsearch;
|
||||
lseek;
|
||||
localtime; localtime_r; lockf; lockf64; longjmp; lrand48; lrand48_r;
|
||||
lsearch; lseek; lseek64;
|
||||
|
||||
# m*
|
||||
madvise;
|
||||
@ -257,27 +261,27 @@ GLIBC_2.0 {
|
||||
mbtowc; mcheck; mcount;
|
||||
|
||||
memalign; memccpy; memchr; memcmp; memcpy; memfrob; memmem;
|
||||
memmove; memset;
|
||||
memmove; mempcpy; memset;
|
||||
|
||||
mkdir; mkfifo; mkstemp; mktemp; mktime; mlock;
|
||||
mlockall; mmap; modf; modff; modfl; moncontrol; monstartup; mount;
|
||||
mlockall; mmap; mmap64; modf; modff; modfl; moncontrol; monstartup; mount;
|
||||
mprobe; mprotect; mrand48; mrand48_r; mremap; msgctl; msgget; msgrcv;
|
||||
msgsnd; msync; mtrace; munlock; munlockall; munmap; muntrace;
|
||||
|
||||
# n*
|
||||
nanosleep; netname2host; netname2user; nftw; nfsservctl; nice; nl_langinfo;
|
||||
nrand48; nrand48_r; ntohl; ntohs;
|
||||
nanosleep; netname2host; netname2user; nftw; nftw64; nfsservctl; nice;
|
||||
nl_langinfo; nrand48; nrand48_r; ntohl; ntohs;
|
||||
|
||||
# o*
|
||||
obstack_free; obstack_printf; obstack_vprintf; on_exit; open;
|
||||
obstack_free; obstack_printf; obstack_vprintf; on_exit; open; open64;
|
||||
open_memstream; opendir; openlog;
|
||||
|
||||
# p*
|
||||
parse_printf_format; passwd2des; pathconf; pause; pciconfig_read;
|
||||
pciconfig_write; pclose; perror;
|
||||
personality; pipe; pmap_getmaps; pmap_getport; pmap_rmtcall; pmap_set;
|
||||
pmap_unset; poll; popen; pread; printf; printf_size; printf_size_info;
|
||||
profil; profil_counter; pwrite; pselect; psignal;
|
||||
pmap_unset; poll; popen; prctl; pread; printf; printf_size;
|
||||
printf_size_info; profil; profil_counter; pwrite; pselect; psignal;
|
||||
|
||||
pthread_attr_destroy;
|
||||
pthread_attr_getdetachstate; pthread_attr_getinheritsched;
|
||||
@ -307,10 +311,10 @@ GLIBC_2.0 {
|
||||
re_comp; re_compile_fastmap; re_compile_pattern; re_exec; re_match;
|
||||
re_match_2; re_search; re_search_2; re_set_registers; re_set_syntax;
|
||||
|
||||
read; readdir; readdir_r; readlink; readv; realloc; realpath; reboot;
|
||||
recv; recvfrom; recvmsg; regcomp; regerror; regexec; regfree;
|
||||
register_printf_function; registerrpc; remove; remque; rename;
|
||||
res_init; revoke; rewind; rewinddir; rexec; rindex; rmdir; rpmatch;
|
||||
read; readdir; readdir_r; readdir64; readdir64_r; readlink; readv;
|
||||
realloc; realpath; reboot; recv; recvfrom; recvmsg; regcomp; regerror;
|
||||
regexec; regfree; register_printf_function; registerrpc; remove; remque;
|
||||
rename; res_init; revoke; rewind; rewinddir; rexec; rindex; rmdir; rpmatch;
|
||||
rresvport; rtime; ruserok; ruserpass;
|
||||
|
||||
# s*
|
||||
@ -328,8 +332,8 @@ GLIBC_2.0 {
|
||||
sethostid; sethostname; setitimer; setjmp; setlinebuf; setlocale;
|
||||
setlogin; setlogmask; setmntent; setnetent; setnetgrent; setpgid;
|
||||
setpgrp; setpriority; setprotoent; setpwent; setregid; setresgid;
|
||||
setresuid; setreuid;
|
||||
setrlimit; setrpcent; setservent; setsid; setsockopt; setspent;
|
||||
setresuid; setreuid; setrlimit; setrlimit64; setrpcent; setservent;
|
||||
setsid; setsockopt; setspent;
|
||||
setstate; setstate_r; settimeofday; setttyent; setuid; setusershell;
|
||||
setutent; setutxent; setvbuf; sgetspent; sgetspent_r; shmat; shmctl;
|
||||
shmdt; shmget; shutdown;
|
||||
@ -341,8 +345,8 @@ GLIBC_2.0 {
|
||||
sigwait;
|
||||
|
||||
sleep; snprintf; socket; socketpair; sprintf; srand; srand48;
|
||||
srand48_r; srandom; srandom_r; sscanf; ssignal; sstk; statfs; step;
|
||||
stime; stpcpy; stpncpy; strcasecmp; strcat; strchr; strcmp; strcoll;
|
||||
srand48_r; srandom; srandom_r; sscanf; ssignal; sstk; statfs; statfs64;
|
||||
step; stime; stpcpy; stpncpy; strcasecmp; strcat; strchr; strcmp; strcoll;
|
||||
strcpy; strcspn; strdup; strerror; strerror_r; strfmon; strfry;
|
||||
strftime; strlen; strncasecmp; strncat; strncmp; strncpy; strndup;
|
||||
strnlen; strpbrk; strptime; strrchr; strsep; strsignal; strspn;
|
||||
@ -362,11 +366,12 @@ GLIBC_2.0 {
|
||||
# t*
|
||||
tcdrain; tcflow; tcflush; tcgetattr; tcgetpgrp; tcsendbreak;
|
||||
tcsetattr; tcsetpgrp; tdelete; tdestroy; telldir; tempnam; textdomain;
|
||||
tfind; time; timegm; timelocal; times; tmpfile; tmpnam; tmpnam_r;
|
||||
tfind; time; timegm; timelocal; times; tmpfile; tmpfile64; tmpnam;
|
||||
tmpnam_r;
|
||||
|
||||
toascii; tolower; toupper; towctrans; towlower; towupper;
|
||||
tr_break; truncate; tsearch; ttyname; ttyname_r; ttyslot; twalk;
|
||||
tzset;
|
||||
tr_break; truncate; truncate64; tsearch; ttyname; ttyname_r; ttyslot;
|
||||
twalk; tzset;
|
||||
|
||||
# u*
|
||||
ualarm; ulckpwdf; ulimit; umask; umount; uname; ungetc; unlink;
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
};
|
||||
|
49
libio/freopen64.c
Normal file
49
libio/freopen64.c
Normal file
@ -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
|
||||
}
|
48
libio/fseeko64.c
Normal file
48
libio/fseeko64.c
Normal file
@ -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
|
||||
}
|
55
libio/ftello64.c
Normal file
55
libio/ftello64.c
Normal file
@ -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
|
||||
}
|
@ -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)
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
int
|
||||
_IO_fgetpos (fp, posp)
|
||||
_IO_FILE* fp;
|
||||
_IO_FILE *fp;
|
||||
_IO_fpos_t *posp;
|
||||
{
|
||||
_IO_fpos_t pos;
|
||||
|
61
libio/iofgetpos64.c
Normal file
61
libio/iofgetpos64.c
Normal file
@ -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
|
@ -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);
|
||||
|
69
libio/iofopen64.c
Normal file
69
libio/iofopen64.c
Normal file
@ -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
|
@ -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),
|
||||
};
|
||||
|
||||
|
||||
|
61
libio/iofsetpos64.c
Normal file
61
libio/iofsetpos64.c
Normal file
@ -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
|
@ -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
|
||||
|
@ -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)
|
||||
};
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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 *));
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
};
|
||||
|
||||
|
||||
|
133
libio/stdio.h
133
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
|
||||
|
||||
|
||||
|
@ -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)
|
||||
};
|
||||
|
@ -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)
|
||||
};
|
||||
|
||||
|
||||
|
@ -612,7 +612,7 @@ from-value of `collating-element' must be a string"));
|
||||
now = lr_token (ldfile, charset);
|
||||
}
|
||||
while (now->tok == tok_comma
|
||||
&& (now == lr_token (ldfile, charset) != tok_none));
|
||||
&& ((now = lr_token (ldfile, charset)) != tok_none));
|
||||
|
||||
/* Check for consistency: forward and backwards are
|
||||
mutually exclusive. */
|
||||
|
@ -70,7 +70,7 @@ lib: $(objpfx)libmcheck.a
|
||||
#CPPFLAGS-malloc.o += -DMALLOC_DEBUG
|
||||
|
||||
$(objpfx)mtrace: mtrace.pl
|
||||
rm -fr %@.new
|
||||
rm -f $@.new
|
||||
sed -e 's|@PERL@|$(PERL)|' -e 's|@XXX@|$(address-width)|' \
|
||||
-e 's|@VERSION@|$(version)|' $^ > $@.new \
|
||||
&& rm -fr $@ && mv $@.new $@ && chmod +x $@
|
||||
|
249
malloc/malloc.c
249
malloc/malloc.c
@ -297,7 +297,7 @@
|
||||
|
||||
#if __STD_C
|
||||
# include <stddef.h> /* for size_t */
|
||||
# if defined(_LIBC) || defined(MALLOC_HOOKS)
|
||||
# if defined _LIBC || defined MALLOC_HOOKS
|
||||
# include <stdlib.h> /* for getenv(), abort() */
|
||||
# endif
|
||||
#else
|
||||
@ -1168,17 +1168,19 @@ typedef struct _heap_info {
|
||||
|
||||
#if __STD_C
|
||||
|
||||
static void chunk_free(arena *ar_ptr, mchunkptr p);
|
||||
static mchunkptr chunk_alloc(arena *ar_ptr, INTERNAL_SIZE_T size);
|
||||
static void chunk_free(arena *ar_ptr, mchunkptr p) internal_function;
|
||||
static mchunkptr chunk_alloc(arena *ar_ptr, INTERNAL_SIZE_T size)
|
||||
internal_function;
|
||||
static mchunkptr chunk_realloc(arena *ar_ptr, mchunkptr oldp,
|
||||
INTERNAL_SIZE_T oldsize, INTERNAL_SIZE_T nb);
|
||||
INTERNAL_SIZE_T oldsize, INTERNAL_SIZE_T nb)
|
||||
internal_function;
|
||||
static mchunkptr chunk_align(arena *ar_ptr, INTERNAL_SIZE_T nb,
|
||||
size_t alignment);
|
||||
static int main_trim(size_t pad);
|
||||
size_t alignment) internal_function;
|
||||
static int main_trim(size_t pad) internal_function;
|
||||
#ifndef NO_THREADS
|
||||
static int heap_trim(heap_info *heap, size_t pad);
|
||||
static int heap_trim(heap_info *heap, size_t pad) internal_function;
|
||||
#endif
|
||||
#ifdef _LIBC
|
||||
#if defined _LIBC || defined MALLOC_HOOKS
|
||||
static Void_t* malloc_check(size_t sz, const Void_t *caller);
|
||||
static void free_check(Void_t* mem, const Void_t *caller);
|
||||
static Void_t* realloc_check(Void_t* oldmem, size_t bytes,
|
||||
@ -1189,17 +1191,6 @@ static Void_t* malloc_starter(size_t sz, const Void_t *caller);
|
||||
static void free_starter(Void_t* mem, const Void_t *caller);
|
||||
static Void_t* malloc_atfork(size_t sz, const Void_t *caller);
|
||||
static void free_atfork(Void_t* mem, const Void_t *caller);
|
||||
#else
|
||||
#ifdef MALLOC_HOOKS
|
||||
static Void_t* malloc_check(size_t sz);
|
||||
static void free_check(Void_t* mem);
|
||||
static Void_t* realloc_check(Void_t* oldmem, size_t bytes);
|
||||
static Void_t* memalign_check(size_t alignment, size_t bytes);
|
||||
static Void_t* malloc_starter(size_t sz);
|
||||
static void free_starter(Void_t* mem);
|
||||
static Void_t* malloc_atfork(size_t sz);
|
||||
static void free_atfork(Void_t* mem);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#else
|
||||
@ -1212,7 +1203,7 @@ static int main_trim();
|
||||
#ifndef NO_THREADS
|
||||
static int heap_trim();
|
||||
#endif
|
||||
#if defined(_LIBC) || defined(MALLOC_HOOKS)
|
||||
#if defined _LIBC || defined MALLOC_HOOKS
|
||||
static Void_t* malloc_check();
|
||||
static void free_check();
|
||||
static Void_t* realloc_check();
|
||||
@ -1225,6 +1216,13 @@ static void free_atfork();
|
||||
|
||||
#endif
|
||||
|
||||
/* On some platforms we can compile internal, not exported functions better.
|
||||
Let the environment provide a macro and define it to be empty if it
|
||||
is not available. */
|
||||
#ifndef internal_function
|
||||
# define internal_function
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* sizes, alignments */
|
||||
@ -1387,13 +1385,13 @@ static void free_atfork();
|
||||
Indexing into bins
|
||||
*/
|
||||
|
||||
#define bin_index(sz) \
|
||||
(((((unsigned long)(sz)) >> 9) == 0) ? (((unsigned long)(sz)) >> 3): \
|
||||
((((unsigned long)(sz)) >> 9) <= 4) ? 56 + (((unsigned long)(sz)) >> 6): \
|
||||
((((unsigned long)(sz)) >> 9) <= 20) ? 91 + (((unsigned long)(sz)) >> 9): \
|
||||
((((unsigned long)(sz)) >> 9) <= 84) ? 110 + (((unsigned long)(sz)) >> 12): \
|
||||
((((unsigned long)(sz)) >> 9) <= 340) ? 119 + (((unsigned long)(sz)) >> 15): \
|
||||
((((unsigned long)(sz)) >> 9) <= 1364) ? 124 + (((unsigned long)(sz)) >> 18): \
|
||||
#define bin_index(sz) \
|
||||
(((((unsigned long)(sz)) >> 9) == 0) ? (((unsigned long)(sz)) >> 3):\
|
||||
((((unsigned long)(sz)) >> 9) <= 4) ? 56 + (((unsigned long)(sz)) >> 6):\
|
||||
((((unsigned long)(sz)) >> 9) <= 20) ? 91 + (((unsigned long)(sz)) >> 9):\
|
||||
((((unsigned long)(sz)) >> 9) <= 84) ? 110 + (((unsigned long)(sz)) >> 12):\
|
||||
((((unsigned long)(sz)) >> 9) <= 340) ? 119 + (((unsigned long)(sz)) >> 15):\
|
||||
((((unsigned long)(sz)) >> 9) <= 1364) ? 124 + (((unsigned long)(sz)) >> 18):\
|
||||
126)
|
||||
/*
|
||||
bins for chunks < 512 are all spaced 8 bytes apart, and hold
|
||||
@ -1533,18 +1531,12 @@ int __malloc_initialized = 0;
|
||||
temporarily, because the `atfork' handler mechanism may use
|
||||
malloc/free internally (e.g. in LinuxThreads). */
|
||||
|
||||
#ifdef _LIBC
|
||||
#if defined _LIBC || defined MALLOC_HOOKS
|
||||
static __malloc_ptr_t (*save_malloc_hook) __MALLOC_P ((size_t __size,
|
||||
const __malloc_ptr_t));
|
||||
static void (*save_free_hook) __MALLOC_P ((__malloc_ptr_t __ptr,
|
||||
const __malloc_ptr_t));
|
||||
static Void_t* save_arena;
|
||||
#else
|
||||
#ifdef MALLOC_HOOKS
|
||||
static __malloc_ptr_t (*save_malloc_hook) __MALLOC_P ((size_t __size));
|
||||
static void (*save_free_hook) __MALLOC_P ((__malloc_ptr_t __ptr));
|
||||
static Void_t* save_arena;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static void
|
||||
@ -1558,7 +1550,7 @@ ptmalloc_lock_all __MALLOC_P((void))
|
||||
ar_ptr = ar_ptr->next;
|
||||
if(ar_ptr == &main_arena) break;
|
||||
}
|
||||
#if defined(_LIBC) || defined(MALLOC_HOOKS)
|
||||
#if defined _LIBC || defined MALLOC_HOOKS
|
||||
save_malloc_hook = __malloc_hook;
|
||||
save_free_hook = __free_hook;
|
||||
__malloc_hook = malloc_atfork;
|
||||
@ -1574,7 +1566,7 @@ ptmalloc_unlock_all __MALLOC_P((void))
|
||||
{
|
||||
arena *ar_ptr;
|
||||
|
||||
#if defined(_LIBC) || defined(MALLOC_HOOKS)
|
||||
#if defined _LIBC || defined MALLOC_HOOKS
|
||||
tsd_setspecific(arena_key, save_arena);
|
||||
__malloc_hook = save_malloc_hook;
|
||||
__free_hook = save_free_hook;
|
||||
@ -1600,13 +1592,13 @@ void
|
||||
ptmalloc_init __MALLOC_P((void))
|
||||
#endif
|
||||
{
|
||||
#if defined(_LIBC) || defined(MALLOC_HOOKS)
|
||||
#if defined _LIBC || defined MALLOC_HOOKS
|
||||
const char* s;
|
||||
#endif
|
||||
|
||||
if(__malloc_initialized) return;
|
||||
__malloc_initialized = 1;
|
||||
#if defined(_LIBC) || defined(MALLOC_HOOKS)
|
||||
#if defined _LIBC || defined MALLOC_HOOKS
|
||||
/* With some threads implementations, creating thread-specific data
|
||||
or initializing a mutex may call malloc() itself. Provide a
|
||||
simple starter version (realloc() won't work). */
|
||||
@ -1615,7 +1607,7 @@ ptmalloc_init __MALLOC_P((void))
|
||||
__malloc_hook = malloc_starter;
|
||||
__free_hook = free_starter;
|
||||
#endif
|
||||
#if defined(_LIBC) && !defined (NO_THREADS)
|
||||
#if defined _LIBC && !defined NO_THREADS
|
||||
/* Initialize the pthreads interface. */
|
||||
if (__pthread_initialize != NULL)
|
||||
__pthread_initialize();
|
||||
@ -1627,7 +1619,7 @@ ptmalloc_init __MALLOC_P((void))
|
||||
tsd_setspecific(arena_key, (Void_t *)&main_arena);
|
||||
thread_atfork(ptmalloc_lock_all, ptmalloc_unlock_all, ptmalloc_unlock_all);
|
||||
#endif
|
||||
#if defined(_LIBC) || defined(MALLOC_HOOKS)
|
||||
#if defined _LIBC || defined MALLOC_HOOKS
|
||||
if((s = getenv("MALLOC_TRIM_THRESHOLD_")))
|
||||
mALLOPt(M_TRIM_THRESHOLD, atoi(s));
|
||||
if((s = getenv("MALLOC_TOP_PAD_")))
|
||||
@ -1654,7 +1646,7 @@ thread_atfork_static(ptmalloc_lock_all, ptmalloc_unlock_all, \
|
||||
ptmalloc_unlock_all)
|
||||
#endif
|
||||
|
||||
#if defined(_LIBC) || defined(MALLOC_HOOKS)
|
||||
#if defined _LIBC || defined MALLOC_HOOKS
|
||||
|
||||
/* Hooks for debugging versions. The initial hooks just call the
|
||||
initialization routine, then do the normal work. */
|
||||
@ -1678,14 +1670,11 @@ malloc_hook_ini(sz) size_t sz;
|
||||
}
|
||||
|
||||
static Void_t*
|
||||
#ifdef _LIBC
|
||||
#if __STD_C
|
||||
realloc_hook_ini(Void_t* ptr, size_t sz, const __malloc_ptr_t caller)
|
||||
#else
|
||||
#if __STD_C
|
||||
realloc_hook_ini(Void_t* ptr, size_t sz)
|
||||
#else
|
||||
realloc_hook_ini(ptr, sz) Void_t* ptr; size_t sz;
|
||||
#endif
|
||||
realloc_hook_ini(ptr, sz, caller)
|
||||
Void_t* ptr; size_t sz; const __malloc_ptr_t caller;
|
||||
#endif
|
||||
{
|
||||
__malloc_hook = NULL;
|
||||
@ -1696,14 +1685,11 @@ realloc_hook_ini(ptr, sz) Void_t* ptr; size_t sz;
|
||||
}
|
||||
|
||||
static Void_t*
|
||||
#ifdef _LIBC
|
||||
#if __STD_C
|
||||
memalign_hook_ini(size_t sz, size_t alignment, const __malloc_ptr_t caller)
|
||||
#else
|
||||
#if __STD_C
|
||||
memalign_hook_ini(size_t sz, size_t alignment)
|
||||
#else
|
||||
memalign_hook_ini(sz, alignment) size_t sz; size_t alignment;
|
||||
#endif
|
||||
memalign_hook_ini(sz, alignment, caller)
|
||||
size_t sz; size_t alignment; const __malloc_ptr_t caller;
|
||||
#endif
|
||||
{
|
||||
__malloc_hook = NULL;
|
||||
@ -1714,7 +1700,6 @@ memalign_hook_ini(sz, alignment) size_t sz; size_t alignment;
|
||||
}
|
||||
|
||||
void weak_variable (*__malloc_initialize_hook) __MALLOC_P ((void)) = NULL;
|
||||
#ifdef _LIBC
|
||||
void weak_variable (*__free_hook) __MALLOC_P ((__malloc_ptr_t __ptr,
|
||||
const __malloc_ptr_t)) = NULL;
|
||||
__malloc_ptr_t weak_variable (*__malloc_hook)
|
||||
@ -1725,15 +1710,6 @@ __malloc_ptr_t weak_variable (*__realloc_hook)
|
||||
__malloc_ptr_t weak_variable (*__memalign_hook)
|
||||
__MALLOC_P ((size_t __size, size_t __alignment, const __malloc_ptr_t))
|
||||
= memalign_hook_ini;
|
||||
#else
|
||||
void weak_variable (*__free_hook) __MALLOC_P ((__malloc_ptr_t __ptr)) = NULL;
|
||||
__malloc_ptr_t weak_variable (*__malloc_hook)
|
||||
__MALLOC_P ((size_t __size)) = malloc_hook_ini;
|
||||
__malloc_ptr_t weak_variable (*__realloc_hook)
|
||||
__MALLOC_P ((__malloc_ptr_t __ptr, size_t __size)) = realloc_hook_ini;
|
||||
__malloc_ptr_t weak_variable (*__memalign_hook)
|
||||
__MALLOC_P ((size_t __size, size_t __alignment)) = memalign_hook_ini;
|
||||
#endif
|
||||
void weak_variable (*__after_morecore_hook) __MALLOC_P ((void)) = NULL;
|
||||
|
||||
/* Activate a standard set of debugging hooks. */
|
||||
@ -1774,10 +1750,16 @@ static int dev_zero_fd = -1; /* Cached file descriptor for /dev/zero. */
|
||||
|
||||
#endif
|
||||
|
||||
static mchunkptr
|
||||
#if defined __GNUC__ && __GNUC__ >= 2
|
||||
/* This function is only called from one place, inline it. */
|
||||
inline
|
||||
#endif
|
||||
internal_function
|
||||
#if __STD_C
|
||||
static mchunkptr mmap_chunk(size_t size)
|
||||
mmap_chunk(size_t size)
|
||||
#else
|
||||
static mchunkptr mmap_chunk(size) size_t size;
|
||||
mmap_chunk(size) size_t size;
|
||||
#endif
|
||||
{
|
||||
size_t page_mask = malloc_getpagesize - 1;
|
||||
@ -1897,6 +1879,7 @@ static mchunkptr mremap_chunk(p, new_size) mchunkptr p; size_t new_size;
|
||||
of the page size. */
|
||||
|
||||
static heap_info *
|
||||
internal_function
|
||||
#if __STD_C
|
||||
new_heap(size_t size)
|
||||
#else
|
||||
@ -1986,6 +1969,7 @@ grow_heap(h, diff) heap_info *h; long diff;
|
||||
} while(0)
|
||||
|
||||
static arena *
|
||||
internal_function
|
||||
#if __STD_C
|
||||
arena_get2(arena *a_tsd, size_t size)
|
||||
#else
|
||||
@ -2302,10 +2286,16 @@ arena *ar_ptr; mchunkptr p; INTERNAL_SIZE_T s;
|
||||
Main interface to sbrk (but see also malloc_trim).
|
||||
*/
|
||||
|
||||
static void
|
||||
#if defined __GNUC__ && __GNUC__ >= 2
|
||||
/* This function is called only from one place, inline it. */
|
||||
inline
|
||||
#endif
|
||||
internal_function
|
||||
#if __STD_C
|
||||
static void malloc_extend_top(arena *ar_ptr, INTERNAL_SIZE_T nb)
|
||||
malloc_extend_top(arena *ar_ptr, INTERNAL_SIZE_T nb)
|
||||
#else
|
||||
static void malloc_extend_top(ar_ptr, nb) arena *ar_ptr; INTERNAL_SIZE_T nb;
|
||||
malloc_extend_top(ar_ptr, nb) arena *ar_ptr; INTERNAL_SIZE_T nb;
|
||||
#endif
|
||||
{
|
||||
unsigned long pagesz = malloc_getpagesize;
|
||||
@ -2340,7 +2330,7 @@ static void malloc_extend_top(ar_ptr, nb) arena *ar_ptr; INTERNAL_SIZE_T nb;
|
||||
(brk < old_end && old_top != initial_top(&main_arena)))
|
||||
return;
|
||||
|
||||
#if defined(_LIBC) || defined(MALLOC_HOOKS)
|
||||
#if defined _LIBC || defined MALLOC_HOOKS
|
||||
/* Call the `morecore' hook if necessary. */
|
||||
if (__after_morecore_hook)
|
||||
(*__after_morecore_hook) ();
|
||||
@ -2374,7 +2364,7 @@ static void malloc_extend_top(ar_ptr, nb) arena *ar_ptr; INTERNAL_SIZE_T nb;
|
||||
new_brk = (char*)(MORECORE (correction));
|
||||
if (new_brk == (char*)(MORECORE_FAILURE)) return;
|
||||
|
||||
#if defined(_LIBC) || defined(MALLOC_HOOKS)
|
||||
#if defined _LIBC || defined MALLOC_HOOKS
|
||||
/* Call the `morecore' hook if necessary. */
|
||||
if (__after_morecore_hook)
|
||||
(*__after_morecore_hook) ();
|
||||
@ -2531,14 +2521,14 @@ Void_t* mALLOc(bytes) size_t bytes;
|
||||
INTERNAL_SIZE_T nb; /* padded request size */
|
||||
mchunkptr victim;
|
||||
|
||||
#if defined(_LIBC) || defined(MALLOC_HOOKS)
|
||||
#if defined _LIBC || defined MALLOC_HOOKS
|
||||
if (__malloc_hook != NULL) {
|
||||
Void_t* result;
|
||||
|
||||
#ifdef _LIBC
|
||||
#if defined __GNUC__ && __GNUC__ >= 2
|
||||
result = (*__malloc_hook)(bytes, __builtin_return_address (0));
|
||||
#else
|
||||
result = (*__malloc_hook)(bytes);
|
||||
result = (*__malloc_hook)(bytes, NULL);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
@ -2563,6 +2553,7 @@ Void_t* mALLOc(bytes) size_t bytes;
|
||||
}
|
||||
|
||||
static mchunkptr
|
||||
internal_function
|
||||
#if __STD_C
|
||||
chunk_alloc(arena *ar_ptr, INTERNAL_SIZE_T nb)
|
||||
#else
|
||||
@ -2828,12 +2819,12 @@ void fREe(mem) Void_t* mem;
|
||||
arena *ar_ptr;
|
||||
mchunkptr p; /* chunk corresponding to mem */
|
||||
|
||||
#if defined(_LIBC) || defined(MALLOC_HOOKS)
|
||||
#if defined _LIBC || defined MALLOC_HOOKS
|
||||
if (__free_hook != NULL) {
|
||||
#ifdef _LIBC
|
||||
#if defined __GNUC__ && __GNUC__ >= 2
|
||||
(*__free_hook)(mem, __builtin_return_address (0));
|
||||
#else
|
||||
(*__free_hook)(mem);
|
||||
(*__free_hook)(mem, NULL);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@ -2868,6 +2859,7 @@ void fREe(mem) Void_t* mem;
|
||||
}
|
||||
|
||||
static void
|
||||
internal_function
|
||||
#if __STD_C
|
||||
chunk_free(arena *ar_ptr, mchunkptr p)
|
||||
#else
|
||||
@ -3030,14 +3022,14 @@ Void_t* rEALLOc(oldmem, bytes) Void_t* oldmem; size_t bytes;
|
||||
|
||||
mchunkptr newp; /* chunk to return */
|
||||
|
||||
#if defined(_LIBC) || defined(MALLOC_HOOKS)
|
||||
#if defined _LIBC || defined MALLOC_HOOKS
|
||||
if (__realloc_hook != NULL) {
|
||||
Void_t* result;
|
||||
|
||||
#ifdef _LIBC
|
||||
#if defined __GNUC__ && __GNUC__ >= 2
|
||||
result = (*__realloc_hook)(oldmem, bytes, __builtin_return_address (0));
|
||||
#else
|
||||
result = (*__realloc_hook)(oldmem, bytes);
|
||||
result = (*__realloc_hook)(oldmem, bytes, NULL);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
@ -3099,6 +3091,7 @@ Void_t* rEALLOc(oldmem, bytes) Void_t* oldmem; size_t bytes;
|
||||
}
|
||||
|
||||
static mchunkptr
|
||||
internal_function
|
||||
#if __STD_C
|
||||
chunk_realloc(arena* ar_ptr, mchunkptr oldp, INTERNAL_SIZE_T oldsize,
|
||||
INTERNAL_SIZE_T nb)
|
||||
@ -3296,15 +3289,15 @@ Void_t* mEMALIGn(alignment, bytes) size_t alignment; size_t bytes;
|
||||
INTERNAL_SIZE_T nb; /* padded request size */
|
||||
mchunkptr p;
|
||||
|
||||
#if defined(_LIBC) || defined(MALLOC_HOOKS)
|
||||
#if defined _LIBC || defined MALLOC_HOOKS
|
||||
if (__memalign_hook != NULL) {
|
||||
Void_t* result;
|
||||
|
||||
#ifdef _LIBC
|
||||
#if defined __GNUC__ && __GNUC__ >= 2
|
||||
result = (*__memalign_hook)(alignment, bytes,
|
||||
__builtin_return_address (0));
|
||||
#else
|
||||
result = (*__memalign_hook)(alignment, bytes);
|
||||
result = (*__memalign_hook)(alignment, bytes, NULL);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
@ -3337,6 +3330,7 @@ Void_t* mEMALIGn(alignment, bytes) size_t alignment; size_t bytes;
|
||||
}
|
||||
|
||||
static mchunkptr
|
||||
internal_function
|
||||
#if __STD_C
|
||||
chunk_align(arena* ar_ptr, INTERNAL_SIZE_T nb, size_t alignment)
|
||||
#else
|
||||
@ -3473,13 +3467,13 @@ Void_t* cALLOc(n, elem_size) size_t n; size_t elem_size;
|
||||
INTERNAL_SIZE_T sz, csz, oldtopsize;
|
||||
Void_t* mem;
|
||||
|
||||
#if defined(_LIBC) || defined(MALLOC_HOOKS)
|
||||
#if defined _LIBC || defined MALLOC_HOOKS
|
||||
if (__malloc_hook != NULL) {
|
||||
sz = n * elem_size;
|
||||
#ifdef _LIBC
|
||||
#if defined __GNUC__ && __GNUC__ >= 2
|
||||
mem = (*__malloc_hook)(sz, __builtin_return_address (0));
|
||||
#else
|
||||
mem = (*__malloc_hook)(sz);
|
||||
mem = (*__malloc_hook)(sz, NULL);
|
||||
#endif
|
||||
if(mem == 0)
|
||||
return 0;
|
||||
@ -3597,6 +3591,7 @@ int mALLOC_TRIm(pad) size_t pad;
|
||||
/* Trim the main arena. */
|
||||
|
||||
static int
|
||||
internal_function
|
||||
#if __STD_C
|
||||
main_trim(size_t pad)
|
||||
#else
|
||||
@ -3625,7 +3620,7 @@ main_trim(pad) size_t pad;
|
||||
|
||||
new_brk = (char*)(MORECORE (-extra));
|
||||
|
||||
#if defined(_LIBC) || defined(MALLOC_HOOKS)
|
||||
#if defined _LIBC || defined MALLOC_HOOKS
|
||||
/* Call the `morecore' hook if necessary. */
|
||||
if (__after_morecore_hook)
|
||||
(*__after_morecore_hook) ();
|
||||
@ -3654,6 +3649,7 @@ main_trim(pad) size_t pad;
|
||||
#ifndef NO_THREADS
|
||||
|
||||
static int
|
||||
internal_function
|
||||
#if __STD_C
|
||||
heap_trim(heap_info *heap, size_t pad)
|
||||
#else
|
||||
@ -4114,7 +4110,7 @@ mALLOC_SET_STATe(msptr) Void_t* msptr;
|
||||
|
||||
|
||||
|
||||
#if defined(_LIBC) || defined(MALLOC_HOOKS)
|
||||
#if defined _LIBC || defined MALLOC_HOOKS
|
||||
|
||||
/* A simple, standard set of debugging hooks. Overhead is `only' one
|
||||
byte per chunk; still this will catch most cases of double frees or
|
||||
@ -4127,6 +4123,7 @@ mALLOC_SET_STATe(msptr) Void_t* msptr;
|
||||
goal here is to avoid crashes, unlike in the MALLOC_DEBUG code. */
|
||||
|
||||
static mchunkptr
|
||||
internal_function
|
||||
#if __STD_C
|
||||
mem2chunk_check(Void_t* mem)
|
||||
#else
|
||||
@ -4173,14 +4170,10 @@ mem2chunk_check(mem) Void_t* mem;
|
||||
}
|
||||
|
||||
static Void_t*
|
||||
#ifdef _LIBC
|
||||
#if __STD_C
|
||||
malloc_check(size_t sz, const Void_t *caller)
|
||||
#else
|
||||
#if __STD_C
|
||||
malloc_check(size_t sz)
|
||||
#else
|
||||
malloc_check(sz) size_t sz;
|
||||
#endif
|
||||
malloc_check(sz, caller) size_t sz; const Void_t *caller;
|
||||
#endif
|
||||
{
|
||||
mchunkptr victim;
|
||||
@ -4200,14 +4193,10 @@ malloc_check(sz) size_t sz;
|
||||
}
|
||||
|
||||
static void
|
||||
#ifdef _LIBC
|
||||
#if __STD_C
|
||||
free_check(Void_t* mem, const Void_t *caller)
|
||||
#else
|
||||
#if __STD_C
|
||||
free_check(Void_t* mem)
|
||||
#else
|
||||
free_check(mem) Void_t* mem;
|
||||
#endif
|
||||
free_check(mem, caller) Void_t* mem; const Void_t *caller;
|
||||
#endif
|
||||
{
|
||||
mchunkptr p;
|
||||
@ -4241,24 +4230,17 @@ free_check(mem) Void_t* mem;
|
||||
}
|
||||
|
||||
static Void_t*
|
||||
#ifdef _LIBC
|
||||
#if __STD_C
|
||||
realloc_check(Void_t* oldmem, size_t bytes, const Void_t *caller)
|
||||
#else
|
||||
#if __STD_C
|
||||
realloc_check(Void_t* oldmem, size_t bytes)
|
||||
#else
|
||||
realloc_check(oldmem, bytes) Void_t* oldmem; size_t bytes;
|
||||
#endif
|
||||
realloc_check(oldmem, bytes, caller)
|
||||
Void_t* oldmem; size_t bytes; const Void_t *caller;
|
||||
#endif
|
||||
{
|
||||
mchunkptr oldp, newp;
|
||||
INTERNAL_SIZE_T nb, oldsize;
|
||||
|
||||
#ifdef _LIBC
|
||||
if (oldmem == 0) return malloc_check(bytes, NULL);
|
||||
#else
|
||||
if (oldmem == 0) return malloc_check(bytes);
|
||||
#endif
|
||||
(void)mutex_lock(&main_arena.mutex);
|
||||
oldp = mem2chunk_check(oldmem);
|
||||
if(!oldp) {
|
||||
@ -4270,11 +4252,7 @@ realloc_check(oldmem, bytes) Void_t* oldmem; size_t bytes;
|
||||
case 2:
|
||||
abort();
|
||||
}
|
||||
#ifdef _LIBC
|
||||
return malloc_check(bytes, NULL);
|
||||
#else
|
||||
return malloc_check(bytes);
|
||||
#endif
|
||||
}
|
||||
oldsize = chunksize(oldp);
|
||||
|
||||
@ -4327,24 +4305,17 @@ realloc_check(oldmem, bytes) Void_t* oldmem; size_t bytes;
|
||||
}
|
||||
|
||||
static Void_t*
|
||||
#ifdef _LIBC
|
||||
#if __STD_C
|
||||
memalign_check(size_t alignment, size_t bytes, const Void_t *caller)
|
||||
#else
|
||||
#if __STD_C
|
||||
memalign_check(size_t alignment, size_t bytes)
|
||||
#else
|
||||
memalign_check(alignment, bytes) size_t alignment; size_t bytes;
|
||||
#endif
|
||||
memalign_check(alignment, bytes, caller)
|
||||
size_t alignment; size_t bytes; const Void_t *caller;
|
||||
#endif
|
||||
{
|
||||
INTERNAL_SIZE_T nb;
|
||||
mchunkptr p;
|
||||
|
||||
#ifdef _LIBC
|
||||
if (alignment <= MALLOC_ALIGNMENT) return malloc_check(bytes, NULL);
|
||||
#else
|
||||
if (alignment <= MALLOC_ALIGNMENT) return malloc_check(bytes);
|
||||
#endif
|
||||
if (alignment < MINSIZE) alignment = MINSIZE;
|
||||
|
||||
nb = request2size(bytes+1);
|
||||
@ -4365,14 +4336,10 @@ memalign_check(alignment, bytes) size_t alignment; size_t bytes;
|
||||
ptmalloc_init() hasn't completed yet. */
|
||||
|
||||
static Void_t*
|
||||
#ifdef _LIBC
|
||||
#if __STD_C
|
||||
malloc_starter(size_t sz, const Void_t *caller)
|
||||
#else
|
||||
#if __STD_C
|
||||
malloc_starter(size_t sz)
|
||||
#else
|
||||
malloc_starter(sz) size_t sz;
|
||||
#endif
|
||||
malloc_starter(sz, caller) size_t sz; const Void_t *caller;
|
||||
#endif
|
||||
{
|
||||
mchunkptr victim = chunk_alloc(&main_arena, request2size(sz));
|
||||
@ -4381,14 +4348,10 @@ malloc_starter(sz) size_t sz;
|
||||
}
|
||||
|
||||
static void
|
||||
#ifdef _LIBC
|
||||
#if __STD_C
|
||||
free_starter(Void_t* mem, const Void_t *caller)
|
||||
#else
|
||||
#if __STD_C
|
||||
free_starter(Void_t* mem)
|
||||
#else
|
||||
free_starter(mem) Void_t* mem;
|
||||
#endif
|
||||
free_starter(mem, caller) Void_t* mem; const Void_t *caller;
|
||||
#endif
|
||||
{
|
||||
mchunkptr p;
|
||||
@ -4408,14 +4371,10 @@ free_starter(mem) Void_t* mem;
|
||||
is active. */
|
||||
|
||||
static Void_t*
|
||||
#ifdef _LIBC
|
||||
#if __STD_C
|
||||
malloc_atfork (size_t sz, const Void_t *caller)
|
||||
#else
|
||||
#if __STD_C
|
||||
malloc_atfork(size_t sz)
|
||||
#else
|
||||
malloc_atfork(sz) size_t sz;
|
||||
#endif
|
||||
malloc_atfork(sz, caller) size_t sz; const Void_t *caller;
|
||||
#endif
|
||||
{
|
||||
Void_t *vptr = NULL;
|
||||
@ -4435,14 +4394,10 @@ malloc_atfork(sz) size_t sz;
|
||||
}
|
||||
|
||||
static void
|
||||
#ifdef _LIBC
|
||||
#if __STD_C
|
||||
free_atfork(Void_t* mem, const Void_t *caller)
|
||||
#else
|
||||
#if __STD_C
|
||||
free_atfork(Void_t* mem)
|
||||
#else
|
||||
free_atfork(mem) Void_t* mem;
|
||||
#endif
|
||||
free_atfork(mem, caller) Void_t* mem; const Void_t *caller;
|
||||
#endif
|
||||
{
|
||||
Void_t *vptr = NULL;
|
||||
@ -4471,7 +4426,7 @@ free_atfork(mem) Void_t* mem;
|
||||
(void)mutex_unlock(&ar_ptr->mutex);
|
||||
}
|
||||
|
||||
#endif /* defined(_LIBC) || defined(MALLOC_HOOKS) */
|
||||
#endif /* defined _LIBC || defined MALLOC_HOOKS */
|
||||
|
||||
|
||||
|
||||
|
@ -39,34 +39,34 @@
|
||||
*/
|
||||
|
||||
#if defined(__STDC__) || defined (__cplusplus)
|
||||
#include <stddef.h>
|
||||
#define __malloc_ptr_t void *
|
||||
# include <stddef.h>
|
||||
# define __malloc_ptr_t void *
|
||||
#else
|
||||
#undef size_t
|
||||
#define size_t unsigned int
|
||||
#undef ptrdiff_t
|
||||
#define ptrdiff_t int
|
||||
#define __malloc_ptr_t char *
|
||||
# undef size_t
|
||||
# define size_t unsigned int
|
||||
# undef ptrdiff_t
|
||||
# define ptrdiff_t int
|
||||
# define __malloc_ptr_t char *
|
||||
#endif
|
||||
|
||||
#ifdef _LIBC
|
||||
/* Used by GNU libc internals. */
|
||||
#define __malloc_size_t size_t
|
||||
#define __malloc_ptrdiff_t ptrdiff_t
|
||||
# define __malloc_size_t size_t
|
||||
# define __malloc_ptrdiff_t ptrdiff_t
|
||||
#endif
|
||||
|
||||
#if defined (__STDC__) || defined (__cplusplus) || defined (__GNUC__)
|
||||
#define __MALLOC_P(args) args
|
||||
#if defined __STDC__ || defined __cplusplus || defined __GNUC__
|
||||
# define __MALLOC_P(args) args
|
||||
#else
|
||||
#define __MALLOC_P(args) ()
|
||||
# define __MALLOC_P(args) ()
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
#ifdef __cplusplus
|
||||
#define NULL 0
|
||||
#else
|
||||
#define NULL ((__malloc_ptr_t) 0)
|
||||
#endif
|
||||
# ifdef __cplusplus
|
||||
# define NULL 0
|
||||
# else
|
||||
# define NULL ((__malloc_ptr_t) 0)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -77,7 +77,7 @@ extern "C" {
|
||||
#ifdef _LIBC
|
||||
/* In the GNU libc we rename the global variable
|
||||
`__malloc_initialized' to `__libc_malloc_initialized'. */
|
||||
#define __malloc_initialized __libc_malloc_initialized
|
||||
# define __malloc_initialized __libc_malloc_initialized
|
||||
#endif
|
||||
extern int __malloc_initialized;
|
||||
|
||||
@ -138,16 +138,16 @@ extern struct mallinfo mallinfo __MALLOC_P ((void));
|
||||
|
||||
/* SVID2/XPG mallopt options */
|
||||
#ifndef M_MXFAST
|
||||
#define M_MXFAST 1 /* UNUSED in this malloc */
|
||||
# define M_MXFAST 1 /* UNUSED in this malloc */
|
||||
#endif
|
||||
#ifndef M_NLBLKS
|
||||
#define M_NLBLKS 2 /* UNUSED in this malloc */
|
||||
# define M_NLBLKS 2 /* UNUSED in this malloc */
|
||||
#endif
|
||||
#ifndef M_GRAIN
|
||||
#define M_GRAIN 3 /* UNUSED in this malloc */
|
||||
# define M_GRAIN 3 /* UNUSED in this malloc */
|
||||
#endif
|
||||
#ifndef M_KEEP
|
||||
#define M_KEEP 4 /* UNUSED in this malloc */
|
||||
# define M_KEEP 4 /* UNUSED in this malloc */
|
||||
#endif
|
||||
|
||||
/* mallopt options that actually do something */
|
||||
@ -178,7 +178,7 @@ extern __malloc_ptr_t malloc_get_state __MALLOC_P ((void));
|
||||
malloc_get_state(). */
|
||||
extern int malloc_set_state __MALLOC_P ((__malloc_ptr_t __ptr));
|
||||
|
||||
#ifdef __GLIBC__
|
||||
#if defined __GLIBC__ || defined MALLOC_HOOKS
|
||||
/* Hooks for debugging versions. */
|
||||
extern void (*__malloc_initialize_hook) __MALLOC_P ((void));
|
||||
extern void (*__free_hook) __MALLOC_P ((__malloc_ptr_t __ptr,
|
||||
@ -195,21 +195,6 @@ extern void (*__after_morecore_hook) __MALLOC_P ((void));
|
||||
|
||||
/* Activate a standard set of debugging hooks. */
|
||||
extern void __malloc_check_init __MALLOC_P ((void));
|
||||
#else
|
||||
#ifdef MALLOC_HOOKS
|
||||
/* Hooks for debugging versions. */
|
||||
extern void (*__malloc_initialize_hook) __MALLOC_P ((void));
|
||||
extern void (*__free_hook) __MALLOC_P ((__malloc_ptr_t __ptr));
|
||||
extern __malloc_ptr_t (*__malloc_hook) __MALLOC_P ((size_t __size));
|
||||
extern __malloc_ptr_t (*__realloc_hook) __MALLOC_P ((__malloc_ptr_t __ptr,
|
||||
size_t __size));
|
||||
extern __malloc_ptr_t (*__memalign_hook) __MALLOC_P ((size_t __size,
|
||||
size_t __alignment));
|
||||
extern void (*__after_morecore_hook) __MALLOC_P ((void));
|
||||
|
||||
/* Activate a standard set of debugging hooks. */
|
||||
extern void __malloc_check_init __MALLOC_P ((void));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -73,8 +73,9 @@ tr_break ()
|
||||
{
|
||||
}
|
||||
|
||||
static void tr_where __P ((const __ptr_t));
|
||||
static void tr_where __P ((const __ptr_t)) internal_function;
|
||||
static void
|
||||
internal_function
|
||||
tr_where (caller)
|
||||
const __ptr_t caller;
|
||||
{
|
||||
|
@ -379,6 +379,11 @@ __extension__ \
|
||||
_obstack_newchunk (__o, __len); \
|
||||
(void) 0; })
|
||||
|
||||
#define obstack_empty_p(OBSTACK) \
|
||||
__extension__ \
|
||||
({ struct obstack *__o = (OBSTACK); \
|
||||
(__o->chunk->prev == 0 && __o->next_free - __o->chunk->contents == 0); })
|
||||
|
||||
#define obstack_grow(OBSTACK,where,length) \
|
||||
__extension__ \
|
||||
({ struct obstack *__o = (OBSTACK); \
|
||||
@ -492,6 +497,9 @@ __extension__ \
|
||||
#define obstack_room(h) \
|
||||
(unsigned) ((h)->chunk_limit - (h)->next_free)
|
||||
|
||||
#define obstack_empty_p(h) \
|
||||
(h->chunk->prev == 0 && h->next_free - h->chunk->contents == 0)
|
||||
|
||||
/* Note that the call to _obstack_newchunk is enclosed in (..., 0)
|
||||
so that we can avoid having void expressions
|
||||
in the arms of the conditional expression.
|
||||
|
@ -414,13 +414,19 @@ This function returns the absolute value of the floating-point number
|
||||
@deftypefunx float cabsf (complex float @var{z})
|
||||
@deftypefunx {long double} cabsl (complex long double @var{z})
|
||||
These functions return the absolute value of the complex number @var{z}.
|
||||
The compiler must support complex numbers to use these functions. (See
|
||||
also the function @code{hypot} in @ref{Exponents and Logarithms}.) The
|
||||
The compiler must support complex numbers to use these functions. The
|
||||
value is:
|
||||
|
||||
@smallexample
|
||||
sqrt (creal (@var{z}) * creal (@var{z}) + cimag (@var{z}) * cimag (@var{z}))
|
||||
@end smallexample
|
||||
|
||||
This function should always be used instead of the direct formula since
|
||||
using the simple straight-forward method can mean to loose accuracy. If
|
||||
one of the squared values is neglectable in size compared to the other
|
||||
value the result should be the same as the larger value. But squaring
|
||||
the value and afterwards using the square root function leads to
|
||||
unaccuracy. See @code{hypot} in @xref{Exponents and Logarithms}.
|
||||
@end deftypefun
|
||||
|
||||
@node Normalization Functions
|
||||
|
593
manual/conf.texi
593
manual/conf.texi
@ -236,7 +236,7 @@ always defines this as @code{1}, on the assumption that you had to have
|
||||
@deftypevr Macro {long int} _POSIX_VERSION
|
||||
This constant represents the version of the POSIX.1 standard to which
|
||||
the implementation conforms. For an implementation conforming to the
|
||||
1990 POSIX.1 standard, the value is the integer @code{199009L}.
|
||||
1995 POSIX.1 standard, the value is the integer @code{199506L}.
|
||||
|
||||
@code{_POSIX_VERSION} is always defined (in @file{unistd.h}) in any
|
||||
POSIX system.
|
||||
@ -367,6 +367,294 @@ Inquire about the parameter corresponding to @code{_POSIX_VERSION}.
|
||||
Inquire about the parameter corresponding to @code{CLOCKS_PER_SEC};
|
||||
@pxref{Basic CPU Time}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment GNU
|
||||
@item _SC_CHARCLASS_NAME_MAX
|
||||
Inquire about the parameter corresponding to maximal length allowed for
|
||||
a character class name in an extended locale specification. These
|
||||
extensions are not yet standardized and so this option is not standardized
|
||||
as well.
|
||||
|
||||
@comment unistdh.h
|
||||
@comment POSIX.1
|
||||
@item _SC_REALTIME_SIGNALS
|
||||
Inquire about the parameter corresponding to @code{_POSIX_REALTIME_SIGNALS}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_PRIORITY_SCHEDULING
|
||||
Inquire about the parameter corresponding to @code{_POSIX_PRIORITY_SCHEDULING}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_TIMERS
|
||||
Inquire about the parameter corresponding to @code{_POSIX_TIMERS}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_ASYNCHRONOUS_IO
|
||||
Inquire about the parameter corresponding to @code{_POSIX_ASYNCHRONOUS_IO}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_PRIORITIZED_IO
|
||||
Inquire about the parameter corresponding to @code{_POSIX_PRIORITIZED_IO}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_SYNCHRONIZED_IO
|
||||
Inquire about the parameter corresponding to @code{_POSIX_SYNCHRONIZED_IO}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_FSYNC
|
||||
Inquire about the parameter corresponding to @code{_POSIX_FSYNC}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_MAPPED_FILES
|
||||
Inquire about the parameter corresponding to @code{_POSIX_MAPPED_FILES}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_MEMLOCK
|
||||
Inquire about the parameter corresponding to @code{_POSIX_MEMLOCK}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_MEMLOCK_RANGE
|
||||
Inquire about the parameter corresponding to @code{_POSIX_MEMLOCK_RANGE}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_MEMORY_PROTECTION
|
||||
Inquire about the parameter corresponding to @code{_POSIX_MEMORY_PROTECTION}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_MESSAGE_PASSING
|
||||
Inquire about the parameter corresponding to @code{_POSIX_MESSAGE_PASSING}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_SEMAPHORES
|
||||
Inquire about the parameter corresponding to @code{_POSIX_SEMAPHORES}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_SHARED_MEMORY_OBJECTS
|
||||
Inquire about the parameter corresponding to
|
||||
@code{_POSIX_SHARED_MEMORY_OBJECTS}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_AIO_LISTIO_MAX
|
||||
Inquire about the parameter corresponding to @code{_POSIX_AIO_LISTIO_MAX}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_AIO_MAX
|
||||
Inquire about the parameter corresponding to @code{_POSIX_AIO_MAX}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_AIO_PRIO_DELTA_MAX
|
||||
Inquire the value by which a process can decrease its asynchronous I/O
|
||||
priority level from its own scheduling priority. This corresponds to the
|
||||
run-time invariant value @code{AIO_PRIO_DELTA_MAX}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_DELAYTIMER_MAX
|
||||
Inquire about the parameter corresponding to @code{_POSIX_DELAYTIMER_MAX}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_MQ_OPEN_MAX
|
||||
Inquire about the parameter corresponding to @code{_POSIX_MQ_OPEN_MAX}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_MQ_PRIO_MAX
|
||||
Inquire about the parameter corresponding to @code{_POSIX_MQ_PRIO_MAX}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_RTSIG_MAX
|
||||
Inquire about the parameter corresponding to @code{_POSIX_RTSIG_MAX}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_SEM_NSEMS_MAX
|
||||
Inquire about the parameter corresponding to @code{_POSIX_SEM_NSEMS_MAX}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_SEM_VALUE_MAX
|
||||
Inquire about the parameter corresponding to @code{_POSIX_SEM_VALUE_MAX}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_SIGQUEUE_MAX
|
||||
Inquire about the parameter corresponding to @code{_POSIX_SIGQUEUE_MAX}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_TIMER_MAX
|
||||
Inquire about the parameter corresponding to @code{_POSIX_TIMER_MAX}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1g
|
||||
@item _SC_PII
|
||||
Inquire about the parameter corresponding to @code{_POSIX_PII}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1g
|
||||
@item _SC_PII_XTI
|
||||
Inquire about the parameter corresponding to @code{_POSIX_PII_XTI}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1g
|
||||
@item _SC_PII_SOCKET
|
||||
Inquire about the parameter corresponding to @code{_POSIX_PII_SOCKET}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1g
|
||||
@item _SC_PII_INTERNET
|
||||
Inquire about the parameter corresponding to @code{_POSIX_PII_INTERNET}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1g
|
||||
@item _SC_PII_OSI
|
||||
Inquire about the parameter corresponding to @code{_POSIX_PII_OSI}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1g
|
||||
@item _SC_SELECT
|
||||
Inquire about the parameter corresponding to @code{_POSIX_SELECT}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1g
|
||||
@item _SC_UIO_MAXIOV
|
||||
Inquire about the parameter corresponding to @code{_POSIX_UIO_MAXIOV}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1g
|
||||
@item _SC_PII_INTERNET_STREAM
|
||||
Inquire about the parameter corresponding to @code{_POSIX_PII_INTERNET_STREAM}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1g
|
||||
@item _SC_PII_INTERNET_DGRAM
|
||||
Inquire about the parameter corresponding to @code{_POSIX_PII_INTERNET_DGRAM}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1g
|
||||
@item _SC_PII_OSI_COTS
|
||||
Inquire about the parameter corresponding to @code{_POSIX_PII_OSI_COTS}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1g
|
||||
@item _SC_PII_OSI_CLTS
|
||||
Inquire about the parameter corresponding to @code{_POSIX_PII_OSI_CLTS}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1g
|
||||
@item _SC_PII_OSI_M
|
||||
Inquire about the parameter corresponding to @code{_POSIX_PII_OSI_M}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1g
|
||||
@item _SC_T_IOV_MAX
|
||||
Inquire the value of the value associated with the @code{T_IOV_MAX}
|
||||
variable.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_THREADS
|
||||
Inquire about the parameter corresponding to @code{_POSIX_THREADS}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_THREAD_SAFE_FUNCTIONS
|
||||
Inquire about the parameter corresponding to
|
||||
@code{_POSIX_THREAD_SAFE_FUNCTIONS}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_GETGR_R_SIZE_MAX
|
||||
Inquire about the parameter corresponding to @code{_POSIX_GETGR_R_SIZE_MAX}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_GETPW_R_SIZE_MAX
|
||||
Inquire about the parameter corresponding to @code{_POSIX_GETPW_R_SIZE_MAX}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_LOGIN_NAME_MAX
|
||||
Inquire about the parameter corresponding to @code{_POSIX_LOGIN_NAME_MAX}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_TTY_NAME_MAX
|
||||
Inquire about the parameter corresponding to @code{_POSIX_TTY_NAME_MAX}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_THREAD_DESTRUCTOR_ITERATIONS
|
||||
Inquire about the parameter corresponding to
|
||||
@code{_POSIX_THREAD_DESTRUCTOR_ITERATIONS}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_THREAD_KEYS_MAX
|
||||
Inquire about the parameter corresponding to @code{_POSIX_THREAD_KEYS_MAX}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_THREAD_STACK_MIN
|
||||
Inquire about the parameter corresponding to @code{_POSIX_THREAD_STACK_MIN}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_THREAD_THREADS_MAX
|
||||
Inquire about the parameter corresponding to @code{_POSIX_THREAD_THREADS_MAX}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_THREAD_ATTR_STACKADDR
|
||||
Inquire about the parameter corresponding to
|
||||
@code{_POSIX_THREAD_ATTR_STACKADDR}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_THREAD_ATTR_STACKSIZE
|
||||
Inquire about the parameter corresponding to
|
||||
@code{_POSIX_THREAD_ATTR_STACKSIZE}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_THREAD_PRIORITY_SCHEDULING
|
||||
Inquire about the parameter corresponding to
|
||||
@code{_POSIX_THREAD_PRIORITY_SCHEDULING}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_THREAD_PRIO_INHERIT
|
||||
Inquire about the parameter corresponding to @code{_POSIX_THREAD_PRIO_INHERIT}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_THREAD_PRIO_PROTECT
|
||||
Inquire about the parameter corresponding to @code{_POSIX_THREAD_PRIO_PROTECT}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _SC_THREAD_PROCESS_SHARED
|
||||
Inquire about the parameter corresponding to
|
||||
@code{_POSIX_THREAD_PROCESS_SHARED}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.2
|
||||
@item _SC_2_C_DEV
|
||||
@ -465,6 +753,212 @@ support.
|
||||
Inquire about the virtual memory page size of the machine.
|
||||
@code{getpagesize} returns the same value.
|
||||
@c @xref{XXX getpagesize}. !!! ???
|
||||
|
||||
@comment unistd.h
|
||||
@comment GNU
|
||||
@item _SC_NPROCESSORS_CONF
|
||||
Inquire about number of configured processors.
|
||||
|
||||
@comment unistd.h
|
||||
@comment GNU
|
||||
@item _SC_NPROCESSORS_ONLN
|
||||
Inquire about number of processors online.
|
||||
|
||||
@comment unistd.h
|
||||
@comment GNU
|
||||
@item _SC_PHYS_PAGES
|
||||
Inquire about number of physical pages in the system.
|
||||
|
||||
@comment unistd.h
|
||||
@comment GNU
|
||||
@item _SC_AVPHYS_PAGES
|
||||
Inquire about number of available physical pages in the system.
|
||||
|
||||
@comment unistd.h
|
||||
@comment GNU
|
||||
@item _SC_ATEXIT_MAX
|
||||
Inquire about number of functions which can be registered as termination
|
||||
functions for @code{atexit}; @pxref{Cleanups on Exit}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_XOPEN_VERSION
|
||||
Inquire about the parameter corresponding to @code{_XOPEN_VERSION}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_XOPEN_XCU_VERSION
|
||||
Inquire about the parameter corresponding to @code{_XOPEN_XCU_VERSION}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_XOPEN_UNIX
|
||||
Inquire about the parameter corresponding to @code{_XOPEN_UNIX}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_XOPEN_CRYPT
|
||||
Inquire about the parameter corresponding to @code{_XOPEN_CRYPT}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_XOPEN_ENH_I18N
|
||||
Inquire about the parameter corresponding to @code{_XOPEN_ENH_I18N}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_XOPEN_SHM
|
||||
Inquire about the parameter corresponding to @code{_XOPEN_SHM}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_XOPEN_XPG2
|
||||
Inquire about the parameter corresponding to @code{_XOPEN_XPG2}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_XOPEN_XPG3
|
||||
Inquire about the parameter corresponding to @code{_XOPEN_XPG3}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_XOPEN_XPG4
|
||||
Inquire about the parameter corresponding to @code{_XOPEN_XPG4}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_CHAR_BIT
|
||||
Inquire about number of bits in a variable of type @code{char}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_CHAR_MAX
|
||||
Inquire about maximum value which can be stored in a variable of type
|
||||
@code{char}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_CHAR_MIN
|
||||
Inquire about minimum value which can be stored in a variable of type
|
||||
@code{char}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_INT_MAX
|
||||
Inquire about maximum value which can be stored in a variable of type
|
||||
@code{int}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_INT_MIN
|
||||
Inquire about minimum value which can be stored in a variable of type
|
||||
@code{int}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_LONG_BIT
|
||||
Inquire about number of bits in a variable of type @code{long int}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_WORD_BIT
|
||||
Inquire about number of bits in a variable of a register word.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_MB_LEN_MAX
|
||||
Inquire the maximum length of a multi-byte representation of a wide
|
||||
character value.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_NZERO
|
||||
Inquire value used to internally represent the zero priority level for
|
||||
the process execution.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item SC_SSIZE_MAX
|
||||
Inquire about maximum value which can be stored in a variable of type
|
||||
@code{ssize_t}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_SCHAR_MAX
|
||||
Inquire about maximum value which can be stored in a variable of type
|
||||
@code{signed char}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_SCHAR_MIN
|
||||
Inquire about minimum value which can be stored in a variable of type
|
||||
@code{signed char}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_SHRT_MAX
|
||||
Inquire about maximum value which can be stored in a variable of type
|
||||
@code{short int}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_SHRT_MIN
|
||||
Inquire about minimum value which can be stored in a variable of type
|
||||
@code{short int}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_UCHAR_MAX
|
||||
Inquire about maximum value which can be stored in a variable of type
|
||||
@code{unsigned char}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_UINT_MAX
|
||||
Inquire about maximum value which can be stored in a variable of type
|
||||
@code{unsigned int}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_ULONG_MAX
|
||||
Inquire about maximum value which can be stored in a variable of type
|
||||
@code{unsigned long int}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_USHRT_MAX
|
||||
Inquire about maximum value which can be stored in a variable of type
|
||||
@code{unsigned short int}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_NL_ARGMAX
|
||||
Inquire about the parameter corresponding to @code{NL_ARGMAX}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_NL_LANGMAX
|
||||
Inquire about the parameter corresponding to @code{NL_LANGMAX}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_NL_MSGMAX
|
||||
Inquire about the parameter corresponding to @code{NL_MSGMAX}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_NL_NMAX
|
||||
Inquire about the parameter corresponding to @code{NL_NMAX}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_NL_SETMAX
|
||||
Inquire about the parameter corresponding to @code{NL_SETMAX}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@item _SC_NL_TEXTMAX
|
||||
Inquire about the parameter corresponding to @code{NL_TEXTMAX}.
|
||||
@end table
|
||||
|
||||
@node Examples of Sysconf
|
||||
@ -520,6 +1014,23 @@ safely push to these limits without checking whether the particular
|
||||
system you are using can go that far.
|
||||
|
||||
@table @code
|
||||
@comment limits.h
|
||||
@comment POSIX.1
|
||||
@item _POSIX_AIO_LISTIO_MAX
|
||||
The most restrictive limit permitted by POSIX for the maximum number of
|
||||
I/O operations that can be specified in a list I/O call. The value of
|
||||
this constant is @code{2}; thus you can add up to two new entries
|
||||
of the list of outstandard operations.
|
||||
|
||||
@comment limits.h
|
||||
@comment POSIX.1
|
||||
@item _POSIX_AIO_MAX
|
||||
The most restrictive limit permitted by POSIX for the maximum number of
|
||||
outstanding asynchronous I/O operations. The value of this constant is
|
||||
@code{1}. So you cannot expect that you can issue more than one
|
||||
operation and immediately continue with the normal work, receiving the
|
||||
notifications asynchronously.
|
||||
|
||||
@comment limits.h
|
||||
@comment POSIX.1
|
||||
@item _POSIX_ARG_MAX
|
||||
@ -732,7 +1243,9 @@ particular file, call @code{pathconf} or @code{fpathconf}.
|
||||
Here are the names for the POSIX minimum upper bounds for some of the
|
||||
above parameters. The significance of these values is that you can
|
||||
safely push to these limits without checking whether the particular
|
||||
system you are using can go that far.
|
||||
system you are using can go that far. In most cases GNU systems do not
|
||||
have these strict limitations. The actual limit should be requested if
|
||||
necessary.
|
||||
|
||||
@table @code
|
||||
@comment limits.h
|
||||
@ -883,6 +1396,26 @@ Inquire about the value of @code{_POSIX_NO_TRUNC}.
|
||||
@comment POSIX.1
|
||||
@item _PC_VDISABLE
|
||||
Inquire about the value of @code{_POSIX_VDISABLE}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _PC_SYNC_IO
|
||||
Inquire about the value of @code{_POSIX_SYNC_IO}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _PC_ASYNC_IO
|
||||
Inquire about the value of @code{_POSIX_ASYNC_IO}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1
|
||||
@item _PC_PRIO_IO
|
||||
Inquire about the value of @code{_POSIX_PRIO_IO}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX.1g
|
||||
@item _PC_SOCK_MAXBUF
|
||||
Inquire about the value of @code{_POSIX_PIPE_BUF}.
|
||||
@end table
|
||||
|
||||
@node Utility Limits
|
||||
@ -1064,6 +1597,62 @@ Currently there is just one parameter you can read with @code{confstr}:
|
||||
This parameter's value is the recommended default path for searching for
|
||||
executable files. This is the path that a user has by default just
|
||||
after logging in.
|
||||
|
||||
@comment unistd.h
|
||||
@comment Unix98
|
||||
@item _CS_LFS_CFLAGS
|
||||
The returned string specifies which additionals flags must be given to
|
||||
the C compiler if a source is compiled using the
|
||||
@code{_LARGEFILE_SOURCE} feature select macro; @pxref{Feature Test Macros}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment Unix98
|
||||
@item _CS_LFS_LDFLAGS
|
||||
The returned string specifies which additionals flags must be given to
|
||||
the linker if a source is compiled using the
|
||||
@code{_LARGEFILE_SOURCE} feature select macro; @pxref{Feature Test Macros}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment Unix98
|
||||
@item _CS_LFS_LIBS
|
||||
The returned string specifies which additionals libraries must be linked
|
||||
to the application if a source is compiled using the
|
||||
@code{_LARGEFILE_SOURCE} feature select macro; @pxref{Feature Test Macros}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment Unix98
|
||||
@item _CS_LFS_LINTFLAGS
|
||||
The returned string specifies which additionals flags must be given to
|
||||
the the lint tool if a source is compiled using the
|
||||
@code{_LARGEFILE_SOURCE} feature select macro; @pxref{Feature Test Macros}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment Unix98
|
||||
@item _CS_LFS64_CFLAGS
|
||||
The returned string specifies which additionals flags must be given to
|
||||
the C compiler if a source is compiled using the
|
||||
@code{_LARGEFILE64_SOURCE} feature select macro; @pxref{Feature Test Macros}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment Unix98
|
||||
@item _CS_LFS64_LDFLAGS
|
||||
The returned string specifies which additionals flags must be given to
|
||||
the linker if a source is compiled using the
|
||||
@code{_LARGEFILE64_SOURCE} feature select macro; @pxref{Feature Test Macros}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment Unix98
|
||||
@item _CS_LFS64_LIBS
|
||||
The returned string specifies which additionals libraries must be linked
|
||||
to the application if a source is compiled using the
|
||||
@code{_LARGEFILE64_SOURCE} feature select macro; @pxref{Feature Test Macros}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment Unix98
|
||||
@item _CS_LFS64_LINTFLAGS
|
||||
The returned string specifies which additionals flags must be given to
|
||||
the the lint tool if a source is compiled using the
|
||||
@code{_LARGEFILE64_SOURCE} feature select macro; @pxref{Feature Test Macros}.
|
||||
@end table
|
||||
|
||||
The way to use @code{confstr} without any arbitrary limit on string size
|
||||
|
@ -71,7 +71,7 @@ included as well as the @w{ISO C}, POSIX.1, POSIX.2, and X/Open material.
|
||||
@end defvr
|
||||
|
||||
@comment (none)
|
||||
@comment XOPEN
|
||||
@comment X/Open
|
||||
@defvr Macro _XOPEN_SOURCE
|
||||
@defvrx Macro _XOPEN_SOURCE_EXTENDED
|
||||
If you define this macro, functionality described in the X/Open
|
||||
@ -91,11 +91,72 @@ all functionality described so far plus some new definitions from the
|
||||
Single Unix specification, @w{version 2}.
|
||||
@end defvr
|
||||
|
||||
@comment (NONE)
|
||||
@comment X/Open
|
||||
@defvr Macro _LARGEFILE_SOURCE
|
||||
If this macro is defined some extra functions are available which
|
||||
rectify a few shortcomings in all previous standards. More concreten
|
||||
the functions @code{fseeko} and @code{ftello} are available. Without
|
||||
these functions the difference between the @w{ISO C} interface
|
||||
(@code{fseek}, @code{ftell}) and the low-level POSIX interface
|
||||
(@code{lseek}) would lead to problems.
|
||||
|
||||
This macro was introduced as part of the Large File Support extension (LFS).
|
||||
@end defvr
|
||||
|
||||
@comment (NONE)
|
||||
@comment X/Open
|
||||
@defvar Macro _LARGEFILE64_SOURCE
|
||||
If you define this macro an additional set of function gets available
|
||||
which enables to use on @w{32 bit} systems to use files of sizes beyond
|
||||
the usual limit of 2GB. This interface is not available if the system
|
||||
does not support files that large. On systems where the natural file
|
||||
size limit is greater than 2GB (i.e., on @w{64 bit} systems) the new
|
||||
functions are identical to the replaced functions.
|
||||
|
||||
The new functionality is made available by a new set of types and
|
||||
functions which replace existing. The names of these new objects
|
||||
contain @code{64} to indicate the intention, e.g., @code{off_t}
|
||||
vs. @code{off64_t} and @code{fseeko} vs. @code{fseeko64}.
|
||||
|
||||
This macro was introduced as part of the Large File Support extension
|
||||
(LFS). It is a transition interface for the time @w{64 bit} offsets are
|
||||
not generally used (see @code{_FILE_OFFSET_BITS}.
|
||||
@end defvar
|
||||
|
||||
@comment (NONE)
|
||||
@comment X/Open
|
||||
@defvar _FILE_OFFSET_BITS
|
||||
This macro lets decide which file system interface shall be used, one
|
||||
replacing the other. While @code{_LARGEFILE64_SOURCE} makes the @w{64
|
||||
bit} interface available as an additional interface
|
||||
@code{_FILE_OFFSET_BITS} allows to use the @w{64 bit} interface to
|
||||
replace the old interface.
|
||||
|
||||
If @code{_FILE_OFFSET_BITS} is undefined or if it is defined to the
|
||||
value @code{32} nothing changes. The @w{32 bit} interface is used and
|
||||
types like @code{off_t} have a size of @w{32 bits} on @w{32 bit}
|
||||
systems.
|
||||
|
||||
If the macro is defined to the value @code{64} the large file interface
|
||||
replaces the old interface. I.e., the functions are not made available
|
||||
under different names as @code{_LARGEFILE64_SOURCE} does. Instead the
|
||||
old function names now reference the new functions, e.g., a call to
|
||||
@code{fseeko} now indeed calls @code{fseeko64}.
|
||||
|
||||
This macro should only be selected if the system provides mechanisms for
|
||||
handling large files. On @w{64 bit} systems this macro has no effect
|
||||
since the @code{*64} functions are identical to the normal functions.
|
||||
|
||||
This macro was introduced as part of the Large File Support extension
|
||||
(LFS).
|
||||
@end defvar
|
||||
|
||||
@comment (none)
|
||||
@comment GNU
|
||||
@defvr Macro _GNU_SOURCE
|
||||
If you define this macro, everything is included: @w{ISO C}, POSIX.1,
|
||||
POSIX.2, BSD, SVID, X/Open, and GNU extensions. In the cases where
|
||||
POSIX.2, BSD, SVID, X/Open, LFS, and GNU extensions. In the cases where
|
||||
POSIX.1 conflicts with BSD, the POSIX definitions take precedence.
|
||||
|
||||
If you want to get the full effect of @code{_GNU_SOURCE} but make the
|
||||
|
216
manual/llio.texi
216
manual/llio.texi
@ -32,6 +32,7 @@ directly.)
|
||||
@menu
|
||||
* Opening and Closing Files:: How to open and close file
|
||||
descriptors.
|
||||
* Truncating Files:: Change the size of a file.
|
||||
* I/O Primitives:: Reading and writing data.
|
||||
* File Position Primitive:: Setting a descriptor's file
|
||||
position.
|
||||
@ -41,6 +42,7 @@ directly.)
|
||||
descriptors and streams.
|
||||
* Waiting for I/O:: How to check for input or output
|
||||
on multiple file descriptors.
|
||||
* Synchronizing I/O:: Making sure all I/O actions completed.
|
||||
* Control Operations:: Various other operations on file
|
||||
descriptors.
|
||||
* Duplicating Descriptors:: Fcntl commands for duplicating
|
||||
@ -136,6 +138,14 @@ or @code{O_CREAT} is set and the file does not already exist.
|
||||
|
||||
@c !!! umask
|
||||
|
||||
This function is a cancelation point in multi-threaded programs. This
|
||||
is a problem if the thread allocates some resources (like memory, file
|
||||
descriptors, semaphores or whatever) at the time @code{open} is
|
||||
called. If the thread gets canceled these resources stay allocated
|
||||
until the program ends. To avoid this calls to @code{open} should be
|
||||
protected using cancelation handlers.
|
||||
@c ref pthread_cleanup_push / pthread_cleanup_pop
|
||||
|
||||
The @code{open} function is the underlying primitive for the @code{fopen}
|
||||
and @code{freopen} functions, that create streams.
|
||||
@end deftypefun
|
||||
@ -175,6 +185,14 @@ When all file descriptors associated with a pipe or FIFO have been closed,
|
||||
any unread data is discarded.
|
||||
@end itemize
|
||||
|
||||
This function is a cancelation point in multi-threaded programs. This
|
||||
is a problem if the thread allocates some resources (like memory, file
|
||||
descriptors, semaphores or whatever) at the time @code{close} is
|
||||
called. If the thread gets canceled these resources stay allocated
|
||||
until the program ends. To avoid this calls to @code{close} should be
|
||||
protected using cancelation handlers.
|
||||
@c ref pthread_cleanup_push / pthread_cleanup_pop
|
||||
|
||||
The normal return value from @code{close} is @code{0}; a value of @code{-1}
|
||||
is returned in case of failure. The following @code{errno} error
|
||||
conditions are defined for this function:
|
||||
@ -206,6 +224,73 @@ of trying to close its underlying file descriptor with @code{close}.
|
||||
This flushes any buffered output and updates the stream object to
|
||||
indicate that it is closed.
|
||||
|
||||
|
||||
@node Truncating Files
|
||||
@section Change the size of a file
|
||||
|
||||
In some situations it is useful to explicitly determine the size of a
|
||||
file. Since the 4.2BSD days there is a function to truncate a file to
|
||||
at most a given number of bytes and POSIX defines one additional
|
||||
function. The prototypes for these functions are in @file{unistd.h}.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@deftypefun int truncate (const char *@var{name}, size_t @var{length})
|
||||
The @code{truncation} function truncates the file named by @var{name} to
|
||||
at most @var{length} bytes. I.e., if the file was larger before the
|
||||
extra bytes are stripped of. If the file was small or equal to
|
||||
@var{length} in size before nothing is done. The file must be writable
|
||||
by the user to perform this operation.
|
||||
|
||||
The return value is zero is everything wnet ok. Otherwise the return
|
||||
value is @math{-1} and the global variable @var{errno} is set to:
|
||||
@table @code
|
||||
@item EACCES
|
||||
The file is not accessible to the user.
|
||||
@item EINVAL
|
||||
The @var{length} value is illegal.
|
||||
@item EISDIR
|
||||
The object named by @var{name} is a directory.
|
||||
@item ENOENT
|
||||
The file named by @var{name} does not exist.
|
||||
@item ENOTDIR
|
||||
One part of the @var{name} is not a directory.
|
||||
@end table
|
||||
|
||||
This function was introduced in 4.2BSD but also was available in later
|
||||
@w{System V} systems. It is not added to POSIX since the authors felt
|
||||
it is only of marginally additional utility. See below.
|
||||
@end deftypefun
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX
|
||||
@deftypefun int ftruncate (int @var{fd}, size_t @var{length})
|
||||
The @code{ftruncate} function is similar to the @code{truncate}
|
||||
function. The main difference is that it takes a descriptor for an
|
||||
opened file instead of a file name to identify the object. The file
|
||||
must be opened for writing to successfully carry out the operation.
|
||||
|
||||
The POSIX standard leaves it implementation defined what happens if the
|
||||
specified new @var{length} of the file is bigger than the original size.
|
||||
The @code{ftruncate} function might simply leave the file alone and do
|
||||
nothing or it can increase the size to the desired size. In this later
|
||||
case the extended area should be zero-filled. So using @code{ftruncate}
|
||||
is no reliable way to increase the file size but if it is possible it is
|
||||
probably the fastest way. The function also operates on POSIX shared
|
||||
memory segments if these are implemented by the system.
|
||||
|
||||
On success the function returns zero. Otherwise it returns @math{-1}
|
||||
and set @var{errno} to one of these values:
|
||||
@table @code
|
||||
@item EBADF
|
||||
@var{fd} is no valid file descriptor or is not opened for writing.
|
||||
@item EINVAL
|
||||
The object referred to by @var{fd} does not permit this operation.
|
||||
@item EROFS
|
||||
The file is on a read-only file system.
|
||||
@end table
|
||||
@end deftypefun
|
||||
|
||||
@node I/O Primitives
|
||||
@section Input and Output Primitives
|
||||
|
||||
@ -297,6 +382,14 @@ orphaned. @xref{Job Control}, for more information about job control,
|
||||
and @ref{Signal Handling}, for information about signals.
|
||||
@end table
|
||||
|
||||
This function is a cancelation point in multi-threaded programs. This
|
||||
is a problem if the thread allocates some resources (like memory, file
|
||||
descriptors, semaphores or whatever) at the time @code{read} is
|
||||
called. If the thread gets canceled these resources stay allocated
|
||||
until the program ends. To avoid this calls to @code{read} should be
|
||||
protected using cancelation handlers.
|
||||
@c ref pthread_cleanup_push / pthread_cleanup_pop
|
||||
|
||||
The @code{read} function is the underlying primitive for all of the
|
||||
functions that read from streams, such as @code{fgetc}.
|
||||
@end deftypefun
|
||||
@ -419,6 +512,14 @@ macro @code{TEMP_FAILURE_RETRY}, as follows:
|
||||
nbytes = TEMP_FAILURE_RETRY (write (desc, buffer, count));
|
||||
@end smallexample
|
||||
|
||||
This function is a cancelation point in multi-threaded programs. This
|
||||
is a problem if the thread allocates some resources (like memory, file
|
||||
descriptors, semaphores or whatever) at the time @code{write} is
|
||||
called. If the thread gets canceled these resources stay allocated
|
||||
until the program ends. To avoid this calls to @code{write} should be
|
||||
protected using cancelation handlers.
|
||||
@c ref pthread_cleanup_push / pthread_cleanup_pop
|
||||
|
||||
The @code{write} function is the underlying primitive for all of the
|
||||
functions that write to streams, such as @code{fputc}.
|
||||
@end deftypefun
|
||||
@ -537,9 +638,18 @@ only for pipes and FIFOs, but in the GNU system, you always get
|
||||
@code{ESPIPE} if the object is not seekable.)
|
||||
@end table
|
||||
|
||||
This function is a cancelation point in multi-threaded programs. This
|
||||
is a problem if the thread allocates some resources (like memory, file
|
||||
descriptors, semaphores or whatever) at the time @code{lseek} is
|
||||
called. If the thread gets canceled these resources stay allocated
|
||||
until the program ends. To avoid this calls to @code{lseek} should be
|
||||
protected using cancelation handlers.
|
||||
@c ref pthread_cleanup_push / pthread_cleanup_pop
|
||||
|
||||
The @code{lseek} function is the underlying primitive for the
|
||||
@code{fseek}, @code{ftell} and @code{rewind} functions, which operate on
|
||||
streams instead of file descriptors.
|
||||
@code{fseek}, @code{fseeko}, @code{ftell}, @code{ftello} and
|
||||
@code{rewind} functions, which operate on streams instead of file
|
||||
descriptors.
|
||||
@end deftypefun
|
||||
|
||||
You can have multiple descriptors for the same file if you open the file
|
||||
@ -1007,6 +1117,100 @@ There is another example showing the use of @code{select} to multiplex
|
||||
input from multiple sockets in @ref{Server Example}.
|
||||
|
||||
|
||||
@node Synchronizing I/O
|
||||
@section Synchronizing I/O operations
|
||||
|
||||
@cindex synchronizing
|
||||
In most modern operation systems the normal I/O operations are not
|
||||
executed synchronously. I.e., even if a @code{write} system call
|
||||
returns this does not mean the data is actually written to the media,
|
||||
e.g., the disk.
|
||||
|
||||
In situations where synchronization points are necessary the user can
|
||||
use special functions which ensure that all operations finished before
|
||||
they return.
|
||||
|
||||
@comment unistd.h
|
||||
@comment X/Open
|
||||
@deftypefun int sync (void)
|
||||
A call to this function will not return as long as there is data which
|
||||
that is not written to the device. All dirty buffers in the kernel will
|
||||
be written and so an overall consistent system can be achieved (if no
|
||||
other process in parallel writes data).
|
||||
|
||||
A prototype for @code{sync} can be found in @file{unistd.h}.
|
||||
|
||||
The return value is zero to indicate no error.
|
||||
@end deftypefun
|
||||
|
||||
More often it is wanted that not all data in the system is committed.
|
||||
Programs want to ensure that data written to a given file are all
|
||||
committed and in this situation @code{sync} is overkill.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX
|
||||
@deftypefun int fsync (int @var{fildes})
|
||||
The @code{fsync} can be used to make sure all data associated with the
|
||||
open file @var{fildes} is written to the device associated with the
|
||||
descriptor. The function call does not return unless all actions have
|
||||
finished.
|
||||
|
||||
A prototype for @code{fsync} can be found in @file{unistd.h}.
|
||||
|
||||
This function is a cancelation point in multi-threaded programs. This
|
||||
is a problem if the thread allocates some resources (like memory, file
|
||||
descriptors, semaphores or whatever) at the time @code{fsync} is
|
||||
called. If the thread gets canceled these resources stay allocated
|
||||
until the program ends. To avoid this calls to @code{fsync} should be
|
||||
protected using cancelation handlers.
|
||||
@c ref pthread_cleanup_push / pthread_cleanup_pop
|
||||
|
||||
The return value of the function is zero if no error occured. Otherwise
|
||||
it is @math{-1} and the global variable @var{errno} is set to the
|
||||
following values:
|
||||
@table @code
|
||||
@item EBADF
|
||||
The descriptor @var{fildes} is not valid.
|
||||
|
||||
@item EINVAL
|
||||
No synchronization is possible since the system does not implement this.
|
||||
@end table
|
||||
@end deftypefun
|
||||
|
||||
Sometimes it is not even necessary to write all data associated with a
|
||||
file descriptor. E.g., in database files which do not change in size it
|
||||
is enough to write all the file content data to the device.
|
||||
Metainformation like the modification time etc. are not that important
|
||||
and leaving such information uncommitted does not prevent a successful
|
||||
recovering of the file in case of a problem.
|
||||
|
||||
@comment unistd.h
|
||||
@comment POSIX
|
||||
@deftypefun int fdatasync (int @var{fildes})
|
||||
When a call to the @code{fdatasync} function returns it is maed sure
|
||||
that all of the file data is written to the device. For all pending I/O
|
||||
operations the parts guaranteeing data integrety finished.
|
||||
|
||||
Not all systems implement the @code{fdatasync} operation. On systems
|
||||
missing this functionality @code{fdatasync} is emulated by a call to
|
||||
@code{fsync} since the performed actions are a superset of those
|
||||
required by @code{fdatasyn}.
|
||||
|
||||
The prototype for @code{fdatasync} is in @file{unistd.h}.
|
||||
|
||||
The return value of the function is zero if no error occured. Otherwise
|
||||
it is @math{-1} and the global variable @var{errno} is set to the
|
||||
following values:
|
||||
@table @code
|
||||
@item EBADF
|
||||
The descriptor @var{fildes} is not valid.
|
||||
|
||||
@item EINVAL
|
||||
No synchronization is possible since the system does not implement this.
|
||||
@end table
|
||||
@end deftypefun
|
||||
|
||||
|
||||
@node Control Operations
|
||||
@section Control Operations on Files
|
||||
|
||||
@ -1069,6 +1273,14 @@ Get process or process group ID to receive @code{SIGIO} signals.
|
||||
Set process or process group ID to receive @code{SIGIO} signals.
|
||||
@xref{Interrupt Input}.
|
||||
@end table
|
||||
|
||||
This function is a cancelation point in multi-threaded programs. This
|
||||
is a problem if the thread allocates some resources (like memory, file
|
||||
descriptors, semaphores or whatever) at the time @code{fcntl} is
|
||||
called. If the thread gets canceled these resources stay allocated
|
||||
until the program ends. To avoid this calls to @code{fcntl} should be
|
||||
protected using cancelation handlers.
|
||||
@c ref pthread_cleanup_push / pthread_cleanup_pop
|
||||
@end deftypefun
|
||||
|
||||
|
||||
|
@ -50,28 +50,21 @@ Here are some options that you should specify (if appropriate) when
|
||||
you run @code{configure}:
|
||||
|
||||
@table @samp
|
||||
@item --with-gnu-ld
|
||||
Use this option if you plan to use GNU @code{ld} to link programs with
|
||||
the GNU C Library. (We strongly recommend that you do.) This option
|
||||
enables use of features that exist only in GNU @code{ld}; so if you
|
||||
configure for GNU @code{ld} you must use GNU @code{ld} @emph{every time}
|
||||
you link with the GNU C Library, and when building it.
|
||||
|
||||
@item --with-gnu-as
|
||||
Use this option if you plan to use the GNU assembler, @code{gas}, when
|
||||
building the GNU C Library. On some systems, the library may not build
|
||||
properly if you do @emph{not} use @code{gas}.
|
||||
|
||||
@item --with-gnu-binutils
|
||||
This option implies both @w{@samp{--with-gnu-ld}} and @w{@samp{--with-gnu-as}}.
|
||||
On systems where GNU tools are the system tools, there is no need to
|
||||
specify this option. These include GNU, GNU/Linux, and free BSD systems.
|
||||
@item --with-binutils=@var{directory}
|
||||
Use the binutils (assembler and linker) in @file{@var{directory}}, not
|
||||
the ones the C compiler would default to. You could use this option if
|
||||
the default binutils on your system cannot deal with all the constructs
|
||||
in the GNU C library. (@code{configure} will detect the problem and
|
||||
suppress these constructs, so the library will still be usable, but
|
||||
functionality may be lost---for example, you can not build a shared libc
|
||||
with old binutils.)
|
||||
|
||||
@c extra blank line makes it look better
|
||||
@item --without-fp
|
||||
@itemx --nfp
|
||||
|
||||
Use this option if your computer lacks hardware floating-point support.
|
||||
Use this option if your computer lacks hardware floating-point support
|
||||
and your operating system does not emulate an FPU.
|
||||
|
||||
@item --prefix=@var{directory}
|
||||
Install machine-independent data files in subdirectories of
|
||||
@ -1133,6 +1126,114 @@ extensions that they make and grant Carnegie Mellon the rights to
|
||||
redistribute these changes.
|
||||
@end quotation
|
||||
|
||||
@item
|
||||
The code for the database library @file{libdb} comes from the 2.3
|
||||
release of Berkeley DB. That code is under the same copyright as 4.4 BSD
|
||||
and also:
|
||||
|
||||
@quotation
|
||||
@display
|
||||
Copyright @copyright{} 1990, 1993, 1994, 1995, 1996, 1997
|
||||
Sleepycat Software. All rights reserved.
|
||||
@end display
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
@enumerate
|
||||
@item
|
||||
Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
@item
|
||||
Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
@item
|
||||
Redistributions in any form must be accompanied by information on
|
||||
how to obtain complete source code for the DB software and any
|
||||
accompanying software that uses the DB software. The source code
|
||||
must either be included in the distribution or be available for no
|
||||
more than the cost of distribution plus a nominal fee, and must be
|
||||
freely redistributable under reasonable conditions. For an
|
||||
executable file, complete source code means the source code for all
|
||||
modules it contains. It does not mean source code for modules or
|
||||
files that typically accompany the operating system on which the
|
||||
executable file runs, e.g., standard library modules or system
|
||||
header files.
|
||||
@end enumerate
|
||||
|
||||
@sc{this software is provided by sleepycat software ``as is'' and
|
||||
any express or implied warranties, including, but not limited to, the
|
||||
implied warranties of merchantability and fitness for a particular purpose
|
||||
are disclaimed. in no event shall sleepycat software be liable
|
||||
for any direct, indirect, incidental, special, exemplary, or consequential
|
||||
damages (including, but not limited to, procurement of substitute goods
|
||||
or services; loss of use, data, or profits; or business interruption)
|
||||
however caused and on any theory of liability, whether in contract, strict
|
||||
liability, or tort (including negligence or otherwise) arising in any way
|
||||
out of the use of this software, even if advised of the possibility of
|
||||
such damage.}
|
||||
|
||||
@display
|
||||
Portions copyright @copyright{} 1995, 1996
|
||||
The President and Fellows of Harvard University.
|
||||
All rights reserved.
|
||||
@end display
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
@enumerate
|
||||
@item
|
||||
Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
@item
|
||||
Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
@item
|
||||
All advertising materials mentioning features or use of this software
|
||||
must display the following acknowledgement:
|
||||
@quotation
|
||||
This product includes software developed by Harvard University
|
||||
and its contributors.
|
||||
@end quotation
|
||||
@item
|
||||
Neither the name of the University nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
@end enumerate
|
||||
|
||||
@sc{this software is provided by harvard and its contributors ``as is'' and
|
||||
any express or implied warranties, including, but not limited to, the
|
||||
implied warranties of merchantability and fitness for a particular purpose
|
||||
are disclaimed. in no event shall harvard or its contributors be liable
|
||||
for any direct, indirect, incidental, special, exemplary, or consequential
|
||||
damages (including, but not limited to, procurement of substitute goods
|
||||
or services; loss of use, data, or profits; or business interruption)
|
||||
however caused and on any theory of liability, whether in contract, strict
|
||||
liability, or tort (including negligence or otherwise) arising in any way
|
||||
out of the use of this software, even if advised of the possibility of
|
||||
such damage.}
|
||||
|
||||
@noindent
|
||||
For a license to use, redistribute or sell DB software under conditions
|
||||
other than those described above, or to purchase support for this
|
||||
software, please contact Sleepycat Software at
|
||||
|
||||
@display
|
||||
Sleepycat Software
|
||||
394 E. Riding Dr.
|
||||
Carlisle, MA 01741
|
||||
USA
|
||||
+1-508-287-4781
|
||||
@end display
|
||||
|
||||
or @email{db@@sleepycat.com}.
|
||||
|
||||
@end quotation
|
||||
|
||||
@end itemize
|
||||
|
||||
@c @bye
|
||||
|
@ -1259,6 +1259,31 @@ $$\log(z) = \log(|z|) + i \arg(z)$$
|
||||
@end iftex
|
||||
@end deftypefun
|
||||
|
||||
|
||||
@comment complex.h
|
||||
@comment GNU
|
||||
@deftypefun {complex double} clog10 (complex double @var{z})
|
||||
@deftypefunx {complex float} clog10f (complex float @var{z})
|
||||
@deftypefunx {complex long double} clog10l (complex long double @var{z})
|
||||
These functions return the base 10 logarithm of the complex value
|
||||
@var{z}. Unlike the real value version @code{log} and its variants,
|
||||
@code{clog} has no limit for the range of its argument @var{z}.
|
||||
|
||||
@noindent
|
||||
Mathematically this corresponds to the value
|
||||
|
||||
@ifinfo
|
||||
@math{log (z) = log10 (cabs (z)) + I * carg (z)}
|
||||
@end ifinfo
|
||||
@iftex
|
||||
@tex
|
||||
$$\log_{10}(z) = \log_{10}(|z|) + i \arg(z)$$
|
||||
@end tex
|
||||
@end iftex
|
||||
|
||||
This function is a GNU extension.
|
||||
@end deftypefun
|
||||
|
||||
@comment complex.h
|
||||
@comment ISO
|
||||
@deftypefun {complex double} csqrt (complex double @var{z})
|
||||
@ -1274,7 +1299,7 @@ the value of the argument.
|
||||
@deftypefun {complex double} cpow (complex double @var{base}, complex double @var{power})
|
||||
@deftypefunx {complex float} cpowf (complex float @var{base}, complex float @var{power})
|
||||
@deftypefunx {complex long double} cpowl (complex long double @var{base}, complex long double @var{power})
|
||||
These functions return the complex value @var{BASE} raised to the power of
|
||||
These functions return the complex value @var{base} raised to the power of
|
||||
@var{power}. This is computed as
|
||||
|
||||
@ifinfo
|
||||
|
@ -62,6 +62,14 @@ possible to create the shell process, and otherwise is the status of the
|
||||
shell process. @xref{Process Completion}, for details on how this
|
||||
status code can be interpreted.
|
||||
|
||||
This function is a cancelation point in multi-threaded programs. This
|
||||
is a problem if the thread allocates some resources (like memory, file
|
||||
descriptors, semaphores or whatever) at the time @code{system} is
|
||||
called. If the thread gets canceled these resources stay allocated
|
||||
until the program ends. To avoid this calls to @code{system} should be
|
||||
protected using cancelation handlers.
|
||||
@c ref pthread_cleanup_push / pthread_cleanup_pop
|
||||
|
||||
@pindex stdlib.h
|
||||
The @code{system} function is declared in the header file
|
||||
@file{stdlib.h}.
|
||||
@ -477,6 +485,14 @@ processes as well as processes that have terminated.
|
||||
The status information from the child process is stored in the object
|
||||
that @var{status-ptr} points to, unless @var{status-ptr} is a null pointer.
|
||||
|
||||
This function is a cancelation point in multi-threaded programs. This
|
||||
is a problem if the thread allocates some resources (like memory, file
|
||||
descriptors, semaphores or whatever) at the time @code{waitpid} is
|
||||
called. If the thread gets canceled these resources stay allocated
|
||||
until the program ends. To avoid this calls to @code{waitpid} should be
|
||||
protected using cancelation handlers.
|
||||
@c ref pthread_cleanup_push / pthread_cleanup_pop
|
||||
|
||||
The return value is normally the process ID of the child process whose
|
||||
status is reported. If the @code{WNOHANG} option was specified and no
|
||||
child process is waiting to be noticed, the value is zero. A value of
|
||||
@ -547,6 +563,14 @@ is exactly equivalent to:
|
||||
@smallexample
|
||||
waitpid (-1, &status, 0)
|
||||
@end smallexample
|
||||
|
||||
This function is a cancelation point in multi-threaded programs. This
|
||||
is a problem if the thread allocates some resources (like memory, file
|
||||
descriptors, semaphores or whatever) at the time @code{wait} is
|
||||
called. If the thread gets canceled these resources stay allocated
|
||||
until the program ends. To avoid this calls to @code{wait} should be
|
||||
protected using cancelation handlers.
|
||||
@c ref pthread_cleanup_push / pthread_cleanup_pop
|
||||
@end deftypefun
|
||||
|
||||
@comment sys/wait.h
|
||||
|
@ -2927,6 +2927,14 @@ The function was interrupted by delivery of a signal.
|
||||
If the signal causes program termination, @code{pause} doesn't return
|
||||
(obviously).
|
||||
|
||||
This function is a cancelation point in multi-threaded programs. This
|
||||
is a problem if the thread allocates some resources (like memory, file
|
||||
descriptors, semaphores or whatever) at the time @code{pause} is
|
||||
called. If the thread gets canceled these resources stay allocated
|
||||
until the program ends. To avoid this calls to @code{pause} should be
|
||||
protected using cancelation handlers.
|
||||
@c ref pthread_cleanup_push / pthread_cleanup_pop
|
||||
|
||||
The @code{pause} function is declared in @file{unistd.h}.
|
||||
@end deftypefun
|
||||
|
||||
|
@ -895,7 +895,7 @@ The conversion specifications in a @code{printf} template string have
|
||||
the general form:
|
||||
|
||||
@example
|
||||
% @var{flags} @var{width} @r{[} . @var{precision} @r{]} @var{type} @var{conversion}
|
||||
% @r{[} @var{param-no} @r{$]} @var{flags} @var{width} @r{[} . @var{precision} @r{]} @var{type} @var{conversion}
|
||||
@end example
|
||||
|
||||
For example, in the conversion specifier @samp{%-10.8ld}, the @samp{-}
|
||||
@ -909,6 +909,33 @@ In more detail, output conversion specifications consist of an
|
||||
initial @samp{%} character followed in sequence by:
|
||||
|
||||
@itemize @bullet
|
||||
@item
|
||||
An optional specification of the parameter used for this format.
|
||||
Normally the parameters to the @code{printf} function a assigned to the
|
||||
formats in the order of appearence in the format string. But in some
|
||||
situations (such as message translation) this is not desirable and this
|
||||
extension allows to specify and explicit parameter to be used.
|
||||
|
||||
The @var{param-no} part of the format must be an integer in the range of
|
||||
1 to the maximum number of arguments present to the function call. Some
|
||||
implementations limit this number to a certainly upper bound. The exact
|
||||
limit can be retrieved by the following constant.
|
||||
|
||||
@defvr Macro NL_ARGMAX
|
||||
The value of @code{ARGMAX} is the maximum value allowed for the
|
||||
specification of an positional parameter in a @code{printf} call. The
|
||||
actual value in effect at runtime can be retrieved by using
|
||||
@code{sysconf} using the @code{_SC_NL_ARGMAX} parameter @pxref{Sysconf
|
||||
Definition}.
|
||||
|
||||
Some system have a quite low limit such as @math{9} for @w{System V}
|
||||
systems. The GNU C library has no real limit.
|
||||
@end defvr
|
||||
|
||||
If any of the formats has a specification for the parameter position all
|
||||
of them in the format string shall have one. Otherwise the behaviour is
|
||||
undefined.
|
||||
|
||||
@item
|
||||
Zero or more @dfn{flag characters} that modify the normal behavior of
|
||||
the conversion specification.
|
||||
|
@ -1638,6 +1638,14 @@ The @var{filedes} is not associated with a terminal device.
|
||||
The @code{tcdrain} function waits until all queued
|
||||
output to the terminal @var{filedes} has been transmitted.
|
||||
|
||||
This function is a cancelation point in multi-threaded programs. This
|
||||
is a problem if the thread allocates some resources (like memory, file
|
||||
descriptors, semaphores or whatever) at the time @code{tcdrain} is
|
||||
called. If the thread gets canceled these resources stay allocated
|
||||
until the program ends. To avoid this calls to @code{tcdrain} should be
|
||||
protected using cancelation handlers.
|
||||
@c ref pthread_cleanup_push / pthread_cleanup_pop
|
||||
|
||||
The return value is normally zero. In the event of an error, a value
|
||||
of @code{-1} is returned. The following @code{errno} error conditions
|
||||
are defined for this function:
|
||||
|
@ -1455,6 +1455,42 @@ On the GNU system, it is safe to use @code{sleep} and @code{SIGALRM} in
|
||||
the same program, because @code{sleep} does not work by means of
|
||||
@code{SIGALRM}.
|
||||
|
||||
@comment time.h
|
||||
@comment POSIX.1
|
||||
@deftypefun int nanosleep (const struct timespec *@var{requested_time}, struct timespec *@var{remaining})
|
||||
If the resolution of seconds is not enough the @code{nanosleep} function
|
||||
can be used. As the name suggests the sleeping period can be specified
|
||||
in nanoseconds. The actual period of waiting time might be longer since
|
||||
the requested time in the @var{requested_time} parameter is rounded up
|
||||
to the next integer multiple of the actual resolution of the system.
|
||||
|
||||
If the function returns because the time has elapsed the return value is
|
||||
zero. If the function return @math{-1} the global variable @var{errno}
|
||||
is set to the following values:
|
||||
|
||||
@table @code
|
||||
@item EINTR
|
||||
The call was interrupted because a signal was delivered to the thread.
|
||||
If the @var{remaining} parameter is not the null pointer the structure
|
||||
pointed to by @var{remaining} is updated to contain the remaining time.
|
||||
|
||||
@item EINVAL
|
||||
The nanosecond value in the @var{requested_time} parameter contains an
|
||||
illegal value. Either the value is negative or greater than or equal to
|
||||
1000 million.
|
||||
@end table
|
||||
|
||||
This function is a cancelation point in multi-threaded programs. This
|
||||
is a problem if the thread allocates some resources (like memory, file
|
||||
descriptors, semaphores or whatever) at the time @code{nanosleep} is
|
||||
called. If the thread gets canceled these resources stay allocated
|
||||
until the program ends. To avoid this calls to @code{nanosleep} should
|
||||
be protected using cancelation handlers.
|
||||
@c ref pthread_cleanup_push / pthread_cleanup_pop
|
||||
|
||||
The @code{nanosleep} function is declared in @file{time.h}.
|
||||
@end deftypefun
|
||||
|
||||
@node Resource Usage
|
||||
@section Resource Usage
|
||||
|
||||
|
@ -23,7 +23,7 @@ subdir := math
|
||||
# Installed header files.
|
||||
headers := math.h bits/mathcalls.h bits/mathinline.h bits/huge_val.h \
|
||||
bits/nan.h fpu_control.h complex.h bits/cmathcalls.h \
|
||||
fenv.h bits/fenv.h bits/mathdef.h
|
||||
fenv.h bits/fenv.h bits/mathdef.h tgmath.h
|
||||
|
||||
# Internal header files.
|
||||
distribute := math_private.h machine/asm.h machine/endian.h
|
||||
@ -39,7 +39,6 @@ extra-libs-others = $(extra-libs)
|
||||
libm-map := libm.map
|
||||
|
||||
libm-support = k_standard s_lib_version s_matherr s_signgam \
|
||||
s_lrint s_llrint s_lround s_llround \
|
||||
fclrexcpt fgetexcptflg fraiseexcpt fsetexcptflg \
|
||||
ftestexcept fegetround fesetround fegetenv feholdexcpt \
|
||||
fesetenv feupdateenv
|
||||
@ -49,8 +48,8 @@ libm-calls = e_acos e_acosh e_asin e_atan2 e_atanh e_cosh e_exp e_fmod \
|
||||
k_cos k_rem_pio2 k_sin k_tan s_asinh s_atan s_cbrt \
|
||||
s_ceil s_copysign s_cos s_erf s_expm1 s_fabs s_finite \
|
||||
s_floor s_frexp s_ilogb s_ldexp s_log1p s_logb \
|
||||
s_modf s_nextafter s_rint s_scalbn s_significand \
|
||||
s_sin s_tan s_tanh w_acos w_acosh w_asin \
|
||||
s_modf s_nextafter s_nextafterx s_rint s_scalbn s_scalbln \
|
||||
s_significand s_sin s_tan s_tanh w_acos w_acosh w_asin \
|
||||
w_atan2 w_atanh w_cosh w_drem w_exp w_exp2 w_fmod w_gamma \
|
||||
w_hypot w_j0 w_j1 w_jn w_lgamma w_lgamma_r \
|
||||
w_log w_log10 w_pow w_remainder w_scalb w_sinh w_sqrt \
|
||||
@ -58,7 +57,8 @@ libm-calls = e_acos e_acosh e_asin e_atan2 e_atanh e_cosh e_exp e_fmod \
|
||||
s_remquo s_log2 s_exp2 s_round s_nearbyint s_sincos \
|
||||
conj cimag creal cabs carg s_cexp s_csinh s_ccosh s_clog \
|
||||
s_catan s_casin s_ccos s_csin s_ctan s_ctanh s_cacos \
|
||||
s_casinh s_cacosh s_catanh s_csqrt s_cpow s_cproj
|
||||
s_casinh s_cacosh s_catanh s_csqrt s_cpow s_cproj s_clog10 \
|
||||
s_fma s_lrint s_llrint s_lround s_llround
|
||||
libm-routines = $(libm-support) $(libm-calls) \
|
||||
$(patsubst %_rf,%f_r,$(libm-calls:=f)) \
|
||||
$(long-m-$(long-double-fcts))
|
||||
|
@ -90,6 +90,11 @@ __MATHCALL (cexp, (_Mdouble_complex_ __z));
|
||||
/* Natural logarithm of Z. */
|
||||
__MATHCALL (clog, (_Mdouble_complex_ __z));
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* The base 10 logarithm is not defined by the standard but to implement
|
||||
the standard C++ library it is handy. */
|
||||
__MATHCALL (clog10, (_Mdouble_complex_ __z));
|
||||
#endif
|
||||
|
||||
/* Power functions. */
|
||||
|
||||
|
@ -232,6 +232,9 @@ __MATHCALL (rint,, (_Mdouble_ __x));
|
||||
|
||||
/* Return X + epsilon if X < Y, X - epsilon if X > Y. */
|
||||
__MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
|
||||
#ifdef __USE_ISOC9X
|
||||
__MATHCALLX (nextafterx,, (_Mdouble_ __x, long double __y), (__const__));
|
||||
#endif
|
||||
|
||||
/* Return the remainder of integer divison X / Y with infinite precision. */
|
||||
__MATHCALL (remainder,, (_Mdouble_ __x, _Mdouble_ __y));
|
||||
@ -240,13 +243,16 @@ __MATHCALL (remainder,, (_Mdouble_ __x, _Mdouble_ __y));
|
||||
__MATHCALL (scalb,, (_Mdouble_ __x, _Mdouble_ __n));
|
||||
|
||||
/* Return X times (2 to the Nth power). */
|
||||
__MATHCALL (scalbn,, (_Mdouble_ __x, long int __n));
|
||||
__MATHCALL (scalbn,, (_Mdouble_ __x, int __n));
|
||||
|
||||
/* Return the binary exponent of X, which must be nonzero. */
|
||||
__MATHDECL (int,ilogb,, (_Mdouble_ __x));
|
||||
#endif
|
||||
|
||||
#ifdef __USE_ISOC9X
|
||||
/* Return X times (2 to the Nth power). */
|
||||
__MATHCALL (scalbln,, (_Mdouble_ __x, long int __n));
|
||||
|
||||
/* Round X to integral valuein floating-point format using current
|
||||
rounding direction, but do not raise inexact exception. */
|
||||
__MATHCALL (nearbyint,, (_Mdouble_ __x));
|
||||
@ -265,6 +271,19 @@ __MATHCALLX (trunc,, (_Mdouble_ __x), (__const__));
|
||||
__MATHCALL (remquo,, (_Mdouble_ __x, _Mdouble_ __y, int *__quo));
|
||||
|
||||
|
||||
/* Conversion functions. */
|
||||
|
||||
/* Round X to nearest integral value according to current rounding
|
||||
direction. */
|
||||
__MATHDECL (long int, lrint,, (_Mdouble_ __x));
|
||||
__MATHDECL (long long int, llrint,, (_Mdouble_ __x));
|
||||
|
||||
/* Round X to nearest integral value, rounding halfway cases away from
|
||||
zero. */
|
||||
__MATHDECL (long int, lround,, (_Mdouble_ __x));
|
||||
__MATHDECL (long long int, llround,, (_Mdouble_ __x));
|
||||
|
||||
|
||||
/* Return positive difference between X and Y. */
|
||||
__MATHCALL (fdim,, (_Mdouble_ __x, _Mdouble_ __y));
|
||||
|
||||
@ -282,4 +301,8 @@ __MATHDECL_1 (int, __fpclassify,, (_Mdouble_ __value))
|
||||
/* Test for negative number. */
|
||||
__MATHDECL_1 (int, __signbit,, (_Mdouble_ __value))
|
||||
__attribute__ ((__const__));
|
||||
|
||||
|
||||
/* Multiply-add function computed as a ternary operation. */
|
||||
__MATHCALL (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z));
|
||||
#endif /* Use ISO C 9X. */
|
||||
|
216
math/libm-test.c
216
math/libm-test.c
@ -4300,6 +4300,160 @@ clog_test (void)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
clog10_test (void)
|
||||
{
|
||||
__complex__ MATHTYPE result;
|
||||
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (minus_zero, 0));
|
||||
check_isinfn_exc ("real(clog10(-0 + i0)) = -Inf plus divide-by-zero exception",
|
||||
__real__ result, DIVIDE_BY_ZERO_EXCEPTION);
|
||||
check ("imag(clog10(-0 + i0)) = pi plus divide-by-zero exception",
|
||||
__imag__ result, M_PI);
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (minus_zero, minus_zero));
|
||||
check_isinfn_exc ("real(clog10(-0 - i0)) = -Inf plus divide-by-zero exception",
|
||||
__real__ result, DIVIDE_BY_ZERO_EXCEPTION);
|
||||
check ("imag(clog10(-0 - i0)) = -pi plus divide-by-zero exception",
|
||||
__imag__ result, -M_PI);
|
||||
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (0, 0));
|
||||
check_isinfn_exc ("real(clog10(0 + i0)) = -Inf plus divide-by-zero exception",
|
||||
__real__ result, DIVIDE_BY_ZERO_EXCEPTION);
|
||||
check ("imag(clog10(0 + i0)) = 0 plus divide-by-zero exception",
|
||||
__imag__ result, 0);
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (0, minus_zero));
|
||||
check_isinfn_exc ("real(clog10(0 - i0)) = -Inf plus divide-by-zero exception",
|
||||
__real__ result, DIVIDE_BY_ZERO_EXCEPTION);
|
||||
check ("imag(clog10(0 - i0)) = -0 plus divide-by-zero exception",
|
||||
__imag__ result, minus_zero);
|
||||
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (minus_infty, plus_infty));
|
||||
check_isinfp ("real(clog10(-Inf + i Inf)) = +Inf", __real__ result);
|
||||
check ("imag(clog10(-Inf + i Inf)) = 3*pi/4", __imag__ result, M_PI - M_PI_4);
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (minus_infty, minus_infty));
|
||||
check_isinfp ("real(clog10(-Inf - i Inf)) = +Inf", __real__ result);
|
||||
check ("imag(clog10(-Inf - i Inf)) = -3*pi/4", __imag__ result, M_PI_4 - M_PI);
|
||||
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (plus_infty, plus_infty));
|
||||
check_isinfp ("real(clog10(+Inf + i Inf)) = +Inf", __real__ result);
|
||||
check ("imag(clog10(+Inf + i Inf)) = pi/4", __imag__ result, M_PI_4);
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (plus_infty, minus_infty));
|
||||
check_isinfp ("real(clog10(+Inf - i Inf)) = +Inf", __real__ result);
|
||||
check ("imag(clog10(+Inf - i Inf)) = -pi/4", __imag__ result, -M_PI_4);
|
||||
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (0, plus_infty));
|
||||
check_isinfp ("real(clog10(0 + i Inf)) = +Inf", __real__ result);
|
||||
check ("imag(clog10(0 + i Inf)) = pi/2", __imag__ result, M_PI_2);
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (3, plus_infty));
|
||||
check_isinfp ("real(clog10(3 + i Inf)) = +Inf", __real__ result);
|
||||
check ("imag(clog10(3 + i Inf)) = pi/2", __imag__ result, M_PI_2);
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (minus_zero, plus_infty));
|
||||
check_isinfp ("real(clog10(-0 + i Inf)) = +Inf", __real__ result);
|
||||
check ("imag(clog10(-0 + i Inf)) = pi/2", __imag__ result, M_PI_2);
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (-3, plus_infty));
|
||||
check_isinfp ("real(clog10(-3 + i Inf)) = +Inf", __real__ result);
|
||||
check ("imag(clog10(-3 + i Inf)) = pi/2", __imag__ result, M_PI_2);
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (0, minus_infty));
|
||||
check_isinfp ("real(clog10(0 - i Inf)) = +Inf", __real__ result);
|
||||
check ("imag(clog10(0 - i Inf)) = -pi/2", __imag__ result, -M_PI_2);
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (3, minus_infty));
|
||||
check_isinfp ("real(clog10(3 - i Inf)) = +Inf", __real__ result);
|
||||
check ("imag(clog10(3 - i Inf)) = -pi/2", __imag__ result, -M_PI_2);
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (minus_zero, minus_infty));
|
||||
check_isinfp ("real(clog10(-0 - i Inf)) = +Inf", __real__ result);
|
||||
check ("imag(clog10(-0 - i Inf)) = -pi/2", __imag__ result, -M_PI_2);
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (-3, minus_infty));
|
||||
check_isinfp ("real(clog10(-3 - i Inf)) = +Inf", __real__ result);
|
||||
check ("imag(clog10(-3 - i Inf)) = -pi/2", __imag__ result, -M_PI_2);
|
||||
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (minus_infty, 0));
|
||||
check_isinfp ("real(clog10(-Inf + i0)) = +Inf", __real__ result);
|
||||
check ("imag(clog10(-Inf + i0)) = pi", __imag__ result, M_PI);
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (minus_infty, 1));
|
||||
check_isinfp ("real(clog10(-Inf + i1)) = +Inf", __real__ result);
|
||||
check ("imag(clog10(-Inf + i1)) = pi", __imag__ result, M_PI);
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (minus_infty, minus_zero));
|
||||
check_isinfp ("real(clog10(-Inf - i0)) = +Inf", __real__ result);
|
||||
check ("imag(clog10(-Inf - i0)) = -pi", __imag__ result, -M_PI);
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (minus_infty, -1));
|
||||
check_isinfp ("real(clog10(-Inf - i1)) = +Inf", __real__ result);
|
||||
check ("imag(clog10(-Inf - i1)) = -pi", __imag__ result, -M_PI);
|
||||
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (plus_infty, 0));
|
||||
check_isinfp ("real(clog10(+Inf + i0)) = +Inf", __real__ result);
|
||||
check ("imag(clog10(+Inf + i0)) = 0", __imag__ result, 0);
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (plus_infty, 1));
|
||||
check_isinfp ("real(clog10(+Inf + i1)) = +Inf", __real__ result);
|
||||
check ("imag(clog10(+Inf + i1)) = 0", __imag__ result, 0);
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (plus_infty, minus_zero));
|
||||
check_isinfp ("real(clog10(+Inf - i0)) = +Inf", __real__ result);
|
||||
check ("imag(clog10(+Inf - i0)) = -0", __imag__ result, minus_zero);
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (plus_infty, -1));
|
||||
check_isinfp ("real(clog10(+Inf - i1)) = +Inf", __real__ result);
|
||||
check ("imag(clog10(+Inf - i1)) = -0", __imag__ result, minus_zero);
|
||||
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (plus_infty, nan_value));
|
||||
check_isinfp ("real(clog10(+Inf + i NaN)) = +Inf", __real__ result);
|
||||
check_isnan ("imag(clog10(+Inf + i NaN)) = NaN", __imag__ result);
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (minus_infty, nan_value));
|
||||
check_isinfp ("real(clog10(-Inf + i NaN)) = +Inf", __real__ result);
|
||||
check_isnan ("imag(clog10(-Inf + i NaN)) = NaN", __imag__ result);
|
||||
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (nan_value, plus_infty));
|
||||
check_isinfp ("real(clog10(NaN + i Inf)) = +Inf", __real__ result);
|
||||
check_isnan ("imag(clog10(NaN + i Inf)) = NaN", __imag__ result);
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (nan_value, minus_infty));
|
||||
check_isinfp ("real(clog10(NaN - i Inf)) = +Inf", __real__ result);
|
||||
check_isnan ("imag(clog10(NaN - i Inf)) = NaN", __imag__ result);
|
||||
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (0, nan_value));
|
||||
check_isnan_maybe_exc ("real(clog10(0 + i NaN)) = NaN plus maybe invalid exception",
|
||||
__real__ result, INVALID_EXCEPTION);
|
||||
check_isnan ("imag(clog10(0 + i NaN)) = NaN plus maybe invalid exception",
|
||||
__imag__ result);
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (3, nan_value));
|
||||
check_isnan_maybe_exc ("real(clog10(3 + i NaN)) = NaN plus maybe invalid exception",
|
||||
__real__ result, INVALID_EXCEPTION);
|
||||
check_isnan ("imag(clog10(3 + i NaN)) = NaN plus maybe invalid exception",
|
||||
__imag__ result);
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (minus_zero, nan_value));
|
||||
check_isnan_maybe_exc ("real(clog10(-0 + i NaN)) = NaN plus maybe invalid exception",
|
||||
__real__ result, INVALID_EXCEPTION);
|
||||
check_isnan ("imag(clog10(-0 + i NaN)) = NaN plus maybe invalid exception",
|
||||
__imag__ result);
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (-3, nan_value));
|
||||
check_isnan_maybe_exc ("real(clog10(-3 + i NaN)) = NaN plus maybe invalid exception",
|
||||
__real__ result, INVALID_EXCEPTION);
|
||||
check_isnan ("imag(clog10(-3 + i NaN)) = NaN plus maybe invalid exception",
|
||||
__imag__ result);
|
||||
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (nan_value, 0));
|
||||
check_isnan_maybe_exc ("real(clog10(NaN + i0)) = NaN plus maybe invalid exception",
|
||||
__real__ result, INVALID_EXCEPTION);
|
||||
check_isnan ("imag(clog10(NaN + i0)) = NaN plus maybe invalid exception",
|
||||
__imag__ result);
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (nan_value, 5));
|
||||
check_isnan_maybe_exc ("real(clog10(NaN + i5)) = NaN plus maybe invalid exception",
|
||||
__real__ result, INVALID_EXCEPTION);
|
||||
check_isnan ("imag(clog10(NaN + i5)) = NaN plus maybe invalid exception",
|
||||
__imag__ result);
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (nan_value, minus_zero));
|
||||
check_isnan_maybe_exc ("real(clog10(NaN - i0)) = NaN plus maybe invalid exception",
|
||||
__real__ result, INVALID_EXCEPTION);
|
||||
check_isnan ("imag(clog10(NaN - i0)) = NaN plus maybe invalid exception",
|
||||
__imag__ result);
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (nan_value, -5));
|
||||
check_isnan_maybe_exc ("real(clog10(NaN - i5)) = NaN plus maybe invalid exception",
|
||||
__real__ result, INVALID_EXCEPTION);
|
||||
check_isnan ("imag(clog10(NaN - i5)) = NaN plus maybe invalid exception",
|
||||
__imag__ result);
|
||||
|
||||
result = FUNC(clog10) (BUILD_COMPLEX (nan_value, nan_value));
|
||||
check_isnan ("real(clog10(NaN + i NaN)) = NaN", __real__ result);
|
||||
check_isnan ("imag(clog10(NaN + i NaN)) = NaN", __imag__ result);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
csqrt_test (void)
|
||||
{
|
||||
@ -4539,43 +4693,52 @@ round_test (void)
|
||||
static void
|
||||
lround_test (void)
|
||||
{
|
||||
check_long ("lround(0) = 0", lround (0), 0);
|
||||
check_long ("lround(-0) = 0", lround (minus_zero), 0);
|
||||
check_long ("lround(0.2) = 0", lround (0.2), 0.0);
|
||||
check_long ("lround(-0.2) = 0", lround (-0.2), 0);
|
||||
check_long ("lround(0.5) = 1", lround (0.5), 1);
|
||||
check_long ("lround(-0.5) = -1", lround (-0.5), -1);
|
||||
check_long ("lround(0.8) = 1", lround (0.8), 1);
|
||||
check_long ("lround(-0.8) = -1", lround (-0.8), -1);
|
||||
check_long ("lround(1.5) = 2", lround (1.5), 2);
|
||||
check_long ("lround(-1.5) = -2", lround (-1.5), -2);
|
||||
check_long ("lround(2097152.5) = 2097153", lround (2097152.5), 2097153);
|
||||
check_long ("lround(-2097152.5) = -2097153", lround (-2097152.5),
|
||||
check_long ("lround(0) = 0", FUNC(lround) (0), 0);
|
||||
check_long ("lround(-0) = 0", FUNC(lround) (minus_zero), 0);
|
||||
check_long ("lround(0.2) = 0", FUNC(lround) (0.2), 0.0);
|
||||
check_long ("lround(-0.2) = 0", FUNC(lround) (-0.2), 0);
|
||||
check_long ("lround(0.5) = 1", FUNC(lround) (0.5), 1);
|
||||
check_long ("lround(-0.5) = -1", FUNC(lround) (-0.5), -1);
|
||||
check_long ("lround(0.8) = 1", FUNC(lround) (0.8), 1);
|
||||
check_long ("lround(-0.8) = -1", FUNC(lround) (-0.8), -1);
|
||||
check_long ("lround(1.5) = 2", FUNC(lround) (1.5), 2);
|
||||
check_long ("lround(-1.5) = -2", FUNC(lround) (-1.5), -2);
|
||||
check_long ("lround(22514.5) = 22514", FUNC(lround) (1.5), 2);
|
||||
check_long ("lround(-22514.5) = -22514", FUNC(lround) (-1.5), -2);
|
||||
#ifndef TEST_FLOAT
|
||||
check_long ("lround(2097152.5) = 2097153", FUNC(lround) (2097152.5),
|
||||
2097153);
|
||||
check_long ("lround(-2097152.5) = -2097153", FUNC(lround) (-2097152.5),
|
||||
-2097153);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
llround_test (void)
|
||||
{
|
||||
check_longlong ("llround(0) = 0", llround (0), 0);
|
||||
check_longlong ("llround(-0) = 0", llround (minus_zero), 0);
|
||||
check_longlong ("llround(0.2) = 0", llround (0.2), 0.0);
|
||||
check_longlong ("llround(-0.2) = 0", llround (-0.2), 0);
|
||||
check_longlong ("llround(0.5) = 1", llround (0.5), 1);
|
||||
check_longlong ("llround(-0.5) = -1", llround (-0.5), -1);
|
||||
check_longlong ("llround(0.8) = 1", llround (0.8), 1);
|
||||
check_longlong ("llround(-0.8) = -1", llround (-0.8), -1);
|
||||
check_longlong ("llround(1.5) = 2", llround (1.5), 2);
|
||||
check_longlong ("llround(-1.5) = -2", llround (-1.5), -2);
|
||||
check_longlong ("llround(0) = 0", FUNC(llround) (0), 0);
|
||||
check_longlong ("llround(-0) = 0", FUNC(llround) (minus_zero), 0);
|
||||
check_longlong ("llround(0.2) = 0", FUNC(llround) (0.2), 0.0);
|
||||
check_longlong ("llround(-0.2) = 0", FUNC(llround) (-0.2), 0);
|
||||
check_longlong ("llround(0.5) = 1", FUNC(llround) (0.5), 1);
|
||||
check_longlong ("llround(-0.5) = -1", FUNC(llround) (-0.5), -1);
|
||||
check_longlong ("llround(0.8) = 1", FUNC(llround) (0.8), 1);
|
||||
check_longlong ("llround(-0.8) = -1", FUNC(llround) (-0.8), -1);
|
||||
check_longlong ("llround(1.5) = 2", FUNC(llround) (1.5), 2);
|
||||
check_longlong ("llround(-1.5) = -2", FUNC(llround) (-1.5), -2);
|
||||
check_longlong ("llround(22514.5) = 22514", FUNC(llround) (1.5), 2);
|
||||
check_longlong ("llround(-22514.5) = -22514", FUNC(llround) (-1.5), -2);
|
||||
#ifndef TEST_FLOAT
|
||||
check_longlong ("llround(2097152.5) = 2097153",
|
||||
llround (2097152.5), 2097153);
|
||||
FUNC(llround) (2097152.5), 2097153);
|
||||
check_longlong ("llround(-2097152.5) = -2097153",
|
||||
llround (-2097152.5), -2097153);
|
||||
FUNC(llround) (-2097152.5), -2097153);
|
||||
check_longlong ("llround(34359738368.5) = 34359738369",
|
||||
llround (34359738368.5), 34359738369ll);
|
||||
FUNC(llround) (34359738368.5), 34359738369ll);
|
||||
check_longlong ("llround(-34359738368.5) = -34359738369",
|
||||
llround (-34359738368.5), -34359738369ll);
|
||||
FUNC(llround) (-34359738368.5), -34359738369ll);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -4962,6 +5125,7 @@ main (int argc, char *argv[])
|
||||
ccos_test ();
|
||||
ccosh_test ();
|
||||
clog_test ();
|
||||
clog10_test ();
|
||||
cacos_test ();
|
||||
cacosh_test ();
|
||||
casin_test ();
|
||||
|
@ -23,6 +23,7 @@ GLIBC_2.0 {
|
||||
fdim; fdimf; fdiml;
|
||||
finite; finitef; finitel;
|
||||
floor; floorf; floorl;
|
||||
fma; fmaf; fmal;
|
||||
fmax; fmaxf; fmaxl;
|
||||
fmin; fminf; fminl;
|
||||
fmod; fmodf; fmodl;
|
||||
@ -47,15 +48,19 @@ GLIBC_2.0 {
|
||||
nan; nanf; nanl;
|
||||
nearbyint; nearbyintf; nearbyintl;
|
||||
nextafter; nextafterf; nextafterl;
|
||||
nextafterx; nextafterxf; nextafterxl;
|
||||
pow; powf; powl;
|
||||
remainder; remainderf; remainderl;
|
||||
remquo; remquof; remquol;
|
||||
rint; rintf; rintl;
|
||||
lrint; llrint;
|
||||
lrint; lrintf; lrintl;
|
||||
llrint; llrintf; llrintl;
|
||||
round; roundf; roundl;
|
||||
lround; llround;
|
||||
lround; lroundf; lroundl;
|
||||
llround; llroundf; llroundl;
|
||||
scalb; scalbf; scalbl;
|
||||
scalbn; scalbnf; scalbnl;
|
||||
scalbln; scalblnf; scalblnl;
|
||||
significand; significandf; significandl;
|
||||
sin; sinf; sinl;
|
||||
sincos; sincosf; sincosl;
|
||||
@ -82,6 +87,8 @@ GLIBC_2.0 {
|
||||
cexp; cexpf; cexpl;
|
||||
cimag; cimagf; cimagl;
|
||||
clog; clogf; clogl;
|
||||
clog10; clog10f; clog10l;
|
||||
__clog10; __clog10f; __clog10l;
|
||||
conj; conjf; conjl;
|
||||
cpow; cpowf; cpowl;
|
||||
cproj; cprojf; cprojl;
|
||||
|
25
math/math.h
25
math/math.h
@ -131,6 +131,18 @@ extern int signgam;
|
||||
else `float_t' and `double_t' are unspecified
|
||||
|
||||
INFINITY representation of the infinity value of type `float_t'
|
||||
|
||||
FP_FAST_FMA
|
||||
FP_FAST_FMAF
|
||||
FP_FAST_FMAL
|
||||
If defined it indicates that the the `fma' function
|
||||
generally executes about as fast as a multiply and an add.
|
||||
This macro is defined only iff the `fma' function is
|
||||
implemented directly with a hardware multiply-add instructions.
|
||||
|
||||
FP_ILOGB0 Expands to a value returned by `ilogb (0.0)'.
|
||||
FP_ILOGBNAN Expands to a value returned by `ilogb (NAN)'.
|
||||
|
||||
*/
|
||||
# include <bits/mathdef.h>
|
||||
|
||||
@ -181,19 +193,6 @@ enum
|
||||
: sizeof (x) == sizeof (double) ? \
|
||||
__isnan (x) : __isnanl (x))
|
||||
|
||||
|
||||
/* Conversion functions. */
|
||||
|
||||
/* Round X to nearest integral value according to current rounding
|
||||
direction. */
|
||||
extern long int lrint __P ((long double __x));
|
||||
extern long long int llrint __P ((long double __x));
|
||||
|
||||
/* Round X to nearest integral value, rounding halfway cases away from
|
||||
zero. */
|
||||
extern long int lround __P ((long double __x));
|
||||
extern long long int llround __P ((long double __x));
|
||||
|
||||
#endif /* Use ISO C 9X. */
|
||||
|
||||
#ifdef __USE_MISC
|
||||
|
@ -23,6 +23,7 @@
|
||||
#define MATHCONST(x) x
|
||||
#define CHOOSE(Clongdouble,Cdouble,Cfloat) Cdouble
|
||||
#define PRINTF_EXPR "e"
|
||||
#define TEST_DOUBLE 1
|
||||
|
||||
#ifndef __NO_MATH_INLINES
|
||||
# define __NO_MATH_INLINES
|
||||
|
@ -23,6 +23,7 @@
|
||||
#define MATHCONST(x) x
|
||||
#define CHOOSE(Clongdouble,Cdouble,Cfloat) Cfloat
|
||||
#define PRINTF_EXPR "e"
|
||||
#define TEST_FLOAT 1
|
||||
|
||||
#ifndef __NO_MATH_INLINES
|
||||
# define __NO_MATH_INLINES
|
||||
|
@ -24,6 +24,7 @@
|
||||
#define MATHCONST(x) x
|
||||
#define CHOOSE(Clongdouble,Cdouble,Cfloat) Cdouble
|
||||
#define PRINTF_EXPR "e"
|
||||
#define TEST_DOUBLE 1
|
||||
#define TEST_INLINE
|
||||
|
||||
#ifdef __NO_MATH_INLINES
|
||||
|
@ -23,7 +23,8 @@
|
||||
#define MATHCONST(x) x
|
||||
#define CHOOSE(Clongdouble,Cdouble,Cfloat) Cfloat
|
||||
#define PRINTF_EXPR "e"
|
||||
#define TEST_INLINE
|
||||
#define TEST_FLOAT 1
|
||||
#define TEST_INLINE 1
|
||||
|
||||
#ifdef __NO_MATH_INLINES
|
||||
# undef __NO_MATH_INLINES
|
||||
|
312
math/tgmath.h
Normal file
312
math/tgmath.h
Normal file
@ -0,0 +1,312 @@
|
||||
/* Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/*
|
||||
* ISO C 9X Standard: 7.9 Type-generic math <tgmath.h>
|
||||
*/
|
||||
|
||||
#ifndef _TGMATH_H
|
||||
#define _TGMATH_H 1
|
||||
|
||||
/* Include the needed headers. */
|
||||
#include <math.h>
|
||||
#include <complex.h>
|
||||
|
||||
|
||||
/* Since `complex' is currently not really implemented in most C compilers
|
||||
and if it is implemented, the implementations differ. This makes it
|
||||
quite difficult to write a generic implementation of this header. We
|
||||
do not try this for now and instead concentrate only on GNU CC. Once
|
||||
we have more information support for other compilers might follow. */
|
||||
|
||||
#if defined __GNUC__ && (__GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7)
|
||||
|
||||
/* We have two kinds of generic macros: to support functions which are
|
||||
only defined on real valued parameters and those which are defined
|
||||
for complex functions as well. */
|
||||
# define __TGMATH_UNARY_REAL_ONLY(Val, Fct) \
|
||||
(__extension__ (sizeof (__real__ (Val)) == sizeof (long double) \
|
||||
? Fct##l (Val) \
|
||||
: (sizeof (__real__ (Val)) == sizeof (double) \
|
||||
? Fct (Val) \
|
||||
: Fct##f (Val))))
|
||||
|
||||
# define __TGMATH_BINARY_FIRST_REAL_ONLY(Val1, Val2, Fct) \
|
||||
(__extension__ (sizeof (__real__ (Val1)) == sizeof (long double) \
|
||||
? Fct##l (Val1, Val2) \
|
||||
: (sizeof (__real__ (Val1)) == sizeof (double) \
|
||||
? Fct (Val1, Val2) \
|
||||
: Fct##f (Val1, Val2))))
|
||||
|
||||
# define __TGMATH_BINARY_REAL_ONLY(Val1, Val2, Fct) \
|
||||
(__extension__ (sizeof (Val1) == sizeof (long double) \
|
||||
|| sizeof (Val2) == sizeof (long double) \
|
||||
? Fct##l (Val1, Val2) \
|
||||
: (sizeof (Val1) == sizeof (double) \
|
||||
|| sizeof (Val2) == sizeof (double) \
|
||||
? Fct (Val1, Val2) \
|
||||
: Fct##f (Val1, Val2))))
|
||||
|
||||
# define __TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY(Val1, Val2, Val3, Fct) \
|
||||
(__extension__ (sizeof (Val1) == sizeof (long double) \
|
||||
|| sizeof (Val2) == sizeof (long double) \
|
||||
? Fct##l (Val1, Val2, Val3) \
|
||||
: (sizeof (Val1) == sizeof (double) \
|
||||
|| sizeof (Val2) == sizeof (double) \
|
||||
? Fct (Val1, Val2, Val3) \
|
||||
: Fct##f (Val1, Val2, Val3))))
|
||||
|
||||
# define __TGMATH_UNARY_REAL_IMAG(Val, Fct, Cfct) \
|
||||
(__extension__ (sizeof (__real__ (Val)) == sizeof (long double) \
|
||||
? (sizeof (__real__ (Val)) == sizeof (Val) \
|
||||
? Fct##l (Val) \
|
||||
: Cfct##l (Val)) \
|
||||
: (sizeof (__real__ (Val)) == sizeof (double) \
|
||||
? (sizeof (__real__ (Val)) == sizeof (Val) \
|
||||
? Fct (Val) \
|
||||
: Cfct (Val)) \
|
||||
: (sizeof (__real__ (Val)) == sizeof (Val) \
|
||||
? Fct##f (Val) \
|
||||
: Cfct##f (Val)))))
|
||||
|
||||
# define __TGMATH_UNARY_IMAG_ONLY(Val, Fct) \
|
||||
(__extension__ (sizeof (Val) == sizeof (__complex__ long double) \
|
||||
? Fct##l (Val) \
|
||||
: (sizeof (Val) == sizeof (__complex__ double) \
|
||||
? Fct (Val) \
|
||||
: Fct##f (Val))))
|
||||
|
||||
# define __TGMATH_BINARY_REAL_IMAG(Val1, Val2, Fct, Cfct) \
|
||||
(__extension__ (sizeof (__real__ (Val1)) == sizeof (long double) \
|
||||
|| sizeof (__real__ (Val2)) == sizeof (long double) \
|
||||
? (sizeof (__real__ (Val1)) == sizeof (Val1) \
|
||||
&& sizeof (__real__ (Val2)) == sizeof (Val2) \
|
||||
? Fct##l (Val1, Val2) \
|
||||
: Cfct##l (Val1, Val2)) \
|
||||
: (sizeof (__real__ (Val1)) == sizeof (double) \
|
||||
|| sizeof (__real__ (Val2)) == sizeof (double) \
|
||||
? (sizeof (__real__ (Val1)) == sizeof (Val1) \
|
||||
&& sizeof (__real__ (Val2)) == sizeof (Val2) \
|
||||
? Fct (Val1, Val2) \
|
||||
: Cfct (Val1, Val2)) \
|
||||
: (sizeof (__real__ (Val1)) == sizeof (Val1) \
|
||||
&& sizeof (__real__ (Val2)) == sizeof (Val2) \
|
||||
? Fct##f (Val1, Val2) \
|
||||
: Cfct##f (Val1, Val2)))))
|
||||
#else
|
||||
# error "Unsupported compiler; you cannot use <tgmath.h>"
|
||||
#endif
|
||||
|
||||
|
||||
/* Unary functions defined for real and complex values. */
|
||||
|
||||
|
||||
/* Trigonometric functions. */
|
||||
|
||||
/* Arc cosine of X. */
|
||||
#define acos(Val) __TGMATH_UNARY_REAL_IMAG (Val, acos, cacos)
|
||||
/* Arc sine of X. */
|
||||
#define asin(Val) __TGMATH_UNARY_REAL_IMAG (Val, asin, casin)
|
||||
/* Arc tangent of X. */
|
||||
#define atan(Val) __TGMATH_UNARY_REAL_IMAG (Val, atan, catan)
|
||||
/* Arc tangent of Y/X. */
|
||||
#define atan2(Val) __TGMATH_UNARY_REAL_ONLY (Val, atan2)
|
||||
|
||||
/* Cosine of X. */
|
||||
#define cos(Val) __TGMATH_UNARY_REAL_IMAG (Val, cos, ccos)
|
||||
/* Sine of X. */
|
||||
#define sin(Val) __TGMATH_UNARY_REAL_IMAG (Val, sin, csin)
|
||||
/* Tangent of X. */
|
||||
#define tan(Val) __TGMATH_UNARY_REAL_IMAG (Val, tan, ctan)
|
||||
|
||||
|
||||
/* Hyperbolic functions. */
|
||||
|
||||
/* Hyperbolic arc cosine of X. */
|
||||
#define acosh(Val) __TGMATH_UNARY_REAL_IMAG (Val, acosh, cacosh)
|
||||
/* Hyperbolic arc sine of X. */
|
||||
#define asinh(Val) __TGMATH_UNARY_REAL_IMAG (Val, asinh, casinh)
|
||||
/* Hyperbolic arc tangent of X. */
|
||||
#define atanh(Val) __TGMATH_UNARY_REAL_IMAG (Val, atanh, catanh)
|
||||
|
||||
/* Hyperbolic cosine of X. */
|
||||
#define cosh(Val) __TGMATH_UNARY_REAL_IMAG (Val, cosh, ccosh)
|
||||
/* Hyperbolic sine of X. */
|
||||
#define sinh(Val) __TGMATH_UNARY_REAL_IMAG (Val, sinh, csinh)
|
||||
/* Hyperbolic tangent of X. */
|
||||
#define tanh(Val) __TGMATH_UNARY_REAL_IMAG (Val, tanh, ctanh)
|
||||
|
||||
|
||||
/* Exponential and logarithmic functions. */
|
||||
|
||||
/* Exponential function of X. */
|
||||
#define exp(Val) __TGMATH_UNARY_REAL_IMAG (Val, exp, cexp)
|
||||
|
||||
/* Break VALUE into a normalized fraction and an integral power of 2. */
|
||||
#define frexp(Val1, Val2) __TGMATH_BINARY_FIRST_REAL_ONLY (Val1, Val2, frexp)
|
||||
|
||||
/* X times (two to the EXP power). */
|
||||
#define ldexp(Val1, Val2) __TGMATH_BINARY_FIRST_REAL_ONLY (Val1, Val2, ldexp)
|
||||
|
||||
/* Natural logarithm of X. */
|
||||
#define log(Val) __TGMATH_UNARY_REAL_IMAG (Val, log, clog)
|
||||
|
||||
/* Base-ten logarithm of X. */
|
||||
#define log10(Val) __TGMATH_UNARY_REAL_IMAG (Val, log10, __clog10)
|
||||
|
||||
/* Return exp(X) - 1. */
|
||||
#define expm1(Val) __TGMATH_UNARY_REAL_ONLY (Val, expm1)
|
||||
|
||||
/* Return log(1 + X). */
|
||||
#define log1p(Val) __TGMATH_UNARY_REAL_ONLY (Val, log1p)
|
||||
|
||||
/* Return the base 2 signed integral exponent of X. */
|
||||
#define logb(Val) __TGMATH_UNARY_REAL_ONLY (Val, logb)
|
||||
|
||||
/* Compute base-2 exponential of X. */
|
||||
#define exp2(Val) __TGMATH_UNARY_REAL_ONLY (Val, exp2)
|
||||
|
||||
/* Compute base-2 logarithm of X. */
|
||||
#define log2(Val) __TGMATH_UNARY_REAL_ONLY (Val, log2)
|
||||
|
||||
|
||||
/* Power functions. */
|
||||
|
||||
/* Return X to the Y power. */
|
||||
#define pow(Val1, Val2) __TGMATH_BINARY_REAL_IMAG (Val1, Val2, pow, cpow)
|
||||
|
||||
/* Return the square root of X. */
|
||||
#define sqrt(Val) __TGMATH_UNARY_REAL_IMAG (Val, sqrt, csqrt)
|
||||
|
||||
/* Return `sqrt(X*X + Y*Y)'. */
|
||||
#define hypot(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, hypot)
|
||||
|
||||
/* Return the cube root of X. */
|
||||
#define cbrt(Val) __TGMATH_UNARY_REAL_ONLY (Val, cbrt)
|
||||
|
||||
|
||||
/* Nearest integer, absolute value, and remainder functions. */
|
||||
|
||||
/* Smallest integral value not less than X. */
|
||||
#define ceil(Val) __TGMATH_UNARY_REAL_ONLY (Val, ceil)
|
||||
|
||||
/* Absolute value of X. */
|
||||
#define fabs(Val) __TGMATH_UNARY_REAL_IMAG (Val, fabs, cabs)
|
||||
|
||||
/* Largest integer not greater than X. */
|
||||
#define floor(Val) __TGMATH_UNARY_REAL_ONLY (Val, floor)
|
||||
|
||||
/* Floating-point modulo remainder of X/Y. */
|
||||
#define fmod(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, fmod)
|
||||
|
||||
/* Round X to integral valuein floating-point format using current
|
||||
rounding direction, but do not raise inexact exception. */
|
||||
#define nearbyint(Val) __TGMATH_UNARY_REAL_ONLY (Val, nearbyint)
|
||||
|
||||
/* Round X to nearest integral value, rounding halfway cases away from
|
||||
zero. */
|
||||
#define round(Val) __TGMATH_UNARY_REAL_ONLY (Val, round)
|
||||
|
||||
/* Round X to the integral value in floating-point format nearest but
|
||||
not larger in magnitude. */
|
||||
#define trunc(Val) __TGMATH_UNARY_REAL_ONLY (Val, trunc)
|
||||
|
||||
/* Compute remainder of X and Y and put in *QUO a value with sign of x/y
|
||||
and magnitude congruent `mod 2^n' to the magnitude of the integral
|
||||
quotient x/y, with n >= 3. */
|
||||
#define remquo(Val1, Val2, Val3) \
|
||||
__TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY (Val1, Val2, Val3, remquo)
|
||||
|
||||
/* Round X to nearest integral value according to current rounding
|
||||
direction. */
|
||||
#define lrint(Val) __TGMATH_UNARY_REAL_ONLY (Val, lrint)
|
||||
#define llrint(Val) __TGMATH_UNARY_REAL_ONLY (Val, llrint)
|
||||
|
||||
/* Round X to nearest integral value, rounding halfway cases away from
|
||||
zero. */
|
||||
#define lround(Val) __TGMATH_UNARY_REAL_ONLY (Val, lround)
|
||||
#define llround(Val) __TGMATH_UNARY_REAL_ONLY (Val, llround)
|
||||
|
||||
|
||||
/* Return X with its signed changed to Y's. */
|
||||
#define copysign(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, copysign)
|
||||
|
||||
/* Error and gamma functions. */
|
||||
#define erf(Val) __TGMATH_UNARY_REAL_ONLY (Val, erf)
|
||||
#define erfc(Val) __TGMATH_UNARY_REAL_ONLY (Val, erfc)
|
||||
#define gamma(Val) __TGMATH_UNARY_REAL_ONLY (Val, gamma)
|
||||
#define lgamma(Val) __TGMATH_UNARY_REAL_ONLY (Val, lgamma)
|
||||
|
||||
|
||||
/* Return the integer nearest X in the direction of the
|
||||
prevailing rounding mode. */
|
||||
#define rint(Val) __TGMATH_UNARY_REAL_ONLY (Val, rint)
|
||||
|
||||
/* Return X + epsilon if X < Y, X - epsilon if X > Y. */
|
||||
#define nextafter(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, nextafter)
|
||||
#define nextafterx(Val1, Val2) \
|
||||
__TGMATH_BINARY_FIRST_REAL_ONLY (Val1, Val2, nextafterx)
|
||||
|
||||
/* Return the remainder of integer divison X / Y with infinite precision. */
|
||||
#define remainder(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, remainder)
|
||||
|
||||
/* Return X times (2 to the Nth power). */
|
||||
#define scalb(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, scalb)
|
||||
|
||||
/* Return X times (2 to the Nth power). */
|
||||
#define scalbn(Val1, Val2) __TGMATH_BINARY_FIRST_REAL_ONLY (Val1, Val2, scalbn)
|
||||
|
||||
/* Return X times (2 to the Nth power). */
|
||||
#define scalbln(Val1, Val2) \
|
||||
__TGMATH_BINARY_FIRST_REAL_ONLY (Val1, Val2, scalbln)
|
||||
|
||||
/* Return the binary exponent of X, which must be nonzero. */
|
||||
#define ilogb(Val) __TGMATH_UNARY_REAL_ONLY (Val, ilogb)
|
||||
|
||||
|
||||
/* Return positive difference between X and Y. */
|
||||
#define fdim(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, fdim)
|
||||
|
||||
/* Return maximum numeric value from X and Y. */
|
||||
#define fmax(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, fmax)
|
||||
|
||||
/* Return minimum numeric value from X and Y. */
|
||||
#define fmin(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, fmin)
|
||||
|
||||
|
||||
/* Absolute value, conjugates, and projection. */
|
||||
|
||||
/* Argument value of Z. */
|
||||
#define carg(Val) __TGMATH_UNARY_IMAG_ONLY (Val, carg)
|
||||
|
||||
/* Complex conjugate of Z. */
|
||||
#define conj(Val) __TGMATH_UNARY_IMAG_ONLY (Val, conj)
|
||||
|
||||
/* Projection of Z onto the Riemann sphere. */
|
||||
#define cproj(Val) __TGMATH_UNARY_IMAG_ONLY (Val, cproj)
|
||||
|
||||
|
||||
/* Decomposing complex values. */
|
||||
|
||||
/* Imaginary part of Z. */
|
||||
#define cimag(Val) __TGMATH_UNARY_IMAG_ONLY (Val, cimag)
|
||||
|
||||
/* Real part of Z. */
|
||||
#define creal(Val) __TGMATH_UNARY_IMAG_ONLY (Val, creal)
|
||||
|
||||
#endif /* tgmath.h */
|
@ -1,5 +1,5 @@
|
||||
/* err.h -- 4.4BSD utility functions for error messages.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
/* 4.4BSD utility functions for error messages.
|
||||
Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -25,7 +25,7 @@
|
||||
#define __need___va_list
|
||||
#include <stdarg.h>
|
||||
#ifndef __GNUC_VA_LIST
|
||||
#define __gnuc_va_list __ptr_t
|
||||
# define __gnuc_va_list __ptr_t
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
@ -47,6 +47,7 @@ setfsent (void)
|
||||
}
|
||||
|
||||
static struct fstab *
|
||||
internal_function
|
||||
mnt2fs (struct mntent *m)
|
||||
{
|
||||
static struct fstab f;
|
||||
|
@ -57,7 +57,8 @@ getttynam(tty)
|
||||
return (t);
|
||||
}
|
||||
|
||||
static char *skip __P((char *)), *value __P((char *));
|
||||
static char *skip __P((char *)) internal_function;
|
||||
static char *value __P((char *)) internal_function;
|
||||
|
||||
struct ttyent *
|
||||
getttyent()
|
||||
@ -133,6 +134,7 @@ getttyent()
|
||||
* the next field.
|
||||
*/
|
||||
static char *
|
||||
internal_function
|
||||
skip(p)
|
||||
register char *p;
|
||||
{
|
||||
@ -167,6 +169,7 @@ skip(p)
|
||||
}
|
||||
|
||||
static char *
|
||||
internal_function
|
||||
value(p)
|
||||
register char *p;
|
||||
{
|
||||
|
@ -28,6 +28,7 @@
|
||||
included only for compatibility reasons. Use the POSIX definition
|
||||
in <regex.h> for portable applications and a reasonable interface. */
|
||||
|
||||
#include <features.h>
|
||||
#include <alloca.h>
|
||||
#include <regex.h>
|
||||
#include <stdlib.h>
|
||||
@ -110,13 +111,13 @@ compile (char *__instring, char *__expbuf, __const char *__endbuf, int __eof)
|
||||
of type `regex_t'. Then check for minimum size of the buffer for
|
||||
the compiled regular expression. */
|
||||
regex_t *__expr_ptr;
|
||||
#if defined __GNUC__ && __GNUC__ >= 2
|
||||
# if defined __GNUC__ && __GNUC__ >= 2
|
||||
const size_t __req = __alignof__ (regex_t *);
|
||||
#else
|
||||
# else
|
||||
/* How shall we find out? We simply guess it and can change it is
|
||||
this really proofs to be wrong. */
|
||||
const size_t __req = 8;
|
||||
#endif
|
||||
# endif
|
||||
__expbuf += __req;
|
||||
__expbuf -= (__expbuf - ((char *) 0)) % __req;
|
||||
if (__endbuf < __expbuf + sizeof (regex_t))
|
||||
|
@ -26,61 +26,61 @@
|
||||
|
||||
#ifdef __GNUC__
|
||||
|
||||
#define __P(args) args /* GCC can always grok prototypes. */
|
||||
#define __DOTS , ...
|
||||
# define __P(args) args /* GCC can always grok prototypes. */
|
||||
# define __DOTS , ...
|
||||
|
||||
#else /* Not GCC. */
|
||||
|
||||
#define __inline /* No inline functions. */
|
||||
# define __inline /* No inline functions. */
|
||||
|
||||
#if (defined (__STDC__) && __STDC__) || defined (__cplusplus)
|
||||
# if (defined __STDC__ && __STDC__) || defined __cplusplus
|
||||
|
||||
#define __P(args) args
|
||||
#define __const const
|
||||
#define __signed signed
|
||||
#define __volatile volatile
|
||||
#define __DOTS , ...
|
||||
# define __P(args) args
|
||||
# define __const const
|
||||
# define __signed signed
|
||||
# define __volatile volatile
|
||||
# define __DOTS , ...
|
||||
|
||||
#else /* Not ANSI C or C++. */
|
||||
# else /* Not ANSI C or C++. */
|
||||
|
||||
#define __P(args) () /* No prototypes. */
|
||||
#define __const /* No ANSI C keywords. */
|
||||
#define __signed
|
||||
#define __volatile
|
||||
#define __DOTS
|
||||
# define __P(args) () /* No prototypes. */
|
||||
# define __const /* No ANSI C keywords. */
|
||||
# define __signed
|
||||
# define __volatile
|
||||
# define __DOTS
|
||||
|
||||
#endif /* ANSI C or C++. */
|
||||
# endif /* ANSI C or C++. */
|
||||
|
||||
#endif /* GCC. */
|
||||
|
||||
/* For these things, GCC behaves the ANSI way normally,
|
||||
and the non-ANSI way under -traditional. */
|
||||
|
||||
#if defined (__STDC__) && __STDC__
|
||||
#if defined __STDC__ && __STDC__
|
||||
|
||||
#define __CONCAT(x,y) x ## y
|
||||
#define __STRING(x) #x
|
||||
# define __CONCAT(x,y) x ## y
|
||||
# define __STRING(x) #x
|
||||
|
||||
/* This is not a typedef so `const __ptr_t' does the right thing. */
|
||||
#define __ptr_t void *
|
||||
#define __long_double_t long double
|
||||
# define __ptr_t void *
|
||||
# define __long_double_t long double
|
||||
|
||||
#else
|
||||
|
||||
#define __CONCAT(x,y) x/**/y
|
||||
#define __STRING(x) "x"
|
||||
# define __CONCAT(x,y) x/**/y
|
||||
# define __STRING(x) "x"
|
||||
|
||||
#define __ptr_t char *
|
||||
#define __long_double_t long double
|
||||
# define __ptr_t char *
|
||||
# define __long_double_t long double
|
||||
|
||||
/* The BSD header files use the ANSI keywords unmodified (this means that
|
||||
old programs may lose if they use the new keywords as identifiers), but
|
||||
those names are not available under -traditional. We define them to
|
||||
their __ versions, which are taken care of above. */
|
||||
#ifdef __USE_BSD
|
||||
#define const __const
|
||||
#define signed __signed
|
||||
#define volatile __volatile
|
||||
# define const __const
|
||||
# define signed __signed
|
||||
# define volatile __volatile
|
||||
#endif
|
||||
|
||||
#endif /* __STDC__ */
|
||||
@ -88,18 +88,18 @@
|
||||
|
||||
/* C++ needs to know that types and declarations are C, not C++. */
|
||||
#ifdef __cplusplus
|
||||
#define __BEGIN_DECLS extern "C" {
|
||||
#define __END_DECLS }
|
||||
# define __BEGIN_DECLS extern "C" {
|
||||
# define __END_DECLS }
|
||||
#else
|
||||
#define __BEGIN_DECLS
|
||||
#define __END_DECLS
|
||||
# define __BEGIN_DECLS
|
||||
# define __END_DECLS
|
||||
#endif
|
||||
|
||||
/* GCC2 has various useful declarations that can be made with the
|
||||
`__attribute__' syntax. All of the ways we use this do fine if
|
||||
they are omitted for compilers that don't understand it. */
|
||||
#if !defined (__GNUC__) || __GNUC__ < 2
|
||||
#define __attribute__(xyz) /* Ignore. */
|
||||
#if !defined __GNUC__ || __GNUC__ < 2
|
||||
# define __attribute__(xyz) /* Ignore. */
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 1992, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -22,7 +22,7 @@
|
||||
#include <features.h>
|
||||
|
||||
#ifndef _FCNTL_H
|
||||
#include <fcntl.h>
|
||||
# include <fcntl.h>
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
@ -31,19 +31,19 @@ __BEGIN_DECLS
|
||||
/* Alternate names for values for the WHENCE argument to `lseek'.
|
||||
These are the same as SEEK_SET, SEEK_CUR, and SEEK_END, respectively. */
|
||||
#ifndef L_SET
|
||||
#define L_SET 0 /* Seek from beginning of file. */
|
||||
#define L_INCR 1 /* Seek from current position. */
|
||||
#define L_XTND 2 /* Seek from end of file. */
|
||||
# define L_SET 0 /* Seek from beginning of file. */
|
||||
# define L_INCR 1 /* Seek from current position. */
|
||||
# define L_XTND 2 /* Seek from end of file. */
|
||||
#endif
|
||||
|
||||
|
||||
/* Operations for the `flock' call. */
|
||||
#define LOCK_SH 1 /* Shared lock. */
|
||||
#define LOCK_EX 2 /* Exclusive lock. */
|
||||
#define LOCK_UN 8 /* Unlock. */
|
||||
#define LOCK_SH 1 /* Shared lock. */
|
||||
#define LOCK_EX 2 /* Exclusive lock. */
|
||||
#define LOCK_UN 8 /* Unlock. */
|
||||
|
||||
/* Can be OR'd in to one of the above. */
|
||||
#define LOCK_NB 4 /* Don't block when locking. */
|
||||
#define LOCK_NB 4 /* Don't block when locking. */
|
||||
|
||||
|
||||
/* Apply or remove an advisory lock, according to OPERATION,
|
||||
|
@ -70,7 +70,7 @@ extern char *__progname; /* Program name, from crt0. */
|
||||
/* Define the lock. */
|
||||
__libc_lock_define_initialized (static, syslog_lock)
|
||||
|
||||
static void openlog_internal(const char *, int, int);
|
||||
static void openlog_internal(const char *, int, int) internal_function;
|
||||
static void closelog_internal(void);
|
||||
static void sigpipe_handler (int);
|
||||
#ifdef _LIBC_REENTRANT
|
||||
@ -230,6 +230,7 @@ vsyslog(pri, fmt, ap)
|
||||
static struct sockaddr SyslogAddr; /* AF_UNIX address of local logger */
|
||||
|
||||
static void
|
||||
internal_function
|
||||
openlog_internal(const char *ident, int logstat, int logfac)
|
||||
{
|
||||
if (ident != NULL)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user