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
2008-04-26 * dcrt0.cc (dll_crt0_0): Set SEM_NOGPFAULTERRORBOX error mode, too,Corinna Vinschen
to accommodate Vista/Longhorn. * spawn.cc (spawn_guts): Move check for CREATE_SUSPENDED condition after the call to ch.set() since it depends on it.
2008-04-23 * dcrt0.cc (dll_crt0_0): Move CWD initialization from here...Corinna Vinschen
(dll_crt0_1): ...to here.
2008-04-07Add miscfuncs.h to files as needed throughout.Christopher Faylor
* mount.cc: New file. * path.cc: Move mount-specific stuff into mount.cc. Move common stuff into miscfuncs.cc. Remove unneeded includes. * miscfuncs.cc: Move some common path functions here. * miscfuncs.h: New file. * winsup.h: Move miscelleneous functions to miscfuncs.h. * dcrt0.cc: Remove unneeded includes. * Makefile.in (DLL_OFILES): Add mount.o. * include/cygwin/config.h: Fix a minor typo.
2008-04-03 * dcrt0.cc (insert_file): Fix potential buffer overflow.Corinna Vinschen
2008-04-02 * dcrt0.cc (insert_file): Convert filename to WCHAR and callCorinna Vinschen
CreateFileW to allow UTF-8 filenames.
2008-04-01 * Fix copyright dates.Corinna Vinschen
2008-03-24 * fhandler.cc (fhandler_base::dup): Drop setting flags in the parent.Corinna Vinschen
Implement advisory file locking. * cygheap.h (struct init_cygheap): Add inode_list member. * cygwin.din (lockf): Export. * dcrt0.cc (child_info_spawn::handle_spawn): Call fixup_lockf_after_exec. * dtable.h (class dtable): Add fhandler_disk_file as friend class. * fhandler.cc (fhandler_base::close): Call del_my_locks if node is set. (fhandler_base::fhandler_base): Initialize node to NULL. (fhandler_base::fixup_after_fork): Ditto. * fhandler.h (class fhandler_base): Add member node. * fhandler_disk_file.cc (fhandler_disk_file::lock): Delete. * flock.cc: Implement all advisory file locking here. (fhandler_disk_file::lock): Implement here. (flock): Call fcntl with F_FLOCK bit set. Remove test main function. (lockf): New function. * fork.cc (frok::child): Call fixup_lockf_after_fork. * ntdll.h (DIRECTORY_ALL_ACCESS): Define. (struct _OBJECT_BASIC_INFORMATION): Define. (enum _EVENT_TYPE): Define. (NtCreateDirectoryObject): Declare. (NtCreateEvent): Declare. (NtCreateMutant): Declare. (NtOpenEvent): Declare. (NtOpenMutant): Declare. * include/cygwin/version.h: Bump API minor number.
2008-03-12 * winsup.h (NT_MAX_PATH): Revert ill-advised change to 32767.Corinna Vinschen
Accommodate change throughout. * cygwin.din (cygwin_conv_path): Export. (cygwin_conv_path_list): Export. (cygwin_create_path): Export. * dcrt0.cc (dll_crt0_1): Use cygwin_conv_path. * dtable.cc (handle_to_fn): Ditto. Don't expect UNICODE_STRING being 0-terminated. * environ.cc (env_plist_to_posix): New helper function. (env_plist_to_win32): Ditto. (env_path_to_posix): Ditto. (env_path_to_win32): Ditto. (return_MAX_PATH): Remove. (conv_envvars): Use new helper functions. Drop removed members. (win_env::operator =): Accommodate removal of path length functions. (win_env::add_cache): Accommodate new env helper function API. (posify): Ditto. * environ.h (struct win_env): Ditto. Remove path length function pointers since they are unused. * path.cc (warn_msdos): Use cygwin_conv_path. (getfileattr): Use new tmp_pathbuf::u_get method. (fillout_mntent): Ditto. (symlink_info::check): Ditto. (path_conv::check): Use sizeof (WCHAR) instead of constant 2. (symlink_info::check_reparse_point): Ditto. (conv_path_list): Get max size of target string as argument. Call cygwin_conv_path as helper function. (cygwin_conv_path): New function. (cygwin_create_path): New function. (cygwin_conv_to_win32_path): Just call cygwin_conv_path with size set to MAX_PATH. (cygwin_conv_to_full_win32_path): Ditto. (cygwin_conv_to_posix_path): Ditto. (cygwin_conv_to_full_posix_path): Ditto. (conv_path_list_buf_size): Add FIXME comment. (env_PATH_to_posix): Rename from env_win32_to_posix_path_list. Add size argument as required for env helper functions. (cygwin_win32_to_posix_path_list): Call conv_path_list with size set to MAX_PATH. (cygwin_posix_to_win32_path_list): Ditto. (cygwin_conv_path_list): New function. (cwdstuff::get): Fix length argument in call to sys_wcstombs. * spawn.cc (find_exec): Use cygwin_conv_path_list. * tls_pbuf.h (tmp_pathbuf::u_get: New method. * uinfo.cc (cygheap_user::ontherange): Allocate temporary path buffers using tmp_pathbuf. Use cygwin_conv_path. * winf.cc (av::unshift): Use cygwin_conv_path. * include/cygwin/version.h: Bump API minor number. * include/sys/cygwin.h: Comment out old cygwin32_XXX API. Mark old path handling API as deprecated. (cygwin_conv_path_t): Typedef. Define values. (cygwin_conv_path): Declare. (cygwin_create_path): Declare. (cygwin_conv_path_list): Declare.
2008-02-25 * dcrt0.cc (initial_env): Only use local buffer "buf" if DEBUGGING isCorinna Vinschen
enabled. Replace calls to GetEnvironmentVariable by calls to GetEnvironmentVariableA for clarity. Call GetEnvironmentVariableA with NULL buffer. (cygbench): Ditto, drop local buffer. * environ.cc (getearly): Call GetEnvironmentVariableA. (environ_init): Retrieve unicode environment and convert to current codepage locally. (getwinenveq): Ditto. * exceptions.cc (try_to_debug): Accommodate new sys_mbstowcs calling convention. * fhandler_clipboard.cc (set_clipboard): Call sys_mbstowcs to retrieve required buffer length. * fork.cc (frok::child): Call GetEnvironmentVariableA. * miscfuncs.cc: Accommodate changed arguments in calls to sys_mbstowcs. * sec_auth.cc: Ditto. * strfuncs.cc (sys_wcstombs_alloc): Fix formatting. (sys_mbstowcs): Change arguments to allow specifying a source string length. (sys_mbstowcs_alloc): Ditto. * uinfo.cc (cygheap_user::ontherange): Accommodate changed arguments in calls to sys_mbstowcs. * winsup.h (sys_mbstowcs): Adjust declaration. (sys_mbstowcs_alloc): Ditto.
2008-02-15Perform whitespace cleanup throughout.Christopher Faylor
* dcrt0.cc (signal_shift_subtract): Eliminate ancient backwards compatibility. (check_sanity_and_sync): Ditto. * winsup.h (SIGTOMASK): Ditto. Just use constant in signal calculation. * include/cygwin/version: Remove backwards signal mask compatibility define. * path.cc (symlink_info::check_sysfile): Cosmetic change. * registry.cc (get_registry_hive_path): Remove unneeded variable. * exceptions.cc (handle_sigsuspend): Eliminate thread signal mask and use either main sigmask or current thread sigmask. (set_process_mask): Ditto. (sighold): Ditto. (sigrelse): Ditto. (sigset): Ditto. (set_process_mask_delta): Ditto. (_cygtls::call_signal_handler): Ditto. * fhandler_process.cc (format_process_status): Ditto. * fhandler_termios.cc (fhandler_termios::bg_check): Ditto. * pinfo.h (class pinfo): Ditto. * select.cc (pselect): Ditto. * signal.cc (sigprocmask): Ditto. (abort): Ditto. (sigpause): Ditto. (sigsend): Ditto. (wait_sig): Ditto. * thread.h (pthread::parent_tls): New member. * thread.cc (pthread::pthread): Record parent_tls here. (pthread::thread_init_wrapper): Initialize sigmask from parent thread.
2008-02-14 * cygheap.cc (cwcsdup): New function.Corinna Vinschen
(cwcsdup1): New function. * cygheap.h (cygheap_user::get_windows_id): New method returning PWCHAR. (cwcsdup): Declare. (cwcsdup1): Declare. * registry.cc (get_registry_hive_path): Use WCHAR instead of char throughout. (load_registry_hive): Ditto. * registry.h (get_registry_hive_path): Change declaration accordingly. (load_registry_hive): Ditto. * sec_helper.cc (cygpsid::string): New method returning PWCHAR. * security.h (cygpsid::string): Declare. * syscalls.cc (seteuid32): Convert local name var to WCHAR. * uinfo.cc (cygheap_user::env_userprofile): Convert local name buffers to WCHAR. Call sys_wcstombs_alloc to generate puserprof buffer. * winsup.h: Fix comment. (NT_MAX_PATH): New definition for maximum internal path length. Use throughout where appropriate. * include/limits.h (PATH_MAX): Set to 4096 as on Linux.
2008-02-11 * dcrt0.cc (dll_crt0_1): Fix typo in call to sys_wcstombs.Corinna Vinschen
* miscfuncs.cc (next_char): Initialize ret to keep gcc happy.
2008-02-01 * string.h: Re-enable inline strcasematch and strncasematchCorinna Vinschen
implementations and rename to ascii_strcasematch/ascii_strncasematch. * dcrt0.cc: Replace str[n]casematch with ascii_str[n]casematch where applicable. * environ.cc: Ditto. * fhandler_process.cc: Ditto. * hookapi.cc: Ditto. * path.cc: Ditto. * spawn.cc: Ditto. * strace.cc: Ditto. * syscalls.cc: Ditto. * uinfo.cc: Ditto. * winf.cc: Ditto.
2008-01-31 * dcrt0.cc (dll_crt0_1): Use GetCommandLineW and convert to currentCorinna Vinschen
codepage. * environ.cc (set_file_api_mode): Always set file api to ANSI if not using the OEM codepage. (codepage_init): Allow "utf8" codepage. * fhandler_clipboard.cc (set_clipboard): Convert clipbuf to void and cast as needed. Always convert input to wide char and write CF_UNICODETEXT to clipboard. (fhandler_dev_clipboard::read): Read CF_UNICODETEXT from clipboard and convert to current codepage if CYGWIN_NATIVE format is not available. * fhandler_console.cc: Drop redundant undef. * smallprint.cc (__small_vsprintf): Convert PWCHAR and UNICODE_STRING to current codepage for printing. * strfuncs.cc: Use PWCHAR throughout. (get_cp): Return CP_UTF8 for utf8_cp codepage setting. (sys_wcstombs): Allow NULL target buffer. (sys_wcstombs_alloc): New function. (sys_mbstowcs_alloc): Ditto. * winsup.h (codepage_type): Add utf8_cp. (HEAP_NOTHEAP): Define. (sys_wcstombs_alloc): Declare. (sys_mbstowcs_alloc): Declare.
2007-12-12 * dcrt0.cc: Include string.h.Corinna Vinschen
(initial_env): Use small_printf's %P specifier. * dll_init.cc (dll_list::alloc): Use PATH_MAX instead of CYG_MAX_PATH for path name buffer size. * dll_init.h (struct dll): Ditto. * environ.cc: Include string.h. (win_env::add_cache): Use temporary local buffer for path conversion. (posify): Ditto. * exceptions.cc (try_to_debug): Use CreateProcessW to allow long path names. * miscfuncs.cc: Drop unused implementations of strcasematch and strncasematch. (ch_case_eq): Drop. (strcasestr): Drop. (cygwin_wcscasecmp): New function. (cygwin_wcsncasecmp): New function. (cygwin_strcasecmp): New function. (cygwin_strncasecmp): New function. (cygwin_wcslwr): New function. (cygwin_wcsupr): New function. (cygwin_strlwr): New function. (cygwin_strupr): New function. * ntdll.h (RtlDowncaseUnicodeString): Declare. (RtlUpcaseUnicodeString): Declare. (RtlInt64ToHexUnicodeString): Fix typo in comment. * string.h: Disable not NLS aware implementations of strcasematch and strncasematch. (cygwin_strcasecmp): Declare. (strcasecmp): Define as cygwin_strcasecmp. (cygwin_strncasecmp): Declare. (strncasecmp): Define as cygwin_strncasecmp. (strcasematch):Define using cygwin_strcasecmp. (strncasematch):Define using cygwin_strncasecmp. (cygwin_strlwr): Declare. (strlwr): Define as cygwin_strlwr. (cygwin_strupr): Declare. (strupr): Define as cygwin_strupr. * wchar.h: New file. * wincap.cc (wincapc::init): Use "NT" as fix OS string. * winsup.h (strcasematch): Drop declaration. (strncasematch): Ditto. (strcasestr): Ditto.
2007-12-06 * dcrt0.cc (initial_env): Use PATH_MAX instead of CYG_MAX_PATH for pathCorinna Vinschen
name buffer size. (dll_crt0_1): Allocate new_argv0 with PATH_MAX size. * exceptions.cc (debugger_command): Set size to 2 * PATH_MAX + 20; (error_start_init): Use PATH_MAX instead of CYG_MAX_PATH for path name buffer size. * external.cc (fillout_pinfo): Always fill out ep.progname 0-terminated. Fill out ep.progname_long. * fhandler_process.cc (fhandler_process::fill_filebuf): Allocate buffer for executable filename with PATH_MAX size. * pinfo.cc: Throughout use PATH_MAX instead of CYG_MAX_PATH. * pinfo.h (class _pinfo): Set progname size to PATH_MAX. * smallprint.cc: Include limits.h. Use PATH_MAX instead of CYG_MAX_PATH for path name buffer size. * strace.cc (strace::vsprntf): Ditto. * include/sys/cygwin.h (EXTERNAL_PINFO_VERSION_32_LP): Define. (EXTERNAL_PINFO_VERSION): Set to EXTERNAL_PINFO_VERSION_32_LP. (struct external_pinfo): Add progname_long member. * include/sys/dirent.h: Correctly include limits.h instead of sys/limits.h.
2007-11-27 Drop old SetResourceLock stuff in favor of mutos.Corinna Vinschen
* dcrt0.cc (_reslock): Remove. (__cygwin_user_data): Accommodate removal of resourcelocks member. (dll_crt0_0): Don't initialize resourcelocks. * exceptions.cc (_cygtls::signal_exit): Drop resourcelocks handling. * mmap.cc (mmap_guard): New muto. (LIST_LOCK): Define. (LIST_UNLOCK): Define. (mmap_list::search_record): Remove. (mmap_list::try_map): Include code for anonymous case from mmap_list::search_record. (mmap_is_attached_or_noreserve): Access bookkeeping lists in a thread safe way. (mmap64): Replace SetResourceLock/ReleaseResourceLock by LIST_LOCK/LIST_UNLOCK. Lock at the latest possible point. (munmap): Replace SetResourceLock/ReleaseResourceLock by LIST_LOCK/LIST_UNLOCK. (msync): Ditto. (mprotect): Ditto. * thread.cc (ResourceLocks::Lock): Remove. (SetResourceLock): Remove. (ReleaseResourceLock): Remove. (ResourceLocks::Init): Remove. (ResourceLocks::Delete): Remove. * thread.h (SetResourceLock): Drop declaration. (ReleaseResourceLock): Ditto. (class ResourceLocks): Drop definition. * include/sys/cygwin.h (class ResourceLocks): Drop forward declaration. (struct per_process): Replace resourcelocks with additional unused2 element. (per_process_overwrite): Accommodate above change.
2007-08-02* dcrt0.cc (codepage_type): Remove definition.Christopher Faylor
* strfuncs.cc: Move it here. New file with bits of miscfuncs.cc. * miscfuncs.cc: Remove wide character stuff.
2007-07-19 * dcrt0.cc (dll_crt0_0): Call set_cygwin_privileges here, afterCorinna Vinschen
initializing hProcToken. * sec_helper.cc (init_global_security): Don't call set_cygwin_privileges here.
2007-03-29 * cygheap.cc (cygheap_init): Fix formatting. Remove comment. SetCorinna Vinschen
shared_prefix depending only on terminal service capability. * dcrt0.cc (dll_crt0_1): Don't call set_cygwin_privileges here. * fhandler_fifo.cc (fhandler_fifo::open): Create the mutex as global object. * posix_ipc.cc (ipc_mutex_init): Use cygheap->shared_prefix. (ipc_cond_init): Ditto. * sec_helper.cc (privilege_name): Make static. Use LookupPrivilegeName directly to be independent of the state of cygheap. (set_privilege): Take a LUID as parameter instead of an index value. Only print debug output in case of failure. (set_cygwin_privileges): Add comment. Use LookupPrivilegeValue to get privilege LUIDs. (init_global_security): Call set_cygwin_privileges here. * security.h (privilege_name): Drop declaration. (set_privilege): Declare according to above change. (set_process_privilege): Call privilege_luid to get LUID. (_push_thread_privilege): Ditto. * shared.cc (open_shared): Add comment. On systems supporting the SeCreateGlobalPrivilege, try to create/open global shared memory first. Fall back to local shared memory if that fails. * thread.cc (semaphore::semaphore): Use cygheap->shared_prefix. * wincap.h (wincapc::has_create_global_privilege): New element. * wincap.cc: Implement above element throughout.
2007-02-23 Throughout remove all usage of wincap.has_security.Corinna Vinschen
* environ.cc (environ_init): Drop setting allow_ntsec here. * grp.cc (initgroups32): Drop usage of label "out". * security.cc (allow_ntsec): Set to true by default. * syscalls.cc (seteuid32): Remove label success_9x. * wincap.cc: Remove has_security throughout. * wincap.h: Ditto.
2007-02-22* dcrt0.cc (child_info_fork::alloc_stack_hard_way): Change sense of guard test.Christopher Faylor
Increase size of stack reserved and increase size before the current stack pointer. Use pointers when doing arithmetic. (dll_crt0_1): Initialize exception handler when we notice we're the child of a fork from non-main thread. * fork.cc (frok::parent): Make argument volatile. (frok::child): Ditto. (lock_signals): New class. (lock_pthread): Ditto. (hold_everhthing): Ditto. (frok::parent): Move atforkprepare and atforkparent to lock_pthread class. (fork): Make ischild boolean. Use hold_everything variable within limited scope to set various mutexes in such a way as to avoid deadlocks. * thread.h (pthread_mutex::tid): New variable, active when debugging for tracking thread id of owner. (pthread_mutex::set_owner): Set tid when debugging. * thread.cc (pthread_mutex::pthread_mutex): Clear tid. (pthread_mutex::_unlock): Ditto when unlocking. (pthread_mutex::fixup_after_fork): Set tid to special value after forking since owner is unknown.
2007-02-22 * Makefile.in (DLL_IMPORTS): Add libntdll.a.Corinna Vinschen
* autoload.cc: Remove all symbols from advapi32.dll, kernel32.dll and ntdll.dll available on all platforms since NT4. Throughout remove all usage of wincap.is_winnt. * dcrt0.cc (dll_crt0_0): Remove call to mmap_init. * fhandler.h (class fhandler_base): Remove has_changed flag. (fhandler_disk_file::touch_ctime): Remove declaration. (fhandler_disk_file::readdir_9x): Ditto. (fhandler_disk_file::touch_ctime): Remove. (fhandler_disk_file::readdir_9x): Remove. (fhandler_disk_file::closedir): Call NtClose instead of CloseHandle. * mmap.cc: Throughout call CreateMapping and MapView directly. (VirtualProt9x): Remove. (VirtualProtNT): Remove. (VirtualProtEx9x): Remove. (VirtualProtExNT): Remove. (VirtualProtect): Remove define. (VirtualProtectEx): Remove define. (CreateMapping9x): Remove. (CreateMappingNT): Rename to CreateMapping. (MapView9x): Remove. (MapViewNT): Rename to MapView. (struct mmap_func_t): Remove definition. (mmap_funcs_9x): Remove. (mmap_funcs_nt): Remove. (mmap_func): Remove. (mmap_init): Remove. * net.cc (getdomainname): Drop comment. Use NT4 registry key only. (get_95_ifconf): Remove. * pinfo.cc (winpids::enumNT): Rename to winpids::enum_processes. (winpids::enum9x): Remove. (winpids::set): Just call enum_processes directly. (winpids::enum_init): Ditto. * pinfo.h (class winpids): Drop enum_processes pointer. Rename enumNT to enum_processes. Drop enum9x declaration. Drop initialization of enum_processes throughout. * registry.cc (get_registry_hive_path): Just create NT key. (load_registry_hive): Only load NT specific file. * syscalls.cc (unlink_9x): Remove. (unlink): Just call unlink_nt. * wincap.cc: Remove is_winnt flag throughout. * wincap.h: Ditto. * winsup.h: Remove mmap_init declaration.
2006-12-12 Partially revert change from 2005-04-03, always running under anCorinna Vinschen
impersonation token, which collides with Vista UAC. * cygheap.h (deimpersonate): revert to self instead of impersonating hProcImpToken. (reimpersonate): Only impersonate if setuid. * dcrt0.cc (dll_crt0_0): Don't initialize hProcImpToken here. (dll_crt0_1): Set privileges on hProcToken. * fork.cc (frok::child): Set privileges on hProcToken. Close handle to hProcImpToken. * grp.cc (internal_getgroups): Use hProcToken instead of hProcImpToken. * security.cc (check_access): Create hProcImpToken on demand here. * security.h (set_process_privilege): Set privileges on hProcToken. (_push_thread_privilege): Use hProcToken instead of hProcImpToken. (pop_thread_privilege): If not setuid'ed, revert to self. * syscalls.cc (setegid32): Drop setting primary group on hProcImpToken. Close handle to hProcImpToken. * uinfo.cc (internal_getlogin): Ditto. * winsup.h (clear_procimptoken): New inline function.
2006-12-11* child_info.h (child_info_spawn::__stdin): New element.Christopher Faylor
(child_info_spawn::__stdin): Ditto. (CURR_CHILD_INFO_MAGIC): Regenerate. * dcrt0.cc (check_sanity_and_sync): Minor cleanup. (child_info_spawn::handle_spawn): Handle new __std* elements by calling move_fd. * dtable.cc (dtable::move_fd): Define new function. * dtable.h (dtable::move_fd): Declare new function. * fhandler.h (fhandler_pipe::popen_pid): Declare new element. * fhandler.h (fhandler_pipe::get_popen_pid): Define new function. * fhandler.h (fhandler_pipe::set_popen_pid): Ditto. * pipe.cc (fhandler_pipe::fhandler_pipe): Zero popen_pid. (fhandler_pipe::dup): Ditto. * spawn.cc (handle): Change second argument to bool. (spawn_guts): Accept __stdin/__stdout arguments and set them appropriately in child_info structure and in STARTUPINFO structure. * syscalls.cc (popen): New cygwin-specific implementation using spawn. (pclose): Ditto. * winsup.h (spawn_guts): Accommodate new arguments for spawn_guts. * fhandler.cc (fhandler_base::set_no_inheritance): Make second arg a bool. * fhandler.h (fhandler_base::set_no_inheritance): Ditto for declaration. * child_info.h (child_info::msv_count): Rename from the now-inappropriate "zero". (child_info_spawn::filler): Add filler to work around Vista bug. (child_info_fork::filler): Ditto. * dcrt0.cc (get_cygwin_startup_info): Remove "zero" check since it is now always filled out. * fork.cc (frok::parent): Move ch.zero manipulation to constructor. * spawn.cc (spawn_guts): Ditto. Remove _ch wrapper. * sigproc.cc (child_info::child_info): Initialize starter[]. * shared.cc (shared_info::heap_slop_size): Remove noisy system_printfs. * shared_info.h (CURR_SHARED_MAGIC): Regenerate.
2006-12-05 * dcrt0.cc (get_cygwin_startup_info): Fix comment.Corinna Vinschen
* wincap.cc (wincapc::init): Always reset needs_count_in_si_lpres2 to false on non 64-bit systems.
2006-12-05 * dcrt0.cc (get_cygwin_startup_info): Change zeros to DWORD array.Corinna Vinschen
Expect first DWORD in child_info struct being set to non-zero if wincap.needs_count_in_si_lpres2 is set. Add comment to explain why. * fork.cc (frok::parent): Set ch.zero[0] to a sensible count value if wincap.needs_count_in_si_lpres2 is set. * spawn.cc (spawn_guts): Ditto. Add filler bytes after ch on stack to accomodate needs_count_in_si_lpres2. * wincap.h: Define needs_count_in_si_lpres2 throughout. * wincap.cc: Ditto.
2006-10-27 * dcrt0.cc (__api_fatal): Drop spare argument to __small_sprintf.Corinna Vinschen
* smallprint.c (__small_vsprintf): Preserve GetLastError value. * winsup.h (api_fatal): Simplify. Drop duplicate filename arg.
2006-06-04* dcrt0.cc (dll_crt0_0): Call tty_list::init_session here.Christopher Faylor
(dll_crt0_1): Reflect renaming from tty_init to tty::init_session. (do_exit): Reflect moving of tty_terminate into tty_list. * exceptions.cc (events_init): Move tty_mutex stuff elsewhere. * fhandler_console.cc (set_console_title): Use lock_ttys class. * fhandler_termios.cc (fhandler_termios::bg_check): Make debug output more accurate. * fhandler_tty.cc (fhandler_tty_slave::open): Reflect move of attach_tty into tty_list class. Don't attempt to grab master end of pty if master doesn't exist. (fhandler_pty_master::open): Reflect move of allocate_tty into tty_list class. Use lock_ttys::release to release mutex. Improve debugging output. (fhandler_pty_master::setup): Remove if 0'ed block. Fix argument to SetNamedPipeHandleState. * pinfo.cc (_pinfo::set_ctty): Lock ttys before setting sid/pgid. Improve debugging. Add temporary debugging. * tty.cc (tty_list::init_session): New function. (tty::init_session): Rename from tty_init. Reflect move of attach_tty to tty_list class. (tty::create_master): Rename from create_tty_master. (tty_list::attach): Rename from attach_tty. Reflect renaming of connect_tty to connect. Ditto for allocate_tty. (tty_terminate): Delete. (tty_list::terminate): Subsume tty_terminate. Use lock_ttys rather than manipulating mutex directly. (tty_list::allocate): Rename from allocate_tty. Use lock_ttys rather than manipulating mutex directly. Don't set sid here since linux apparently doesn't do this. Reflect move of create_tty_master into tty. (lock_ttys::lock_ttys): Define new constructor. (lock_ttys::release): New function. * tty.h (tty::exists): Return false immediately if !master_pid. (tty::set_master_closed): Define new function. (tty::create_master): Ditto. (tty::init_session): Ditto. (tty_list::mutex): New field. (tty_list::allocate): Define new function. (tty_list::connect): Ditto. (tty_list::attach): Ditto. (tty_list::init_session): Ditto. (lock_ttys): New class. (tty_init): Delete declaration. (tty_terminate): Ditto. (attach_tty): Ditto. (create_tty_master): Ditto.
2006-06-03* cygheap.cc (init_cygheap::close_ctty): Remove obsolete code.Christopher Faylor
* dcrt0.cc (child_info_spawn::handle_spawn): Signal ready after we've run fixup_after_exec. * dtable.cc (dtable::fixup_after_exec): Add debugging output. * fhandler_tty.cc (fhandler_pty_master::doecho): Use class version of to_master. (fhandler_tty_common::close): Remove obsolete code. (fhandler_tty_slave::fixup_after_exec): Don't close, since this is done in dtable's fixup_after_exec. (revisit later?) (fhandler_pty_master::fixup_after_exec): Ditto.
2006-06-03* cygtls.h (CYGTLS_PADSIZE): Bump up or suffer a regrettable collision with theChristopher Faylor
call chain.
2006-06-02* cygheap.cc (cygheap_fixup_in_child): Don't close parent handle here. Let theChristopher Faylor
caller do that. * dcrt0.cc (child_info_spawn::handle_spawn): Close parent handle here to allow fixup_after_exec functions to use it. * cygtls.cc (_cygtls::call2): Avoid calling exit thread if called with *crt0_1 functions. * cygtls.h (_cygtls::isinitialized): Check that we actually have a tls before seeing if it is initialized. * gendef (_sigfe_maybe): Ditto. * dcrt0.cc (dll_crt0_1): Remove static, use just one argument. * dll_init.cc (dllcrt0_info): New structure. (dll_dllcrt0): Change into a front-end to renamed dll_dllcrt0_1 so that we'll always be assured of having something like a tls. (dll_dllcrt0_1): New function, basically renamed from from dll_dllcrt0. Unconditionally call _my_tls.init_exception_handler now that we are assured of having a tls. Change variable name from "linking" to "linked". * winsup.h (dll_crt0_1): Declare. (dll_dllcrt0_1): Ditto.
2006-05-28white spaceChristopher Faylor
2006-05-25* cygtls.cc (_cygtls::call): Call call2 using _my_tls.Christopher Faylor
(_cygtls::init_exception_handler): Always replace existing exception handler with cygwin exception handler. * cygtls.h (_cygtls::call2): Remove static designation. * dcrto.cc (dll_crt0_1): Define in a way that allows calling via _cygtls::call. (_initialize_main_tls): Delete. (_dll_crt0): Call dll_crt0_1 via cygtls::call. Set _main_tls here. * external.cc (cygwin_internal): Implement CW_CYGTLS_PADSIZE. * include/sys/cygwin.h (CW_CYGTLS_PADSIZE): Define. * tlsoffsets.h: Regenerate.
2006-05-16* sigproc.cc (no_signals_available): Detect hwait_sig == INVALID_HANDLE_VALUE.Christopher Faylor
(wait_sig): Set hwait_sig to INVALID_HANDLE_VALUE on __SIGEXIT. * cygtls.cc (_cygtls::init_thread): Zero entire _my_tls structure and no more. * cygtls.h (_my_tls::padding): Delete. (CYGTLS_PADSIZE): Redefine concept of padding to mean padding at the end of the stack. * dcrt0.cc (initialize_main_tls): Change return to void. * gentls_offsets: Treat const specially, too. Keep going after a '}' is found. Change negative offset calculation to use CYGTLS_PADSIZE. * init.cc (_my_oldfunc): New variable. (threadfunc_fe): Use stored tls value for oldfunc rather than blindly writing to the stack. (munge_threadfunc): Set oldfunc in tls. (dll_entry): Initialize tls allocation. * tlsoffsets.h: Regenerate.
2006-04-05* dcrt0.cc (dll_crt0_0): Move user_data->{resourcelocks,threadinterface}Christopher Faylor
initialization here from dll_crt0_1. (dll_crt0_1): See above.
2006-04-03* child_info.h (CURR_CHILD_INFO_MAGIC): Update.Christopher Faylor
(child_info_fork::alloc_stack): Move into this class. (child_info_fork::alloc_stack_hard_way): Ditto. * dcrt0.cc (child_info_fork::alloc_stack): Ditto. (child_info_fork::alloc_stack_hard_way): Ditto. (_dll_crt0): Reference alloc_stack via fork_info.
2006-04-03* dcrt0.cc (sm): Delete.Christopher Faylor
(alloc_stack_hard_way): Figure out where the stack lives here rather than relying on previously filled out information which has been invalid since 1.5.19.
2006-03-29* dcrt0.cc (child_info_fork::handle_fork): Set uid/gid in myself so that it canChristopher Faylor
be used by subsequent startup functions. (dll_crt0_0): Issue a warning if DuplicateTokenEx fails and DEBUGGING. (dll_crt0_1): Move user_data->{resourcelocks,threadinterface} initialization here from dll_crt0_0. * fork.cc (frok::child): Tell wait_for_sigthread that this is fork. (frok::parent): Only initialize start_time once. Tighten time when we're "deimpersonated". * sigproc.cc (signal_fixup_after_exec): Rework (futiley) sa_buf stuff. Add debugging output. (wait_for_sigthread): Accept an argument which illustrates whether we are forked or not. (wait_sig): Avoid using myself pointer. * winsup.h ((wait_for_sigthread): Reflect change to argument.
2006-03-23* dcrt0.cc (child_info_spawn::handle_spawn): Don't initialize the consoleChristopher Faylor
handler here. * dtable.cc (dtable::stdio_init): Initialize console handler here.
2006-03-22* fhandler.cc (fcntl): Print flags in hex.Christopher Faylor
* dcrt0.cc (dll_crt0_0): Semi-revert 2006-03-14 change which moved pinfo_init and uinfo_init here. (dll_crt0_1): Ditto. (__dll_crt0): Ditto. Don't call update_envptrs here. (dll_crt0_1): Ditto. Move wait_for_sigthread call here from dll_crt0_0. * environ.cc (environ_init): Call it here instead. * sigproc.cc (my_readsig): New static variable. (wait_for_sigthread): Set up read pipe here since we are assured that we have the proper privileges when this is called. (talktome): Eliminate second argument since it is available as a global now. (wait_sig): Reflect use of my_readsig.
2006-03-21* dcrt0.cc (dll_crt0_0): Call SetErrorMode earlier.Christopher Faylor
* pinfo.cc (_pinfo::dup_proc_pipe): Reset wr_proc_pipe on failure. Return previous pipe handle. * pinfo.h (_pinfo::dup_proc_pipe): Reflect change to return value. * spawn.cc (spawn_guts): Restore previous proc pipe on retry or if process exits before synchronization.
2006-03-20* child_info.h (child_status): New enum.Christopher Faylor
(child_info::flag): Rename from 'straced'. (child_info::isstraced): New function. (child_info::iscygwin): Ditto. (child_info_fork::handle_fork): Reparmize. (child_info_fork::handle_failure): Ditto. (child_info_spawn::handle_spawn): New function. * dcrt0.cc (get_cygwin_startup_info): Use isstraced method. (child_info_spawn::handle_spawn): Define new function from code previously in dll_crt0_0. (dll_crt0_0): Move spawn stuff into handle_spawn. Only call init_console_handler for fork case. * sigproc.cc (child_info::child_info): Set flag appropriately. (child_info::proc_retry): Treat exit code as "funny" if it's a cygwin process. * spawn.cc (spawn_guts): Remove commented out flag setting.
2006-03-20* dcrt0.cc (dll_crt0_0): Oops. We need to bother with setting this in theChristopher Faylor
fork/exec case.
2006-03-20* dcrt0.cc (dll_crt0_0): Don't bother with setting init_console_handler hereChristopher Faylor
since it will be set later when we discover if we have a ctty or not. * exceptions.cc (init_console_handler): Properly remove NULL handler.
2006-03-18* child_info.h (CURR_CHILD_INFO_MAGIC): Regenerate.Christopher Faylor
(child_info::retry): Move here from fork subclass. (child_info::exit_code): New field. (child_info::retry_count): Max retry count for process start. (child_info::proc_retry): Declare new function. (child_info_fork::retry): Move to parent. (child_info_fork::fork_retry): Ditto. * dcrt0.cc (child_info::fork_retry): Rename and move. (child_info_fork::handle_failure): Move. (dll_crt0_0): Initialize console handler based on whether we have a controlling tty or not. Avoid nonsensical check for fork where it can never occur. * environ.cc (set_proc_retry): Rename from set_fork_retry. Set retry_count in child_info. (parse_thing): Reflect above change. * exceptions.cc (dummy_ctrl_c_handler): Remove unused variable name. (ctrl_c_handler): Always return TRUE for the annoying CTRL_LOGOFF_EVENT. * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Remove call to init_console_handler. * fhandler_tty.cc (fhandler_tty_slave::open): Just call mange_console_count here and let it decide what to do with initializing console control handling. * fork.cc (fork_retry): Remove definition. (frok::parent): Define static errbuf and use in error messages (not thread safe yet). Close pi.hThread as soon as possible. Protect pi.hProcess as soon as possible. Don't set retry_count. That happens automatically in the constructor now. Accommodate name change from fork_retry to proc_retry. * init.cc (dll_entry): Turn off ctrl-c handling early until we know how it is supposed to be handled. * pinfo.cc (_pinfo::dup_proc_pipe): Remember original proc pipe value for failure error message. Tweak debug message slightly. * sigproc.cc (child_info::retry_count): Define. (child_info::child_info): Initialize retry count. (child_info::sync): Set exit code if process dies before synchronization. (child_info::proc_retry): Rename from child_info_fork::fork_retry. Use previously derived exit code. Be more defensive about what is classified as an error exit. (child_info_fork::handle_failure): Move here from dcrt0.cc. * spawn.cc (spawn_guts): Maintain error mode when starting new process to avoid annoying pop ups. Move deimpersonate call within new loop. Move envblock freeing to end. Loop if process dies prematurely with bad exit code. * syscalls.cc (init_console_handler): Remove hopefully unneeded call to init_console_handler.
2006-03-16* cygheap.cc (init_cygheap::manage_console_count): Turn console control handlerChristopher Faylor
on/off depending on whether we have allocated a console or not. * dcrt0.cc (child_info_fork::fork_retry): Add more potential retry statuses. (dll_crt0_0): Turn on/off console control depending on whether we have a controlling tty or not. * exceptions.cc (init_console_handler): Change BOOL to bool. * fhandler_console.cc (fhandler_console::need_invisible): Cosmetic change. * winsup.h (init_console_handler): Reflect argument type change. * wincap.h (supports_setconsolectrlhandler_null): Remove duplicate capability throughout. * wincap.cc: Ditto.
2006-03-15* child_info.h (child_info_fork::fork_retry): Declare new function.Christopher Faylor
* dcrt0.cc (child_info_fork::fork_retry): Define new function. * fork.cc (frok::parent): Move retry decision into child_info_fork::fork_retry and honor what it tells us to do. * sigproc.cc (sig_send): Unhold signals on __SIGEXIT.
2006-03-14* dcrt0.cc (main_environ): Initialize to &__cygwin_environment.Christopher Faylor
(dll_crt0_1): Move resourcelocks, thread interface, pinfo_init, and uinfo_init... (dll_crt0_0): ...to here. (_dll_crt0): Call update_envptrs here after setting main_environ. * environ.cc (environ_init): Eliminate initted variable. Don't call update_envptrs here. * sigproc.cc (wait_sig): Use my_sendsig when calling CreatePipe to avoid a dereference.
2006-03-14* child_info.h (child_info_fork::handle_failure): Declare new function.Christopher Faylor
(child_info_fork::retry): New field. * dcrt0.cc (__api_fatal_exit_val): Define. (child_info_fork::handle_failure): Define new function. (__api_fatal): Exit using __api_fatal_exit_val value. * environ.cc (set_fork_retry): Set fork_retry based on CYGWIN environment variable. (parse_thing): Add "fork_retry" setting. * fork.cc (fork_retry): Define. (frok::parent): Reorganize to allow retry of failed child creation if child signalled that it was ok to do so. * heap.cc (heap_init): Signal parent via handle_failure when VirtualAlloc fails. * pinfo.h (EXITCODE_RETRY): Declare. * sigproc.cc (child_info::sync): Properly exit with failure condition if called for fork and didn't see subproc_ready. * spawn.cc (spawn_guts): Use windows pid as first argument. * winsup.h: Remove obsolete NEW_MACRO_VARARGS define. (__api_fatal_exit_val): Declare. (set_api_fatal_return): Define. (in_dllentry): Declare. * exceptions.cc (inside_kernel): Remove unneeded in_dllentry declaration.