summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin
Commit message (Collapse)AuthorAgeFilesLines
...
* * cygheap.cc (cygheap_root::cygheap_root): New function.Corinna Vinschen2000-11-1516-138/+287
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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.
* * dir.cc (rewinddir): Always set __d_position = 0, so nextCorinna Vinschen2000-11-142-1/+6
| | | | call to readdir() will restart the directory scan.
* * cygheap.h (init_cygheap): New struct holding values that live in the CygwinChristopher Faylor2000-11-1412-87/+122
| | | | | | | | | | | | | | | | | | | | | 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.
* * path.cc (get_device_number): Allow /dev/ttySn to designate a com port.Christopher Faylor2000-11-136-6/+13
|
* * path.h: Add __attribute__ ((regparm(x))) to commonly used functions.Christopher Faylor2000-11-125-12/+17
| | | | | | * pinfo.h: Ditto. * sigproc.h: Ditto. * sync.h: Ditto.
* * dcrt0.cc: New global variable `ignore_case_with_glob'.Christopher Faylor2000-11-114-10/+75
| | | | | | | | (dll_crt0_1): Disable case-insensitive globbing before calling `main'. * environ.cc (glob_init): New static function to set or clear `ignore_case_with_glob'. (known): Changed "glob" entry to call `glob_init'. * glob.c (match): Use case-insensitive globbing if needed.
* remove include/rapi.hChristopher Faylor2000-11-091-64/+0
|
* * dir.cc (readdir): Avoid reading from the beginning whenCorinna Vinschen2000-11-092-1/+7
| | | | readdir is called after a previous call has returned NULL.
* Increase cygwin heap size.Christopher Faylor2000-11-091-1/+1
|
* * select.cc (peek_pipe): Deal with pending newline in pty_master.Christopher Faylor2000-11-092-5/+20
|
* * environ.cc (_addenv): malloc space for setenv if cygwin1.dll is used inChristopher Faylor2000-11-088-9/+88
| | | | | | | | | | | | | | | | | | conjunction with older binaries. (environ_init): Ditto. * external.cc (get_cygdrive_info): New function. * external.cc (get_cygdrive_prefixes): Change to use get_cygdrive_info but toss the user and system flags. * external.cc (cygwin_internal): Add new CW_GET_CYGDRIVE_INFO case. * path.cc (mount_info::get_cygdrive_prefixes): Remove method. * path.cc (mount_info::get_cygdrive_info): New method. Actually, get_cygdrive_info is really an enhanced version of get_cygdrive_prefixes renamed to get_cygdrive_info that also gets the user and system flags. * shared_info.h (get_cygdrive_prefixes): Remove method. * shared_info.h (get_cygdrive_info): New method. * include/cygwin/version.h: Bump minor API version due to adding CW_GET_CYGDRIVE_INFO to cygwin_internal. * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_GET_CYGDRIVE_INFO.
* * autoload.cc: Add autoload statement for `WSASetLastError'.Corinna Vinschen2000-11-073-1/+15
| | | | | * net.cc (cygwin_connect): Change error code to WSAEINPROGRESS when connect returns WSAEWOULDBLOCK.
* Fix typos.Christopher Faylor2000-11-071-3/+3
|
* Update copyright.Christopher Faylor2000-11-071-1/+1
|
* * dcrt0.cc (sigthread::init): Reinstitute sigthread lock as a critical section.Christopher Faylor2000-11-065-79/+71
| | | | | | | | | | | | (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.
* * path.cc (mount_info::read_cygdrive_info_from_registry): UseChristopher Faylor2000-11-063-11/+30
| | | | | | | | | | | CYGWIN_INFO_CYGDRIVE_PREFIX, CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX, and CYGWIN_INFO_CYGDRIVE_FLAGS. * path.cc (mount_info::write_cygdrive_info_to_registry): Use CYGWIN_INFO_CYGDRIVE_PREFIX and CYGWIN_INFO_CYGDRIVE_FLAGS. * path.cc (mount_info::remove_cygdrive_info_from_registry): Ditto. * path.cc (mount_info::get_cygdrive_prefixes): Use CYGWIN_INFO_CYGDRIVE_PREFIX. * include/cygwin/version.h: Add CYGWIN_INFO_CYGDRIVE_FLAGS, CYGWIN_INFO_CYGDRIVE_PREFIX, and CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX.
* * errno.cc (strerror): Change EAGAIN case to return "Resource temporarilyChristopher Faylor2000-11-062-1/+6
| | | | unavailable" instead of "No more processes".
* Fix typo.Christopher Faylor2000-11-061-2/+2
|
* * child_info.h (child_info): Add pppid_handle for closing the parent's of theChristopher Faylor2000-11-069-141/+188
| | | | | | | | | | | | | | | | | | | | | | | 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-052-2/+9
|
* * pinfo (wait_subproc): Neverending debug tweaking.Christopher Faylor2000-11-052-3/+7
|
* * pinfo.cc (winpids:add): New method.Christopher Faylor2000-11-055-46/+101
| | | | | | | | | | | | | (winpids::enumNT): New method renamed from EnumProcessesNT. Use add method to add elements to the lists. (winpids::enum9x): New method renamed from EnumProcesses9x. Use add method to add elements to the lists. (winpids::enum_init): Accept 'winpid' parameter to control whether to add all windows pids to the list. (winpids::release): New method. * pinfo.h (winpids): Reflect above changes. * signal.cc (kill_pgrp): Ditto. * external.cc (fillout_pinfo): Ditto.
* * exceptions.cc (handle_sigsuspend): Record frame here for signalling.Christopher Faylor2000-11-053-6/+12
| | | | (set_process_mask): Ditto.
* * sigproc.cc (wait_subproc): Still more debugging cleanup.Christopher Faylor2000-11-042-4/+8
|
* * pinfo.cc (EnumProcessesNT): Avoid 0 pids.Christopher Faylor2000-11-045-30/+39
| | | | | | | | | | (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-042-3/+10
|
* * pinfo.cc (pinfo::init): Reverse order of setting status and pid info in anChristopher Faylor2000-11-0310-22/+59
| | | | | | | | 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.
* * ntdll.h: Remove IO_COUNTERS definition since it is now in winnt.h.Christopher Faylor2000-11-022-10/+4
|
* * pinfo.cc (EnumProcessesNT): New function. Eliminates dependence on psapi.h.Christopher Faylor2000-11-025-65/+228
| | | | | | | | | | | (EnumProcesses9x): Rename from EnumProcessesW95. Change arguments to be more useful for cygwin. (winpids::init): Accomodate argument changes. (enum_init): Ditto. * pinfo.h (winpids): Make pidlist dynamically extendable by storing it as a pointer and remembering the size. * ntdll.h: Add extra definitions needed for EnumProcessesNT. Reformat via 'indent'.
* * exceptions.cc (interruptible): Remove obsolete tests.Christopher Faylor2000-11-023-35/+46
| | | | | | (sigreturn): Construct pseudo-frame-pointer so that signal handler can figure out where to put return address when signals are coming in quickly. * path.cc (cwdstuff::get): Allow length 0 buffer length when buffer when NULL.
* * path.h (has_exec_chars): Standard function for checking for executable magicChristopher Faylor2000-10-314-6/+22
| | | | | | numbers. * path.cc (symlink_info::check): Use the above function. * fhandler.cc (fhandler_disk_file::open): Ditto.
* * path.cc (_readlink): Return ENOENT when file does not exist.Christopher Faylor2000-10-312-0/+10
|
* * fhandler.h (fhandler_dev_raw): Add method `fixup_after_exec'.Corinna Vinschen2000-10-312-0/+5
|
* * fhandler.h (fhandler_dev_raw): Add definition for methodCorinna Vinschen2000-10-314-19/+47
| | | | | | | | | | | | | | | `fixup_after_fork'. * fhandler_raw.cc (fhandler_dev_raw::fhandler_dev_raw): Add `set_need_fixup_after_fork' call. (fhandler_dev_raw::~fhandler_dev_raw): Revert to user space allocation. (fhandler_dev_raw::open): Ditto. (fhandler_dev_raw::dup): Ditto. Reset buffer pointer. (fhandler_dev_raw::fixup_after_fork): New function. * fhandler_tape.cc (fhandler_dev_tape::open): Revert to user space memory allocation. (fhandler_dev_tape::ioctl): Ditto. Change behaviour on MTSETBLK when new size is 1.
* * fhandler_tape.cc (fhandler_dev_tape::open): Fix memory allocation.Corinna Vinschen2000-10-312-3/+10
| | | | | Use Cygwin heap instead of user heap. (fhandler_dev_tape::ioctl): Ditto.
* * pinfo.cc (enum_init): Don't suffer silently if we can't load the processChristopher Faylor2000-10-312-3/+17
| | | | enumerators.
* * signal.cc (kill_pgrp): Revert 25-Oct change.Christopher Faylor2000-10-302-1/+8
| | | | (kill_worker): Ditto.
* * include/cygwin/version.h: Bump DLL minor version number to 6.Christopher Faylor2000-10-302-1/+5
|
* Whitespace cleanup.Christopher Faylor2000-10-2845-301/+196
| | | | | | * configure.in: Eliminate subdir stuff. * configure: Regenerate. * include/getopt.h (option): Make name field 'const'.
* * autoload.cc: New file keeping all autoload stuff.Corinna Vinschen2000-10-277-329/+326
| | | | | | | | * Makefile.in: Add autoload.o to dependencies. * dcrt0.cc: Move all autoload stuff to autoload.cc. * fhandler_mem.cc: Ditto. * net.cc: Ditto. * uinfo.cc: Ditto.
* * sigproc.cc (wait_sig): Add braces to avoid confusion.Christopher Faylor2000-10-273-5/+11
|
* * fhandler_socket.cc: New file.Corinna Vinschen2000-10-276-300/+324
| | | | | | | * Makefile.in: Add fhandler_socket.o to dependencies. * fhandler.h: Change comment. * net.cc Move all fhandler_socket methods to fhandler_socket.cc. * winsup.h: Add declaration for `ws2_32_handle'.
* * dtable.cc (dtable::release): Check for socket. ChangeCorinna Vinschen2000-10-267-42/+260
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cnt_need_fixup_before accordingly. (dtable::dup2): Ditto. (dtable::fixup_before_fork): New method. (dtable::fixup_before_exec): Ditto. * dtable.h (class dtable): Add member `cnt_need_fixup_before'. Add definition for methods `dec_need_fixup_before', `inc_need_fixup_before', `need_fixup_before', `fixup_before_exec' and `fixup_before_fork'. * fhandler.h (class fhandler_base): Slight rearrangements. Add definitions for methods `fixup_before_fork_exec'. (class fhandler_socket): Eliminate superfluous constructor. Add member `prot_info_ptr'. Add destructor. Add definitions for methods `dup', `fixup_before_fork_exec', `fixup_after_fork' and `fixup_after_exec'. * fork.cc (fork_parent): Care for file types which need a fixup before fork. Start child in suspended state then. * net.cc: New global variable `ws2_32_handle' and `wsadata'. (fdsock): Check for Winsock version. Call `set_socket_inheritance' only if Winsock version < 2.0. Care for `need_fixup' count in fdtab. (cygwin_socket): Eliminate call to `set_socket_inheritance'. (cygwin_accept): Ditto. (cygwin_rcmd): Ditto. (cygwin_rresvport): Ditto. (cygwin_rexec): Ditto. (socketpair): Ditto. (fhandler_socket::fhandler_socket): Set `need_fork_fixup'. Allocate space for the WSAPROTOCOL_INFOA struct used in fixup. (fhandler_socket::~fhandler_socket): New destructor. (fhandler_socket::fixup_before_fork_exec): New method. (fhandler_socket::fixup_after_fork): Ditto. (fhandler_socket::dup): Ditto. (wsock_init): New static function. (LoadDLLinitfunc (wsock32)): Rearranged. (LoadDLLinitfunc (ws2_32)): New function. (dummy_autoload): Add autoload statemants for `WSADuplicateSocketA' and `WSASocketA'. * spawn.cc (spawn_guts): Care for file types which need a fixup before exec. Start child in suspended state then.
* * signal.cc (kill_pgrp): Don't limit sending of signals to stopped processesChristopher Faylor2000-10-262-3/+7
| | | | | when sig < 0. (kill_worker): Only send SIGCONT to stopped processes when sendSIGCONT.
* * exceptions.cc (sig_handle): Just make sure that wait_sig loops when receivingChristopher Faylor2000-10-252-1/+7
| | | | a SIGCONT. Don't block waiting for completion that will never occur.
* Add comment.Christopher Faylor2000-10-251-0/+1
|
* * dtable.cc (dtable::fixup_after_exec): Use variable rather than constantlyChristopher Faylor2000-10-252-7/+14
| | | | | indexing into fds array. (dtable::fixup_after_fork): Ditto.
* * fhandler.cc (fhandler_base::fcntl): Treat O_NONBLOCK and OLD_O_NDELAYCorinna Vinschen2000-10-253-10/+28
| | | | | as exactly the same. If one is set, both are set. * net.cc (fhandler_socket::fcntl): Ditto.
* * dcrt0.cc (do_exit): Remove debugging statement.Christopher Faylor2000-10-252-2/+4
|
* * dcrt0.cc (do_exit): Don't bother looking for pgrp children to send SIGHUP ifChristopher Faylor2000-10-256-3/+28
| | | | | | | | | | process has never created any children. * fork.cc (fork): Set flag indicating that there is another process with our process group. * spawn.cc (spawn_guts): Ditto. * pinfo.h (set_has_pgid_children): New methods for setting when process has children in its process group. * syscalls.cc (setpgid): Clear has_gid_children if pgid changes.