summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/exceptions.cc
Commit message (Collapse)AuthorAgeFilesLines
* Change check_null_empty_path* to check_null_empty_str* throughout.Christopher Faylor2001-06-281-1/+1
| | | | | | | | | | | | | | | * path.cc (path_conv::check): Add signal protection here since retrieving info about remote shares can take some time. * path.h (check_null_empty_str_errno): Convert to a function prototype. * path.cc (check_null_empty_str): Move to miscfuncs.cc. * miscfuncs.cc (check_null_empty_str_errno): New function. (__check_null_invalid_struct): Ditto. (__check_null_invalid_struct_errno): Ditto. (check_null_empty_str): Change from VirtualQuery to IsBadWritePtr. * thread.cc (check_valid_pointer): Ditto. * resource.cc (getrlimit): Use check_null_invalid_struct macro for checking validity of pointer. (setrlimit): Ditto.
* * exceptions.cc (interrupt_setup): Move actions from setup_handler to here.Christopher Faylor2001-06-241-69/+61
| | | | | | | | | (setup_handler): Move actions after a successful interrupt to interrupt_setup. * fork.cc (vfork): Augment debugging output. * sigproc.cc (proc_subproc): Ditto. * spawn.cc (spawn_guts): Ditto. Correctly fill out progname when spawn NO_WAIT. Call signal handler when a signal arrives. * sigproc.h: Declare a function.
* * exceptions.cc (sig_handle_tty_stop): Reset PID_STOPPED if not actuallyChristopher Faylor2001-06-161-1/+4
| | | | | | | | | | stopping. * fhandler_console.cc (fhandler_console::fixup_after_fork): Don't set controlling terminal if just inheriting a handle. (fhandler_console::fixup_after_exec): Ditto. * fhandler_tty.cc (fhandler_tty_slave::init): Ditto. * signal.cc (kill_worker): Set appropriate errno if proc_exists determines that process does not really exist.
* * exceptions.cc (sigdelayed): Ensure that signal is cleared as the lastChristopher Faylor2001-06-101-1/+1
| | | | | operation or suffer races. * sigproc.cc (proc_subproc): Deal with zombie array overflow.
* * exceptions.cc (handle_exceptions): Bump repeat count for debugging kick out.Christopher Faylor2001-05-241-1/+1
| | | | | | | | | | * fhandler.h (fhandler_dev_dsp): Add a fixup_after_exec. * fhandler_dsp.cc (class Audio): Add TOT_BLOCK_SIZE to enum. (operator new): New. (bigwavebuffer): Declare using TOT_BLOCK_SIZE to avoid buffer overruns. (Audio::Audio): Optimize slightly. (fhandler_dev_dsp::open): Allocate s_audio using static buffer. (fhandler_dev_dsp::fixup_after_exec): New function. Ditto.
* * exceptions.cc (handle_exceptions): Don't print message when executing from aChristopher Faylor2001-05-111-2/+2
| | | | cygwin program.
* * cygheap.cc (_cfree): Add regparm attribute.Christopher Faylor2001-05-081-2/+3
| | | | | | | | | | | | | | | | (_crealloc): Ditto. * dcrt0.cc (dll_crt0_1): Default to always checking for executable for now. * dtable.cc (dtable::not_open): Move method. * dtable.h (dtable): Here. * exceptions.cc (ctrl_c_handler): Don't expect process group leader to handle a signal if it doesn't exist. * fhandler.h (fhandler_base): Make openflags protected. * localtime.c (tzsetwall): Check for __CYGWIN__ as well as __WIN32__. * path.cc (path_conv::check): Add some comments. Change strcat to assignment. * lib/_cygwin_S_IEXEC.cc (_cygwin_bob__): Eliminate. * fhandler_tty.cc (fhandler_console::dup): Set controlling terminal if necessary. * fhandler_tty.cc (fhandler_tty_slave::dup): Ditto.
* * exceptions.cc (handle_exceptions): Vastly increase test for exception loopChristopher Faylor2001-05-051-2/+5
| | | | guard variable.
* * exceptions.cc (stack_info): Add some controls.Christopher Faylor2001-05-051-19/+28
| | | | | | | | | | | | | (stack_info::init): Add extra arguments to control method of initialization.. If we have a known good frame, set things up so that this frame is not skipped the first time through. Record whether caller cares about arguments or not. (stack_info::walk): Don't store arguments if they're unwanted. (stackdump): Add isexception parameter for use when called by exception handler. (cygwin_stackdump): Accomodate extra argument to stackdump. (handle_exceptions): Ditto. (sig_handle): Ditto. (interrupt_on_return): Accomodate extra arguments to stack walk initialization.
* Revert much of previous erroneous checkin. Add ChangeLog entry.Christopher Faylor2001-05-041-3/+3
| | | | | | | | | | | * pinfo.h: Correctly set __SIGOFFSET. * path.cc (hash_path_name): Avoid calling library functions for simple copying of characters. * shortcut.c: Use WIN32_LEAN_AND_MEAN. * smallprint.c: Ditto. * environ.cc (getwinenv): Minor clarity fix. * localtime.c: No need to include windows.h * string.h: New file.
* * exceptions.cc (ctrl_c_handler): Always send signal to process if it has noChristopher Faylor2001-05-041-5/+5
| | | | tty.
* * exceptions.cc (handle_exceptions): Break out of "loop" if the debuggerChristopher Faylor2001-05-031-1/+1
| | | | doesn't seem to be attaching to our process.
* * exceptions.cc (INIT_EXCEPTION_HANDLER): Eliminate.Christopher Faylor2001-04-301-93/+77
| | | | | | | | | | | | | | | | | | | | (init_exceptions): Just use init_exception_handler. (open_stackdumpfile): New function. (stack_info::first_time): Eliminate. (stack_info::init): Set up fields to avoid "first_time" consideration. (stack_info::walk): Remove "first_time" consideration. (stackdump): Change arguments to accept initial frame pointer and open stack file flag. (stack): Eliminate. (cygwin_stackdump): Use stackdump() rather than stack(). (try_to_debug): Remove all synchronization logic. Just keep looping in exception handler until debugger notices us. Return 1 if successfully started debugger. (handle_exceptions): Just return if we know that we're debugging. Reorganize to avoid creating a stackdump file if we are starting a debugger. Return from exception handler if debugger started successfully. (sig_handle): Create a stackdump only if debugger wasn't started. * winsup.h (try_to_debug): Add an argument.
* Throughout, change 'tty_attached' to 'real_tty_attached', for clarity.Christopher Faylor2001-04-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Throughout, change 'OutputStopped' to 'output_stopped', for consistency. * dtable.cc (stdio_init): Set controlling tty if not set by stdio opens. * exceptions.cc (ctrl_c_handler): Avoid special pgid checking if no tty is associated with the process. (Suggested by Tim Baker <dbaker@direct.ca>) * external.cc (fillout_pinfo): Return actual tty number for ctty. * fhandler_console.cc (get_tty_stuff): Set ctty when shared memory is allocated. Accept flags input from open(). (set_console_ctty): New function. (fhandler_console::open): Pass flags to get_tty_stuff and rely on this function to set the ctty, if appropriate. * fhandler_termios.cc (fhandler_termios::set_ctty): Move to tty_min class. * fhandler_tty.cc (fhandler_tty_slave::open): Use tc field to access set_ctty(). * tty.h (TTY_CONSOLE): Move to include/sys/cygwin.h. (tty_min): Add set_ctty class here. * include/sys/cygwin.h (TTY_CONSOLE): New home here. * path.cc (symlink_info): Make contents an actual buffer. Pass more flags to case_check. (path_conv::check): Reorganize to do parsing based on posix path rather than native path. (symlink_info::check): Expect posix path as input. Translate to native path here. Accept path_conv flags. Stop parsing if not a symlink regardless of whether previous path was a symlink.
* * thread.cc (thread_init_wrapper): Use _REENT_INIT to initialize the reentChristopher Faylor2001-04-271-1/+1
| | | | | | | structure of newlib. * sigproc.h (sig_send): Add exception parameter to sig_send. * sigproc.cc (sig_send): Ditto. Use it when setting frame info. * exceptions.cc (handle_exceptions): Use exception flag when calling sig_send.
* * sigproc.h [sigthread]: Add exception field.Christopher Faylor2001-04-251-1/+1
| | | | | | | [sigframe::~sigframe]: Clear exception field. [sigframe::set]: Set exception field from caller. * sigproc.cc (sig_send): Set exception field when frame pointer is passed in. * exceptions.cc (interrupt_on_return): Always treat exception as interruptible.
* * Makefile.in: Put -lgcc last in list of libraries, since stdc++ library needsChristopher Faylor2001-04-091-0/+4
| | | | | | | | | | | | | | it. * cygwin.din: Remove obsolete "__empty" export. * exceptions.cc (call_signal_handler_now): Force inclusion of function even when -finline-functions is specified. * sigproc.h: Remove obsolete call_signal_handler declaration. * fhandler_console.cc (cp_get_internal): New function. (cp_convert): New function. (con_to_str): New function. (str_to_con): New function. (fhandler_console::read): Replace OemToCharBuff with con_to_str. (fhandler_console::write_normal): Replace CharToOemBuff with str_to_con.
* * exceptions.cc (sigframe::call_signal_handler): Return value ofChristopher Faylor2001-04-021-12/+10
| | | | | | call_signal_handler_now. * sigproc.h (sigframe): Use constructor. * syscalls.cc (_read): Correct errno test prior to calling signal handler.
* * exceptions.cc (sigframe::call_signal_handler): Move out side of "C" block orChristopher Faylor2001-04-011-7/+11
| | | | some compilers will complain.
* * exceptions.cc (call_signal_handler_now): Rename from call_signal_handler toChristopher Faylor2001-04-011-10/+10
| | | | avoid C++ confusion.
* * sigproc.h (class sigframe): Implement 'unregister()' method.Christopher Faylor2001-04-011-2/+9
| | | | | | | | | | | | | (sigframe::~sigframe): Use unregister method. (sigframe::call_signal_handler): Declare new method. * exceptions.cc (sigframe::call_signal_handler): New method. Unregisters current sigframe before calling signal handler. (setup_handler): Clear waiting threads prior to arming signal_arrived. * syscalls.cc (_read): Change goto to loop. Recalculate sigframe inside of loop so that constructor is called when appropriate. * wait.cc (wait4): Ditto. * signal.cc: Change "sig" to "signal" in debugging messages throughout. * sigproc.cc: Ditto.
* * dtable.cc: Guard against new winsock.h/winsock2.h warnings when mixingChristopher Faylor2001-03-201-1/+0
| | | | | | | | winsock*.h and sys/types.h. * fhandler_socket.cc: Ditto. * net.cc: Ditto. * select.cc: Ditto. * exceptions.cc: Remove unneeded define.
* * exceptions.cc (interruptible): Update debugging output.Christopher Faylor2001-03-191-4/+4
| | | | | | (setup_handler): Ensure that wait_sig loop wakes up when we punt on sending a signal. * poll.cc (poll): Add signal guard here.
* * autoload.cc (noload): Use proper method for multiline strings or newer gcc'sChristopher Faylor2001-03-111-63/+63
| | | | | | | | complain. * exceptions.cc (unused_sig_wrapper): Ditto. * fhandler.h (fhandler_base): Make get_io_handle and friends return self. * fhandler_tty.cc (fhandler_pty_common::close_on_exec): Accomodate DEBUGGING flag to avoid spurious warnings when inheritance is set.
* * shortcut.c (PATH_ALL_EXEC): Add parentheses to avoid a compiler warning.Christopher Faylor2001-03-101-2/+2
| | | | | | | | | | | | * exceptions.cc (setup_handler): Clarify debugging message. * sigproc.cc (proc_subproc): Remove PROC_CHILDSTOPPED test. It is handled by normal PROC_CLEARWAIT case. (wait_sig): Eliminate "dispatched" tracking. Remove __SIGCHILDSTOPPED test. Decrement counter again before jumping out of InterlockedDecrement loop so that subsequent InterlockedIncrement will keep the counter at the correctly decremented value and also detect when there are pending signals. * sigproc.h: Remove __SIGCHILDSTOPPED element. (procstuff): Remove PROC_CHILDSTOPPED element.
* * sigproc.h (sigthread): Declare new methods. Create new winapi_lock field.Christopher Faylor2001-03-071-0/+25
| | | | | | | | | | | (sigframe:;set): Call get_winapi_lock after frame is set so that signal handler thread knows not to call SuspendThread. (sigframe::~sigframe): Release winapi_lock. * exceptions.cc (sigthread::get_winapi_lock): New method. (sigthread::release_winapi_lock): New method. (setup_handler): Use get_winapi_lock to ensure that signalled thread is not blocked in a Windows API. * path.h (path_types): Avoid broken GCC warning.
* * exceptions.cc (sig_handle_tty_stop): Ignore attempts to suspend a process ifChristopher Faylor2001-03-021-0/+4
| | | | started by non-cygwin parent.
* Throughout, change 'cygwin_shared.mount' to 'mount_table'.Christopher Faylor2001-01-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * child_info.h (child_info): Move shared_h, console_h to cygheap. Add mount_h. * cygheap.h (init_cygheap): Add shared_h, console_h. * cygheap.cc (init_cheap): Initialize heap at a fixed location after the shared memory regions. Initialize cygheap->user name here. * dcrt0.cc (dll_crt0_1): Call getpagesize () to initialize constants. Remove cygheap_init since it is done in shared_init now. (_dll_crt0): Initialize mount_h, remove shared_h and console_h initialization. * fhandler_console.cc (console_shared_h): Eliminate. (get_tty_stuff): Use cygheap->console_h rather than console_shared_h. * heap.cc (heap_init): Use page size constant calculated earlier in initialization. * shared.cc: Eliminate cygwin_shared_h. Add cygwin_mount_h. (mount_table_init): New function for initializing a user mount table. (open_shared_file_map): Use constant for shared memory region. Initialize cygheap and mount table here. (open_shared): Improve debugging output. (shared_info::initialize): Eliminate call to mount.init. (shared_terminate): Use cygheap->shared_h. Close cygwin_mount_h. (open_shared_file_map): Eliminate. * shared_info.h (mount_info): Add a version field. (shared_align_past): New macro for calculating location for shared memory regions. * sigproc.cc (init_child_info): Eliminate shared_h, console_h. * spawn.cc (spawn_guts): Pass on cygwin_mount_h iff not a different user. * syscalls.cc (system_info): New global holding system memory defaults. (getpagesize): Use system_info. * uinfo.cc (internal_getlogin): Only fill in user name if nonexistent. * winsup.h: Declare system_info. * passwd.cc (read_etc_passwd): Use cygheap->user.name () rather than retrieving the name again.
* Fix typos. Add some comments.Christopher Faylor2001-01-271-4/+6
|
* * exceptions.cc (sigreturn): Call any pending signals prior to resetting theChristopher Faylor2001-01-271-9/+20
| | | | | | signal mask so that stacked signals behave correctly. (sigdelayed): Avoid a race where a signal could end up calling an incorrect signal handler if two signals come in close together.
* * autoload.cc (LoadDLLinitfunc): Remove debugging statement.Christopher Faylor2001-01-171-24/+30
| | | | | | | | | | | | | | | | | | * exceptions.cc (sig_handle_tty_stop): Move setting of PID_STOPPED to earlier in interrupt. ((interrupt_setup): i.e., here. (sig_handle): Don't queue multiple SIGSTOPS. * fhandler.h (bg_check_types): Enumerate return value of bg_check for clarity. * signal.cc (kill_pgrp): Minor cleanup. * fhandler_termios.cc (fhandler_termios::bg_check): Use enumerated type for function return. Don't raise signal if a signal is already queued. * fhandler_console.cc (fhandler_console::read): Use enumerated return type for bg_check. * select.cc: Ditto, throughout. * read.cc: Ditto, throughout. * termios.cc: Ditto, throughout. (_read): YA interrupt detect simplification. * wait.cc (wait4): Ditto.
* * debug.h: Add regparm attributes to some functions.Christopher Faylor2001-01-121-0/+14
| | | | | | | | | | | | * signal.cc (sigaction): Don't treat SIGCONT specially. * exceptions.cc (interrupt_setup): Save sa_flags of interrupted signal for later use. (sig_handler): Default any stopping signal to SIGSTOP. (call_signal_handler): New function. (sigdelayed0): New function. * sigproc.cc (sigproc_init): Initialize SIGSTOP sigaction for special behavior. * sigproc.h: Define call_signal_handler. * syscalls.cc (_read): Allow restartable signal behavior.
* * pinfo.cc (codepage_init): Move function.Christopher Faylor2001-01-081-2/+2
| | | | | | | | | * environ.cc (codepage_init): To here. * exceptoins.cc (SIG_NONMASKABLE): Remove SIGCONT from consideration since it is supposed to be maskable. * signal.cc (sigaction): Ditto. * sigproc.cc (wait_sig): Ditto. * winsup.h: Eliminate global declaration of codepage_init.
* * cygwin.din: Add symbols for `getrlimit' and `setrlimit'.Corinna Vinschen2000-12-271-0/+5
| | | | | | | | | | | | * exceptions.cc (stackdump): Avoid creating stackdump when `rlim_core' is 0. * resource.cc: New global variable `rlim_core'. (getrlimit): New function. (setrlimit): Ditto. include/cygwin/version.h: Bump minor API version to 32 due to adding `getrlimit' and `setrlimit'. include/sys/resource.h: Add defines, types and prototypes for `getrlimit' and `setrlimit'.
* * autoload.h: Make DLL initializers global to avoid inlining.Christopher Faylor2000-12-261-10/+17
| | | | | | | | * exceptions.cc (interrupt_setup): Reorganize arguments to allow use of regparm. (interrupt_now): Ditto. (interrupt_on_return): Ditto. (call_handler): Ditto.
* * exceptions.cc (reset_signal_arrived): Make global to avoid inlining.Christopher Faylor2000-12-201-2/+1
|
* * fhandler_serial.cc (fhandler_serial::raw_read): Always find number of bytesChristopher Faylor2000-12-201-2/+2
| | | | ready to be read whether overlapped_armed or not.
* * sigproc.cc (wait_sig): Remove unneeded for loop iteration.Christopher Faylor2000-11-161-19/+14
| | | | | | | | | | | * exceptions.cc (interrupt_setup): Don't set signal mask here or races occur with main thread. Set it in sigdelayed instead. (sigreturn): Reflect change in stack order of ebp and flags. (sigdelayed): Set stack frame correctly. Call set_process_mask here with flags for last trapped signal. (signal_dispatch): Add newmask. * sigproc.cc (wait_sig): Eliminate ill-considered attempt to halt looping signal processors.
* Throughout use myself->ppid_handle rather than parent_alive.Christopher Faylor2000-11-151-2/+2
| | | | | | | | | | | | | | | | * child_info.h (child_info): Eliminate parent_alive. * dcrt0.cc (dll_crt0_1): Call fork_init for debugging pid creation. * fork.cc (fork_child): Reflect change to fixup_mmaps_after_fork arguments. (slow_pid_reuse): New function to grab last 'n' pids to prevent pid reuse. (fork_parent): Move last_fork_proc into slow_pid_reuse. Handle fork_pids debugging. Eliminate unnecessary call to set_child_mmap_ptr. (fork_init): New debugging function. * mmap.cc (fixup_mmaps_after_fork): Renamed from recreate_mmaps_after_fork. Rely on copied data after a fork. (set_child_mmap_ptr): Eliminate. * pinfo.h (_pinfo): Eliminate parent_alive, mmap_ptr and reflect above changes. * spawn.cc (spawn_guts): Eliminate vestiges of "old way" of sending new hProc to parent process.
* * path.cc (get_device_number): Allow /dev/ttySn to designate a com port.Christopher Faylor2000-11-131-2/+2
|
* * dcrt0.cc (sigthread::init): Reinstitute sigthread lock as a critical section.Christopher Faylor2000-11-061-70/+49
| | | | | | | | | | | | (dll_crt0_1): Move sigthread lock initialization to earlier in startup. * exceptions.cc (interrupt_on_return): Remove previous kludgy attempt to detect an invalid frame. (call_handler): Eliminate inner for loop. Grab signal critical section lock where appropriate. * sigproc.cc (proc_subproc): Restore uid setting. * sigproc.h (sigthread): Reinstitute sigthread lock as a critical section. (sigframe): Grab the sigthread lock before clearing frame to avoid having the signal thread use an invalid frame.
* * child_info.h (child_info): Add pppid_handle for closing the parent's of theChristopher Faylor2000-11-061-84/+101
| | | | | | | | | | | | | | | | | | | | | | | parent handle. * dcrt0.cc (_dll_crt0): Close parent's parent handle when spawned or forked. * debug.cc (add_handle): Correct erroneous reference to handle structure when printing warning. * exceptions.cc (interrupt_now): Always return 1. (interrupt_on_return): Accept a sigthread argument. Check to see if this argument has been trashed prior to setting up the stack return. (call_handler): Add a loop around attempts to dispatch signals to detect case where interrupt_on_return fails. (_sigdelayed): Set up a temporary frame pointer prior to calling stuff that could trigger an interrupt or the stack walking code will be very confused. * fork.cc (fork_parent): Move a lot of the setup of the child process into proc_subproc. * spawn.cc (spawn_guts): Ditto. Use ppid_handle to contact logical parent when reparenting. * pinfo.h (_pinfo): Remember the logical handle of the parent process. * sigproc.cc (proc_subproc): Record most stuff necessary for the _pinfo structure that is inferrable from myself when adding children. (wait_sig): Always set 'pending_signals' flag when about to kick off the signal scanning loop. Reset it only if there are no pending signals.
* * exceptions.cc (handle_sigsuspend): Record frame here for signalling.Christopher Faylor2000-11-051-0/+2
| | | | (set_process_mask): Ditto.
* * exceptions.cc (interruptible): Remove obsolete tests.Christopher Faylor2000-11-021-34/+32
| | | | | | (sigreturn): Construct pseudo-frame-pointer so that signal handler can figure out where to put return address when signals are coming in quickly. * path.cc (cwdstuff::get): Allow length 0 buffer length when buffer when NULL.
* * exceptions.cc (sig_handle): Just make sure that wait_sig loops when receivingChristopher Faylor2000-10-251-1/+1
| | | | a SIGCONT. Don't block waiting for completion that will never occur.
* * exceptions.cc (signal_exit): Kill any executing child process if we're dying.Christopher Faylor2000-10-241-0/+5
| | | | | | | | | | * path.h: Remove unneeded extern. * spawn.cc (std_suffixes): Make static. Don't set dwProcessId here since it makes the process unsignalable. Set strace flag that this is an execed process stub. * strace.cc (strace::vsprntf): Use strace flag to indicate when to visually flag that this is an exec stub. * include/sys/strace.h (strace): Add 'execing' flag.
* * dcrt0.cc (sigthread::init): Correct overzealous ifdef.Christopher Faylor2000-10-191-0/+10
| | | | | | * exceptions.cc (call_handler): Avoid calling sigthread acquire lock. * sigproc.h (sigthread): Comment out lock for now. * sync.cc (muto::acquire): Add a minor optimization.
* * exceptions.cc (call_handler): Make signal pending if sigsave.sig is stillChristopher Faylor2000-10-181-1/+4
| | | | | | | | | | active. * syscalls.cc (_read): Don't clear errno. * sigproc.cc (wait_sig): Don't scan the waiting process list after a SIGCHLD if there are no zombies to reap. * winsup.h: Use __builtin_strcmp. * environ.cc (posify): Don't initialize len unless it is required (from DJ Delorie <dj@redhat.com>).
* * Makefile.in: Remove some obsolete stuff.Christopher Faylor2000-10-161-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dcrt0.cc (dll_crt0_1): Call signal_fixup_after_exec where appropriate. Set myself->uid from parent version. Just use ThreadItem Init method. Close or store hexec_proc as appropriate. (_dll_crt0): Store user_data->forkee here so that proper tests can be made subsequently. (do_exit): Remove hExeced stuff. * environ.cc (environ_init): Accept environ count as well as environ pointer. * environ.h: Reflect above change. * pinfo.cc (pinfo_init): Ditto. Accept environ count. (fixup_in_spawned_child): Remove. * spawn.cc (spawn_guts): Move signal code to dll_crt0_1. Don't suspend execing process since it is no longer necessary. Store envc. * exceptions.cc (signal_fixup_after_exec): New function. (call_handler): Remove hExeced test. * child_info.h (cygheap_exec_info): Store envc as well as envp. (child_info_spawn): Store hexec_proc so that it can be closed in child. * path.cc (normalize_posix_path): Avoid intermediate use of temporary cwd buf. (normalize_win32_path): Ditto. (cwdstuff::get_initial): Always set lock. * sigproc.h: Remove hExeced. * strace.cc (strace::vsprntf): Modify to accomodate for lack of hExeced. * thread.cc (MTinterface::Init): Merge Init1 and ClearReent into this method. (MTinterface::Init1): Eliminate. (MTinterface::ClearReent): Eliminate. * thread.h: Reflect above changes. * include/sys/strace.h (strace): Make microseconds() public. Make various functions 'regparm', throughout. * pinfo.h (_pinfo): Inline simple signal manipulation functions. Requires inclusion of thread.h which was removed from .cc files, where appropriate. throughout. * pinfo.cc: Eliminate signal manipulation functions. (_pinfo::exit): Calculate total rusage for exiting process here. * cygheap.cc (size2bucket): Eliminate. (init_buckets): Ditto. (_cmalloc): Calculate size and bits in a loop rather than going through a function call. (_crealloc): Use stored array index to calculate allocated size. * spawn.cc (spawn_guts): Use _pinfo exit method to exit, calculating cpu usage.
* * exceptions.cc (set_console_handler): Don't allocateChristopher Faylor2000-10-151-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | console_handler_thread_waiter. It is obsolete. (ctrl_c_handler): Don't use console_handler_thread_waiter. * path.cc (hash_path_name): Fix handling of relative names. Make case insensitive. * path.h (suffix_info): Use initializers. * pinfo.h (_pinfo): Avoid initializers for null case. * resource.cc (fill_rusage): Zero rest of rusage structure. * security.cc (set_process_privileges): Don't reopen parent process. Just use hMainProc. * signal.cc (signal): Track when a signal handler has been used. (sigaction): Ditto. * sigproc.cc (pchildren): Use default initializer. (zombies): Ditto. (sigproc_terminate): Avoid closing handles that will be closed on exit anyway. (wait_sig): Send signal to "parent" on EXECing, not FORKing. (wait_subproc): Send SIGCHLD here rather than in proc_wait to avoid potential muto conflicts. * sigproc.h (sigthread): Don't initialize to zero. It's the default. * spawn.cc (spawn_guts): Fill in resources from exec parent prior to termination. * sync.h (muto): Don't initialize to zero. * syscalls.cc (close_all_files): Use one lock around entire loop and call fhandler close/release stuff directly. (_read): Don't use ready_for_read if there are not signal handlers active. * dcrt0.cc (dll_crt0_1): Fix display of "title". (do_exit): Use pinfo exit method to exit. (__api_fatal): Ditto. * exceptions.cc (signal_exit): Ditto. * fork.cc (fork_child): Remove debugging stuff. Use pinfo_fixup_after fork in place of exec_fixup_after_fork. * pinfo.cc (pinfo_fixup_after_fork): New method. (pinfo_fixup_in_spawned_child): Ditto. (_pinfo::exit): New method. (_pinfo::init): Remove recursion. Detect pathological case where pinfo structure already exists for new pid. * pinfo.h (_pinfo): Reorganize slightly. Add new method and new function declarations. * sigproc.cc (proc_exists): Previous simplification was a little to simple. Try harder to detect if a process exists. (proc_terminate): Use PID_EXITED setting to determine if process is still around. (WFSO): Remove debugging statement. (WFMO): Ditto. * spawn.cc (exec_fixup_after_fork): Eliminate. (spawn_guts): Always set old_title to NULL. Is it really needed? Move hexec_proc to pinfo.cc. Call pinfo_fixup_in_spawned_child to eliminate handle link after a spawn. * include/sys/cygwin.h: Remove PID_NOT_IN_USE. Add PID_EXITED.