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
2001-09-22* exceptions.cc (setup_handler): Always relinquish lock after we'veChristopher Faylor
interrupted. * fhandler.cc: Move pipe methods to pipe.cc. * fhandler.h (fhandler_pipe): Add new methods. * fork.cc (sync_with_parent): Make error messages more informative. * pipe.cc (fhandler_pipe::fhandler_pipe): Move here from fhandler.cc. (fhandler_pipe::lseek): Ditto. (fhandler_pipe::set_close_on_exec): New method. (fhandler_pipe::read): Ditto. (fhandler_pipe::close): Ditto. (fhandler_pipe::dup): Ditto. (make_pipe): Create the guard mutex on the read side of the pipe. * select.cc (peek_pipe): Use guard_mutex to discover if we have the right to read on this pipe. (fhandler_pipe::readh_for_read): Pass the read pipe guard mutex to peek_pipe. * syscalls.cc (_read): Always detect signal catchers, for now. * debug.cc (makethread): Eliminate hack to make thread inheritable. * sigproc.cc (subproc_init): Don't use hack to make thread inheritable.
2001-09-12* exceptions.cc (call_signal_handler_now): Add additional guard againstChristopher Faylor
inappropriately calling signal handler. * syscalls.cc (_read): Reset errno if not exiting due to signal.
2001-09-12* sigproc.h (sigframe::unregister): Return true/false whether this frame isChristopher Faylor
capable of responding to signals. * exceptions.cc (sigframe::call_signal_handler): Don't call signal handler if it is not armed for this thread.
2001-09-06* cygheap.cc (cygheap_fixup_in_child): Don't consider a NULL bucket as aChristopher Faylor
candidate for deletion. It is actually the end of a linked list chain. * exceptions.cc (open_stackdumpfile): Default to "unknown" program name if myself->progname hasn't been filled out yet.
2001-09-05* exceptions.cc (ctrl_c_handler): Only send SIGINT when we have a controllingChristopher Faylor
terminal and we are the head of the process group.
2001-07-26* syscalls.cc (setsid): Detach process from its console if the currentChristopher Faylor
controlling tty is the console and already closed. * dtable.h (class dtable): Add members to count descriptors referring to the console. * dtable.cc (dtable::dec_console_fds): New function to detach process from its console. (dtable::release): Decrement the counter of console descriptors. (dtable::build_fhandler): Increment it. * exception.cc (ctrl_c_handler): Send SIGTERM to myself when catch CTRL_SHUTDOWN_EVENT.
2001-06-28Change check_null_empty_path* to check_null_empty_str* throughout.Christopher Faylor
* 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.
2001-06-25* exceptions.cc (interrupt_setup): Move actions from setup_handler to here.Christopher Faylor
(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.
2001-06-16* exceptions.cc (sig_handle_tty_stop): Reset PID_STOPPED if not actuallyChristopher Faylor
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.
2001-06-10* exceptions.cc (sigdelayed): Ensure that signal is cleared as the lastChristopher Faylor
operation or suffer races. * sigproc.cc (proc_subproc): Deal with zombie array overflow.
2001-05-24* exceptions.cc (handle_exceptions): Bump repeat count for debugging kick out.Christopher Faylor
* 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.
2001-05-11* exceptions.cc (handle_exceptions): Don't print message when executing from aChristopher Faylor
cygwin program.
2001-05-08* cygheap.cc (_cfree): Add regparm attribute.Christopher Faylor
(_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.
2001-05-05* exceptions.cc (handle_exceptions): Vastly increase test for exception loopChristopher Faylor
guard variable.
2001-05-05* exceptions.cc (stack_info): Add some controls.Christopher Faylor
(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.
2001-05-05Revert much of previous erroneous checkin. Add ChangeLog entry.Christopher Faylor
* 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.
2001-05-05* exceptions.cc (ctrl_c_handler): Always send signal to process if it has noChristopher Faylor
tty.
2001-05-03* exceptions.cc (handle_exceptions): Break out of "loop" if the debuggerChristopher Faylor
doesn't seem to be attaching to our process.
2001-04-30* exceptions.cc (INIT_EXCEPTION_HANDLER): Eliminate.Christopher Faylor
(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.
2001-04-29Throughout, change 'tty_attached' to 'real_tty_attached', for clarity.Christopher Faylor
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.
2001-04-27* thread.cc (thread_init_wrapper): Use _REENT_INIT to initialize the reentChristopher Faylor
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.
2001-04-25* sigproc.h [sigthread]: Add exception field.Christopher Faylor
[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.
2001-04-09* Makefile.in: Put -lgcc last in list of libraries, since stdc++ library needsChristopher Faylor
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.
2001-04-02* exceptions.cc (sigframe::call_signal_handler): Return value ofChristopher Faylor
call_signal_handler_now. * sigproc.h (sigframe): Use constructor. * syscalls.cc (_read): Correct errno test prior to calling signal handler.
2001-04-01* exceptions.cc (sigframe::call_signal_handler): Move out side of "C" block orChristopher Faylor
some compilers will complain.
2001-04-01* exceptions.cc (call_signal_handler_now): Rename from call_signal_handler toChristopher Faylor
avoid C++ confusion.
2001-04-01* sigproc.h (class sigframe): Implement 'unregister()' method.Christopher Faylor
(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.
2001-03-20* dtable.cc: Guard against new winsock.h/winsock2.h warnings when mixingChristopher Faylor
winsock*.h and sys/types.h. * fhandler_socket.cc: Ditto. * net.cc: Ditto. * select.cc: Ditto. * exceptions.cc: Remove unneeded define.
2001-03-20* exceptions.cc (interruptible): Update debugging output.Christopher Faylor
(setup_handler): Ensure that wait_sig loop wakes up when we punt on sending a signal. * poll.cc (poll): Add signal guard here.
2001-03-11* autoload.cc (noload): Use proper method for multiline strings or newer gcc'sChristopher Faylor
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.
2001-03-11* shortcut.c (PATH_ALL_EXEC): Add parentheses to avoid a compiler warning.Christopher Faylor
* 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.
2001-03-07* sigproc.h (sigthread): Declare new methods. Create new winapi_lock field.Christopher Faylor
(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.
2001-03-02* exceptions.cc (sig_handle_tty_stop): Ignore attempts to suspend a process ifChristopher Faylor
started by non-cygwin parent.
2001-01-28Throughout, change 'cygwin_shared.mount' to 'mount_table'.Christopher Faylor
* 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.
2001-01-27Fix typos. Add some comments.Christopher Faylor
2001-01-27* exceptions.cc (sigreturn): Call any pending signals prior to resetting theChristopher Faylor
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.
2001-01-17* autoload.cc (LoadDLLinitfunc): Remove debugging statement.Christopher Faylor
* 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.
2001-01-12* debug.h: Add regparm attributes to some functions.Christopher Faylor
* 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.
2001-01-08* pinfo.cc (codepage_init): Move function.Christopher Faylor
* 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.
2000-12-27 * cygwin.din: Add symbols for `getrlimit' and `setrlimit'.Corinna Vinschen
* 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'.
2000-12-26* autoload.h: Make DLL initializers global to avoid inlining.Christopher Faylor
* exceptions.cc (interrupt_setup): Reorganize arguments to allow use of regparm. (interrupt_now): Ditto. (interrupt_on_return): Ditto. (call_handler): Ditto.
2000-12-20* exceptions.cc (reset_signal_arrived): Make global to avoid inlining.Christopher Faylor
2000-12-20* fhandler_serial.cc (fhandler_serial::raw_read): Always find number of bytesChristopher Faylor
ready to be read whether overlapped_armed or not.
2000-11-16* sigproc.cc (wait_sig): Remove unneeded for loop iteration.Christopher Faylor
* 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.
2000-11-15Throughout use myself->ppid_handle rather than parent_alive.Christopher Faylor
* 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.
2000-11-13* path.cc (get_device_number): Allow /dev/ttySn to designate a com port.Christopher Faylor
2000-11-07* dcrt0.cc (sigthread::init): Reinstitute sigthread lock as a critical section.Christopher Faylor
(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.
2000-11-06* child_info.h (child_info): Add pppid_handle for closing the parent's of theChristopher Faylor
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.
2000-11-05* exceptions.cc (handle_sigsuspend): Record frame here for signalling.Christopher Faylor
(set_process_mask): Ditto.
2000-11-02* exceptions.cc (interruptible): Remove obsolete tests.Christopher Faylor
(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.