aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-12-08Add missing checks for __SNLK flagCorinna Vinschen5-15/+39
* libc/stdio/fclose.c (_fclose_r): Make _flockfile/_funlockfile calls dependent on __SNLK flag. * libc/stdio/findfp.c (__fp_lock): Ditto. (__fp_unlock): Ditto. * libc/stdio/freopen.c (_freopen_r): Ditto. * libc/stdio64/freopen64.c (_freopen64_r): Ditto. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-12-08Fix re-initialization of FILE flags and mbstate in freopenCorinna Vinschen3-1/+10
* libc/stdio/freopen.c (_freopen_r): Only reset __SWID bit per SUSv4. * libc/stdio64/freopen64.c (_freopen64_r): Add missing resetting of flag values and _mbstate. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-12-08Remove unnecessary locking in pthread_setcancelstate/pthread_setcanceltypeCorinna Vinschen2-26/+15
* thread.cc (pthread::setcancelstate): Remove unnecessary locking. (pthread::setcanceltype): Ditto. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-12-08Rename FileId to IndexNumber in NT structures to align with upstreamCorinna Vinschen4-12/+20
* ntdll.h (FILE_ID_BOTH_DIR_INFORMATION): Rename FileId to IndexNumber to align with Microsoft naming scheme. (FILE_INTERNAL_INFORMATION): Ditto. * fhandler_disk_file.cc: Rename FileId to IndexNumber throughout. * syscalls.cc: Ditto. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-12-07Fix minor style issue in _dll_crt0.Corinna Vinschen1-1/+1
Fix missing space. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-12-07Introduce the 'usertemp' filesystem typeJohannes Schindelin5-4/+54
* mount.cc (mount_info::from_fstab_line): Support mounting the current user's temp folder as /tmp/. This is particularly useful a feature when Cygwin's own files are write-protected. * pathnames.xml: document the new usertemp file system type Detailed explanation: In the context of Windows, there is a per-user directory for temporary files, by default specified via the environment variable %TEMP%. Let's allow to use that directory for our /tmp/ directory. With this patch, we introduce the special filesystem type "usertemp": By specifying none /tmp usertemp binary,posix=0 0 0 in /etc/fstab, the /tmp/ directory gets auto-mounted to the directory specified by the %TEMP% variable. This feature comes handy in particularly in scenarios where the administrator might want to write-protect the entire Cygwin directory yet still needs to allow users to write into the /tmp/ directory. This is the case in the context of Git for Windows, where the Cygwin (MSys2) root directory lives inside C:\Program Files and hence /tmp/ would not be writable otherwise. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-12-07Add definitions for NBBY to arm and rtems targetsNick Withers3-0/+9
* libc/sys/arm/sys/param.h (NBBY): Define if not already defined. * libc/sys/rtems/include/sys/param.h (NBBY): Define. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-12-07Move fd_stuff from sys/types.h to sys/select.hCorinna Vinschen11-96/+122
* libc/include/sys/types.h: Move definitions of NBBY and howmany to sys/param.h. Move definitions of select(2) macros to sys/select.h. * libc/include/sys/param.h: See above. * libc/include/sys/select.h: Move Cygwin's sys/select.h here. * include/sys/select.h: Move select(2) macros from newlib's sys/types.h here. Rename howmany to _howmany to unclutter namespace. Move file to newlib. * libc/rexex.cc: Add declaration for cygwin_gethostname. * poll.cc: Include sys/param.h and locale select.h. * select.h (cygwin_select): Declare. * uname.cc: Declare cygwin_gethostname. * winsup.h: Drop declarations of cygwin_select and cygwin_gethostname. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-12-07Always allocate main thread stack from pthread stack area on x86_64.Corinna Vinschen8-79/+96
* dcrt0.cc: Semi-revert commit 12743c2d5d2721f3a80b4d7671a349be03c1f520. (dll_crt0_0): Drop setting wow64_needs_stack_adjustment on 64 bit. (_dll_crt0): Split out 64 bit code again and always create new main thread stack, unless forked off from the non main thread in the parent. Call create_new_main_thread_stack with parent stack commitsize if started from the parent's main thread. Only call child_info_fork::alloc_stack for the latter case on 64 bit. Slightly rearrange moving rsp and rbp to new stack and document how. Revert 32 bit wow64 handling to its former self. * miscfunc.cc (create_new_main_thread_stack): Take a commitsize parameter and use it if it's not 0. Don't set _main_tls here, it's done in the caller _dll_crt0 anyway. Return stackbase - 16 bytes, rather than stacklimit (which was very wrong anyway). * miscfuncs.h (create_new_main_thread_stack): Accommodate declaration to aforementioned change. * wincap.h (wincaps::has_3264_stack_broken): Remove element. * wincap.cc: Ditto, throughout. * wow64.cc: Semi-revert to pre-12743c2d5d2721f3a80b4d7671a349be03c1f520 but keep architecture-agnostic type changes intact. Fix formatting. * wow64.h: Revert to pre-12743c2d5d2721f3a80b4d7671a349be03c1f520. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-12-06Allow cygwin_conv_path(3) and cygpath(1) to emit /proc/cygdrive prefixed pathCorinna Vinschen13-45/+131
* include/sys/cygwin.h (CCP_PROC_CYGDRIVE): New flag. * mount.cc (mount_info::cygdrive_posix_path): Take flag values rather than just a trailing_slash_p bool. Emit /proc/cygdrive path if CCP_PROC_CYGDRIVE flag is given. (mount_info::conv_to_posix_path): Take flag values rather than just a keep_rel_p bool. Rename _p variables. Print flag value as hex in debug_printf. Call cygdrive_posix_path with flag values. * mount.h (mount_info::cygdrive_posix_path): Accommodate above change in declaration. (mount_info::conv_to_posix_path): Ditto. * fhandler_process.cc (format_process_exename): Accommodate change to mount_info::conv_to_posix_path. * path.cc (cygwin_conv_path): Ditto. * cygpath.cc (absolute_flag): Initialize to CCP_RELATIVE to simplify expressions. (cygdrive_flag): New global flag. (long_options): Add --proc-cygdrive option. (options): Add -U option. (usage): Add description for -U option. (do_sysfolders): Or cygdrive_flag to cygwin_conv_path call. (do_pathconv): Simply or absolute_flag to conv_func. Or cygdrive_flag to conv_func. (do_options): Initalize absolute_flag to CCP_RELATIVE. Initialize new cygdrive_flag. Set absolute_flag to CCP_ABSOLUTE on -a. Set cygdrive_flag to CCP_PROC_CYGDRIVE on -U. * new-features.xml (ov-new2.4): Document cygpath -U option. * utils.xml (cygpath): Ditto. * path.xml (func-cygwin-path): Add CCP_PROC_CYGDRIVE description. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-12-04Always define __high_bsssize, do not just PROVIDE it.Nick Clifton2-2/+6
* msp430/msp430xl-sim.ld (__high_bsssize): Define.
2015-12-03Add release message for workaround added with previous commitsCorinna Vinschen1-0/+7
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-12-03On 64 bit, only create new thread stack if started from 32 bit process on ↵Corinna Vinschen6-60/+90
affected platforms * dcrt0.cc (dll_crt0_0): On 64 bit, set wow64_needs_stack_adjustment if not started from a 64 bit process. (_dll_crt0): Enable wow64_needs_stack_adjustment branch on 64 bit as well. Remove 64 bit only code. Introduce CREATE_STACK and FIX_STACK macros to conditionalize the code. Rearrange and partially rewrite comments. * wincap.h (wincaps::has_3264_stack_broken): New element. * wincap.cc: Implement above element throughout. (wincapc::init): Set has_3264_stack_broken to false on 32 bit. * wow64.cc: Enable functionality on 64 bit architecture, except for wow64_revert_to_original_stack. Enhance comments to explain. (wow64_eval_expected_main_stack): Make 64 bit clean. (wow64_test_for_64bit_parent): Ditto. * wow64.h: Export wow64_revert_to_original_stack on 32 bit only, everything else on all architectures. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-12-03Fix thinko in /proc/<PID>/maps TEB detection on W10 1511Corinna Vinschen2-26/+60
* fhandler_process.cc (thread_info::thread_info): Accommodate the fact that TEBs take two pages. (thread_info::fill_if_match): Rewrite the method for post W10 1511 TEB detection. (format_process_maps): Add a state member to region. Fix the code to handle PEB/TEB region since W10 1511. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-12-03Fix /proc/<PID>/maps output for PEB and TEBs on W10 1511Corinna Vinschen5-10/+113
* fhandler_process.cc (heap_info::fill_if_match): Return NULL, not 0. (thread_info::fill_if_match): Ditto. (thread_info::fill_if_match): New method to extract TEB info from PEB/TEB region since W10 1511. (format_process_maps): Drop outdated FIXME comment. Add code to handle PEB/TEB region since W10 1511. * mmap.cc (posix_madvise): Align comment to new W10 1511 version. * wincap.h (wincaps::has_new_pebteb_region): New element. * wincap.cc: Implement above element throughout. (wincap_10_1511): New global wincaps to support Windows 10 since 1511. (wincapc::init): Use wincap_10_1511 for W10 builds >= 10586. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-12-03Always move 64 bit main thread stack to defined pthread stack areaCorinna Vinschen4-0/+83
x86_64 only: * dcrt0.cc (_dll_crt0): Always move stack to pthread stack area. Explain why. * miscfuncs.cc (create_new_main_thread_stack): New function to create OS-like stack for main thread in pthread stack area. * miscfuncs.cc (create_new_main_thread_stack): Declare. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-12-03Cleanup in dcrt0.cc and fork.ccCorinna Vinschen3-6/+12
* dcrt0.cc (child_info_fork::alloc_stack): Fix formatting. * fork.cc (frok::parent): Fix formatting. (child_copy): Change type of res to BOOL. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-12-03Always restore full TEB stack info in forkeeCorinna Vinschen2-9/+14
* dcrt0.cc (dll_crt0_1): Always restore the TEB stack info. Especially restore DeallocationStack. Fix comment. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-12-03Add missing dcrt0.cc patch to previous commitCorinna Vinschen2-1/+4
* dcrt0.cc (child_info_fork::alloc_stack): Don't set stackaddr to 0. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-12-03Safely recognize when fork is running from main thread or another pthreadCorinna Vinschen3-2/+10
* child_info.h (struct child_info): Add member from_main. * fork.cc (frok::child): Check from_main rather than stackaddr. (frok::parent): Set ch.from_main if running in the main thread. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-12-02Rename parent stack members in child_info struct to align with OS namesCorinna Vinschen4-28/+36
* child_info.h (CURR_CHILD_INFO_MAGIC): Align to below change. (class child_info_fork): Rename stacktop to stacklimit. Rename stackbottom to stackbase. Accommodate name change throughout Cygwin. Rephrase comments to be clearer. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-12-02Drop using _tlsbase and _tlstop in favor of access via NtCurrentTeb.Corinna Vinschen7-40/+41
* cygtls.h (_tlsbase): Remove. Replace throughout with NtCurrentTeb()->Tib.StackBase. (_tlstop): Remove. Replace throughout with NtCurrentTeb()->Tib.StackLimit. * dcrt0.cc (child_info_fork::alloc_stack): Move definition of local teb variable up to be used throughout. * include/cygwin/config.h (__getreent): Use inline function on both architectures. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-12-02miscfuncs.cc: Fix typos in commentCorinna Vinschen1-2/+2
2015-11-29Only generate BUILTIN SIDs for uid/gid values <= 999Corinna Vinschen2-2/+7
* uinfo.cc (pwdgrp::fetch_account_from_windows): Only create 1-5-32-x SIDs from ids for x <= 999. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-29Use correct gid value for Microsoft Account when /etc/group is in useCorinna Vinschen2-2/+18
* sec_acl.cc (get_posix_access): In case owner SID == group SID, when encountering the group entry, change the value of `id' accordingly. Explain why. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-28Save and restore MXCSR register in delayed signal handlingCorinna Vinschen2-0/+7
* gendef (sigdelayed): Save and restore content of the MXCSR register on x86_64. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-27Belatedly create release notes for commits 2f4fef9 and 9471b0bCorinna Vinschen1-0/+7
2015-11-27Fix race condition when waiting for a signalCorinna Vinschen12-26/+63
* cygtls.h (_cygtls::wait_signal_arrived): Renamed from set_signal_arrived. (_cygtls::set_signal_arrived): New function signalling signal_arrived. (_cygtls::reset_signal_arrived): Don't reset will_wait_for_signal. (_cygtls::unwait_signal_arrived): New function only resetting will_wait_for_signal. (class wait_signal_arrived): Rename from set_signal_arrived. Accommodate name change throughout Cygwin. (wait_signal_arrived::~wait_signal_arrived): Call _cygtls::unwait_signal_arrived. Add comment. * cygserver_ipc.h (ipc_set_proc_info): Fetch signal_arrived handle via call to _cygtls::get_signal_arrived. * exceptions.cc (_cygtls::interrupt_setup): Signal signal_arrived via call to _cygtls::set_signal_arrived. (_cygtls::handle_SIGCONT): Ditto. * fhandler_socket.cc (fhandler_socket::wait_for_events): Generate WSAEVENT array prior to entering wait loop. Add cancel event object if available. Remove calls to pthread_testcancel and just call pthread::static_cancel_self if the cancel event object is signalled. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-26Fix SEGV of kill -l 0Michael Kwasigroch2-3/+8
* kill.cc (strsigno): Don't call sys_sigabbrev for signal 0. (listsig): Don't call strsigno for signal 0. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-26Fix creating relative native symlinks in top-level directoriesCorinna Vinschen2-1/+5
* path.cc (symlink_native): Fix index when looking for colon in path. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-26Add MacType to BLODADavid Macek2-2/+7
One more patch. MacType was observed by several users to cause `GPGME: Invalid crypto engine` failures in MSYS2. See <https://github.com/Alexpux/MSYS2-packages/issues/393>. I also removed two full stops in the sake of consistency. * faq-using.xml: Add MacType to the BLODA. Fix formatting. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-26Add a section describing peculiarities of how Cygwin creates NTFS symlinksDavid Macek2-0/+8
First take on how to describe dereferencing of Cygwin-only symlinks path components when creating NTFS symlinks. Note that I haven't tried building the documentation, so I don't know if the added paragraph breaks anything. Hopefully not. * pathnames.xml: Add a section describing peculiarities of how Cygwin creates NTFS symlinks. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-26Add Forefront TMG to the BLODADavid Macek2-0/+5
A user of MSYS2 had non-deterministic segfaults when running simple command from bash started from cmd. We've isolated the cause to `C:\Program Files (x86)\Forefront TMG Client\FwcWsp64.dll`. See <http://sourceforge.net/p/msys2/tickets/212/> for a little more information. It seems enough to include the software in BLODA, but if not, sorry for the unsolicited patch and let's discuss. * faq-using.xml: Add Forefront TMG to the BLODA Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-26Only build _strtodg_r on targets supporting a distinct long double typeCorinna Vinschen2-0/+9
* libc/stdlib/strtodg.c: Add ifdef to check _HAVE_LONG_DOUBLE and _LDBL_EQ_DBL. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-24 libc/stdlib/strtorx.c: Fix ifdef to check _LDBL_EQ_DBL.Steve Ellcey2-2/+6
2015-11-23[ARM] Adjust strcmp-armv7.S selection logic.Marcus Shawcroft4-3/+40
Reformulate the strcmp-armv7.S selection logic around the architecture features required by the implementation code rather (some) version of the architecture that expose those features.
2015-11-23[ARM] Factor out the thumb2 -Os implementation.Marcus Shawcroft4-13/+63
The patch moves the inline ASM thumb2 -Os implementation out into its own .S file. Tested by building newlib and comparing libc.a binaries before and after for all permutations of: Architectures: armv4 armv4t armv5 armv5t armv5te armv6 armv6j armv6k armv6z armv6kz armv6t2 armv6-m armv6s-m armv7 armv7-a armv7ve armv7-r armv7-m armv7e-m armv8-a iwmmxt iwmmxt2 ISAs: thumb arm Optimization Levels: Os O2 Excluding: armv6s-m -mthumb armv6-m -mthumb armv6zk -mthumb armv6z -mthumb armv6k -mthumb armv6j -mthumb
2015-11-23Fix initialisation of .upper.bss for the MSP430.Nick Clifton2-0/+5
* msp430/msp430xl-sim.ld (__high_bsssize): Define.
2015-11-21Fix numeric and monetary decimal point and thousands separator in fa_IR and ↵Corinna Vinschen5-10/+77
ps_AF locales * nlsfuncs.cc (setlocaleinfo): New macro calling __setlocaleinfo. (__setlocaleinfo): New function to set a locale-specific character to an explicit wchar_t value. (__set_lc_numeric_from_win): Handle fa_IR and ps_AF locales to return same decimal point and thousands separator characters as on Linux. (__set_lc_monetary_from_win): Ditto for monetary characters. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-21Handle multibyte decimapl point in strtold.Corinna Vinschen2-1/+13
* libc/stdlib/strtodg.c: Define USE_LOCALE. (_strtodg_r): Handle multibyte decimal point. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-20Mention strtold patch in Cygwin 2.4.0 release messageCorinna Vinschen1-0/+4
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-20Import correctly working strtold from David M. Gay.Corinna Vinschen14-19/+1369
* libc/stdlib/Makefile.am (GENERAL_SOURCES): Add strtodg.c and strtorx.c. * libc/stdlib/Makefile.in: Regenerate. * libc/stdlib/strtodg.c: New file implementing generic string to long double conversion. * libc/stdlib/strtorx.c: New file, implementing IEEE format string to long double conversion. * libc/stdlib/mprec.h (_strtodg_r): Declare. (_strtorx_r): Declare. * libc/stdlib/gdtoa.h (__UShort): Define. * libc/stdlib/strtold.c (__flt_rounds): Define for i386 and x86_64 target. (FLT_ROUNDS): Define, as 0 on platforms missing a __flt_rounds function. (_strtold_r): Converted from strtold. Call _strtorx_r on targets supporting distinct long doubles. (strtold): Just call _strtold_r. * libc/include/stdlib.h (_strtold_r): Declare. * libc/stdlib/ldtoa.c (_strtold): Comment out. Explain why. * libc/stdio/vfscanf.c (__SVFSCANF_R): Call _strtold_r instead of _strtold. * libc/machine/powerpc/vfscanf.c (__svfscanf_r): Ditto. * common.din (strtold): Drop redirection to _strtold. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-20Make match function globally available to stdlib functions.Corinna Vinschen4-21/+26
* libc/stdlib/strtod.c (match): Move from here... * libc/stdlib/gdtoa-hexnan.c (match): ...to here. * libc/stdlib/mprec.h (match): Declare and add __match define. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-20Drop unused declaration from wcstold.cCorinna Vinschen2-2/+4
* libc/stdlib/wcstold.c (_strtold): Drop unused declaration. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-19Fix typo in rpmatch doc referenceYaakov Selkowitz2-1/+5
* libc/stdlib/stdlib.tex: Fix typo in rpmatch reference. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2015-11-19ldtoa.c: Reindent to GNU styleCorinna Vinschen2-2317/+2408
* libc/stdlib/ldtoa.c: Convert to GNU style so as not to get crazy reading the code. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-19Fix rpmatch build problemCorinna Vinschen2-0/+5
* libc/stdlib/rpmatch.c: Include sys/types.h to make GCC happy. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-11-19Simplify the markup for sprintf and swprintf documentationJon Turney3-64/+76
- move the description of the alternative form produced with the # flag from a nested table to an additional table 2015-11-12 Jon Turney <jon.turney@dronecode.org.uk> * libc/stdio/sprintf.c: Simplify documentation markup. * libc/stdio/swprintf.c: Ditto. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2015-11-19Improve markup of sscanf and swscanf documentationJon Turney3-114/+242
- use bullet points to separate width, size and type sections, rather than using rows in an enormous table, for consistency with sprintf and swprintf. - use code markup for size bullet point for consistency - use a texinfo multitable for description of the size flags, rather than some preformatted text - tidy up some whitespace so type flags are all aligned 2015-11-12 Jon Turney <jon.turney@dronecode.org.uk> * libc/stdio/sscanf.c: Improve documentation markup. * libc/stdio/swscanf.c: Ditto. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2015-11-18Document new ACL codeCorinna Vinschen3-0/+63
* new-features.xml (ov-new2.4): Add new ACL changes. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>