summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/sigproc.cc
Commit message (Collapse)AuthorAgeFilesLines
* * sigproc.cc (wait_sig): Make sure that strace is activated on __SIGSTRACE byChristopher Faylor2010-03-311-0/+1
| | | | | | | calling new strace::activate function. * strace.cc (strace::activate): Rename from strace::strace. * strace.h (strace::activate): Define new function. (strace::strace): Call activate.
* * sigproc.cc (no_signals_available): Get sense of the test right for previousChristopher Faylor2010-03-151-1/+1
| | | | botched change.
* * sigproc.cc (no_signals_available): Don't try to send a signal if still inChristopher Faylor2010-03-151-1/+1
| | | | cygwin startup code.
* * spinlock.h: New file.Christopher Faylor2010-03-131-1/+3
| | | | | | | | | | (spinlock): New class. * shared.cc: Include spinlock.h. (memory_init): Use new spinlock methods rather than roll-your-own. Time out after ten seconds if shared_mem_inited is not initialized. * sync.h: Update copyright. Remove vanity attribution. * sigproc.cc (sigproc_terminate): Avoid attempts to kill the signal thread while we're still initializing or suffer a deadlock.
* Throughout change all calls of low_priority_sleep (0) to yield ().Christopher Faylor2010-03-121-2/+2
| | | | | | | | | | * miscfuncs.cc (yield): Rename from low_priority_sleep. Remove all of the logic which called Sleep() and just use SwitchToThread. * miscfuncs.h (yield): Rename from low_priority_sleep. (SLEEP_0_STAY_LOW): Delete unused define. * shared.cc (memory_init): Move heap_init() call directly after shared memory initialization to more closely mimic long-standing program flow. * tty.cc (tty_list::terminate): Replace call to low_priority_sleep with Sleep.
* * sigproc.cc (get_proc_lock): Fix error message typo.Christopher Faylor2010-02-031-1/+1
|
* Throughout, replace hMainProc with GetCurrentProcess/NtCurrentProcessCorinna Vinschen2009-12-181-4/+5
| | | | | | | | | | | | according to context. Throughout, replace hMainThread with GetCurrentThread/NtCurrentThread according to context. * dcrt0.cc (dll_crt0_0): Drop duplication of GetCurrentProcess to hMainProc. Drop duplication of GetCurrentThread to hMainThread. * dtable.cc (dtable::stdio_init): Remove useless comment. * globals.cc (hMainProc): Remove. (hMainThread): Remove. * ntdll.h (NtCurrentProcess): Define. (NtCurrentThread: Define.
* Support pseudo-reloc version 2Charles Wilson2009-10-071-0/+2
|
* * sigproc.cc (stopped_or_terminated): Don't return a match when stopsig ==Christopher Faylor2009-08-021-3/+4
| | | | | SIGCONT and not WCONTINUED. * termios.cc (tcsetpgrp): Improve debugging output.
* * sigproc.h (wait_for_sigthread): Eliminate parameter.Christopher Faylor2009-07-241-13/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sigproc.cc (wait_for_sigthread): Ditto. Don't synchronize with wait_sig after receiving an event that it is ready to go. (init_sig_pipe): New function. (wait_sig): Call init_sig_pipe to create pipes for communicating signals to this process. Don't send sigCONT signal when initializing. * fork.cc (frok::child): Accommodate wait_for_sigpipe parameter change. * fhandler.h (fhandler_*::write): Make ssize_t/__stdcall. (fhandler_*::write_overlapped): Ditto. (fhandler_*::raw_write): Ditto. (fhandler_*::readv): Ditto. (fhandler_*::writev): Ditto. (fhandler_*::raw_read): Make __stdcall. * fhandler: Accommodate changes to read/write functions throughout. * fhandler_clipboard.cc: Ditto. * fhandler_console.cc: Ditto. * fhandler_dsp.cc: Ditto. * fhandler_fifo.cc: Ditto. * fhandler_mailslot.cc: Ditto. * fhandler_mem.cc: Ditto. * fhandler_mem.cc: Ditto. * fhandler_random.cc: Ditto. * fhandler_tape.cc: Ditto. * fhandler_tty.cc: Ditto. * fhandler_virtual.cc: Ditto. * fhandler_windows.cc: Ditto. * fhandler_zero.cc: Ditto. * syscalls.cc (readv): Use ssize_t as temp variable. * fhandler.cc (fhandler_base::read): Coerce returned len to signed or it will never be treated as < 0. (fhandler_base::wait_overlapped): Minimize calls to GetLastError. Remove duplicate debugging test. Fix error return. * fhandler.h (fhandler_fifo::fifo_name): Declare new function. (fhandler_fifo::close): Ditto. (fhandler_fifo::dup): Ditto. (fhandler_fifo::close_on_exec): Ditto. * fhandler.cc (fhandler_fifo::fifo_name): Define new function. (FIFO_BUF_SIZE): New define. (cnp): Ditto. (fhandler_fifo::open): Rework. Use cnp to open named pipe. Always open write side as a client. Open dummy client when writing and can't connect. (wait): Rework. Implement fifo_wait_for_next_client. Handle signals during connect better. Add new fifo_wait_for_server code which polls (sigh) waiting for server. (fhandler_fifo::raw_read): Handle transition states when one client closes and another is available. (fhandler_fifo::close): Define. (fhandler_fifo::dup): Ditto. (fhandler_fifo::close_on_exec): Ditto.
* * exceptions.cc (sig_handle_tty_stop): Set stopsig to SIGCONT when continuing.Christopher Faylor2009-07-181-2/+5
| | | | | | | | (stopped_or_terminated): Honor WCONTINUED. * wait.cc (wait4): Ditto. * include/cygwin/wait.h (WCONTINUED): Define. (__W_CONTINUED): Ditto. (WIFCONTINUED): Ditto.
* * Makefile.in: Don't do anything special with any RCS directories.Christopher Faylor2009-07-121-1/+1
| | | | | | * ntdll.h (PROCESSINFOCLASS): Remove unneeded trailing comma. * pinfo.cc (_pinfo::dup_proc_pipe): Remove unneeded assignment. * sigproc.cc (sig_send): Don't send signal to myself if this is an exec stub.
* * fhandler.cc (fhandler_base::wait_overlapped): Honor nonblocking flag forChristopher Faylor2009-06-141-2/+2
| | | | | | writes. Don't reset event handle when we see a ERROR_IO_PENDING. * sigproc.cc (stopped_or_terminated): Use bool constants for consistency. * wait.cc (wait4): Remove nonsensical comment.
* Remove unneeded header files from source files throughout.Christopher Faylor2008-04-071-8/+0
|
* Add miscfuncs.h to files as needed throughout.Christopher Faylor2008-04-071-0/+1
| | | | | | | | | | | | * mount.cc: New file. * path.cc: Move mount-specific stuff into mount.cc. Move common stuff into miscfuncs.cc. Remove unneeded includes. * miscfuncs.cc: Move some common path functions here. * miscfuncs.h: New file. * winsup.h: Move miscelleneous functions to miscfuncs.h. * dcrt0.cc: Remove unneeded includes. * Makefile.in (DLL_OFILES): Add mount.o. * include/cygwin/config.h: Fix a minor typo.
* * Fix copyright dates.Corinna Vinschen2008-04-011-1/+1
|
* * hookapi.cc (find_first_notloaded_dll): New function.Christopher Faylor2008-03-271-0/+3
| | | | | | | | | | | | | | * pinfo.cc (status_exit): New function. Issue message when dll not found. Use find_first_notloaded_dll to find a nonexistent dll. (pinfo::maybe_set_exit_code_from_windows): Call status_exit when exit code >= 0xc0000000UL. * sigproc.cc (child_info::proc_retry): Return exit code when STATUS_DLL_NOT_FOUND. * spawn.cc (spawn_guts): Minor cleanup. * syscalls.cc (close_all_files): Don't actually close stderr filehandle. Just make it noninheritable. * winsup.h (find_first_notloaded_dll): Declare new function. * ntdll.h: Add several missing NTSTATUS defines.
* * cygtls.h (_cygtls::handle_threadlist_exception): Eliminate.Christopher Faylor2008-03-011-1/+0
| | | | | | | | (_cygtls::init_threadlist_exceptions): Ditto. * cygtls.cc (_cygtls::handle_threadlist_exception): Eliminate. (_cygtls::init_threadlist_exceptions): Ditto. (_cygtls::find_tls): Use myfault handling to deal with errors caused by nonexistent threads.
* * sigproc.cc (sig_send): Use sigmask of target thread if it is specifiedChristopher Faylor2008-02-191-2/+2
| | | | otherwise default to main sigmask.
* Perform whitespace cleanup throughout.Christopher Faylor2008-02-151-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dcrt0.cc (signal_shift_subtract): Eliminate ancient backwards compatibility. (check_sanity_and_sync): Ditto. * winsup.h (SIGTOMASK): Ditto. Just use constant in signal calculation. * include/cygwin/version: Remove backwards signal mask compatibility define. * path.cc (symlink_info::check_sysfile): Cosmetic change. * registry.cc (get_registry_hive_path): Remove unneeded variable. * exceptions.cc (handle_sigsuspend): Eliminate thread signal mask and use either main sigmask or current thread sigmask. (set_process_mask): Ditto. (sighold): Ditto. (sigrelse): Ditto. (sigset): Ditto. (set_process_mask_delta): Ditto. (_cygtls::call_signal_handler): Ditto. * fhandler_process.cc (format_process_status): Ditto. * fhandler_termios.cc (fhandler_termios::bg_check): Ditto. * pinfo.h (class pinfo): Ditto. * select.cc (pselect): Ditto. * signal.cc (sigprocmask): Ditto. (abort): Ditto. (sigpause): Ditto. (sigsend): Ditto. (wait_sig): Ditto. * thread.h (pthread::parent_tls): New member. * thread.cc (pthread::pthread): Record parent_tls here. (pthread::thread_init_wrapper): Initialize sigmask from parent thread.
* Change many cygheap allocation routines to their *_abort analogs.Christopher Faylor2007-11-261-1/+1
| | | | | | * cygheap.cc (cmalloc_abort): New function. (crealloc_abort): Ditto. (ccalloc_abort): Ditto.
* * init.cc (in_dllentry): Delete.Christopher Faylor2007-07-141-1/+1
| | | | | | | (dll_entry): Remove assignment to deleted variable. * winsup.h (in_dllentry): Delete declaration. * exceptions.cc (inside_kernel): Use another method to see if we are in dll_entry phase.
* Remove extraneous whitespace.Christopher Faylor2007-02-201-1/+1
| | | | | | * pinfo.cc (commune_process): Use default argument to lock_process. * sigproc.cc: Update copyright. * select.cc: Ditto.
* * sigproc.cc (child_info::child_info): Set msv_count to non-zeroCorinna Vinschen2007-01-301-3/+3
| | | | value only on systems requiring it.
* Revert erroneous checkin.Corinna Vinschen2006-12-121-1/+0
|
* * Makefile.in (DLL_OFILES): Add minires-os-if.o and minires.o.Corinna Vinschen2006-12-111-0/+1
| | | | | | | | | | | | | | | | | (SUBLIBS): Add libresolv.a. Add rule for libresolv.a. * autoload.cc: Fix return code handling for IP Helper API in case of being unable to load iphlpapi.dll. (DnsQuery_A): Define. (DnsRecordListFree): Define. * cygwin.din: Export resolver functions. * include/resolv.h: New header. * include/arpa/nameser.h: New header. * include/arpa/nameser_compat.h: New header. * include/cygwin/version.h: Bump API minor number. * libc/minires-os-if.c: New file. * libc/minires.c: New file. * libc/minires.h: New file.
* * sigproc.cc (child_info::child_info): Move old comment about msv_count here.Christopher Faylor2006-12-111-0/+23
| | | | Edit it slightly to reflect new sensibilities.
* * child_info.h (child_info_spawn::__stdin): New element.Christopher Faylor2006-12-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (child_info_spawn::__stdin): Ditto. (CURR_CHILD_INFO_MAGIC): Regenerate. * dcrt0.cc (check_sanity_and_sync): Minor cleanup. (child_info_spawn::handle_spawn): Handle new __std* elements by calling move_fd. * dtable.cc (dtable::move_fd): Define new function. * dtable.h (dtable::move_fd): Declare new function. * fhandler.h (fhandler_pipe::popen_pid): Declare new element. * fhandler.h (fhandler_pipe::get_popen_pid): Define new function. * fhandler.h (fhandler_pipe::set_popen_pid): Ditto. * pipe.cc (fhandler_pipe::fhandler_pipe): Zero popen_pid. (fhandler_pipe::dup): Ditto. * spawn.cc (handle): Change second argument to bool. (spawn_guts): Accept __stdin/__stdout arguments and set them appropriately in child_info structure and in STARTUPINFO structure. * syscalls.cc (popen): New cygwin-specific implementation using spawn. (pclose): Ditto. * winsup.h (spawn_guts): Accommodate new arguments for spawn_guts. * fhandler.cc (fhandler_base::set_no_inheritance): Make second arg a bool. * fhandler.h (fhandler_base::set_no_inheritance): Ditto for declaration. * child_info.h (child_info::msv_count): Rename from the now-inappropriate "zero". (child_info_spawn::filler): Add filler to work around Vista bug. (child_info_fork::filler): Ditto. * dcrt0.cc (get_cygwin_startup_info): Remove "zero" check since it is now always filled out. * fork.cc (frok::parent): Move ch.zero manipulation to constructor. * spawn.cc (spawn_guts): Ditto. Remove _ch wrapper. * sigproc.cc (child_info::child_info): Initialize starter[]. * shared.cc (shared_info::heap_slop_size): Remove noisy system_printfs. * shared_info.h (CURR_SHARED_MAGIC): Regenerate.
* * sigproc.cc (waitq_head): Don't initialize to zero.Christopher Faylor2006-07-141-1/+1
| | | | * sigproc.h: Update copyright, fix whitespace.
* * fhandler.cc (fhandler_base::raw_read): Only return EISDIR when we're reallyChristopher Faylor2006-07-131-4/+4
| | | | | trying to read a directory. * sigproc.cc: Use "Static" where appropriate.
* * sigproc.cc (child_info::proc_retry): Mask all of the bits we're interestedChristopher Faylor2006-05-291-1/+1
| | | | in, which includes bits above and below 0xc0000000.
* * child_info.h (_CI_SAW_CTRL_C): New enum.Christopher Faylor2006-05-221-0/+3
| | | | | | | | | | | | | | | | | (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.
* * sigproc.cc (no_signals_available): Detect hwait_sig == INVALID_HANDLE_VALUE.Christopher Faylor2006-05-161-2/+2
| | | | | | | | | | | | | | | | | (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.
* * sigproc.cc (wait_for_sigthread): Use the current user sid when setting up theChristopher Faylor2006-03-301-1/+1
| | | | signal pipe rather than relying on (eventually) the effective sid.
* * dcrt0.cc (child_info_fork::handle_fork): Set uid/gid in myself so that it canChristopher Faylor2006-03-291-9/+8
| | | | | | | | | | | | | | | | be used by subsequent startup functions. (dll_crt0_0): Issue a warning if DuplicateTokenEx fails and DEBUGGING. (dll_crt0_1): Move user_data->{resourcelocks,threadinterface} initialization here from dll_crt0_0. * fork.cc (frok::child): Tell wait_for_sigthread that this is fork. (frok::parent): Only initialize start_time once. Tighten time when we're "deimpersonated". * sigproc.cc (signal_fixup_after_exec): Rework (futiley) sa_buf stuff. Add debugging output. (wait_for_sigthread): Accept an argument which illustrates whether we are forked or not. (wait_sig): Avoid using myself pointer. * winsup.h ((wait_for_sigthread): Reflect change to argument.
* * sigproc.cc (wait_sig): Move myself manipulation...Christopher Faylor2006-03-271-8/+5
| | | | (wait_for_sigthread): ...to here.
* * sigproc.cc (sigalloc): Don't set SA_RESTART here.Christopher Faylor2006-03-231-4/+0
| | | | | | | | | | | * signal.cc (_SA_NORESTART): New flag. (sigaction_worker): New function, derived from sigaction. Don't set internal flags unless called internally. (sigaction): Use sigaction_worker. (signal): Honor new _SA_NORESTART flag. (siginterrupt): Set _SA_NORESTART flag appropriately. Use sigaction_worker to set flags. * include/cygwin/signal.h: Define _SA_INTERNAL_MASK here.
* * fhandler.cc (fcntl): Print flags in hex.Christopher Faylor2006-03-221-19/+19
| | | | | | | | | | | | | | * dcrt0.cc (dll_crt0_0): Semi-revert 2006-03-14 change which moved pinfo_init and uinfo_init here. (dll_crt0_1): Ditto. (__dll_crt0): Ditto. Don't call update_envptrs here. (dll_crt0_1): Ditto. Move wait_for_sigthread call here from dll_crt0_0. * environ.cc (environ_init): Call it here instead. * sigproc.cc (my_readsig): New static variable. (wait_for_sigthread): Set up read pipe here since we are assured that we have the proper privileges when this is called. (talktome): Eliminate second argument since it is available as a global now. (wait_sig): Reflect use of my_readsig.
* * signal.cc (signal): Don't set SA_RESTART here.Christopher Faylor2006-03-221-0/+4
| | | | | (siginterrupt): White space. * sigproc.cc (sigalloc): Set SA_RESTART here, on initialization.
* * child_info.h (child_status): Fix typo which made it impossible to setChristopher Faylor2006-03-221-6/+6
| | | | | | | | | | iscygwin. (child_info::isstraced): Booleanize. (child_info::iscygwin): Ditto. * sigproc.cc (child_info::child_info): Minor cleanup of flag setting. * spawn.cc (spawn_guts): Only close_all_files when we know the process has started successfully. * exceptions.cc (init_console_handler): Fix indentation.
* * child_info.h (child_status): New enum.Christopher Faylor2006-03-201-2/+6
| | | | | | | | | | | | | | | | | (child_info::flag): Rename from 'straced'. (child_info::isstraced): New function. (child_info::iscygwin): Ditto. (child_info_fork::handle_fork): Reparmize. (child_info_fork::handle_failure): Ditto. (child_info_spawn::handle_spawn): New function. * dcrt0.cc (get_cygwin_startup_info): Use isstraced method. (child_info_spawn::handle_spawn): Define new function from code previously in dll_crt0_0. (dll_crt0_0): Move spawn stuff into handle_spawn. Only call init_console_handler for fork case. * sigproc.cc (child_info::child_info): Set flag appropriately. (child_info::proc_retry): Treat exit code as "funny" if it's a cygwin process. * spawn.cc (spawn_guts): Remove commented out flag setting.
* revert previous debugging checkinChristopher Faylor2006-03-201-8/+4
|
* * pinfo.cc (commune_process): Fix randomly invalid pointer which caused fifosChristopher Faylor2006-03-201-4/+8
| | | | to work incorrectly.
* * pinfo.h (EXITCODE_OK): Define new constant.Christopher Faylor2006-03-181-1/+3
| | | | | | | * sigproc.cc (child_info::sync): Return EXITCODE_OK if entering with exit_code == 0. (sig_send): Don't complain if sending signals while blocked if the sender isn't in the main thread.
* * child_info.h (CURR_CHILD_INFO_MAGIC): Regenerate.Christopher Faylor2006-03-181-3/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (child_info::retry): Move here from fork subclass. (child_info::exit_code): New field. (child_info::retry_count): Max retry count for process start. (child_info::proc_retry): Declare new function. (child_info_fork::retry): Move to parent. (child_info_fork::fork_retry): Ditto. * dcrt0.cc (child_info::fork_retry): Rename and move. (child_info_fork::handle_failure): Move. (dll_crt0_0): Initialize console handler based on whether we have a controlling tty or not. Avoid nonsensical check for fork where it can never occur. * environ.cc (set_proc_retry): Rename from set_fork_retry. Set retry_count in child_info. (parse_thing): Reflect above change. * exceptions.cc (dummy_ctrl_c_handler): Remove unused variable name. (ctrl_c_handler): Always return TRUE for the annoying CTRL_LOGOFF_EVENT. * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Remove call to init_console_handler. * fhandler_tty.cc (fhandler_tty_slave::open): Just call mange_console_count here and let it decide what to do with initializing console control handling. * fork.cc (fork_retry): Remove definition. (frok::parent): Define static errbuf and use in error messages (not thread safe yet). Close pi.hThread as soon as possible. Protect pi.hProcess as soon as possible. Don't set retry_count. That happens automatically in the constructor now. Accommodate name change from fork_retry to proc_retry. * init.cc (dll_entry): Turn off ctrl-c handling early until we know how it is supposed to be handled. * pinfo.cc (_pinfo::dup_proc_pipe): Remember original proc pipe value for failure error message. Tweak debug message slightly. * sigproc.cc (child_info::retry_count): Define. (child_info::child_info): Initialize retry count. (child_info::sync): Set exit code if process dies before synchronization. (child_info::proc_retry): Rename from child_info_fork::fork_retry. Use previously derived exit code. Be more defensive about what is classified as an error exit. (child_info_fork::handle_failure): Move here from dcrt0.cc. * spawn.cc (spawn_guts): Maintain error mode when starting new process to avoid annoying pop ups. Move deimpersonate call within new loop. Move envblock freeing to end. Loop if process dies prematurely with bad exit code. * syscalls.cc (init_console_handler): Remove hopefully unneeded call to init_console_handler.
* * child_info.h (child_info_fork::fork_retry): Declare new function.Christopher Faylor2006-03-151-1/+1
| | | | | | | * dcrt0.cc (child_info_fork::fork_retry): Define new function. * fork.cc (frok::parent): Move retry decision into child_info_fork::fork_retry and honor what it tells us to do. * sigproc.cc (sig_send): Unhold signals on __SIGEXIT.
* * dcrt0.cc (main_environ): Initialize to &__cygwin_environment.Christopher Faylor2006-03-141-4/+4
| | | | | | | | | | | (dll_crt0_1): Move resourcelocks, thread interface, pinfo_init, and uinfo_init... (dll_crt0_0): ...to here. (_dll_crt0): Call update_envptrs here after setting main_environ. * environ.cc (environ_init): Eliminate initted variable. Don't call update_envptrs here. * sigproc.cc (wait_sig): Use my_sendsig when calling CreatePipe to avoid a dereference.
* * child_info.h (child_info_fork::handle_failure): Declare new function.Christopher Faylor2006-03-131-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | (child_info_fork::retry): New field. * dcrt0.cc (__api_fatal_exit_val): Define. (child_info_fork::handle_failure): Define new function. (__api_fatal): Exit using __api_fatal_exit_val value. * environ.cc (set_fork_retry): Set fork_retry based on CYGWIN environment variable. (parse_thing): Add "fork_retry" setting. * fork.cc (fork_retry): Define. (frok::parent): Reorganize to allow retry of failed child creation if child signalled that it was ok to do so. * heap.cc (heap_init): Signal parent via handle_failure when VirtualAlloc fails. * pinfo.h (EXITCODE_RETRY): Declare. * sigproc.cc (child_info::sync): Properly exit with failure condition if called for fork and didn't see subproc_ready. * spawn.cc (spawn_guts): Use windows pid as first argument. * winsup.h: Remove obsolete NEW_MACRO_VARARGS define. (__api_fatal_exit_val): Declare. (set_api_fatal_return): Define. (in_dllentry): Declare. * exceptions.cc (inside_kernel): Remove unneeded in_dllentry declaration.
* * dcrt0.cc (dll_crt0_0): Reorganize so that sigproc_init is called a littleChristopher Faylor2006-03-131-11/+10
| | | | | | | | | | | | later. Add a comment. * fork.cc (resume_child): Make void. (frok::parent): Only zero pi when necessary. Explicitly zero si. Set this_errno when child_copy fails. Accommodate change to resume_child. * sigproc.cc (sigalloc): Move global_sigs initialization here. (sigproc_init): Move global_sigs. (sig_send): Just check for flush signals once. * wincap.h: Define supports_setconsolectrlhandler_null throughout. * wincap.cc: Ditto.
* * cygtls.h (CYGTLS_INITIALIZED): Change to a little more unlikely value.Christopher Faylor2006-03-121-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | (CYGTLSMAGIC): Delete. * dcrt0.cc (dll_crt0_0): Call sigproc_init during init startup. (_dll_crt0): Don't worry about sync_startup. Just wait for sigthread here. * dll_init.cc (cygwin_detach_dll): Only pick up tls version of retaddr if we have a valid tls. * fork.cc (frok::child): Remove sigproc_init initialization since it happens much earlier now. * gendef: Recognize SIGFE_MAYBE. (fefunc): Generate calls to _sigfe_maybe, if appropriate. (_sigfe_maybe): New function. * init.cc (search_for): Always initialize search_for, even on fork. (calibration_thread): Delete. (calibration_id): Delete. (prime_threads): Delete. (munge_threadfunc): Remove calibration_thread special case. Avoid calling thread function if we haven't yet hit the "search_for" thread. (dll_entry): Remove prime_threads call. Only call munge_threadfunc when hwait_sig is active. Ditto. for _my_tls.remove (); * sigproc.cc (hwait_sig): Make global. (sigproc_init): Don't bother with sync_startup. (sig_send): Treat flush as a no-op when signals are held. (wait_sig): Cause signals to be held after fork.