Corinna Vinschen [Thu, 15 Oct 2009 11:40:02 +0000 (11:40 +0000)]
* cygpath.cc (get_special_folder): Fetch path as WCHAR and convert
using my_wcstombs.
(get_user_folder): Remove.
(do_sysfolders): Use get_special_folder instead of get_user_folder.
Fetch system paths as WCHAR and convert using my_wcstombs.
Corinna Vinschen [Tue, 13 Oct 2009 10:23:31 +0000 (10:23 +0000)]
* include/sys/cygwin.h: Add new cygwin_getinfo_type
CW_SET_EXTERNAL_TOKEN.
Add new enum CW_TOKEN_IMPERSONATION, CW_TOKEN_RESTRICTED.
* cygheap.h (cyguser): New flags ext_token_is_restricted,
curr_token_is_restricted and setuid_to_restricted.
* external.cc (cygwin_internal): Add CW_SET_EXTERNAL_TOKEN.
* sec_auth.cc (set_imp_token): New function.
(cygwin_set_impersonation_token): Call set_imp_token ().
* security.h (set_imp_token): New prototype.
* spawn.cc (spawn_guts): Use CreateProcessAsUserW if restricted token
was enabled by setuid(). Do not create new window station in this case.
* syscalls.cc (seteuid32): Add handling of restricted external tokens.
Set HANDLE_FLAG_INHERIT for primary token.
(setuid32): Set setuid_to_restricted flag.
* uinfo.cc (uinfo_init): Do not reimpersonate if restricted token was
enabled by setuid (). Initialize user.*_restricted flags.
Eric Blake [Tue, 13 Oct 2009 02:26:33 +0000 (02:26 +0000)]
Improve clock_gettime and utimensat resolution.
* hires.h (hires_ms): Change initime_us to initime_ns, with 10x
more resolution.
(hires_ms::nsecs): New prototype.
(hires_ms::usecs, hires_ms::msecs, hires_ms::uptime): Adjust.
* times.cc (systime_ns): New helper function.
(hires_ms::prime): Use it for more resolution.
(hires_ms::usecs): Change to...
(hires_ms::nsecs): ...with more resolution.
(clock_gettime): Use more resolution.
(systime): Rewrite in terms of systime_ns.
(timespec_to_filetime): Rewrite math to reflect true operation.
* fhandler_disk_file.cc (utimens_fs): Use higher resolution.
* libc/locale/locale.c (DEFAULT_LOCALE): New define.
(__default_locale): New global variable set to the default locale.
(__get_locale_env): Return __default_locale rather than fixed "C".
Jeff Johnston [Thu, 8 Oct 2009 16:44:10 +0000 (16:44 +0000)]
2009-10-08 Jeff Johnston <jjohnstn@redhat.com>
* configure.host: For RTEMS, define HAVE_ASSERT_FUNC.
* libc/stdlib/assert.c (_assert_func): Do not specify
__assert_func if HAVE_ASSERT_FUNC flag is set.
* fhandler.h (fhandler_pty_master::tcgetpgrp): Declare.
* fhandler_termios.cc (fhandler_termios::tcgetpgrp): Only return
valid pgid if tty is controlling tty. Set errno to ENOTTY and
return -1 otherwise.
(fhandler_pty_master::tcgetpgrp): New function. Return 0 for
master side of pty if it's not the controlling tty of the process.
* dcrt0.cc (dll_crt0_1): Drop calls to setlocale/_setlocale_r. Just
call initial_setlocale from here.
* syscalls.cc (initial_setlocale): Set internal charset and revert
application locale to "C".
(setlocale): Don't set Cygwin's internal charset here.
* dcrt0.cc (dll_crt0_1): Move cxx_malloc reset kluge from here.
(check_sanity_and_sync): to here.
* path.cc (has_dot_last_component): Rewrite to detect some corner cases that
were previously uncaught.
* fhandler_console.cc (beep): Move up to avoid forward declaration.
(fhandler_console::read): Just beep on characters invalid in current
charset. Add comment.
binutils
* readelf.c: Add support for RX target.
* MAINTAINERS: Add DJ and NickC as maintainers for RX.
gas
* Makefile.am: Add RX target.
* configure.in: Likewise.
* configure.tgt: Likewise.
* read.c (do_repeat_with_expander): New function.
* read.h: Provide a prototype for do_repeat_with_expander.
* doc/Makefile.am: Add RX target documentation.
* doc/all.texi: Likewise.
* doc/as.texinfo: Likewise.
* Makefile.in: Regenerate.
* NEWS: Mention support for RX architecture.
* configure: Regenerate.
* doc/Makefile.in: Regenerate.
* config/rx-defs.h: New file.
* config/rx-parse.y: New file.
* config/tc-rx.h: New file.
* config/tc-rx.c: New file.
* doc/c-rx.texi: New file.
gas/testsuite
* gas/rx: New directory.
* gas/rx/*: New set of test cases.
* gas/elf/section2.e-rx: New expected output file.
* gas/all/gas.exp: Add support for RX target.
* gas/elf/elf.exp: Likewise.
* gas/lns/lns.exp: Likewise.
* gas/macros/macros.exp: Likewise.
include
* dis-asm.h: Add prototype for print_insn_rx.
include/elf
* rx.h: New file.
include/opcode
* rx.h: New file.
ld
* Makefile.am: Add rules to build RX emulation.
* configure.tgt: Likewise.
* NEWS: Mention support for RX architecture.
* Makefile.in: Regenerate.
* emulparams/elf32rx.sh: New file.
* emultempl/rxelf.em: New file.
opcodes
* Makefile.am: Add RX files.
* configure.in: Add support for RX target.
* disassemble.c: Likewise.
* Makefile.in: Regenerate.
* configure: Regenerate.
* opc2c.c: New file.
* rx-decode.c: New file.
* rx-decode.opc: New file.
* rx-dis.c: New file.
* fhandler.h (class dev_console): Constify charset parameter of
str_to_con.
* fhandler_console.cc (dev_console::con_to_str): Simplify. Always
default to the current internal locale.
(dev_console::get_console_cp): Always use codepage 437 for alternate
charset.
(dev_console::str_to_con): Constify charset parameter.
(fhandler_console::write_normal): Always use codepage 437 for alternate
charset. Otherwise always default to the current internal locale.
Replace ASCII SO with ASCII CAN.
* strfuncs.cc: Tweka comments according to below changes.
(sys_cp_wcstombs): Constify charset parameter. Convert all wchar_t
values in the Unicode private use area U+F0xx to the singlebyte
counterpart. Drop special handling creating ASCII SO sequence from
U+DCxx value. Rearrange for performance. Replace ASCII SO with
ASCII CAN.
(sys_cp_mbstowcs): Constify charset parameter. Replace ASCII SO with
ASCII CAN. Drop special case for U+DCxx ASCII SO sequences. Always
create a replacement from the Unicode private use area U+F0xx for
invalid byte values in a multibyte sequence. Do the same for wchar_t
values from the U+F0xx range to make them roundtrip safe.
* wchar.h (sys_cp_wcstombs): Constify charset parameter.
(sys_cp_mbstowcs): Ditto.
* cygheap.cc (cygheap_init): Default locale.charset to "UTF-8".
* dcrt0.cc (dll_crt0_1): Call setlocale (LC_CTYPE, "") here, just
before resetting application locale to "C".
* environ.cc (environ_init): Drop code setting locale here.
* syscalls.cc (check_codepage): Break out check for required codepage
from internal_setlocale.
(internal_setlocale): Just convert CWD and $PATH from old charset to
new charset and set internal charset.
(setlocale): Change accordingly. Don't require LC_ALL or LC_CTYPE to
store old locale value. Always call internal_setlocale if charset
changed due to locale environment changes.
* libc/locale/locale.c (lc_ctype_charset): Set to "UTF-8" on Cygwin.
(lc_message_charset): Ditto.
(loadlocale): Set charset of the "C" locale to "UTF-8" on Cygwin.
* libc/stdlib/mbtowc_r.c (__mbtowc): Default to __utf8_mbtowc on
Cygwin.
* libc/stdlib/wctomb_r.c (__wctomb): Default to __utf8_wctomb on
Cygwin.
* dwarf2.h (DW_TAG_rvalue_reference_type, DW_TAG_template_alias):
New tags.
(DW_FORM_ref_sig8): New name for DW_FORM_sig8.
(DW_AT_main_subprogram, DW_AT_data_bit_offset, DW_AT_const_expr,
DW_AT_enum_class, DW_AT_linkage_name, DW_AT_GNU_guarded_by,
DW_AT_GNU_pt_guarded_by, DW_AT_GNU_guarded, DW_AT_GNU_pt_guarded,
DW_AT_GNU_locks_excluded, DW_AT_GNU_exclusive_locks_required,
DW_AT_GNU_shared_locks_required, DW_AT_GNU_odr_signature): New
attributes.
(DW_LANG_Python): New language.
binutils/
* dwarf.c (get_TAG_name): Add missing DWARF-3 and new DWARF-4 tags.
(get_FORM_name): Add new DWARF-4 forms.
(read_and_display_attr_value): Add DW_FORM_ref_sig8, DW_LANG_Python.
(get_AT_name): Add new DWARF-4 and GNU-specific attributes.
(process_debug_info): Add do_types parameter; change all callers.
Add support for .debug_types sections.
(display_debug_types): New function.
(debug_displays): Add .debug_types section.
* readelf.c (process_section_headers): Add .debug_types section.
(display_debug_section): Simplify call to streq.
* strfuncs.cc (sys_cp_wcstombs): Convert lone surrogate pair
second halves to unambiguous ASCII SO sequence. When converting
chars invalid in current codepage to ASCII SO sequence, make
sure to check for surrogate pair second half only if ct least
one wide characters is left. Decrement nwc if valid second half has
been converted.
(sys_cp_mbstowcs): Improve ASCII SO handling. Never break from loop
if invalid character has been found. Recognize ASCII SO sequence
representing originally invalid mulitbyte char converted into a
lone surrogate pair second half. Convert accordingly.
* autoload.cc (WSARecv): Define.
* fhandler_socket.cc (fhandler_socket::recv_internal): Call WSARecv
instead of WSARecvFrom if no name parameter is given. Explain why.
* cygheap.h (cwdstuff::get_posix): Convert to const inline method just
returning pointer to posix path.
(cwdstuff::reset_posix): Convert to non-inline method taking a wchar_t
pointer.
* path.cc (cwdstuff::set): Revert change from 2009-05-13. Set posix
to valid incoming path again.
(cwdstuff::reset_posix): New implementation setting posix path from
incoming wchar_t path. Explain usage.
(cwdstuff::get_posix): Drop implementation.
(cwdstuff::get): Drop special case to handle empty posix path.
* syscalls.cc (internal_setlocale): Store old posix cwd as wide char
path. Restore posix cwd using new charset. Explain why.