summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/sigproc.cc
Commit message (Collapse)AuthorAgeFilesLines
* * sigproc.h (class sigframe): Implement 'unregister()' method.Christopher Faylor2001-04-011-3/+3
| | | | | | | | | | | | | (sigframe::~sigframe): Use unregister method. (sigframe::call_signal_handler): Declare new method. * exceptions.cc (sigframe::call_signal_handler): New method. Unregisters current sigframe before calling signal handler. (setup_handler): Clear waiting threads prior to arming signal_arrived. * syscalls.cc (_read): Change goto to loop. Recalculate sigframe inside of loop so that constructor is called when appropriate. * wait.cc (wait4): Ditto. * signal.cc: Change "sig" to "signal" in debugging messages throughout. * sigproc.cc: Ditto.
* * shortcut.c (PATH_ALL_EXEC): Add parentheses to avoid a compiler warning.Christopher Faylor2001-03-101-30/+14
| | | | | | | | | | | | * exceptions.cc (setup_handler): Clarify debugging message. * sigproc.cc (proc_subproc): Remove PROC_CHILDSTOPPED test. It is handled by normal PROC_CLEARWAIT case. (wait_sig): Eliminate "dispatched" tracking. Remove __SIGCHILDSTOPPED test. Decrement counter again before jumping out of InterlockedDecrement loop so that subsequent InterlockedIncrement will keep the counter at the correctly decremented value and also detect when there are pending signals. * sigproc.h: Remove __SIGCHILDSTOPPED element. (procstuff): Remove PROC_CHILDSTOPPED element.
* * sigproc.cc (getsem): Make semaphore always non-inheritable.Egor Duda2001-02-211-1/+1
|
* * fork.cc (fork_parent): Return EAGAIN when can't record pid.Christopher Faylor2001-02-101-1/+4
| | | | | * pinfo.h (pinfo::remember): Return value of call to proc_subproc. * sigproc.cc (proc_subproc): Return error if can't record pid.
* Throughout, change 'cygwin_shared.mount' to 'mount_table'.Christopher Faylor2001-01-281-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * child_info.h (child_info): Move shared_h, console_h to cygheap. Add mount_h. * cygheap.h (init_cygheap): Add shared_h, console_h. * cygheap.cc (init_cheap): Initialize heap at a fixed location after the shared memory regions. Initialize cygheap->user name here. * dcrt0.cc (dll_crt0_1): Call getpagesize () to initialize constants. Remove cygheap_init since it is done in shared_init now. (_dll_crt0): Initialize mount_h, remove shared_h and console_h initialization. * fhandler_console.cc (console_shared_h): Eliminate. (get_tty_stuff): Use cygheap->console_h rather than console_shared_h. * heap.cc (heap_init): Use page size constant calculated earlier in initialization. * shared.cc: Eliminate cygwin_shared_h. Add cygwin_mount_h. (mount_table_init): New function for initializing a user mount table. (open_shared_file_map): Use constant for shared memory region. Initialize cygheap and mount table here. (open_shared): Improve debugging output. (shared_info::initialize): Eliminate call to mount.init. (shared_terminate): Use cygheap->shared_h. Close cygwin_mount_h. (open_shared_file_map): Eliminate. * shared_info.h (mount_info): Add a version field. (shared_align_past): New macro for calculating location for shared memory regions. * sigproc.cc (init_child_info): Eliminate shared_h, console_h. * spawn.cc (spawn_guts): Pass on cygwin_mount_h iff not a different user. * syscalls.cc (system_info): New global holding system memory defaults. (getpagesize): Use system_info. * uinfo.cc (internal_getlogin): Only fill in user name if nonexistent. * winsup.h: Declare system_info. * passwd.cc (read_etc_passwd): Use cygheap->user.name () rather than retrieving the name again.
* * autoload.cc (LoadDLLinitfunc): Remove debugging statement.Christopher Faylor2001-01-171-2/+2
| | | | | | | | | | | | | | | | | | * exceptions.cc (sig_handle_tty_stop): Move setting of PID_STOPPED to earlier in interrupt. ((interrupt_setup): i.e., here. (sig_handle): Don't queue multiple SIGSTOPS. * fhandler.h (bg_check_types): Enumerate return value of bg_check for clarity. * signal.cc (kill_pgrp): Minor cleanup. * fhandler_termios.cc (fhandler_termios::bg_check): Use enumerated type for function return. Don't raise signal if a signal is already queued. * fhandler_console.cc (fhandler_console::read): Use enumerated return type for bg_check. * select.cc: Ditto, throughout. * read.cc: Ditto, throughout. * termios.cc: Ditto, throughout. (_read): YA interrupt detect simplification. * wait.cc (wait4): Ditto.
* * debug.h: Add regparm attributes to some functions.Christopher Faylor2001-01-121-0/+1
| | | | | | | | | | | | * signal.cc (sigaction): Don't treat SIGCONT specially. * exceptions.cc (interrupt_setup): Save sa_flags of interrupted signal for later use. (sig_handler): Default any stopping signal to SIGSTOP. (call_signal_handler): New function. (sigdelayed0): New function. * sigproc.cc (sigproc_init): Initialize SIGSTOP sigaction for special behavior. * sigproc.h: Define call_signal_handler. * syscalls.cc (_read): Allow restartable signal behavior.
* * sigproc.cc (wait_sig): Allow SIGCONT when stopped.Christopher Faylor2001-01-101-1/+1
|
* * pinfo.cc (codepage_init): Move function.Christopher Faylor2001-01-081-2/+2
| | | | | | | | | * environ.cc (codepage_init): To here. * exceptoins.cc (SIG_NONMASKABLE): Remove SIGCONT from consideration since it is supposed to be maskable. * signal.cc (sigaction): Ditto. * sigproc.cc (wait_sig): Ditto. * winsup.h: Eliminate global declaration of codepage_init.
* * sigproc.cc (wait_sig): Remove unneeded for loop iteration.Christopher Faylor2000-11-161-15/+4
| | | | | | | | | | | * exceptions.cc (interrupt_setup): Don't set signal mask here or races occur with main thread. Set it in sigdelayed instead. (sigreturn): Reflect change in stack order of ebp and flags. (sigdelayed): Set stack frame correctly. Call set_process_mask here with flags for last trapped signal. (signal_dispatch): Add newmask. * sigproc.cc (wait_sig): Eliminate ill-considered attempt to halt looping signal processors.
* * cygheap.h: Move `token' and `impersonated' from class _pinfoCorinna Vinschen2000-11-151-2/+0
| | | | | | | | | | | | | to class cygheap_user. * pinfo.h: Ditto. * fork.cc (fork_child): Change usage of `token' and `impersonated' accordingly. (fork_parent): Ditto. * security.cc (cygwin_set_impersonation_token): Ditto. * sigproc.cc (proc_subproc): Ditto. * spawn.cc (spawn_guts): Ditto. * syscalls.cc (seteuid): Ditto. * uinfo.cc (uinfo_init): Ditto.
* Throughout use myself->ppid_handle rather than parent_alive.Christopher Faylor2000-11-151-11/+7
| | | | | | | | | | | | | | | | * child_info.h (child_info): Eliminate parent_alive. * dcrt0.cc (dll_crt0_1): Call fork_init for debugging pid creation. * fork.cc (fork_child): Reflect change to fixup_mmaps_after_fork arguments. (slow_pid_reuse): New function to grab last 'n' pids to prevent pid reuse. (fork_parent): Move last_fork_proc into slow_pid_reuse. Handle fork_pids debugging. Eliminate unnecessary call to set_child_mmap_ptr. (fork_init): New debugging function. * mmap.cc (fixup_mmaps_after_fork): Renamed from recreate_mmaps_after_fork. Rely on copied data after a fork. (set_child_mmap_ptr): Eliminate. * pinfo.h (_pinfo): Eliminate parent_alive, mmap_ptr and reflect above changes. * spawn.cc (spawn_guts): Eliminate vestiges of "old way" of sending new hProc to parent process.
* * cygheap.cc (cygheap_root::cygheap_root): New function.Corinna Vinschen2000-11-151-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (cygheap_root::~cygheap_root): Ditto. (cygheap_root::operator=): Ditto. (cygheap_user::~cygheap_user): Ditto. (cygheap_user::set_name): Ditto. (cygheap_user::set_logsrv): Ditto. (cygheap_user::set_domain): Ditto. (cygheap_user::set_sid): Ditto. * cygheap.h (cygheap_root): New class. (cygheap_user): Ditto. (init_cygheap): Change type of `root' member to cygheap_root. Add `user' member. * dir.cc (opendir): Use new `cygheap_root' class. * dcrt0.cc (dll_crt0_1): Use new `cygheap_user' class. * fork.cc (fork_parent): Ditto. * grp.cc (getgroups): Ditto. * passwd.cc (search_for): Ditto. * path.cc: Use new `cygheap_root' class throughout. * pinfo.h (_pinfo): Remove `use_psid'. Move `username', `psid', `logsrv', `domain', `orig_{uid,gid}' and `real_{uid,gid}' to cygheap_user class. * security.cc: Use new `cygheap_user' class throughout. * shared.cc (sec_user): Ditto. * sigproc.cc (proc_subproc): Remove copy statements for user related information moved to `cygheap_user' class. * spawn.cc (spawn_guts): Invalidate current chroot settings when creating Windows environment. Use new `cygheap_user' class. * syscalls.cc: Use new `cygheap_user' class throughout. * uinfo.cc: Ditto. * uinfo.cc (internal_getlogin): Change parameters to reflect the move of user information to cygheap.
* * cygheap.h (init_cygheap): New struct holding values that live in the CygwinChristopher Faylor2000-11-141-3/+0
| | | | | | | | | | | | | | | | | | | | | heap. * child_info.h (child_info): Change pointer type of cygheap to init_cygheap. * cygheap.cc (init_cheap): Point cygheap_max after contents of cygheap. Move some stuff into cygheap.h. * dir.cc (opendir): Change to use root and rootlen in cygheap rather than in myself. (mkdir): Change to use umask in cygheap rather than in myself. * path.cc: Ditto, throughout. * syscalls.cc (_open): Ditto. Change to use umask in cygheap rather than in myself. (chroot): Change to allocate root dir on the cygwin heap. (umask): Change to use umask in cygheap rather than in myself. (cygwin_bind): Ditto. * sigproc.cc (proc_subproc): Don't copy umask or root stuff as this happens automatically now. * pinfo.h (_pinfo): Migrate stuff out of here and into init_cheap. * dcrt0.cc (dll_crt0_1): Call cygheap_init later in startup for first cygwin process.
* * dcrt0.cc (sigthread::init): Reinstitute sigthread lock as a critical section.Christopher Faylor2000-11-061-0/+1
| | | | | | | | | | | | (dll_crt0_1): Move sigthread lock initialization to earlier in startup. * exceptions.cc (interrupt_on_return): Remove previous kludgy attempt to detect an invalid frame. (call_handler): Eliminate inner for loop. Grab signal critical section lock where appropriate. * sigproc.cc (proc_subproc): Restore uid setting. * sigproc.h (sigthread): Reinstitute sigthread lock as a critical section. (sigframe): Grab the sigthread lock before clearing frame to avoid having the signal thread use an invalid frame.
* * child_info.h (child_info): Add pppid_handle for closing the parent's of theChristopher Faylor2000-11-061-7/+48
| | | | | | | | | | | | | | | | | | | | | | | parent handle. * dcrt0.cc (_dll_crt0): Close parent's parent handle when spawned or forked. * debug.cc (add_handle): Correct erroneous reference to handle structure when printing warning. * exceptions.cc (interrupt_now): Always return 1. (interrupt_on_return): Accept a sigthread argument. Check to see if this argument has been trashed prior to setting up the stack return. (call_handler): Add a loop around attempts to dispatch signals to detect case where interrupt_on_return fails. (_sigdelayed): Set up a temporary frame pointer prior to calling stuff that could trigger an interrupt or the stack walking code will be very confused. * fork.cc (fork_parent): Move a lot of the setup of the child process into proc_subproc. * spawn.cc (spawn_guts): Ditto. Use ppid_handle to contact logical parent when reparenting. * pinfo.h (_pinfo): Remember the logical handle of the parent process. * sigproc.cc (proc_subproc): Record most stuff necessary for the _pinfo structure that is inferrable from myself when adding children. (wait_sig): Always set 'pending_signals' flag when about to kick off the signal scanning loop. Reset it only if there are no pending signals.
* * pinfo (wait_subproc): Son of neverending debug tweaking.Christopher Faylor2000-11-051-2/+5
|
* * pinfo (wait_subproc): Neverending debug tweaking.Christopher Faylor2000-11-051-3/+3
|
* * exceptions.cc (handle_sigsuspend): Record frame here for signalling.Christopher Faylor2000-11-051-6/+5
| | | | (set_process_mask): Ditto.
* * sigproc.cc (wait_subproc): Still more debugging cleanup.Christopher Faylor2000-11-041-3/+3
|
* * pinfo.cc (EnumProcessesNT): Avoid 0 pids.Christopher Faylor2000-11-041-23/+14
| | | | | | | | | | (EnumProcesses9x): Ditto. * sigproc.cc (remove_childe): Eliminate. (proc_subproc): Move remove_child stuff here. (wait_subproc): Synchronize with proc_subproc when error occurs. Add more debugging info. * sigproc.h (procstuff): Add an entry. * spawn.cc (spawn_guts): Add sigframe here.
* * sigproc.cc (wait_subproc): Refine debug output.Christopher Faylor2000-11-041-3/+6
|
* * pinfo.cc (pinfo::init): Reverse order of setting status and pid info in anChristopher Faylor2000-11-031-2/+4
| | | | | | | | execed process to avoid a race. * sigproc.cc (wait_subproc): Print more info when a WFSO error occurs. * automode.c: New file. * syscalls.cc (close_all_files): Streamline slightly. * cygheap.cc (ccalloc): Clear *entire* allocated array.
* * sigproc.cc (wait_sig): Add braces to avoid confusion.Christopher Faylor2000-10-271-4/+6
|
* * sigproc.cc (proc_subproc): Don't send a false positive if WNOHANG and noChristopher Faylor2000-10-231-1/+1
| | | | processes are available for waiting.
* * sigproc.cc (proc_subproc): Correctly handle flags for WNOHANG case.Christopher Faylor2000-10-231-2/+2
|
* * exceptions.cc (call_handler): Make signal pending if sigsave.sig is stillChristopher Faylor2000-10-181-1/+1
| | | | | | | | | | active. * syscalls.cc (_read): Don't clear errno. * sigproc.cc (wait_sig): Don't scan the waiting process list after a SIGCHLD if there are no zombies to reap. * winsup.h: Use __builtin_strcmp. * environ.cc (posify): Don't initialize len unless it is required (from DJ Delorie <dj@redhat.com>).
* * sigproc.cc (proc_subproc): Remove unneeded test for correct process inChristopher Faylor2000-10-171-12/+7
| | | | | | PROC_ADDCHILD. Return 0 when terminated child has just been reparented. (wait_subproc): Only send SIGCHLD when proc_subproc returns != 0. * strace.cc (strace::vsprntf): Only strip .exe extension from program name.
* * debug.cc (add_handle): Issue warning on attempts to add the same handle moreChristopher Faylor2000-10-171-1/+0
| | | | | | | | | | | | than once. * fhandler_tty.cc (fhandler_tty_slave::open): Protect some handles. (fhandler_tty_common::close): Use proper name when closing handles. (fhandler_pty_master::close): Don't close to_slave or from_slave since they've already been closed earlier in the function. * sigproc.cc (proc_subproc): Don't protect vchild->hProcess. Expect that the caller will do this, instead. * tty.cc (tty_list::terminate): Use proper name when closing handles. (tty::make_pipes): Protect some handles.
* * Makefile.in: Remove some obsolete stuff.Christopher Faylor2000-10-161-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dcrt0.cc (dll_crt0_1): Call signal_fixup_after_exec where appropriate. Set myself->uid from parent version. Just use ThreadItem Init method. Close or store hexec_proc as appropriate. (_dll_crt0): Store user_data->forkee here so that proper tests can be made subsequently. (do_exit): Remove hExeced stuff. * environ.cc (environ_init): Accept environ count as well as environ pointer. * environ.h: Reflect above change. * pinfo.cc (pinfo_init): Ditto. Accept environ count. (fixup_in_spawned_child): Remove. * spawn.cc (spawn_guts): Move signal code to dll_crt0_1. Don't suspend execing process since it is no longer necessary. Store envc. * exceptions.cc (signal_fixup_after_exec): New function. (call_handler): Remove hExeced test. * child_info.h (cygheap_exec_info): Store envc as well as envp. (child_info_spawn): Store hexec_proc so that it can be closed in child. * path.cc (normalize_posix_path): Avoid intermediate use of temporary cwd buf. (normalize_win32_path): Ditto. (cwdstuff::get_initial): Always set lock. * sigproc.h: Remove hExeced. * strace.cc (strace::vsprntf): Modify to accomodate for lack of hExeced. * thread.cc (MTinterface::Init): Merge Init1 and ClearReent into this method. (MTinterface::Init1): Eliminate. (MTinterface::ClearReent): Eliminate. * thread.h: Reflect above changes. * include/sys/strace.h (strace): Make microseconds() public. Make various functions 'regparm', throughout. * pinfo.h (_pinfo): Inline simple signal manipulation functions. Requires inclusion of thread.h which was removed from .cc files, where appropriate. throughout. * pinfo.cc: Eliminate signal manipulation functions. (_pinfo::exit): Calculate total rusage for exiting process here. * cygheap.cc (size2bucket): Eliminate. (init_buckets): Ditto. (_cmalloc): Calculate size and bits in a loop rather than going through a function call. (_crealloc): Use stored array index to calculate allocated size. * spawn.cc (spawn_guts): Use _pinfo exit method to exit, calculating cpu usage.
* * exceptions.cc (set_console_handler): Don't allocateChristopher Faylor2000-10-151-38/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | console_handler_thread_waiter. It is obsolete. (ctrl_c_handler): Don't use console_handler_thread_waiter. * path.cc (hash_path_name): Fix handling of relative names. Make case insensitive. * path.h (suffix_info): Use initializers. * pinfo.h (_pinfo): Avoid initializers for null case. * resource.cc (fill_rusage): Zero rest of rusage structure. * security.cc (set_process_privileges): Don't reopen parent process. Just use hMainProc. * signal.cc (signal): Track when a signal handler has been used. (sigaction): Ditto. * sigproc.cc (pchildren): Use default initializer. (zombies): Ditto. (sigproc_terminate): Avoid closing handles that will be closed on exit anyway. (wait_sig): Send signal to "parent" on EXECing, not FORKing. (wait_subproc): Send SIGCHLD here rather than in proc_wait to avoid potential muto conflicts. * sigproc.h (sigthread): Don't initialize to zero. It's the default. * spawn.cc (spawn_guts): Fill in resources from exec parent prior to termination. * sync.h (muto): Don't initialize to zero. * syscalls.cc (close_all_files): Use one lock around entire loop and call fhandler close/release stuff directly. (_read): Don't use ready_for_read if there are not signal handlers active. * dcrt0.cc (dll_crt0_1): Fix display of "title". (do_exit): Use pinfo exit method to exit. (__api_fatal): Ditto. * exceptions.cc (signal_exit): Ditto. * fork.cc (fork_child): Remove debugging stuff. Use pinfo_fixup_after fork in place of exec_fixup_after_fork. * pinfo.cc (pinfo_fixup_after_fork): New method. (pinfo_fixup_in_spawned_child): Ditto. (_pinfo::exit): New method. (_pinfo::init): Remove recursion. Detect pathological case where pinfo structure already exists for new pid. * pinfo.h (_pinfo): Reorganize slightly. Add new method and new function declarations. * sigproc.cc (proc_exists): Previous simplification was a little to simple. Try harder to detect if a process exists. (proc_terminate): Use PID_EXITED setting to determine if process is still around. (WFSO): Remove debugging statement. (WFMO): Ditto. * spawn.cc (exec_fixup_after_fork): Eliminate. (spawn_guts): Always set old_title to NULL. Is it really needed? Move hexec_proc to pinfo.cc. Call pinfo_fixup_in_spawned_child to eliminate handle link after a spawn. * include/sys/cygwin.h: Remove PID_NOT_IN_USE. Add PID_EXITED.
* * cygheap.cc (cygheap_fixup_in_child): Don't page round cygheap copied fromChristopher Faylor2000-10-141-65/+11
| | | | | | | | | | | | | | | | | | parent. * dcrt0.cc (do_exit): Don't cleanup pinfo on exit. That happens automatically now. * exceptions.cc (signal_exit): Ditto. * fork.cc (fork_parent): Use stack_here value passed in from fork(). (fork): Figure out top of stack here and pass it to fork_parent. * pinfo.cc (_pinfo::record_death): Eliminate. * pinfo.h (_pinfo): Ditto. * sigproc.cc (proc_exists): Simplify. (proc_terminate): Ditto. (remove_zombie): Don't cleanup pinfo stuff. (wait_sig): Send subproc_ready signal whether execed or spawned. * spawn.cc (spawn_guts): Always create subproc_ready event. Use it for both exec and spawn. (_spawnve): Send proper mode to spawn_guts when mode != _P_OVERLAY.
* * child_info: Bump child_info "version".Christopher Faylor2000-10-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | (child_info): Move some fields from child_info_spawn to here. * cygheap.cc: Make cygheap pointers NOCOPY. * dcrt0.cc (dll_crt0_1): Copy cygwin heap here regardless of whether we've been forked or execed. * dtable.cc (dtable::fixup_after_fork): Just release close-on-exec fds. * exceptions.cc (stackdump): Respond to C warning. * fork.cc: Reorganize to minimize stack copying. (fork_child): New function. (fork_parent): Ditto. (sync_with_child): Don't suspend the forkee. (sync_with_parent): Ditto. Make into a function. * heap.cc (heap_init): Add some debugging output. * path.cc (path_conv::check): Add an assertion. (has_suffix): Ditto. * security.cc (get_pw_sid): Defend against NULL. * sigproc.cc (proc_subproc): Fix debugging output. (wait_sig): Ditto. * strace.cc: Make statics NO_COPY throughout. (strace::vsprntf): Defend against NULL.
* * dtable.cc (set_std_handle): Use std_consts array to control SetStdHandleChristopher Faylor2000-10-091-90/+64
| | | | | | | | | | | | | | | | | | | | | | | settings. (dtable::fixup_after_fork): Ditto. * exceptions.cc (set_sig_errno): Remove some debugging output. * path.cc (path_conv::check): Don't OR need_directory with flags sent to symlink_info::check. (symlink_info::check): Use PATH_ALL_EXEC to determine when a file is executable. * path.h (path_types): Add PATH_ALL_EXEC. (isexec): Use PATH_ALL_EXEC so that cygexec types will be considered executable. * pinfo.h (_pinfo): Add a process handle that is kept open throughout the life of a cygwin pid. * sigproc.cc (proc_exists): Remove hopefully obsolete stuff. (proc_subproc): Set up process handle that is kept open throughout the life of a cygwin pid. Reorganize PROC_WAIT stuff to use common code. (proc_terminate): Close pid lifetime process handle. (checkstate): Cleanup. (stopped_or_terminated): Move zombie cleanup. (remove_zombie): To here. * spawn.cc (spawn_guts): Reorganize reparenting code for 1247th time.
* * exceptions.cc (interruptible): Add extra debugging.Christopher Faylor2000-10-051-0/+1
| | | | | * sigproc.h (wait_sig): Fill in frame pointer, by default, prior to calling or suffer confusion due to September 7 change below.
* * exceptions.cc (handle_exceptions): Just "core dump" if SIGSEGV in signalChristopher Faylor2000-09-161-2/+0
| | | | | | | thread. * external.cc (fillout_pinfo): Fix compiler warning. * sigproc.h: Eliminate special asm naming for sig_dispatch_pending. * sigproc.cc (sig_send): Remove debugging statements.
* * sigproc.h (sigframe::set): Eliminate second argument. Default bp to currentChristopher Faylor2000-09-081-1/+1
| | | | | | | | frame pointer rather than using this within the function, which is unstable when this method is not inlined. * net.cc: Eliminate use of second argument to sigframe.set throughout. * select.cc (cygwin_select): Ditto. * sigproc.cc (sig_send): Ditto.
* Break out more header info into separate files. Use appropriate header filesChristopher Faylor2000-09-081-1/+2
| | | | | | | | | | | | throughout. * shared.h: Remove. * cygwin_version.h: New file. * delqueue.h: New file. * environ.h: New file. * host_dependent.h: New file. * perprocess.h: New file. * registry.h: New file. * security.h: New file.
* Split out tty and shared_info stuff into their own headers and use throughout.Christopher Faylor2000-09-071-0/+2
| | | | | | | | | | | | | | | | | Include sys/termios.h for files which need it. * tty.h: New file. * shared_info.h: New file. * fhandler.h: Move inline methods that rely on tty stuff to fhandler_console.cc. * fhandler_tty.cc (fhandler_pty_master::process_slave_output): Set output_done_event immediately after reading data to speed up tty output processing. (process_output): Set write_error to errno or zero. (fhandler_tty_slave::write): Check previous write error prior to writing to slave end of pipe. This allows tty output to be slightly less synchronous. * fhandler_console.cc (fhandler_console::tcsetpgrp): Moved here from fhandler.h. (fhandler_console::set_input_state): Ditto.
* * sigproc.cc: Add include file for proper definitions.Christopher Faylor2000-09-061-0/+1
| | | | | * spawn.cc: Ditto. * winsup.h: Define cfree to avoid newlib pollution.
* * sigproc.cc (mychild): New function.Christopher Faylor2000-09-021-7/+19
| | | | | (proc_subproc): Use mychild() to determine if a specific pid is valid for wait()ing.
* * sigproc.cc (sigproc_init): Create wait_sig_inited without auto-reset to avoidChristopher Faylor2000-09-011-2/+2
| | | | | potential races. (init_child_info): Avoid unneeded test.
* * sigproc.cc (proc_info): Rename proc_exists which takes a pid to "pid_exists".Christopher Faylor2000-09-011-3/+4
| | | | | | * shared.h: Split out "child_info" stuff into a new header file and use where necessary. Declare pid_exists. * child_info.h: New file.
* * pinfo.h (pinfo): Un-inline release.Christopher Faylor2000-08-261-3/+2
| | | | | | * pinfo.cc (pinfo::release): Move here from pinfo.h. * sigproc.cc (proc_terminate): Remove bogus 'pinfo child' which caused strange destruction of random regions of memory when destructor was invoked.
* * dcrt0.cc (dll_crt0_1): Move set_os_type.Christopher Faylor2000-08-261-0/+5
| | | | | | | | | | | (_dll_crt0): To here. (cygwin_dll_init): And here. * external.cc (fillout_pinfo): Use more foolproof method for scanning for pids. * pinfo.cc (set_myself): Eliminate myself_identity.init. * sigproc.cc (wait_sig): Do it here instead to reduce the amount of time where there could potentially be two processes with the same pid. * spawn.cc (spawn_guts): Eliminate duplicate initialization. * include/sys/cygwin.h: Mark unused PID_* elements.
* * external.cc (cygwin_internal): Add CW_INIT_EXCEPTIONS to allow cygwinChristopher Faylor2000-08-251-3/+9
| | | | | | | exception handling on threads not created by cygwin. * sigproc.cc (proc_terminate): Don't release pinfo structs since we are exiting. * include/sys/cygwin.h: Add CW_INIT_EXCEPTIONS.
* * winsup.h: Eliminate inclusion of most of the cygwin .h files. Use .h filesChristopher Faylor2000-08-221-1/+4
| | | | | only in sources which require them. * Makefile.in: Generate dependencies with -MD option.
* * cygerrno.h: New file. Use this throughout whenever errno manipulation isChristopher Faylor2000-08-221-0/+1
| | | | | | | | | | | | | | | required. * errno.cc: Use DWORD to hold Windows errors. (geterrno_from_win_error): New function. (seterrno_from_win_error): Use geterrno_from_win_error to convert supplied windows error (suggested by Corinna Vinschen). * path.cc (symlink_info): Add error element. * path.cc (path_conv::check): Remove errno setting. Use new symlink_info errno element to set path_conv error, where appropriate. (symlink_info::check): Set error element rather than attempting to manipulate errno. Add more checks for trailing / and /.. even though they are currently useless. Avoid setting EINVAL. * path.cc (normalize_posix_path): Correct check for trailing /.
* * winsup.h: Split out dtable definitions into separate header file.Christopher Faylor2000-08-121-0/+1
| | | | | | * dtable.h: New file. * sigproc.h: Eliminate pinfo.h usage here. Use it in source files that need it.
* * winsup.h: take out protections of environ, errno, allow C useDJ Delorie2000-08-021-1/+1
| | | | | | | | | | * *.cc: put winsup.h before other headers (for __INSIDE_CYGWIN__); use cur_environ() instead of just environ * times.cc: remove import protections * glob.c: add winsup.h * localtime.c: ditto * smallprint.c: ditto * Makefile.in: don't __INSIDE_CYGWIN__ as it messes up profiling.