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
path: root/winsup
AgeCommit message (Collapse)Author
2011-11-26* init.cc (remove): Don't bother calling through thread removal cleanup if weChristopher Faylor
are exiting.
2011-11-26* exceptions.cc (stackdump): Make global.Christopher Faylor
(signal_exit): Move to sigproc.cc. * sigproc.cc (signal_exit): Move here. Declare stackdump extern. Set my_sendsig to indicate that signals are no longer available. (my_readsig): Make Static again. (sig_send): Interpret ERROR_BROKEN_PIPE as ESRCH. Remove special-case EACCESS errno setting, just setting errno generally, even for "its_me" case.
2011-11-26* exceptions.cc (sigpacket::process): Move signal_exit processing into...Christopher Faylor
(_cygtls::signal_exit): ...here. Close my_readsig and comment on why. * pinfo.cc (pinfo::exit): Move sigproc_terminate earlier. Set exiting flag in lock_process. * sigproc.cc (my_readsig): Make global. * sync.cc (muto::exiting_thread): Delete. (muto::acquire): Delete #if 0'ed code. * sync.h (muto::exiting_thread): Delete. (set_exiting_thread): Ditto. (lock_process::lock_process): Don't worry about setting the exiting thread since it had no meaning.
2011-11-25* strace.cc (attach_process): Use NT_SUCCESS to figure out ifChristopher Faylor
NtSetInformationProcess succeeded. (handle_output_debug_string): Put back DebugActiveProcess since it seems to still be needed (on my system at least). Detect new format _STRACE_INTERFACE_ACTIVATE_ADDR which informs whether this is a forked process or not. Use that to decide if forkdebug should be handled.
2011-11-25missed this in previous checkinChristopher Faylor
2011-11-25* cygthread.h (cygthread::name): Default name to "main" if we are early in theChristopher Faylor
process of setting up the DLL and no name is known. * dcrt0.cc (initial_env): Remove CYGWIN_SLEEP stuff. (get_cygwin_startup_info): Activate strace here as appropriate. (dll_crt0_0): Move get_cygwin_startup_info as early as possible to avoid missing strace output. * fork.cc (frok::child): Move debugging statement to point where ppid will be set. * pinfo.cc (pinfo::thisproc): Remove obsolete call to strace.hello. Tweak debug output slightly. * select.cc (select_stuff::wait): Allow APCS to be triggered while waiting since we use them now. Report when that happens. * sigproc.cc (child_info::child_info): Use strace.active() rather than strace.attached(). * spawn.cc (child_info_spawn::worker): Only write strace child pid when we know it's a cygwin process. Accommodate change to write_child argument list. * strace.cc (strace::hello): Delete. Move functionality... (strace::activate): ...to here. (mypid): Just use raw GetCurrentProcessId () if myself isn't set. (strace::write_childpid): Don't wait for subproc_ready. Remove arg which was required for it. * include/sys/strace.h (strace::hello): Delete. (strace::write_childpid): Delete first argument.
2011-11-24* child_info.h (CURR_CHILD_INFO_MAGIC): Reset for previous changes.Christopher Faylor
* dcrt0.cc (get_cygwin_startup_info): Signal readiness when stracing since strace::write_child relies on it. Use strace.activate to notify strace process, passing in arg indicating whether we're forked. * sigproc.cc (wait_sig): Accommodate new strace::activate argument. * spawn.cc (child_info_spawn::worker): Oops. Previous suspended test was actually correct. Revert and document. * strace.cc (strace::activate): Send additional flag indicating whether this is an attempt to activate a forked process. (strace::hello): Report on windows pid. * include/sys/strace.h (strace::strace): Make a dummy. (strace::activate): Modify declaration to accept an argument. (strace::write_childpid): Set regparm.
2011-11-24* pipe.cc (fhandler_pipe::create): Avoid derefencing a NULL pointer.Christopher Faylor
* child_info.h (child_info): Reorganize some elements so that the ones which are initialized in a constructor are all together. * sigproc.cc (child_info::child_info): Initialize values via the constructor rather than as C statements and make sure that flags is set to zero initially. * spawn.cc (child_info_spawn::worker): Use iscygwin() test for determining when to send strace info since it is more foolproof than checking the suspend state.
2011-11-23* fhandler.h (fhandler_pipe::create): Rename from the misnamedChristopher Faylor
"create_selectable". Change return to DWORD. (fhandler_pty_common::pipesize): New constant. * fhandler_fifo.cc (fhandler_fifo::fhandler_fifo): Reflect create_selectable name change. * miscfuncs.cc (CreatePipeOverlapped): Ditto. * pipe.cc (fhandler_pipe::create): Ditto. (fhandler_pipe::create): Rename from the misnamed "create_selectable". Return DWORD. Only set pipe size to default when it is passed in as zero. * fhandler_tty.cc (fhandler_pty_master::setup): Ditto. Use fhandler_pty_common::pipesize rather than a raw constant. * tty.cc (tty::not_allocated): Ditto. * sigproc.cc (sigproc_init): Use create_selectable to create the signal pipe to get a more appropriate message based pipe.
2011-11-22* sigproc.cc (remove_proc): Don't do busy loop when exiting since it doesn'tChristopher Faylor
matter.
2011-11-21* sigproc.cc (remove_proc): Don't do busy loop when execing since thread couldChristopher Faylor
have been terminated prior to setting flag. * signal.cc (sigwaitinfo): Zero event before closing to signal other threads that it is no longer available.
2011-11-21 * faq-using.xml (faq.using.weirdchars): Rewrite.Corinna Vinschen
2011-11-18 * shared.cc (get_shared_parent_dir): Use global shared_parent_dirCorinna Vinschen
instead of local dir variable and create handle not inheritable to avoid accumulating stray handles in child processes. (get_session_parent_dir): Ditto with session_parent_dir variable.
2011-11-18 * faq-using.xml (faq.using.converting-paths): Remove reference toCorinna Vinschen
cygwin.bat. (faq.using.emacs): Drop "CYGWIN=tty" setting. * pathnames.sgml (pathnames-posixdevices): Align list of device names with changes in 1.7.10. * setup2.sgml (setup-env-ov): Drop text which assumes that Cygwin processes are started in console window. Align wording to lessened relevance of $CYGWIN. Don't use dropped CYGWIN setting in example. (setup-locale-how): Put using console and Cygwin.bat file into perspective. (setup-locale-problems): Ditto.
2011-11-18 * shared.cc (shared_info::create): Open global shared data sectionCorinna Vinschen
non-inheritable to avoid accumulating stray handles in child processes.
2011-11-16* child_info.h (CURR_CHILD_INFO_MAGIC): Reset.Christopher Faylor
(cygheap_exec_info::nchildren): Move from child_info_spawn. (cygheap_exec_info::cchildren): Ditto. (cygheap_exec_info::record_children): Declare new function. (cygheap_exec_info::reattach_children): Ditto. (cygheap_exec_info::alloc): Ditto. (child_info_spawn::nchildren): Move to cygheap_exec_info. (child_info_spawn::cchildren): Ditto. * sigproc.cc (cygheap_exec_info::alloc): Define new function. (child_info_spawn::cleanup): Accommodate move of children info to cygheap_exec_info. (cygheap_exec_info::record_children): Define new function. (cygheap_exec_info::reattach_children): Ditto. (child_info_spawn::record_children): Use cygheap_exec_info function to accomplish this task. (child_info_spawn::reattach_children): Ditto. * spawn.cc (child_info_spawn::worker): Allocate moreinfo using cygheap_exec_info::alloc. * dcrt0.cc (child_info_fork::alloc_stack_hard_way): Use abort for the error to avoid a retry.
2011-11-14* pinfo.cc (_pinfo::dup_proc_pipe): Fatalize a warning when debugging.Christopher Faylor
2011-11-14* strace.cc (handle_output_debug_string): Disable code which attempted to addChristopher Faylor
stuff in between '****' blocks since they no longer are the first thing output by an straced process.
2011-11-14Remove erroneously checked-in debugging statements.Christopher Faylor
* cygheap.cc (cygheap_fixup_in_child): Here. * debug.cc (delete_handle): Here. * sigproc.cc (child_info_spawn::cleanup): Here. * spawn.cc (child_info_spawn::worker): Here.
2011-11-14update copyrightsChristopher Faylor
2011-11-14Throughout use "have_execed" macro rather than "hExeced" global handle.Christopher Faylor
Throughout rename _PROC_* to _CH_*. * child_info.h: Include "pinfo.h". (child_info_types): Rename _PROC_* -> _CH_* to avoid confusion with similarly named constants. (_PROC_*): Delete unneeded aliases. (PROC_*): Ditto. (CURR_CHILD_INFO_MAGIC): Ditto. (cchildren): Define using "pinfo_minimal". (child_info::set_saw_ctrl_c): Move to (child_info_spawn::set_saw_ctrl_c): Here. (child_info_spawn::lock): New field. (child_info_spawn::hExeced): Ditto. (child_info_spawn::ev): Ditto. (child_info_spawn::~child_info_spawn): Move to sigproc.cc. (child_info_spawn::child_info_spawn): Ditto. (child_info_spawn::cleanup): Declare new function. (child_info_spawn::set_saw_ctrl_c): Move to this class. Set flag only when execed and return true when we have set the flag. (child_info_spawn::child_info_spawn::signal_myself_exited): New function. (child_info_spawn::wait_for_myself): Ditto. (child_info_spawn::has_execed_cygwin): Ditto. (child_info_spawn::has_execed): Ditto. Replaces "hExeced" test. (child_info_spawn::operator HANDLE&): New operator. (child_info_spawn::worker): Define old "spawn_guts" as class member. (ch_spawn): Declare. (have_execed): Define. (have_execed_cygwin): Ditto. * cygheap.h: Update comment. * dcrt0.cc (get_cygwin_startup_info): Use _CH_* enums. (child_info_spawn::handle_spawn): Ditto. (dll_crt0_0): Ditto. (multiple_cygwin_problem): Ditto. * exceptions.cc (chExeced): Delete obsolete declaration. (ctrl_c_handler): Reference set_saw_ctrl_c via new ch_spawn global. * globals.cc (hExeced): Delete. * pinfo.cc (pinfo::thisproc): Refer to cygheap as ::cygheap for consistency in handle naming when -DDEBUGGING. (pinfo::init): Accommodate case where myself.h is known but h0 is passed in. (pinfo::pinfo): New constructor for setting up a pinfo passed in by previous exec'or. (pinfo::proc_waiter): Don't handle subprocess if we're in the process of exiting due to an exec of a cygwin process. Don't close rd_proc_pipe here. Close it when we actually are finished with the process. Use new ch_spawn.signal_myself_exited function to let exec stub know that subprocess has exited. (pinfo::wait): Clarify debugging output. (pinfo::release): Use "close_h" to close all handles to avoid races. (winpids::add): Assume that elements of the array do not need to be zeroed and are properly initialized or suffer problems on pinfo::release. Don't close hProcess since release does that now. * pinfo.h: Update comment. (pinfo_minimal): Move some elements from pinfo here so that child_info_spawn can use them. (pinfo): Inherit from pinfo_minimal. (pinfo::pinfo): Modify to accommodate new pinfo_minimal. (pinfo::allow_remove): New function. * sigproc.cc (proc_subproc): Use boolean values for true/false. Implement PROC_EXEC_CLEANUP. (proc_terminate): Set ppid = 1 since the procs list will only be iterated when the process has not execed. Don't do any cleanup here since it is now handled in pinfo::release. (sigproc_init): Initialize sync_proc_subproc earlier. (child_info::child_info): Assume that all important fields are properly initialized and avoid memset(). (child_info_spawn::child_info_spawn): Specifically test for execing and then set up appropriate fields in the struct. (child_info_spawn::cleanup): Define new function. (child_info_spawn::record_children): Specifically test for being execed here. Fill in pinfo_minimal part of children array. (child_info_spawn::reattach_children): Use constructor to duplicate information for previous exec'or. Add more debugging output. (remove_proc): Force deletion of thread when exiting due to exec. Rely on pinfo::cleanup in release. * sigproc.h (PROC_EXEC_CLEANUP): New enum. (PROC_DETACHED_CHILD): Delete. * spawn.cc (chExeced): Delete. (child_info_spawn::worker): Rename from spawn_guts. Use elements of child_info_spawn throughout rather than ch.whatever. Use ::cygheap to refer to global rather than element of child_info. Use wait_for_myself() rather than waitpid(). Call child_info_spawn::cleanup on function return. (spawnve): Reflect movement of spawn_guts functionality into child_info_spawn::worker. * syscalls.cc (popen): Ditto. * winsup.h (spawn_guts): Delete declaration.
2011-11-08 * new-features.sgml (ov-new1.7.10): Document ptsname_r.Corinna Vinschen
2011-11-08 * posix.sgml (std-gnu): Add ptsname_r.Corinna Vinschen
2011-11-08* fhandler.h (__ptsname): New macro.Christopher Faylor
* dtable.cc (decode_tty): Use __ptsname to generate the slave pty name. * fhandler_tty.cc (fhandler_pty_master::ptsname_r): Ditto. * bsdlib.cc: Add needed includes for openpty() changes. (openpty): Use __ptsname to generate the slave pty name. Close slave fd when aslave == NULL.
2011-11-08* include/cygwin/stdlib.h: Update copyright.Christopher Faylor
2011-11-08* cygwin.din (ptsname_r): Export.Christopher Faylor
* fhandler.cc (fhandler_base::ptsname_r): Define. * fhandler.h (fhandler_base::ptsname): Delete. (fhandler_base::ptsname_r): Declare. (fhandler_pty_master::ptsname_r): Declare. * fhandler_tty.cc (fhandler_pty_master::ptsname): Delete. (fhandler_pty_master::ptsname_r): New reentrant function derived from previous ptsname. * syscalls.cc (ptsname_r): Implement new function with functionality similar to Linux. (ptsname): Use ptsname_r () to fill out buf. * include/cygwin/stdlib.h (ptsname_r): Declare. * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 255 to reflect export of ptsname_r. * pinfo.cc (pinfo::wait): Return bool rather than int. * pinfo.h (info::wait): Ditto. (pinfo::reattach): Define !defined(_SIGPROC_H) case for consistency. * sigproc.cc (child_info_spawn::reattach_children): Use correct dwProcessId rather than pid when duplicating handle.
2011-11-07 * fhandler.cc (CHUNK_SIZE): Drop NO_COPY.Corinna Vinschen
2011-11-07 * syscalls.cc (check_dir_not_empty): Check surplus directory entriesCorinna Vinschen
by calling NtQueryAttributesFile. Make STATUS_DIRECTORY_NOT_EMPTY return value dependent on its status code. Add long comment to explain. (unlink_nt): Add comment to explain flaw in checking the sharing mode. Set status to STATUS_SUCCESS instead of 0. Add a retry loop to setting the delete disposition and trying to move a directory to bin to workaround rare cases of lingering, already deleted subdirectory entries. Add long comment to explain. (rename): Set status to STATUS_SUCCESS instead of 0.
2011-11-05* pinfo.cc (status_exit): Recognize STATUS_ILLEGAL_INSTRUCTION.Christopher Faylor
(child_info::proc_retry): Ditto.
2011-11-05 * faq-using.xml (faq.using.fixing-fork-failures): Add new FAQ.Jon TURNEY
* overview2.sgml (ov-hi-process-problems): Describe some difficulties in implementing fork()
2011-11-05* pinfo.cc (status_exit): Return complete error code. HandleChristopher Faylor
STATUS_ACCESS_VIOLATION correctly. (pinfo::set_exit_code): Set self->exitcode directly from status_exit.
2011-11-04* pinfo.h (pinfo::reattach): Only set destroy to false when proc_subprocChristopher Faylor
succeeds. Return true for success. * sigproc.cc (child_info_spawn::reattach_children): Try harder to clean up on error by detecting reattach failures too.
2011-11-04* sigproc.cc (child_info_spawn::reattach_children): Clean up handle when can'tChristopher Faylor
open parent process or suffer handle leak.
2011-11-04* sigproc.cc (child_info::sync): Report on exit code in strace output.Christopher Faylor
(child_info::proc_retry): Don't consider STATUS_ACCESS_VIOLATION as a restartable event.
2011-11-03* sigproc.cc (child_info_spawn::reattach_children): Avoid issuing an error whenChristopher Faylor
we can't duplicate from "parent" since it is probably ok if children of the previous owner of the pid disappear.
2011-11-03 * fhandler.cc (off_current): Define local in fhandler_base::raw_write.Corinna Vinschen
Drop erroneous NO_COPY, add _RDATA to make R/O. (off_append): Ditto. * globals.cc (_RDATA): Move definition from here... * winsup.h: ...to here.
2011-10-30Remove erroneous entry.Christopher Faylor
2011-10-30* fhandler.h (fhandler_pipe::create_selectable): Remove optional argument, takeChristopher Faylor
an options argument for CreateNamedPipe/CreateFile. Change handle arguments to expect pointers. (fhandler_fifo::fifo_state): Delete. (fhandler_fifo::dummy_client): Ditto. (fhandler_fifo::open_nonserver): Ditto. (fhandler_fifo::wait_state): Ditto. (fhandler_fifo::raw_write): Ditto. (fhandler_fifo::read_ready): New field. (fhandler_fifo::write_ready): Ditto. (fhandler_fifo::wait): Modify argument. (fhandler_fifo::fifo_name): Add a new argument. (fhandler_fifo::fixup_after_fork): New function. * fhandler_fifo.cc (fhandler_fifo::fhandler_fifo): Remove initialization of expunged elements. Initialize new handles to NULL. (fhandler_fifo::open_nonserver): Delete. (fnevent): New macro for creating a named event. (fnpipe): New macro for creating a unique named pipe name. (create_pipe): New macro for simplification of named pipe creation. (fhandler_fifo::fifo_name): Use new argument when creating a shared name. (fhandler_fifo::open): Rewrite. Use events to synchronize. (pure_debug_printf): New macro, active only when DEBUGGING. (fhandler_fifo::wait): Rewrite to wait for new fifo events which are supplied as a parameter. (fhandler_fifo::raw_read): Rewrite to use handle mechanism to detect client-side disconnect. (fhandler_fifo::raw_write): Delete. (fhandler_fifo::close): Remove accommodations for expunged fields. Close event handles. (fhandler_fifo::dup): Remove accommodations for expunged fields. Duplicate event handles. (fhandler_fifo::fixup_after_fork): New function. Perform fixups on event handles. (fhandler_fifo::set_close_on_exec): Remove accommodations for expunged fields. Set inheritance for new handle fields. * miscfuncs.cc (CreatePipeOverlapped): Accommodate changes in fhandler_pipe::create_selectable. * tty.cc (tty::not_allocated): Ditto. * pipe.cc (fhandler_pipe::create): Ditto. (fhandler_pipe::create_selectable): Accept an extra open_mode argument. Pass arguments by reference and allow opening one end of the pipe at a time. * sys/strace.h (debug_only_printf): Define new macro which calls debug_printf only when DEBUGGING is defined.
2011-10-28* exceptions.cc (sigpacket::process): Avoid a potential deadlock when exitingChristopher Faylor
due to a signal.
2011-10-28 * new-features.sgml (ov-new1.7.10): Document getgrouplist.Corinna Vinschen
2011-10-28 * cygwin.din (getgrouplist): Export.Corinna Vinschen
* grp.cc (get_groups): New static function to run the core functionality of initgroups and getgrouplist. (initgroups32): Call get_groups and just create supplementary group list in cygheap. Rename name of first argument to "user". Add an assertion to test for a NULL user name. (initgroups): Rename name of first argument to "user". (getgrouplist): New function. * posix.sgml (std-bsd): Add getgrouplist. * include/cygwin/grp.h (getgrouplist): Declare. * include/cygwin/version.h: Bump API minor number.
2011-10-26* child_info.h (cchildren): New struct.Christopher Faylor
(child_info_spawn::nchildren): Rename from nprocs. (child_info_spawn::children): Change type to cchildren for more bookkeeping possibilities. (child_info_spawn::child_info_spawn): Clear nchildren. (child_info_spawn::record_children): Declare new function. (child_info_spawn::reattach_children): Ditto. * dcrt0.cc (child_info_spawn::handle_spawn): Call reattach_children to gather list of processes we are potentially waiting for. * pinfo.h (pinfo::pinfo): Make sure that rd_proc_pipe is always cleared. (pinfo::reattach): New function. * sigproc.cc: Move pinfo.h earlier so that it can be used in sigproc.h. (get_proc_lock): Don't bother with a lock during DLL initialization. (proc_subproc): Handle PROC_REATTACH_CHILD. (proc_terminate): Orphan children only when we are not an execed process or when the pid is about to be occupied by a non-cygwin process. (child_info_spawn::record_children): Define new function. (child_info_spawn::reattach_children): Ditto. * sigproc.h (procstuff): Define PROC_REATTACH_CHILD and renumber other elements. * spawn.cc (spawn_guts): Record any to-be-waited-for subprocesses if about to exec a cygwin process. * sigproc.cc (sig_send): Fix harmless transposition of fifth and six arguments to DuplicateHandle(). (child_info::child_info): Ditto. * globals.cc (hExeced): Make NO_COPY.
2011-10-25 * hookapi.cc (hook_or_detect_cygwin): Take additional handleCorinna Vinschen
to a file mapping as parameter. If this handle is not NULL, create another file mapping for the IAT. * spawn.cc (av::fixup): Only map the first 64K of an image and keep the mapping handle to use as argument to hook_or_detect_cygwin. * winsup.h (hook_or_detect_cygwin): Add mapping handle as default parameter in declaration.
2011-10-24 * syscalls.cc (unlink_nt): Fix a bug which overwrites the NT statusCorinna Vinschen
value in case setting the delete disposition returns with STATUS_DIRECTORY_NOT_EMPTY.
2011-10-24 * shared.cc (open_shared): Fix memory reservation of essential sharedCorinna Vinschen
memory regions. Drop delta computations since delta is always 0 in non-relocated case. Add a comment.
2011-10-23* fhandler_tty.cc (fhandler_pty_slave::read): Use consistent way for testingChristopher Faylor
ReadFile return. * pipe.cc (fhandler_pipe::create_selectable): Open the write side of the pipe in message-mode to force writing as "chunks". Explain why.
2011-10-23* path.cc (path_conv::get_nt_native_path): Avoid dereferencing path when it isChristopher Faylor
NULL.
2011-10-22* dtable.cc (dtable::delete_archetype): Improve debugging output.Christopher Faylor
(dtable::init_std_file_from_handle): Close console handle early, before initialization. Build up openflags for passing to open_setup, just to be safe. (last_tty_dev): New variable. (fh_last_tty_dev): New macro. (fh_alloc): Try again to keep track of previously opened tty, this time by just saving the device and using that to potentially open an archetype. Avoid setting the "/dev/tty" name if the creation of the fhandler failed. (build_fh_pc): Remove unused second argument. Reorganize how and where the name is set. Set last_tty_dev as appropriate. Avoid a NULL dereference in a debug printf. * dtable.h (build_fh_pc): Reflect removal of second parameter. * fhandler.cc (fhandler_base::reset): Use new '<<' operator to copy pc since it preserves any potentially previously set name. (fhandler_base::set_name): Ditto. * fhandler.h (fhandler_*::clone): Throughout use ccalloc to allocate new fhandler, primarily to make sure that pc field is properly zeroed. (fhandler_termios::last): Eliminate. (fhandler_termios): Remove setting of last. (fhandler_base::~fhandler_termios): Ditto. * fhandler_console.cc (fhandler_console::open): Don't make decisions about opening close-on-exec handles here since it makes no sense for archetypes. (fhandler_console::init): Assume that input handle has already been opened. * fhandler_termios.cc (fhandler_termios::last): Delete. * path.h (path_conv::eq_worker): New function. Move bulk of operator = here. (operator <<): New function. (operator =): Use eq_worker to perform old functionality.
2011-10-21 * fhandler_disk_file.cc (fhandler_disk_file::rmdir): Check invalidCorinna Vinschen
success only on Samba shares. * mount.cc (fs_info::update): Drop has_buggy_basic_info flag for NcFsd. * syscalls.cc (unlink_nt): Fix typo in comment.
2011-10-21Check in missing ChangeLog entry.Christopher Faylor