* shared_info.h (open_shared): Create function wrapper for common use case.
(open_shared): Change fifth argument to a pointer rather than a reference.
* fhandler_console.cc (fhandler_console::get_tty_stuff): Eliminate use of dummy
variable and call open_shared with constant.
* fhandler_process.cc (format_process_mounts): Ditto.
* pinfo.cc (pinfo::init): Pass pointer to shloc.
* shared.cc (shared_mem_inited): New variable.
(open_shared): Crate function wrapper for common use case.
(open_shared): Accommodate change to fifth argument to a pointer.
(shared_info::initialize): Remove spinlock test. Simplify function. Move
get_session_parent_dir call back here.
(memory_init): Protect global shared settings with shared_mem_inited spinlock.
Move get_session_parent_dir call to shared_info::initialize.
* shared.cc (inst_root_inited): Delete.
* (shared_info::initialize): Reorganize. Move call to init_installation_root
here under spinlock control. Move unneeded non-shared_info initialization out
of this function.
(memory_init): Remove call to init_installation_root. Call heap_init and
get_session_parent_dir here.
* libm/common/s_rint.c: Fix error when integral part had 18 bits and
fraction had bits set beyond first radix bit. Also, make 2-part
adjustment consistent with 1-part adjustment when adjusting fractional
bits.
* libm/common/sf_rint.c: Make fractional-bit adjustment consistent
with s_rint.c by setting 0b.01 instead of 0b.001.
* setup2.sgml (setup-env): Add cross reference to using-cygwinenv.
Change description for locale environment variables to comply with
changes in 1.7.2.
* syscalls.cc (nt_path_has_executable_suffix): Change storage class of
blessed_executable_suffixes to static.
(rename): Revert meaning of old_explicit_suffix. Change the rules
for appending a .exe suffix and (yikes!) document them.
* cygwin.din: Export __xdr functions.
* include/cygwin/version.h: Bump version.
* posix.sgml: Add a few more XDR functions to list
of implemented Solaris functions.
* libc/include/sys/features.h: Add POSIX.1-permitted definition of
_POSIX_C_SOURCE if not already defined and _XOPEN_SOURCE has an
appropriate value. Specifically, check for POSIX.1-2008 & 2001 values.
* libc/include/sys/config.h: Add #include <sys/features.h> so that all
includes get the new check added to it.
* cygtls.h (_cygtls::init_exception_handler): Eliminate argument.
(_cygtls::andreas): Convert to a pointer.
(san): Convert to a real class with methods. Use a linked list to keep track
of previous handlers on the "stack".
(myfault): Rewrite to use new san class rather than calling directly into
_cygtls.
* cygtls.cc (_cygtls::init_exception_handler): Just assume that we're always
using the standard exception handler.
(_cygtls::init_thread): Reflect loss of argument to init_exception_handler.
* dcrt0.cc (dll_crt0_1): Ditto.
* dfcn.cc (dlopen): Ditto.
(dlclose): Reset the exception handler after FreeLibrary.
* dll_init.cc (dll_list::detach): Make sure that the exception handler is
initialized before calling destructors.
* exceptions.cc (_cygtls::handle_exceptions): Accommodate new andreas pointer.
* thread.cc (verifyable_object_isvalid): Pass objectptr to faulted for explicit
NULL pointer checking.
* tlsoffsets.h: Regenerate.
Corinna Vinschen [Fri, 26 Feb 2010 17:53:52 +0000 (17:53 +0000)]
* libc/strptime.cc: Implement support for era, alt_digits and POSIX
padding and width modifiers.
(era_info_t): New type.
(free_era_info): New static function to free era_info_t storage.
(get_era_info): New static function to create era_info_t storage
from LC_TIME era information.
(alt_digits_t): New type.
(get_alt_digits): New static function to create alt_digits_t storage
from LC_TIME alt_digits information.
(free_alt_digits): New static function to free alt_digits_t storage.
(find_alt_digits): New static function to scan input for alternative
digits and return them, if any. Return NULL otherwise.
(__strptime): New static function taking all code from strptime.
Implement handling for E, O, +, 0, and width modifiers per POSIX-1.2008.
(strptime): Convert into wrapper function to provide era_info and
alt_digits pointers and call __strptime.
(conv_num): Take additional alt_digits_t parameter and if it's not
NULL, call find_alt_digits to convert.
Corinna Vinschen [Fri, 26 Feb 2010 09:41:44 +0000 (09:41 +0000)]
* libc/time/strftime.c: Add support for era and alt_digits data from
LC_TIME locale category. Conditionalize using _WANT_C99_TIME_FORMATS
flag.
(STRTOUL): Define differently for building strftime or wcsftime.
(STRCPY): Ditto.
(STRCHR): Ditto.
(STRLEN): Ditto.
(CHECK_LENGTH): Define to simplify code.
(era_info_t): New type to store era info.
(get_era_info): New function to fetch era info matching incoming
struct tm.
(free_era_info): New function to free era info.
(alt_digits_t): New type to store alternative digits.
(get_alt_digits): New function to convert alt_digits string into
alt_digits_t structure.
(free_alt_digits): New function to free alt_digits info.
(conv_to_alt_digits): New function to convert unsigned value into
alternative digits.
(strftime): Conditionalize on _WANT_C99_TIME_FORMATS. If
_WANT_C99_TIME_FORMATS is defined, define as just a wrapper function
providing era_info and alt_digits pointers and call ...
(__strftime): Rename from strftime and make static if
_WANT_C99_TIME_FORMATS is defined. Add parameters for era_info and
alt_digits pointers. Handle conversion modifiers according to
POSIX-1.2008. Redefine %F and %Y according to POSIX. Add default case
to allow to bail out on invalid conversion specifiers.
* libc/include/sys/config.h: Move Cygwin build flags to Cygwin's
config.h.
Corinna Vinschen [Thu, 25 Feb 2010 16:10:42 +0000 (16:10 +0000)]
* libc/locale/locale.c: Throughout, extensively comment on the
reason for using __CYGWIN__.
(lconv): Remove _CONST entirely.
(loadlocale): Guard calls to function loading locale-specific
category data with __HAVE_LOCALE_INFO__ rather than __CYGWIN__.
* libc/sys/config.h (__HAVE_LOCALE_INFO__): Define for Cygwin.
Nick Clifton [Thu, 25 Feb 2010 11:15:48 +0000 (11:15 +0000)]
* config/tc-mips.c (mips_fix_loongson2f, mips_fix_loongson2f_nop,
mips_fix_loongson2f_jump): New variables.
(md_longopts): Add New options -mfix-loongson2f-nop/jump,
-mno-fix-loongson2f-nop/jump.
(md_parse_option): Initialize variables via above options.
(options): New enums for the above options.
(md_begin): Initialize nop_insn from LOONGSON2F_NOP_INSN.
(fix_loongson2f, fix_loongson2f_nop, fix_loongson2f_jump):
New functions.
(append_insn): call fix_loongson2f().
(mips_handle_align): Replace the implicit nops.
* config/tc-mips.h (MAX_MEM_FOR_RS_ALIGN_CODE): Modified
for the new mips_handle_align().
* doc/c-mips.texi: Document the new options.
* gas/mips/loongson-2f-2.s: New test of -mfix-loongson2f-nop.
* gas/mips/loongson-2f-2.d: Likewise.
* gas/mips/loongson-2f-3.s: New test of -mfix-loongson2f-jump.
* gas/mips/loongson-2f-3.d: Likewise.
* gas/mips/mips.exp: Run the new tests.
Corinna Vinschen [Tue, 23 Feb 2010 14:07:08 +0000 (14:07 +0000)]
* locale.cc (printlocale): Remove.
(loc_t): New type to keep locale information for printing.
(print_codeset): New function to print codeset as on Linux.
(print_locale_with_codeset): New function to print single locale.
Print verbose style as the Linux locale(1) tool.
(print_locale): New function to print single locale plus its UTF-8
variation, if available.
(compare_locales): New helper function for bsearch and qsort on loc_t.
(add_locale): New function to store locale in loc_t array.
(add_locale_alias_locales): New function to store locales from
locale.alias file in loc_t.
(print_all_locales): Call add_locale instead of printlocale.
Call add_locale_alias_locales, sort locales alphabetically and print
them.
* include/sys/strace.h: Define _STRACE_SPECIAL.
(strace_printf_wrap): Fix NOSTRACE definitions.
(strace_printf_wrap1): Fix NOSTRACE definitions.
(special_printf): Define.
* thread.cc: Perform minor syntax fix in a comment. Rename
"is_good_initialzer*" to "is_initializer*" throughout. Use pthread_printf
rather than debug_printf throughout. Add extra pthread_printf debugging
throughout.
(pthread_mutex::_new_mutex): New constant value.
(pthread_mutex::_unlocked_mutex): Ditto.
(pthread_mutex::_destroyed_mutex): Ditto.
(pthread_mutex::no_owner): Define new function.
(pthread_mutex::can_be_unlocked): Detect no_owner situation. Handle
PTHREAD_MUTEX_NORMAL as a special case.
(pthread::create_cancel_event): Use C++ boolean values.
(pthread::precreate): Use method to set mutex type.
(pthread_cond::pthread_cond): Ditto.
(pthread_rwlock::pthread_rwlock): Ditto.
(pthread_mutex::pthread_mutex): Set owner to _new_mutex initially.
(pthread_mutex::~pthread_mutex): Reset various elements to make it clearer if
they are incorrectly reused.
(pthread_mutex::lock): Add clarifying comment.
(pthread_mutex::unlock): Attempt to handle various mutex types correctly. In
particular, reinstate ability to have one thread unlock another thread's mutex
if type == PTHREAD_MUTEX_NORMAL.
(semaphore::_fixup_after_fork): Avoid redundancy.
(pthread_mutex::_fixup_after_fork): Ditto. Fix debugging statement.
(__pthread_cond_dowait): Accommodate changes to remove previously inexplicable
use can_be_unblocked() as a static function.
* thread.h: Rename "is_good_initialzer*" to "is_initializer*" throughout.
(pthread_mutex): Reorganize. Make many things private.
(pthread_mutex::no_owner): Define new method.
(pthread_mutex::_new_mutex): Define new constant.
(pthread_mutex::_unlocked_mutex): Ditto.
(pthread_mutex::_destroyed_mutex): Ditto.
Corinna Vinschen [Mon, 22 Feb 2010 11:01:46 +0000 (11:01 +0000)]
* lc_era.h: Redefine lc_era_t to keep
default date and time formats as well to workaround YA Windows
shortcoming. Refresh with latest data.
* lc_msg.h: Refresh with latest data.
* nlsfuncs.cc (__eval_datetimefmt): Revert latest change.
(__set_lc_time_from_win): Rename res to era. Prefer default date and
time formats from era array if available.
(__set_lc_messages_from_win): Rename res to msg.
Corinna Vinschen [Mon, 22 Feb 2010 10:53:04 +0000 (10:53 +0000)]
* libc/include/langinfo.h (_NL_TIME_DATE_FMT): Define new nl_item
value for LC_TIME entry date_fmt.
(_DATE_FMT): Define "official" GNU name same as _NL_TIME_DATE_FMT.
* libc/locale/nl_langinfo.c (nl_langinfo): Add case for _DATE_FMT.
Corinna Vinschen [Sat, 20 Feb 2010 22:10:26 +0000 (22:10 +0000)]
* lc_era.h (lc_era): Fix "ja_JP" era_t_fmt entry to use traditional
format.
* nlsfuncs.cc (dt_flags): Remove DT_ERACAL since crippled era data
in Windows makes it useless.
(__eval_datetimefmt): Check if locale's default calender has
non-gregorian start year. Use era year also in default date entries,
if so.
Corinna Vinschen [Fri, 19 Feb 2010 17:30:19 +0000 (17:30 +0000)]
* lc_era.h: New file.
* nlsfuncs.cc: Include lc_era.h.
(locale_cmp): convert arguments to char** to be usable for both types,
lc_msg_t and lc_era_t.
(__set_lc_time_from_win): Handle era-related data
Corinna Vinschen [Fri, 19 Feb 2010 17:27:05 +0000 (17:27 +0000)]
* locale.cc (print_lc_mstrings): New function to print
semicolon-separated strings.
(enum type_t): New type is_sepstrings_linf.
(lc_time_names): Change type of era and alt_digits entry to
is_sepstrings_linf.
(print_lc): Add case for is_sepstrings_linf and call print_lc_mstrings
in that case.
Corinna Vinschen [Fri, 19 Feb 2010 12:37:37 +0000 (12:37 +0000)]
* fhandler_disk_file.cc (fhandler_base::fstat_helper): Set st_rdev
to same value as st_dev. Avoid useless debug output in executable
check. Add filename to debug output.
(fhandler_disk_file::facl): Simplify code calling fstat methods to
just call fstat to avoid errors with the cygdrive directory.
Corinna Vinschen [Thu, 18 Feb 2010 20:37:19 +0000 (20:37 +0000)]
* libc/ctype/iswalpha.c (iswalpha): Update to Unicode 5.2.
* libc/ctype/iswprint.c (iswprint): Ditto.
* libc/ctype/iswpunct.c (iswpunct): Drop standalone implementation.
Define in terms of other wctype functions instead.
* libc/ctype/towlower.c (towlower): Update to Unicode 5.2. Add comment
to explain how to fetch the data from the Unicode database.
* libc/ctype/towupper.c (towupper): Ditto.
* libc/ctype/utf8alpha.h: Ditto.
* libc/ctype/utf8print.h: Ditto.
* libc/ctype/utf8punct.h: Remove.
* libc/ctype/iswcntrl.c (iswcntrl): Add comment to explain how to
fetch the data from the Unicode database.
Corinna Vinschen [Thu, 18 Feb 2010 18:07:14 +0000 (18:07 +0000)]
* nlsfuncs.cc (eval_datetimefmt): Rename force to flags.
(enum dt_flags): Define.
(__eval_datetimefmt): Change force to flags and change type to
dt_flags. Accommodate throughout.
(__set_lc_time_from_win): Accommodate above change. Set era-related
values to empty strings for now.
Corinna Vinschen [Thu, 18 Feb 2010 17:35:15 +0000 (17:35 +0000)]
* libc/locale/timelocal.h (struct lc_time_T): Add missing ERA-related
members.
* libc/locale/timelocal.c (_C_time_local): Set new members to empty
strings.
* libc/locale/nl_langinfo.c (nl_langinfo): Return values from
__get_current_time_locale() for ERA related requests.
* bfd/elf32-arm.c (elf32_arm_merge_eabi_attributes): Add support for
merging Tag_DIV_use, Tag_MPextension_use, and
Tag_MPextension_use_legacy tags.
* binutils/readelf.c (arm_attr_tag_Advanced_SIMD_arch): Add
description of newly permitted attribute values.
(arm_attr_tag_Virtualization_use): Likewise.
(arm_attr_tag_DIV_use): Add description of new attribute.
(arm_attr_tag_MPextension_use_legacy): Likewise.
* gas/config/tc-arm.c (arm_convert_symbolic_attribute):
Add Tag_DIV_use.
* gas/doc/c-arm.texi: Likewise.
* gas/testsuite/gas/arm/attr-order.d: Fix test for new names for
attribute values.
* include/elf/arm.h (Tag_MPextension_use): Renumber.
(Tag_DIV_use): Add.
(Tag_MPextension_use_legacy): Likewise.
* ld/testsuite/ld-arm/attr-merge-3.attr: Fix test for new attribute
values.
* ld/testsuite/ld-arm/attr-merge-3b.s: Likewise.
* ld/testsuite/ld-arm/attr-merge-unknown-1.d: Fix test now that 42
is a recognised attribute ID.
* ld/testsuite/ld-arm/attr-merge-unknown-1.s: Likewise.
* ld/testsuite/ld-arm/attr-merge-6.attr: New test.
* ld/testsuite/ld-arm/attr-merge-6a.s: Likewise.
* ld/testsuite/ld-arm/attr-merge-6b.s: Likewise.
* ld/testsuite/ld-arm/attr-merge-7.attr: Likewise.
* ld/testsuite/ld-arm/attr-merge-7a.s: Likewise.
* ld/testsuite/ld-arm/attr-merge-7b.s: Likewise.
* ld/testsuite/ld-arm/arm-elf.exp: Run the new tests.
Corinna Vinschen [Wed, 17 Feb 2010 15:01:56 +0000 (15:01 +0000)]
* Makefile.in (CYGWIN_BINS): Rename getlocale to locale.
* getlocale.c: Rename to ...
* locale.cc: Revamp to add full functionality of POSIX locale(1) tool,
as far as Cygwin supports it.
* utils.sgml (getlocale): Move and rename to ...
(locale): Accommodate new functionality.
Nick Clifton [Wed, 17 Feb 2010 10:05:51 +0000 (10:05 +0000)]
PR 11238
* Makefile.tpl (local-distclean): Also remove config.cache files in
sub-directories as there may not be Makefiles present in the
sub-directories.
* Makefile.in: Regenerate.
* configure.ac: Revert previous delta.
* configure: Regenerate.
Corinna Vinschen [Wed, 17 Feb 2010 09:14:35 +0000 (09:14 +0000)]
* libc/ctype/iswblank.c (iswblank): Remove Unicode characters
U+00A0 and U+200B. Add Unicode character U+180E. Add comment
to explain how to generate from Unicode data file.
* libc/ctype/iswspace.c (iswspace): Ditto.
Corinna Vinschen [Mon, 15 Feb 2010 13:35:53 +0000 (13:35 +0000)]
* new-features.sgml (ov-new1.7.2): Add native DOS path and UNC path
change.
* pathnames.sgml (pathnames-intro): Make the Win32 path text a note
and xref to new pathnames-win32 section.
(cygdrive): Add description how the cygdrive mount flags apply to
UNC paths starting with slashes.
(pathnames-win32): New section describing native path handling.
* pthread.cc (pthread_mutex_init): Explicitly fill out third arg to
pthread_mutex::init.
* thread.cc: Remov some obsolete comments.
(verifyable_object_isvalid): Reflect change to use thread_magic_t for magic
numbers.
(pthread_mutex::pthread_mutex): Set magic number to invalid initially until
we've verified that everything is valid.
(pthread_mutex::unlock): Fix a comment.
(verifyable_object::verifyable_object): Delete here.
(~verifyable_object::~verifyable_object): Ditto.
(pthread_mutex::init): Don't run is_good_initializer for non-static objects.
* thread.h (thread_magic_t): New typedef.
(verifyable_object::verifyable_object): Use thread_magic_t;
(verifyable_object::magic): Ditto.
(pthread_mutex::is_good_initializer_or_bad_object): Remove unneeded variable
names.
(pthread_mutex::can_be_unlocked): Ditto.
(pthread_mutex::init): Ditto. Remove default for third argument.
Corinna Vinschen [Fri, 12 Feb 2010 17:46:39 +0000 (17:46 +0000)]
* regex/regcomp.c (xwcrtomb): New function to convert wide chars
outside of the base plane to UTF-8. Call throughout instead of
wcrtomb.
(wgetnext): Handle surrogate pairs on UTF-16 systems.
* regex/regexec.c (xmbrtowc): Ditto.
Corinna Vinschen [Fri, 12 Feb 2010 17:40:42 +0000 (17:40 +0000)]
* sec_auth.cc (get_user_local_groups): Retrieve name of well known
builtin group from system. Explain why.
* sec_helper.cc (well_known_builtin_sid): New SID for BUILTIN group.
* security.h (well_known_builtin_sid): Declare.
Corinna Vinschen [Thu, 11 Feb 2010 21:19:19 +0000 (21:19 +0000)]
* regex/engine.c (step): Drop Cygwin-specific definition.
(NONCHAR): Better cast here to make the test work. Move comment
from step here.
(matcher): Disable skipping initial string in multibyte case.
* regex/regcomp.c (p_bracket): Don't simplify singleton in the invert
case.
(p_b_term): Handle early end of pattern after dash in bracket
expression.
(singleton): Don't ignore the wides just because there's already a
singleton in the single byte chars. Fix condition for a singleton
wide accordingly.
(findmust): Check for LC_CTYPE charset, rather than LC_COLLATE charset.
* regex2.h (CHIN): Fix condition in the icase & invert case.
(ISWORD): Fix wrong cast to unsigned char.
* libm/common/s_ilogb.c: Adjust documentation to reflect new returns
(see next items) and that ilogb() and ilogbf() are C99/POSIX.
* libm/common/s_ilogb.c (ilogb): Use C99/POSIX FP_ILOGB0 and
FP_ILOGBNAN returns for 0 and NAN arguments, respectively, instead of
the prior -INT_MAX and INT_MAX. The FP_ILOGBx defines in math.h
presently match the prior hard-codes, so no functional change is
actually introduced. (Not at this time, nor planned, but the values
are permitted to be different, so subsequent edits of math.h could
possibly cause a functional change.)
* libm/common/sf_ilogb.c (ilogbf): Ditto.