summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin
Commit message (Collapse)AuthorAgeFilesLines
* * fhandler_tty.cc (fhandler_pty_master::close): Always closeChristopher Faylor2006-06-122-12/+11
| | | | from_master/to_master since we always have copies of these handles.
* * include/sys/wait.h: Move definition of wait constants from here...Corinna Vinschen2006-06-124-22/+46
| | | | | * include/cygwin/wait.h: ...to here. New file. * include/cygwin/stdlib.h: Include cygwin/wait.h to conform with SUSv3.
* * heap.cc (heap_init): Only commit if allocsize is not zero.Corinna Vinschen2006-06-122-1/+5
|
* * net.cc (fdsock): Disable raising buffer sizes. Add comment toCorinna Vinschen2006-06-122-2/+18
| | | | explain why.
* * ioctl.cc (ioctl): Accommodate change in reported pty master device number.Christopher Faylor2006-06-043-5/+13
| | | | * select.cc (peek_pipe): Ditto.
* * cygtls.h (CYGTLS_PADSIZE): Reset to a size that XP SP1 seems to like.Christopher Faylor2006-06-043-63/+69
| | | | * tlsoffsets.h: Regenerate.
* fix wordingChristopher Faylor2006-06-031-1/+2
|
* * cygthread.cc (cygthread::terminate_thread): In debugging output, use name ofChristopher Faylor2006-06-035-25/+35
| | | | | | | | | | | | | | | | | | | | thread being terminated rather than thread doing terminating. * fhandler.h (fhandler_pty_master::slave): Delete. (fhandler_pty_master::get_unit): Ditto. (fhandler_pty_master::setup): Change argument declaration to accommodate new usage. * fhandler_tty.cc (fhandler_tty_master::init): Remove obsolete slave assignment. Pass argument to setup indicating that this is a tty. (fhandler_tty_slave::open): Use dev() method rather than referencing pc.dev directly. (fhandler_pty_master::open): Don't create archetype based on ptym device number. Set device number to use DEV_TTYM_MAJOR and tty number. Pass argument to setup indicating that this is a pty. (fhandler_pty_master::setup): Change single argument to a flag indicating whether we're creating a pty and use appropriately. Calculate 't' variable here rather than in caller. * fhandler_dsp.cc (fhandler_dev_dsp::open): Use dev() method rather than referencing pc.dev directly.
* * dcrt0.cc (dll_crt0_0): Call tty_list::init_session here.Christopher Faylor2006-06-039-77/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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.
* * Makefile.in (libdl.a): New library.Christopher Faylor2006-06-032-1/+8
|
* * fhandler_tty.cc (fhandler_pty_master::close): Don't close handles if we don'tChristopher Faylor2006-06-032-6/+29
| | | | | | | | | | own them. (fhandler_pty_master::setup): Make sure that original handle is closed when changing inheritance. (fhandler_pty_master::fixup_after_fork): Set from_master/to_master to arch value always. (fhandler_pty_master::fixup_after_exec): Clear from_master/to_master when close_on_exec.
* * cygheap.cc (init_cygheap::close_ctty): Remove obsolete code.Christopher Faylor2006-06-035-36/+26
| | | | | | | | | | | | * dcrt0.cc (child_info_spawn::handle_spawn): Signal ready after we've run fixup_after_exec. * dtable.cc (dtable::fixup_after_exec): Add debugging output. * fhandler_tty.cc (fhandler_pty_master::doecho): Use class version of to_master. (fhandler_tty_common::close): Remove obsolete code. (fhandler_tty_slave::fixup_after_exec): Don't close, since this is done in dtable's fixup_after_exec. (revisit later?) (fhandler_pty_master::fixup_after_exec): Ditto.
* (check in missing ChangeLog lines)Christopher Faylor2006-06-031-0/+6
| | | | | | | | * tlsoffsets.h: Regenerate. * dcrt0.cc (break_here): Define unconditionally for use elsewhere. Call DebugBreak, if appropriate. (initial_env): Rely on break_here() to call DebugBreak. * exceptions.cc (try_to_debug): Ditto.
* * cygtls.h (CYGTLS_PADSIZE): Bump up or suffer a regrettable collision with theChristopher Faylor2006-06-035-68/+74
| | | | call chain.
* * fhandler.cc (fhandler_base::fixup_after_exec): Declare here.Christopher Faylor2006-06-028-333/+311
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fhandler.h (fhandler_base::fixup_after_exec): Make non-inline. (fhandler_termios::fixup_after_fork): Delete declaration. (fhandler_termios::fixup_after_exec): Ditto. (fhandler_tty_common::inuse): Remove. (fhandler_tty_common::dup): Delete declaration. (fhandler_tty_common::fixup_after_fork): Ditto. (fhandler_tty_slave::fixup_after_exec): Declare new function. (fhandler_pty_master::dwProcessId): New variable. (fhandler_pty_master::from_master): Ditto. (fhandler_pty_master::to_master): Ditto. (fhandler_pty_master::setup): New function. (fhandler_pty_master::fixup_after_fork): Ditto. (fhandler_pty_master::fixup_after_exec): Ditto. * fhandler_termios.cc (fhandler_termios::fixup_after_exec): Delete definition. (fhandler_termios::fixup_after_fork): Ditto. * fhandler_tty.cc (fhandler_tty_master::init): Use fhandler_pty_master setup function rather than obsolete tty::common_init. Delete obsolete inuse setting. (fhandler_tty_slave::fhandler_tty_slave): Set inuse to NULL here. (fhandler_tty_slave::open): Change debugging output for clarity. Check for different things when doing a sanity check on the tty. Reflect the fact that master_pid now is the cygwin pid rather than the windows pid. Use "arch" rather than "archetype" for consistency. (fhandler_tty_slave::close): Close inuse here. (fhandler_tty_slave::dup): Remove old if 0'ed code. (fhandler_pty_master::dup): New function. Handles pty master archetype. (fhandler_pty_master::fhandler_pty_master): Zero pty_master specific fields. (fhandler_pty_master::open): Implement using archetypes, similar to slave. Use fhandler_pty_master setup function rather than obsolete tty::common_init. Don't set inuse. (fhandler_tty_common::close): Don't deal with inuse. Delete old if 0'ed code. (fhandler_pty_master::close): Implement using archetypes. Close from_master and to_master. (fhandler_tty_common::set_close_on_exec): Just set close_on_exec flag here since everything uses archetypes now. (fhandler_tty_common::fixup_after_fork): Delete definition. (fhandler_tty_slave::fixup_after_exec): Define new function. (fhandler_pty_master::setup): New function, derived from tty::common_init. (fhandler_pty_master::fixup_after_fork): New function. (shared_info.h): Reset SHARED_INFO_CB to reflect new tty size. * tty.cc (tty_list::terminate): Close individual handles from tty_master. (tty::master_alive): Delete. (tty::make_pipes): Ditto. (tty::common_init): Ditto. * tty.h (tty::from_slave): Delete. (tty::to_slave): Ditto. (tty::common_init): Delete declaration. (tty::make_pipes): Ditto. (tty::master_pid): Define as pid_t since it is now a cygwin pid.
* * cygheap.cc (cygheap_fixup_in_child): Don't close parent handle here. Let theChristopher Faylor2006-06-028-22/+75
| | | | | | | | | | | | | | | | | | | | caller do that. * dcrt0.cc (child_info_spawn::handle_spawn): Close parent handle here to allow fixup_after_exec functions to use it. * cygtls.cc (_cygtls::call2): Avoid calling exit thread if called with *crt0_1 functions. * cygtls.h (_cygtls::isinitialized): Check that we actually have a tls before seeing if it is initialized. * gendef (_sigfe_maybe): Ditto. * dcrt0.cc (dll_crt0_1): Remove static, use just one argument. * dll_init.cc (dllcrt0_info): New structure. (dll_dllcrt0): Change into a front-end to renamed dll_dllcrt0_1 so that we'll always be assured of having something like a tls. (dll_dllcrt0_1): New function, basically renamed from from dll_dllcrt0. Unconditionally call _my_tls.init_exception_handler now that we are assured of having a tls. Change variable name from "linking" to "linked". * winsup.h (dll_crt0_1): Declare. (dll_dllcrt0_1): Ditto.
* * cygtls.cc (_cygtls::call2): Don't call ExitThread on the main thread.Christopher Faylor2006-05-312-1/+8
|
* * winf.h (MAXCYGWINCMDLEN): Set down size to 30000 or suffer fork errors.Christopher Faylor2006-05-292-3/+8
|
* * sigproc.cc (child_info::proc_retry): Mask all of the bits we're interestedChristopher Faylor2006-05-292-1/+6
| | | | in, which includes bits above and below 0xc0000000.
* Put an underscore in front of the "active" in "strace.active".Christopher Faylor2006-05-281-1/+1
|
* white spaceChristopher Faylor2006-05-2819-91/+91
|
* * dll_init.cc (dll_dllcrt0): Previous change didn't work very well with fork.Christopher Faylor2006-05-272-2/+10
| | | | | Semi-revert it but change name of variable to something that makes better sense.
* * thread.cc (verifyable_object_isvalid): Check for NULL specifically.Christopher Faylor2006-05-272-4/+10
|
* add missing commentChristopher Faylor2006-05-271-0/+6
|
* * dll_init.cc (dll_dllcrt0): Call _my_tls.init_exception_handler if we'veChristopher Faylor2006-05-272-3/+12
| | | | | finished initializing (Thanks to Gary Zablackis for noticing this problem). Just use cygwin_finished_initializing rather than defining a separate variable.
* * debug.h (ModifyHandle): Define new macro.Christopher Faylor2006-05-256-8/+50
| | | | | | | | | | | | | (modify_handle): Declare new function. * debug.cc (modify_handle): Define new function. * fhandler.h (fhandler_base::fork_fixup): Change return value from void to bool. * fhandler.cc (fhandler_base::fork_fixup): Return true if fork fixup has been done. * pipe.cc (fhandler_pipe::set_close_on_exec): Set inheritance of protected handle via ModifyHandle if DEBUGGING. (fhandler_pipe::fixup_after_fork): Protect guard handle if fork fixup has been done.
* * cygtls.cc (_cygtls::call): Call call2 using _my_tls.Christopher Faylor2006-05-257-112/+104
| | | | | | | | | | | | (_cygtls::init_exception_handler): Always replace existing exception handler with cygwin exception handler. * cygtls.h (_cygtls::call2): Remove static designation. * dcrto.cc (dll_crt0_1): Define in a way that allows calling via _cygtls::call. (_initialize_main_tls): Delete. (_dll_crt0): Call dll_crt0_1 via cygtls::call. Set _main_tls here. * external.cc (cygwin_internal): Implement CW_CYGTLS_PADSIZE. * include/sys/cygwin.h (CW_CYGTLS_PADSIZE): Define. * tlsoffsets.h: Regenerate.
* update to newer autoconfChristopher Faylor2006-05-243-1318/+2082
|
* * fhandler.cc (readv): Remove nonsensical assert.Christopher Faylor2006-05-242-2/+4
|
* * select.cc (start_thread_socket): Delay setting thread local exitsock until weChristopher Faylor2006-05-244-1549/+4838
| | | | know it's correct. Return correct value on error.
* * select.cc (start_thread_socket): Clean up exitsock in case of error. UseChristopher Faylor2006-05-242-2/+9
| | | | si->exitcode consistently.
* * child_info.h (_CI_SAW_CTRL_C): New enum.Christopher Faylor2006-05-227-12/+50
| | | | | | | | | | | | | | | | | (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.
* * fhandle.h (fhandler_pipe::create_guard): Revert change which eliminatedChristopher Faylor2006-05-213-32/+64
| | | | | | | | | | | | | | | | SECURITY_ATTRIBUTES argument. * pipe.cc (fhandler_pipe::open): Duplicate guard from other process and protect it appropriately. Eliminate unneeded writepipe_exists temporary variable. Set inheritance appropriately. (fhandler_pipe::set_close_on_exec): Revert change which eliminated handling guard inheritance. (fhandler_pipe::fixup_after_fork): Ditto. Use correct name of entity being checked by fork_fixup. (fhandler_pipe::fixup_after_exec): Don't bother with guard here. (fhandler_pipe::dup): Cosmetic changes and revert creation of writepipe_exists as noninheritable. (fhandler_pipe::create): Revert change which eliminated SECURITY_ATTRIBUTES argument. Revert change which always made writepipe_exists noninheritable.
* check in missing fileChristopher Faylor2006-05-211-11/+25
|
* typoChristopher Faylor2006-05-211-1/+1
|
* * debug.cc (add_handle): Print handle value when collision detected.Christopher Faylor2006-05-216-46/+71
| | | | | | | | | | | | | | | | | | | | | | | * dtable.cc (dtable::stdio_init): Cosmetic change. * fhandler.h (fhandler_base::create_read_state): Protect handle. (fhandler_pipe::create_guard): Ditto. Always mark the handle as inheritable. (fhandler_pipe::is_slow): Return boolean value rather than numeric 1. * pipe.cc (fhandler_pipe::fhandler_pipe): Always flag that we need fork fixup. (fhandler_pipe::open): Don't pass security attributes to create_guard. (fhandler_pipe::set_close_on_exec): Don't handle guard here. (fhandler_pipe::close): Accommodate now-protected guard handle. (fhandler_pipe::fixup_in_child): Don't proected read_state here. (fhandler_pipe::fixup_after_exec): Close guard handle if close_on_exec. (fhandler_pipe::fixup_after_fork): Don't bother with guard here. (fhandler_pipe::dup): Don't set res to non-error prematurely. Use boolean values where appropriate. Protect guard and read_state. (fhandler_pipe::create): Don't call need_fork_fixup since it is now the default. Don't protect read_state or guard. * pipe.cc (fhandler_base::ready_for_read): Use bool values for "avail". * spawn.cc (spawn_guts): Set cygheap->pid_handle as inheritable when protecting. * select.cc (fhandler_pipe::ready_for_read): Actually get the guard mutex for blocking reads.
* * fhandler_tty.cc (fhandler_tty::close): Remove problematic hExeced guard.Christopher Faylor2006-05-202-12/+18
|
* * fhandler_tty.cc (fhandler_tty_slave::open): Reinstate call to need_invisibleChristopher Faylor2006-05-202-1/+8
| | | | on first pty open.
* fix incorrect function name in old entryChristopher Faylor2006-05-201-1/+1
|
* * fhandler_console.cc (fhandler_console::need_invisible): Allocate an invisibleChristopher Faylor2006-05-192-5/+10
| | | | window station when ctty != TTY_CONSOLE.
* * cygtls.cc (_cygtls::remove): Don't test for initialization since thisChristopher Faylor2006-05-173-3/+9
| | | | | | function will always be called when _my_tls is initialized. * init.cc (dll_entry): Don't attempt to remove tls info if _my_tls is obviously not even available.
* correct changelog dateChristopher Faylor2006-05-161-1/+1
|
* * sigproc.cc (no_signals_available): Detect hwait_sig == INVALID_HANDLE_VALUE.Christopher Faylor2006-05-168-85/+105
| | | | | | | | | | | | | | | | | (wait_sig): Set hwait_sig to INVALID_HANDLE_VALUE on __SIGEXIT. * cygtls.cc (_cygtls::init_thread): Zero entire _my_tls structure and no more. * cygtls.h (_my_tls::padding): Delete. (CYGTLS_PADSIZE): Redefine concept of padding to mean padding at the end of the stack. * dcrt0.cc (initialize_main_tls): Change return to void. * gentls_offsets: Treat const specially, too. Keep going after a '}' is found. Change negative offset calculation to use CYGTLS_PADSIZE. * init.cc (_my_oldfunc): New variable. (threadfunc_fe): Use stored tls value for oldfunc rather than blindly writing to the stack. (munge_threadfunc): Set oldfunc in tls. (dll_entry): Initialize tls allocation. * tlsoffsets.h: Regenerate.
* * ntdll.h (STATUS_INVALID_INFO_CLASS): Conditionalize.Christopher Faylor2006-05-142-0/+8
|
* * Makefile.in (clean): Also delete *.dbg.Brian Dessent2006-05-102-1/+5
|
* * fhandler_disk_file.cc (fhandler_disk_file::readdir): Fix typo which causedChristopher Faylor2006-05-082-1/+6
| | | | test for ".." to be skipped.
* * external.cc (cygwin_internal): Set errno on failure.Christopher Faylor2006-05-022-0/+5
|
* * pipe.cc (DEFAULT_PIPEBUFSIZE): Raise to 64K.Corinna Vinschen2006-04-272-1/+5
|
* * fhandler.h (fhandler_base): Change fstat_helper prototypeCorinna Vinschen2006-04-266-95/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | to take file size and inode number as 64 bit values. * fhandler_disk_file.cc (FS_IS_SAMBA): Move to path.cc (FS_IS_SAMBA_WITH_QUOTA): Ditto. (path_conv::hasgood_inode): Delete. (path_conv::is_samba): Delete. (path_conv::isgood_inode): Centralized function to recognize a good inode number. (fhandler_base::fstat_by_handle): Constify fvi_size and fai_size. Accomodate argument change in fstat_helper. (fhandler_base::fstat_by_name): Ditto. (fhandler_base::fstat_helper): Accomodate argument change. Call path_conv::isgood_inode to recognize good inodes. (fhandler_disk_file::opendir): Explain Samba weirdness here. Call path_conv::fs_is_samba instead of path_conv::is_samba. (fhandler_disk_file::readdir): Add STATUS_INVALID_INFO_CLASS as valid return code from NtQueryDirectoryFile to indicate that FileIdBothDirectoryInformation is not supported. Call path_conv::isgood_inode to recognize good inodes. * ntdll.h (STATUS_INVALID_INFO_CLASS): Define. * path.cc (fs_info::update): Rework file system recognition and set appropriate flags. * path.h (struct fs_info): Add is_ntfs, is_samba and is_nfs flags. Constify pure read accessors.
* * environ.cc (getearly): Force correct dereference order when inspectingChristopher Faylor2006-04-242-1/+6
| | | | environ table.