Compare commits

...
Author SHA1 Message Date
Roland McGrath 03d0a7e2aa * extract-dynsym: New file.
* Makefile (distribute): Add it.
1996-05-09 00:53:12 +00:00
Roland McGrath 7c713e287e Wed May 8 20:04:29 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* Rules (subdir_install): Depend on $(common-objpfx)sor-$(subdir).
	[! libc.so-version]: Clear static-only-routines.
	($(common-objpfx)sor-$(subdir)): New target.
	[static-only-routines]: New static pattern rule for these .so's.
	* Makerules [libc.so-version] ($(slibdir)/libc.so): Target removed.
	[libc.so-version] ($(libdir)/libc.so, $(common-objpfx)libc-syms.so):
	New targets replace it.
	(install) [libc.so-version]: Depend on $(libdir)/libc.so instead of
	$(slibdir)/libc.so.
	* io/Makefile (static-only-routines): New variable.
	* configure.in: Check for tools objdump and objcopy, and for awk.
	* config.make.in (OBJDUMP, OBJCOPY, AWK): New variables.

Thu May  9 01:24:00 1996  Ulrich Drepper  <drepper@cygnus.com>

	* locale/programs/config.h: Remove definition of wint_t.

	* locale/programs/ld-collate.c: Include <wchar.h> instead of
	<wcstr.h>.

	* manual/time.texi: Add some more description for %U and %W
	format of strftime.  Describe new format %V of strftime.

	* resolv/gethnamaddr.c: Prevent warning by preventing variable
	definition.
	* stdio-common/_itoa.c: Ditto.

Tue May  7 23:43:07 1996  Ulrich Drepper  <drepper@cygnus.com>

	* libio/clearerr.c, libio/feof.c, libio/ferror.c, libio/fgetc.c,
	libio/fileno.c, libio/fputc.c, libio/freopen.c, libio/fseek.c,
	libio/genops.c, libio/getc.c, libio/getchar.c, libio/iofclose.c,
	libio/iofflush.c, libio/iofgetpos.c, libio/iofgets.c,
	libio/iofputs.c, libio/iofread.c, libio/iofsetpos.c,
	libio/ioftell.c, libio/iofwrite.c, libio/iogetdelim.c,
	libio/iogets.c, libio/ioputs.c, libio/iosetbuffer.c,
	libio/iosetvbuf.c, libio/ioungetc.c, libio/iovsprintf.c,
	libio/libio.h, libio/putc.c, libio/putchar.c, libio/rewind.c,
	libio/stdio.h, stdio-common/printf_fp.c, stdio-common/vfprintf.c,
	stdio-common/vfscanf.c: Prepare for reentrent libio.

	* libio/clearerr_u.c, libio/feof_u.c, libio/ferror_u.c,
	libio/fputc_u.c, libio/getc_u.c, libio/getchar_u.c,
	libio/iofflush_u.c, libio/putc_u.c, libio/putchar_u.c: New files.
	Used in reentrent libio.

	* misc/getusershell.c: Prevent warnings.
1996-05-09 00:37:21 +00:00
Roland McGrath f0523145cc * Makerules (install-lib.so rules): Undouble $s in target and dep
parts of o-iterator-doit defns.
	(unversioned libraries install rule): Fix pattern.

	* mach/Makefile (mach-src-headers): Use $(base-machine) instead of
	$(config-machine).
	($(includedir)/machine): Likewise.

	* config.make.in (base-machine): New variable.
	* configure.in (machine): Move case stmt to set $machine out of sysdep
	dirs AC_CACHE_CHECK.
	(base_machine): New variable, set in that switch and AC_SUBST'd.

	* Makerules (stub-$(subdir)): Use file name in directory as output,
	since cmd is cd'd.
1996-05-08 22:40:39 +00:00
Roland McGrath c17097f152 Wed May 8 12:08:35 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* configure.in (MSGFMT): Use : if none found.

	* po/Makefile: Include ../Rules instead of ../Makerules.
1996-05-08 16:18:27 +00:00
Roland McGrath ce4d8b661a Tue May 7 23:18:44 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* po/Makefile: New file.
	* Makefile (subdirs): Add po.

	* configure.in: Check for msgfmt.
	* config.make.in (MSGFMT): New variable.

Sun May  5 23:49:10 1996  Ulrich Drepper  <drepper@cygnus.com>

	* misc/Makefile (routines): Add swapoff.

	* sysdeps/unix/sysv/linux/Dist: Add sys/quota.h.

	* sysdeps/unix/sysv/linux/sys/quota.h: New file.  Wrapper around
	kernel header file.
1996-05-08 03:31:04 +00:00
Roland McGrath 0e3426bbcf Tue May 7 19:00:01 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* string/argz-extract.c: Remove const from decl.
	* string/argz.h: Here too.

	* Makeconfig (version.mk): Fix regexp in sed cmd.
	Depend on $(..)Makeconfig.

	* GMP code updated from gmp-2.0 release.
	* stdlib/Makefile (mpn-routines): Removed add_1, added inlines.
	* sysdeps/generic/add_1.c: File removed.
	* stdlib/strtod.c: mp_limb is now mp_limb_t.
	* stdlib/fpioconst.c, stdlib/fpioconst.h: Likewise.
	* stdio-common/_itoa.c: Likewise.
	* stdio-common/printf_fp.c: Likewise.
	Don't include ansidecl.h.

	* sysdeps/mach/hurd/getcwd.c: Use io_identity instead of io_stat.

	* shlib-versions: New file.
	* Makerules (soversions.mk): New target, include file generated from
	shlib-versions.  Moved shared library rules before installation rules.
	Rewrote shared library installation rules for versioned libraries.
	* math/Makefile (libm.so-version): Variable removed.

	* sysdeps/mach/hurd/i386/exc2signal.c: Use struct hurd_signal_detail.

	* hurd/report-wait.c (_S_msg_describe_ports): New function.

	* configure.in: Add AC_PROG_LN_S check.
	* config.make.in (LN_S): New variable.

Sun May  5 03:10:44 1996  Ulrich Drepper  <drepper@cygnus.com>

	* misc/efgcvt_r.c (ecvt_r): Work aroung gcc bug.  gcc does
	not know about weak aliases now and optimizes necessary `if'
	statement away.

	* posix/unistd.h: Add swapoff prototype.

	* sysdeps/generic/confname.h: Add even more POSIX.4 symbols.

	* sysdeps/posix/fpathconf.c (__fpathconf): Get information
	for _PC_PATH_MAX from fstatfs function if available.

	* sysdeps/posix/sysconf.c: Add code to handle _SC_AIO_LISTIO_MAX,
	_SC_AIO_MAX, _SC_AIO_PRIO_DELTA_MAX, _SC_DELAYTIMER_MAX,
	_SC_MQ_OPEN_MAX, _SC_MQ_PRIO_MAX, _SC_RTSIG_MAX,
	_SC_SEM_NSEMS_MAX, _SC_SEM_VALUE_MAX, _SC_SIGQUEUE_MAX, and
	_SC_TIMER_MAX.
	* sysdeps/unix/sysv/sysv4/sysconf.c: Ditto.

	* sysdeps/stub/swapoff.c: New file.  Stub version for swapoff
	function.

	* sysdeps/unix/syscalls.list:  Add swapoff.

	* sysdeps/unix/sysv/linux/Dist: Add sys/acct.h.

	* sysdeps/unix/sysv/linux/Makefile [$(subdir) == misc]
	(sysdep_routines): Add mount, umount, llseek, setfsgid, setfsuid,
	sysinfo, and uselib.
	(headers): Add sys/sysinfo.h.

	* sysdeps/unix/sysv/linux/gethostid.c: Prevent warning.

	* sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) == misc]
	(sysdep_routines): Add ioperm, iopl, and vm86.
	(headers): Add sys/perm.h and sys/vm86.h.

	* sysdeps/unix/sysv/linux/i386/sys/perm.h: New file.  Contains
	prototypes for iopl and ioperm.

	* sysdeps/unix/sysv/linux/i386/sys/vm86.h:  New file.  Contains
	prototype for vm86.

	* sysdeps/unix/sysv/linux/i386/syscalls.list: New file.  Add
	vm86 system call.

	* sysdeps/unix/sysv/linux/sys/acct.h: New file.  Contains
	prototypes for acct function.

	* sysdeps/unix/sysv/linux/sys/socket.h: Provide real header
	file with prototypes.

	* sysdeps/unix/sysv/linux/sys/sysinfo.h: New file.  Contains
	prototype for sysinfo function.

	* sysdeps/unix/sysv/linux/syscalls.list: Add flock, ioperm, iopl,
	llseek, setfsgid, setfsuid, sysinfo, and uselib.

	* sysdeps/unix/sysv/linux/sysconf.c: Instead of duplicating
	posix/sysconf.c now only handle cases different to that
	implementation.

Tue May  7 15:08:19 1996  Miles Bader  <miles@gnu.ai.mit.edu>

	* stdio/linewrap.c (__line_wrap_output): Renamed from lwoutput
	(all references changed).  Now exported.

	* stdio/linewrap.c (struct data): Type deleted (moved to linewrap.h).
	(wrap_stream, unwrap_stream, lwclose, lwfileno, lwoutput,
	line_wrap_stream, line_unwrap_stream): Use struct line_wrap_data
	instead of struct data.
	(lwoutput, line_wrap_stream, line_unwrap_stream): Rename various
	occurences of `wrap' and `wrapmargin' to `wmargin'.
	(line_wrapped, line_wrap_lmargin, line_wrap_set_lmargin,
	line_wrap_rmargin, line_wrap_set_rmargin, line_wrap_wmargin,
	line_wrap_set_wmargin, line_wrap_point): New functions.
	* stdio/linewrap.h: New file.
	* stdio/Makefile (headers): Add linewrap.h.

Tue May  7 14:19:12 1996  Roland McGrath  <roland@delasyd.gnu.ai.mit.edu>

	* sysdeps/unix/sysv/linux/i386/Makefile: File removed.

	* stdio/stdio.h: Remove line_wrap_stream, line_unwap_stream decls.

	* sysdeps/unix/sysv/linux/schedbits.h: New file.

Tue May  7 13:47:02 1996  Miles Bader  <miles@gnu.ai.mit.edu>

	* stdio/linewrap.c (struct data): Make margin fields not-pointers.
	(lwoutput): Adjust uses acordingly.

	* sysdeps/mach/hurd/fdatasync.c: New file.
	* sysdeps/mach/hurd/fsync.c: Pass new flag to file_sync.

	* sysdeps/mach/hurd/xmknod.c: Pass new flag to dir_link.
	* sysdeps/mach/hurd/symlink.c: Likewise.
	* sysdeps/mach/hurd/link.c: Likewise.
	* sysdeps/mach/hurd/bind.c: Likewise.
	* hurd/hurdsig.c (write_corefile): Likewise.

	* hurd/hurdsig.c (write_corefile): Pass cttyid port to crash server.

	* sysdeps/mach/hurd/fpathconf.c: RPC takes int pointer, not long int.

	* sysdeps/mach/hurd/_exit.c (_hurd_exit): Pass sigcode arg to
	proc_mark_exit.
	* sysdeps/mach/hurd/dl-sysdep.c (_exit): Likewise.

	* sysdeps/mach/hurd/wait4.c: Pass sigcode arg to proc_wait.

	* sysdeps/mach/hurd/rename.c: Pass new flag to dir_rename.

	* hurd/hurdfault.c (_hurdsig_fault_catch_exception_raise): Use struct
	hurd_signal_detail.
	* hurd/catch-exc.c (_S_catch_exception_raise): Likewise.
	* hurd/hurd-raise.c (_hurd_raise_signal): Likewise.
	* sysdeps/mach/hurd/i386/trampoline.c (_hurd_setup_sighandler):
	Likewise.
	* sysdeps/mach/hurd/setitimer.c (restart_itimer): Likewise.

	* hurd/hurd/signal.h: Fix _hurd_exception2signal prototype.

	* hurd/hurdsig.c (write_corefile): Take const struct
	hurd_signal_detail * arg.  Pass all details to crash_dump_task.
	(_hurd_internal_post_signal): Pass DETAIL to write_corefile.
	(_hurd_internal_post_signal: suspend): Pass code and error to
	proc_mark_stop.

	* hurd/hurdprio.c (_hurd_priority_which_map): Pass flags arg to
	proc_getprocinfo by reference.
1996-05-08 02:07:47 +00:00
Roland McGrath b928942eaa Updated from /src/gmp-2.0 1996-05-07 21:04:52 +00:00
Miles Bader fc38dc5be9 (headers): Add linewrap.h. 1996-05-07 19:27:44 +00:00
Roland McGrath ad41463d4e Regenerated: autoconf configure.in 1996-05-07 19:19:14 +00:00
Roland McGrath 93a470c71a Tue May 7 10:51:52 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* wcsmbs/wcwidth.c, wcsmbs/wcswidth.c: Fixed typos.

	* sysdeps/unix/sysv/linux/sys/mman.h: Fixed typo.

	* sysdeps/stub/sched_getp.c: Add missing #include <sys/types.h>.
	* sysdeps/stub/sched_sets.c: Likewise.
	* sysdeps/stub/sched_setp.c: Likewise.
	* sysdeps/stub/sched_rr_gi.c: Likewise.
	* sysdeps/stub/sched_gets.c: Likewise.

	* hurd/hurdsig.c: Use struct hurd_signal_detail.
	* hurd/hurd/fd.h (_hurd_fd_error): Likewise.
	* sysdeps/mach/hurd/sysd-stdio.c (fd_fail): Likewise.
1996-05-07 14:57:38 +00:00
Roland McGrath 4ddc1f9dd6 Mon May 6 09:51:05 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* stdio/linewrap.c: New file.
	* stdio/Makefile (routines): Add linewrap.
	* stdio/stdio.h [__USE_GNU]: Declare line_wrap_stream,
	line_unwrap_stream.

Mon May  6 14:53:26 1996  Ulrich Drepper  <drepper@cygnus.com>

	* time/strftime.c (week): Add third parameter telling how
	many days must be in new year so that it is called week 1.
	(Following ISO 8601).
	Correct computation for %U and %V formats when day was first
	day of the week.
	(strftime): Implement %V format according to Spec1170.

	* hurd/hurd/sigpreempt.h (struct hurd_signal_preempter): Change
	prototype of `preempter' elt to use struct hurd_signal_detail.

	* hurd/hurd/signal.h (struct hurd_signal_detail): New type.
	(struct hurd_sigstate): Make `pending_data' member an array of that.
	Use the new type in several decls.
1996-05-07 14:49:30 +00:00
Roland McGrath 28ca945828 Mon May 6 09:51:05 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* stdio/linewrap.c: New file.
	* stdio/Makefile (routines): Add linewrap.
	* stdio/stdio.h [__USE_GNU]: Declare line_wrap_stream,
	line_unwrap_stream.
1996-05-07 14:49:12 +00:00
Thomas Bushnell, BSG cee8df033b *** empty log message ***
Mon May  6 17:01:09 1996  Michael I. Bushnell, p/BSG  <mib@gnu.ai.mit.edu>

	* hurd/hurd/signal.h (_hurd_intr_rpc_mach_msg): New declaration.
1996-05-06 21:02:30 +00:00
Thomas Bushnell, BSG 3d46e1cd0a (_hurd_intr_rpc_mach_msg): New declaration. 1996-05-06 21:00:43 +00:00
Roland McGrath 339841f985 Mon May 6 14:53:26 1996 Ulrich Drepper <drepper@cygnus.com>
* time/strftime.c (week): Add third parameter telling how
	many days must be in new year so that it is called week 1.
	(Following ISO 8601).
	Correct computation for %U and %V formats when day was first
	day of the week.
	(strftime): Implement %V format according to Spec1170.
1996-05-06 14:31:45 +00:00
Roland McGrath db2286f6d9 * locale/setlocale.c (_nl_C_name): Variable removed.
* locale/C_name.c: New file.
	(_nl_C_name): Put it here instead.
	* locale/Makefile (aux): Add C_name.

	* sysdeps/mach/hurd/dl-sysdep.c (open): Don't pass io port in
	auth_user_authenticate rpc.
	(open): Avoid using strtol in digit conversion for "fd/N" magic.
	(_dl_sysdep_start): Likewise for memobj name in magic switches.

	* elf/Makefile (reloc-link): New variable.
	(dl-allobjs.so): New target, link together $(rtld-routines).
	(librtld.so): Depend on that instead of the rtld components.
	(generated): Add dl-allobjs.so.
1996-05-04 13:57:05 +00:00
Roland McGrath 8f0c527e13 Sat May 4 05:44:25 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* hurd/hurd-raise.c (_hurd_raise_signal): Pass sigcode in msg_sig_post
	rpc.

	* hurd/hurdmsg.c (_S_msg_set_environment): Use argz.h functions
	instead of _hurd_split_args.
	(_S_msg_*_exec_flags): Functions removed.
	(_S_msg_startup_dosync): Stub removed.

Sat May  4 02:11:55 1996  Roland McGrath  <roland@delasyd.gnu.ai.mit.edu>

	* sysdeps/mach/hurd/ptrace.c: Set _hurdsig_traced instead of
	EXEC_TRACED bit in _hurd_exec_flags.
	Pass sigcode arg in msg_sig_post_untraced rpc.

	* sysdeps/mach/hurd/access.c: Don't pass io port in
	auth_user_authenticate rpc.

	* posix/sched.h: Fix typos.

	* sysdeps/mach/hurd/fork.c: Use new critical section lock.
	Clear _hurdsig_traced instead of EXEC_TRACED.

	* sysdeps/stub/nanosleep.c (nanosleep): Fix typo.

	* wcsmbs/wcstol.c: Find strtol.c in ../stdlib.
	* wcsmbs/wcstof.c: Find strtod.c in ../stdlib.
	* wcsmbs/wcstod.c: Likewise.
	* wcsmbs/wcstold.c: Likewise.

	* wcsmbs/wcwidth.h: Find cname-lookup.h in ../wctype.

	* string/envz.c (envz_entry): Use const.
	(envz_get, envz_remove): Likewise.
	(envz_entry): Return char *, not const char *.

	* string/envz.h: Fix decl.

	* string/argz-create.c: Use const in prototype.
	* string/argz-next.c: Likewise.

	* sysdeps/mach/hurd/sigprocmask.c: Pass sigcode arg to msg_sig_post.
	* sysdeps/mach/hurd/i386/sigreturn.c: Likewise.
	* sysdeps/mach/hurd/sigsuspend.c: Likewise.
	* sysdeps/mach/hurd/kill.c: Likewise.

	* hurd/hurdexec.c (_hurd_exec): Use new critical section lock.
	* hurd/catch-exc.c (_S_catch_exception_raise): Likewise.
	* hurd/sigunwind.c (_hurdsig_longjmp_from_handler): Likewise.
	* hurd/thread-cancel.c (hurd_thread_cancel, hurd_check_cancel):
	Likewise.
	* sysdeps/mach/hurd/jmp-unwind.c (_longjmp_unwind): Likewise.
	* sysdeps/mach/hurd/sigaction.c: Likewise.

	* sysdeps/mach/hurd/errnos.awk: Don't use ARGV in comment; it can
	change meaninglessly.

	* hurd/hurd/signal.h (struct hurd_sigstate): Replace critical section
 	flag with a spin lock.
	(_hurd_critical_section_lock): Use spin_try_lock on that to see if we
 	get it.  No need to take SS->lock at all.
	(_hurd_critical_section_unlock): Unlock SS->critical_section_lock
	instead of clearing the old flag member.
	* hurd/hurdsig.c (_hurd_internal_post_signal): Use spin_lock_locked to
	test the critical section state.

	* hurd/hurdinit.c (_hurd_init): Set _hurdsig_traced from the intarray.

	* hurd/hurdkill.c (_hurd_sig_post): Pass 0 sigcode in msg_sig_post.

	* hurd/hurdsig.c (_hurd_internal_post_signal): Test _hurdsig_traced
 	instead of testing (_hurd_exec_flags & EXEC_TRACED).
	(_S_msg_sig_post): Take sigcode arg and pass it through.
	(_S_msg_sig_post_untraced): Likewise.
	(reauth_proc): Don't pass proc port in auth_user_authenticate.

	* hurd/setauth.c (_hurd_setauth): Don't pass object ports in
	auth_user_authenticate RPCs, just the one-off rendezvous port.
	* hurd/dtable.c (reauth_dtable): Likewise.
	* hurd/hurdlookup.c (__hurd_file_name_lookup_retry): Likewise.

	* hurd/hurdexec.c (_hurd_exec): Pass 0 flags to file_exec.
	Pass sigcode arg to msg_sig_post.

	* string/argz.h (argz_create): Use const in prototype.

	* hurd/hurdinit.c (_hurd_proc_init): Test _hurdsig_traced instead of
	testing (_hurd_exec_flags & EXEC_TRACED).
	Pass sigcode arg to msg_sig_post.

	* hurd/hurd.h: Declare _hurdsig_traced.

	* string/argz.h (__argz_next): Cast ENTRY before returning it.

	* hurd/hurd/signal.h (_hurd_critical_section_unlock): Pass sigcode arg
	to msg_sig_post.

	* hurd/path-lookup.c: New file.
	* hurd/Makefile (routines): Add path-lookup.
	* hurd/hurd/lookup.h: Declare file_name_path_scan,
	hurd_file_name_path_lookup.
	* hurd/hurd.h: Declare file_name_path_lookup.

	* sysdeps/mach/hurd/select.c: The io_select rpc no longer has a TAG_ID
	argument.  Instead, use a separate reply port for each RPC and put them
	all in a port set to wait for slow replies.
1996-05-04 09:46:57 +00:00
Roland McGrath 7a12c6bba7 Fri May 3 13:32:08 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* intl/Makefile (CPPFLAGS): Change $(nlsdir) to $(i18ndir) in
	LOCALE_ALIAS_PATH.

Fri May  3 03:14:02 1996  Ulrich Drepper  <drepper@cygnus.com>

	* intl/Makefile (routines): Add l10nflist and explodename.
	(distribute): Add loadinfo.h and locale.alias.
	(install-others): New variable to install locale.alias.

	* intl/dcgettext.c, intl/finddomain.c, intl/gettextP.h,
	intl/loadmsgcat.c: Adapt for upcoming gettext-0.10.13.  Some code
	is now shared with the locale implementation.

	* intl/explodename.c, intl/l10nflist.c, intl/loadinfo.h: New file.
        Extracted from finddomain.c.  This is also used in the locale
        implementation.

	* intl/locale.alias: New file.  Locale alias database compatible
        with X Window System's locale alias file.  Can now be used in
        locale and gettext code.

	* libio/stdio.h: Add prototypes for asprint and vasprintf.

	* locale/C-collate.c, locale/C-ctype.c, locale/C-messages.c,
	locale/C-monetary.c, locale/C-numeric.c, locale/C-time.c: Add new
	field in structure with name of locale ("C" in this case).

	* locale/Makefile (routines): Add findlocale.

	* locale/findlocale.c: New file.  Instead of trying to load the
        directly described file we now try to be much smarter when this
        fails.  Use the same code as gettext does.

	* locale/loadlocale.c, locale/setlocale.c: Rewrite to know about
        new loading scheme.

	* locale/localeinfo.h: Adapt prototypes and declarations for new
	setlocale implementation.  Remove definition of u32_t type.  We
	now use u_int32_t from <sys/types.h>.

	* locale/programs/charset.h (ILLEGAL_CHAR_VALUE): Provide type
        with constant.

	* locale/programs/config.h, locale/lc-collate.c,
        locale/localeinfo.h, locale/programs/ld-collate.c,
        locale/programs/ld-ctype.c, locale/programs/ld-messages.c,
        locale/programs/ld-monetary.c, locale/programs/ld-numeric.c,
        locale/programs/ld-time.c, locale/weight.h, string/strcoll.c:
        Change to use u_int32_t and u_int16_t.

	* locale/programs/localedef.c (construct_output_path): Change name
        of output locale to contain normalized form of the character set
        portion.

	* string/Makefile (routines): Add agrz-ctsep and argz-next.
	(tests): Add tst-strlen.

	* string/argz-ctsep.c: New file.  Implement reverse operation
	from argz-stringify.

	* string/argz-next.c: Non-inline version of function from argz.h.

	* string/argz.h, string/envz.h: Make usable as global header file.

	* string/envz.c: Fix declarations to use size_t where prototypes
	say so.

	* string/tst-strlen.c: New file.  Another test for critical
        situation in strlen implementations.

	* sysdeps/i386/i586/strlen.S: Fix bug with highest byte in word
        being zero.

	* wctype/test_wctype.c: Fix controlling comparison after change to
        32 bit character class array.

Fri May  3 12:53:12 1996  Roland McGrath  <roland@delasyd.gnu.ai.mit.edu>

	* sysdeps/unix/sysv/linux/sys/socket.h: Remove spurious doubled line.

Thu May  2 22:50:52 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/unix/sysv/linux/getpriority.c: New file.
	* sysdeps/unix/sysv/linux/syscalls.list: Add s_getpriority.

Thu May  2 22:41:31 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/unix/sysv/linux/m68k/fpu_control.h (_FPU_DEFAULT):
	Disable all exceptions.

Thu May  2 22:33:14 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/m68k/fpu/e_acos.c, sysdeps/m68k/fpu/e_acosf.c,
	sysdeps/m68k/fpu/e_fmod.c, sysdeps/m68k/fpu/e_fmodf.c,
	sysdeps/m68k/fpu/isinfl.c, sysdeps/m68k/fpu/isnanl.c,
	sysdeps/m68k/fpu/s_atan.c, sysdeps/m68k/fpu/s_atanf.c,
	sysdeps/m68k/fpu/s_frexp.c, sysdeps/m68k/fpu/s_frexpf.c,
	sysdeps/m68k/fpu/s_ilogb.c, sysdeps/m68k/fpu/s_ilogbf.c,
	sysdeps/m68k/fpu/s_isinf.c, sysdeps/m68k/fpu/s_isinff.c,
	sysdeps/m68k/fpu/s_ldexp.c, sysdeps/m68k/fpu/s_ldexpf.c,
	sysdeps/m68k/fpu/s_modf.c, sysdeps/m68k/fpu/s_modff.c: Don't
	define __NO_MATH_INLINES, which is already defined on command
	line.

Thu May  2 22:18:28 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/libm-ieee754/e_j0f.c (__ieee754_j0f, __ieee754_y0f):
	Replace 0x80000000 by 0x48000000.
	* sysdeps/libm-ieee754/e_j1f.c (__ieee754_j1f): Likewise.

Thu May  2 21:30:33 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sunrpc/svc_simple.c: Make global variable pl local to
	registerrpc.

Thu May  2 00:24:04 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* time/Makefile (tz-cflags): New variable.
	(CFLAGS-tzfile.c): New variable.
	(CFLAGS-zic.c): Add $(tz-cflags).
	(tz-cc): Remove variable.
	($(objpfx)tzfile.o, $(objpfx)zic.o): Remove targets.

	* sysdeps/mach/hurd/getcwd.c: Jump out of both loops when we find a
	name, instead of checking for reaching end of buffer, which happens
	when the match is the last entry in the buffer.
1996-05-03 17:44:31 +00:00
Roland McGrath 9e72046871 Thu May 2 00:24:04 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* time/Makefile (tz-cflags): New variable.
	(CFLAGS-tzfile.c): New variable.
	(CFLAGS-zic.c): Add $(tz-cflags).
	(tz-cc): Remove variable.
	($(objpfx)tzfile.o, $(objpfx)zic.o): Remove targets.
1996-05-03 16:46:40 +00:00
Noah Friedman 8962ae8d6b Don't report an error if mkdir fails because a directory was created by another process. 1996-05-03 07:37:52 +00:00
Roland McGrath f5936b69da Wed May 1 09:10:04 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* sysdeps/mach/hurd/getcwd.c: Jump out of both loops when we find a
	name, instead of checking for reaching end of buffer, which happens
	when the match is the last entry in the buffer.
1996-05-02 00:26:56 +00:00
Roland McGrath 75cd5204dd Wed May 1 09:10:04 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* time/strftime.c: Use canonical autoconf nugget for time.h+sys/time.h
	include.

Mon Apr 29 02:48:26 1996  Ulrich Drepper  <drepper@cygnus.com>

	* ctype/ctype-info.c: (__ctype_width): New variable.
	(__ctype_names): Initialize correctly without offset.

	* locale/C-collate.c, locale/C-ctype.c,
	locale/C-messages.c, locale/C-monetary.c,
	locale/C-numeric.c, locale/C-time.c: Change copyright.

	* locale/C-ctype.c (_nl_C_LC_CTYPE_class32): Correct
	endianess for initialization value.

	* locale/lc-ctype.c (current): Add parameter for offset.
	(__ctype32_b, __ctype_width): Add initialization for these
	variables.

	* locale/programs/charmap.c: Finish support for WIDTH information.
	(new_width): New function.

	* locale/programs/charset.h (width_rule): new data structure.
	(charset_t): Add elements for width information.

	* locale/programs/ld-ctype.c (locale_ctype_t): Add element
	for width information.
	(allocate_arrays): Add new argument for charset.
	(ctype_finish): Make sure all characters named in charset
	width table are known to name table.
	(ctype_output): Correct handling of class and map name
	information and write out width information.
	(find_idx): Prepare for being called with NULL pointer as
	TABLE argument.  This means only allocate name entry.
	(allocate_arrays): Correct handling of array element -1.
	Because EOF == -1 the value of element 127 must *not* be
	mirrored here.
	Fill width information from charset tables.

	* locale/programs/localedef.c (main): Correct loop over all
	categories after change of order from Thu Mar 28 14:22:51 1996.
	Add new charset argument to call of `write_all_categories'.

	* locale/programs/locales.h (ctype_finish, ctype_output): New
	charset argument.

	* locale/programs/locfile.c (write_all_categories): Call
	`ctype_output' with additional argument charset.

	* posix/getconf.c (vars): Add _POSIX_SYNC_IO, _POSIX_ASYNC_IO,
	and _POSIX_PRIO_IO definitions.

	* posix/posix2_lim.h: Add definition of _POSIX2_CHARCLASS_NAME_MAX
	and CHARCLASS_NAME_MAX.

	* posix/unistd.h: Document _POSIX_SYNC_IO, _POSIX_ASYNC_IO,
	and _POSIX_PRIO_IO.

	* stdlib/grouping.h: Prepare for use in wide string functions.

	* stdlib/stdlib.h: Correct prototypes for __strto*_internal
	functions.

	* stdlib/strtod.c: Extend for use as `wcsto{f,d,ld}'.

	* stdlib/strtol.c: Extend for use as `wcsto{l,ul,q,uq}'.

	* string/strcoll.c: Extend for use as `wcscoll'.

	* string/strxfrm.c: Extend for use as `wcsxfrm'.

	* sysdeps/generic/confname.h: Add definition of _PC_SYNC_IO,
	_PC_ASYNC_IO, _PC_PRIO_IO and _SC_CHARCLASS_NAME_MAX.

	* sysdeps/generic/stpncpy.c: Correct return value.

	* sysdeps/posix/fpathconf.c: Add handling of _PC_SYNC_IO,
	_PC_ASYNC_IO, and _PC_PRIO_IO.

	* sysdeps/posix/sysconf.c: Add handling of _SC_REALTIME_SIGNALS,
	_SC_PRIORITY_SCHEDULING, _SC_TIMERS, _SC_ASYNCHRONOUS_IO,
	_SC_PRIORITIZED_IO, _SC_SYNCHRONIZED_IO, _SC_FSYNC,
	_SC_MAPPED_FILES, _SC_MEMLOCK, _SC_MEMLOCK_RANGE,
	_SC_MEMORY_PROTECTION, _SC_MESSAGE_PASSING, _SC_SEMAPHORES,
	_SC_SHARED_MEMORY_OBJECTS, and _SC_CHARCLASS_NAME_MAX.
	* sysdeps/stub/sysconf.c: Ditto.
	* sysdeps/unix/sysv/sysv4/sysconf.c: Ditto.

	* sysdeps/unix/sysv/linux/Dist: Add sys/sysctl.h.

	* sysdeps/unix/sysv/linux/Makefile [subdir == misc]
	(sysdep_routines): Add s_sysctl and sysctl.

	* sysdeps/unix/sysv/linux/sys/mman.h: Add declaration of mremap.

	* sysdeps/unix/sysv/linux/sys/socket.h: New file.  Wrapper
	around kernel header.

	* sysdeps/unix/sysv/linux/sys/sysctl.h: New file.  Define
	interface to `sysctl' function.

	* sysdeps/unix/sysv/linux/syscalls.list: Add mremap and _sysctl.

	* sysdeps/unix/sysv/linux/sysconf.c: Add handling of
	_SC_CHARCLASS_NAME_MAX.

	* sysdeps/unix/sysv/linux/sysctl.c: new file.  Implement caller
	of _sysctl system call.

	* sysvipc/Makefile (routines): Add ftok.

	* sysvipc/ftok.c: use variable `proj_id' not `id'.  Patch by
	David Mosberger-Tang.

	* wcsmbs/Makefile (routines): Add wcpcpy, wcpncpy, wcstol,
        wcstoul, wcstoq, wcstouq, wcstod, wcstold, wcstof, wcscoll,
        wcsxfrm, wcwidth, and wcswidth.

	* wcsmbs/wchar.h: Add declarations for wcpcpy, wcpncpy, wcstol,
        wcstoul, wcstoq, wcstouq, wcstod, wcstold, wcstof, wcscoll,
        wcsxfrm, wcwidth, and wcswidth.
	Declare internal interfaces for wcsto* functions.
	[OPTIMIZE]: Define inline functions for wcsto* functions to
	call internal interface functions.

	* wcsmbs/wcpcpy.c, wcsmbs/wcpncpy.c: New files.  Implement non-
	standard function equivalent to stpcpy/stpncpy.

	* wcsmbs/wcscoll.c: Implement `wcscoll' function by using
        `strcoll' implementation.

	* wcsmbs/wcscpy.c, wcsmbs/wcsncpy.c: Use wint_t instead of
        wchar_t.

	* wcsmbs/wcstod.c: Implement `wcstod' function by using `strtod'
        implementation.
	* wcsmbs/wcstof.c: Same for `wcstof'.
	* wcsmbs/wcstold.c: Same for `strtold'.

	* wcsmbs/wcstol.c: Implement `wcstol' function by using `strtol'
        implementation.
	* wcsmbs/wcstoq.c: Same for `wcstoq'.
	* wcsmbs/wcstoul.c: Same for `wcstoul'.
	* wcsmbs/wcstouq.c: Same for `wcstouq'.

	* wcsmbs/wcswidth.c: Implement `wcswidth' function from X/Open
        CAE.
	* wcsmbs/wcwidth.c: Ditto for `wcwidth'.
	* wcsmbs/wcwidth.h: Common function for definitions of above two
	functions.

	* wcsmbs/wcsxfrm.c: Implement `wcsxfrm function by using
        `strxfrm implementation.

	* wctype/wctype.c: Remove case for `wctype_t' being 16 bit type.

	* wctype/wctype.h (wint_t): Protect against multiple definition.
	(wctype_t): Always define as `unsigned long int'.

	* wctype.h: New file.  Wrapper around wctype/wctype.h.

	* hurd/hurdstartup.c (_hurd_split_args): Function removed.
	(_hurd_startup): Use argz functions.

	* hurd/hurdexec.c: Use argz functions.
1996-05-01 13:55:18 +00:00
Roland McGrath 5bd4495594 Tue Apr 30 17:30:46 1996 Miles Bader <miles@gnu.ai.mit.edu>
* hurd/hurdsig.c (_hurdsig_abort_rpcs): Add timeout argument to
	interrupt_operation call.
	(_hurdsig_interrupt_timeout): New variable.

	* hurd/report-wait.c (describe_number): Correctly allocate space
	in DESCRIPTION for the digits in I.
1996-05-01 09:03:01 +00:00
Miles Bader d3dc731b47 (describe_number): Correctly allocate space in DESCRIPTION for the digits in I. 1996-05-01 01:01:48 +00:00
Miles Bader 06f82985cb Regenerated from ../sysdeps/mach/hurd/errnos.awk ../manual/errno.texi ../../mach/mach/message.h ../../mach/mach/kern_return.h ../../mach/mach/mig_errors.h ../../mach/device/device_types.h 1996-04-30 21:33:05 +00:00
Roland McGrath c508104668 Regenerated from ../sysdeps/mach/hurd/errnos.awk ../manual/errno.texi /gd4/gnu/mach/mach/message.h /gd4/gnu/mach/mach/kern_return.h /gd4/gnu/mach/mach/mig_errors.h /gd4/gnu/mach/device/device_types.h 1996-04-29 06:49:03 +00:00
Roland McGrath 392d7920cd Mon Apr 29 00:11:59 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* errno.h [!__error_t_defined] (error_t): New type.
	* sysdeps/mach/hurd/errnos.awk: #define __error_t_defined after the
	typedef in errnos.h.

	* string/envz.c, string/envz.h: New files.
	* string/argz.h, string/argz-append.c, string/argz-count.c,
	string/argz-create.c, string/argz-delete.c, string/argz-extract.c,
	string/argz-insert.c, string/argz-stringify.c: New files.
	* string/Makefile (routines): Add envz, argz-*.
	(headers): Add argz.h, envz.h.
1996-04-29 05:21:53 +00:00
Roland McGrath 7b3547eb0f Sun Apr 28 14:14:35 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* sysdeps/unix/sysv/linux/i386/Makefile: New file.

Wed Apr 24 17:35:30  Ulrich Drepper  <drepper@cygnus.com>

	* inet/netinet/in.h, socket/sys/socket.h: Move to
	sysdeps/generic/netinet/in.h, sysdeps/generic/sys/socket.h.
	* netinet/in.h, sys/socket.h: Remove file.

	* misc/Makefile (routines): Add fdatasync.

	* posix/Makefile (headers): Add sched.h.
	(routines): Add nanosleep, sched_setp, sched_getp, sched_sets,
	sched_gets, sched_yield, sched_primax, sched_primin, sched_rr_gi.

	* posix/getconf.c (vars): Add entries for _POSIX_REALTIME_SIGNALS,
	_POSIX_PRIORITY_SCHEDULING, _POSIX_TIMERS, _POSIX_ASYNCHRONOUS_IO,
	_POSIX_PRIORITIZED_IO, _POSIX_SYNCHRONIZED_IO, _POSIX_FSYNC,
	_POSIX_MAPPED_FILES, _POSIX_MEMLOCK, _POSIX_MEMLOCK_RANGE,
	_POSIX_MEMORY_PROTECTION, _POSIX_MESSAGE_PASSING,
	_POSIX_SEMAPHORES, _POSIX_SHARED_MEMORY_OBJECTS.

	* posix/sched.h: New file.  Header for POSIX scheduling interface.

	* posix/unistd.h: Describe options from POSIX.4.
	Add declaration of fdatasync.

	* sysdeps/generic/confname.h: Add definition for
	 _SC_REALTIME_SIGNALS, _SC_PRIORITY_SCHEDULING, _SC_TIMERS,
	_SC_ASYNCHRONOUS_IO, _SC_PRIORITIZED_IO, _SC_SYNCHRONIZED_IO,
	_SC_FSYNC, _SC_MAPPED_FILES, _SC_MEMLOCK, _SC_MEMLOCK_RANGE,
	_SC_MEMORY_PROTECTION, _SC_MESSAGE_PASSING,
	_SC_SEMAPHORES, _SC_SHARED_MEMORY_OBJECTS.

	* sysdeps/generic/fdatasync.c: New file.  Default implementation
	simply uses fsync.

	* sysdeps/generic/netinit/in.h: Moved to here from inet/netinet/in.h.

	* sysdeps/generic/schedbits.h: New file.  System dependent
	defintion for POSIX.4 scheduling interface.

	* sysdeps/generic/sys/socket.h: Moved to here from socket/sys/socket.h.

	* sysdeps/stub/nanosleep.c, sysdeps/stub/sched_getp.c,
	sysdeps/stub/sched_gets.c, sysdeps/stub/sched_primax.c,
	sysdeps/stub/sched_primin.c, sysdeps/stub/sched_rr_gi.c,
	sysdeps/stub/sched_setp.c, sysdeps/stub/sched_sets.c,
	sysdeps/stub/sched_yield.c: New file:  Stub implementation
	for systems missing these POSIX.4 system calls.

	* sysdeps/unix/sysv/linux/gnu/types.h,
	sysdeps/unix/sysv/linux/ioctls.h: Use kernel header for
	data type definitions.

	* sysdeps/unix/sysv/linux/netinet/in.h: New file.  Linux
	specific version.

	* sysdeps/unix/sysv/linux/posix_opt.h: New file.  Define POSIX
	options applicable for Linux.

	* sysdeps/unix/sysv/linux/syscalls.list: Add definitions for
	fdatasync, nanosleep, sched_setparam, sched_getparam,
	sched_setscheduler, sched_getscheduler, sched_yield,
	sched_get_priority_max, sched_get_priority_min, and
	sched_rr_get_interval.

	* sysdeps/unix/sysv/linux/sysconf.c: Add handling of POSIX.4
	options.

	* sysdeps/unix/sysv/linux/termbits.h: Use kernel headers.

	* time/sys/time.h: Remove definition of `struct timespec'.

	* time/time.h (struct timespec): Move definition to here.

 	variable, LUCKY, to use instead of setting D to -1 (which fouls
1996-04-28 18:25:22 +00:00
Roland McGrath b1794a285f Thu Apr 25 15:49:57 1996 Miles Bader <miles@gnu.ai.mit.edu>
* sysdeps/mach/hurd/getcwd.c (__getcwd): When we find a match in
	the scan for a name, avoid doing another readdir (which overwrites
	NENTRIES, and was resulting in a bogus ENOENT).

	* sysdeps/mach/hurd/fcntl.c (__fcntl): Add missing break after F_SETFL.
1996-04-26 06:03:18 +00:00
Roland McGrath b2c8be1fdf Fri Apr 26 01:55:07 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* malloc/mcheck.c (mabort): Use __libc_fatal only #ifdef _LIBC.

Wed Apr 24 00:22:42 1996  Roland McGrath  <roland@delasyd.gnu.ai.mit.edu>

	* stdio/internals.c (seek_to_target): Set errno if seek function
	returns the wrong offset.

	* wcsmbs/wcsrtombs.c [! EILSEQ] (EILSEQ): Define to EINVAL.
	* wcsmbs/wcrtomb.c: Likewise.

	* stdio-common/vfprintf.c: Include errno.h.
1996-04-26 05:57:35 +00:00
Roland McGrath 8555e89e37 Added trailing blank line. 1996-04-26 05:55:41 +00:00
Miles Bader 072d114510 (__getcwd): When we find a match in the scan for a name, avoid doing another readdir (which overwrites NENTRIES, and was resulting in a bogus ENOENT). 1996-04-25 21:37:46 +00:00
Miles Bader 8ec2f30995 (__fcntl): Add missing break after F_SETFL. 1996-04-25 20:21:20 +00:00
Roland McGrath 7f77e07b00 Wed Apr 24 00:22:42 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* stdio/internals.c (seek_to_target): Set errno if seek function
	returns the wrong offset.
1996-04-25 18:13:38 +00:00
Roland McGrath 66aeca9cfb Tue Apr 23 21:09:14 1996 Miles Bader <miles@gnu.ai.mit.edu>
* hurd/hurdsig.c (signal_allowed): For SIGIO/SIGURG, add a new
 	variable, LUCKY, to use instead of setting D to -1 (which fucks
 	things up).
1996-04-24 09:03:11 +00:00
Roland McGrath 80bcb41041 Wed Apr 24 00:22:42 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* wcsmbs/wcsrtombs.c [! EILSEQ] (EILSEQ): Define to EINVAL.
	* wcsmbs/wcrtomb.c: Likewise.
1996-04-24 05:28:34 +00:00
Miles Bader e0637da1c7 (signal_allowed): For SIGIO/SIGURG, add a new variable, LUCKY, to use instead of setting D to -1 (which fucks things up). 1996-04-24 03:28:51 +00:00
Roland McGrath 9a8c0d4f41 Tue Apr 23 15:56:56 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* config.h.in (HAVE_REGEX): New macro.

	* sysdeps/unix/syscalls.list: Add statfs, fstatfs.
	* io/Makefile (headers): Add sys/statfs.h, statfsbuf.h.
	(routines): Add statfs, fstatfs.
	* sysdeps/mach/hurd/statfs.c: New file.
	* sysdeps/mach/hurd/fstatfs.c: New file.
	* sysdeps/stub/fstatfs.c: New file.
	* sysdeps/stub/statfs.c: New file.
	* io/sys/statfs.h: New file.
	* sysdeps/generic/statfsbuf.h: New file.
	* sysdeps/unix/sysv/linux/statfsbuf.h: New file.

Tue Apr 23 00:06:47 1996  Roland McGrath  <roland@delasyd.gnu.ai.mit.edu>

	* malloc/Makefile (gmalloc-routines): Add valloc back here.
	(dist-routines): Remove it here.
	* malloc/valloc.c [_MALLOC_INTERNAL && GMALLOC_INHIBIT_VALLOC]
	(ELIDE_VALLOC): Define it.
	[! ELIDE_VALLOC]: Make whole file conditional on this.
	* malloc/malloc.h (valloc): Make decl conditional on
	[!GMALLOC_INHIBIT_VALLOC] instead of [!emacs].

Mon Apr 22 00:02:19 1996  Roland McGrath  <roland@delasyd.gnu.ai.mit.edu>

	* MakeTAGS: Include version.mk.
	(po/SYS_libc.pot): Add missing / in sed s cmd.
1996-04-24 00:58:47 +00:00
Roland McGrath b0d20a87b5 Sat Apr 20 18:13:00 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* Makerules (no-whole-archive): Test $(have-no-whole-archive), not
	$(libc_cv_ld_no_whole_archive).

Sat Apr 20 17:07:17 1996  Ulrich Drepper  <drepper@cygnus.com>

	* assert/assert.h, ctype/ctype.h, dirent/dirent.h, errno.h,
	grp/grp.h, io/fcntl.h, io/sys/stat.h, io/utime.h, locale/locale.h,
	math/math.h, misc/nlist.h, misc/sgtty.h, misc/sys/file.h,
	misc/sys/ioctl.h, misc/sys/uio.h, posix/sys/times.h,
	posix/sys/types.h, posix/sys/utsname.h, posix/sys/wait.h,
	posix/tar.h, posix/wordexp.h, pwd/pwd.h, resource/sys/vlimit.h,
	resource/sys/vtimes.h, setjmp/setjmp.h, signal/signal.h,
	stdio-common/printf.h, stdlib/alloca.h, stdlib/stdlib.h,
	string/string.h, sysdeps/generic/sigaction.h,
	sysdeps/generic/sigset.h, sysdeps/generic/sys/ptrace.h,
	sysdeps/generic/sys/ptrace.h, sysdeps/unix/bsd/osf/sigaction.h,
	sysdeps/unix/sysv/linux/sys/ptrace.h,
	sysdeps/unix/sysv/minix/sigaction.h,
	sysdeps/unix/sysv/sco3.2.4/sigaction.h,
	sysdeps/unix/sysv/sysv4/sigaction.h,
	sysdeps/unix/sysv/sysv4/sigset.h, termios/termios.h,
	time/sys/time.h, time/time.h: Fix copyright comment.

	* sysdeps/generic/dl-sysdep.c (_dl_sysdep_start): If uids and gids are
	not given in stack aux vector, fetch them with syscalls.
1996-04-21 00:27:19 +00:00
Roland McGrath a641835acd Fri Apr 19 00:49:44 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* stdlib/rpmatch.c (rpmatch: try): Take new arg NOMATCH, return value
 	for nonmatching nonerror (instead of !MATCH).
	(rpmatch): Use it, so we return -1 when NOEXPR doesn't match either.

	* resolv/getnetnamadr.c (getnetbyaddr): Use u_int32_t instead of
	unsigned long for variable NET2.

	* time/etcetera, time/europe, time/solar89: Updated from ADO's 96e.

Tue Apr  9 14:37:31 1996  Ulrich Drepper  <drepper@cygnus.com>

	* catgets/Makefile, catgets/catgets.c, catgets/catgetsinfo.h,
	catgets/config.h, catgets/gencat.c, catgets/nl_types.h,
	catgets/open_catalog.c: New files.  Implementation of XPG4
	compliant catgets() function and needed tools.
	* Makefile (subdirs): Add catgets.

Thu Apr 18 23:36:11 1996  Roland McGrath  <roland@delasyd.gnu.ai.mit.edu>

	* math/Makefile (CPPFLAGS): Append -D__NO_MATH_INLINES.

Wed Apr 10 20:48:43 1996  Ulrich Drepper  <drepper@cygnus.com>

	* stdio-common/vfprintf.c: Correct some typos.

	* sysdeps/libm-ieee754/w_gammaf.c, sysdeps/libm-ieee754/w_lgamma.c,
	sysdeps/libm-ieee754/w_lgammaf.c: Reference signgam instead of
	__signgam.

Thu Apr 18 21:07:27 1996  Roland McGrath  <roland@delasyd.gnu.ai.mit.edu>

	* Makerules (no-whole-archive): New variable.
	(build-shlib): Use it.
	* elf/Makefile (libdl.so): Use it.
	* configure.in (libc_cv_ld_no_whole_archive): New check for
	--no-whole-archive.
	* config.make.in (have-no-whole-archive): New variable.

	* stdio-common/printf_fp.c: Increase fudge factor for BIGNUM_SIZE calc
	from 3 to 4.

	* Make-dist: Include version.mk.
	(version, release): Variables removed.
	* Makeconfig (version.mk): New target.

Fri Apr 19 01:42:18 1996  Ulrich Drepper  <drepper@cygnus.com>

	* locale/Makefile (headers): Add langinfo.h.
	(CPPFLAGS): Remove -Iliblib.
1996-04-20 00:05:25 +00:00
Roland McGrath f24f4dc82d Mon Apr 15 16:49:04 1996 Roland McGrath <roland@whiz-bang.gnu.ai.mit.edu>
* malloc/memalign.c, malloc/malloc.h [__DJGPP__ == 1]: Elide memalign
	function and its declaration.
1996-04-16 01:18:23 +00:00
Per Bothner 147e600987 * config.guess: Combine two OSF1 rules. Also recognize field test versions. From mjr@zk3.dec.com. * config.guess (dgux): Use /usr/bin/uname rather than uname, because GNU uname does not support -p. From pmr@pajato.com. 1996-04-13 00:06:54 +00:00
487 changed files with 15758 additions and 3650 deletions
+961
View File
@@ -1,3 +1,964 @@
Wed May 8 20:04:29 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* extract-dynsym: New file.
* Makefile (distribute): Add it.
* Rules (subdir_install): Depend on $(common-objpfx)sor-$(subdir).
[! libc.so-version]: Clear static-only-routines.
($(common-objpfx)sor-$(subdir)): New target.
[static-only-routines]: New static pattern rule for these .so's.
* Makerules [libc.so-version] ($(slibdir)/libc.so): Target removed.
[libc.so-version] ($(libdir)/libc.so, $(common-objpfx)libc-syms.so):
New targets replace it.
(install) [libc.so-version]: Depend on $(libdir)/libc.so instead of
$(slibdir)/libc.so.
* io/Makefile (static-only-routines): New variable.
* configure.in: Check for tools objdump and objcopy, and for awk.
* config.make.in (OBJDUMP, OBJCOPY, AWK): New variables.
Thu May 9 01:24:00 1996 Ulrich Drepper <drepper@cygnus.com>
* locale/programs/config.h: Remove definition of wint_t.
* locale/programs/ld-collate.c: Include <wchar.h> instead of
<wcstr.h>.
* manual/time.texi: Add some more description for %U and %W
format of strftime. Describe new format %V of strftime.
* resolv/gethnamaddr.c: Prevent warning by preventing variable
definition.
* stdio-common/_itoa.c: Ditto.
Tue May 7 23:43:07 1996 Ulrich Drepper <drepper@cygnus.com>
* libio/clearerr.c, libio/feof.c, libio/ferror.c, libio/fgetc.c,
libio/fileno.c, libio/fputc.c, libio/freopen.c, libio/fseek.c,
libio/genops.c, libio/getc.c, libio/getchar.c, libio/iofclose.c,
libio/iofflush.c, libio/iofgetpos.c, libio/iofgets.c,
libio/iofputs.c, libio/iofread.c, libio/iofsetpos.c,
libio/ioftell.c, libio/iofwrite.c, libio/iogetdelim.c,
libio/iogets.c, libio/ioputs.c, libio/iosetbuffer.c,
libio/iosetvbuf.c, libio/ioungetc.c, libio/iovsprintf.c,
libio/libio.h, libio/putc.c, libio/putchar.c, libio/rewind.c,
libio/stdio.h, stdio-common/printf_fp.c, stdio-common/vfprintf.c,
stdio-common/vfscanf.c: Prepare for reentrent libio.
* libio/clearerr_u.c, libio/feof_u.c, libio/ferror_u.c,
libio/fputc_u.c, libio/getc_u.c, libio/getchar_u.c,
libio/iofflush_u.c, libio/putc_u.c, libio/putchar_u.c: New files.
Used in reentrent libio.
* misc/getusershell.c: Prevent warnings.
Wed May 8 12:08:35 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* Makerules (install-lib.so rules): Undouble $s in target and dep
parts of o-iterator-doit defns.
(unversioned libraries install rule): Fix pattern.
* mach/Makefile (mach-src-headers): Use $(base-machine) instead of
$(config-machine).
($(includedir)/machine): Likewise.
* config.make.in (base-machine): New variable.
* configure.in (machine): Move case stmt to set $machine out of sysdep
dirs AC_CACHE_CHECK.
(base_machine): New variable, set in that switch and AC_SUBST'd.
* Makerules (stub-$(subdir)): Use file name in directory as output,
since cmd is cd'd.
* configure.in (MSGFMT): Use : if none found.
* po/Makefile: Include ../Rules instead of ../Makerules.
Tue May 7 23:18:44 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* po/Makefile: New file.
* Makefile (subdirs): Add po.
* configure.in: Check for msgfmt.
* config.make.in (MSGFMT): New variable.
Sun May 5 23:49:10 1996 Ulrich Drepper <drepper@cygnus.com>
* misc/Makefile (routines): Add swapoff.
* sysdeps/unix/sysv/linux/Dist: Add sys/quota.h.
* sysdeps/unix/sysv/linux/sys/quota.h: New file. Wrapper around
kernel header file.
Tue May 7 19:00:01 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* string/argz-extract.c: Remove const from decl.
* string/argz.h: Here too.
* Makeconfig (version.mk): Fix regexp in sed cmd.
Depend on $(..)Makeconfig.
* GMP code updated from gmp-2.0 release.
* stdlib/Makefile (mpn-routines): Removed add_1, added inlines.
* sysdeps/generic/add_1.c: File removed.
* stdlib/strtod.c: mp_limb is now mp_limb_t.
* stdlib/fpioconst.c, stdlib/fpioconst.h: Likewise.
* stdio-common/_itoa.c: Likewise.
* stdio-common/printf_fp.c: Likewise.
Don't include ansidecl.h.
* sysdeps/mach/hurd/getcwd.c: Use io_identity instead of io_stat.
* shlib-versions: New file.
* Makerules (soversions.mk): New target, include file generated from
shlib-versions. Moved shared library rules before installation rules.
Rewrote shared library installation rules for versioned libraries.
* math/Makefile (libm.so-version): Variable removed.
* sysdeps/mach/hurd/i386/exc2signal.c: Use struct hurd_signal_detail.
* hurd/report-wait.c (_S_msg_describe_ports): New function.
* configure.in: Add AC_PROG_LN_S check.
* config.make.in (LN_S): New variable.
Sun May 5 03:10:44 1996 Ulrich Drepper <drepper@cygnus.com>
* misc/efgcvt_r.c (ecvt_r): Work aroung gcc bug. gcc does
not know about weak aliases now and optimizes necessary `if'
statement away.
* posix/unistd.h: Add swapoff prototype.
* sysdeps/generic/confname.h: Add even more POSIX.4 symbols.
* sysdeps/posix/fpathconf.c (__fpathconf): Get information
for _PC_PATH_MAX from fstatfs function if available.
* sysdeps/posix/sysconf.c: Add code to handle _SC_AIO_LISTIO_MAX,
_SC_AIO_MAX, _SC_AIO_PRIO_DELTA_MAX, _SC_DELAYTIMER_MAX,
_SC_MQ_OPEN_MAX, _SC_MQ_PRIO_MAX, _SC_RTSIG_MAX,
_SC_SEM_NSEMS_MAX, _SC_SEM_VALUE_MAX, _SC_SIGQUEUE_MAX, and
_SC_TIMER_MAX.
* sysdeps/unix/sysv/sysv4/sysconf.c: Ditto.
* sysdeps/stub/swapoff.c: New file. Stub version for swapoff
function.
* sysdeps/unix/syscalls.list: Add swapoff.
* sysdeps/unix/sysv/linux/Dist: Add sys/acct.h.
* sysdeps/unix/sysv/linux/Makefile [$(subdir) == misc]
(sysdep_routines): Add mount, umount, llseek, setfsgid, setfsuid,
sysinfo, and uselib.
(headers): Add sys/sysinfo.h.
* sysdeps/unix/sysv/linux/gethostid.c: Prevent warning.
* sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) == misc]
(sysdep_routines): Add ioperm, iopl, and vm86.
(headers): Add sys/perm.h and sys/vm86.h.
* sysdeps/unix/sysv/linux/i386/sys/perm.h: New file. Contains
prototypes for iopl and ioperm.
* sysdeps/unix/sysv/linux/i386/sys/vm86.h: New file. Contains
prototype for vm86.
* sysdeps/unix/sysv/linux/i386/syscalls.list: New file. Add
vm86 system call.
* sysdeps/unix/sysv/linux/sys/acct.h: New file. Contains
prototypes for acct function.
* sysdeps/unix/sysv/linux/sys/socket.h: Provide real header
file with prototypes.
* sysdeps/unix/sysv/linux/sys/sysinfo.h: New file. Contains
prototype for sysinfo function.
* sysdeps/unix/sysv/linux/syscalls.list: Add flock, ioperm, iopl,
llseek, setfsgid, setfsuid, sysinfo, and uselib.
* sysdeps/unix/sysv/linux/sysconf.c: Instead of duplicating
posix/sysconf.c now only handle cases different to that
implementation.
Tue May 7 15:08:19 1996 Miles Bader <miles@gnu.ai.mit.edu>
* stdio/linewrap.c (__line_wrap_output): Renamed from lwoutput
(all references changed). Now exported.
* stdio/linewrap.c (struct data): Type deleted (moved to linewrap.h).
(wrap_stream, unwrap_stream, lwclose, lwfileno, lwoutput,
line_wrap_stream, line_unwrap_stream): Use struct line_wrap_data
instead of struct data.
(lwoutput, line_wrap_stream, line_unwrap_stream): Rename various
occurences of `wrap' and `wrapmargin' to `wmargin'.
(line_wrapped, line_wrap_lmargin, line_wrap_set_lmargin,
line_wrap_rmargin, line_wrap_set_rmargin, line_wrap_wmargin,
line_wrap_set_wmargin, line_wrap_point): New functions.
* stdio/linewrap.h: New file.
* stdio/Makefile (headers): Add linewrap.h.
Tue May 7 14:19:12 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* sysdeps/unix/sysv/linux/i386/Makefile: File removed.
* stdio/stdio.h: Remove line_wrap_stream, line_unwap_stream decls.
* sysdeps/unix/sysv/linux/schedbits.h: New file.
Tue May 7 13:47:02 1996 Miles Bader <miles@gnu.ai.mit.edu>
* stdio/linewrap.c (struct data): Make margin fields not-pointers.
(lwoutput): Adjust uses acordingly.
Tue May 7 10:51:52 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* sysdeps/mach/hurd/fdatasync.c: New file.
* sysdeps/mach/hurd/fsync.c: Pass new flag to file_sync.
* sysdeps/mach/hurd/xmknod.c: Pass new flag to dir_link.
* sysdeps/mach/hurd/symlink.c: Likewise.
* sysdeps/mach/hurd/link.c: Likewise.
* sysdeps/mach/hurd/bind.c: Likewise.
* hurd/hurdsig.c (write_corefile): Likewise.
* hurd/hurdsig.c (write_corefile): Pass cttyid port to crash server.
* sysdeps/mach/hurd/fpathconf.c: RPC takes int pointer, not long int.
* sysdeps/mach/hurd/_exit.c (_hurd_exit): Pass sigcode arg to
proc_mark_exit.
* sysdeps/mach/hurd/dl-sysdep.c (_exit): Likewise.
* sysdeps/mach/hurd/wait4.c: Pass sigcode arg to proc_wait.
* sysdeps/mach/hurd/rename.c: Pass new flag to dir_rename.
* hurd/hurdfault.c (_hurdsig_fault_catch_exception_raise): Use struct
hurd_signal_detail.
* hurd/catch-exc.c (_S_catch_exception_raise): Likewise.
* hurd/hurd-raise.c (_hurd_raise_signal): Likewise.
* sysdeps/mach/hurd/i386/trampoline.c (_hurd_setup_sighandler):
Likewise.
* sysdeps/mach/hurd/setitimer.c (restart_itimer): Likewise.
* hurd/hurd/signal.h: Fix _hurd_exception2signal prototype.
* hurd/hurdsig.c (write_corefile): Take const struct
hurd_signal_detail * arg. Pass all details to crash_dump_task.
(_hurd_internal_post_signal): Pass DETAIL to write_corefile.
(_hurd_internal_post_signal: suspend): Pass code and error to
proc_mark_stop.
* hurd/hurdprio.c (_hurd_priority_which_map): Pass flags arg to
proc_getprocinfo by reference.
* wcsmbs/wcwidth.c, wcsmbs/wcswidth.c: Fixed typos.
* sysdeps/unix/sysv/linux/sys/mman.h: Fixed typo.
* sysdeps/stub/sched_getp.c: Add missing #include <sys/types.h>.
* sysdeps/stub/sched_sets.c: Likewise.
* sysdeps/stub/sched_setp.c: Likewise.
* sysdeps/stub/sched_rr_gi.c: Likewise.
* sysdeps/stub/sched_gets.c: Likewise.
* hurd/hurdsig.c: Use struct hurd_signal_detail.
* hurd/hurd/fd.h (_hurd_fd_error): Likewise.
* sysdeps/mach/hurd/sysd-stdio.c (fd_fail): Likewise.
Mon May 6 09:51:05 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* stdio/linewrap.c: New file.
* stdio/Makefile (routines): Add linewrap.
* stdio/stdio.h [__USE_GNU]: Declare line_wrap_stream,
line_unwrap_stream.
Mon May 6 14:53:26 1996 Ulrich Drepper <drepper@cygnus.com>
* time/strftime.c (week): Add third parameter telling how
many days must be in new year so that it is called week 1.
(Following ISO 8601).
Correct computation for %U and %V formats when day was first
day of the week.
(strftime): Implement %V format according to Spec1170.
Mon May 6 17:01:09 1996 Michael I. Bushnell, p/BSG <mib@gnu.ai.mit.edu>
* hurd/hurd/signal.h (_hurd_intr_rpc_mach_msg): New declaration.
Sat May 4 05:44:25 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* hurd/hurd/sigpreempt.h (struct hurd_signal_preempter): Change
prototype of `preempter' elt to use struct hurd_signal_detail.
* hurd/hurd/signal.h (struct hurd_signal_detail): New type.
(struct hurd_sigstate): Make `pending_data' member an array of that.
Use the new type in several decls.
* locale/setlocale.c (_nl_C_name): Variable removed.
* locale/C_name.c: New file.
(_nl_C_name): Put it here instead.
* locale/Makefile (aux): Add C_name.
* sysdeps/mach/hurd/dl-sysdep.c (open): Don't pass io port in
auth_user_authenticate rpc.
(open): Avoid using strtol in digit conversion for "fd/N" magic.
(_dl_sysdep_start): Likewise for memobj name in magic switches.
* elf/Makefile (reloc-link): New variable.
(dl-allobjs.so): New target, link together $(rtld-routines).
(librtld.so): Depend on that instead of the rtld components.
(generated): Add dl-allobjs.so.
* hurd/hurd-raise.c (_hurd_raise_signal): Pass sigcode in msg_sig_post
rpc.
* hurd/hurdmsg.c (_S_msg_set_environment): Use argz.h functions
instead of _hurd_split_args.
(_S_msg_*_exec_flags): Functions removed.
(_S_msg_startup_dosync): Stub removed.
Sat May 4 02:11:55 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* sysdeps/mach/hurd/ptrace.c: Set _hurdsig_traced instead of
EXEC_TRACED bit in _hurd_exec_flags.
Pass sigcode arg in msg_sig_post_untraced rpc.
* sysdeps/mach/hurd/access.c: Don't pass io port in
auth_user_authenticate rpc.
* posix/sched.h: Fix typos.
* sysdeps/mach/hurd/fork.c: Use new critical section lock.
Clear _hurdsig_traced instead of EXEC_TRACED.
* sysdeps/stub/nanosleep.c (nanosleep): Fix typo.
* wcsmbs/wcstol.c: Find strtol.c in ../stdlib.
* wcsmbs/wcstof.c: Find strtod.c in ../stdlib.
* wcsmbs/wcstod.c: Likewise.
* wcsmbs/wcstold.c: Likewise.
* wcsmbs/wcwidth.h: Find cname-lookup.h in ../wctype.
* string/envz.c (envz_entry): Use const.
(envz_get, envz_remove): Likewise.
(envz_entry): Return char *, not const char *.
* string/envz.h: Fix decl.
* string/argz-create.c: Use const in prototype.
* string/argz-next.c: Likewise.
Fri May 3 13:32:08 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* sysdeps/mach/hurd/sigprocmask.c: Pass sigcode arg to msg_sig_post.
* sysdeps/mach/hurd/i386/sigreturn.c: Likewise.
* sysdeps/mach/hurd/sigsuspend.c: Likewise.
* sysdeps/mach/hurd/kill.c: Likewise.
* hurd/hurdexec.c (_hurd_exec): Use new critical section lock.
* hurd/catch-exc.c (_S_catch_exception_raise): Likewise.
* hurd/sigunwind.c (_hurdsig_longjmp_from_handler): Likewise.
* hurd/thread-cancel.c (hurd_thread_cancel, hurd_check_cancel):
Likewise.
* sysdeps/mach/hurd/jmp-unwind.c (_longjmp_unwind): Likewise.
* sysdeps/mach/hurd/sigaction.c: Likewise.
* sysdeps/mach/hurd/errnos.awk: Don't use ARGV in comment; it can
change meaninglessly.
* hurd/hurd/signal.h (struct hurd_sigstate): Replace critical section
flag with a spin lock.
(_hurd_critical_section_lock): Use spin_try_lock on that to see if we
get it. No need to take SS->lock at all.
(_hurd_critical_section_unlock): Unlock SS->critical_section_lock
instead of clearing the old flag member.
* hurd/hurdsig.c (_hurd_internal_post_signal): Use spin_lock_locked to
test the critical section state.
* hurd/hurdinit.c (_hurd_init): Set _hurdsig_traced from the intarray.
* hurd/hurdkill.c (_hurd_sig_post): Pass 0 sigcode in msg_sig_post.
* hurd/hurdsig.c (_hurd_internal_post_signal): Test _hurdsig_traced
instead of testing (_hurd_exec_flags & EXEC_TRACED).
(_S_msg_sig_post): Take sigcode arg and pass it through.
(_S_msg_sig_post_untraced): Likewise.
(reauth_proc): Don't pass proc port in auth_user_authenticate.
* hurd/setauth.c (_hurd_setauth): Don't pass object ports in
auth_user_authenticate RPCs, just the one-off rendezvous port.
* hurd/dtable.c (reauth_dtable): Likewise.
* hurd/hurdlookup.c (__hurd_file_name_lookup_retry): Likewise.
* hurd/hurdexec.c (_hurd_exec): Pass 0 flags to file_exec.
Pass sigcode arg to msg_sig_post.
* string/argz.h (argz_create): Use const in prototype.
* hurd/hurdinit.c (_hurd_proc_init): Test _hurdsig_traced instead of
testing (_hurd_exec_flags & EXEC_TRACED).
Pass sigcode arg to msg_sig_post.
* hurd/hurd.h: Declare _hurdsig_traced.
* string/argz.h (__argz_next): Cast ENTRY before returning it.
* hurd/hurd/signal.h (_hurd_critical_section_unlock): Pass sigcode arg
to msg_sig_post.
* hurd/path-lookup.c: New file.
* hurd/Makefile (routines): Add path-lookup.
* hurd/hurd/lookup.h: Declare file_name_path_scan,
hurd_file_name_path_lookup.
* hurd/hurd.h: Declare file_name_path_lookup.
* sysdeps/mach/hurd/select.c: The io_select rpc no longer has a TAG_ID
argument. Instead, use a separate reply port for each RPC and put them
all in a port set to wait for slow replies.
* intl/Makefile (CPPFLAGS): Change $(nlsdir) to $(i18ndir) in
LOCALE_ALIAS_PATH.
Fri May 3 03:14:02 1996 Ulrich Drepper <drepper@cygnus.com>
* intl/Makefile (routines): Add l10nflist and explodename.
(distribute): Add loadinfo.h and locale.alias.
(install-others): New variable to install locale.alias.
* intl/dcgettext.c, intl/finddomain.c, intl/gettextP.h,
intl/loadmsgcat.c: Adapt for upcoming gettext-0.10.13. Some code
is now shared with the locale implementation.
* intl/explodename.c, intl/l10nflist.c, intl/loadinfo.h: New file.
Extracted from finddomain.c. This is also used in the locale
implementation.
* intl/locale.alias: New file. Locale alias database compatible
with X Window System's locale alias file. Can now be used in
locale and gettext code.
* libio/stdio.h: Add prototypes for asprint and vasprintf.
* locale/C-collate.c, locale/C-ctype.c, locale/C-messages.c,
locale/C-monetary.c, locale/C-numeric.c, locale/C-time.c: Add new
field in structure with name of locale ("C" in this case).
* locale/Makefile (routines): Add findlocale.
* locale/findlocale.c: New file. Instead of trying to load the
directly described file we now try to be much smarter when this
fails. Use the same code as gettext does.
* locale/loadlocale.c, locale/setlocale.c: Rewrite to know about
new loading scheme.
* locale/localeinfo.h: Adapt prototypes and declarations for new
setlocale implementation. Remove definition of u32_t type. We
now use u_int32_t from <sys/types.h>.
* locale/programs/charset.h (ILLEGAL_CHAR_VALUE): Provide type
with constant.
* locale/programs/config.h, locale/lc-collate.c,
locale/localeinfo.h, locale/programs/ld-collate.c,
locale/programs/ld-ctype.c, locale/programs/ld-messages.c,
locale/programs/ld-monetary.c, locale/programs/ld-numeric.c,
locale/programs/ld-time.c, locale/weight.h, string/strcoll.c:
Change to use u_int32_t and u_int16_t.
* locale/programs/localedef.c (construct_output_path): Change name
of output locale to contain normalized form of the character set
portion.
* string/Makefile (routines): Add agrz-ctsep and argz-next.
(tests): Add tst-strlen.
* string/argz-ctsep.c: New file. Implement reverse operation
from argz-stringify.
* string/argz-next.c: Non-inline version of function from argz.h.
* string/argz.h, string/envz.h: Make usable as global header file.
* string/envz.c: Fix declarations to use size_t where prototypes
say so.
* string/tst-strlen.c: New file. Another test for critical
situation in strlen implementations.
* sysdeps/i386/i586/strlen.S: Fix bug with highest byte in word
being zero.
* wctype/test_wctype.c: Fix controlling comparison after change to
32 bit character class array.
Fri May 3 12:53:12 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* sysdeps/unix/sysv/linux/sys/socket.h: Remove spurious doubled line.
Thu May 2 22:50:52 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/sysv/linux/getpriority.c: New file.
* sysdeps/unix/sysv/linux/syscalls.list: Add s_getpriority.
Thu May 2 22:41:31 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/sysv/linux/m68k/fpu_control.h (_FPU_DEFAULT):
Disable all exceptions.
Thu May 2 22:33:14 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/m68k/fpu/e_acos.c, sysdeps/m68k/fpu/e_acosf.c,
sysdeps/m68k/fpu/e_fmod.c, sysdeps/m68k/fpu/e_fmodf.c,
sysdeps/m68k/fpu/isinfl.c, sysdeps/m68k/fpu/isnanl.c,
sysdeps/m68k/fpu/s_atan.c, sysdeps/m68k/fpu/s_atanf.c,
sysdeps/m68k/fpu/s_frexp.c, sysdeps/m68k/fpu/s_frexpf.c,
sysdeps/m68k/fpu/s_ilogb.c, sysdeps/m68k/fpu/s_ilogbf.c,
sysdeps/m68k/fpu/s_isinf.c, sysdeps/m68k/fpu/s_isinff.c,
sysdeps/m68k/fpu/s_ldexp.c, sysdeps/m68k/fpu/s_ldexpf.c,
sysdeps/m68k/fpu/s_modf.c, sysdeps/m68k/fpu/s_modff.c: Don't
define __NO_MATH_INLINES, which is already defined on command
line.
Thu May 2 22:18:28 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/libm-ieee754/e_j0f.c (__ieee754_j0f, __ieee754_y0f):
Replace 0x80000000 by 0x48000000.
* sysdeps/libm-ieee754/e_j1f.c (__ieee754_j1f): Likewise.
Thu May 2 21:30:33 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sunrpc/svc_simple.c: Make global variable pl local to
registerrpc.
Thu May 2 00:24:04 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* time/Makefile (tz-cflags): New variable.
(CFLAGS-tzfile.c): New variable.
(CFLAGS-zic.c): Add $(tz-cflags).
(tz-cc): Remove variable.
($(objpfx)tzfile.o, $(objpfx)zic.o): Remove targets.
Wed May 1 09:10:04 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* sysdeps/mach/hurd/getcwd.c: Jump out of both loops when we find a
name, instead of checking for reaching end of buffer, which happens
when the match is the last entry in the buffer.
* time/strftime.c: Use canonical autoconf nugget for time.h+sys/time.h
include.
Mon Apr 29 02:48:26 1996 Ulrich Drepper <drepper@cygnus.com>
* ctype/ctype-info.c: (__ctype_width): New variable.
(__ctype_names): Initialize correctly without offset.
* locale/C-collate.c, locale/C-ctype.c,
locale/C-messages.c, locale/C-monetary.c,
locale/C-numeric.c, locale/C-time.c: Change copyright.
* locale/C-ctype.c (_nl_C_LC_CTYPE_class32): Correct
endianess for initialization value.
* locale/lc-ctype.c (current): Add parameter for offset.
(__ctype32_b, __ctype_width): Add initialization for these
variables.
* locale/programs/charmap.c: Finish support for WIDTH information.
(new_width): New function.
* locale/programs/charset.h (width_rule): new data structure.
(charset_t): Add elements for width information.
* locale/programs/ld-ctype.c (locale_ctype_t): Add element
for width information.
(allocate_arrays): Add new argument for charset.
(ctype_finish): Make sure all characters named in charset
width table are known to name table.
(ctype_output): Correct handling of class and map name
information and write out width information.
(find_idx): Prepare for being called with NULL pointer as
TABLE argument. This means only allocate name entry.
(allocate_arrays): Correct handling of array element -1.
Because EOF == -1 the value of element 127 must *not* be
mirrored here.
Fill width information from charset tables.
* locale/programs/localedef.c (main): Correct loop over all
categories after change of order from Thu Mar 28 14:22:51 1996.
Add new charset argument to call of `write_all_categories'.
* locale/programs/locales.h (ctype_finish, ctype_output): New
charset argument.
* locale/programs/locfile.c (write_all_categories): Call
`ctype_output' with additional argument charset.
* posix/getconf.c (vars): Add _POSIX_SYNC_IO, _POSIX_ASYNC_IO,
and _POSIX_PRIO_IO definitions.
* posix/posix2_lim.h: Add definition of _POSIX2_CHARCLASS_NAME_MAX
and CHARCLASS_NAME_MAX.
* posix/unistd.h: Document _POSIX_SYNC_IO, _POSIX_ASYNC_IO,
and _POSIX_PRIO_IO.
* stdlib/grouping.h: Prepare for use in wide string functions.
* stdlib/stdlib.h: Correct prototypes for __strto*_internal
functions.
* stdlib/strtod.c: Extend for use as `wcsto{f,d,ld}'.
* stdlib/strtol.c: Extend for use as `wcsto{l,ul,q,uq}'.
* string/strcoll.c: Extend for use as `wcscoll'.
* string/strxfrm.c: Extend for use as `wcsxfrm'.
* sysdeps/generic/confname.h: Add definition of _PC_SYNC_IO,
_PC_ASYNC_IO, _PC_PRIO_IO and _SC_CHARCLASS_NAME_MAX.
* sysdeps/generic/stpncpy.c: Correct return value.
* sysdeps/posix/fpathconf.c: Add handling of _PC_SYNC_IO,
_PC_ASYNC_IO, and _PC_PRIO_IO.
* sysdeps/posix/sysconf.c: Add handling of _SC_REALTIME_SIGNALS,
_SC_PRIORITY_SCHEDULING, _SC_TIMERS, _SC_ASYNCHRONOUS_IO,
_SC_PRIORITIZED_IO, _SC_SYNCHRONIZED_IO, _SC_FSYNC,
_SC_MAPPED_FILES, _SC_MEMLOCK, _SC_MEMLOCK_RANGE,
_SC_MEMORY_PROTECTION, _SC_MESSAGE_PASSING, _SC_SEMAPHORES,
_SC_SHARED_MEMORY_OBJECTS, and _SC_CHARCLASS_NAME_MAX.
* sysdeps/stub/sysconf.c: Ditto.
* sysdeps/unix/sysv/sysv4/sysconf.c: Ditto.
* sysdeps/unix/sysv/linux/Dist: Add sys/sysctl.h.
* sysdeps/unix/sysv/linux/Makefile [subdir == misc]
(sysdep_routines): Add s_sysctl and sysctl.
* sysdeps/unix/sysv/linux/sys/mman.h: Add declaration of mremap.
* sysdeps/unix/sysv/linux/sys/socket.h: New file. Wrapper
around kernel header.
* sysdeps/unix/sysv/linux/sys/sysctl.h: New file. Define
interface to `sysctl' function.
* sysdeps/unix/sysv/linux/syscalls.list: Add mremap and _sysctl.
* sysdeps/unix/sysv/linux/sysconf.c: Add handling of
_SC_CHARCLASS_NAME_MAX.
* sysdeps/unix/sysv/linux/sysctl.c: new file. Implement caller
of _sysctl system call.
* sysvipc/Makefile (routines): Add ftok.
* sysvipc/ftok.c: use variable `proj_id' not `id'. Patch by
David Mosberger-Tang.
* wcsmbs/Makefile (routines): Add wcpcpy, wcpncpy, wcstol,
wcstoul, wcstoq, wcstouq, wcstod, wcstold, wcstof, wcscoll,
wcsxfrm, wcwidth, and wcswidth.
* wcsmbs/wchar.h: Add declarations for wcpcpy, wcpncpy, wcstol,
wcstoul, wcstoq, wcstouq, wcstod, wcstold, wcstof, wcscoll,
wcsxfrm, wcwidth, and wcswidth.
Declare internal interfaces for wcsto* functions.
[OPTIMIZE]: Define inline functions for wcsto* functions to
call internal interface functions.
* wcsmbs/wcpcpy.c, wcsmbs/wcpncpy.c: New files. Implement non-
standard function equivalent to stpcpy/stpncpy.
* wcsmbs/wcscoll.c: Implement `wcscoll' function by using
`strcoll' implementation.
* wcsmbs/wcscpy.c, wcsmbs/wcsncpy.c: Use wint_t instead of
wchar_t.
* wcsmbs/wcstod.c: Implement `wcstod' function by using `strtod'
implementation.
* wcsmbs/wcstof.c: Same for `wcstof'.
* wcsmbs/wcstold.c: Same for `strtold'.
* wcsmbs/wcstol.c: Implement `wcstol' function by using `strtol'
implementation.
* wcsmbs/wcstoq.c: Same for `wcstoq'.
* wcsmbs/wcstoul.c: Same for `wcstoul'.
* wcsmbs/wcstouq.c: Same for `wcstouq'.
* wcsmbs/wcswidth.c: Implement `wcswidth' function from X/Open
CAE.
* wcsmbs/wcwidth.c: Ditto for `wcwidth'.
* wcsmbs/wcwidth.h: Common function for definitions of above two
functions.
* wcsmbs/wcsxfrm.c: Implement `wcsxfrm function by using
`strxfrm implementation.
* wctype/wctype.c: Remove case for `wctype_t' being 16 bit type.
* wctype/wctype.h (wint_t): Protect against multiple definition.
(wctype_t): Always define as `unsigned long int'.
* wctype.h: New file. Wrapper around wctype/wctype.h.
Tue Apr 30 17:30:46 1996 Miles Bader <miles@gnu.ai.mit.edu>
* hurd/hurdsig.c (_hurdsig_abort_rpcs): Add timeout argument to
interrupt_operation call.
(_hurdsig_interrupt_timeout): New variable.
* hurd/report-wait.c (describe_number): Correctly allocate space
in DESCRIPTION for the digits in I.
Mon Apr 29 00:11:59 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* hurd/hurdstartup.c (_hurd_split_args): Function removed.
(_hurd_startup): Use argz functions.
* hurd/hurdexec.c: Use argz functions.
* errno.h [!__error_t_defined] (error_t): New type.
* sysdeps/mach/hurd/errnos.awk: #define __error_t_defined after the
typedef in errnos.h.
* string/envz.c, string/envz.h: New files.
* string/argz.h, string/argz-append.c, string/argz-count.c,
string/argz-create.c, string/argz-delete.c, string/argz-extract.c,
string/argz-insert.c, string/argz-stringify.c: New files.
* string/Makefile (routines): Add envz, argz-*.
(headers): Add argz.h, envz.h.
Sun Apr 28 14:14:35 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* sysdeps/unix/sysv/linux/i386/Makefile: New file.
Wed Apr 24 17:35:30 Ulrich Drepper <drepper@cygnus.com>
* inet/netinet/in.h, socket/sys/socket.h: Move to
sysdeps/generic/netinet/in.h, sysdeps/generic/sys/socket.h.
* netinet/in.h, sys/socket.h: Remove file.
* misc/Makefile (routines): Add fdatasync.
* posix/Makefile (headers): Add sched.h.
(routines): Add nanosleep, sched_setp, sched_getp, sched_sets,
sched_gets, sched_yield, sched_primax, sched_primin, sched_rr_gi.
* posix/getconf.c (vars): Add entries for _POSIX_REALTIME_SIGNALS,
_POSIX_PRIORITY_SCHEDULING, _POSIX_TIMERS, _POSIX_ASYNCHRONOUS_IO,
_POSIX_PRIORITIZED_IO, _POSIX_SYNCHRONIZED_IO, _POSIX_FSYNC,
_POSIX_MAPPED_FILES, _POSIX_MEMLOCK, _POSIX_MEMLOCK_RANGE,
_POSIX_MEMORY_PROTECTION, _POSIX_MESSAGE_PASSING,
_POSIX_SEMAPHORES, _POSIX_SHARED_MEMORY_OBJECTS.
* posix/sched.h: New file. Header for POSIX scheduling interface.
* posix/unistd.h: Describe options from POSIX.4.
Add declaration of fdatasync.
* sysdeps/generic/confname.h: Add definition for
_SC_REALTIME_SIGNALS, _SC_PRIORITY_SCHEDULING, _SC_TIMERS,
_SC_ASYNCHRONOUS_IO, _SC_PRIORITIZED_IO, _SC_SYNCHRONIZED_IO,
_SC_FSYNC, _SC_MAPPED_FILES, _SC_MEMLOCK, _SC_MEMLOCK_RANGE,
_SC_MEMORY_PROTECTION, _SC_MESSAGE_PASSING,
_SC_SEMAPHORES, _SC_SHARED_MEMORY_OBJECTS.
* sysdeps/generic/fdatasync.c: New file. Default implementation
simply uses fsync.
* sysdeps/generic/netinit/in.h: Moved to here from inet/netinet/in.h.
* sysdeps/generic/schedbits.h: New file. System dependent
defintion for POSIX.4 scheduling interface.
* sysdeps/generic/sys/socket.h: Moved to here from socket/sys/socket.h.
* sysdeps/stub/nanosleep.c, sysdeps/stub/sched_getp.c,
sysdeps/stub/sched_gets.c, sysdeps/stub/sched_primax.c,
sysdeps/stub/sched_primin.c, sysdeps/stub/sched_rr_gi.c,
sysdeps/stub/sched_setp.c, sysdeps/stub/sched_sets.c,
sysdeps/stub/sched_yield.c: New file: Stub implementation
for systems missing these POSIX.4 system calls.
* sysdeps/unix/sysv/linux/gnu/types.h,
sysdeps/unix/sysv/linux/ioctls.h: Use kernel header for
data type definitions.
* sysdeps/unix/sysv/linux/netinet/in.h: New file. Linux
specific version.
* sysdeps/unix/sysv/linux/posix_opt.h: New file. Define POSIX
options applicable for Linux.
* sysdeps/unix/sysv/linux/syscalls.list: Add definitions for
fdatasync, nanosleep, sched_setparam, sched_getparam,
sched_setscheduler, sched_getscheduler, sched_yield,
sched_get_priority_max, sched_get_priority_min, and
sched_rr_get_interval.
* sysdeps/unix/sysv/linux/sysconf.c: Add handling of POSIX.4
options.
* sysdeps/unix/sysv/linux/termbits.h: Use kernel headers.
* time/sys/time.h: Remove definition of `struct timespec'.
* time/time.h (struct timespec): Move definition to here.
Fri Apr 26 01:55:07 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* malloc/mcheck.c (mabort): Use __libc_fatal only #ifdef _LIBC.
Thu Apr 25 15:49:57 1996 Miles Bader <miles@gnu.ai.mit.edu>
* sysdeps/mach/hurd/getcwd.c (__getcwd): When we find a match in
the scan for a name, avoid doing another readdir (which overwrites
NENTRIES, and was resulting in a bogus ENOENT).
* sysdeps/mach/hurd/fcntl.c (__fcntl): Add missing break after F_SETFL.
Wed Apr 24 00:22:42 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* stdio/internals.c (seek_to_target): Set errno if seek function
returns the wrong offset.
* wcsmbs/wcsrtombs.c [! EILSEQ] (EILSEQ): Define to EINVAL.
* wcsmbs/wcrtomb.c: Likewise.
* stdio-common/vfprintf.c: Include errno.h.
Tue Apr 23 21:09:14 1996 Miles Bader <miles@gnu.ai.mit.edu>
* hurd/hurdsig.c (signal_allowed): For SIGIO/SIGURG, add a new
variable, LUCKY, to use instead of setting D to -1 (which fouls
things up).
Tue Apr 23 15:56:56 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* config.h.in (HAVE_REGEX): New macro.
* sysdeps/unix/syscalls.list: Add statfs, fstatfs.
* io/Makefile (headers): Add sys/statfs.h, statfsbuf.h.
(routines): Add statfs, fstatfs.
* sysdeps/mach/hurd/statfs.c: New file.
* sysdeps/mach/hurd/fstatfs.c: New file.
* sysdeps/stub/fstatfs.c: New file.
* sysdeps/stub/statfs.c: New file.
* io/sys/statfs.h: New file.
* sysdeps/generic/statfsbuf.h: New file.
* sysdeps/unix/sysv/linux/statfsbuf.h: New file.
Tue Apr 23 00:06:47 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* malloc/Makefile (gmalloc-routines): Add valloc back here.
(dist-routines): Remove it here.
* malloc/valloc.c [_MALLOC_INTERNAL && GMALLOC_INHIBIT_VALLOC]
(ELIDE_VALLOC): Define it.
[! ELIDE_VALLOC]: Make whole file conditional on this.
* malloc/malloc.h (valloc): Make decl conditional on
[!GMALLOC_INHIBIT_VALLOC] instead of [!emacs].
Mon Apr 22 00:02:19 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* MakeTAGS: Include version.mk.
(po/SYS_libc.pot): Add missing / in sed s cmd.
Sat Apr 20 18:13:00 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* Makerules (no-whole-archive): Test $(have-no-whole-archive), not
$(libc_cv_ld_no_whole_archive).
Sat Apr 20 17:07:17 1996 Ulrich Drepper <drepper@cygnus.com>
* assert/assert.h, ctype/ctype.h, dirent/dirent.h, errno.h,
grp/grp.h, io/fcntl.h, io/sys/stat.h, io/utime.h, locale/locale.h,
math/math.h, misc/nlist.h, misc/sgtty.h, misc/sys/file.h,
misc/sys/ioctl.h, misc/sys/uio.h, posix/sys/times.h,
posix/sys/types.h, posix/sys/utsname.h, posix/sys/wait.h,
posix/tar.h, posix/wordexp.h, pwd/pwd.h, resource/sys/vlimit.h,
resource/sys/vtimes.h, setjmp/setjmp.h, signal/signal.h,
stdio-common/printf.h, stdlib/alloca.h, stdlib/stdlib.h,
string/string.h, sysdeps/generic/sigaction.h,
sysdeps/generic/sigset.h, sysdeps/generic/sys/ptrace.h,
sysdeps/generic/sys/ptrace.h, sysdeps/unix/bsd/osf/sigaction.h,
sysdeps/unix/sysv/linux/sys/ptrace.h,
sysdeps/unix/sysv/minix/sigaction.h,
sysdeps/unix/sysv/sco3.2.4/sigaction.h,
sysdeps/unix/sysv/sysv4/sigaction.h,
sysdeps/unix/sysv/sysv4/sigset.h, termios/termios.h,
time/sys/time.h, time/time.h: Fix copyright comment.
Fri Apr 19 00:49:44 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* sysdeps/generic/dl-sysdep.c (_dl_sysdep_start): If uids and gids are
not given in stack aux vector, fetch them with syscalls.
* stdlib/rpmatch.c (rpmatch: try): Take new arg NOMATCH, return value
for nonmatching nonerror (instead of !MATCH).
(rpmatch): Use it, so we return -1 when NOEXPR doesn't match either.
* resolv/getnetnamadr.c (getnetbyaddr): Use u_int32_t instead of
unsigned long for variable NET2.
* time/etcetera, time/europe, time/solar89: Updated from ADO's 96e.
Tue Apr 9 14:37:31 1996 Ulrich Drepper <drepper@cygnus.com>
* catgets/Makefile, catgets/catgets.c, catgets/catgetsinfo.h,
catgets/config.h, catgets/gencat.c, catgets/nl_types.h,
catgets/open_catalog.c: New files. Implementation of XPG4
compliant catgets() function and needed tools.
* Makefile (subdirs): Add catgets.
Thu Apr 18 23:36:11 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* math/Makefile (CPPFLAGS): Append -D__NO_MATH_INLINES.
Wed Apr 10 20:48:43 1996 Ulrich Drepper <drepper@cygnus.com>
* stdio-common/vfprintf.c: Correct some typos.
* sysdeps/libm-ieee754/w_gammaf.c, sysdeps/libm-ieee754/w_lgamma.c,
sysdeps/libm-ieee754/w_lgammaf.c: Reference signgam instead of
__signgam.
Thu Apr 18 21:07:27 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* Makerules (no-whole-archive): New variable.
(build-shlib): Use it.
* elf/Makefile (libdl.so): Use it.
* configure.in (libc_cv_ld_no_whole_archive): New check for
--no-whole-archive.
* config.make.in (have-no-whole-archive): New variable.
* stdio-common/printf_fp.c: Increase fudge factor for BIGNUM_SIZE calc
from 3 to 4.
* Make-dist: Include version.mk.
(version, release): Variables removed.
* Makeconfig (version.mk): New target.
Fri Apr 19 01:42:18 1996 Ulrich Drepper <drepper@cygnus.com>
* locale/Makefile (headers): Add langinfo.h.
(CPPFLAGS): Remove -Iliblib.
Mon Apr 15 16:49:04 1996 Roland McGrath <roland@whiz-bang.gnu.ai.mit.edu>
* malloc/memalign.c, malloc/malloc.h [__DJGPP__ == 1]: Elide memalign
function and its declaration.
Wed Apr 10 14:13:45 1996 Miles Bader <miles@gnu.ai.mit.edu>
* hurd/sigunwind.c (_hurdsig_longjmp_from_handler): Store
+1 -5
View File
@@ -105,11 +105,7 @@ foo:=$(shell echo '+tsrcs=$(+tsrcs)'>&2)
foo:=$(shell echo foobie, dammit! >&2)
ifndef tardir
rel+vers := $(shell sed -n -e 's/^.*RELEASE.*\"\([^"]*\)";$$/\1/p' \
-e 's/^.*VERSION.*\"\([^"]*\)";$$/\1/p' \
< $(..)version.h)
release := $(word 1,$(rel+vers))
version := $(word 2,$(rel+vers))
-include $(common-objpfx)version.mk
export tardir := glibc-$(version)
endif
+4 -1
View File
@@ -162,10 +162,13 @@ $P/subdirs.pot: $(subdirs:%=$P/%.pot)
do sed "s%^#: %&$$d/%" $P/$$d.pot; done) > $@.new
mv -f $@.new $@
# Get $(version) defined.
include $(common-objpfx)version.mk
# Combine all the messages into the final sorted template translation file.
$P/SYS_libc.pot: $(all-pot)
@rm -f $@.new
sed -e 's/VERSION/$(version)/' -e "s/DATE/`date +'%Y-%m-%d %k:%M'`" \
sed -e 's/VERSION/$(version)/' -e "s/DATE/`date +'%Y-%m-%d %k:%M'`/" \
po/header.pot > $@.new
$(XGETTEXT) -d - -n -s --omit-header $^ >> $@.new
mv -f $@.new $@
+7
View File
@@ -468,6 +468,13 @@ cross-compiling := yes
else
cross-compiling := no
endif
# Figure out the version numbers from version.h.
$(common-objpfx)version.mk: $(..)version.h $(..)Makeconfig
sed -n -e 's/^.*RELEASE.*"\([^"]*\)".*$$/release=\1/p' \
-e 's/^.*VERSION.*"\([^"]*\)".*$$/version=\1/p' \
< $< > $@-new
mv -f $@-new $@
endif # Makeconfig not yet included
+3 -2
View File
@@ -51,10 +51,10 @@ sysdep-subdirs := $(subst $(\n), ,$(sysdep-subdirs))
endif
# These are the subdirectories containing the library source.
subdirs = csu assert ctype db locale intl math setjmp signal stdlib \
subdirs = csu assert ctype db locale intl catgets math setjmp signal stdlib \
stdio-common $(stdio) malloc string wcsmbs time dirent grp pwd\
posix io termios resource misc socket sysvipc gmon gnulib \
wctype $(wildcard crypt) manual $(sysdep-subdirs) elf
wctype $(wildcard crypt) manual $(sysdep-subdirs) elf po
export subdirs := $(subdirs) # Benign, useless in GNU make before 3.63.
# The mach and hurd subdirectories have many generated header files which
@@ -225,6 +225,7 @@ distribute := README INSTALL NOTES COPYING.LIB COPYING NEWS \
Makefile Makeconfig Makerules Rules Make-dist MakeTAGS \
extra-lib.mk o-iterator.mk \
ansidecl.h mkinstalldirs move-if-change install-sh \
extract-dynsym \
configure configure.in aclocal.m4 config.sub config.guess\
config.make.in config-name.in Makefile.in \
munch-tmpl.c munch.awk sysdep.h set-hooks.h libc-symbols.h
+131 -44
View File
@@ -428,6 +428,71 @@ $(AR) cru$(verbose) $(@:$(objpfx)%=%) \
$(RANLIB) $@
endef
# Shared library building.
ifeq (yes,$(build-shared))
# Process the shlib-versions file, which tells us what shared library
# version numbers to use when we install shared objects on this system.
-include $(common-objpfx)soversions.mk
$(common-objpfx)soversions.mk: $(..)shlib-versions $(..)Makerules \
$(common-objpfx)config.make
sed 's/#.*$$//' $< | while read conf versions; do \
test -n "$$versions" || continue; \
case '$(config-machine)-$(config-vendor)-$(config-os)' in $$conf)\
for v in $$versions; do \
lib="$${v%%=*}"; if eval "test -z \"\$$vers_lib$$lib\""; then \
eval vers_lib$${lib}=yes; \
echo $$lib.so-version=.$${v##$$lib=}; fi; \
done ;; esac; done > $@T
mv -f $@T $@
# Get $(version) defined with the release version number.
-include $(common-objpfx)version.mk
# Pattern rule to build a shared object from an archive of PIC objects.
# This must come after the installation rules so Make doesn't try to
# build shared libraries in place from the installed *_pic.a files.
# $(LDLIBS-%.so) may contain -l switches to generate run-time dependencies
# on other shared objects.
lib%.so: lib%_pic.a; $(build-shlib)
ifeq ($(have-no-whole-archive),yes)
no-whole-archive = -Wl,--no-whole-archive
else
no-whole-archive =
endif
define build-shlib
$(LINK.o) -shared -o $@ $(sysdep-LDFLAGS) $(config-LDFLAGS) \
-Wl,-soname=lib$(libprefix)$(@F:lib%.so=%).so$($(@F)-version) \
$(LDFLAGS.so) $(LDFLAGS-$(@F:lib%.so=%).so) \
-Wl,-rpath-link=$(common-objdir) \
-Wl,--whole-archive $^ $(no-whole-archive) \
$(LDLIBS-$(@F:lib%.so=%).so)
endef
# Don't try to use -lc when making libc.so itself.
# Also omits crti.o and crtn.o, which we do not want
# since we define our own `.init' section specially.
LDFLAGS-c.so = -nostdlib -nostartfiles
# Give libc.so an entry point and make it directly runnable itself.
LDFLAGS-c.so += -e __libc_print_version
# Use our own special initializer and finalizer files for libc.so.
elfobjdir := $(firstword $(objdir) $(..)elf)
$(common-objpfx)libc.so: $(elfobjdir)/soinit.so \
$(common-objpfx)libc_pic.a \
$(elfobjdir)/sofini.so
$(build-shlib)
ifdef libc.so-version
$(common-objpfx)libc.so$(libc.so-version): $(common-objpfx)libc.so
rm -f $@
ln -s $(<F) $@ || ln $< $@
endif
endif
# Installation.
# $(install-lib) are installed from the object directory into $(libdir);
@@ -483,13 +548,72 @@ endef
install-lib.so := $(filter %.so,$(install-lib:%_pic.a=%.so))
install-lib := $(filter-out %.so %_pic.a,$(install-lib))
ifeq (yes,$(build-shared))
install-lib-nosubdir: $(foreach so,$(install-lib.so),\
$(libdir)/$(patsubst $(libprefix)lib%,lib$(libprefix)%,\
$(libprefix)$(so))$($(so)-version))
install: $(slibdir)/libc.so$(libc.so-version)
$(slibdir)/lib$(libprefix)c.so$(libc.so-version): $(common-objpfx)libc.so
$(do-install-so)
install-lib-nosubdir: $(install-lib.so:%=$(libdir)/%)
# Find which .so's have versions.
versioned := $(foreach so,$(install-lib.so),\
$(patsubst %,$(so),$($(so)-version)))
# Install all the unversioned shared libraries.
$(addprefix $(libdir)/,$(filter-out $(versioned),$(install-lib.so))): \
$(libdir)/%.so: $(objpfx)%.so; $(do-install-program)
make-link = cd $(@D); rm -f $(@F); $(LN_S) $(<F) $(@F)
ifdef libc.so-version
# For a library specified to be version N, install three files:
# libc.so -> libc.so.N (e.g. libc.so.6)
# libc.so.6 -> libc-VERSION.so (e.g. libc-1.10.so)
$(slibdir)/libc.so$(libc.so-version): $(slibdir)/libc-$(version).so
$(make-link)
$(slibdir)/libc-$(version).so: $(common-objpfx)libc.so; $(do-install-program)
# What we install as libc.so for programs to link against is in fact an
# archive. It contains the various $(static-only-routines) objects, and
# the special object libc-syms.so that contains just the dynamic symbol
# table of the shared libc object.
install: $(libdir)/libc.so
$(libdir)/libc.so: $(common-objpfx)libc-syms.so subdir_install
$(AR) crvs $@ $< `cat $(addprefix $(common-objpfx)sor-,$(subdirs))`
# Extract from the shared object file just the dynamic symbol table
# needed to link against the shared library.
$(common-objpfx)libc-syms.so: $(common-objpfx)libc.so
AWK='$(AWK)' OBJCOPY='$(OBJCOPY)' OBJDUMP='$(OBJDUMP)' \
./extract-dynsym $< $@
ifndef subdir
generated += libc-syms.so
endif
else
install: $(slibdir)/libc.so
$(slibdir)/libc.so: $(common-objpfx)libc.so; $(do-install-program)
endif
ifneq (,$(versioned))
# Produce three sets of rules as above for all the smaller versioned libraries.
define o-iterator-doit
$(libdir)/$o: $(libdir)/$o$($o-version); $$(make-link)
endef
object-suffixes-left := $(versioned)
include $(..)o-iterator.mk
define o-iterator-doit
$(libdir)/$o$($o-version): $(libdir)/$(o:.so=)-$(version).so; $$(make-link)
endef
object-suffixes-left := $(versioned)
include $(..)o-iterator.mk
define o-iterator-doit
$(libdir)/$(o:.so=)-$(version).so: $(objpfx)$o; $$(do-install-program)
endef
object-suffixes-left := $(versioned)
include $(..)o-iterator.mk
endif
define do-install-so
$(do-install-program)
@@ -561,43 +685,6 @@ install-no-libc.a-nosubdir: install-headers-nosubdir install-data-nosubdir\
install-others-nosubdir install-sbin-nosubdir
install: install-no-libc.a-nosubdir
ifeq (yes,$(build-shared))
# Pattern rule to build a shared object from an archive of PIC objects.
# This must come after the installation rules so Make doesn't try to
# build shared libraries in place from the installed *_pic.a files.
# $(LDLIBS-%.so) may contain -l switches to generate run-time dependencies
# on other shared objects.
lib%.so: lib%_pic.a; $(build-shlib)
define build-shlib
$(LINK.o) -shared -o $@ $(sysdep-LDFLAGS) $(config-LDFLAGS) \
-Wl,-soname=lib$(libprefix)$(@F:lib%.so=%).so$($(@F)-version) \
$(LDFLAGS.so) $(LDFLAGS-$(@F:lib%.so=%).so) \
-Wl,-rpath-link=$(common-objdir) \
-Wl,--whole-archive $^ $(LDLIBS-$(@F:lib%.so=%).so)
endef
# Don't try to use -lc when making libc.so itself.
# Also omits crti.o and crtn.o, which we do not want
# since we define our own `.init' section specially.
LDFLAGS-c.so = -nostdlib -nostartfiles
# Give libc.so an entry point and make it directly runnable itself.
LDFLAGS-c.so += -e __libc_print_version
# Use our own special initializer and finalizer files for libc.so.
elfobjdir := $(firstword $(objdir) $(..)elf)
$(common-objpfx)libc.so: $(elfobjdir)/soinit.so \
$(common-objpfx)libc_pic.a \
$(elfobjdir)/sofini.so
$(build-shlib)
ifdef libc.so-version
$(common-objpfx)libc.so$(libc.so-version): $(common-objpfx)libc.so
rm -f $@
ln -s $(<F) $@ || ln $< $@
endif
endif
# Command to compile $< in $(objdir) using the native libraries.
define native-compile
cwd=`pwd`; cd $(@D); $(BUILD_CC) $(BUILD_CFLAGS) \
@@ -673,7 +760,7 @@ $(common-objpfx)stub-$(subdir): $(+depfiles)
sed -n 's/^stub_warning *(\([^)]*\).*$$/#define __stub_\1/p' \
`sed -n 's@^.*$s/\([a-z0-9_-]*\.c\).*$$@'"$$s"/'\1@p' \
$(patsubst $(objpfx)%,%,$^) /dev/null` \
/dev/null > $@T
/dev/null > $(@F)T
mv -f $@T $@
# Make the distribution tar file.
+27 -1
View File
@@ -122,7 +122,33 @@ subdir_echo-distinfo:
# our portions of the library because the parent make will install it later
# (likewise the stubs file).
.PHONY: subdir_install
subdir_install: install-no-libc.a lib-noranlib stubs
subdir_install: install-no-libc.a lib-noranlib stubs \
$(common-objpfx)sor-$(subdir)
ifdef objpfx
sor-objpfx = $(objpfx:../%=%)
else
sor-objpfx = $(subdir)
endif
ifndef libc.so-version
# Undefine this because it can't work when we libc.so is unversioned.
static-only-routines =
endif
# This communicates to the parent during install the set of routines that
# need to be put into the special libc.so archive.
$(common-objpfx)sor-$(subdir): Makefile
echo $(static-only-routines:%=$(sor-objpfx)%.o) > $@T
mv -f $@T $@
ifdef static-only-routines
# These routines are to be omitted from the shared library object,
# so we replace the PIC objects for them with the dummy object file.
$(static-only-routines:%=$(objpfx)%.so): %.so: $(common-objpfx) dummy.so
rm -f $@
ln $< $@
endif
.PHONY: subdir_TAGS subdir_dist
subdir_TAGS: TAGS
+1
View File
@@ -0,0 +1 @@
#include <string/argz.h>
+2 -3
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992, 1994, 1995 Free Software Foundation, Inc.
/* Copyright (C) 1991, 92, 94, 95, 96 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
@@ -13,7 +13,7 @@ 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, 1992 Free Software Foundation, Inc., 675 Mass Ave,
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
/*
@@ -95,4 +95,3 @@ __END_DECLS
#endif /* NDEBUG. */
+41
View File
@@ -0,0 +1,41 @@
# Copyright (C) 1996 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.
#
# Makefile for catgets.
#
subdir := catgets
headers = nl_types.h
distribute = catgetsinfo.h config.h
routines = catgets open_catalog
others = gencat
install-bin = gencat
gencat-modules = xmalloc
# To find xmalloc.c
vpath %.c ../locale/programs
include ../Rules
$(objpfx)gencat: $(gencat-modules:%=$(objpfx)%.o)
CPPFLAGS := -DNLSPATH='"$(localedir)/%L/%N:$(localedir)/%L/LC_MESSAGES/%N:"' \
-DHAVE_CONFIG_H $(CPPFLAGS)
+163
View File
@@ -0,0 +1,163 @@
/* Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
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 <alloca.h>
#include <nl_types.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/mman.h>
#include "catgetsinfo.h"
/* Open the catalog and return a descriptor for the catalog. */
nl_catd
catopen (const char *cat_name, int flag)
{
__nl_catd result;
const char *env_var;
result = (__nl_catd) malloc (sizeof (__nl_catd));
if (result == NULL)
/* We cannot get enough memory. */
return (nl_catd) -1;
result->status = closed;
result->cat_name = strdup (cat_name);
if (result->cat_name == NULL)
{
free (result);
return (nl_catd) -1;
}
if (strchr (cat_name, '/') == NULL)
{
if (flag == NL_CAT_LOCALE)
{
env_var = getenv ("LC_ALL");
if (env_var == NULL)
{
env_var = getenv ("LC_MESSAGES");
if (env_var == NULL)
{
env_var = getenv ("LANG");
if (env_var == NULL)
env_var = "C";
}
}
}
else
{
env_var = getenv ("LANG");
if (env_var == NULL)
env_var = "C";
}
result->env_var = strdup (env_var);
if (result->env_var == NULL)
{
free ((void *) result->cat_name);
free ((void *) result);
return (nl_catd) -1;
}
if (getenv ("NLSPATH") != NULL)
result->nlspath = strdup (getenv ("NLSPATH"));
else
result->nlspath = strdup (NLSPATH);
if (result->nlspath == NULL)
{
free ((void *) result->cat_name);
free ((void *) result->env_var);
free ((void *) result);
return (nl_catd) -1;
}
}
else
{
result->env_var = NULL;
result->nlspath = NULL;
}
return (nl_catd) result;
}
/* Return message from message catalog. */
char *
catgets (nl_catd catalog_desc, int set, int message, const char *string)
{
__nl_catd catalog;
size_t idx;
size_t cnt;
/* Be generous if catalog which failed to be open is used. */
if (catalog_desc == (nl_catd) -1 || ++set <= 0 || message < 0)
return (char *) string;
catalog = (__nl_catd) catalog_desc;
if (catalog->status == closed)
__open_catalog (catalog, 1);
if (catalog->status == nonexisting)
return (char *) string;
idx = ((set * message) % catalog->plane_size) * 3;
cnt = 0;
do
{
if (catalog->name_ptr[idx + 0] == (u_int32_t) set
&& catalog->name_ptr[idx + 1] == (u_int32_t) message)
return (char *) &catalog->strings[catalog->name_ptr[idx + 2]];
idx += catalog->plane_size * 3;
}
while (++cnt < catalog->plane_depth);
return (char *) string;
}
/* Return resources used for loaded message catalog. */
int
catclose (nl_catd catalog_desc)
{
__nl_catd catalog;
catalog = (__nl_catd) catalog_desc;
if (catalog->status == mmaped)
munmap ((void *) catalog->file_ptr, catalog->file_size);
else if (catalog->status == malloced)
free ((void *) catalog->file_ptr);
else if (catalog->status != closed && catalog->status != nonexisting)
return -1;
if (catalog->nlspath)
free ((void *) catalog->nlspath);
if (catalog->env_var)
free ((void *) catalog->env_var);
free ((void *) catalog);
return 0;
}
+59
View File
@@ -0,0 +1,59 @@
/* Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
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 <sys/types.h>
struct catalog_obj
{
u_int32_t magic;
u_int32_t plane_size;
u_int32_t plane_depth;
/* This is in fact two arrays in one: always a pair of name and
pointer into the data area. */
u_int32_t name_ptr[0];
};
/* This structure will be filled after loading the catalog. */
typedef struct catalog_info
{
enum { closed, nonexisting, mmaped, malloced } status;
const char *cat_name;
const char *env_var;
const char *nlspath;
size_t plane_size;
size_t plane_depth;
u_int32_t *name_ptr;
const char *strings;
struct catalog_obj *file_ptr;
size_t file_size;
} *__nl_catd;
/* The magic number to signal we really have a catalog file. */
#define CATGETS_MAGIC 0x960408de
/* Prototypes for helper functions. */
void __open_catalog (__nl_catd __catalog, int __with_path);
+14
View File
@@ -0,0 +1,14 @@
#ifndef _CG_CONFIG_H
#define _CG_CONFIG_H
/* Use the internal textdomain used for libc messages. */
#define PACKAGE _libc_intl_domainname
#ifndef VERSION
/* Get libc version number. */
#include "../version.h"
#endif
#include_next <config.h>
#endif
+1030
View File
File diff suppressed because it is too large Load Diff
+48
View File
@@ -0,0 +1,48 @@
/* Copyright (C) 1996 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. */
#ifndef _NL_TYPES_H
#define _NL_TYPES_H 1
#include <features.h>
/* The default message set used by the gencat program. */
#define NL_SETD 1
/* Value for FLAG parameter of `catgets' to say we want XPG4 compliance. */
#define NL_CAT_LOCALE 1
/* Message catalog descriptor type. */
typedef void *nl_catd;
__BEGIN_DECLS
/* Open message catalog for later use, returning descriptor. */
extern nl_catd catopen __P ((__const char *__cat_name, int __flag));
/* Return translation with NUMBER in SET of CATALOG; if not found
return STRING. */
extern char *catgets __P ((nl_catd __catalog, int __set, int __number,
__const char *__string));
/* Close message CATALOG. */
extern int catclose __P ((nl_catd __catalog));
__END_DECLS
#endif /* nl_types.h */
+263
View File
@@ -0,0 +1,263 @@
/* Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
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 <endian.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include "catgetsinfo.h"
#define SWAPU32(w) \
(((w) << 24) | (((w) & 0xff00) << 8) | (((w) >> 8) & 0xff00) | ((w) >> 24))
void
__open_catalog (__nl_catd catalog, int with_path)
{
int fd;
struct stat st;
int swapping;
if (strchr (catalog->cat_name, '/') != NULL || !with_path)
fd = open (catalog->cat_name, O_RDONLY);
else
{
const char *run_nlspath = catalog->nlspath;
#define ENOUGH(n) \
if (bufact + (n) >=bufmax) \
{ \
char *old_buf = buf; \
bufmax += 256 + (n); \
buf = (char *) alloca (bufmax); \
memcpy (buf, old_buf, bufact); \
}
/* The RUN_NLSPATH variable contains a colon separated list of
descriptions where we expect to find catalogs. We have to
recognize certain % substitutions and stop when we found the
first existing file. */
char *buf;
size_t bufact;
size_t bufmax;
buf = NULL;
bufmax = 0;
fd = -1;
while (*run_nlspath != '\0')
{
bufact = 0;
while (*run_nlspath != ':' && *run_nlspath != '\0')
if (*run_nlspath == '%')
{
const char *tmp;
++run_nlspath; /* We have seen the `%'. */
switch (*run_nlspath++)
{
case 'N':
/* Use the catalog name. */
ENOUGH (strlen (catalog->cat_name));
bufact = stpcpy (&buf[bufact], catalog->cat_name) - buf;
break;
case 'L':
/* Use the current locale category value. */
ENOUGH (strlen (catalog->env_var));
bufact = stpcpy (&buf[bufact], catalog->env_var) - buf;
break;
case 'l':
/* Use language element of locale category value. */
tmp = catalog->env_var;
do
{
ENOUGH (1);
buf[bufact++] = *tmp++;
}
while (*tmp != '\0' && *tmp != '_' && *tmp != '.');
break;
case 't':
/* Use territory element of locale category value. */
tmp = catalog->env_var;
do
++tmp;
while (*tmp != '\0' && *tmp != '_' && *tmp != '.');
if (*tmp == '_')
{
++tmp;
do
{
ENOUGH (1);
buf[bufact++] = *tmp;
}
while (*tmp != '\0' && *tmp != '.');
}
break;
case 'c':
/* Use code set element of locale category value. */
tmp = catalog->env_var;
do
++tmp;
while (*tmp != '\0' && *tmp != '.');
if (*tmp == '.')
{
++tmp;
do
{
ENOUGH (1);
buf[bufact++] = *tmp;
}
while (*tmp != '\0');
}
break;
case '%':
ENOUGH (1);
buf[bufact++] = '%';
break;
default:
/* Unknown variable: ignore this path element. */
bufact = 0;
while (*run_nlspath != '\0' && *run_nlspath != ':')
++run_nlspath;
break;
}
}
else
{
ENOUGH (1);
buf[bufact++] = *run_nlspath++;
}
ENOUGH (1);
buf[bufact] = '\0';
if (bufact != 0)
{
fd = open (buf, O_RDONLY);
if (fd >= 0)
break;
}
++run_nlspath;
}
}
if (fd < 0 || fstat (fd, &st) < 0)
{
catalog->status = nonexisting;
return;
}
#ifndef MAP_COPY
/* Linux seems to lack read-only copy-on-write. */
#define MAP_COPY MAP_PRIVATE
#endif
#ifndef MAP_FILE
/* Some systems do not have this flag; it is superfluous. */
#define MAP_FILE 0
#endif
#ifndef MAP_INHERIT
/* Some systems might lack this; they lose. */
#define MAP_INHERIT 0
#endif
catalog->file_size = st.st_size;
catalog->file_ptr =
(struct catalog_obj *) mmap (NULL, st.st_size, PROT_READ,
MAP_FILE|MAP_COPY|MAP_INHERIT, fd, 0);
if (catalog->file_ptr != (struct catalog_obj *) -1)
/* Tell the world we managed to mmap the file. */
catalog->status = mmaped;
else
{
/* mmap failed perhaps because the system call is not
implemented. Try to load the file. */
size_t todo;
catalog->file_ptr = malloc (st.st_size);
if (catalog->file_ptr == NULL)
{
catalog->status = nonexisting;
return;
}
todo = st.st_size;
/* Save read, handle partial reads. */
do
{
size_t now = read (fd, (((char *) &catalog->file_ptr)
+ (st.st_size - todo)), todo);
if (now == 0)
{
free ((void *) catalog->file_ptr);
catalog->status = nonexisting;
return;
}
todo -= now;
}
while (todo > 0);
catalog->status = malloced;
}
/* We don't need the file anymore. */
close (fd);
/* Determine whether the file is a catalog file and if yes whether
it is written using the correct byte order. Else we have to swap
the values. */
if (catalog->file_ptr->magic == CATGETS_MAGIC)
swapping = 0;
else if (catalog->file_ptr->magic == SWAPU32 (CATGETS_MAGIC))
swapping = 1;
else
{
/* Illegal file. Free he resources and mark catalog as not
usable. */
if (catalog->status == mmaped)
munmap ((void *) catalog->file_ptr, catalog->file_size);
else
free (catalog->file_ptr);
catalog->status = nonexisting;
return;
}
#define SWAP(x) (swapping ? SWAPU32 (x) : (x))
/* Get dimensions of the used hashing table. */
catalog->plane_size = SWAP (catalog->file_ptr->plane_size);
catalog->plane_depth = SWAP (catalog->file_ptr->plane_depth);
/* The file contains two versions of the pointer tables. Pick the
right one for the local byte order. */
#if __BYTE_ORDER == __LITTLE_ENDIAN
catalog->name_ptr = &catalog->file_ptr->name_ptr[0];
#elif __BYTE_ORDER == __BIG_ENDIAN
catalog->name_ptr = &catalog->file_ptr->name_ptr[catalog->plane_size
* catalog->plane_depth
* 3];
#else
# error Cannot handle __BYTE_ORDER byte order
#endif
/* The rest of the file contains all the strings. They are
addressed relative to the position of the first string. */
catalog->strings =
(const char *) &catalog->file_ptr->name_ptr[catalog->plane_size
* catalog->plane_depth * 3 * 2];
}
+6 -8
View File
@@ -51,15 +51,13 @@ trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
alpha:OSF1:[VX]*:*)
# After 1.2, OSF1 uses "V1.3" for uname -r.
# After 4.x, OSF1 uses "X4.x" for uname -r.
echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VX]//'`
exit 0 ;;
alpha:OSF1:*:*)
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo alpha-dec-osf${UNAME_RELEASE}
exit 0 ;;
echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//'`
exit 0 ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
exit 0 ;;
@@ -138,7 +136,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
exit 0 ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`uname -p`
UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88100 ] ; then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
-o ${TARGET_BINARY_INTERFACE}x = x ] ; then
+4
View File
@@ -71,4 +71,8 @@
#define HAVE_STRERROR 1
/* The locale code needs these definitions. */
#define HAVE_REGEX 1
#endif
+8
View File
@@ -8,6 +8,7 @@ exec_prefix = @exec_prefix@
# System configuration.
config-machine = @host_cpu@
base-machine = @base_machine@
config-vendor = @host_vendor@
config-os = @host_os@
config-sysdirs = @sysnames@
@@ -17,6 +18,8 @@ config-defines = @DEFS@
elf = @elf@
have-initfini = @libc_cv_have_initfini@
have-no-whole-archive = @libc_cv_ld_no_whole_archive@
# Configuration options.
gnu-as = @gnu_as@
gnu-ld = @gnu_ld@
@@ -30,10 +33,15 @@ CC = @CC@
AR = @AR@
RANLIB = @RANLIB@
AS = $(CC) -c
OBJDUMP = @OBJDUMP@
OBJCOPY = @OBJCOPY@
AWK = @AWK@
# Installation tools.
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
LN_S = @LN_S@
MSGFMT = @MSGFMT@
# More variables may be inserted below by configure.
Vendored
+115 -33
View File
@@ -2,7 +2,7 @@
# From configure.in CVSid
# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.9
# Generated automatically using autoconf version 2.10
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
@@ -353,7 +353,7 @@ EOF
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
echo "configure generated by autoconf version 2.9"
echo "configure generated by autoconf version 2.10"
exit 0 ;;
-with-* | --with-*)
@@ -725,34 +725,35 @@ alpha*-linux*)
gnu_ld=no elf=no ;;
esac
# Compute the list of sysdep directories for this configuration.
sysdep_dir=$srcdir/sysdeps
echo $ac_n "checking sysdep dirs""... $ac_c" 1>&4
if eval "test \"`echo '$''{'libc_cv_sysdirs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
machine=$config_machine
machine=$config_machine
vendor=$config_vendor
os=$config_os
# Expand the configuration machine name into a subdirectory by architecture
# type and particular chip.
case "$machine" in
a29k | am29000) machine=a29k ;;
alpha*) machine=alpha/$machine ;;
hppa*) machine=hppa/$machine ;;
i[345]86) machine=i386/$machine ;;
m680?0) machine=m68k/$machine ;;
m68k) machine=m68k/m68020 ;;
m88???) machine=m88k/$machine ;;
m88k) machine=m88k/m88100 ;;
mips*) machine=mips/$machine ;;
mips64*) machine=mips/mips64/$machine ;;
sparc[6789]) machine=sparc/$machine ;;
supersparc) machine=sparc/sparc8 ;;
a29k | am29000) base_machine=a29k machine=a29k ;;
alpha*) base_machine=alpha machine=alpha/$machine ;;
hppa*) base_machine=hppa machine=hppa/$machine ;;
i[345]86) base_machine=i386 machine=i386/$machine ;;
m680?0) base_machine=m68k machine=m68k/$machine ;;
m68k) base_machine=m68k machine=m68k/m68020 ;;
m88???) base_machine=m88k machine=m88k/$machine ;;
m88k) base_machine=m88k machine=m88k/m88100 ;;
mips*) base_machine=mips machine=mips/$machine ;;
mips64*) base_machine=mips64 machine=mips/mips64/$machine ;;
sparc[6789]) base_machine=sparc machine=sparc/$machine ;;
supersparc) base_machine=sparc machine=sparc/sparc8 ;;
esac
# Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1.
# Compute the list of sysdep directories for this configuration.
sysdep_dir=$srcdir/sysdeps
echo $ac_n "checking sysdep dirs""... $ac_c" 1>&4
if eval "test \"`echo '$''{'libc_cv_sysdirs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
# 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'`"
case "$os" in
@@ -981,6 +982,59 @@ if test "$INSTALL" = "${srcdir}/install-sh"; then
# The makefiles need to use a different form to find it in $srcdir.
INSTALL='$(..)./install-sh'
fi
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&4
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
rm -f conftestdata
if ln -s X conftestdata 2>/dev/null
then
rm -f conftestdata
ac_cv_prog_LN_S="ln -s"
else
ac_cv_prog_LN_S=ln
fi
fi
LN_S="$ac_cv_prog_LN_S"
if test "$ac_cv_prog_LN_S" = "ln -s"; then
echo "$ac_t""yes" 1>&4
else
echo "$ac_t""no" 1>&4
fi
for ac_prog in msgfmt gmsgfmt
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>&4
if eval "test \"`echo '$''{'ac_cv_prog_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
if test -n "$MSGFMT"; then
ac_cv_prog_MSGFMT="$MSGFMT" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_MSGFMT="$ac_prog"
break
fi
done
IFS="$ac_save_ifs"
fi
fi
MSGFMT="$ac_cv_prog_MSGFMT"
if test -n "$MSGFMT"; then
echo "$ac_t""$MSGFMT" 1>&4
else
echo "$ac_t""no" 1>&4
fi
test -n "$MSGFMT" && break
done
test -n "$MSGFMT" || MSGFMT=":"
echo $ac_n "checking build system type""... $ac_c" 1>&4
@@ -1143,13 +1197,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 1147 "configure"
#line 1201 "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:1153: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1207: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -1158,13 +1212,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
#line 1162 "configure"
#line 1216 "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:1168: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1222: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -1213,7 +1267,7 @@ if eval "test \"`echo '$''{'libc_cv_friendly_stddef'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
cat > conftest.$ac_ext <<EOF
#line 1217 "configure"
#line 1271 "configure"
#include "confdefs.h"
#define __need_size_t
#define __need_wchar_t
@@ -1229,7 +1283,7 @@ size_t size; wchar_t wchar;
if (&size == NULL || &wchar == NULL) abort ();
; return 0; }
EOF
if { (eval echo configure:1233: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:1287: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libc_cv_friendly_stddef=yes
else
@@ -1336,7 +1390,7 @@ if eval "test \"`echo '$''{'libc_cv_have_initfini'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
cat > conftest.$ac_ext <<EOF
#line 1340 "configure"
#line 1394 "configure"
#include "confdefs.h"
int main() { return 0; }
@@ -1345,7 +1399,7 @@ asm (".section .init");
asm (".section .fini");
; return 0; }
EOF
if { (eval echo configure:1349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:1403: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libc_cv_have_initfini=yes
else
@@ -1373,7 +1427,7 @@ if eval "test \"`echo '$''{'libc_cv_asm_underscores'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
cat > conftest.$ac_ext <<EOF
#line 1377 "configure"
#line 1431 "configure"
#include "confdefs.h"
asm ("_glibc_foobar:");
int main() { return 0; }
@@ -1381,7 +1435,7 @@ int t() {
glibc_foobar ();
; return 0; }
EOF
if { (eval echo configure:1385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
if { (eval echo configure:1439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
rm -rf conftest*
libc_cv_asm_underscores=yes
else
@@ -1464,6 +1518,24 @@ EOF
fi
echo $ac_n "checking for ld --no-whole-archive""... $ac_c" 1>&4
if eval "test \"`echo '$''{'libc_cv_ld_no_whole_archive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&4
else
cat > conftest.c <<\EOF
main () { exit (0); }
EOF
if ${CC-cc} $CFLAGS -Wl,--no-whole-archive \
-o conftest conftest.c 2>/dev/null; then
libc_cv_ld_no_whole_archive=yes
else
libc_cv_ld_no_whole_archive=no
fi
rm -f conftest*
fi
echo "$ac_t""$libc_cv_ld_no_whole_archive" 1>&4
### End of automated tests.
### Now run sysdeps configure fragments.
@@ -1665,7 +1737,7 @@ do
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
echo "$CONFIG_STATUS generated by autoconf version 2.9"
echo "$CONFIG_STATUS generated by autoconf version 2.10"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
@@ -1711,9 +1783,12 @@ s%@host_alias@%$host_alias%g
s%@host_cpu@%$host_cpu%g
s%@host_vendor@%$host_vendor%g
s%@host_os@%$host_os%g
s%@base_machine@%$base_machine%g
s%@sysnames@%$sysnames%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@LN_S@%$LN_S%g
s%@MSGFMT@%$MSGFMT%g
s%@build@%$build%g
s%@build_alias@%$build_alias%g
s%@build_cpu@%$build_cpu%g
@@ -1724,6 +1799,7 @@ s%@AR@%$AR%g
s%@RANLIB@%$RANLIB%g
s%@CPP@%$CPP%g
s%@libc_cv_have_initfini@%$libc_cv_have_initfini%g
s%@libc_cv_ld_no_whole_archive@%$libc_cv_ld_no_whole_archive%g
s%@uname_sysname@%$uname_sysname%g
s%@uname_release@%$uname_release%g
s%@uname_version@%$uname_version%g
@@ -1886,6 +1962,12 @@ cat >> $CONFIG_STATUS <<\EOF
echo "$ac_file is unchanged"
rm -f conftest.h
else
# Remove last slash and all that follows it. Not all systems have dirname.
ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
# The file is in a subdirectory.
test ! -d "$ac_dir" && mkdir "$ac_dir"
fi
rm -f $ac_file
mv conftest.h $ac_file
fi
+39 -17
View File
@@ -1,6 +1,6 @@
Dnl Process this file with autoconf to produce a configure script.
AC_REVISION([$CVSid$])
AC_PREREQ(2.9)dnl dnl Minimum Autoconf version required.
AC_PREREQ(2.10)dnl dnl Minimum Autoconf version required.
AC_INIT(features.h)
AC_CONFIG_HEADER(config.h)
@@ -95,9 +95,6 @@ alpha*-linux*)
gnu_ld=no elf=no ;;
esac
# Compute the list of sysdep directories for this configuration.
sysdep_dir=$srcdir/sysdeps
AC_CACHE_CHECK(sysdep dirs, libc_cv_sysdirs, [dnl
machine=$config_machine
vendor=$config_vendor
os=$config_os
@@ -107,20 +104,27 @@ changequote(,)dnl
# Expand the configuration machine name into a subdirectory by architecture
# type and particular chip.
case "$machine" in
a29k | am29000) machine=a29k ;;
alpha*) machine=alpha/$machine ;;
hppa*) machine=hppa/$machine ;;
i[345]86) machine=i386/$machine ;;
m680?0) machine=m68k/$machine ;;
m68k) machine=m68k/m68020 ;;
m88???) machine=m88k/$machine ;;
m88k) machine=m88k/m88100 ;;
mips*) machine=mips/$machine ;;
mips64*) machine=mips/mips64/$machine ;;
sparc[6789]) machine=sparc/$machine ;;
supersparc) machine=sparc/sparc8 ;;
a29k | am29000) base_machine=a29k machine=a29k ;;
alpha*) base_machine=alpha machine=alpha/$machine ;;
hppa*) base_machine=hppa machine=hppa/$machine ;;
i[345]86) base_machine=i386 machine=i386/$machine ;;
m680?0) base_machine=m68k machine=m68k/$machine ;;
m68k) base_machine=m68k machine=m68k/m68020 ;;
m88???) base_machine=m88k machine=m88k/$machine ;;
m88k) base_machine=m88k machine=m88k/m88100 ;;
mips*) base_machine=mips machine=mips/$machine ;;
mips64*) base_machine=mips64 machine=mips/mips64/$machine ;;
sparc[6789]) base_machine=sparc machine=sparc/$machine ;;
supersparc) base_machine=sparc machine=sparc/sparc8 ;;
esac
changequote([,])dnl
AC_SUBST(base_machine)
# Compute the list of sysdep directories for this configuration.
sysdep_dir=$srcdir/sysdeps
AC_CACHE_CHECK(sysdep dirs, libc_cv_sysdirs, [dnl
dnl We need to use [ and ] for other purposes for a while now.
changequote(,)dnl
# 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'`"
@@ -293,11 +297,16 @@ if test "$INSTALL" = "${srcdir}/install-sh"; then
# The makefiles need to use a different form to find it in $srcdir.
INSTALL='$(..)./install-sh'
fi
AC_PROG_LN_S
AC_CHECK_PROGS(MSGFMT, msgfmt gmsgfmt, :)
AC_CHECK_TOOL(CC, gcc)
AC_PROG_CPP
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, :)
AC_PROG_CPP
AC_CHECK_TOOL(OBJDUMP, objdump)
AC_CHECK_TOOL(OBJCOPY, objcopy)
AC_PROG_AWK
AC_CACHE_CHECK(for signed size_t type, libc_cv_signed_size_t, [dnl
echo '#include <stddef.h>
@@ -469,6 +478,19 @@ elif test $libc_cv_asm_weakext_directive = yes; then
AC_DEFINE(HAVE_ASM_WEAKEXT_DIRECTIVE)
fi
AC_CACHE_CHECK(for ld --no-whole-archive, libc_cv_ld_no_whole_archive, [dnl
cat > conftest.c <<\EOF
main () { exit (0); }
EOF
if ${CC-cc} $CFLAGS -Wl,--no-whole-archive \
-o conftest conftest.c 2>/dev/null; then
libc_cv_ld_no_whole_archive=yes
else
libc_cv_ld_no_whole_archive=no
fi
rm -f conftest*])
AC_SUBST(libc_cv_ld_no_whole_archive)dnl
### End of automated tests.
### Now run sysdeps configure fragments.
+8 -6
View File
@@ -25,11 +25,13 @@ extern const char _nl_C_LC_CTYPE_class32[];
extern const char _nl_C_LC_CTYPE_toupper[];
extern const char _nl_C_LC_CTYPE_tolower[];
extern const char _nl_C_LC_CTYPE_names[];
extern const char _nl_C_LC_CTYPE_width[];
#define b(u,x,o) (((const u int *) _nl_C_LC_CTYPE_##x) + o);
#define b(t,x,o) (((const t *) _nl_C_LC_CTYPE_##x) + o);
const unsigned short int *__ctype_b = b (unsigned short, class, 128);
const unsigned int *__ctype32_b = b (unsigned, class32, 0);
const int *__ctype_tolower = b (, tolower, 128);
const int *__ctype_toupper = b (, toupper, 128);
const unsigned int *__ctype_names = b (unsigned, names, 0);
const unsigned short int *__ctype_b = b (unsigned short int, class, 128);
const unsigned int *__ctype32_b = b (unsigned int, class32, 0);
const int *__ctype_tolower = b (int, tolower, 128);
const int *__ctype_toupper = b (int, toupper, 128);
const unsigned int *__ctype_names = b (unsigned int, names, 0);
const unsigned char *__ctype_width = b (unsigned char, width, 0);
+2 -2
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992, 1993, 1995, 1996 Free Software Foundation, Inc.
/* Copyright (C) 1991, 92, 93, 95, 96 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
@@ -13,7 +13,7 @@ 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, 1992 Free Software Foundation, Inc., 675 Mass Ave,
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
/*
+1 -1
View File
@@ -13,7 +13,7 @@ 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, 1992 Free Software Foundation, Inc., 675 Mass Ave,
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
/*
+11 -6
View File
@@ -1,6 +1,6 @@
# Makefile for elf subdirectory of GNU C Library.
# Copyright (C) 1995 Free Software Foundation, Inc.
# Copyright (C) 1995, 1996 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
@@ -39,7 +39,7 @@ include ../Makeconfig
ifeq (yes,$(build-shared))
extra-objs = $(rtld-routines:=.so) soinit.so sofini.so
generated = librtld.so
generated = librtld.so dl-allobjs.so
install-others = $(slibdir)/$(rtld-installed-name)
install-bin = ldd
@@ -52,14 +52,19 @@ endif
include ../Rules
# Command to link into a larger single relocatable object.
reloc-link = $(LINK.o) -nostdlib -nostartfiles -r -o $@
$(objpfx)dl-allobjs.so: $(rtld-routines:%=$(objpfx)%.so)
$(reloc-link) $^
# Link together the dynamic linker into a single relocatable object.
# We use this to produce both the ABI-compliant and Linux-compatible
# dynamic linker shared objects below.
$(objpfx)librtld.so: $(rtld-routines:%=$(objpfx)%.so) \
$(objpfx)librtld.so: $(objpfx)dl-allobjs.so \
$(patsubst %,$(common-objpfx)lib%_pic.a,\
elf c $(LDLIBS-c.so:-l%=%))
$(LINK.o) -nostdlib -nostartfiles -r -o $@ \
'-Wl,-(' $^ -lgcc '-Wl,-)'
$(reloc-link) '-Wl,-(' $^ -lgcc '-Wl,-)'
$(objpfx)ld.so: $(objpfx)librtld.so
$(rtld-link) -Wl,-soname=$(rtld-installed-name)
@@ -80,7 +85,7 @@ $(objpfx)libdl.so: $(objpfx)libdl_pic.a $(common-objpfx)libc.so $(objpfx)ld.so
$(patsubst %/,cd %;,$(objpfx)) \
$(LINK.o) -shared -o $(@:$(objpfx)%=%) \
$(LDFLAGS.so) $(LDFLAGS-dl.so) \
-Wl,--whole-archive $(^:$(objpfx)%=%)
-Wl,--whole-archive $(^:$(objpfx)%=%) $(no-whole-archive)
$(slibdir)/$(rtld-installed-name): $(objpfx)ld.so; $(do-install-program)
$(slibdir)/ld-linux.so.1: $(objpfx)ld-linux.so.1; $(do-install-program)
+1
View File
@@ -0,0 +1 @@
#include <string/envz.h>
+9 -1
View File
@@ -13,7 +13,7 @@ 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, 1992 Free Software Foundation, Inc., 675 Mass Ave,
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
/*
@@ -47,6 +47,14 @@ extern int errno;
#endif
#ifdef __USE_GNU
/* The Hurd <errnos.h> defines `error_t' as an enumerated type
so that printing `error_t' values in the debugger shows the names. */
#ifndef __error_t_defined
typedef int error_t;
#define __error_t_defined 1
#endif
/* The full and simple forms of the name with which the program was
invoked. These variables are set up automatically at startup based on
the value of ARGV[0] (this works only if you use GNU ld). */
Executable
+23
View File
@@ -0,0 +1,23 @@
#!/bin/sh
# Extract from an ELF shared object file just the dynamic symbols necessary
# to link against it and the (GNU extension) warning sections that linking
# against it may use to produce warning messages.
infile=$1
outfile=$2
# Handle both objdump -h output formats.
osechdr='^SECTION [0-9]+ \['
nsechdr='^ +[0-9]+ '
$OBJCOPY -S `$OBJDUMP -h $infile | $AWK "
/($osechdr|$nsechdr)"'\.(hash|dyn[a-z]+|gnu\.warning[a-zA-Z_.]*) / { next; }
/'"$osechdr"'/ { printf "--remove-section=%s ", $3 }
/'"$nsechdr"'/ { printf "--remove-section=%s ", $2 }
' |
# The old format puts brackets around section names. The new format fails
# to delimit long section names from the following hex digits.
sed -e 's/[][]//g' -e 's/0[0-9a-f]* / /g'` $infile $outfile.new
mv -f $outfile.new $outfile
+2 -2
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1992, 1995, 1996 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
@@ -13,7 +13,7 @@ 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, 1992 Free Software Foundation, Inc., 675 Mass Ave,
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
/*
+1
View File
@@ -42,6 +42,7 @@ server-interfaces := hurd/msg
routines = hurdstartup hurdinit \
hurdid hurdlookup hurdpid hurdrlimit hurdprio hurdexec \
path-lookup \
setauth \
pid2task task2pid \
getuids setuids getumask fchroot \
+10 -7
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1994, 1995 Free Software Foundation, Inc.
/* Copyright (C) 1994, 1995, 1996 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,18 +29,21 @@ _S_catch_exception_raise (mach_port_t port,
int code,
int subcode)
{
int signo, error;
long int sigcode;
struct hurd_sigstate *ss;
int signo;
struct hurd_signal_detail d;
if (task != __mach_task_self ())
/* The sender wasn't the kernel. */
return EPERM;
d.exc = exception;
d.exc_code = code;
d.exc_subcode = subcode;
/* Call the machine-dependent function to translate the Mach exception
codes into a signal number and subcode. */
_hurd_exception2signal (exception, code, subcode,
&signo, &sigcode, &error);
_hurd_exception2signal (&d, &signo);
/* Find the sigstate structure for the faulting thread. */
__mutex_lock (&_hurd_siglock);
@@ -64,13 +67,13 @@ _S_catch_exception_raise (mach_port_t port,
no code should do anything that can fault while holding the
sigstate lock. */
ss->critical_section = 0;
__spin_unlock (&ss->critical_section_lock);
ss->context = NULL;
__spin_unlock (&ss->lock);
}
/* Post the signal. */
_hurd_internal_post_signal (ss, signo, sigcode, error,
_hurd_internal_post_signal (ss, signo, &d,
MACH_PORT_NULL, MACH_MSG_TYPE_PORT_SEND,
0);
+4 -6
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 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
@@ -173,7 +173,7 @@ static void
ctty_new_pgrp (void)
{
int i;
HURD_CRITICAL_BEGIN;
__mutex_lock (&_hurd_dtable_lock);
@@ -226,7 +226,7 @@ reauth_dtable (void)
{
struct hurd_fd *const d = _hurd_dtable[i];
mach_port_t new, newctty, ref;
if (d == NULL)
/* Nothing to do for an unused descriptor cell. */
continue;
@@ -235,14 +235,13 @@ reauth_dtable (void)
/* Take the descriptor cell's lock. */
__spin_lock (&d->port.lock);
/* Reauthenticate the descriptor's port. */
if (d->port.port != MACH_PORT_NULL &&
! __io_reauthenticate (d->port.port,
ref, MACH_MSG_TYPE_MAKE_SEND) &&
! __USEPORT (AUTH, __auth_user_authenticate
(port,
d->port.port,
ref, MACH_MSG_TYPE_MAKE_SEND,
&new)))
{
@@ -254,7 +253,6 @@ reauth_dtable (void)
ref, MACH_MSG_TYPE_MAKE_SEND) &&
! __USEPORT (AUTH, __auth_user_authenticate
(port,
d->ctty.port,
ref, MACH_MSG_TYPE_MAKE_SEND,
&newctty)))
_hurd_port_set (&d->ctty, newctty);
+4 -5
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1994, 1995 Free Software Foundation, Inc.
/* Copyright (C) 1994, 1995, 1996 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
@@ -27,7 +27,7 @@ Cambridge, MA 02139, USA. */
void
_hurd_raise_signal (struct hurd_sigstate *ss,
int signo, long int sigcode, int sigerror)
int signo, const struct hurd_signal_detail *detail)
{
if (ss == NULL)
{
@@ -37,12 +37,11 @@ _hurd_raise_signal (struct hurd_sigstate *ss,
/* Mark SIGNO as pending to be delivered. */
__sigaddset (&ss->pending, signo);
ss->pending_data[signo].code = sigcode;
ss->pending_data[signo].error = sigerror;
ss->pending_data[signo] = *detail;
__spin_unlock (&ss->lock);
/* Send a message to the signal thread so it
will wake up and check for pending signals. */
__msg_sig_post (_hurd_msgport, 0, __mach_task_self ());
__msg_sig_post (_hurd_msgport, signo, detail->code, __mach_task_self ());
}
+16
View File
@@ -76,6 +76,7 @@ extern int _hurd_exec_flags; /* Flags word passed in exec_startup. */
extern struct hurd_port *_hurd_ports;
extern unsigned int _hurd_nports;
extern volatile mode_t _hurd_umask;
extern sigset_t _hurdsig_traced;
/* Shorthand macro for internal library code referencing _hurd_ports (see
<hurd/port.h>). */
@@ -183,6 +184,21 @@ extern file_t file_name_lookup_under (file_t startdir, const char *file,
int flags, mode_t mode);
/* Lookup FILE_NAME and return the node opened with FLAGS & MODE
(see hurd_file_name_lookup for details), but a simple file name (without
any directory prefixes) will be consecutively prefixed with the pathnames
in the `:' separated list PATH until one succeeds in a successful lookup.
If none succeed, then the first error that wasn't ENOENT is returned, or
ENOENT if no other errors were returned. If PREFIXED_NAME is non-NULL,
then if the result is looked up directly, *PREFIXED_NAME is set to NULL, and
if it is looked up using a prefix from PATH, *PREFIXED_NAME is set to
malloc'd storage containing the prefixed name. */
extern file_t file_name_path_lookup (const char *file_name, const char *path,
int flags, mode_t mode,
char **prefixed_name);
/* Open a file descriptor on a port. FLAGS are as for `open'; flags
affected by io_set_openmodes are not changed by this. If successful,
this consumes a user reference for PORT (which will be deallocated on
+7 -3
View File
@@ -1,5 +1,5 @@
/* File descriptors.
Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
Copyright (C) 1993, 1994, 1995, 1996 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
@@ -153,14 +153,18 @@ _hurd_fd_error_signal (error_t err)
/* Handle an error from an RPC on a file descriptor's port. You should
always use this function to handle errors from RPCs made on file
descriptor ports. Some errors are translated into signals. */
descriptor ports. Some errors are translated into signals. */
_EXTERN_INLINE error_t
_hurd_fd_error (int fd, error_t err)
{
int signo = _hurd_fd_error_signal (err);
if (signo)
_hurd_raise_signal (NULL, signo, fd, err);
{
const struct hurd_signal_detail detail
= { code: fd, error: err, exc: 0 };
_hurd_raise_signal (NULL, signo, &detail);
}
return err;
}
+30 -1
View File
@@ -1,5 +1,5 @@
/* Declarations of file name translation functions for the GNU Hurd.
Copyright (C) 1995 Free Software Foundation, Inc.
Copyright (C) 1995, 1996 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
@@ -98,4 +98,33 @@ error_t hurd_file_name_lookup_retry (error_t (*use_init_port)
file_t *result);
/* If FILE_NAME contains a '/', or PATH is NULL, call FUN with FILE_NAME, and
return the result (if PREFIXED_NAME is non-NULL, setting *PREFIXED_NAME to
NULL). Otherwise, call FUN repeatedly with FILE_NAME prefixed with each
successive `:' separated element of PATH, returning whenever FUN returns
0 (if PREFIXED_NAME is non-NULL, setting *PREFIXED_NAME to the resulting
prefixed path). If FUN never returns 0, return the first non-ENOENT
return value, or ENOENT if there is none. */
error_t file_name_path_scan (const char *file_name, const char *path,
error_t (*fun)(const char *name),
char **prefixed_name);
/* Lookup FILE_NAME and return the node opened with FLAGS & MODE in result
(see hurd_file_name_lookup for details), but a simple filename (without
any directory prefixes) will be consectutively prefixed with the pathnames
in the `:' separated list PATH until one succeeds in a successful lookup.
If none succeed, then the first error that wasn't ENOENT is returned, or
ENOENT if no other errors were returned. If PREFIXED_NAME is non-NULL,
then if RESULT is looked up directly, *PREFIXED_NAME is set to NULL, and
if it is looked up using a prefix from PATH, *PREFIXED_NAME is set to
malloced storage containing the prefixed name. */
error_t hurd_file_name_path_lookup (error_t (*use_init_port)
(int which,
error_t (*operate) (mach_port_t)),
file_t (*get_dtable_port) (int fd),
const char *file_name, const char *path,
int flags, mode_t mode,
file_t *result, char **prefixed_name);
#endif /* hurd/lookup.h */
+53 -39
View File
@@ -43,13 +43,25 @@ Cambridge, MA 02139, USA. */
struct hurd_signal_preempter; /* <hurd/sigpreempt.h> */
/* Full details of a signal. */
struct hurd_signal_detail
{
/* Codes from origination Mach exception_raise message. */
integer_t exc, exc_code, exc_subcode;
/* Sigcode as passed or computed from exception codes. */
integer_t code;
/* Error code as passed or extracted from exception codes. */
error_t error;
};
/* Per-thread signal state. */
struct hurd_sigstate
{
spin_lock_t lock; /* Locks most of the rest of the structure. */
spin_lock_t critical_section_lock; /* Held if in critical section. */
int critical_section; /* Nonzero if in critical section. */
spin_lock_t lock; /* Locks most of the rest of the structure. */
thread_t thread;
struct hurd_sigstate *next; /* Linked-list of thread sigstates. */
@@ -65,13 +77,8 @@ struct hurd_sigstate
stack frame, and each next element in an outermore frame. */
struct hurd_signal_preempter *preempters;
struct
{
/* For each signal that may be pending, the
sigcode and error code to deliver it with. */
long int code;
error_t error;
} pending_data[NSIG];
/* For each signal that may be pending, the details to deliver it with. */
struct hurd_signal_detail pending_data[NSIG];
/* If `suspended' is set when this thread gets a signal,
the signal thread sends an empty message to it. */
@@ -159,27 +166,22 @@ _hurd_critical_section_lock (void)
(void *) __hurd_threadvar_location (_HURD_THREADVAR_SIGSTATE);
struct hurd_sigstate *ss = *location;
if (ss == NULL)
/* The thread variable is unset; this must be the first time we've
asked for it. In this case, the critical section flag cannot
possible already be set. Look up our sigstate structure the slow
way; this locks the sigstate lock. */
ss = *location = _hurd_thread_sigstate (__mach_thread_self ());
else
__spin_lock (&ss->lock);
if (ss->critical_section)
{
/* We are already in a critical section, so do nothing. */
/* The thread variable is unset; this must be the first time we've
asked for it. In this case, the critical section flag cannot
possible already be set. Look up our sigstate structure the slow
way; this locks the sigstate lock. */
ss = *location = _hurd_thread_sigstate (__mach_thread_self ());
__spin_unlock (&ss->lock);
return NULL;
}
/* Set the critical section flag so no signal handler will run. */
ss->critical_section = 1;
__spin_unlock (&ss->lock);
if (! __spin_try_lock (&ss->critical_section_lock))
/* We are already in a critical section, so do nothing. */
return NULL;
/* Return our sigstate pointer; this will be passed to
_hurd_critical_section_unlock to clear the critical section flag. */
/* With the critical section lock held no signal handler will run.
Return our sigstate pointer; this will be passed to
_hurd_critical_section_unlock to unlock it. */
return ss;
}
@@ -191,19 +193,18 @@ _hurd_critical_section_unlock (void *our_lock)
return;
else
{
/* It was us who acquired the critical section lock. Clear the
critical section flag. */
/* It was us who acquired the critical section lock. Unlock it. */
struct hurd_sigstate *ss = our_lock;
sigset_t pending;
__spin_lock (&ss->lock);
ss->critical_section = 0;
__spin_unlock (&ss->critical_section_lock);
pending = ss->pending & ~ss->blocked;
__spin_unlock (&ss->lock);
if (pending)
/* There are unblocked signals pending, which weren't
delivered because we were in the critical section.
Tell the signal thread to deliver them now. */
__msg_sig_post (_hurd_msgport, 0, __mach_task_self ());
__msg_sig_post (_hurd_msgport, 0, 0, __mach_task_self ());
}
}
@@ -223,27 +224,28 @@ extern void _hurdsig_init (void);
extern void _hurdsig_fault_init (void);
/* Raise a signal as described by SIGNO, SIGCODE and SIGERROR, on the
thread whose sigstate SS points to. If SS is a null pointer, this
instead affects the calling thread. */
/* Raise a signal as described by SIGNO an DETAIL, on the thread whose
sigstate SS points to. If SS is a null pointer, this instead affects
the calling thread. */
extern void _hurd_raise_signal (struct hurd_sigstate *ss,
int signo, long int sigcode, int sigerror);
extern void _hurd_raise_signal (struct hurd_sigstate *ss, int signo,
const struct hurd_signal_detail *detail);
/* Translate a Mach exception into a signal (machine-dependent). */
extern void _hurd_exception2signal (int exception, int code, int subcode,
int *signo, long int *sigcode, int *error);
extern void _hurd_exception2signal (struct hurd_signal_detail *detail,
int *signo);
/* Make the thread described by SS take the signal described by SIGNO and
SIGCODE. If the process is traced, this will in fact stop with a SIGNO
DETAIL. If the process is traced, this will in fact stop with a SIGNO
as the stop signal unless UNTRACED is nonzero. When the signal can be
considered delivered, sends a sig_post reply message on REPLY_PORT
indicating success. SS is not locked. */
extern void _hurd_internal_post_signal (struct hurd_sigstate *ss,
int signo, long int sigcode, int error,
int signo,
struct hurd_signal_detail *detail,
mach_port_t reply_port,
mach_msg_type_name_t reply_port_type,
int untraced);
@@ -258,7 +260,7 @@ extern void _hurd_internal_post_signal (struct hurd_sigstate *ss,
struct machine_thread_all_state;
extern struct sigcontext *
_hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler,
int signo, long int sigcode,
int signo, struct hurd_signal_detail *detail,
int rpc_wait, struct machine_thread_all_state *state);
/* Function run by the signal thread to receive from the signal port. */
@@ -279,6 +281,18 @@ extern void _hurd_longjmp_thread_state (void *state, jmp_buf env, int value);
extern void _hurd_siginfo_handler (int);
/* Replacement for mach_msg used in RPCs to provide Hurd interruption
semantics. Args are all the same as for mach_msg. intr-rpc.h arranges
for this version to be used automatically by the RPC stubs the library
builds in place of the normal mach_msg. */
error_t _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg,
mach_msg_option_t option,
mach_msg_size_t send_size,
mach_msg_size_t rcv_size,
mach_port_t rcv_name,
mach_msg_timeout_t timeout,
mach_port_t notify);
/* Milliseconds to wait for an interruptible RPC to return after
`interrupt_operation'. */
+2 -1
View File
@@ -23,6 +23,7 @@ Cambridge, MA 02139, USA. */
#include <errno.h>
#include <signal.h> /* For sigset_t, sighandler_t, SIG_ERR. */
struct hurd_sigstate; /* <hurd/signal.h> */
struct hurd_signal_detail; /* <hurd/signal.h> */
struct hurd_signal_preempter
{
@@ -39,7 +40,7 @@ struct hurd_signal_preempter
is processed as if the return value were its handler setting. */
sighandler_t (*preempter) (struct hurd_signal_preempter *preempter,
struct hurd_sigstate *ss,
int *signo, long int *sigcode, int *sigerror);
int *signo, struct hurd_signal_detail *detail);
/* If PREEMPTER is null, act as if it returned HANDLER. */
sighandler_t handler;
+20 -46
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
/* Copyright (C) 1991, 92, 93, 94, 95, 96 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,6 +25,8 @@ Cambridge, MA 02139, USA. */
#include <hurd.h>
#include <hurd/fd.h>
#include <hurd/signal.h>
#include <assert.h>
#include <argz.h>
/* Overlay TASK, executing FILE with arguments ARGV and environment ENVP.
If TASK == mach_task_self (), some ports are dealloc'd by the exec server.
@@ -34,7 +36,7 @@ _hurd_exec (task_t task, file_t file,
char *const argv[], char *const envp[])
{
error_t err;
char *args, *env, *ap;
char *args, *env;
size_t argslen, envlen;
int ints[INIT_INT_MAX];
mach_port_t ports[_hurd_nports];
@@ -43,40 +45,14 @@ _hurd_exec (task_t task, file_t file,
unsigned int dtablesize, i;
struct hurd_port **dtable_cells;
struct hurd_userlink *ulink_dtable;
char *const *p;
struct hurd_sigstate *ss;
mach_port_t *please_dealloc, *pdp;
/* Pack the arguments into an array with nulls separating the elements. */
argslen = 0;
if (argv != NULL)
{
p = argv;
while (*p != NULL)
argslen += strlen (*p++) + 1;
args = __alloca (argslen);
ap = args;
for (p = argv; *p != NULL; ++p)
ap = __memccpy (ap, *p, '\0', ULONG_MAX);
}
else
args = NULL;
/* Pack the environment into an array with nulls separating elements. */
envlen = 0;
if (envp != NULL)
{
p = envp;
while (*p != NULL)
envlen += strlen (*p++) + 1;
env = __alloca (envlen);
ap = env;
for (p = envp; *p != NULL; ++p)
ap = __memccpy (ap, *p, '\0', ULONG_MAX);
}
else
env = NULL;
/* XXX needs to be hurdmalloc XXX */
if (err = __argz_create (argv, &args, &argslen))
return err;
if (err = __argz_create (envp, &env, &envlen))
goto outargs;
/* Load up the ports to give to the new program. */
for (i = 0; i < _hurd_nports; ++i)
@@ -88,7 +64,7 @@ _hurd_exec (task_t task, file_t file,
{
while (--i > 0)
_hurd_port_free (&_hurd_ports[i], &ulink_ports[i], ports[i]);
return err;
goto outenv;
}
}
else
@@ -114,6 +90,10 @@ _hurd_exec (task_t task, file_t file,
}
ss = _hurd_self_sigstate ();
assert (! __spin_lock_locked (&ss->critical_section_lock));
__spin_lock (&ss->critical_section_lock);
__spin_lock (&ss->lock);
ints[INIT_SIGMASK] = ss->blocked;
ints[INIT_SIGPENDING] = ss->pending;
@@ -130,7 +110,6 @@ _hurd_exec (task_t task, file_t file,
critical section flag avoids anything we call trying to acquire the
sigstate lock. */
ss->critical_section = 1;
__spin_unlock (&ss->lock);
/* Pack up the descriptor table to give the new program. */
@@ -217,8 +196,7 @@ _hurd_exec (task_t task, file_t file,
*pdp++ = dtable[i];
}
err = __file_exec (file, task,
_hurd_exec_flags & EXEC_INHERITED,
err = __file_exec (file, task, 0,
args, argslen, env, envlen,
dtable, MACH_MSG_TYPE_COPY_SEND, dtablesize,
ports, MACH_MSG_TYPE_COPY_SEND, _hurd_nports,
@@ -244,15 +222,11 @@ _hurd_exec (task_t task, file_t file,
__mutex_unlock (&_hurd_dtable_lock);
/* Safe to let signals happen now. */
{
sigset_t pending;
__spin_lock (&ss->lock);
ss->critical_section = 0;
pending = ss->pending & ~ss->blocked;
__spin_unlock (&ss->lock);
if (pending)
__msg_sig_post (_hurd_msgport, 0, __mach_task_self ());
}
_hurd_critical_section_unlock (ss);
outargs:
free (args);
outenv:
free (env);
return err;
}
+7 -5
View File
@@ -42,19 +42,21 @@ _hurdsig_fault_catch_exception_raise (mach_port_t port,
int subcode)
{
int signo;
long int sigcode;
int sigerror;
struct hurd_signal_detail d;
if (port != forward_sigexc ||
thread != _hurd_msgport_thread || task != __mach_task_self ())
return EPERM; /* Strange bogosity. */
d.exc = exception;
d.exc_code = code;
d.exc_subcode = subcode;
/* Call the machine-dependent function to translate the Mach exception
codes into a signal number and subcode. */
_hurd_exception2signal (exception, code, subcode,
&signo, &sigcode, &sigerror);
_hurd_exception2signal (&d, &signo);
return HURD_PREEMPT_SIGNAL_P (&_hurdsig_fault_preempter, signo, sigcode)
return HURD_PREEMPT_SIGNAL_P (&_hurdsig_fault_preempter, signo, d.code)
? 0 : EGREGIOUS;
}
+6 -2
View File
@@ -30,6 +30,7 @@ int _hurd_exec_flags;
struct hurd_port *_hurd_ports;
unsigned int _hurd_nports;
mode_t _hurd_umask;
sigset_t _hurdsig_traced;
error_t
_hurd_ports_use (int which, error_t (*operate) (mach_port_t))
@@ -78,6 +79,9 @@ _hurd_init (int flags, char **argv,
else
_hurd_umask = CMASK;
if (intarraysize > INIT_TRACEMASK)
_hurdsig_traced = intarray[INIT_TRACEMASK];
/* All done with init ints and ports. */
__vm_deallocate (__mach_task_self (),
(vm_address_t) intarray,
@@ -147,11 +151,11 @@ _hurd_proc_init (char **argv)
here, like _hurd_pid, are already initialized. */
RUN_HOOK (_hurd_proc_subinit, ());
if (_hurd_exec_flags & EXEC_TRACED)
if (_hurdsig_traced)
/* This process is "traced", meaning it should stop on signals or exec.
We are all set up now to handle signals. Stop ourselves, to inform
our parent (presumably a debugger) that the exec has completed. */
__msg_sig_post (_hurd_msgport, SIGTRAP, __mach_task_self ());
__msg_sig_post (_hurd_msgport, SIGTRAP, 0, __mach_task_self ());
}
/* Called when we get a message telling us to change our proc server port. */
+1 -1
View File
@@ -42,7 +42,7 @@ _hurd_sig_post (pid_t pid, int sig, mach_port_t arg_refport)
(refport = arg_refport, 0), 0,
/* If no message port we cannot send signals. */
msgport == MACH_PORT_NULL ? EPERM :
__msg_sig_post (msgport, sig, refport));
__msg_sig_post (msgport, sig, 0, refport));
if (! err)
delivered = 1;
}
+1 -1
View File
@@ -100,7 +100,7 @@ __hurd_file_name_lookup_retry (error_t (*use_init_port)
mach_port_t ref = __mach_reply_port ();
error_t reauth (auth_t auth)
{
return __auth_user_authenticate (auth, unauth, ref,
return __auth_user_authenticate (auth, ref,
MACH_MSG_TYPE_MAKE_SEND,
result);
}
+4 -49
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
/* Copyright (C) 1992, 1994, 1995, 1996 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,6 +22,7 @@ Cambridge, MA 02139, USA. */
#include <unistd.h>
#include <limits.h>
#include <string.h>
#include <argz.h>
#define AUTHCHECK \
@@ -377,57 +378,15 @@ _S_msg_set_environment (mach_port_t msgport, mach_port_t auth,
AUTHCHECK;
envc = _hurd_split_args (data, datalen, NULL);
envc = __argz_count (data, datalen);
envp = malloc ((envc + 1) * sizeof (char *));
if (envp == NULL)
return errno;
_hurd_split_args (data, datalen, envp);
__argz_extract (data, datalen, envp);
__environ = envp; /* XXX cooperate with loadenv et al */
return 0;
}
/* Get and frob the exec flags. */
kern_return_t
_S_msg_get_exec_flags (mach_port_t process, mach_port_t auth,
int *flags)
{
AUTHCHECK;
*flags = _hurd_exec_flags;
return 0;
}
kern_return_t
_S_msg_set_all_exec_flags (mach_port_t process, mach_port_t auth,
int flags)
{
AUTHCHECK;
_hurd_exec_flags = flags;
return 0;
}
kern_return_t
_S_msg_set_some_exec_flags (mach_port_t process, mach_port_t auth,
int flags)
{
AUTHCHECK;
_hurd_exec_flags |= flags;
return 0;
}
kern_return_t
_S_msg_clear_some_exec_flags (mach_port_t process, mach_port_t auth,
int flags)
{
AUTHCHECK;
_hurd_exec_flags &= ~flags;
return 0;
}
/* XXX */
@@ -445,7 +404,3 @@ _S_msg_set_dtable (mach_port_t process,
portarray_t dtable,
mach_msg_type_number_t dtableCnt)
{ return EOPNOTSUPP; }
kern_return_t
_S_msg_startup_dosync (mach_port_t process)
{ return EOPNOTSUPP; }
+2 -2
View File
@@ -1,5 +1,5 @@
/* Support code for dealing with priorities in the Hurd.
Copyright (C) 1994, 1995 Free Software Foundation, Inc.
Copyright (C) 1994, 1995, 1996 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
@@ -62,7 +62,7 @@ _hurd_priority_which_map (enum __priority_which which, int who,
char *tw = 0;
size_t twsz = 0;
if (err = __USEPORT (PROC, __proc_getprocinfo (port, pids[i],
pi_flags,
&pi_flags,
&pi, &pisize,
&tw, &twsz)))
continue;
+48 -35
View File
@@ -130,7 +130,7 @@ int _hurd_core_limit; /* XXX */
/* Call the crash dump server to mummify us before we die.
Returns nonzero if a core file was written. */
static int
write_corefile (int signo, long int sigcode, int sigerror)
write_corefile (int signo, const struct hurd_signal_detail *detail)
{
error_t err;
mach_port_t coreserver;
@@ -168,13 +168,16 @@ write_corefile (int signo, long int sigcode, int sigerror)
/* Call the core dumping server to write the core file. */
err = __crash_dump_task (coreserver,
__mach_task_self (),
file, _hurdsig_getenv ("GNUTARGET"),
signo, sigcode, sigerror);
file,
signo, detail->code, detail->error,
detail->exc, detail->exc_code, detail->exc_subcode,
_hurd_ports[INIT_PORT_CTTYID].port,
MACH_MSG_TYPE_COPY_SEND);
__mach_port_deallocate (__mach_task_self (), coreserver);
if (! err)
/* The core dump into FILE succeeded, so now link it into the
directory. */
err = __dir_link (file, coredir, name);
err = __dir_link (file, coredir, name, 1);
__mach_port_deallocate (__mach_task_self (), file);
__mach_port_deallocate (__mach_task_self (), coredir);
return !err;
@@ -233,6 +236,9 @@ interrupted_reply_port_location (struct machine_thread_all_state *thread_state,
#include <hurd/sigpreempt.h>
#include "intr-msg.h"
/* Timeout on interrupt_operation calls. */
mach_msg_timeout_t _hurdsig_interrupt_timeout = 1000;
/* SS->thread is suspended.
Abort any interruptible RPC operation the thread is doing.
@@ -299,7 +305,7 @@ _hurdsig_abort_rpcs (struct hurd_sigstate *ss, int signo, int sigthread,
mach_port_t *reply = interrupted_reply_port_location (state,
sigthread);
error_t err = __interrupt_operation (intr_port);
error_t err = __interrupt_operation (intr_port, _hurdsig_interrupt_timeout);
if (err)
{
@@ -425,7 +431,7 @@ sigset_t _hurdsig_preempted_set;
/* Deliver a signal. SS is not locked. */
void
_hurd_internal_post_signal (struct hurd_sigstate *ss,
int signo, long int sigcode, int sigerror,
int signo, struct hurd_signal_detail *detail,
mach_port_t reply_port,
mach_msg_type_name_t reply_port_type,
int untraced)
@@ -456,10 +462,9 @@ _hurd_internal_post_signal (struct hurd_sigstate *ss,
void mark_pending (void)
{
__sigaddset (&ss->pending, signo);
/* Save the code to be given to the handler when SIGNO is
/* Save the details to be given to the handler when SIGNO is
unblocked. */
ss->pending_data[signo].code = sigcode;
ss->pending_data[signo].error = sigerror;
ss->pending_data[signo] = *detail;
}
/* Suspend the process with SIGNO. */
@@ -475,7 +480,7 @@ _hurd_internal_post_signal (struct hurd_sigstate *ss,
__mutex_unlock (&_hurd_siglock);
abort_all_rpcs (signo, &thread_state, 1);
reply ();
__proc_mark_stop (port, signo);
__proc_mark_stop (port, signo, detail->code);
}));
_hurd_stopped = 1;
}
@@ -537,15 +542,15 @@ _hurd_internal_post_signal (struct hurd_sigstate *ss,
handler = SIG_ERR;
for (pe = ss->preempters; pe && handler == SIG_ERR; pe = pe->next)
if (HURD_PREEMPT_SIGNAL_P (pe, signo, sigcode))
handler = (*pe->preempter) (pe, ss, &signo, &sigcode, &sigerror);
if (HURD_PREEMPT_SIGNAL_P (pe, signo, detail->code))
handler = (*pe->preempter) (pe, ss, &signo, detail);
if (handler == SIG_ERR && (__sigmask (signo) & _hurdsig_preempted_set))
{
__mutex_lock (&_hurd_siglock);
for (pe = _hurdsig_preempters; pe && handler == SIG_ERR; pe = pe->next)
if (HURD_PREEMPT_SIGNAL_P (pe, signo, sigcode))
handler = (*pe->preempter) (pe, ss, &signo, &sigcode, &sigerror);
if (HURD_PREEMPT_SIGNAL_P (pe, signo, detail->code))
handler = (*pe->preempter) (pe, ss, &signo, detail);
__mutex_unlock (&_hurd_siglock);
}
@@ -561,7 +566,7 @@ _hurd_internal_post_signal (struct hurd_sigstate *ss,
{
/* No preemption. Do normal handling. */
if (!untraced && (_hurd_exec_flags & EXEC_TRACED))
if (!untraced && __sigismember (&_hurdsig_traced, signo))
{
/* We are being traced. Stop to tell the debugger of the signal. */
if (_hurd_stopped)
@@ -662,7 +667,7 @@ _hurd_internal_post_signal (struct hurd_sigstate *ss,
/* If we would ordinarily stop for a job control signal, but we are
orphaned so noone would ever notice and continue us again, we just
quietly die, alone and in the dark. */
sigcode = signo;
detail->code = signo;
signo = SIGKILL;
act = term;
}
@@ -684,7 +689,8 @@ _hurd_internal_post_signal (struct hurd_sigstate *ss,
/* We are already stopped, but receiving an untraced stop
signal. Instead of resuming and suspending again, just
notify the proc server of the new stop signal. */
error_t err = __USEPORT (PROC, __proc_mark_stop (port, signo));
error_t err = __USEPORT (PROC, __proc_mark_stop
(port, signo, detail->code));
assert_perror (err);
}
else
@@ -699,7 +705,7 @@ _hurd_internal_post_signal (struct hurd_sigstate *ss,
sigbomb:
/* We got a fault setting up the stack frame for the handler.
Nothing to do but die; BSD gets SIGILL in this case. */
sigcode = signo; /* XXX ? */
detail->code = signo; /* XXX ? */
signo = SIGILL;
act = core;
/* FALLTHROUGH */
@@ -719,7 +725,7 @@ _hurd_internal_post_signal (struct hurd_sigstate *ss,
int status = W_EXITCODE (0, signo);
/* Do a core dump if desired. Only set the wait status bit saying we
in fact dumped core if the operation was actually successful. */
if (act == core && write_corefile (signo, sigcode, sigerror))
if (act == core && write_corefile (signo, detail))
status |= WCOREFLAG;
/* Tell proc how we died and then stick the saber in the gut. */
_hurd_exit (status);
@@ -782,7 +788,7 @@ _hurd_internal_post_signal (struct hurd_sigstate *ss,
/* The thread was in sigreturn, not in any interruptible RPC. */
wait_for_reply = 0;
assert (! ss->critical_section);
assert (! __spin_lock_locked (&ss->critical_section_lock));
}
else
{
@@ -792,7 +798,7 @@ _hurd_internal_post_signal (struct hurd_sigstate *ss,
&reply)
!= MACH_PORT_NULL);
if (ss->critical_section)
if (__spin_lock_locked (&ss->critical_section_lock))
{
/* The thread is in a critical section. Mark the signal as
pending. When it finishes the critical section, it will
@@ -806,8 +812,7 @@ _hurd_internal_post_signal (struct hurd_sigstate *ss,
/* Call the machine-dependent function to set the thread up
to run the signal handler, and preserve its old context. */
scp = _hurd_setup_sighandler (ss, handler,
signo, sigcode,
scp = _hurd_setup_sighandler (ss, handler, signo, detail,
wait_for_reply, &thread_state);
if (scp == NULL)
goto sigbomb;
@@ -846,7 +851,7 @@ _hurd_internal_post_signal (struct hurd_sigstate *ss,
}
/* Backdoor extra argument to signal handler. */
scp->sc_error = sigerror;
scp->sc_error = detail->error;
/* Block SIGNO and requested signals while running the handler. */
scp->sc_mask = ss->blocked;
@@ -880,7 +885,7 @@ _hurd_internal_post_signal (struct hurd_sigstate *ss,
thread finishes its critical section. */
inline int signals_pending (void)
{
if (_hurd_stopped || ss->critical_section)
if (_hurd_stopped || __spin_lock_locked (&ss->critical_section_lock))
return 0;
return pending = ss->pending & ~ss->blocked;
}
@@ -895,8 +900,7 @@ _hurd_internal_post_signal (struct hurd_sigstate *ss,
if (__sigismember (&pending, signo))
{
__sigdelset (&ss->pending, signo);
sigcode = ss->pending_data[signo].code;
sigerror = ss->pending_data[signo].error;
*detail = ss->pending_data[signo];
__spin_unlock (&ss->lock);
goto post_signal;
}
@@ -1013,8 +1017,9 @@ signal_allowed (int signo, mach_port_t refport)
authorizing SIGIO and SIGURG signals properly. */
int d;
int lucky = 0; /* True if we find a match for REFPORT. */
__mutex_lock (&_hurd_dtable_lock);
for (d = 0; (unsigned int) d < (unsigned int) _hurd_dtablesize; ++d)
for (d = 0; !lucky && (unsigned) d < (unsigned) _hurd_dtablesize; ++d)
{
struct hurd_userlink ulink;
io_t port;
@@ -1026,13 +1031,13 @@ signal_allowed (int signo, mach_port_t refport)
{
if (refport == asyncid)
/* Break out of the loop on the next iteration. */
d = -1;
lucky = 1;
__mach_port_deallocate (__mach_task_self (), asyncid);
}
_hurd_port_free (&_hurd_dtable[d]->port, &ulink, port);
}
/* If we found a lucky winner, we've set D to -1 in the loop. */
if (d < 0)
if (lucky)
goto win;
}
}
@@ -1053,18 +1058,22 @@ signal_allowed (int signo, mach_port_t refport)
kern_return_t
_S_msg_sig_post (mach_port_t me,
mach_port_t reply_port, mach_msg_type_name_t reply_port_type,
int signo,
int signo, natural_t sigcode,
mach_port_t refport)
{
error_t err;
struct hurd_signal_detail d;
if (err = signal_allowed (signo, refport))
return err;
d.code = sigcode;
d.exc = 0;
/* Post the signal to the designated signal-receiving thread. This will
reply when the signal can be considered delivered. */
_hurd_internal_post_signal (_hurd_thread_sigstate (_hurd_sigthread),
signo, 0, 0, reply_port, reply_port_type,
signo, &d, reply_port, reply_port_type,
0); /* Stop if traced. */
return MIG_NO_REPLY; /* Already replied. */
@@ -1077,18 +1086,22 @@ kern_return_t
_S_msg_sig_post_untraced (mach_port_t me,
mach_port_t reply_port,
mach_msg_type_name_t reply_port_type,
int signo,
int signo, natural_t sigcode,
mach_port_t refport)
{
error_t err;
struct hurd_signal_detail d;
if (err = signal_allowed (signo, refport))
return err;
d.code = sigcode;
d.exc = 0;
/* Post the signal to the designated signal-receiving thread. This will
reply when the signal can be considered delivered. */
_hurd_internal_post_signal (_hurd_thread_sigstate (_hurd_sigthread),
signo, 0, 0, reply_port, reply_port_type,
signo, &d, reply_port, reply_port_type,
1); /* Untraced flag. */
return MIG_NO_REPLY; /* Already replied. */
@@ -1166,7 +1179,7 @@ reauth_proc (mach_port_t new)
if (! HURD_PORT_USE (&_hurd_ports[INIT_PORT_PROC],
__proc_reauthenticate (port, ref,
MACH_MSG_TYPE_MAKE_SEND) ||
__auth_user_authenticate (new, port, ref,
__auth_user_authenticate (new, ref,
MACH_MSG_TYPE_MAKE_SEND,
&ignore))
&& ignore != MACH_PORT_NULL)
+6 -40
View File
@@ -1,5 +1,5 @@
/* Initial program startup for running under the GNU Hurd.
Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
Copyright (C) 1991, 92, 93, 94, 95, 96 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
@@ -30,6 +30,7 @@ Cambridge, MA 02139, USA. */
#include "set-hooks.h"
#include "hurdmalloc.h" /* XXX */
#include "hurdstartup.h"
#include <argz.h>
mach_port_t *_hurd_init_dtable;
mach_msg_type_number_t _hurd_init_dtablesize;
@@ -45,9 +46,6 @@ unsigned long int *__hurd_sigthread_variables;
extern void __mach_init (void);
int _hurd_split_args (char *, size_t, char **);
/* Entry point. This is the first thing in the text segment.
The exec server started the initial thread in our task with this spot the
@@ -125,9 +123,9 @@ _hurd_startup (void **argptr, void (*main) (int *data))
arguments and environment into vectors of pointers to strings. */
/* Count up the arguments so we can allocate ARGV. */
argc = _hurd_split_args (args, argslen, NULL);
argc = __argz_count (args, argslen);
/* Count up the environment variables so we can allocate ENVP. */
envc = _hurd_split_args (env, envlen, NULL);
envc = __argz_count (env, envlen);
/* There were some arguments. Allocate space for the vectors of
pointers and fill them in. We allocate the space for the
@@ -138,11 +136,11 @@ _hurd_startup (void **argptr, void (*main) (int *data))
sizeof (struct hurd_startup_data));
*argcptr = argc;
argv = (void *) (argcptr + 1);
_hurd_split_args (args, argslen, argv);
__argz_extract (args, argslen, argv);
/* There was some environment. */
envp = &argv[argc + 1];
_hurd_split_args (env, envlen, envp);
__argz_extract (env, envlen, envp);
}
if (err || in_bootstrap == MACH_PORT_NULL)
@@ -197,35 +195,3 @@ _hurd_startup (void **argptr, void (*main) (int *data))
LOSE;
abort ();
}
/* Split ARGSLEN bytes at ARGS into words, breaking at NUL characters. If
ARGV is not a null pointer, store a pointer to the start of each word in
ARGV[n], and null-terminate ARGV. Return the number of words split. */
int
_hurd_split_args (char *args, size_t argslen, char **argv)
{
char *p = args;
size_t n = argslen;
int argc = 0;
while (n > 0)
{
char *end = memchr (p, '\0', n);
if (argv)
argv[argc] = p;
++argc;
if (end == NULL)
/* The last argument is unterminated. */
break;
n -= end + 1 - p;
p = end + 1;
}
if (argv)
argv[argc] = NULL;
return argc;
}
+120
View File
@@ -0,0 +1,120 @@
/* Filename lookup using a search path
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.ai.mit.edu>
This program 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 program 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 program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <string.h>
#include <hurd.h>
#include <hurd/lookup.h>
/* If FILE_NAME contains a '/', or PATH is NULL, call FUN with FILE_NAME, and
return the result (if PREFIXED_NAME is non-NULL, setting *PREFIXED_NAME to
NULL). Otherwise, call FUN repeatedly with FILE_NAME prefixed with each
successive `:' separated element of PATH, returning whenever FUN returns
0 (if PREFIXED_NAME is non-NULL, setting *PREFIXED_NAME to the resulting
prefixed path). If FUN never returns 0, return the first non-ENOENT
return value, or ENOENT if there is none. */
error_t
file_name_path_scan (const char *file_name, const char *path,
error_t (*fun)(const char *name),
char **prefixed_name)
{
if (path == NULL || index (file_name, '/'))
{
if (prefixed_name)
*prefixed_name = 0;
return (*fun)(file_name);
}
else
{
error_t real_err = 0;
size_t file_name_len = strlen (file_name);
for (;;)
{
error_t err;
const char *next = index (path, ':') ?: path + strlen (path);
size_t pfx_len = next - path;
char pfxed_name[pfx_len + 2 + file_name_len + 1];
if (pfx_len == 0)
pfxed_name[pfx_len++] = '.';
else
bcopy (path, pfxed_name, pfx_len);
if (pfxed_name[pfx_len - 1] != '/')
pfxed_name[pfx_len++] = '/';
bcopy (file_name, pfxed_name + pfx_len, file_name_len + 1);
err = (*fun)(pfxed_name);
if (err == 0)
{
if (prefixed_name)
*prefixed_name = strdup (pfxed_name);
return 0;
}
if (!real_err && err != ENOENT)
real_err = err;
if (*next == '\0')
return real_err ?: ENOENT;
else
path = next + 1;
}
}
}
/* Lookup FILE_NAME and return the node opened with FLAGS & MODE in result
(see hurd_file_name_lookup for details), but a simple filename (without
any directory prefixes) will be consectutively prefixed with the pathnames
in the `:' separated list PATH until one succeeds in a successful lookup.
If none succeed, then the first error that wasn't ENOENT is returned, or
ENOENT if no other errors were returned. If PREFIXED_NAME is non-NULL,
then if RESULT is looked up directly, *PREFIXED_NAME is set to NULL, and
if it is looked up using a prefix from PATH, *PREFIXED_NAME is set to
malloced storage containing the prefixed name. */
error_t
hurd_file_name_path_lookup (error_t (*use_init_port)
(int which,
error_t (*operate) (mach_port_t)),
file_t (*get_dtable_port) (int fd),
const char *file_name, const char *path,
int flags, mode_t mode,
file_t *result, char **prefixed_name)
{
error_t lookup (const char *name)
{
return
__hurd_file_name_lookup (use_init_port, get_dtable_port,
name, flags, mode, result);
}
return file_name_path_scan (file_name, path, lookup, prefixed_name);
}
file_t
file_name_path_lookup (const char *file_name, const char *path,
int flags, mode_t mode, char **prefixed_name)
{
error_t err;
file_t result;
err = hurd_file_name_path_lookup (&_hurd_ports_use, &__getdport,
file_name, path, flags, mode,
&result, prefixed_name);
return err ? (__hurd_fail (err), MACH_PORT_NULL) : result;
}
+34 -4
View File
@@ -29,15 +29,20 @@ Cambridge, MA 02139, USA. */
static void
describe_number (string_t description, const char *flavor, int i)
{
int j;
char *p = __stpcpy (description, flavor);
p += i / 10 + 1;
*p = '\0';
/* Allocate space for the number at the end of DESCRIPTION. */
for (j = i; j >= 10; j /= 10)
p++;
p[1] = '\0';
do
{
*--p = '0' + i % 10;
*p-- = '0' + i % 10;
i /= 10;
} while (i != 0);
assert (p[-1] == '#');
assert (*p == '#');
}
static void
@@ -144,3 +149,28 @@ _S_msg_report_wait (mach_port_t msgport, thread_t thread,
__mach_port_deallocate (__mach_task_self (), thread);
return 0;
}
kern_return_t
_S_msg_describe_ports (mach_port_t msgport, mach_port_t refport,
mach_port_t *ports, mach_msg_type_number_t nports,
char **desc, mach_msg_type_number_t *desclen)
{
char *p, *end;
if (__USEPORT (AUTH, msgport != port))
return EPERM;
end = *desc + *desclen;
p = *desc;
while (nports-- > 0)
{
char this[200];
describe_port (this, *ports++);
p = __stpncpy (p, this, end - p);
if (p == end && p[-1] != '\0')
return ENOMEM;
}
*desclen = p - *desc;
return 0;
}
+3 -4
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 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
@@ -73,7 +73,6 @@ _hurd_setauth (auth_t new)
! HURD_PORT_USE (&_hurd_ports[INIT_PORT_AUTH],
__auth_user_authenticate
(port,
_hurd_init_dtable[d],
ref, MACH_MSG_TYPE_MAKE_SEND,
&new)))
{
@@ -88,7 +87,7 @@ _hurd_setauth (auth_t new)
if (__USEPORT (CRDIR,
! __io_reauthenticate (port,
ref, MACH_MSG_TYPE_MAKE_SEND) &&
! __auth_user_authenticate (new, port,
! __auth_user_authenticate (new,
ref, MACH_MSG_TYPE_MAKE_SEND,
&newport)))
_hurd_port_set (&_hurd_ports[INIT_PORT_CRDIR], newport);
@@ -98,7 +97,7 @@ _hurd_setauth (auth_t new)
if (__USEPORT (CWDIR,
! __io_reauthenticate (port,
ref, MACH_MSG_TYPE_MAKE_SEND) &&
! __auth_user_authenticate (new, port,
! __auth_user_authenticate (new,
ref, MACH_MSG_TYPE_MAKE_SEND,
&newport)))
_hurd_port_set (&_hurd_ports[INIT_PORT_CWDIR], newport);
+2 -2
View File
@@ -56,7 +56,7 @@ _hurdsig_longjmp_from_handler (void *data, jmp_buf env, int val)
__spin_lock (&ss->lock);
/* We should only ever be called from _longjmp_unwind (in jmp-unwind.c),
which calls us inside a critical section. */
assert (ss->critical_section);
assert (__spin_lock_locked (&ss->critical_section_lock));
/* Are we on the alternate signal stack now? */
onstack = (ss->sigaltstack.ss_flags & SA_ONSTACK);
__spin_unlock (&ss->lock);
@@ -122,7 +122,7 @@ _hurdsig_longjmp_from_handler (void *data, jmp_buf env, int val)
having run all the unwind forms back to ENV's frame, but our SP is
still inside those unwound frames. */
__spin_lock (&ss->lock);
ss->critical_section = 0;
__spin_unlock (&ss->critical_section_lock);
ss->blocked = ~(sigset_t) 0 & ~_SIG_CANT_MASK;
__spin_unlock (&ss->lock);
+6 -6
View File
@@ -1,5 +1,5 @@
/* Thread cancellation support.
Copyright (C) 1995 Free Software Foundation, Inc.
Copyright (C) 1995, 1996 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 @@ Cambridge, MA 02139, USA. */
/* See hurdsig.c. */
extern mach_port_t _hurdsig_abort_rpcs (struct hurd_sigstate *ss,
int signo, int sigthread,
int signo, int sigthread,
struct machine_thread_all_state *,
int *state_change,
mach_port_t *reply_port,
@@ -45,9 +45,9 @@ hurd_thread_cancel (thread_t thread)
if (ss == _hurd_self_sigstate ())
return EINTR; /* Bozo. */
assert (! __spin_lock_locked (&ss->critical_section_lock));
__spin_lock (&ss->critical_section_lock);
__spin_lock (&ss->lock);
assert (! ss->critical_section);
ss->critical_section = 1;
err = __thread_suspend (thread);
__spin_unlock (&ss->lock);
@@ -59,7 +59,7 @@ hurd_thread_cancel (thread_t thread)
/* Interrupt any interruptible RPC now in progress. */
state.set = 0;
_hurdsig_abort_rpcs (ss, 0, 0, &state, &state_change, NULL, 0, 0);
if (state_change)
if (state_change)
err = __thread_set_state (thread, MACHINE_THREAD_STATE_FLAVOR,
(natural_t *) &state.basic,
MACHINE_THREAD_STATE_COUNT);
@@ -85,7 +85,7 @@ hurd_check_cancel (void)
int cancel;
__spin_lock (&ss->lock);
assert (! ss->critical_section);
assert (! __spin_lock_locked (&ss->critical_section_lock));
cancel = ss->cancel;
ss->cancel = 0;
__spin_unlock (&ss->lock);
+10 -3
View File
@@ -21,19 +21,26 @@
subdir = intl
headers = libintl.h
routines = bindtextdom dcgettext dgettext gettext \
finddomain loadmsgcat localealias textdomain
distribute = gettext.h gettextP.h hash-string.h
finddomain loadmsgcat localealias textdomain \
l10nflist explodename
distribute = gettext.h gettextP.h hash-string.h loadinfo.h locale.alias
install-others = $(localedir)/locale.alias
include ../Rules
CPPFLAGS += -D'GNULOCALEDIR="$(localedir)"' \
-D'LOCALE_ALIAS_PATH="$(localedir):$(nlsdir)"'
-D'LOCALE_ALIAS_PATH="$(localedir):$(i18ndir)"'
$(localedir)/locale.alias: locale.alias
$(do-install)
ifdef gettext-srcdir
%.h:: ../gpl2lgpl.sed $(gettext-srcdir)/intl/%.glibc; $(copysrc)
%.c:: ../gpl2lgpl.sed $(gettext-srcdir)/intl/%.c; $(copysrc)
%.h:: ../gpl2lgpl.sed $(gettext-srcdir)/intl/%.h; $(copysrc)
locale.alias:: ../gpl2lgpl.sed $(gettext-srcdir)/misc/locale.alias; $(copysrc)
define copysrc
sed -f $^ > $@.new
+16 -14
View File
@@ -1,8 +1,6 @@
/* dcgettext.c -- implementation of the dcgettext(3) function
Copyright (C) 1995 Free Software Foundation, Inc.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
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
@@ -16,8 +14,8 @@ 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., 675 Mass Ave,
Cambridge, MA 02139, USA. */
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
@@ -155,7 +153,7 @@ const char _nl_default_dirname[] = GNULOCALEDIR;
struct binding *_nl_domain_bindings;
/* Prototypes for local functions. */
static char *find_msg PARAMS ((struct loaded_domain *domain,
static char *find_msg PARAMS ((struct loaded_l10nfile *domain_file,
const char *msgid));
static const char *category_to_name PARAMS ((int category));
static const char *guess_category_value PARAMS ((int category,
@@ -180,7 +178,7 @@ DCGETTEXT (domainname, msgid, category)
const char *msgid;
int category;
{
struct loaded_domain *domain;
struct loaded_l10nfile *domain;
struct binding *binding;
const char *categoryname;
const char *categoryvalue;
@@ -355,18 +353,21 @@ weak_alias (__dcgettext, dcgettext);
static char *
find_msg (domain, msgid)
struct loaded_domain *domain;
find_msg (domain_file, msgid)
struct loaded_l10nfile *domain_file;
const char *msgid;
{
size_t top, act, bottom;
struct loaded_domain *domain;
if (domain->decided == 0)
_nl_load_domain (domain);
if (domain_file->decided == 0)
_nl_load_domain (domain_file);
if (domain->data == NULL)
if (domain_file->data == NULL)
return NULL;
domain = (struct loaded_domain *) domain_file->data;
/* Locate the MSGID and its translation. */
if (domain->hash_size > 2 && domain->hash_tab != NULL)
{
@@ -439,7 +440,8 @@ find_msg (domain, msgid)
/* Return string representation of locale CATEGORY. */
static const char *category_to_name (category)
static const char *
category_to_name (category)
int category;
{
const char *retval;
+167
View File
@@ -0,0 +1,167 @@
/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
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 <stdlib.h>
#include <string.h>
#include "loadinfo.h"
int
_nl_explode_name (name, language, modifier, territory, codeset,
normalized_codeset, special, sponsor, revision)
char *name;
const char **language;
const char **modifier;
const char **territory;
const char **codeset;
const char **normalized_codeset;
const char **special;
const char **sponsor;
const char **revision;
{
enum { undecided, xpg, cen } syntax;
char *cp;
int mask;
*modifier = NULL;
*territory = NULL;
*codeset = NULL;
*normalized_codeset = NULL;
*special = NULL;
*sponsor = NULL;
*revision = NULL;
/* Now we determine the single parts of the locale name. First
look for the language. Termination symbols are `_' and `@' if
we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */
mask = 0;
syntax = undecided;
*language = cp = name;
while (cp[0] != '\0' && cp[0] != '_' && cp[0] != '@'
&& cp[0] != '+' && cp[0] != ',')
++cp;
if (*language == cp)
/* This does not make sense: language has to be specified. Use
this entry as it is without exploding. Perhaps it is an alias. */
cp = strchr (*language, '\0');
else if (cp[0] == '_')
{
/* Next is the territory. */
cp[0] = '\0';
*territory = ++cp;
while (cp[0] != '\0' && cp[0] != '.' && cp[0] != '@'
&& cp[0] != '+' && cp[0] != ',' && cp[0] != '_')
++cp;
mask |= TERRITORY;
if (cp[0] == '.')
{
/* Next is the codeset. */
syntax = xpg;
cp[0] = '\0';
*codeset = ++cp;
while (cp[0] != '\0' && cp[0] != '@')
++cp;
mask |= XPG_CODESET;
if (*codeset != cp && (*codeset)[0] != '\0')
{
*normalized_codeset = _nl_normalize_codeset (*codeset,
cp - *codeset);
if (strcmp (*codeset, *normalized_codeset) == 0)
free ((char *) *normalized_codeset);
else
mask |= XPG_NORM_CODESET;
}
}
}
if (cp[0] == '@' || (syntax != xpg && cp[0] == '+'))
{
/* Next is the modifier. */
syntax = cp[0] == '@' ? xpg : cen;
cp[0] = '\0';
*modifier = ++cp;
while (syntax == cen && cp[0] != '\0' && cp[0] != '+'
&& cp[0] != ',' && cp[0] != '_')
++cp;
mask |= XPG_MODIFIER | CEN_AUDIENCE;
}
if (syntax != xpg && (cp[0] == '+' || cp[0] == ',' || cp[0] == '_'))
{
syntax = cen;
if (cp[0] == '+')
{
/* Next is special application (CEN syntax). */
cp[0] = '\0';
*special = ++cp;
while (cp[0] != '\0' && cp[0] != ',' && cp[0] != '_')
++cp;
mask |= CEN_SPECIAL;
}
if (cp[0] == ',')
{
/* Next is sponsor (CEN syntax). */
cp[0] = '\0';
*sponsor = ++cp;
while (cp[0] != '\0' && cp[0] != '_')
++cp;
mask |= CEN_SPONSOR;
}
if (cp[0] == '_')
{
/* Next is revision (CEN syntax). */
cp[0] = '\0';
*revision = ++cp;
mask |= CEN_REVISION;
}
}
/* For CEN sytnax values it might be important to have the
separator character in the file name, not for XPG syntax. */
if (syntax == xpg)
{
if (*territory != NULL && (*territory)[0] == '\0')
mask &= ~TERRITORY;
if (*codeset != NULL && (*codeset)[0] == '\0')
mask &= ~XPG_CODESET;
if (*modifier != NULL && (*modifier)[0] == '\0')
mask &= ~XPG_MODIFIER;
}
return mask;
}
+27 -387
View File
@@ -1,9 +1,6 @@
/* finddomain.c -- handle list of needed message catalogs
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
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
@@ -17,8 +14,8 @@ 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., 675 Mass Ave,
Cambridge, MA 02139, USA. */
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
@@ -71,39 +68,8 @@ void free ();
# define stpcpy(dest, src) __stpcpy(dest, src)
#endif
/* Encoding of locale name parts. */
#define CEN_REVISION 1
#define CEN_SPONSOR 2
#define CEN_SPECIAL 4
#define XPG_NORM_CODESET 8
#define XPG_CODESET 16
#define TERRITORY 32
#define CEN_AUDIENCE 64
#define XPG_MODIFIER 128
#define CEN_SPECIFIC (CEN_REVISION|CEN_SPONSOR|CEN_SPECIAL|CEN_AUDIENCE)
#define XPG_SPECIFIC (XPG_CODESET|XPG_NORM_CODESET|XPG_MODIFIER)
/* List of already loaded domains. */
static struct loaded_domain *_nl_loaded_domains;
/* Prototypes for local functions. */
static struct loaded_domain *make_entry_rec PARAMS ((const char *dirname,
int mask,
const char *language,
const char *territory,
const char *codeset,
const char *normalized_codeset,
const char *modifier,
const char *special,
const char *sponsor,
const char *revision,
const char *domainname,
int do_allocate));
/* Normalize name of selected codeset. */
static const char *normalize_codeset PARAMS ((const char *codeset));
static struct loaded_l10nfile *_nl_loaded_domains;
/* Substitution for systems lacking this function in their C library. */
#if !_LIBC && !HAVE_STPCPY
@@ -115,29 +81,25 @@ static char *stpcpy__ PARAMS ((char *dest, const char *src));
/* Return a data structure describing the message catalog described by
the DOMAINNAME and CATEGORY parameters with respect to the currently
established bindings. */
struct loaded_domain *
struct loaded_l10nfile *
_nl_find_domain (dirname, locale, domainname)
const char *dirname;
char *locale;
const char *domainname;
{
enum { undecided, xpg, cen } syntax;
struct loaded_domain *retval;
struct loaded_l10nfile *retval;
const char *language;
const char *modifier = NULL;
const char *territory = NULL;
const char *codeset = NULL;
const char *normalized_codeset = NULL;
const char *special = NULL;
const char *sponsor = NULL;
const char *revision = NULL;
const char *alias_value = NULL;
char *cp;
const char *modifier;
const char *territory;
const char *codeset;
const char *normalized_codeset;
const char *special;
const char *sponsor;
const char *revision;
const char *alias_value;
int mask;
/* CATEGORYVALUE now possibly contains a colon separated list of
locales. Each single locale can consist of up to four recognized
parts for the XPG syntax:
/* LOCALE can consist of up to four recognized parts for the XPG syntax:
language[_territory[.codeset]][@modifier]
@@ -160,15 +122,16 @@ _nl_find_domain (dirname, locale, domainname)
/* If we have already tested for this locale entry there has to
be one data set in the list of loaded domains. */
retval = make_entry_rec (dirname, 0, locale, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, domainname, 0);
retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
strlen (dirname) + 1, 0, locale, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, domainname, 0);
if (retval != NULL)
{
/* We know something about this locale. */
int cnt;
if (retval->decided == 0)
_nl_load_domain (retval); /* @@@ */
_nl_load_domain (retval);
if (retval->data != NULL)
return retval;
@@ -181,8 +144,6 @@ _nl_find_domain (dirname, locale, domainname)
if (retval->successor[cnt]->data != NULL)
break;
}
/* We really found some usable information. */
return cnt >= 0 ? retval : NULL;
/* NOTREACHED */
}
@@ -204,123 +165,16 @@ _nl_find_domain (dirname, locale, domainname)
/* Now we determine the single parts of the locale name. First
look for the language. Termination symbols are `_' and `@' if
we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */
mask = 0;
syntax = undecided;
language = cp = locale;
while (cp[0] != '\0' && cp[0] != '_' && cp[0] != '@'
&& cp[0] != '+' && cp[0] != ',')
++cp;
if (language == cp)
/* This does not make sense: language has to be specified. Use
this entry as it is without exploding. Perhaps it is an alias. */
cp = strchr (language, '\0');
else if (cp[0] == '_')
{
/* Next is the territory. */
cp[0] = '\0';
territory = ++cp;
while (cp[0] != '\0' && cp[0] != '.' && cp[0] != '@'
&& cp[0] != '+' && cp[0] != ',' && cp[0] != '_')
++cp;
mask |= TERRITORY;
if (cp[0] == '.')
{
/* Next is the codeset. */
syntax = xpg;
cp[0] = '\0';
codeset = ++cp;
while (cp[0] != '\0' && cp[0] != '@')
++cp;
mask |= XPG_CODESET;
if (codeset != cp && codeset[0] != '\0')
{
normalized_codeset = normalize_codeset (codeset);
if (strcmp (codeset, normalized_codeset) == 0)
free ((char *) normalized_codeset);
else
mask |= XPG_NORM_CODESET;
}
}
}
if (cp[0] == '@' || (syntax != xpg && cp[0] == '+'))
{
/* Next is the modifier. */
syntax = cp[0] == '@' ? xpg : cen;
cp[0] = '\0';
modifier = ++cp;
while (syntax == cen && cp[0] != '\0' && cp[0] != '+'
&& cp[0] != ',' && cp[0] != '_')
++cp;
mask |= XPG_MODIFIER | CEN_AUDIENCE;
}
if (syntax != xpg && (cp[0] == '+' || cp[0] == ',' || cp[0] == '_'))
{
syntax = cen;
if (cp[0] == '+')
{
/* Next is special application (CEN syntax). */
cp[0] = '\0';
special = ++cp;
while (cp[0] != '\0' && cp[0] != ',' && cp[0] != '_')
++cp;
mask |= CEN_SPECIAL;
}
if (cp[0] == ',')
{
/* Next is sponsor (CEN syntax). */
cp[0] = '\0';
sponsor = ++cp;
while (cp[0] != '\0' && cp[0] != '_')
++cp;
mask |= CEN_SPONSOR;
}
if (cp[0] == '_')
{
/* Next is revision (CEN syntax). */
cp[0] = '\0';
revision = ++cp;
mask |= CEN_REVISION;
}
}
/* For CEN sytnax values it might be important to have the
separator character in the file name, not for XPG syntax. */
if (syntax == xpg)
{
if (territory != NULL && territory[0] == '\0')
mask &= ~TERRITORY;
if (codeset != NULL && codeset[0] == '\0')
mask &= ~XPG_CODESET;
if (modifier != NULL && modifier[0] == '\0')
mask &= ~XPG_MODIFIER;
}
mask = _nl_explode_name (locale, &language, &modifier, &territory,
&codeset, &normalized_codeset, &special,
&sponsor, &revision);
/* Create all possible locale entries which might be interested in
generalzation. */
retval = make_entry_rec (dirname, mask, language, territory, codeset,
normalized_codeset, modifier, special, sponsor,
revision, domainname, 1);
retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
strlen (dirname) + 1, mask, language, territory,
codeset, normalized_codeset, modifier, special,
sponsor, revision, domainname, 1);
if (retval == NULL)
/* This means we are out of core. */
return NULL;
@@ -336,12 +190,7 @@ _nl_find_domain (dirname, locale, domainname)
_nl_load_domain (retval->successor[cnt]);
if (retval->successor[cnt]->data != NULL)
break;
/* Signal that locale is not available. */
retval->successor[cnt] = NULL;
}
if (retval->successor[cnt] == NULL)
retval = NULL;
}
/* The room for an alias was dynamically allocated. Free it now. */
@@ -351,215 +200,6 @@ _nl_find_domain (dirname, locale, domainname)
return retval;
}
static struct loaded_domain *
make_entry_rec (dirname, mask, language, territory, codeset,
normalized_codeset, modifier, special, sponsor, revision,
domain, do_allocate)
const char *dirname;
int mask;
const char *language;
const char *territory;
const char *codeset;
const char *normalized_codeset;
const char *modifier;
const char *special;
const char *sponsor;
const char *revision;
const char *domain;
int do_allocate;
{
char *filename = NULL;
struct loaded_domain *last = NULL;
struct loaded_domain *retval;
char *cp;
size_t entries;
int cnt;
/* Process the current entry described by the MASK only when it is
valid. Because the mask can have in the first call bits from
both syntaces set this is necessary to prevent constructing
illegal local names. */
/* FIXME: Rewrite because test is necessary only in first round. */
if ((mask & CEN_SPECIFIC) == 0 || (mask & XPG_SPECIFIC) == 0
|| ((mask & XPG_CODESET) != 0 && (mask & XPG_NORM_CODESET) != 0))
{
/* Allocate room for the full file name. */
filename = (char *) malloc (strlen (dirname) + 1
+ strlen (language)
+ ((mask & TERRITORY) != 0
? strlen (territory) + 1 : 0)
+ ((mask & XPG_CODESET) != 0
? strlen (codeset) + 1 : 0)
+ ((mask & XPG_NORM_CODESET) != 0
? strlen (normalized_codeset) + 1 : 0)
+ ((mask & XPG_MODIFIER) != 0 ?
strlen (modifier) + 1 : 0)
+ ((mask & CEN_SPECIAL) != 0
? strlen (special) + 1 : 0)
+ ((mask & CEN_SPONSOR) != 0
? strlen (sponsor) + 1 : 0)
+ ((mask & CEN_REVISION) != 0
? strlen (revision) + 1 : 0) + 1
+ strlen (domain) + 1);
if (filename == NULL)
return NULL;
retval = NULL;
last = NULL;
/* Construct file name. */
cp = stpcpy (filename, dirname);
*cp++ = '/';
cp = stpcpy (cp, language);
if ((mask & TERRITORY) != 0)
{
*cp++ = '_';
cp = stpcpy (cp, territory);
}
if ((mask & XPG_CODESET) != 0)
{
*cp++ = '.';
cp = stpcpy (cp, codeset);
}
if ((mask & XPG_NORM_CODESET) != 0)
{
*cp++ = '.';
cp = stpcpy (cp, normalized_codeset);
}
if ((mask & (XPG_MODIFIER | CEN_AUDIENCE)) != 0)
{
/* This component can be part of both syntaces but has different
leading characters. For CEN we use `+', else `@'. */
*cp++ = (mask & CEN_AUDIENCE) != 0 ? '+' : '@';
cp = stpcpy (cp, modifier);
}
if ((mask & CEN_SPECIAL) != 0)
{
*cp++ = '+';
cp = stpcpy (cp, special);
}
if ((mask & CEN_SPONSOR) != 0)
{
*cp++ = ',';
cp = stpcpy (cp, sponsor);
}
if ((mask & CEN_REVISION) != 0)
{
*cp++ = '_';
cp = stpcpy (cp, revision);
}
*cp++ = '/';
stpcpy (cp, domain);
/* Look in list of already loaded domains whether it is already
available. */
last = NULL;
for (retval = _nl_loaded_domains; retval != NULL; retval = retval->next)
if (retval->filename != NULL)
{
int compare = strcmp (retval->filename, filename);
if (compare == 0)
/* We found it! */
break;
if (compare < 0)
{
/* It's not in the list. */
retval = NULL;
break;
}
last = retval;
}
if (retval != NULL || do_allocate == 0)
{
free (filename);
return retval;
}
}
retval = (struct loaded_domain *) malloc (sizeof (*retval));
if (retval == NULL)
return NULL;
retval->filename = filename;
retval->decided = 0;
if (last == NULL)
{
retval->next = _nl_loaded_domains;
_nl_loaded_domains = retval;
}
else
{
retval->next = last->next;
last->next = retval;
}
entries = 0;
for (cnt = 254; cnt >= 0; --cnt)
if (cnt < mask && (cnt & ~mask) == 0
&& ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0)
&& ((cnt & XPG_CODESET) == 0 || (cnt & XPG_NORM_CODESET) == 0))
retval->successor[entries++] = make_entry_rec (dirname, cnt,
language, territory,
codeset,
normalized_codeset,
modifier, special,
sponsor, revision,
domain, 1);
retval->successor[entries] = NULL;
return retval;
}
static const char *
normalize_codeset (codeset)
const char *codeset;
{
int len = 0;
int only_digit = 1;
const char *cp;
char *retval;
char *wp;
for (cp = codeset; cp[0] != '\0'; ++cp)
if (isalnum (cp[0]))
{
++len;
if (isalpha (cp[0]))
only_digit = 0;
}
retval = (char *) malloc ((only_digit ? 3 : 0) + len + 1);
if (retval != NULL)
{
if (only_digit)
wp = stpcpy (retval, "ISO");
else
wp = retval;
for (cp = codeset; cp[0] != '\0'; ++cp)
if (isalpha (cp[0]))
*wp++ = toupper (cp[0]);
else if (isdigit (cp[0]))
*wp++ = cp[0];
*wp = '\0';
}
return (const char *) retval;
}
/* @@ begin of epilog @@ */
/* We don't want libintl.a to depend on any other library. So we
+10 -18
View File
@@ -1,8 +1,6 @@
/* gettextP.h -- header describing internals of gettext library
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
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
@@ -16,12 +14,14 @@ 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., 675 Mass Ave,
Cambridge, MA 02139, USA. */
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef _GETTEXTP_H
#define _GETTEXTP_H
#include "loadinfo.h"
/* @@ end of prolog @@ */
#ifndef PARAMS
@@ -49,12 +49,6 @@ SWAP (i)
struct loaded_domain
{
struct loaded_domain *next;
struct loaded_domain *successor[63];
const char *filename;
int decided;
const char *data;
int must_swap;
nls_uint32 nstrings;
@@ -71,12 +65,10 @@ struct binding
char *dirname;
};
struct loaded_domain *_nl_find_domain PARAMS ((const char *__dirname,
char *__locale,
const char *__domainname));
void _nl_load_domain PARAMS ((struct loaded_domain *__domain));
const char *_nl_expand_alias PARAMS ((const char *__name));
struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname,
char *__locale,
const char *__domainname));
void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain));
/* @@ begin of epilog @@ */
+262
View File
@@ -0,0 +1,262 @@
/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
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 <argz.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include "loadinfo.h"
/* Return number of bits set in X. */
static int pop __P ((int x));
static inline int
pop (x)
int x;
{
/* We assume that no more than 16 bits are used. */
x = ((x & ~0x5555) >> 1) + (x & 0x5555);
x = ((x & ~0x3333) >> 2) + (x & 0x3333);
x = ((x >> 4) + x) & 0x0f0f;
x = ((x >> 8) + x) & 0xff;
return x;
}
struct loaded_l10nfile *
_nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
territory, codeset, normalized_codeset, modifier, special,
sponsor, revision, filename, do_allocate)
struct loaded_l10nfile **l10nfile_list;
const char *dirlist;
size_t dirlist_len;
int mask;
const char *language;
const char *territory;
const char *codeset;
const char *normalized_codeset;
const char *modifier;
const char *special;
const char *sponsor;
const char *revision;
const char *filename;
int do_allocate;
{
char *abs_filename;
struct loaded_l10nfile *last = NULL;
struct loaded_l10nfile *retval;
char *cp;
size_t entries;
int cnt;
/* Allocate room for the full file name. */
abs_filename = (char *) malloc (dirlist_len
+ strlen (language)
+ ((mask & TERRITORY) != 0
? strlen (territory) + 1 : 0)
+ ((mask & XPG_CODESET) != 0
? strlen (codeset) + 1 : 0)
+ ((mask & XPG_NORM_CODESET) != 0
? strlen (normalized_codeset) + 1 : 0)
+ (((mask & XPG_MODIFIER) != 0
|| (mask & CEN_AUDIENCE) != 0) ?
strlen (modifier) + 1 : 0)
+ ((mask & CEN_SPECIAL) != 0
? strlen (special) + 1 : 0)
+ ((mask & CEN_SPONSOR) != 0
? strlen (sponsor) + 1 : 0)
+ ((mask & CEN_REVISION) != 0
? strlen (revision) + 1 : 0)
+ 1 + strlen (filename) + 1);
if (abs_filename == NULL)
return NULL;
retval = NULL;
last = NULL;
/* Construct file name. */
memcpy (abs_filename, dirlist, dirlist_len);
__argz_stringify (abs_filename, dirlist_len, ':');
cp = abs_filename + (dirlist_len - 1);
*cp++ = '/';
cp = stpcpy (cp, language);
if ((mask & TERRITORY) != 0)
{
*cp++ = '_';
cp = stpcpy (cp, territory);
}
if ((mask & XPG_CODESET) != 0)
{
*cp++ = '.';
cp = stpcpy (cp, codeset);
}
if ((mask & XPG_NORM_CODESET) != 0)
{
*cp++ = '.';
cp = stpcpy (cp, normalized_codeset);
}
if ((mask & (XPG_MODIFIER | CEN_AUDIENCE)) != 0)
{
/* This component can be part of both syntaces but has different
leading characters. For CEN we use `+', else `@'. */
*cp++ = (mask & CEN_AUDIENCE) != 0 ? '+' : '@';
cp = stpcpy (cp, modifier);
}
if ((mask & CEN_SPECIAL) != 0)
{
*cp++ = '+';
cp = stpcpy (cp, special);
}
if ((mask & CEN_SPONSOR) != 0)
{
*cp++ = ',';
cp = stpcpy (cp, sponsor);
}
if ((mask & CEN_REVISION) != 0)
{
*cp++ = '_';
cp = stpcpy (cp, revision);
}
*cp++ = '/';
stpcpy (cp, filename);
/* Look in list of already loaded domains whether it is already
available. */
last = NULL;
for (retval = *l10nfile_list; retval != NULL; retval = retval->next)
if (retval->filename != NULL)
{
int compare = strcmp (retval->filename, abs_filename);
if (compare == 0)
/* We found it! */
break;
if (compare < 0)
{
/* It's not in the list. */
retval = NULL;
break;
}
last = retval;
}
if (retval != NULL || do_allocate == 0)
{
free (abs_filename);
return retval;
}
retval = (struct loaded_l10nfile *)
malloc (sizeof (*retval) + (__argz_count (dirlist, dirlist_len)
* (1 << pop (mask))
* sizeof (struct loaded_l10nfile *)));
if (retval == NULL)
return NULL;
retval->filename = abs_filename;
retval->decided = (__argz_count (dirlist, dirlist_len) != 1
|| ((mask & XPG_CODESET) != 0
&& (mask & XPG_NORM_CODESET) != 0));
retval->data = NULL;
if (last == NULL)
{
retval->next = *l10nfile_list;
*l10nfile_list = retval;
}
else
{
retval->next = last->next;
last->next = retval;
}
entries = 0;
/* If the DIRLIST is a real list the RETVAL entry correcponds not to
a real file. So we have to use the DIRLIST separation machanism
of the inner loop. */
cnt = __argz_count (dirlist, dirlist_len) == 1 ? mask - 1 : mask;
for (; cnt >= 0; --cnt)
if ((cnt & ~mask) == 0
&& ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0)
&& ((cnt & XPG_CODESET) == 0 || (cnt & XPG_NORM_CODESET) == 0))
{
/* Iterate over all elements of the DIRLIST. */
char *dir = NULL;
while ((dir = __argz_next ((char *) dirlist, dirlist_len, dir))
!= NULL)
retval->successor[entries++]
= _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1, cnt,
language, territory, codeset,
normalized_codeset, modifier, special,
sponsor, revision, filename, 1);
}
retval->successor[entries] = NULL;
return retval;
}
/* Normalize codeset name. There is no standard for the codeset
names. Normalization allows the user to use any of the common
names. */
const char *
_nl_normalize_codeset (codeset, name_len)
const char *codeset;
size_t name_len;
{
int len = 0;
int only_digit = 1;
char *retval;
char *wp;
size_t cnt;
for (cnt = 0; cnt < name_len; ++cnt)
if (isalnum (codeset[cnt]))
{
++len;
if (isalpha (codeset[cnt]))
only_digit = 0;
}
retval = (char *) malloc ((only_digit ? 3 : 0) + len + 1);
if (retval != NULL)
{
if (only_digit)
wp = stpcpy (retval, "ISO");
else
wp = retval;
for (cnt = 0; cnt < name_len; ++cnt)
if (isalpha (codeset[cnt]))
*wp++ = tolower (codeset[cnt]);
else if (isdigit (codeset[cnt]))
*wp++ = codeset[cnt];
*wp = '\0';
}
return (const char *) retval;
}
+48
View File
@@ -0,0 +1,48 @@
/* Encoding of locale name parts. */
#define CEN_REVISION 1
#define CEN_SPONSOR 2
#define CEN_SPECIAL 4
#define XPG_NORM_CODESET 8
#define XPG_CODESET 16
#define TERRITORY 32
#define CEN_AUDIENCE 64
#define XPG_MODIFIER 128
#define CEN_SPECIFIC (CEN_REVISION|CEN_SPONSOR|CEN_SPECIAL|CEN_AUDIENCE)
#define XPG_SPECIFIC (XPG_CODESET|XPG_NORM_CODESET|XPG_MODIFIER)
struct loaded_l10nfile
{
const char *filename;
int decided;
const void *data;
struct loaded_l10nfile *next;
struct loaded_l10nfile *successor[1];
};
extern const char *_nl_normalize_codeset __P ((const char *codeset,
size_t name_len));
extern struct loaded_l10nfile *
_nl_make_l10nflist __P ((struct loaded_l10nfile **l10nfile_list,
const char *dirlist, size_t dirlist_len, int mask,
const char *language, const char *territory,
const char *codeset, const char *normalized_codeset,
const char *modifier, const char *special,
const char *sponsor, const char *revision,
const char *filename, int do_allocate));
extern const char *_nl_expand_alias __P ((const char *name));
extern int _nl_explode_name __P ((char *name, const char **language,
const char **modifier,
const char **territory,
const char **codeset,
const char **normalized_codeset,
const char **special, const char **sponsor,
const char **revision));
+20 -14
View File
@@ -1,8 +1,6 @@
/* loadmsgcat.c -- load needed message catalogs
Copyright (C) 1995 Software Foundation, Inc.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
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
@@ -16,8 +14,8 @@ 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., 675 Mass Ave,
Cambridge, MA 02139, USA. */
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
@@ -65,8 +63,8 @@ int _nl_msg_cat_cntr;
/* Load the message catalogs specified by FILENAME. If it is no valid
message catalog do nothing. */
void
_nl_load_domain (domain)
struct loaded_domain *domain;
_nl_load_domain (domain_file)
struct loaded_l10nfile *domain_file;
{
int fd;
struct stat st;
@@ -75,19 +73,20 @@ _nl_load_domain (domain)
|| defined _LIBC
int use_mmap = 0;
#endif
struct loaded_domain *domain;
domain->decided = 1;
domain->data = NULL;
domain_file->decided = 1;
domain_file->data = NULL;
/* If the record does not represent a valid locale the FILENAME
might be NULL. This can happen when according to the given
specification the locale file name is different for XPG and CEN
syntax. */
if (domain->filename == NULL)
if (domain_file->filename == NULL)
return;
/* Try to open the addressed file. */
fd = open (domain->filename, O_RDONLY);
fd = open (domain_file->filename, O_RDONLY);
if (fd == -1)
return;
@@ -160,6 +159,12 @@ _nl_load_domain (domain)
return;
}
domain_file->data
= (struct loaded_domain *) malloc (sizeof (struct loaded_domain *));
if (domain->data == NULL)
return;
domain = (struct loaded_domain *) domain_file->data;
domain->data = (char *) data;
domain->must_swap = data->magic != _MAGIC;
@@ -185,11 +190,12 @@ _nl_load_domain (domain)
else
#endif
free (data);
domain->data = NULL;
free (domain);
domain_file->data = NULL;
return;
}
/* Show that one domain is changed. This might make some cached
translation invalid. */
translations invalid. */
++_nl_msg_cat_cntr;
}
+52
View File
@@ -0,0 +1,52 @@
# Locale name alias data base
# Copyright (C) 1996 Free Software Foundation, Inc.
#
# This program 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 program 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 program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# The format of this file is the same as for the corresponding file of
# the X Window System, which normally can be found in
# /usr/lib/X11/locale/locale.alias
# A single line contains two fields: an alias and a substitution value.
# All entries are case independent.
# Note: This file is far from being complete. If you have a value for
# your own site which you think might be useful for others too, share it
# with the rest of us. Send it to bug-gnu-utils@prep.ai.mit.edu.
czech cz_CZ.ISO-8859-2
danish da_DK.ISO-8859-1
dansk da_DK.ISO-8859-1
deutsch de_DE.ISO-8859-1
dutch nl_NL.ISO-8859-1
finnish fi_FI.ISO-8859-1
français fr_FR.ISO-8859-1
french fr_FR.ISO-8859-1
german de_DE.ISO-8859-1
greek el_GR.ISO-8859-7
hebrew iw_IL.ISO-8859-8
hungarian hu_HU.ISO-8859-2
icelandic is_IS.ISO-8859-1
italian it_CH.ISO-8859-1
japanese ja_JP.EUC
norwegian no_NO.ISO-8859-1
polish pl_PL.ISO-8859-2
portuguese pt_PT.ISO-8859-1
rumanian ro_RO.ISO-8859-2
russian ru_SU.ISO-8859-5
slovak sk_SK.ISO-8859-2
slovene sl_CS.ISO-8859-2
spanish es_ES.ISO-8859-1
swedish sv_SE.ISO-8859-1
turkish tr_TR.ISO-8859-9
+7 -1
View File
@@ -21,7 +21,7 @@
#
subdir := io
headers := sys/stat.h statbuf.h \
headers := sys/stat.h statbuf.h sys/statfs.h statfsbuf.h \
fcntl.h sys/fcntl.h fcntlbits.h \
poll.h sys/poll.h \
utime.h ftw.h fts.h
@@ -31,6 +31,7 @@ routines := \
mkfifo \
stat fstat lstat mknod \
xstat fxstat lxstat xmknod \
statfs fstatfs \
umask chmod fchmod mkdir \
open close read write lseek access euidaccess \
fcntl flock lockf \
@@ -44,6 +45,11 @@ routines := \
unlink rmdir \
ftw fts poll
# These routines will be omitted from the libc shared object.
# Instead the static object files will be included in a special archive
# linked against when the shared library will be used.
static-only-routines = stat fstat lstat mknod
others := pwd
tests := test-utime
+3 -3
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992, 1994, 1995 Free Software Foundation, Inc.
/* Copyright (C) 1991, 92, 94, 95, 96 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
@@ -13,7 +13,7 @@ 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, 1992 Free Software Foundation, Inc., 675 Mass Ave,
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
/*
@@ -70,7 +70,7 @@ extern int creat __P ((__const char *__file, __mode_t __mode));
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_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. */
+1 -1
View File
@@ -13,7 +13,7 @@ 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, 1992 Free Software Foundation, Inc., 675 Mass Ave,
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
/*
+41
View File
@@ -0,0 +1,41 @@
/* Definitions for getting information about a filesystem.
Copyright (C) 1996 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., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#ifndef _SYS_STATFS_H
#define _SYS_STATFS_H 1
#include <features.h>
/* Get the system-specific definition of `struct statfs'. */
#include <statfsbuf.h>
__BEGIN_DECLS
/* Return information about the filesystem on which FILE resides. */
extern int __statfs __P ((__const char *__file, struct statfs *__buf));
extern int statfs __P ((__const char *__file, struct statfs *__buf));
/* Return information about the filesystem containing the file FILDES
refers to. */
extern int __fstatfs __P ((int __fildes, struct statfs *__buf));
extern int fstatfs __P ((int __fildes, struct statfs *__buf));
__END_DECLS
#endif /* sys/statfs.h */
+2 -2
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1992, 1996 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
@@ -13,7 +13,7 @@ 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, 1992 Free Software Foundation, Inc., 675 Mass Ave,
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
/*
+28 -4
View File
@@ -1,10 +1,34 @@
/* Copyright (C) 1995, 1996 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 "libioP.h"
#include "stdio.h"
void
clearerr(fp)
FILE* fp;
clearerr (fp)
FILE *fp;
{
CHECK_FILE(fp, /*nothing*/);
_IO_clearerr(fp);
CHECK_FILE (fp, /*nothing*/);
flockfile (fp);
_IO_clearerr (fp);
funlockfile (fp);
}
#ifdef _IO_MTSAFE_IO
weak_alias (clearerr, clearerr_locked)
#endif
+30
View File
@@ -0,0 +1,30 @@
/* Copyright (C) 1995, 1996 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 "libioP.h"
#include "stdio.h"
void
__clearerr_unlocked (fp)
FILE *fp;
{
CHECK_FILE (fp, /*nothing*/);
_IO_clearerr (fp);
}
weak_alias (clearerr_unlocked, __clearerr_unlocked)
+16 -5
View File
@@ -1,5 +1,4 @@
/*
Copyright (C) 1993 Free Software Foundation
/* Copyright (C) 1993, 1996 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
@@ -26,9 +25,21 @@ the executable file might be covered by the GNU General Public License. */
#include "stdio.h"
int
feof(fp)
feof (fp)
_IO_FILE* fp;
{
CHECK_FILE(fp, EOF);
return _IO_feof(fp);
int result;
CHECK_FILE (fp, EOF);
_IO_flockfile (fp);
result = _IO_feof_unlocked (fp);
_IO_funlockfile (fp);
return result;
}
#ifdef _IO_MTSAFE_IO
/* The feof implementation for libio does not require locking because
it only accesses once a single variable and this is already atomic
(at least at thread level). */
weak_alias (feof, feof_locked)
#endif
+33
View File
@@ -0,0 +1,33 @@
/* Copyright (C) 1993, 1996 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"
int
feof_unlocked (fp)
_IO_FILE* fp;
{
CHECK_FILE (fp, EOF);
return _IO_feof_unlocked (fp);
}
+11 -3
View File
@@ -1,5 +1,4 @@
/*
Copyright (C) 1993, 1995 Free Software Foundation
/* Copyright (C) 1993, 1995, 1996 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
@@ -29,6 +28,15 @@ int
ferror (fp)
_IO_FILE* fp;
{
int result;
CHECK_FILE (fp, EOF);
return _IO_ferror (fp);
_IO_flockfile (fp);
result = _IO_ferror_unlocked (fp);
_IO_funlockfile (fp);
return result;
}
#ifdef _IO_MTSAFE_IO
weak_alias (ferror, ferror_locked)
#endif
+33
View File
@@ -0,0 +1,33 @@
/* Copyright (C) 1993, 1995, 1996 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"
int
ferror_unlocked (fp)
_IO_FILE* fp;
{
CHECK_FILE (fp, EOF);
return _IO_ferror_unlocked (fp);
}
+5 -1
View File
@@ -29,6 +29,10 @@ int
fgetc (fp)
FILE *fp;
{
int result;
CHECK_FILE (fp, EOF);
return _IO_getc (fp);
flockfile (fp);
result = _IO_getc_unlocked (fp);
funlockfile (fp);
return result;
}
+10 -1
View File
@@ -1,5 +1,5 @@
/*
Copyright (C) 1993, 1995 Free Software Foundation
Copyright (C) 1993, 1995, 1996 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
@@ -36,3 +36,12 @@ fileno (fp)
return _IO_fileno (fp);
}
#ifdef _IO_MTSAFE_IO
/* The fileno implementation for libio does not require locking because
it only accesses once a single variable and this is already atomic
(at least at thread level). */
weak_alias (fileno_unlocked, fileno)
weak_alias (fileno_locked, fileno)
#endif
+6 -2
View File
@@ -1,5 +1,5 @@
/*
Copyright (C) 1993 Free Software Foundation
Copyright (C) 1993, 1996 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
@@ -30,6 +30,10 @@ fputc (c, fp)
int c;
_IO_FILE *fp;
{
int result;
CHECK_FILE (fp, EOF);
return _IO_putc (c, fp);
_IO_flockfile (fp);
result = _IO_putc_unlocked (c, fp);
_IO_funlockfile (fp);
return result;
}
+39
View File
@@ -0,0 +1,39 @@
/*
Copyright (C) 1993, 1996 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"
#undef fputc_unlocked
int
__fputc_unlocked (c, fp)
int c;
_IO_FILE *fp;
{
CHECK_FILE (fp, EOF);
return _IO_putc_unlocked (c, fp);
}
weak_alias (fputc_unlocked, __fputc_unlocked)
+6 -2
View File
@@ -1,5 +1,5 @@
/*
Copyright (C) 1993, 1995 Free Software Foundation
Copyright (C) 1993, 1995, 1996 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
@@ -31,8 +31,12 @@ freopen (filename, mode, fp)
const char* mode;
FILE* fp;
{
FILE *result;
CHECK_FILE (fp, NULL);
if (!(fp->_flags & _IO_IS_FILEBUF))
return NULL;
return _IO_freopen (filename, mode, fp);
flockfile (fp);
result = _IO_freopen (filename, mode, fp);
funlockfile (fp);
return result;
}
+5 -1
View File
@@ -31,6 +31,10 @@ fseek (fp, offset, whence)
long int offset;
int whence;
{
int result;
CHECK_FILE (fp, -1);
return _IO_fseek (fp, offset, whence);
flockfile (fp);
result = _IO_fseek (fp, offset, whence);
funlockfile (fp);
return result;
}
+7
View File
@@ -465,6 +465,9 @@ DEFUN(_IO_init, (fp, flags),
fp->_IO_save_end = NULL;
fp->_markers = NULL;
fp->_cur_column = 0;
#ifdef _IO_MTSAFE_IO
_IO_mutex_init (fp->_lock);
#endif
}
int
@@ -497,6 +500,10 @@ DEFUN(_IO_default_finish, (fp),
fp->_IO_save_base = NULL;
}
#ifdef _IO_MTSAFE_IO
_IO_mutex_destroy (fp->_lock);
#endif
_IO_un_link(fp);
}
+15 -4
View File
@@ -1,5 +1,5 @@
/*
Copyright (C) 1993, 1995 Free Software Foundation
Copyright (C) 1993, 1995, 1996 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
@@ -28,8 +28,19 @@ the executable file might be covered by the GNU General Public License. */
#undef getc
int
getc (stream)
FILE *stream;
getc (fp)
FILE *fp;
{
return _IO_getc (stream);
int result;
CHECK_FILE (fp, EOF);
_IO_flockfile (fp);
result = _IO_getc_unlocked (fp);
_IO_funlockfile (fp);
return result;
}
#ifdef _IO_MTSAFE_IO
# undef getc_locked
weak_alias (getc_locked, getc)
#endif
+38
View File
@@ -0,0 +1,38 @@
/*
Copyright (C) 1993, 1995, 1996 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"
#undef getc_unlocked
int
__getc_unlocked (fp)
FILE *fp;
{
CHECK_FILE (fp, EOF);
return _IO_getc_unlocked (fp);
}
weak_alias (getc_unlocked, __getc_unlocked)
+12 -2
View File
@@ -1,5 +1,5 @@
/*
Copyright (C) 1993 Free Software Foundation
Copyright (C) 1993, 1996 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
@@ -30,5 +30,15 @@ the executable file might be covered by the GNU General Public License. */
int
getchar ()
{
return _IO_getc (stdin);
int result;
_IO_flockfile (stdin);
result = _IO_getc_unlocked (stdin);
_IO_funlockfile (stdin);
return result;
}
#ifdef _IO_MTSAFE_IO
# undef getchar_locked
weak_alias (getchar_locked, getchar)
#endif
+36
View File
@@ -0,0 +1,36 @@
/*
Copyright (C) 1993, 1996 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"
#undef getchar_unlocked
int
__getchar_unlocked ()
{
return _IO_getc_unlocked (stdin);
}
weak_alias (getchar_unlocked, __getchar_unlocked)
+2
View File
@@ -35,6 +35,7 @@ _IO_fclose (fp)
CHECK_FILE(fp, EOF);
_IO_flockfile (fp);
if (fp->_IO_file_flags & _IO_IS_FILEBUF)
status = _IO_file_close_it (fp);
else
@@ -45,6 +46,7 @@ _IO_fclose (fp)
fp->_IO_file_flags = 0;
free(fp);
}
_IO_funlockfile (fp);
return status;
}
+9 -1
View File
@@ -32,9 +32,17 @@ _IO_fflush (fp)
return _IO_flush_all ();
else
{
int result;
_IO_flockfile (fp);
CHECK_FILE (fp, EOF);
return _IO_SYNC (fp) ? EOF : 0;
result = _IO_SYNC (fp) ? EOF : 0;
_IO_funlockfile (fp);
return result;
}
}
weak_alias (_IO_fflush, fflush)
#ifdef _IO_MTSAFE_IO
weak_alias (_IO_fflush, fflush_locked)
#endif
+41
View File
@@ -0,0 +1,41 @@
/*
Copyright (C) 1993, 1995, 1996 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"
int
_IO_fflush_unlocked (fp)
register _IO_FILE *fp;
{
if (fp == NULL)
return _IO_flush_all ();
else
{
CHECK_FILE (fp, EOF);
return _IO_SYNC (fp) ? EOF : 0;
}
}
weak_alias (_IO_fflush_unlocked, fflush_unlocked)
+2
View File
@@ -33,7 +33,9 @@ _IO_fgetpos (fp, posp)
{
_IO_fpos_t pos;
CHECK_FILE (fp, EOF);
_IO_flockfile (fp);
pos = _IO_seekoff (fp, 0, _IO_seek_cur, 0);
_IO_funlockfile (fp);
if (pos == _IO_pos_BAD)
{
#ifdef EIO
+10 -3
View File
@@ -31,14 +31,21 @@ _IO_fgets (buf, n, fp)
_IO_FILE* fp;
{
_IO_size_t count;
char *result;
CHECK_FILE (fp, NULL);
if (n <= 0)
return NULL;
_IO_flockfile (fp);
count = _IO_getline (fp, buf, n - 1, '\n', 1);
if (count == 0 || (fp->_IO_file_flags & _IO_ERR_SEEN))
return NULL;
buf[count] = 0;
return buf;
result = NULL;
else
{
buf[count] = '\0';
result = buf;
}
_IO_funlockfile (fp);
return result;
}
weak_alias (_IO_fgets, fgets)
+9 -4
View File
@@ -1,5 +1,5 @@
/*
Copyright (C) 1993 Free Software Foundation
Copyright (C) 1993, 1996 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
@@ -31,10 +31,15 @@ _IO_fputs (str, fp)
_IO_FILE *fp;
{
_IO_size_t len = strlen (str);
int result;
CHECK_FILE (fp, EOF);
if (_IO_sputn( fp, str, len) != len)
return EOF;
return 1;
_IO_flockfile (fp);
if (_IO_sputn (fp, str, len) != len)
result = EOF;
else
result = 1;
_IO_funlockfile (fp);
return result;
}
weak_alias (_IO_fputs, fputs)
+2
View File
@@ -36,7 +36,9 @@ _IO_fread (buf, size, count, fp)
CHECK_FILE (fp, 0);
if (bytes_requested == 0)
return 0;
_IO_flockfile (fp);
bytes_read = _IO_sgetn (fp, (char *) buf, bytes_requested);
_IO_funlockfile (fp);
return bytes_requested == bytes_read ? count : bytes_read / size;
}
weak_alias (_IO_fread, fread)
+7 -2
View File
@@ -30,7 +30,9 @@ _IO_fsetpos (fp, posp)
_IO_FILE* fp;
const _IO_fpos_t *posp;
{
int result;
CHECK_FILE (fp, EOF);
_IO_flockfile (fp);
if (_IO_seekpos (fp, *posp, _IOS_INPUT|_IOS_OUTPUT) == _IO_pos_BAD)
{
/*ANSI explicily requires setting errno to a positive value on failure.*/
@@ -38,9 +40,12 @@ _IO_fsetpos (fp, posp)
if (errno == 0)
errno = EIO;
#endif
return EOF;
result = EOF;
}
return 0;
else
result = 0;
_IO_funlockfile (fp);
return result;
}
weak_alias (_IO_fsetpos, fsetpos)
+2
View File
@@ -32,7 +32,9 @@ _IO_ftell (fp)
{
_IO_pos_t pos;
CHECK_FILE (fp, -1L);
_IO_flockfile (fp);
pos = _IO_seekoff (fp, 0, _IO_seek_cur, 0);
_IO_funlockfile (fp);
if (pos == _IO_pos_BAD)
{
#ifdef EIO
+2
View File
@@ -36,7 +36,9 @@ _IO_fwrite (buf, size, count, fp)
CHECK_FILE (fp, 0);
if (request == 0)
return 0;
_IO_flockfile (fp);
written = _IO_sputn (fp, (const char *) buf, request);
_IO_funlockfile (fp);
/* Many traditional implementations return 0 if size==0 && count > 0,
but ANSI seems to require us to return count in this case. */
if (written == request)
+24 -6
View File
@@ -42,6 +42,7 @@ _IO_getdelim (lineptr, n, delimiter, fp)
int delimiter;
_IO_FILE *fp;
{
int result;
register _IO_ssize_t cur_len = 0;
_IO_ssize_t len;
@@ -53,22 +54,32 @@ _IO_getdelim (lineptr, n, delimiter, fp)
return -1;
}
CHECK_FILE (fp, -1);
if (_IO_ferror (fp))
return -1;
_IO_flockfile (fp);
if (_IO_ferror_unlocked (fp))
{
result = -1;
goto unlock_return;
}
if (*lineptr == NULL || *n == 0)
{
*n = 120;
*lineptr = (char *) malloc (*n);
if (*lineptr == NULL)
return -1;
{
result = -1;
goto unlock_return;
}
}
len = fp->_IO_read_end - fp->_IO_read_ptr;
if (len <= 0)
{
if (__underflow (fp) == EOF)
return -1;
{
result = -1;
goto unlock_return;
}
len = fp->_IO_read_end - fp->_IO_read_ptr;
}
@@ -88,7 +99,10 @@ _IO_getdelim (lineptr, n, delimiter, fp)
*n = needed;
*lineptr = (char *) realloc (*lineptr, needed);
if (*lineptr == NULL)
return -1;
{
result = -1;
goto unlock_return;
}
}
memcpy (*lineptr + cur_len, (void *) fp->_IO_read_ptr, len);
fp->_IO_read_ptr += len;
@@ -98,7 +112,11 @@ _IO_getdelim (lineptr, n, delimiter, fp)
len = fp->_IO_read_end - fp->_IO_read_ptr;
}
(*lineptr)[cur_len] = '\0';
return cur_len;
result = cur_len;
unlock_return:
_IO_funlockfile (fp);
return result;
}
weak_alias (_IO_getdelim, __getdelim)
+5 -1
View File
@@ -30,7 +30,10 @@ _IO_gets (buf)
char* buf;
{
_IO_size_t count;
int ch = _IO_getc (_IO_stdin);
int ch;
_IO_flockfile (_IO_stdin);
ch = _IO_getc_unlocked (_IO_stdin);
if (ch == EOF)
return NULL;
if (ch == '\n')
@@ -42,6 +45,7 @@ _IO_gets (buf)
if (_IO_stdin->_IO_file_flags & _IO_ERR_SEEN)
return NULL;
}
_IO_funlockfile (_IO_stdin);
buf[count] = 0;
return buf;
}
+10 -6
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 1993 Free Software Foundation
/* Copyright (C) 1993, 1996 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
@@ -28,11 +28,15 @@ int
_IO_puts (str)
const char *str;
{
int result;
_IO_size_t len = strlen (str);
if (_IO_sputn (_IO_stdout, str, len) != len)
return EOF;
if (_IO_putc ('\n', _IO_stdout) == EOF)
return EOF;
return len+1;
_IO_flockfile (fp);
if (_IO_sputn (_IO_stdout, str, len) == len
&& _IO_putc_unlocked ('\n', _IO_stdout) != EOF)
result = len + 1;
else
result = EOF;
_IO_funlockfile (fp);
return result;
}
weak_alias (_IO_puts, puts)
+5 -1
View File
@@ -1,5 +1,5 @@
/*
Copyright (C) 1993 Free Software Foundation
Copyright (C) 1993, 1995, 1996 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
@@ -31,8 +31,12 @@ _IO_setbuffer (fp, buf, size)
_IO_size_t size;
{
CHECK_FILE (fp, );
_IO_flockfile (fp);
fp->_flags &= ~_IO_LINE_BUF;
if (!buf)
size = 0;
(void) _IO_SETBUF (fp, buf, size);
_IO_funlockfile (fp);
}
weak_alias (_IO_setbuffer, setbuffer)
+18 -5
View File
@@ -35,7 +35,9 @@ _IO_setvbuf (fp, buf, mode, size)
int mode;
_IO_size_t size;
{
int result;
CHECK_FILE (fp, EOF);
_IO_flockfile (fp);
switch (mode)
{
case _IOFBF:
@@ -58,25 +60,36 @@ _IO_setvbuf (fp, buf, mode, size)
A possibly cleaner alternative would be to add an
extra flag, but then flags are a finite resource. */
if (_IO_DOALLOCATE (fp) < 0)
return EOF;
{
result = EOF;
goto unlock_return;
}
fp->_IO_file_flags &= ~_IO_LINE_BUF;
}
return 0;
result = 0;
goto unlock_return;
}
break;
case _IOLBF:
fp->_IO_file_flags |= _IO_LINE_BUF;
if (buf == NULL)
return 0;
{
result = 0;
goto unlock_return;
}
break;
case _IONBF:
buf = NULL;
size = 0;
break;
default:
return EOF;
result = EOF;
goto unlock_return;
}
return _IO_SETBUF (fp, buf, size) == NULL ? EOF : 0;
result = _IO_SETBUF (fp, buf, size) == NULL ? EOF : 0;
unlock_return:
_IO_funlockfile (fp);
return result;
}
weak_alias (_IO_setvbuf, setvbuf)
+6 -2
View File
@@ -1,5 +1,5 @@
/*
Copyright (C) 1993 Free Software Foundation
Copyright (C) 1993, 1996 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
@@ -29,10 +29,14 @@ _IO_ungetc (c, fp)
int c;
_IO_FILE *fp;
{
int result;
CHECK_FILE (fp, EOF);
if (c == EOF)
return EOF;
return _IO_sputbackc (fp, (unsigned char) c);
_IO_flockfile (fp);
result = _IO_sputbackc (fp, (unsigned char) c);
_IO_funlockfile (fp);
return result;
}
weak_alias (_IO_ungetc, ungetc)
+1 -1
View File
@@ -37,7 +37,7 @@ _IO_vsprintf (string, format, args)
_IO_JUMPS ((_IO_FILE *) &sf) = &_IO_str_jumps;
_IO_str_init_static ((_IO_FILE *) &sf, string, -1, string);
ret = _IO_vfprintf ((_IO_FILE *) &sf, format, args);
_IO_putc('\0', (_IO_FILE *) &sf);
_IO_putc_unlocked ('\0', (_IO_FILE *) &sf);
return ret;
}

Some files were not shown because too many files have changed in this diff Show More