summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin
Commit message (Collapse)AuthorAgeFilesLines
...
* * signal.cc (sigaction): Allow new action == oldaction.Christopher Faylor2000-10-022-37/+31
|
* * fhandler_mem.cc: Load ntdll functions via autoload method.Corinna Vinschen2000-10-022-82/+58
| | | | (load_ntdll_funcs): Eliminated.
* * fhandler_mem.cc (load_ntdll_funcs): Add missing __stdcall qualifiers.Corinna Vinschen2000-10-022-7/+13
|
* * cygheap.cc (cygheap_init): Born again function.Christopher Faylor2000-10-027-44/+60
| | | | | | | | | | (_cmalloc): Reorganize to accomodate muto locking. (_cfree): Use muto lock to avoid multi-thread problems. * cygheap.h (incygheap): Just use cygheap_max to find upper cygwin heap bounds. * dcrt0.cc (dll_crt0_1): Reinstitute cygheap_init call. * path.cc (getcwd): Just return cwdstuff::get result, allowing correct handling of negative length. (cwdstuff::get): Malloc a buffer if one is not available.
* * Makefile.in: Add fhandler_mem.o to the dependencies.Corinna Vinschen2000-10-016-2/+300
| | | | | | | | * dtable.cc (dtable::build_fhandler): Add case for FH_MEM. * fhandler.h: Add FH_MEM device type. Add class fhandler_dev_mem. * fhandler_mem.cc: New file. Implementation of class fhandler_dev_mem. * path.cc: Add /dev/mem to windows_device_names. (get_device_number): Add FH_MEM type.
* * cygheap.cc (init_cheap): Set aside space for heap walk pointer.Christopher Faylor2000-09-305-39/+104
| | | | | | | | | | | | | | | | | (_csbrk): Make logic for detecting when to alloc cognizant of initialization condition. (_cmalloc): Use a structure to hold bucket size and heap chain pointer. Store pointer to next freed block in bucket size location so that it will be easy to see if a block is allocated. (_cfree): Store pointer to next freed block in bucket size location. (_crealloc): Use macro to retrieve bucket size. (cygheap_init): Eliminate. (cygheap_fixup_in_child): Add second argument to determine if we were execed or not. In execed case, walk the heap, cleaning up any orphaned blocks. * cygheap.h: Add a "MAX" value to cygheap_types. Remove cygheap_init declaration. Accomodate new argument to cygheap_fixup_in child. * fork.cc (fork): Accomodate extra argument to cygheap_fixup_in_child. * dcrt0.cc (dll_crt0_1): Ditto. Remove call to cygheap_init.
* * path.cc (symlink_info::check): Set executable bit for a file if the first twoChristopher Faylor2000-09-304-97/+58
| | | | characters are 'MZ' to mirror spawn_guts check.
* * winsup.h: Add `winME' to os_type symbols.Corinna Vinschen2000-09-304-2/+16
| | | | | | * dcrt0.cc (set_os_type): Identify Windows ME systems. * (host_dependent_constants::init): Care for winME. * uname.cc (uname): Ditto.
* * net.cc (get_ifconf): Code cleanup. Split. Call os dependentCorinna Vinschen2000-09-282-295/+427
| | | | | | | subfunctions instead. (get_9x_ifconf): New function for 9X systems, called by get_ifconf. (get_nt_ifconf): New function for NT systems, called by get_ifconf. (get_2k_ifconf): New function for W2K systems, called by get_ifconf.
* * spawn.cc (spawn_guts): Attempt to accomodate archaic windows quotingChristopher Faylor2000-09-274-11/+31
| | | | mechanism when dealing with '\' and '"'.
* * dcrt0.cc (quoted): Fix problem where ' quoted strings were skipped.Christopher Faylor2000-09-265-22/+15
| | | | | | | | | * fhandler.h (fhandler_socket::~fhandler_socket): Delete declaration. * net.cc: Remove unnecessary "number_of_sockets" usage. (fhandler_socket::fhandler_socket): Ditto. (fhandler_socket::~fhandler_socket): Delete definition. * spawn.cc (spawn_guts): Force first argument passed to CreateProcess as a command line to be windows style.
* * spawn.cc (av::dup_maybe): Make function void rather than void *.Christopher Faylor2000-09-256-46/+50
| | | | | | | | | * environ.cc (environ_init): Remember to reparse CYGWIN if envp is supplied. * heap.cc (_sbrk): Remember frame for signal handling. * syscalls.cc (read_handler): Eliminate. (_read): Move read_handler code here. Reorganize for one path through 'ready_for_read'.
* * spawn.cc (spawn_guts): Use actual program argument passed in for argv[0] asChristopher Faylor2000-09-192-1/+7
| | | | originally suggested by Kazuhiro Fujieda <fujieda@jaist.ac.jp>.
* * path.h: Create new input path flag PATH_NEEDDIR.Christopher Faylor2000-09-193-3/+31
| | | | | | | * path.cc (path::check): Detect trailing slash before converting to windows path. Tell symlink_info::check to check for directory if one is found. (symlink_info::check): Set errno when path is not a directory if pflags & PATH_NEEDDIR.
* * fhandler_tty.cc (fhandler_tty_slave::write): Correct typo which causedChristopher Faylor2000-09-182-1/+6
| | | | resetting of windows error to ERROR_IO_DEVICE to be ignored.
* * path.cc (mount_info::read_mounts): Don't delete mount entries of which mountChristopher Faylor2000-09-182-77/+58
| | | | | | | | | | points have the cygdrive prefix. * (mount_info::add_reg_mount): Properly catch errors on registry operations. * (mount_info::write_cygdrive_info_to_registry): Ditto. * (mount_info::del_reg_mount): Cosmetic changes to be consistent with other methods. * (mount_info::add_item): Check arguments more precisely. Increment nmounts only when registry operations succeed.
* * exceptions.cc (interruptible): Return 0 if given an address in uncommittedChristopher Faylor2000-09-182-1/+6
| | | | memory.
* * signal.cc (sleep): If interrupted by signal, return theEgor Duda2000-09-162-8/+16
| | | | requested time minus the time actually slept.
* * exceptions.cc (handle_exceptions): Just "core dump" if SIGSEGV in signalChristopher Faylor2000-09-165-6/+12
| | | | | | | 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.
* Commit change mentioned in ChangeLog.Christopher Faylor2000-09-131-0/+2
|
* * spawn.cc (av): Hide 'calloced' field and limit cstrduping to class methodsChristopher Faylor2000-09-134-15/+64
| | | | | | | | | | | | | only. (spawn_guts): Use methods for manipulating most newargv stuff. * child_info.h (child_info_spawn::~child_info_spawn): Avoid memory leaks in cygheap. * spawn.cc (spawn_guts): Ditto. * dcrt0.cc (quoted): Return next character after a quoted string when not doing special quote processing. Also ensure that non-NULL is returned in all circumstances. * spawn.cc (spawn_guts): Ensure that argv[0] is correctly set to the full path when a script is detected. Suggested by Kazuhiro Fujieda <fujieda@jaist.ac.jp>.
* * external.cc (fillout_pinfo): Handle explicit pids correctly.Christopher Faylor2000-09-132-3/+7
|
* * path.cc (normalize_posix_path): Fix more slashdot madness.Christopher Faylor2000-09-122-6/+10
|
* * Makefile.in: Make clean target remove *.d.Christopher Faylor2000-09-122-1/+5
|
* * path.cc (normalize_posix_path): Correctly deal with a "." parameter.Christopher Faylor2000-09-112-5/+12
|
* * cygheap.cc (init_cheap): Just use any old address for the cygwin heap.Christopher Faylor2000-09-114-20/+29
| | | | | | | * exceptions.cc (signal_exit): Don't terminate the main thread. Just try to exit in this thread really quickly. * signal.cc (kill_pgrp): Fix typo which caused pinfo structure to be assigned incorrectly.
* * dcrt0.cc (dll_crt0_1): Initialize thread and debug stuff before handlingChristopher Faylor2000-09-104-10/+19
| | | | | | | exec/fork. * dtable.cc (dtable::fixup_after_exec): Always clear out the read ahead buffer whether closing or adjusting. * path.cc (chdir): Avoid a compiler warning.
* * path.cc (chdir): Use the full path for cwd_win32. Consider attempts to chdirChristopher Faylor2000-09-103-10/+38
| | | | | | to strings of dots > 2 to be an error. Pass 'dir' argument to cygcwd.set. (cwdstuff::set): Need to treat arguments from chdir differently. * path.h (cwdstuff): Add an argument to set.
* * lib/_cygwin_crt0_common.cc: Add missing header files.Christopher Faylor2000-09-082-0/+6
|
* * sigproc.h (sigframe::set): Eliminate second argument. Default bp to currentChristopher Faylor2000-09-085-18/+23
| | | | | | | | 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-0863-274/+422
| | | | | | | | | | | | 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-0724-307/+371
| | | | | | | | | | | | | | | | | 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.
* * exceptions.cc (signal_exit): Reset all mutos owned by the main thread.Christopher Faylor2000-09-078-32/+55
| | | | | | | | | | | | | | | | | | | * fhandler.h: Define *_output_mutex macros for serializing tty output. (fhandler_termios): Remove restart_output_event. Define dummy output mutex methods. (fhandler_pty_master): Remove unneeded fixup_after_fork method. * fhandler_termios.cc (fhandler_termios::line_edit): Acquire output_mutex when CTRL-S is hit. Release it on CTRL-Q. * fhandler_tty.cc (fhandler_pty_master::process_slave_output): Remove inappropriate OutputStopped test here. Just use the output mutex. (fhandler_pty_master::fhandler_pty_master): Remove obsolete reference to restart_output_event. (fhandler_tty_common::close): Ditto. (fhandler_pty_master::set_close_on_exec): Ditto. (fhandler_pty_master::fixup_after_fork): Delete. * tty.cc (tty::common_init): Ditto. * sync.cc (muto::reset): New method. * sync.h: Declare above method.
* * sigproc.cc: Add include file for proper definitions.Christopher Faylor2000-09-064-1/+10
| | | | | * spawn.cc: Ditto. * winsup.h: Define cfree to avoid newlib pollution.
* * Makefile.in (CFLAGS): Ensure that -MD is always added even when CFLAGS isChristopher Faylor2000-09-062-1/+7
| | | | overwritten.
* * path.cc (cwdstuff::get_initial): Keep caching alive.Christopher Faylor2000-09-062-3/+13
| | | | (mount_info::conv_to_win32_path): Fill out relative path in failing case.
* Dummy file to accomodate programs which includeChristopher Faylor2000-09-061-0/+6
| | | | it unconditionally.
* * path.cc (normalize_posix_path): Deal with error return from cygcwd.get.Christopher Faylor2000-09-062-4/+17
| | | | | | (normalize_win32_path): Ditto. (mount_info::conv_to_win32_path): Ditto. (cwdstuff::get): Set buf to NULL on error.
* * path.cc (readlink): 'max' should be a 'min' or we'll suffer buffer overflow.Christopher Faylor2000-09-052-1/+6
|
* * path.cc (cwd_win32): Eliminate.Christopher Faylor2000-09-056-316/+273
| | | | | | | | | | | | | | | | | | | | | | | | | | (cwd_posix): Eliminate. (cwd_hash): Eliminate. (cwdstuff::init): Rename from cwd_init. (cwdstuff::fixup_after_exec): Rename from cwd_fixup_after_exec. (cwdstuff::get): Rename from get_cwd_inner. (normalize_posix_path): Eliminate cwd argument. Just calculate when necessary. (normalize_win32_path): Ditto. (mount_info::conv_to_win32_path): Eliminate cwd retrieval here. (mount_info::conv_to_posix_path): Ditto. (hash_path_name): Accomodate additional methods in cwdstuff. (get_cwd_win32): Eliminate. (getcwd): Use cwdstuff methods. Properly handle case where buf == NULL and len < 0. (cwdstuff::get_hash): New method. (cwdstuff::get_initial): New method. (cwdstuff::set): New method. (cwdstuff::get): New method. (cwdstuff::copy): New method. * path.h: Move cwdstuff struct here. Add a bunch of stuff to cwdstuff. Make cygcwd an extern. * spawn.cc (spawn_guts): Use copy method to get copies of cwd info to pass to execed process. * dcrt0.cc (dll_crt0_1): Use cygcwd methods for cwd initialization.
* * path.cc (readlink): Check if buffer length is positive. Truncate output toChristopher Faylor2000-09-0414-27/+33
| | | | buffer length. Don't terminate buffer with '\0'.
* * environ.cc (environ_init): Don't free the new environment table after we'veChristopher Faylor2000-09-032-1/+8
| | | | just copied stuff to it.
* * Makefile.in: Add cygheap.o.Christopher Faylor2000-09-0344-1880/+2211
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * child_info.h: Add specific exec class. * cygheap.h: New file. Contains declarations for cygwin heap. * cygheap.cc: New file. Implements cygwin heap functions. * dcrt0.cc (quoted): Simplify due to new method for passing arguments between cygwin programs. (alloc_stack_hard_way): Attempt to handle overlapped stack. (dll_crt0_1): Move child_info processing here. Accomodate new method for passing arguments between cygwin programs. Initialize cygwin heap. Establish __argc and __argv variables. (_dll_crt0): Move most of child_info processing to dll_crt0_1. (cygwin_dll_init): Remove duplication. * dtable.cc (dtable::extend): Allocate dtable using cygwin heap. (dtable::build_fhandler): Ditto for fhandler type being constructed. (dtable::dup_worker): Free new fhandler from cygwin heap on error. (dtable::select_*): Don't assume that this == fdtab. (dtable::linearize_fd_array): Delete. (dtable::delinearize_fd_array): Delete. (dtable::fixup_after_exec): New file. (dtable::vfork_child_dup): Use cygwin heap. (dtable::vfork_parent_restore): Ditto. * dtable.h: Remove obsolete methods. Add new method. * environ.cc (posify): Eliminate already_posix parameter and logic. (envsize): New function. (_addenv): Use envsize. (environ_init): Accept an argument pointing to an existing environment list. If supplied, allocate space for this in the the program's heap. * fhandler.cc (fhandler_base::operator =): Move here from fhandler.h. Use cygwin heap to allocate filenames. (fhandler_base::set_name): Allocate/free names from cygwin heap. (fhandler_base::linearize): Delete. (fhandler_base::de_linearize): Delete. (fhandler_base::operator delete): Free from cygwin heap. (fhandler_base::~fhandler_base): Ditto. * fhandler.h: Accomodate elimination of *linearize and other changes above. * fhandler_console.cc (fhandler_console::fixup_after_exec): Rename from de_linearize. * heap.h: New file. * fhandler_tty.cc (fhandler_tty_slave::fhandler_tty_slave): Use cygwin heap for name. fhandler_tty::fixup_after_exec): Rename from de_linearize. * fork.cc (fork): Call cygheap_fixup_in_child. * heap.cc: Use declarations in heap.h. * malloc.cc: Sprinkle assertions throughout to catch attempts to free/realloc something from the cygwin heap. * path.cc: Throughout, eliminate use of per-thread cache for cwd. Use cwd_* functions rather than cwd_* variables to access cwd_win32 and cwd_posix. (cwd_win32): New function. (cwd_posix): New function. (cwd_hash): New function. (cwd_fixup_after_exec): New function. * path.h: Accomodate path.cc changes. * pinfo.cc (pinfo_init): Accept a pointer to an environment table. Pass this to environ_init. Eliminate old 'title' tests. * pinfo.h: Accomodate above change in argument. * spawn.cc (struct av): New method for building argv list. (av::unshift): New method. (spawn_guts): Allocate everything that the child process needs in the cygwin heap and pass a pointer to this to the child. Build argv list using new method. Eliminate delinearize stuff. * thread.h: Eliminate _cwd_win32 and _cwd_posix buffers. * winsup.h: Eliminate obsolete functions. Add envsize() declaration.
* * Makefile.in: Remove "make check" support. It is now in winsup/Makefile.in.Christopher Faylor2000-09-032-56/+6
|
* Remove everythingChristopher Faylor2000-09-033-9/+0
|
* Remove READMEChristopher Faylor2000-09-031-42/+0
|
* remove everything and move it up a level.Christopher Faylor2000-09-035-804/+0
|
* * sigproc.cc (mychild): New function.Christopher Faylor2000-09-022-7/+25
| | | | | (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-012-2/+8
| | | | | 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-019-56/+81
| | | | | | * shared.h: Split out "child_info" stuff into a new header file and use where necessary. Declare pid_exists. * child_info.h: New file.