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-07Remove unneeded header files from source files throughout.Christopher Faylor
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-01 * Fix copyright dates.Corinna Vinschen
2008-03-27* hookapi.cc (find_first_notloaded_dll): New function.Christopher Faylor
* pinfo.cc (status_exit): New function. Issue message when dll not found. Use find_first_notloaded_dll to find a nonexistent dll. (pinfo::maybe_set_exit_code_from_windows): Call status_exit when exit code >= 0xc0000000UL. * sigproc.cc (child_info::proc_retry): Return exit code when STATUS_DLL_NOT_FOUND. * spawn.cc (spawn_guts): Minor cleanup. * syscalls.cc (close_all_files): Don't actually close stderr filehandle. Just make it noninheritable. * winsup.h (find_first_notloaded_dll): Declare new function. * ntdll.h: Add several missing NTSTATUS defines.
2008-03-07 * Makefile.in (DLL_OFILES): Add tls_pbuf.o.Corinna Vinschen
* autoload.cc (CreateDesktopW): Replace CreateDesktopA. (CreateWindowStationW): Replace CreateWindowStationA. (GetUserObjectInformationW): Replace GetUserObjectInformationA. * cygheap.h (cwdstuff::get): Assume default buffer size NT_MAX_PATH. * cygtls.cc (_cygtls::remove): Free temporary TLS path buffers. * cygtls.h (TP_NUM_C_BUFS): Define. (TP_NUM_W_BUFS): Define. (class tls_pathbuf): New class to store pointers to thread local temporary path buffers. (_local_storage::pathbufs): New member. * environ.cc (win_env::add_cache): Use temporary TLS path buffer instead of stack based buffer. (posify): Get temporary outenv buffer from calling function. (environ_init): Create temporary TLS path buffer for posify. (build_env): Create Windows environment block as WCHAR buffer. * environ.h (build_env): Change declaration accordingly. * external.cc (sync_winenv): Accommodate build_env change. * fhandler_console.cc (fhandler_console::need_invisible): Use GetUserObjectInformationW and CreateWindowStationW. * fhandler_process.cc (format_process_maps): Use temporary TLS path buffer instead of stack based buffer. * fork.cc (frok::parent): Convert to use CreateProcessW. * path.cc: Throughout use temporary TLS path buffers instead of stack based buffer. Replace checks for CYG_MAX_PATH by checks for NT_MAX_PATH. (getfileattr): New function to replace GetFileAttributesA. (normalize_win32_path): Remove Win32 and NT long path prefixes. (getwd): Assume PATH_MAX + 1 buffer per SUSv3. * path.h (class path_conv): Set path buffer to size NT_MAX_PATH. (iswdrive): Define. * pinfo.cc (commune_process): Use temporary TLS path buffer instead of stack based buffer. * registry.cc (get_registry_hive_path): Ditto. (load_registry_hive): Ditto. * spawn.cc (spawn_guts): Convert to use CreateProcessW and CreateProcessAsUserW. (av::fixup): Open/close file using NtOpenFile/NtClose. * syscalls.cc (mknod_worker): Allow PATH_MAX file name. (mknod32): Ditto. (getusershell): Ditto. * tls_pbuf.cc: New file implementing tls_pathbuf and tmp_pathbuf methods. * tls_pbuf.h: New header for files using tmp_pathbuf. * tlsoffsets.h: Regenerate. * winsup.h (NT_MAX_PATH): Define as 32767 to avoid USHORT overflow.
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.
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-27Change many cygheap allocation routines to their *_abort analogs.Christopher Faylor
* cygheap.cc (cmalloc_abort): New function. (crealloc_abort): Ditto. (ccalloc_abort): Ditto.
2007-07-19 * autoload.cc (SetUserObjectSecurity): Drop.Corinna Vinschen
* pinfo.cc (pinfo::set_acl): Use NtSetSecurityObject instead of SetKernelObjectSecurity. * spawn.cc (spawn_guts): Use NtSetSecurityObject instead of SetUserObjectSecurity. * uinfo.cc (cygheap_user::init): Ditto.
2007-07-07Preliminary change to make fifos/pipes interruptible and fifos reliable.Christopher Faylor
* dtable.cc (dtable::find_fifo): Eliminate definition. * dtable.h (dtable::find_fifo): Ditto for declaration. * fhandler.cc (fhandler_base::raw_read): Remove pipe-specific stuff. (fhandler_base::fhandler_base): Ditto. (fhandler_base::close): Handle overlapped I/O structure if appropriate. (fhandler_base::dup): Ditto. (fhandler_base::fork_fixup): Ditto. (fhandler_base::setup_overlapped): Define new function. (fhandler_base::destroy_overlapped): Ditto. (fhandler_base::wait_overlapped): Ditto. (fhandler_base::read_overlapped): Ditto. (fhandler_base::write_overlapped): Ditto. * fhandler.h (fhandler_base::get_overlapped): Declare new function. (fhandler_base::setup_overlapped): Ditto. (fhandler_base::destroy_overlapped): Ditto. (fhandler_base::wait_overlapped): Ditto. (fhandler_base::read_overlapped): Ditto. (fhandler_base::write_overlapped): Ditto. (fhandler_base::get_guard): Eliminate. (fhandler_pipe::*): Rework to eliminate most Win9x related cruft, removing many variables and defining a new overlapped capability. (fhandler_fifo::*): Ditto. (fifo_state): Declare new enum. * fhandler_fifo.cc (fhandler_fifo::fhandler_fifo): Remove old Win9x stuff. Initialize overlapped handle to NULL. (fhandler_fifo::set_use): Eliminate. (fhandler_fifo::open_nonserver): Define. (fhandler_fifo::open): Rework to use named pipes and overlapped I/O. (fhandler_fifo::wait): Define new function to wait for named pipe connection. (fhandler_fifo::read): Rework to use wait() and new overlapped I/O functionality. (fhandler_fifo::write): Ditto. (fhandler_fifo::dup): Eliminate. * pinfo.cc (commune_process): Remove fifo handling. (_pinfo::commune_request): Ditto. * pinfo.h (picom): Ditto. * pipe.cc (fhandler_pipe::fhandler_pipe): Remove Win9x stuff. Initialize overlapped handle to NULL. (fhandler_pipe::open): Eliminate Win9x stuff. (fhandler_pipe::set_close_on_exec): Eliminate. (read_pipe): Eliminate. (fhandler_pipe::close): Ditto. (fhandler_pipe::fixup_after_exec): Ditto. (fhandler_pipe::fixup_in_child): Ditto. (fhandler_pipe::read): Rework to use overlapped I/O. (fhandler_pipe::write): New function using overlapped I/O. (fhandler_pipe::dup): Rework to eliminate Win9x stuff. (fhandler_pipe::create_selectable): Rework to eliminate Win9x and use overlapped I/O. * select.cc (peek_pipe): Rework to eliminate Win9x stuff and use overlapped I/O. (fhandler_base::ready_for_read): Ditto.
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.
2007-02-20Remove extraneous whitespace.Christopher Faylor
* pinfo.cc (commune_process): Use default argument to lock_process. * sigproc.cc: Update copyright. * select.cc: Ditto.
2006-12-19* pinfo.cc (set_myself): Use a more foolproof method for determining if theChristopher Faylor
current process was started from another cygiwn process.
2006-11-30 * dir.cc (mkdir): Check last path component for "..".Corinna Vinschen
(rmdir): Don't check last path component for "..". * fhandler_disk_file.cc (fhandler_disk_file::rmdir): Drop kludge which tries to allow deleting the current working directory. * path.cc (has_dot_last_component): Add parameter to indicate testing for "..". Take trailing slash into account. (symlink_info::posixify): Rely on cygheap->cwd.win32 having a useful value. (cwdstuff::init): Initialize cygheap->cwd with current working directory. Change to windows_system_directory afterwards. (cwdstuff::set): Never call SetCurrentDirectory here. Just check if changing into target directory would be allowed. Add comment to explain why. * path.h (has_dot_last_component): Declare with second parameter. * pinfo.cc (pinfo::zap_cwd): Remove. (pinfo::exit): Drop call to zap_cwd. * pinfo.h (class pinfo): Remove declaration of zap_cwd. * spawn.cc (spawn_guts): Set current working directory for non-Cygwin child applications. Drop call to zap_cwd.
2006-08-11* pinfo.cc (_onreturn::~onreturn): Don't attempt to close a NULL handle.Christopher Faylor
2006-07-19 * pinfo.cc (commune_process): Don't add extra \0 to cmdline.Corinna Vinschen
(_pinfo::cmdline): Ditto process internal.
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-05-22* child_info.h (_CI_SAW_CTRL_C): New enum.Christopher Faylor
(CURR_CHILD_INFO_MAGIC): Reset. (saw_ctrl_c): New function. (set_saw_ctrl_c): Ditto. * sigproc.cc (child_info::proc_retry): Return EXITCODE_OK if we get STATUS_CONTROL_C_EXIT and we actually saw a CTRL-C. * spawn.cc (dwExeced): Delete. (chExeced): New variable. (spawn_guts): Set chExeced; * exceptions.cc (dwExeced): Delete declaration. (chExeced): Declare. (ctrl_c_handler): Detect if we're an exec stub process and set a flag, if so. * fhandler_tty.cc (fhandler_tty_common::__release_output_mutex): Add extra DEBUGGING test. * pinfo.cc: Fix comment.
2006-03-24* fhandler_console.cc (fhandler_console::fixup_after_fork_exec): Make errorChristopher Faylor
message more explicit. * pinfo.cc (_pinfo::commune_request): Don't lock process unless we're looking for fifos.
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* pinfo.cc (commune_process): Fix randomly invalid pointer which caused fifosChristopher Faylor
to work incorrectly.
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-02-11* fhandler_process.cc (format_process_stat): Use cygwin-derived start time evenChristopher Faylor
on NT since it is the logical start time of the "process". * pinfo.cc (set_myself): Don't set start time when it should have already been set previously.
2006-02-11revert previously applied patch.Christopher Faylor
2006-02-11* times.cc (clock_getres): Use correct conversion from milliseconds toChristopher Faylor
seconds/nanoseconds. (clock_setres): Use correct conversion to nanoseconds.
2006-02-06Always zero all elements of siginfo_t throughout.Christopher Faylor
* cygtls.h (_cygtls::thread_context): Declare new field. (_cygtls::thread_id): Ditto. (_cygtls::signal_exit): Move into this class. (_cygtls::copy_context): Declare new function. (_cygtls::signal_debugger): Ditto. * cygtls.cc (_cygtls::init_thread): Fill out thread id field. * exceptions.cc (exception): Change message when exception info is unknown. Copy context to thread local storage. (_cygtls::handle_exceptions): Avoid double test for fault_guarded. Reflect move of signal_exit to _cygtls class. (sigpacket::process): Copy context to thread local storage. (_cygtls::signal_exit): Move to _cygtls class. Call signal_debugger to notify debugger of exiting signal (WIP). Call stackdump here (WIP). (_cygtls::copy_context): Define new function. (_cygtls::signal_debugger): Ditto. * tlsoffsets.h: Regenerate. * include/cygwin.h (_fpstate): New internal structure. (ucontext): Declare new structure (WIP). (__COPY_CONTEXT_SIZE): New define. * exceptions.cc (_cygtls::interrupt_setup): Clear "threadkill" field when there is no sigwaiting thread. (setup_handler): Move event handling into interrupt_setup.
2006-01-02 Bump copyright dates.Corinna Vinschen
2006-01-02* pinfo.cc (pinfo::exit): Swap signal and normal exit value when not startedChristopher Faylor
from a cygwin process - just like the good-old-days of B20.
2005-12-29*** cygwin DLL Changes:Christopher Faylor
* child_info.h (CURR_CHILD_INFO_MAGIC): Reset. (child_info::dwProcessId): Delete. (child_info::straced): New variable. (child_info::handle_fork): New member function. * dcrt0.cc (in_forkee): New global variable. (__cygwin_user_data::forkee): Mark as obsolete. (do_global_ctors): Use in_forkee rather than user_data->forkee. (get_cygwin_startup_info): Ditto. Deal with new straced field to allow strace to deal with children of attached processes. (initial_env): Accommodate changes to strace::hello. (child_info_fork::handle_fork): Rename from plain old 'handle_fork'. Move alloc_stack() call elsewhere. (dll_crt0_0): Fill out more of user_data. Reference handle_fork via fork_info. Add some debugging output. (_dll_crt0): Don't wait for sync thread if sync_startup is invalid. Zero sync_startup here. Call alloc_stack() here, if appropriate. (dll_crt0_1): Use in_forkee rather than user_data->forkee. (dll_crt0): Ditto. * malloc_wrapper.cc (malloc_init): Ditto. * dll_init.cc (in_forkee): Remove local static version of this variable. (dll_list::load_after_fork): Don't set in_forkee here. * external.cc (cygwin_internal): Use strace method rather than accessing field directly. * fhandler.cc (fhandler_base::read): Ditto. * fhandler_tty.cc (fhandler_tty_common::__acquire_output_mutex): Ditto. * fork.cc (frok::parent): Invoke strace write_childpid to communicate with potential strace. (child_copy): Add more detail to debugging output. * init.cc (calibration_id): New static variable. (prime_threads): Set sync_startup to invalid handle if we already know about thread_func_ix. Use static calibration_id to hold calibration thread id. * munge_threadfunc (munge_threadfunc): Don't try to debug if we don't find threadfunc_ix. (dll_entry): Avoid calling munge_threadfunc and _cygtls::remove on non-cygwin threads invoked during process startup. * pinfo.cc (set_myself): Always call strace.hello here regardless of DEBUGGING. * sigproc.cc (child_info::child_info): Remove spurious handling of dwProcessId. Set straced as appropriate. * spawn.cc (spawn_guts): Rename ciresrv to ch. Invoke strace write_childpid to communicate with potential strace. * strace.cc: Include child_info.h. (strace::hello): Remove inited test. Use active() method to test if strace has been activated. Handle case where we are started before (mypid): New function. (strace::vsprntf): Try to deal more intelligently with case where progname may not be filled out. Put pid in parentheses if it is a windows pid rather than a cygwin pid. myself has been filled out. (strace::write_childpid): New function for notifying strace about the creation of children. (strace::vprntf): Use strace method rather than accessing field directly. (strace_printf): Ditto. (strace::wm): Ditto. * winsup.h (in_forkee): Declare. * include/sys/strace.h (strace::write_childpid): Declare new function. (strace::attached): Define new function. (strace::active): Ditto. (strace::active_val): Ditto. (_STRACE_ON): Delete. (_STRACE_OFF): Ditto. (define_strace0): Use strace method rather than accessing field directly. (strace_printf_wrap): Ditto. (strace_printf_wrap1): Ditto. *** cygwin utils changes: * strace.cc (nprocesses): Make static global. (quiet): New variable. (strace_active): Ditto. (add_child): Increment nprocesses here. Don't add a child if it is already added (windows bug?). Report on child if not quiet. (get_child): Just return NULL if child not found. (remove_child): Report on child if not quiet. (attach_process): Don't complain if given a windows process. Use windows pid in error. (handle_output_debug_string): Issue error if trying to manipulate a process that we don't know about. Handle _STRACE_CHILD_PID - attach to reported child when we get this. (proc_child): Move nprocesses to file scope. Report on exceptions. (longopts): Implement "--quiet". (opts): Implement "-q". (main): Manipulate quiet flag. * utils.sgml (strace): Add words describing '-q'.
2005-12-26* dcrt0.cc (__api_fatal): Simplify to just use strace mechamisms.Christopher Faylor
(do_exit): Move minimal_printf... * pinfo.cc (pinfo::exit): ...into here. * strace.cc (strace::vprntf): Guarantee output to the console when system_printf/api_fatal. * heap.cc (heap_init): Wait a second before issuing an error when ERROR_INVALID_ADDRESS since this is probably due to a CTRL-C handler sneaking in, using the memory that we want to use for the heap, and, eventually exiting.
2005-12-24* cygtls.cc (_cygtls::handle_threadlist_exception): Make an error fatal.Christopher Faylor
* cygtls.h (sockaddr_in): Use header rather than defining our own structure. * exceptions.cc (_cygtls::interrupt_setup): Use exact contents of sa_mask rather than assuming tht current sig should be masked, too. (_cygtls::call_signal_handler): Use more aggressive locking. * gendef (_sigbe): Wait until later before releasing incyg. (_sigreturn): Remove more arguments to accommodate quasi-sa_sigaction support. (_sigdelayed): Push arguments for sa_sigaction. More work needed here. * signal.cc (sigaction): Implement SA_NODEFER. * tlsoffsets.h: Regenerate. * sigproc.cc (wait_sig): Use default buffer size of Windows 9x complains. * pinfo.cc (_onreturn::dummy_handle): Remove. (_onreturn::h): Make this a pointer. (_onreturn::~_onreturn): Detect whether pointer is NULL rather than value is NULL. (_onreturn::_onreturn): Set h to NULL initially. (_onreturn::no_close_p_handle): Set h to NULL. (winpids::add): Initialize onreturn with value from p.hProcess immediately.
2005-12-22whitespace cleanup to force snapshot.Christopher Faylor
2005-12-22* pinfo.cc (winpids::add): Increment nelem when winpid is true since we don'tChristopher Faylor
care if it's a cygwin process in that case.
2005-12-22* pinfo.cc (winpids::release): Fix typo.Christopher Faylor
2005-12-22* pinfo.cc (pinfo::init): Clarify comment slightly.Christopher Faylor
(_onreturn): New helper class. (winpids:add): Remove copied stuff. Try to put process handle into pinfo in question and use _onreturn class to control when to close it. (winpids::release): Remove use of copied array. Free procinfo when hProc is NULL. Otherwise call release and call CloseHandle on hProc. * pinfo.h (winpids::copied): Remove throughout class.
2005-12-21* pinfo.cc (pinfo::init): Remove spurious low_priority_sleep.Christopher Faylor
2005-12-13* pinfo.cc (winpids::add): Don't copy procinfo when there is no cygwin processChristopher Faylor
associated with the pid, i.e., procinfo == NULL.
2005-12-12* pinfo.cc (size_copied): New convenience macro.Christopher Faylor
(winpids::add): Alias the element that we are working on for slightly better clarity. Honor the "make_copy" flag. (winpids::release): Free and zero procinfo field if it was allocated via malloc. (winpids::~winpids): Free copied array. * pinfo.h (class pinfo): Make winpids class a friend. (winpids::make_copy): New field. (winpids::copied): New array. (winpids::reset): Reset npids after releasing pinfos or suffer a memory leak. (winpids::winpids): Try harder to allocate all fields in the class.
2005-11-24* fhandler_tty.cc (fhandler_tty_slave::open): Reset the current windows stationChristopher Faylor
whenever ctty == -1 regardles of whetehr there's a windows station already assigned. Close the old windows station in this situation. * pinfo.cc (_pinfo::set_ctty): Reinstate incrementing of console count when recording ctty so that the current tty is always around.
2005-11-17* fork.cc (fork): Move top-of-stack calculation later.Christopher Faylor
* pinfo.cc (_pinfo::set_ctty): Use __ctty to print current console in debugging output.
2005-11-14* fhandler.h (fhandler_console::fixup_after_fork_exec): Declare new function.Christopher Faylor
(fhandler_console::fixup_after_fork): Use fixup_after_fork_exec. (fhandler_console::fixup_after_exec): Ditto. * fhandler_console.cc (fhandler_console::fixup_after_fork): Delete definition. (fhandler_console::fixup_after_fork_exec): Rename from fixup_after_exec. * pinfo.cc (_pinfo::set_ctty): Don't play with console count here. * syscalls.cc (close_all_files): Don't close cygheap ctty if hExeced since the child will be copying information from us. (setsid): Use myctty() rather than raw ctty #.
2005-11-14* cygheap.h (init_cygheap::manage_console_count): Declare new function.Christopher Faylor
(init_cygheap::console_count): Renamed from open_fhs. Make private. * cygheap.cc (init_cygheap::manage_console_count): Define new function. * dtable.cc (dtable::fixup_after_exec): Always call fixup_after_exec on elements of fd even when they are about to be closed. * fhandler.h (report_tty_counts): Remove open_fhs from debugging output. * fhandler_console.cc (fhandler_console::open): Use manage_console_count rather than manipulating count directly. (fhandler_console::close): Ditto. (fhandler_console::fixup_after_fork): Ditto. (fhandler_console::fixup_after_exec): Ditto. Don't close handles if close_on_exec. * fhandler_tty.cc (fhandler_tty_slave::open): Use manage_console_count() rather than manipulating count directly. Reflect change in arguments to report_tty_counts(). (fhandler_tty_slave::close): Ditto for both. (fhandler_tty_slave::dup): Ditto for both. (fhandler_tty_slave::ioctl): Use myctty() rather than raw ctty #. (fhandler_tty_slave::fixup_after_fork): Reflect change in arguments to report_tty_counts(). (fhandler_tty_master::init_console): Use manage_console_count() rather than manipulating count directly. * fhandler_clipboard.cc (fhandler_dev_clipboard::fixup_after_exec): Don't perform any operations if close_on_exec. * fhandler_dsp.cc (fhandler_dev_dsp::fixup_after_exec): Ditto. * fhandler_raw.cc (fhandler_dev_raw::fixup_after_exec): Ditto. * fhandler_serial.cc (fhandler_serial::fixup_after_exec): Ditto. * pinfo.h (_pinfo::_ctty): Declare new function. (myctty): Declare new macro. (__ctty): Declare new macro. * pinfo.cc (_pinfo::_ctty): Define new function. (_pinfo::set_ctty): Use manage_console_count() rather than manipulating count directly. * signal.cc (kill_pgrp): Use myctty() and __ctty() macros rather than raw ctty #. * syscalls.cc (setsid): Ditto. Use manage_console_count() rather than manipulating count directly.
2005-10-24* pinfo.cc (_pinfo::fds): Lock fdtab while enumerating.Christopher Faylor
2005-10-19* pinfo.cc (_pinfo::dup_proc_pipe): Make warning more severe by actuallyChristopher Faylor
printing it. (_pinfo::alert_parent): Fix comment. Don't send to parent if we are in an exec stub.
2005-10-18Change process_lock to lock_process throughout. Change all calls to newChristopher Faylor
cygthread to handle extra argument, throughout. * cygthread.h (cygthread::callproc): Declare new method. (cygthread::cygthread): Add optional length argument to allow copying arguments to executing thread. * cygthread.cc (cygthread::callproc): Define new method. (cygthread::stub): Use callfunc to invoke thread func to allow potentially allocating stack memory which will be returned. (cygthread::simplestub): Ditto. (cygthread::cygthread): Accept arglen argument. Reset ev here prior to activating thread. Wait for ev after activating thread if we're copying contents to the thread. Wait until the end before setting h, to allow thread synchronization. (cygthread::release): Don't reset ev here. Rely on that happening the next time the thread is activated. * pinfo.h (commune_process): Rename declaration from _pinfo::commune_process. * pinfo.cc (commune_process): Ditto for definition. Modify slightly to allow running as a separate cygthread. * sigproc.cc (child_info::sync): Always wait for both subproc_ready and any hProcess if we have a cygwin parent. (talktome): Change argument to be a pointer to siginfo_t. Contiguously allocate whole siginfo_t structure + any needed extra for eventual passing to commune_process thread. (wait_sig): Accommodate change in talktome argument. * pipe.cc (fhandler_pipe::fixup_after_exec): Remove debugging.
2005-10-03* cygheap.h (class process_lock): New class.Christopher Faylor
* dtable.h (class dtable): Add class process_lock as a friend. * dcrt0.cc (get_exit_lock): Delete. (do_exit): Use process_lock class instead of get_exit_lock. * exceptions.cc (signal_exit): Ditto. * pinfo.cc (pinfo::exit): Ditto. (_pinfo::commune_process): Set process lock around this whole function. (_pinfo::commune_request): Use process_lock rather than myself.lock. * pinfo.h (pinfo::_lock): Delete. (pinfo::initialize_lock): Delete. (pinfo::lock): Delete. (pinfo::unlock): Delete. * winsup.h (get_exit_lock): Delete declaration.
2005-10-02* dcrt0.cc (get_exit_lock): Use myself.lock rather than exit_lock.Christopher Faylor
* exceptions.cc (exit_lock): Delete. (events_init): Don't init exit_lock. * (_pinfo::commune_process): Add per-PICOM debugging. * sigproc.cc (talktome): Add some temporary debugging statements. * fhandler_proc.cc (format_proc_cpuinfo): Cosmetic change. (format_proc_partitions): Ditto. * syscalls.cc (locked_append): Ditto.
2005-10-01* dcrt0.cc (do_exit): Don't set ES_SET_MUTO here. Call get_exit_lock()Christopher Faylor
instead. (get_exit_lock): New function. Grabs the lock and sets initial exit_state. * exceptions.cc (try_to_debug): Use low_priority_sleep. (sigpacket::process): Avoid handler if this is an exec stub. (signal_exit): Use get_exit_lock rather than manipulating the exit_lock critical section directly. * pinfo.cc (pinfo::exit): Ditto. * winsup.h (get_exit_lock): Declare. (exit_lock): Delete declaration.
2005-09-29Change name from commune_recv to commune_process throughout. Change name fromChristopher Faylor
commune_send to commune_request throughout. * pinfo.h (PICOM_EXTRASTR): New flag. (PICOM_FIFO): Define with new flag. (_pinfo::hello_pid): Delete. (_pinfo::tothem): Delete. (_pinfo::fromthem): Delete. (_pinfo::commune_process): Rename from commune_recv. Add a siginfo_t argument to declaration. (_pinfo::commune_request): Rename from commune_send. Change DWORD to __uint32_t in declaration. * pinfo.cc (_pinfo::commune_process): Rename from commune_recv. Add siginfo_t argument. Use information from argument rather than reading from another pipe. Synchronize with other process's commune event. (_pinfo::commune_request): Rename from commune_send. Change DWORD to __uint32 in argument. Fill out information in new siginfo_t element and rely on extended operation of sig_send rather than trying to deal with synchronization issues here. Use process handle and read pipe information filled out by sig_send to gather information from the other process. * sigproc.cc (sig_send): Take special action if "communing" to ensure synchronization with the other process and to return information about the other process to the caller. (talktome): Accept a siginfo_t and handle arguments. Read additional information from the signal pipe when _si_commune._si_code has the PICOM_EXTRASTR flag set. (wait_sig): Pass the transmitted siginfo_t struct and the pipe handle to talktome. Close pipe read handle as soon as possible after we detect that we're exiting.
2005-09-28 Revert erroneous checkin.Corinna Vinschen