summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/exceptions.cc
Commit message (Collapse)AuthorAgeFilesLines
* * cygheap.cc (init_cheap): Temporarily remove inline that newer gcc's haveChristopher Faylor2003-05-301-3/+2
| | | | | | problems with. * path.cc (path_conv::check): Rework has_acls logic slightly. Uncouple exec tests away from filesystem tests.
* * shared_info.h: Match shared_name declaration with below change.Corinna Vinschen2003-05-211-1/+3
| | | | | | | | | | | * shared.cc (shared_name): Use incoming char * parameter instead of local static buffer. (open_shared): Accomodate new calling convention for shared_name. * exceptions.cc (events_init): Ditto. * sigproc.cc (getsem): Ditto. * syscalls.cc (login): Ditto. (logout): Ditto. (pututline): Ditto.
* * Makefile.in: Add finline-functions optimization to CXXFLAGS.Thomas Pfaff2003-04-171-3/+1
| | | | | | | | | | | | | | | | * autoload.cc (LoadDLLprime): Rename std_dll_init to _std_dll_init. (std_dll_init): Remove name mangling prototype. Add attributes used and noinline. (wsock_init): Ditto. Change wsock_init to _wsock_init in wsock32 and ws2_32 LoadDLLprime. * exceptions.cc (unused_sig_wrapper): Remove prototype. Add attributes used and noinline. * pwdgrp.h ((pwdgrp (passwd *&)): Remove inline code. (pwdgrp (__group32 *&)): Ditto. * grp.cc (pwdgrp (passwd *&)): Outline constructor. (pwdgrp (__group32 *&)): Ditto.
* * exceptions.cc (setup_handler): Make sure winapi lock is released when exitingChristopher Faylor2003-03-311-0/+1
| | | | loop.
* * sigproc.h (signal_fixup_after_exec): Eliminate argument in declaration.Christopher Faylor2003-03-201-2/+2
| | | | | | | | | * exceptions.cc (signal_fixup_after_exec): Eliminate argument in definition. Don't reset signal handlers after spawm. Just treat like fork/exec. * dcrt0.cc (dll_crt0_1): Don't pass PROC_SPAWN argument to signal_fixup_after_exec. * syscalls.cc (unlink): Don't change attributes of file if not readonly/system. Ditto for resetting of arguments.
* * exceptions.cc (try_to_debug): Don't reset priority when returning fromChristopher Faylor2003-02-141-3/+2
| | | | non-waitloop call.
* Christopher Faylor <cgf@redhat.com>Christopher Faylor2003-02-071-4/+7
| | | | | | * exceptions.cc (try_to_debug): Set priority of current thread rather than the main thread. Make busy waiting loop less busy. Restore priority when function returns.
* Eliminate most unneeded this-> pointers throughout.Christopher Faylor2003-02-041-1/+1
|
* Apply handle_sigsuspend patchThomas Pfaff2003-01-141-1/+2
|
* Split ChangeLog, create ChangeLog-2002.Corinna Vinschen2003-01-101-1/+1
| | | | Fix copyright dates.
* * dtable.h (dtable::in_vfork_cleanup): New function. True if vfork cleanupChristopher Faylor2003-01-031-1/+1
| | | | | | | needed. * dtable.cc (dtable::vfork_parent_restore): Remove assertion. * pipe.cc (fhandler_pipe::close): Don't close read_state during fork_fixup since it wasn't inherited.
* * exceptions.cc (events_init): Display name of mutex on failure.Christopher Faylor2002-12-301-2/+3
|
* * exceptions.cc (events_init): Initialize critical section to control exitingChristopher Faylor2002-12-251-0/+4
| | | | | | | via signal. (signal_exit): Enter critical section early to avoid exit races with main thread. * dcrt0.cc (do_exit): Use exit_lock critical section to avoid races.
* * cygthread.h (cygthread::stack_ptr): New element.Christopher Faylor2002-12-111-0/+1
| | | | | | | | | | | | | | | | | | | (cygthread::detach): Accept a "wait_for_signal" argument. (cygthread::terminate_thread): New function. * cygthread.cc (cygthread::stub): Set stack pointer argument. (cygthread::terminate_thread): New function. Forcibly terminate thread. (cygthread::detach): Optionally wait for signals and kill thread when signal arrives. * exceptions.cc (signal_exit): Set signal_arrived prior to exiting to wake up anything blocking on signals. * fhandler.h (fhandler_base::set_r_no_interrupt): Change to accept bool argument. (fhandler_pipe::ready_for_read): Declare. * pipe.cc (pipeargs): New structure. (read_pipe): New thread stub wrapper for normal pipe read. (fhandler_pipe::read): Modify to call reader in a cygthread, terminating on signal, as appropriate. * select.cc (fhandler_pipe::ready_for_read): Define new function.
* * exceptions.cc (handle_sigsuspend): Force pending signal delivery beforeChristopher Faylor2002-11-221-0/+1
| | | | | | | | | | | | | | | | | | waiting for signals to happen. * signal.cc (sleep): Force pending signal delivery before sleeping. (usleep): Ditto. (signal): Force pending signal delivery before manipulating signal stuff. (sigprocmask): Ditto. (kill_worker): Ditto. (abort): Ditto. (sigaction): Ditto. * syscalls.cc (readv): Force pending signal delivery before I/O. (writev): Ditto. (open): Ditto. * net.cc: Ditto, throughout. * sigproc.cc (sig_dispatch_pending): Deliver any pending signals prior to returning. * tty.cc (tty::make_pipes): Increase pipe buffer size.
* * exceptions.cc (sigthread::get_winapi_lock): Just do standard 'give upChristopher Faylor2002-11-221-54/+62
| | | | | | | | | | | | timeslice' wait. (setup_handler): Revamp YA to attempt to deliver signal multiple times on failure rather than punting to wait_sig. * miscfuncs.cc (low_priority_sleep): Accept INFINITE sleep to mean "don't reset the priority after setting it to idle". Return previous priority. * winsup.h (SLEEP_0_STAY_LOW): Define. (low_priority_sleep): Return an int. * sigproc.h: Define WAIT_SIG_PRIORITY here. * sigproc.cc: Remove WAIT_SIG_PRIORITY definition.
* * exceptions.cc (setup_handler): Add debugging output. Set thread priority toChristopher Faylor2002-11-151-2/+10
| | | | | | | | idle if pending signals to allow other threads to get into interruptible state. * miscfuncs.cc (sys_mbstowcs): Save current thread in variable to avoid an OS call. * wait.cc (wait_sig): Reset thread priority each time through loop since the priority may have been set down to deal with pending signals.
* * miscfuncs.cc (low_priority_sleep): New function. Use throughout where codeChristopher Faylor2002-11-131-3/+3
| | | | | | is supposed to be giving up time slice. * fhandler_console.cc (fhandler_console::read): Switch button 2/3 output escape sequences to be consistent with xterm.
* * child_info.h (CURR_CHILD_INFO_MAGIC): Reset.Christopher Faylor2002-10-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (child_info_fork::heaptop): Remove obsolete element. (child_info_fork::heabbase): Ditto. (child_info_fork::heapptr): Ditto. (child_info_fork::mount_table): New element. (child_info_fork::myself_addr): Ditto. * dcrt0.cc (dll_crt0_1): Set mount_table and myself_addr when forking. (initial_env): Add newline to "sleeping" message. * dll_init.cc (reserve_upto): Accommodate cygwin heap when freeing memory. Make debugging output a little more descriptive. * fork.cc (fork_parent): Save mount_table and myself_addr. * pinfo.cc (myself_addr): New variable. (set_myself): Pass PID_MYSELF flag to init. (pinfo::Init): Honor PID_MYSELF. Save address where myself shared memory resides in myself_addr, for fork. * pinfo.h (myself_addr): Declare. * shared.cc (memory_init): On fork, use previously saved address for location of mount table. * include/sys/cygwin.h (PID_MYSELF): New value. * dtable.cc (dtable::stdio_init): Don't pass access type to init_std_file_from_handle. It's always the same. (dtable::init_std_file_from_handle): Remove access type argument. Assume read/write. * dtable.h (dtable::init_std_file_from_handle): Ditto for declaration. * exceptions.cc (try_to_debug): Don't try to debug if already being debugged. * fhandler_console.cc (shared_console_info_save): New variable. (fhandler_console::get_tty_stuff): Save address of shared console stuff for fork.
* * cygthread.cc (cygthread::stub): Don't create event for long-running threads.Christopher Faylor2002-10-131-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Initialize thread_sync event here which is used to Suspend using an event rather than relying on SuspendThread/ResumeThread. (cygthread::init): Save handle to runner thread for future termination. (cygthread::cygthread): Only resume thread when it is actually suspended. Otherwise signal thread completion event. (cygthread::terminate): Forcibly terminate runner thread and any helper threads. Call DisableThreadLibrary calls if execing. * cygthread.h (cygthread::thread_sync): Declare. * dcrt0.cc (do_exit): Eliminate calls to obsolete window_terminate and shared_terminate. * exceptions.cc (events_terminate): Don't bother closing title_mutex since it is going away anyway. * pinfo.cc (_pinfo::exit): Call cygthread::terminate to ensure that threads are shut down before process exit or otherwise strange races seem to occur. * shared.cc (shared_terminate): Eliminate. * shared.h (shared_terminate): Eliminate declaration. * winsup.h (window_terminate): Eliminate declaration. * spawn.cc (spawn_guts): Call cygthread::terminate early in process if execing. Call DisableThreadLibrary calls if execing. * window.cc (Winmain): Call ExitThread to force exit. (window_terminate): Eliminate. * dcrt0.cc (do_exit): Track exit state more closely.
* * cygthread.cc (cygthread::stub): Very minor cleanup.Christopher Faylor2002-10-061-2/+1
| | | | | | | | (cygthread::stub): Report overflows in cygwin thread pool when DEBUGGING is on and special environment variable is not set. (cygthread::terminate): Set event only when event actually exists. * exceptions.cc (signal_exit): Set priority of main thread to low before setting current thread to high.
* * exceptions.cc (unused_sig_wrapper): Still need additional level ofChristopher Faylor2002-09-301-2/+3
| | | | indirection when setting errno.
* Remove \n from calls to strace class printfs throughout.Christopher Faylor2002-09-301-1/+1
|
* * exceptions.cc (unused_sig_wrapper): Accommodate newer compilers.Christopher Faylor2002-09-301-4/+9
|
* * fhandler.cc (fhandler_base::dup): Don't set handle on failure. Caller hasChristopher Faylor2002-09-221-3/+3
| | | | | | | already taken care of that. * fhandler_console.cc (fhandler_console::open): Initialize handles to NULL. (fhandler_console::close): Ditto. GNUify non-GNU formatted functions calls throughout.
* * sigproc.cc (sigCONT): Define.Christopher Faylor2002-08-181-5/+6
| | | | | | | | | * sigproc.h (sigCONT): Declare. (wait_sig): Create sigCONT event here. * exceptions.cc (sig_handle_tty_stop): Wait for sigCONT event rather than stopping thread. (sig_handle): Set sigCONT event as appropriate on SIGCONT rather than calling ResumeThread.
* * exceptions.cc (interrupt_setup): Ensure that the previous signal mask isChristopher Faylor2002-08-161-1/+2
| | | | properly saved.
* * assert.cc (__assert): Call debugger on assertion failure if debugging.Christopher Faylor2002-08-111-7/+8
| | | | | | | | | | | | | * dcrt0.cc (dll_crt0_1): Just wait for signal thread to go live rather than going through the overhead of invoking it. * fork.cc (fork_child): Ditto. * exceptions.cc (signal_fixup_after_fork): Call sigproc_init here. * sigproc.cc (proc_can_be_signalled): Assume that the signal thread is live. (sig_dispatch): Ditto. (sig_send): Ditto. (wait_for_sigthread): Renamed from "wait_for_me". Assume that wait_sig_inited has been set and that this function is only called from the main thread. * winsup.h (wait_for_sigthread): Declare new function.
* * path.cc (path_conv::check): Always set fileattr when component == 0.Christopher Faylor2002-07-241-1/+1
| | | | | | | (readlink): Use path_conv method rather than field. * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Ditto, throughout. * path.h (path_conv): Make fileattr private. * exceptions.cc (try_to_debug): Default to idle priority when looping.
* * dcrt0.cc (initial_env): Force path and CYGWIN_DEBUG contents to lower case.Christopher Faylor2002-07-151-6/+7
| | | | | * exceptions.cc (error_start_init): Use the name derived from GetModuleName rather than myself->progname.
* * dcrt0.cc (dll_crt0_1): Move debug_init call back to here. Avoid a compilerChristopher Faylor2002-07-141-1/+1
| | | | | | | | | | | | | | | warning. * shared.cc (memory_init): Remove debug_init call. * debug.h (handle_list): Change "clexec" to "inherited". * debug.cc: Remove a spurious declaration. (setclexec): Conditionalize away since it is currently unused. (add_handle): Use inherited field rather than clexec. (debug_fixup_after_fork_exec): Ditto. Move debugging output to delete_handle. (delete_handle): Add debugging output. * fhandler.cc (fhandler_base::set_inheritance): Don't bother setting inheritance in debugging table since the handle was never protected anyway. (fhandler_base::fork_fixup): Ditto. * exceptions.cc (debugger_command): Revert.
* * dcrt0.cc (dll_crt0_1): Delay closing of some handles until cygheap has beenChristopher Faylor2002-07-131-1/+1
| | | | | | | | | | set up. (break_here): New function, for debugging. (initial_env): Add program name to "Sleeping" message. Implement new "CYGWIN_DEBUG" environment variable option. * exceptions.cc (debugger_command): Add argument to dumper call. * strace.cc (strace::hello): Use winpid if cygwin pid is unavailable. (strace::vsprntf): Ditto.
* * debug.h (handle_list): Move here from debug.cc. Add "inherit" flagChristopher Faylor2002-07-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | functionality. * cygheap.cc (init_cheap): Move cygheap_max calculation to _csbrk. (_csbrk): Reorganize to not assume first allocation is <= 1 page. (cygheap_setup_for_child): Mark protected handle as inheritable. * cygheap.h (cygheap_debug): New struct. (init_cygheap): Add new structure when debugging. * dcrt0.cc (dll_crt0_1): Remove call to debug_init. Close ppid_handle here, if appropriate. Don't protect subproc_ready, since it is already protected in the parent. Call memory_init prior to ProtectHandle to ensure that cygheap is set up. Call debug_fixup_after_fork_exec when appropriate. (_dll_crt0): Don't close ppid_handle here. * debug.cc: Use cygheap debug structure rather than static elements throughout. (add_handle): Don't issue a warning if attempt to protect handle in exactly the same way from exactly the same place. Add pid info to warning output. Accept additional argument controlling whether handle is to be inherited. Add pid to stored information. (debug_fixup_after_fork_exec): Renamed from debug_fixup_after_fork. Reorganize to avoid erroneously skipping handles. (mark_closed): Add pid info to warning output. (setclexec): Rename from setclexec_pid. * fhandler.cc (fhandler_base::get_default_fmode): Minor reorg. (fhandler_base::fstat): Add debugging output. (fhandler_base::set_inheritance): Call setclexec rather than setclexec_pid. (fhandler_base::fork_fixup): Ditto. * fhandler_console.cc (get_tty_stuff): Mark protected handle as inheritable. * fhandler_tty.cc (fhandler_tty_slave::open): Ditto. * tty.cc (tty::make_pipes): Ditto. (tty::common_init): Ditto. * fork.cc (fork_parent): Ditto. (fork_child): Close protected handles with correct name. Remove debug_fixup_after_fork call. * fhandler_socket.cc (fhandler_socket::create_secret_event): Mark protected handle as inheritable/non-inheritable, as appropriate. * shared.cc (memory_init): Mark protected handle as inheritable. Call debug_init here. * sigproc.cc (wait_sig): Close protected handle with correct name. * spawn.cc (spawn_guts): Rename spr to subproc_ready and mark it as inheritable. * exceptions.cc (debugger_command): Try to run dumper.exe, if found. * syscalls.cc (fstat64): Don't follow symlinks for path_conv lookup since path is already resolved.
* * autoload.cc (LoadFuncEx): Define via new LoadFuncEx2 macro.Christopher Faylor2002-05-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (LoadFuncEx2): Adapted from LoadFuncEx. Provides control of return value for nonexistent function. (NtQueryObject): Declare. (IsDebuggerPresent): Declare via LoadFuncEx2 and always return true if not available. * debug.h (being_debugged): Just rely on IsDebuggerPresent return value. * dtable.cc (handle_to_fn): New function. (dtable::init_std_file_from_handle): Attempt to derive std handle's name via handle_to_fn. (dtable::build_fhandler_from_name): Fill in what we can in path_conv structure when given a handle and path doesn't exist. * fhandler.cc (fhandler_base::open): Don't set the file pointer here. Use pc->exists () to determine if file exists rather than calling GetFileAttributes again. * fhandler.h (fhandler_base::exec_state_isknown): New method. (fhandler_base::fstat_helper): Add extra arguments to declaration. (fhandler_base::fstat_by_handle): Declare new method. (fhandler_base::fstat_by_name): Declare new method. * fhandler_disk_file (num_entries): Make __stdcall. (fhandler_base::fstat_by_handle): Define new method. (fhandler_base::fstat_by_name): Define new method. (fhandler_base:fstat): Call fstat_by_{handle,name} as appropriate. (fhandler_disk_file::fstat_helper): Accept extra arguments for filling out stat structure. Move handle or name specific stuff to new methods above. (fhandler_disk_file::open): Use real_path->exists rather than calling GetFileAttributes again. * ntdll.h (FILE_NAME_INFORMATION): Define new structure. (OBJECT_INFORMATION_CLASS): Partially define new enum. (OBJECT_NAME_INFORMATION): Define new structure. (NtQueryInformationFile): New declaration. (NtQueryObject): New declaration. * path.cc (path_conv::fillin): Define new method. * path.h (path_conv::fillin): Declare new method. (path_conv::drive_thpe): Rename from 'get_drive_type'. (path_conv::volser): Declare new method. (path_conv::volname): Declare new method. (path_conv::root_dir): Declare new method. * syscalls.cc (fstat64): Send real path_conv to fstat as second argument.
* * debug.h (being_debugged): New macro.Christopher Faylor2002-05-271-1/+1
| | | | | | | * dtable.cc (dtable::extend): Use new macro. * exceptions.cc (try_to_debug): Ditto. * strace.cc (strace::hello): Only output debugging info when we think we're being debugged.
* * sync.h (new_muto): Just accept an argument which denotes the name of theChristopher Faylor2002-02-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | muto. Use this argument to construct static storage. * cygheap.cc (cygheap_init): Reflect above change. * exceptions.cc (events_init): Ditto. * malloc.cc (malloc_init): Ditto. * path.cc (cwdstuff::init): Ditto. * cygheap.h (cwdstuff): Change name of lock element to make it less generic. * path.cc (cwdstuff::get_hash): Ditto. (cwdstuff::get_initial): Ditto. (cwdstuff::set): Ditto. (cwdstuff::get): Ditto. * sigproc.cc (proc_subproc): Ditto. * debug.cc (lock_debug): Change to method. Use method rather than macro throughout. * tty.h (tty_min::kill_pgrp): Declare new method. * fhandler_termios.cc (tty_min::kill_pgrp): New method. (fhandler_termios::line_edit): Use new method for killing process. * dcrt0.cc (do_exit): Ditto. * dtable.cc (dtable::get_debugger_info): New method for inheriting dtable info from a debugger. * tty.cc (tty_init): Attempt to grab file handle info from parent debugger, if appropriate. # dtable.cc (dtable::stdio_init): Make this a method. (dtable::init_std_file_from_handle): Don't set fd unless it's not open. (dtable::build_fhandler_from_name): Move name setting to dtable::build_fhandler. (dtable::build_fhandler): Add win32 name parameter. * dcrt0.cc (dll_crt0_1): Change to use dtable stdio_init. * dtable.h (dtable): Reflect build_fhandler parameter change. * mmap.cc (mmap_record::alloc_fh): Don't set name parameter in build_fhandler. * net.cc (fdsock): Remove set_name call since it is now handled by build_fhandler. * sigproc.cc (proc_subproc): Release muto as early as possible.
* * times.cc (hires::prime): Restore thread priority on failure condition.Christopher Faylor2002-02-171-1/+1
| | | | | | | | | | | | | | | | | | | * uinfo.cc (uinfo_init): Use more robust method for determining if process was invoked from a non-cygwin process. * sync.h (muto::init): Eliminate "inheritance" parameter. (new_muto): Reflect removal of parameter. * sync.cc (muto::init): Ditto. * cygheap.cc (cygheap_init): Ditto. * debug.cc (threadname_init): Ditto. * exceptions.cc (events_init): Ditto. * malloc.cc (malloc_init): Ditto. * path.cc (cwdstuff::init): Ditto. * sigproc.cc (sigproc_init): Ditto. * grp.cc (group_lock): Use different method for locking with static member. (read_etc_group): REALLY ensure that read lock mutex is released. * passwd.cc (passwd_lock): Use different method for locking with static member. (read_etc_passwd): REALLY ensure that read lock mutex is released. * shared.cc (sec_user): Correct reversed inheritance test.
* * exceptions.cc (unused_sig_wrapper): Eliminate unused parameter to asm.Christopher Faylor2002-02-141-3/+3
| | | | | | | | | | | | | * external.cc (cygwin_internal): Change CW_STRACE_ON to CW_STRACE_TOGGLE. * strace.cc (strace::hello): Toggle strace on and off. * sync.cc (muto::init): Renamed from constructor. * sync.h (muto::new): Delete. (muto::delete): Ditto. (new_muto): Simplify. Use muto.init for nearly everything. * uinfo.cc (uinfo_init): Avoid closing a NULL handle. * include/sys/cygwin.h (cygwin_getinfo_types): Rename CW_STRACE_OFF to CW_STRACE_TOGGLE. Delete CW_STRACE_OFF. * include/sys/strace.h (strace): Add "inited" field.
* * speclib: Don't use /dev/null as DLL name. Just default to what's already inChristopher Faylor2002-01-211-3/+0
| | | | | | .def file. * exceptions.cc (sig_handle): Remove last vestiges of SA_NOCLDSTOP code which caused SIGCHLD to be ignored.
* * exceptions.cc (ctrl_c_handler): Convert windows pid to cygwin pid whenChristopher Faylor2002-01-201-1/+1
| | | | detecting if we should actually handle CTRL-C.
* * exceptions.cc (sig_handle_tty_stop): Don't send SIGCHLD if parent doesn'tChristopher Faylor2002-01-191-2/+4
| | | | | | want it. (sig_handle): Don't check for SA_NOCLDSTOP here. We don't have enough information.
* Add copyright stuffChristopher Faylor2002-01-131-1/+1
|
* * exceptions.cc (sig_handle): Accept a second argument indicating whether theChristopher Faylor2002-01-111-3/+3
| | | | | | | | signal came from this process or not. * sigproc.h: Reflect sig_handle arg change. * signal.cc (kill_pgrp): Add sigframe info. (abort): New function. Eliminates newlib function of same name. * sigproc.cc (wait_sig): Pass "signal from this process" value as arg 2.
* * exceptions.cc (early_stuff_init): Rename from misnamed set_console_handler.Christopher Faylor2002-01-101-9/+21
| | | | | | | | | | (ctrl_c_handler): Attempt to work around potential signal duplication during process startup. (sig_handle): Ignore SIGINT when we're just an "exec stub". * spawn.cc (spawn_guts): Store pid of spawned process in global for use by ctrl_c_handler. * dcrt0.cc (dll_crt0_1): Call renamed initialization function. * winsup.h: Reflect function name change.
* exceptions.cc (sig_handle): Set default action for SIGURG to SIG_IGN.Corinna Vinschen2002-01-051-1/+2
|
* * dtable.cc (dtable::vfork_parent_restore): Add debugging statement.Christopher Faylor2001-11-241-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | * exceptions.cc (try_to_debug): Spin only as long as we don't have a debugger attached. * fhandler.h (fhandler_base::set_nohandle): New method. (fhandler_base::get_nohandle): New method. * fhandler.cc (fhandler_base::dup): Avoid duplicating handle if there is no handle. * fhandler_disk_file.cc (fhandler_disk_file::opendir): Set nohandle flag on dummy fd. * Makefile.in: Make intermediate library for eventual inclusion in libcygwin.a * fhandler.h (fhandler_pipe::fhandler_pipe): Remove default argument setting since it is no longer used. * miscfuncs.cc (check_null_str): New function. (+check_null_str_errno): Ditto. * net.cc: Add defensive buffer checking throughout. (cygwin_sendto): Protect against invalid fd. (cygwin_recvfrom): Ditto. (cygwin_getpeername): Ditto. (cygwin_recv): Ditto. (cygwin_send): Ditto. * winsup.h: Declare a new function. * select.cc (set_bits): Fix conditional for setting fd in exceptfds. * dtable.cc (dtable::build_fhandler): Create fhandler_pipe using correct device type. * path.cc (get_devn): Set correct pipe device type from device name.
* * exceptions.cc: Add stdlib.h include for alloca declaration.Christopher Faylor2001-11-151-0/+1
| | | | | | * poll.cc: Ditto. * termios.cc: Ditto. * syscalls.cc (_write): Only allow zero length when fd is valid.
* * environ.cc: Set reset_com to false to mimic linux behavior more closely.Christopher Faylor2001-10-311-0/+1
|
* * autoload.cc (wsock_init): Reorganize slightly to accomodate a new compiler.Christopher Faylor2001-10-131-2/+2
|
* * cygheap.cc (cfree): Remove malloc debugging probe.Christopher Faylor2001-10-031-1/+4
| | | | | | | | | | | | | | | | | | | | | | | * dlmalloc.c (errprint): Remove abort() call which causes interesting error message printing to abort prematurely. * environ.cc: Sprinkle MALLOC_CHECKs liberally throughout. (_addenv): Allocate two empty elements at end of environ to (apparently) work around problems with some buggy applications. (winenv): Avoid calling alloca if no forced environment variable is present. * exceptions.cc (open_stackdumpfile): Don't print "Dumping stack trace to..." when running in a cygwin environment (i.e., the parent is a cygwin process). * dtable.cc (dtable::init_std_file_from_handle): Move device type detection code from build_fhandler here since it is only used by this function. (dtable::build_fhandler_from_name): New method. Renamed from dtable::build_fhandler. (dtable::build_fhandler): Use build_fhandler_from_name. (cygwin_attach_handle_to_fd): Ditto. * syscalls.cc (_open): Ditto. (stat_worker): Ditto. * dtable.h (dtable::build_fhandler_from_name): Rename declaration from dtable::build_fhandler.