Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-02-03Cygwin: reorder list of CYGWIN env var options alphabetically againCorinna Vinschen
This has been turned upside down for a short while. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-02-03Cygwin: Do not show Error dialogs by defaultJohannes Schindelin
...in a non-Cygwin child process. Backported from MSYS2. Downstream commit message follows. In https://github.com/msys2/msys2-runtime/pull/18, we discussed a change that would allow default Windows error handling of spawned processes to kick in (such as registered JIT debuggers). We even agreed that it would make sense to hide this functionality behind a flag, `winjitdebug`. However, when this got upstreamed as 21ec498d7f (cygwin: use CREATE_DEFAULT_ERROR_MODE in spawn, 2020-12-09), that flag was deemed unnecessary. But it would appear that it _is_ necessary: As reported in https://github.com/msys2/MSYS2-packages/pull/2414#issuecomment-810841296 this new behavior is pretty disruptive e.g. in CI scenarios. So let's introduce that `winjitdebug` flag (settable via the environment variable `MSYS`) at long last. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-16Cygwin: Make 'ulimit -c' control writing a coredumpJon Turney
Pre-format a command to be executed on a fatal error to run 'dumper' (using an absolute path). Factor out executing a pre-formatted command, so we can use that for invoking the JIT debugger in try_to_debug() (if error_start is present in the CYGWIN env var) and to invoke dumper when a fatal error occurs. On a fatal error, if the core file size limit is greater than 1MB, invoke dumper to write a core dump. Otherwise, if that limit is greater than 0, write a .stackdump file, as previously. Adjust and clarify the associated documentation. Also: Fix so that the error_start JIT debugger is now invoked, even when ulimit -c is zero. Also: Fix uses of console_printf() inside exec_prepared_command(). It's output is written via the Windows console device, so needs to use Windows-style line endings. Also: consistently return non-zero from try_to_debug() if we debugged. Future work: Truncate or remove the file written, if it exceeds the maximum size set by the ulimit. Future work: Using the words "fatal error" could probably be improved on. This means exiting on one of the "certain signals whose default action is to cause the process to terminate and produce a core dump file".
2022-08-03Cygwin: drop macro and code for CYGWIN_VERSION_DLL_MALLOC_ENVCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-07-28Cygwin: rename __cygwin_environ and drop env redirection via cur_environ()Corinna Vinschen
Back in early Cygwin development a function based access to the environment was exported, the internal environ in Cygwin was called __cygwin_environ and cur_environ() was used to access the environment indirectly . The history of that necessity is not documented, but kept in i686 for backward compatibility. The x86_64 port eventually used __cygwin_environ directly and exported it as DATA under the usual name environ. We don't need the i686 workaround anymore, so just rename __cygwin_environ to environ, drop the cur_environ() macro and simply export environ under its own name. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-06-06Cygwin: remove most occurrences of __stdcall and __cdeclKen Brown
These have no effect on x86_64. Retain a few occurrences of __cdecl in files imported from other sources. Also retain all occurrences of WINAPI, even though the latter is simply a macro that expands to __stdcall. Most of these occurrences are associated with Windows API functions, and removing them might make the code confusing instead of simpler.
2022-05-30Cygwin: remove some 32-bit only environment codeKen Brown
2022-05-30Cygwin: remove regparm.hKen Brown
This file defines the macros __reg1, __reg2, and __reg3, which are defined to be empty on 64-bit Cygwin. Remove all occurrences of these macros.
2021-08-26Cygwin: C++17: register keyword is deprecatedCorinna Vinschen
The register keyword was already deprecated with C++11, but with C++17 it has been entirely removed. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2021-07-30Cygwin: Add winsymlinks:sysJon Turney
Add winsymlinks:sys, to explicitly select always using plain files with the system attribute containing a magic cookie to represent a symlink.
2020-01-28Cygwin: remove CYGWIN=dos_file_warning optionCorinna Vinschen
This option has been disabled long ago and nobody missed it. Removing drops a bit of unneeded code Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-01-22Cygwin: pty: Introduce disable_pcon in environment CYGWIN.Takashi Yano
- For programs which does not work properly with pseudo console, disable_pcon in environment CYGWIN is introduced. If disable_pcon is set, pseudo console support is disabled.
2019-11-08Cygwin: console, pty: Prevent error in legacy console mode.Takashi Yano
2019-08-07Cygwin: build_env: fix off-by-one bug when re-adding PATHMichael Haubenwallner
Adding default winvar 'PATH=C:\cygwin64\binZ' to an environment that is already allocated for 'SYSTEMROOT=ZWINDIR=Z', we need to count that trailing (Z)ero as well. Otherwise we trigger this assertion failure: $ /bin/env -i SYSTEMROOT= WINDIR= /bin/env assertion "(s - envblock) <= tl" failed: file "/home/corinna/src/cygwin/cygwin-3.0.7/cygwin-3.0.7-1.x86_64/src/newlib-cygwin/winsup/cygwin/environ.cc", line 1302, function: char** build_env(const char* const*, WCHAR*&, int&, bool, HANDLE) Aborted (core dumped)
2019-07-16Cygwin: avoid GCC 8.3 errors with -Werror=stringop-truncationKen Brown
2019-03-31Cygwin: console: support 24 bit colorTakashi Yano
- Add 24 bit color support using xterm compatibility mode in Windows 10 1703 or later. - Add fake 24 bit color support for legacy console, which uses the nearest color from 16 system colors.
2019-02-19Cygwin: add secure_getenvYaakov Selkowitz
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-12-25Cygwin: cygheap: convert installation paths to UNICODE_STRINGSCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-06-07Cygwin: Remove workaround in environ.ccKen Brown
Commit ebd645e on 2001-10-03 made environ.cc:_addenv() add unneeded space at the end of the environment block to "work around problems with some buggy applications." This clutters the code and is presumably no longer needed.
2018-06-07Cygwin: Implement the GNU extension clearenvKen Brown
2018-06-07Cygwin: Allow the environment pointer to be NULLKen Brown
Following glibc, interpret this as meaning the environment is empty.
2018-06-07Cygwin: Clarify some code in environ.ccKen Brown
2017-11-27cygwin: convert most #ifndef __x86_64__ to #ifdef __i386__Corinna Vinschen
Address the real offender Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-07-19cygwin: Use errno instead of _impure_ptr->_errnoCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-07-19Revert "errno: Stop using _impure_ptr->_errno completely"Corinna Vinschen
This reverts commit 44b1746a41921533d27aca414a9188314cb725b6. Bad idea. _impure_ptr->_errno is used by newlib Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-06-06cygwin: Fix crash if env var name starts with non-ASCII charCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-10errno: Stop using _impure_ptr->_errno completelyCorinna Vinschen
We use errno AKA _REENT->_errno since the last century and only set _impure_ptr->_errno for backward compat. Stop that. Also, remove the last check for _impure_ptr->_errno in Cygwin code. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-01-10Move the core environment parsing of environ_init into a new ↵Erik M. Bray
win32env_to_cygenv function. win32env_to_cygwenv handles converting wchar to char and some other minor taks. Optionally it handles converting any paths in variables to posix paths. This will be useful for implementing /proc/<pid>/environ
2016-06-25Remove CYGWIN=detect_bloda optionCorinna Vinschen
2016-06-24Drop max_sys_priv wincapCorinna Vinschen
Convert sys_privs to const struct with TOKEN_PRIVILEGES layout. Drop function get_system_priv_list. Just use pointer to sys_privs. Dropping max_sys_priv from wincaps requires to make sure that the bitfield is 8 byte aligned on x86_64, otherwise gcc (5.3 only?) apparently breaks access to the bitfield (off by 4 bytes). Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-06-23Switching the Cygwin DLL to LGPLv3+, dropping commercial buyout optioncygwin-2_5_2-releaseCorinna Vinschen
Bump GPLv2+ to GPLv3+ for some files, clarify BSD 2-clause. Everything else stays under GPLv3+. New Linking Exception exempts resulting executables from LGPLv3 section 4. Add CONTRIBUTORS file to keep track of licensing. Remove 'Copyright Red Hat Inc' comments. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-04-01Remove MALLOC_CHECK and calls to it entirelyCorinna Vinschen
MALLOC_CHECK got useless with commit b259af5. Remove it throughout. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-01-08Do not treat the command line or environment like pathsJohannes Schindelin
* dcrt0.cc (dll_crt0_1), environ.cc (environ_init, getwinenveq, build_env), strfuncs.cc (sys_wcstombs, sys_wcstombs_alloc), wchar.c (sys_wcstombs, sys_wcstombs_alloc): avoid mis-conversions of text that does not, actually, refer to a path or file name Detailed explanation: Our WCS -> UTF conversion handles the private Unicode page specially to allow for otherwise invalid file names. However, this handling makes no sense for command-lines, nor environment variables, which we would rather convert verbatim. As a stop-gap solution, let's just introduce a version of the sys_wcstombs() function that specifically excludes that file name conversion magic. The proper solution is to change sys_wcstombs() to assume that it is not a path that wants to be converted, and introduce sys_wcstombs_path() that does, but that is a bigger task which we leave for another patch. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-10-22Fix length returned from sys_cp_wcstombs in case nwc > # of wcharsCorinna Vinschen
* strfuncs.cc (sys_cp_wcstombs): Always return number of multibytes without trailing NUL as the documentation implies. Throughout Cygwin, fix usage to align to this pattern. * fhandler_process.cc (format_process_winexename): Drop trailing NUL and LF from output. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-07-29cygwin: Fix crashes under AllocationPreference=0x100000 conditionCorinna Vinschen
* cygtls.h: Include cygtls_padsize.h and define CYGTLS_PADSIZE there. * cygtls_padsize.h: New file. Define CYGTLS_PADSIZE. * environ.cc (parse_options): Fix NULL pointer access. * init.cc (threadfunc_fe): Do not force stack align on x86_64. * strace.cc (main2): Rename from main. (main): Make room for _cygtls area on stack and just call main2. Add comment to explain why. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-01-14 * environ.cc (renv_arr): Drop variables not usually in a WindowsCorinna Vinschen
environment and all variables being uppercase anyway. But keep TMP and TEMP for paranoia.
2015-01-14 * environ.cc (build_env): When merging the user's Windows environment,Corinna Vinschen
explicitely skip the variables needing conversion to avoid collisions. Extend comment to explain.
2014-12-08 * environ.cc (regopt): Remove function.Corinna Vinschen
(environ_init): Drop undocumented feature to read application-specific environment variables from the registry. * include/cygwin/version.h (CYGWIN_INFO_PROGRAM_OPTIONS_NAME): Remove.
2014-12-06 * environ.cc (build_env): Remove loquacious debug statements.Corinna Vinschen
2014-12-02 * autoload.cc (CreateEnvironmentBlock): Import.Corinna Vinschen
(DestroyEnvironmentBlock): Import. * environ.cc (env_compare): New static bsearch comparison function. (build_env): Add parameter taking a user token. If token is non-NULL, fetch user's default Windows environment and merge it into the resulting environment. Explain what we do in preceeding comment. * environ,h (build_env): Align prototype to above change. * external.cc (create_winenv): Call build_env with NULL token. * spawn.cc (child_info_spawn::worker): When spawning new process under another user account, call build_env with new token to allow merging user's default Windows environment. * winlean.h (_USERENV_): Define to override dllimport.
2014-10-27 * cygheap.cc (cygheap_fixup_in_child): Drop call to set_dll_dir.Corinna Vinschen
(init_cygheap::init_installation_root): Set installation_dir_len. (setup_cygheap): Drop call to set_dll_dir. * cygheap.h (struct init_cygheap): Add installation_dir_len member. (init_cygheap::set_dll_dir): Remove. * environ.cc (win_env::add_cache): Use stpcpy for speed. (posify_maybe): Use tmp_pathbuf buffer instead of stack. (raise_envblock): New function to resize Windows environment block. (build_env): Fix indentation. Call raise_envblock function. Check if $PATH exists and is non-empty. If not, add PATH variable with Cygwin installation directory as content to Windows environment. Explain why. * uinfo.cc (cygheap_pwdgrp::_nss_init): Fill UNICODE_STRING members on the fly. Drop call to RtlInitUnicodeString. (pwdgrp::check_file): Ditto.
2014-08-22 * Throughout, use __try/__except/__endtry blocks, rather than myfaultCorinna Vinschen
handler. * cygtls.cc (_cygtls::remove): Accommodate the fact that pathbufs has been moved from _local_storage to _cygtls. * cygtls.h (class tls_pathbuf): Add comment to hint to gendef usage of counters. Change type of counters to uint32_t for clarity. Remove _cygtls as friend class. (struct _local_storage): Move pathbufs from here... (struct _cygtls): ...to here, allowing to access it from _sigbe. (class san): Only define on 32 bit. Remove errno, _c_cnt and _w_cnt members. (san::setup): Drop parameter. Don't initialize removed members. (san::leave): Don't set removed members. (class myfault): Only define on 32 bit. (myfault::faulted): Only keep implementation not taking any parameter. Drop argument in call to sebastian.setup. (__try/__leave/__except/__endtry): Implement to support real SEH. For now stick to SJLJ on 32 bit. * dcrt0.cc (dll_crt0_0): Drop 64 bit call to exception::install_myfault_handler. * exception.h (exception_handler): Define with EXCEPTION_DISPOSITION as return type. (PDISPATCHER_CONTEXT): Define as void * on 32 bit. Define as pointer to _DISPATCHER_CONTEXT on 64 bit. (class exception): Define separately for 32 and 64 bit. (exception::myfault): Add handler for myfault SEH handling on 64 bit. (exception::exception): Fix mangled method name to account for change in type of last parameter. (exception::install_myfault_handler): Remove. * exceptions.cc (exception::myfault_handle): Remove. (exception::myfault): New SEH handler for 64 bit. * gendef (_sigbe): Set tls_pathbuf counters to 0 explicitely when returning to the caller. * ntdll.h: Move a comment to a better place. (struct _SCOPE_TABLE): Define on 64 bit. * thread.cc (verifyable_object_isvalid): Remove gcc 4.7 workaround. * tls_pbuf.cc (tls_pbuf): Fix to accommodate new place of pathbufs. (tls_pathbuf::destroy): Change type of loop variables to uint32_t. * tls_pbuf.h (class tmp_pathbuf): Change type of buffer counters to uint32_t. Accommodate new place of pathbufs. * tlsoffsets.h: Regenerate. * tlsoffsets64.h: Regenerate.
2014-06-23 * environ.cc (regopt): Allocate small local buffer to avoid copyingCorinna Vinschen
twice. Fixes resource leak (CID 60012). Add comment.
2014-02-10* environ.cc (strbrk): Properly deal with environment variable sans quote.Christopher Faylor
2014-02-10* environ.cc (strbrk): New function.Christopher Faylor
(parse_options): Use strbrk to parse CYGWIN environment variable.
2013-11-24 Throughout, drop unnecessary explicit includes of windows header filesCorinna Vinschen
included by default. * winlean.h: Add long comment to explain why we have to define certain symbols. (_NORMALIZE_): Define. (_WINNLS_): Drop definition and subsequent undef. (_WINNETWK_): Ditto. (_WINSVC_): Ditto. 2013-11-23 Eric Blake <eblake@redhat.com>
2013-07-26cygwin directory changes:Christopher Faylor
* environ.cc (tty_is_gone): Delete. (known): Delete tty, add wincmdln. * globals.cc: Reorganize list of environment bools, remove explicit = false for slight load time optimization. (wincmdln): New global. * spawn.cc (child_info_spawn::worker): Honor wincmdln. doc directory changes: * new-features.sgml (ov-new1.7.23): Add new section. Mention wincmdln. * cygwinenv.xml: Mention wincmdln.
2013-07-10 * cygwin.sc.in (.text.*): Fold into .text on all platforms.Corinna Vinschen
(.eh_frame): Add section. * environ.cc (my_findenv): Drop __stdcall attribute. (getearly): Ditto. (findenv_func): Drop cast.
2013-05-24 * environ.cc (win_env::add_cache): Set the Windows environment variableCorinna Vinschen
using wide chars to make sure native chars don't get scrambled. * environ.h (build_env): Fix formatting in declaration. * pinfo.cc (pinfo::status_exit): Handle STATUS_NO_MEMORY. Explain why.
2013-05-23 * environ.cc (set_winsymlinks): Handle "winsymlinks:nativestrict"Corinna Vinschen
option. On pre-Vista warn the user if the "winsymlinks:native*" option is set. * globals.cc (enum winsym_t): Add WSYM_nativestrict. * path.cc (symlink_native): Don't create native symlink if target does not exist. Explain why. Improve comments. (symlink_worker): Change AFS symlink handling to WSYM_nativestrict. Handle WSYM_nativestrict throughout. Change condition for bail out to wsym_type == WSYM_nativestrict. Add comment. Fix formatting. * shared_info.h (CURR_USER_MAGIC): Change to reflect change in class user_info. (class user_info): Add member warned_nonativesyms.