Commit Graph

1629 Commits

Author SHA1 Message Date
Christopher Faylor 7a47ed496c * Makefile.in: Propagate 'clean' to subdirs properly. 2001-10-29 20:32:27 +00:00
Christopher Faylor 8dd6060b98 * fhandler.cc (fhandler_base::set_name): Set namehash here to catch name
changes.
(fhandler_base::open): Remove namehash setting.
(fhandler_base::fstat): Subtract 1 from arbitrary time setting to avoid strange
ls -l granularity problem.
* shared_info.h (MOUNT_VE
2001-10-29 20:30:47 +00:00
Egor Duda 3fbfb55efe * winsup.api/ltp/stat03.c: Supress compiler warning. 2001-10-29 20:03:06 +00:00
Egor Duda bd65358b34 * winsup.api/signal-into-win32-api.c: Supress compiler warning. 2001-10-29 19:45:43 +00:00
Christopher Faylor cdd8cb1f2a * select.cc (MAKEready): Remove extraneous select_read. 2001-10-29 16:12:47 +00:00
Corinna Vinschen ac19c8dcf6 * uinfo.cc (internal_getlogin): Set environment variable $HOME
from either /etc/passwd or $HOMEDRIVE/$HOMEPATH if necessary.
2001-10-29 11:53:52 +00:00
Christopher Faylor 711ded6d28 * fhandler.h (fhandler_serial::fhandler_serial): Change to only accept unit
argument.
* fhandler_serial.cc (fhandler_serial::fhandler_serial): Ditto.
(fhandler_serial::open): Avoid else when previous clause is a return().
* path.cc (get_devn): Alias /dev/ttyS0 -> /dev/com1, etc.
(get_device_number): Reallow standalone "com1" as a valid name for /dev/com1.
2001-10-29 05:28:24 +00:00
Christopher Faylor aa9d50a1c1 fix spelling errors 2001-10-28 23:05:49 +00:00
Christopher Faylor 451386f769 fix consistent spelling errors. 2001-10-28 18:10:44 +00:00
Corinna Vinschen be846a19d7 * configure: Regenerate, removing erroneous SUBDIRS substitution. 2001-10-26 15:01:08 +00:00
Christopher Faylor fe00cca93e * select.cc (MAKEready): Check for read_ready in loop since select_read could
set it.
(peek_socket): Check ready/write/except specifically since they could have been
set even prior to peek_socket call.
2001-10-26 04:06:27 +00:00
Christopher Faylor 53c79b98c9 Clarify checkin comment slightly. 2001-10-24 23:56:45 +00:00
Christopher Faylor 7ee2c95756 * shared_info.h (MOUNT_VERSION): Change to a smaller, still arbitrary number.
* shared.cc (open_shared): Accept a number to denote the shared memory region.
(memory_init): Use shared memory version as part of the object name of the
shared region.  Ditto for the mount table.
* path.cc (CYGWIN_REGNAME): New define used in place of
CYGWIN_INFO_CYGWIN_REGISTRY_NAME throughout.
* external.cc (cygwin_internal): Implement CW_[GS]ET_CYGWIN_REGISTRY_NAME.
* cygheap.h (init_cygheap::cygwin_regname): New element.
2001-10-24 22:10:06 +00:00
Christopher Faylor ae21eea62e * Makefile.in: Remove EXEEXT consideration. We always need EXEEXT. 2001-10-24 22:09:37 +00:00
Christopher Faylor a9f20457f3 * Makefile.in: Only build testsuite directory on first 'make check'.
* configure.in: Remove testsuite from SUBDIRS.
* configure: Regenerate.
2001-10-24 21:56:54 +00:00
Christopher Faylor a830378213 Remove merge conflict indicator. 2001-10-24 15:40:24 +00:00
Christopher Faylor a0626ebe27 Ensure that all fhandler_*::read definitions are __stdcall throughout.
* fhandler.cc (fhandler_base::set_inheritance): Be more defensive in debugging
code.
* fhandler.h: Adjust regparms throughout to reflect passing 'this' parameter.
* fhandler_console.cc (fhandler_console::read): Remove unneeded test.  Only
honor "key down" events.
* miscfuncs.cc (strcasestr): Reorganize for efficient code use.
(check_null_empty_str_errno): Ditto.
(__check_null_invalid_struct_errno): Ditto.
(__check_invalid_read_ptr_errno): Ditto.
* syscalls.cc (_read): Return 0 when length == 0, as per Single UNIX
Specification.
2001-10-24 04:16:45 +00:00
Christopher Faylor a05d38a8b4 * debug.cc (set_errno): Return value of errno that was set, just like the
macro.
(setclexec_pid): Replace old handle with new handle.
* debug.h: Reflect change in arguments for setclexec_pid.
* fhandler.cc (fhandler_base::set_inheritance): Ditto.
(fhandler_base::fork_fixup): Ditto.
* cygerrno.h: Reflect return value change for set_errno.
2001-10-22 21:09:41 +00:00
Christopher Faylor e7e231e531 Remove 'cb' parameter and modify fhandler_* constructors throughout.
* dtable.cc (dtable::build_fhandler): Remove debugging output which uses 'cb'.
* exec.cc (execvp): New function.
(execvpe): Ditto.
* fhandler.cc (fhandler_base::fhandler_base): Use constructor initialization.
* fhandler.h (fhandler_tty_common::fhandler_tty_common): Ditto.
* fhandler_clipboard.cc (fhandler_dev_clipboard::fhandler_dev_clipboard):
Ditto.
* fhandler_console.cc (fhandler_console::fhandler_console): Ditto.
* fhandler_raw.cc (fhandler_dev_raw::fhandler_dev_raw): Ditto.
* fhandler_serial.cc (fhandler_serial::fhandler_serial): Ditto.
* fhandler_tty.cc (fhandler_tty_master::fhandler_tty_master): Ditto.
(fhandler_tty_slave::fhandler_tty_slave): Ditto.
(fhandler_pty_master::fhandler_pty_master): Ditto.
* fhandler_windows.cc (fhandler_windows::fhandler_windows): Ditto.
2001-10-22 18:39:22 +00:00
Corinna Vinschen 65d1068cb8 Patch suggested by Ian Ray <ian.ray@nokia.com>:
* syscalls.cc (seteuid): Unset environment variables HOMEDRIVE and
	HOMEPATH before calling internal_getlogin().
	* uinfo.cc (internal_getlogin): Use default HOMEPATH and HOMEDRIVE
	from environment if both are present, else query NetUserGetInfo().
2001-10-22 18:31:00 +00:00
Corinna Vinschen c270dc2555 * net.cc (get_2k_ifconf): Change multiple IP address naming scheme
to Linux style.

	Patch by Alexander Gottwald <ago@informatik.tu-chemnitz.de>:
        * net.cc (get_2k_ifconf): Added support for multiple IP addresses on
        one interface.
2001-10-22 12:23:33 +00:00
Corinna Vinschen 8b6234ca12 * miscfuncs.cc (__check_invalid_read_ptr_errno): Return error, if any. 2001-10-22 11:31:39 +00:00
Christopher Faylor d055070040 * resource.cc (fill_rusage): Perform paranoid zero structure passed to
GetProcessMemoryInfo.
2001-10-22 00:10:46 +00:00
Christopher Faylor 1f0191e542 * autoload.cc: Autoload GetProcessMemoryInfo.
* resource.cc (fill_rusage): Calculate ru_maxrss and ru_majflt entries.
(Bug report on this from Guido Serassio in the squid project).  This requires
including psapi.h.
2001-10-21 23:44:43 +00:00
Christopher Faylor c43c5c1643 * dll_init.cc (dll_list::alloc): Increase retry count to 1000. 2001-10-21 03:38:41 +00:00
Christopher Faylor 3ddb57fb3f fix typo. 2001-10-20 17:35:27 +00:00
Corinna Vinschen 011ec894d2 * mkgroup.c: Avoid compiler warnings.
(print_special): New function.
        (main): Print special accounts by calling print_special().
        * mkpasswd.c: Avoid compiler warnings.
        (enum_users): Print additional U-domain\username info in gecos
        field when SIDs are printed.
        (print_special): New function.
        (main): Print special accounts by calling print_special().
2001-10-20 13:56:09 +00:00
Corinna Vinschen b07891c58b * include/winnetwk.h (WNetGetResourceInformationA): Add declaration.
(WNetGetResourceInformationW): Ditto.
        (WNetGetResourceInformation): Add define.
2001-10-20 10:41:09 +00:00
Christopher Faylor 6fdd213161 * miscfuncs.cc (+__check_invalid_read_ptr_errno): New function.
* syscalls.c (_write): Validate that write buffer is accessible for reading,
not writing.
* winsup.h: Declare new function, increase regparmization of check_* functions.
2001-10-20 05:08:21 +00:00
Corinna Vinschen 5318c49833 * path.cc (getcwd): Allow len == 0 when buf == NULL. 2001-10-19 19:17:04 +00:00
Christopher Faylor da8f3291d1 * syscalls.cc (_read): Validate input pointer.
(_write): Ditto.
(system): Ditto.
2001-10-19 02:27:19 +00:00
Corinna Vinschen e34027611a Patch from Frederic Devernay <Frederic.Devernay@sophia.inria.fr>:
* poll.cc (poll): Call cygwin_select() if any fd is valid.
2001-10-17 18:52:06 +00:00
Corinna Vinschen 081be67e75 * fhandler_raw.cc (fhandler_dev_raw::open): Eliminate compatibility
code since no Win32 device names are used anymore.
        * fhandler_tape.cc (fhandler_dev_tape::tape_set_blocksize): Allow
        0 as blocksize to indicate variable blocksize.
        * path.cc (win32_device_name): Generate NT internal device names
        using upper/lower case names for readability.
        Generate \DosDevices\<letter>: device name for mount table
        compatibility devices.
2001-10-16 20:17:23 +00:00
Corinna Vinschen 2de2be2235 Forgot ChangeLog 2001-10-16 17:32:42 +00:00
Christopher Faylor 1a2cca85d2 * fhandler.cc (fhandler_base::fork_fixup): Guard against compiler warning. 2001-10-16 16:58:28 +00:00
Corinna Vinschen b20e2ee663 * fhandler_tape.cc (fhandler_dev_tape::tape_status): Report
EOTWarningZoneSize in get->mt_eotwarningzonesize.
        * include/cygwin/mtio.h: Define DEFTAPE.
        (struct mtget): Add member `mt_eotwarningzonesize'. Add a comment.
        * include/cygwin/version.h: Bump API minor version to 47.
2001-10-16 16:28:39 +00:00
Corinna Vinschen 0aa019b960 * pathnames.sgml: Cleanup raw device text to be more coherent. 2001-10-16 16:03:22 +00:00
Corinna Vinschen 7b46bb01e1 * pathnames.sgml: Add description for new fixed device paths. 2001-10-16 15:16:02 +00:00
Corinna Vinschen 990690655c * autoload.cc: Add load statement for `NtOpenFile'.
* fhandler.h (fhandler_dev_raw::get_unit): New method.
	(fhandler_dev_tape::norewind): Eliminate.
	(fhandler_dev_tape::is_rewind_device): New method.
	* fhandler_raw.cc (fhandler_dev_raw::open): Open new
	fixed device name devices using NT internal method.
	Keep calling fhandler_base::open() for old mount table
	device mapping compatibility devices.
	(fhandler_dev_raw::fstat): Eliminate.  Settings are done
	by fhandler_base::fstat() already.
	* fhandler_tape.cc: Remove `norewind' usage throughout.
	* ntdll.h: Define FILE_SYNCHRONOUS_IO_NONALERT.
	Define struct _IO_STATUS_BLOCK.
	Declare NtOpenFile().
	* path.cc (get_raw_device_number): Add new approach for
	using fixed device names.
	(win32_device_name): Ditto.
	(get_device_number): Ditto.  Require POSIX path to begin
	with "/dev/".
	(mount_info::conv_to_win32_path): Call win32_device_name()
	instead of get_device_number() after evaluating mount points
	to allow changing the win32 destination path again.
	* security.cc (str2buf2uni): Remove `static' to be able to
	call function from fhandler_dev_raw::open().
	* wincap.cc: Set flag has_raw_devices appropriately.
	* wincap.h: Add flag has_raw_devices.
2001-10-16 14:53:26 +00:00
Christopher Faylor 2ac3bab68d * cygheap.h (cygheap_fdget::cygheap_fdget): Remove debugging operation from
set_errno.
2001-10-16 14:43:36 +00:00
Christopher Faylor 5a23087628 * mmap.cc (mmap): Assign 'fh' from cygheap_fdget. Use 'fh' everywhere. 2001-10-16 14:04:26 +00:00
Christopher Faylor f636c08124 minor reformat. 2001-10-16 13:49:38 +00:00
Christopher Faylor 0f4db8cbe0 * cygerrno.h (set_errno): Define more informative version of this function for
debugging.
(__set_errno): Declare when DEBUGGING.
* cygheap.h (cygheap_fdget::cygheap_fdget): Add a flag to control when errno is
set.
* debug.cc (__set_errno): New function.
* fcntl.cc (_fcntl): Fix so that correct fd is used for second argument to
dup2.
* syscalls.cc (_cygwin_istext_for_stdio): Don't set errno here when using
cygheap_fdget.
2001-10-16 03:31:50 +00:00
Christopher Faylor df63bd490a * fhandler.cc (fhandler_base::fork_fixup): Don't protect handle.
* dlfcn.cc: Fix to confirm to coding standards.  Reorganize includes throughout
to accomodate new cygheap.h usage.
* cygheap.h (cygheap_fdmanip): New class: simplifies locking and retrieval of
fds from cygheap->fdtab.
(cygheap_fdget): Ditto.
(cygheap_fdnew): Ditto.
* fcntl.cc (_fcntl): Use new method to lock fdtab and retrieve info.
* ioctl.cc (ioctl): Ditto.
* mmap.cc (mmap): Ditto.
* net.cc: Ditto, throughout.
* passwd.cc (getpass): Ditto.
* path.cc (fchdir): Ditto.
* pipe.cc (make_pipe): Ditto.
* sec_acl.cc (facl): Ditto.
* syscalls.cc: Ditto, throughout.
* termios.cc: Ditto, throughout.
2001-10-15 23:39:33 +00:00
David Starks-Browning fff126983e new known problem "hang or core-dump during make" 2001-10-15 22:32:46 +00:00
David Starks-Browning 97eab19f83 cvs+ssh problem on Win9x now FITNR. 2001-10-15 21:51:36 +00:00
Christopher Faylor c2198f849c * mkpasswd.cc (enum_users): Shorten "unused" passwd field. 2001-10-15 15:44:37 +00:00
Corinna Vinschen 271a33443c * uname.cc (uname): Use `wProcessorLevel' unless OS sets it wrong.
Use `dwProcessorType' then instead.
        * wincap.cc: Set flag has_valid_processorlevel appropriately.
        * wincap.h: Add flag has_valid_processorlevel.
2001-10-15 09:41:18 +00:00
Christopher Faylor 48372ea6f1 * dtable.cc (dtable::build_fhandler_from_name): Use PC_FULL to determine path
name.
* fork.cc (fork_parent): Correct the "unable to allocate forker_finished event"
error message.  It named the wrong event before.
2001-10-14 15:49:13 +00:00
Christopher Faylor 611d92e24c * autoload.cc (load_wsock32): Declare dummy function to force loading of
winsock.
* fhandler.cc (fhandler_base::set_inheritance): Make debugging output more
verbose.
* fhandler_socket.cc (fhandler_socket::fixup_after_fork): Force loading of
winsock32 if winsock2 not available.
* net.cc (set_socket_inheritance): Use DuplicateHandle in all cases to set
inheritance correctly.
(fdsock): Use winsock2_active macro to determine when to set socket
inheritance.  Remove fdtab resource locking since this function should already
be protected.
(cygwin_accept): Simplify logic.  Ensure that fdtab unlock is not called
inappropriately.
(cygwin_rcmd): Use fdtab locking.
(cygwin_rresvport): Ditto.
(cygwin_rexec): Ditto.
* select.cc (peek_socket): Set errno appropriately if winsock select fails.
* winsup.h: Declare check_pty_fds.
* syscalls.cc (check_pty_fds): Rename from check_ttys_fds.  Also check pty
master.
(setsid): Use check_pty_fds.
* dtable.cc (dtable::dec_console_fds): Add check on pty fds.
2001-10-14 04:14:24 +00:00
Christopher Faylor 0476bae576 * fhandler_dsp.cc (fhandler_dsp::ioctl): Return 0 for successful
SNDCTL_DSP_GETBLKSIZE operation.  Remove obsolete 'name' arg from fhandler_*
constructors throughout.
* winsup.h (winsock_active): New macro.
(winsock2_active): Ditto.
* autoload.cc (wsock_init): Use new macros to decide if winsock or winsock2 is
loaded.
(nonexist_wsock32): Dummy function to force winsock load.
(nonexist_ws2_32): Dummy function to force winsock2 load.
* fhandler.h (fhandler_socket::fstat): Declare new method.  Currently unused.
* fhandler_socket.cc (fhandler_socket::fixup_before_fork_exec): Check that
winsock2 is active before trying WSADuplicateSocketA.
(fhandler_socket::fixup_after_fork): Add extra check for winsock2_active.
Otherwise use iffy procedures for Windows 95.
(fhandler_socket::fixup_after_exec): Add debugging.
(fhandler_socket::dup): Add debugging.
(fhandler_socket::fstat): New method.
(fhandler_socket::set_close_on_exec): Attempt to perform iffy stuff on Windows
95.
* errno.cc (_sys_nerr): Work around compiler strangeness.
* pinfo.cc (winpids::add): Add extra element at end of allocated array for
setting to NULL.
(winpids::enumNT): Ditto.
(winpids::init): Don't modify pidlist if it hasn't been allocated
(possibly due to malloc problem).
2001-10-13 17:23:35 +00:00
Christopher Faylor 5dec13e179 * Makefile.in: Allow stdinc searching for dumper. 2001-10-13 05:33:47 +00:00
Christopher Faylor bc6ed54986 * autoload.cc (wsock_init): Reorganize slightly to accomodate a new compiler. 2001-10-13 01:35:15 +00:00
Christopher Faylor cb1826572c * Makefile.in: Add -nostdinc to CXXFLAGS. 2001-10-13 00:59:20 +00:00
Christopher Faylor 338420c918 * Makefile.in: Comment out install for now. 2001-10-12 20:02:41 +00:00
Christopher Faylor 0aa753540a * Makefile.in: Accomodate changes to w32api_include macro. 2001-10-12 19:49:29 +00:00
Christopher Faylor 0055a6c6c9 * Makefile.common: Perform more include file testing trickery. 2001-10-12 12:52:05 +00:00
Christopher Faylor c5e7ccacff Red Hatize 2001-10-12 01:51:21 +00:00
Egor Duda 5844588b74 * net.cc (cygwin_sendto): Use correct socket address when sending
data to AF_UNIX socket.
2001-10-11 09:46:21 +00:00
Corinna Vinschen f6a85cddc8 * net.cc (get_95_ifconf): Using other registry values pointing to
correct networkdevice identification for Windows95.
2001-10-10 19:28:19 +00:00
David Starks-Browning a0d03b7eaf New entries:
My application cannot locate cygncurses5.dll!!!
	Why is Cygwin suddenly @emph{so} slow?
Modified:
	Why doesn't //c (for C:) work anymore?
2001-10-10 09:21:55 +00:00
Christopher Faylor 57013c31ec Throughout, rename PROC_FORK1 to PROC_FORK.
* child_info.h: Rename PROC_* to _PROC_*.  Define PROC_* with additional
testing magic.  Eliminate old PROC_FORK and rename PROC_FORK1 to PROC_FORK.
* dcrt0.cc (_cygwin_testing_magic): New variable.  Added to magic number in
proc_info.
(alloc_stack): Eliminate old PROC_FORK test.
(dll_crt0_1): Ditto.  Use _PROC_* enums for test.  Subtract
_cygwin_testing_magic from child_proc_info->type so that normal cygwin programs
invoked by test suite programs do not consider themselves to be in a cygwin
environment.
(_dll_crt0): Ditto.  Move environment checks to initial_env function to
conserve on stack space.
(initial_env): New function.  Checks for testing and debugging environment
variables.
* init.cc (cygwin_hmodule): Move declaration.
* winsup.h: Declare variables used for cygwin testing.
2001-10-10 02:32:12 +00:00
Christopher Faylor b2a8510b89 * Makefile.in (MINGW_INCLUDES): Accomodate changes in Makefile.common. 2001-10-10 01:58:33 +00:00
Christopher Faylor bc6aa7e1b4 * Makefile.common: Avoid adding -I options to compile if they already exist in
CC or C*FLAGS.  This prevents warnings from newer versions of gcc.
2001-10-10 01:57:43 +00:00
Christopher Faylor d3fee5eccb * uinfo.cc (internal_getlogin): Reorganize slightly to minimize work in default
condition.
2001-10-09 23:28:24 +00:00
Egor Duda 132a3b30b9 fix typos 2001-10-09 18:12:51 +00:00
Corinna Vinschen e898b6c0c7 * fhandler.cc (fhandler_disk_file::open): Add missing case clash check. 2001-10-09 16:54:18 +00:00
Corinna Vinschen d7f6398556 * winsup.api/mmaptest01.c: Add several tests on mmaps. Use libltp.
* winsup.api/winsup.exp: Link all tests agains libltp.
2001-10-08 12:18:38 +00:00
Christopher Faylor 97405ef5b0 * dtable.cc (dtable::build_fhandler): Allocate correct amount for given
fhandler class.
* fhandler.h (fhandler_union): Properly define rather than relying on
fhandler_console being "big enough".
2001-10-08 05:50:33 +00:00
Christopher Faylor 2c774ac3f3 * external.cc (fillout_pinfo): Reset counter whenever we initialize the pid
list.
2001-10-08 04:26:27 +00:00
Christopher Faylor 12f6d7bc9c * kill.cc (main): Set exit value to 1 on invalid pid. Perform minor cleanup. 2001-10-08 03:06:25 +00:00
Christopher Faylor c27a29813a * path.cc (normalize_posix_path): Don't eat a '.' after a '\\' since it has
special meaning on NT.
* syscalls.cc (access): Use stat_worker.
2001-10-07 21:16:36 +00:00
Christopher Faylor dca779339f fix typo 2001-10-06 04:04:14 +00:00
Christopher Faylor a448b8cf34 * fhandler.cc (fhandler_base::fork_fixup): Protect dup'ed handle and record it
as non-inheritable for debugging purposes in case there is a subsequent fork or
exec.
* fhandler_tty.cc (fhandler_tty_common::fixup_after_fork): Allow fork_fixup to
call ProtecHandle.
2001-10-06 01:04:24 +00:00
Christopher Faylor 3cf6936e3b * path.cc (get_raw_device_number): Correct length arguments for wdeveqn. 2001-10-05 18:23:49 +00:00
Christopher Faylor 547d07cae8 * winsup.api/nullgetcwd.c: New file. Check that NULL first argument to getcwd
works.
2001-10-05 16:52:43 +00:00
Christopher Faylor 19639f4139 * path.cc (getcwd): Allow NULL first argument. 2001-10-05 15:05:07 +00:00
Christopher Faylor b3fa795ab9 Revert incorrect checkins. 2001-10-05 04:37:33 +00:00
Christopher Faylor f978840bee * heap.h (inheap): Check for NULL. 2001-10-05 04:36:14 +00:00
Christopher Faylor 8d817b0f9e Add second path_conv * argument to fstat()s throughout.
* fhandler.h: Change read and fstat to regparm/stdcall throughout.
(fhandler_base::fstat): Just declare.  Don't define.
(fhandler_disk_file::fstat_helper): Declare.
* fhandler.cc (fhandler_base::fstat): Move here from fhandler.h, adapt from
former stat_dev().
(fhandler_disk_file::fstat): Move most of the disk-file-specific logic from
stat_worker to here.  Use fstat_helper to derive final fstat output.
(fhandler_disk_file::fstat_helper): New method, renamed from former fstat
method.
(num_entries): Moved here from syscalls.cc.
* fhandler_mem.cc (fhandler_dev_mem::fstat): Use base class to initialize most
stuff.  Invert has_physical_mem_access test for establishing permissions.
* fhandler_raw.cc (fhandler_dev_raw::fstat): Eliminate unneed test and memory
clearing.  Use base class to initialize most stuff.
* syscalls.cc (stat_dev): Eliminate.
(stat_worker): Simply call fstat method to generate fstat output.  Move all
device specific code to appropriate fstats.
* dir.cc (opendir): Pass correct arg to stat_worker to allow following
symlinks.
2001-10-05 04:21:41 +00:00
Christopher Faylor 291ae2c1e7 * winsup.api/systemcall.c (main): Change some messages for clarity. 2001-10-05 02:47:28 +00:00
Christopher Faylor ca7320ac2c * winsup.api/systemcall.c: New file. Check for system call problems. 2001-10-05 02:29:46 +00:00
Christopher Faylor af39152f4c * spawn.cc (perhaps_suffix): Return NULL on non-existence of file as well as
"directoryness".  Previous code modified on 2001/09/30 actually had an arguable
bug which was unmasked by the change on that day.
2001-10-05 01:39:08 +00:00
Christopher Faylor cbed6474df * path.cc (path_conv::check): Return ENOTDIR when leading device and trailing
component.
2001-10-05 00:52:41 +00:00
Christopher Faylor 32fb80db07 * syscalls.cc (stat_worker): Make global. Accept path_conv parameter for
passing information back to caller.
* winsup.h: Declare stat_worker.
* dir.cc (opendir): Use stat_worker rather than stat and pass path_conv
parameter to stat_worker for later inspection.
* syslog.cc (syslog): Teach syslog about syslog priorities other than LOG_ERR,
LOG_WARNING and LOG_INFO
* path.cc (path_conv::check): Don't perform file system or rootdir checks on
devices.
2001-10-05 00:17:57 +00:00
Christopher Faylor 8af0f81d52 * dcrt0.cc (dll_crt0_1): Don't close hexec_proc if it is NULL.
* fork.cc (vfork): Add debugging statements.
* path.cc (get_device_number): Make static.  Rewrite to inspect both unix and
windows paths.
(get_raw_device_number): Just check for parts of raw device that we care about.
(get_devn): New function, pulled from get_device_number.
(win32_device_name): Accomodate arg changes to get_device_number.
(mount_info::get_device_number): Call get_device_number on translated Windows
path.
* spawn.cc (spawn_guts): Don't treat P_VFORK differently from P_NOWAIT.  Add
handle to child's shared region to child so that it will be preserved if the
parent goes away.
* fhandler.h: Throughout, simplify to one open method for all fhandler classes,
requiring a path_conv first element.
* fhandler.cc (fhandler_base::open): Remove obsolete method.  Generalize to
require path_conv * as first argument.
(fhandler_disk_file::open): Remove obsolete method.
(fhandler_disk_file::open): Use path_conv pointer rather than reference.
* fhandler_clipboard.cc (fhandler_dev_clipboard::dup): Use new open method.
(fhandler_dev_clipboard::open): Accomodate new argument for open methods.
* fhandler_console.cc (fhandler_console::open): Ditto.
(fhandler_console::dup): Use new open method.
(fhandler_console::fixup_after_fork): Ditto.
(fhandler_console::fixup_after_exec): Ditto.
* fhandler_dsp.cc (fhandler_dev_dsp::open): Accomodate new argument for open
methods.
* fhandler_floppy.cc (fhandler_dev_floppy::open): Ditto.
* fhandler_mem.cc (fhandler_dev_mem::open): Ditto.
* fhandler_random (fhandler_dev_random::open): Ditto.
* fhandler_raw.cc (fhandler_dev_raw::open): Ditto.
* fhandler_serial.cc (fhandler_serial::open): Ditto.
* fhandler_tape.cc (fhandler_dev_tape::open): Ditto.
* fhandler_tty.cc (fhandler_tty_slave::open): Ditto.
(fhandler_pty_master::open): Ditto.
* fhandler_windows.cc (fhandler_windows::open): Ditto.
* fhandler_zero.cc (fhandler_dev_zero::open): Ditto.
* fhandler_socket.cc (fhandler_socket::set_connect_secret): Accomodate new
argument for open methods.
* syscalls.cc (_open): Ditto.
(stat_worker): Ditto.
2001-10-04 02:34:20 +00:00
Christopher Faylor ebd645e7e6 * cygheap.cc (cfree): Remove malloc debugging probe.
* dlmalloc.c (errprint): Remove abort() call which causes interesting error
message printing to abort prematurely.
* environ.cc: Sprinkle MALLOC_CHECKs liberally throughout.
(_addenv): Allocate two empty elements at end of environ to
(apparently) work around problems with some buggy applications.
(winenv): Avoid calling alloca if no forced environment variable is present.

* exceptions.cc (open_stackdumpfile): Don't print "Dumping stack trace to..."
when running in a cygwin environment (i.e., the parent is a cygwin process).

* dtable.cc (dtable::init_std_file_from_handle): Move device type detection
code from build_fhandler here since it is only used by this function.
(dtable::build_fhandler_from_name): New method.  Renamed from
dtable::build_fhandler.
(dtable::build_fhandler): Use build_fhandler_from_name.
(cygwin_attach_handle_to_fd): Ditto.
* syscalls.cc (_open): Ditto.
(stat_worker): Ditto.
* dtable.h (dtable::build_fhandler_from_name): Rename declaration from
dtable::build_fhandler.
2001-10-03 03:49:26 +00:00
Robert Collins 2f17ab1689 Tue Oct 2 22:25:23 2001 Robert Collins <rbtcollins@hotmail.com>
* how-fhandlers-work.txt: New file.
2001-10-02 12:27:03 +00:00
Christopher Faylor 4ab6034f50 * dtable.h (dtable::build_fhandler): Make path_conv parameter non-optional.
(dtable::init_std_file_from_handle): Eliminate name parameter.
* dtable.cc (stdio_init): Don't pass bogus name to init_std_file_from_handle.
The function will figure out the name itself.
(dtable::init_std_file_from_handle): Eliminate name parameter.  Assume that
we're always called with an appropriate fd.  Pass name as NULL if we can't
simply figure it out from context.
(cygwin_attach_handle_to_fd): Pass path_conv argument to build_fhandler.
(dtable::build_fhandler): Make path_conv argument mandatory.  Eliminate
specific call to get_device_number.  With unknown device names, set name from
handle context for parsing by path_conv.
(dtable::build_fhandler): Pass path_conv argument to build_fhandler.
* path.h (path_conv::set_isdisk): Set disk device type.
(path_conv::is_device): Don't consider FH_DISK a "device".
* syscalls.cc (_open): Pass path_conv argument by reference.
(stat_worker): Ditto.
(_rename): Use path_conv operators.  Add bounds to DeleteFile/MoveFile for
loop.
2001-10-02 01:58:06 +00:00
Christopher Faylor 47af76d8c8 * cygwin.din: export strtoll and strtoull 2001-10-01 19:47:37 +00:00
Christopher Faylor 47063f00e4 Add "path.h" include throughout, where needed. Use new path_conv methods and
operators to simplify testing for directory and attributes, throughout.
* path.h (path_conv::exists): New method.
(path_conv::has_attribute): Ditto.
(path_conv::isdir): Ditto.
(path_conv::DWORD &): New operator.
(path_conv::int &): Ditto.
* dir.cc (rmdir): Eliminate a goto.
* dtable.cc (dtable::build_fhandler): Accept opt and suffix info for
path_conv.check.  Return fh == NULL on path_conv error.  Pass unit to set_name
as appropriate.
(dtable::reset_unix_path_name): New method.
* dtable.h (dtable): Declare new method.  Reflect arg changes to
build_fhandler.
* fhandler.cc (fhandler_disk_dummy_name): Eliminate.
(fhandler_base::set_name): Expect paths to be NULL.  Build unix_path_name from
win32_path_name when it is a device.
(fhandler_base::reset_unix_path_name): New method.
(fhandler_base::raw_read): Report EISDIR when ERROR_INVALID_FUNCTION or
ERROR_INVALID_PARAMETER and reading a directory.
(fhandler_disk_file::fstat): Don't call stat_dev since we should now never be
calling fhandler_disk_file methods with devices.
(fhandler_base::fhandler_base): Clear {unix,win32}_path_name.
(fhandler_base::~fhandler_base): Always free {unix,win32}_path_name.
(fhandler_disk_file::fhandler_disk_file): Remove set_no_free_names kludge.
(fhandler_disk_file::open): Ditto.
* fhandler.h (fhandler_base::no_free_names): Eliminate.
(fhandler_base::set_no_free_names): Ditto.
* fhandler_tty.cc (fhandler_tty_slave::fhandler_tty_slave): Don't set
unix_path_name here.
* path.cc (fchdir): Lock fd table throughout.  Use new
dtable::reset_unix_path_name method to reset path.
* syscalls.cc (stat_worker): Reorganize to always call fstat method.  Pass
path_conv method to fhandler_*::open.
(chroot): Elminate a goto.
2001-10-01 04:10:07 +00:00
Christopher Faylor c25c4c5ffc * environ.cc (winenv): Allocate exact amount of space needed for forced windows
environment variable rather than just using MAX_PATH.
2001-09-30 21:37:53 +00:00
Christopher Faylor bb6c3d5832 * Makefile.in: Depend on stamp to ensure rebuilding. Remove stamp file when
we've just built the DLL.
2001-09-30 21:10:38 +00:00
Robert Collins 38102913c8 Mon Oct 1 00:34:00 2001 Robert Collins <rbtcollins@hotmail.com>
* thread.cc (pthread_cond_dowait): Hopefully eliminate a race on multiple thread
        wakeups.
2001-09-30 14:39:55 +00:00
Robert Collins 86336f4fea Sat Sep 29 18:26:00 2001 Robert Collins <rbtcollins@hotmail.com>
* pthread.cc (pthread_cond_timedwait): Deleted - exported from thread.cc.
        (pthread_cond_wait): Deleted - exported from thread.cc.
        * thread.cc (pthread_cond::BroadCast): Update to use the new syntax for
        verifyable_object_isvalid ().
        (pthread_cond::Signal): Ditto. Also attempt to fix the lost signal race
        with pthread_cond::TimedWait().
        (check_valid_pointer): Change definiton to void const *.
        (verifyable_object_isvalid): Add new parameter to allow identification of
        static initializers, and return a enum rather than magic numbers.
        (__pthread_create): Ditto.
        (__pthread_cleanup): Ditto.
        (__pthread_attr_init): Ditto.
        (__pthread_attr_getinheritsched): Ditto.
        (__pthread_attr_getschedparam): Ditto.
        (__pthread_attr_getschedpolicy): Ditto.
        (__pthread_attr_getscope): Ditto.
        (__pthread_attr_setdetachstate): Ditto.
        (__pthread_attr_getdetachstate): Ditto.
        (__pthread_attr_setinheritsched): Ditto.
        (__pthread_attr_setschedparam): Ditto.
        (__pthread_attr_setschedpolicy): Ditto.
        (__pthread_attr_setscope): Ditto.
        (__pthread_attr_setstacksize): Ditto.
        (__pthread_attr_getstacksize): Ditto.
        (__pthread_attr_destroy): Ditto.
        (__pthread_join): Ditto.
        (__pthread_detach): Ditto.
        (__pthread_suspend): Ditto.
        (__pthread_continue): Ditto.
        (__pthread_getschedparam): Ditto.
        (__pthread_getsequence_np): Ditto.
        (__pthread_key_create): Ditto.
        (__pthread_key_delete): Ditto.
        (__pthread_setschedparam): Ditto.
        (__pthread_setspecific): Ditto.
        (__pthread_getspecific): Ditto.
        (__pthread_cond_destroy): Ditto.
        (__pthread_cond_init): Ditto.
        (__pthread_cond_broadcast): Ditto.
        (__pthread_cond_signal): Ditto.
        (__pthread_condattr_init): Ditto.
        (__pthread_condattr_getpshared): Ditto.
        (__pthread_condattr_setpshared): Ditto.
        (__pthread_condattr_destroy): Ditto.
        (__pthread_kill): Ditto.
        (__pthread_mutex_init): Ditto.
        (__pthread_mutex_getprioceiling): Ditto.
        (__pthread_mutex_lock): Ditto.
        (__pthread_mutex_trylock): Ditto.
        (__pthread_mutex_unlock): Ditto.
        (__pthread_mutex_destroy): Ditto.
        (__pthread_mutex_setprioceiling): Ditto.
        (__pthread_mutexattr_getprotocol): Ditto.
        (__pthread_mutexattr_getpshared): Ditto.
        (__pthread_mutexattr_gettype): Ditto.
        (__pthread_mutexattr_init): Ditto.
        (__pthread_mutexattr_destroy): Ditto.
        (__pthread_mutexattr_setprotocol): Ditto.
        (__pthread_mutexattr_setprioceiling): Ditto.
        (__pthread_mutexattr_getprioceiling): Ditto.
        (__pthread_mutexattr_setpshared): Ditto.
        (__pthread_mutexattr_settype): Ditto.
        (__sem_init): Ditto.
        (__sem_destroy): Ditto.
        (__sem_wait): Ditto.
        (__sem_trywait): Ditto.
        (__sem_post): Ditto.
        (__pthread_cond_dowait): New function, contains core logic from
        __pthread_cond_wait and __pthread_cond_timedwait. Decrement (*cond)->waiting
        before reentering the cond access mutex to allow detection of lost signals.
        (__pthread_cond_timedwait): Rename to pthread_cond_timedwait, and call
        __pthread_cond_dowait after calculating the wait length.
        (__pthread_cond_wait): Rename to pthread_cond_wait, and call
        __pthread_cond_dowait.
        * thread.h: New enum for use with verifyable_object_isvalid.
        Remove the extern exporting of __pthread_cond_timedwait and __pthread_cond_wait.
2001-09-29 09:01:01 +00:00
Christopher Faylor a1dc0932f4 * pipe.cc (fhandler_pipe::fixup_after_fork): New method.
* fhandler.h (fhandler_pipe::fixup_after_fork): Declare new method.
2001-09-29 01:23:06 +00:00
Christopher Faylor 1795c53d86 * passwd.cc (read_etc_passwd): Bother with unlocking when not in cygwin
initialization.
* grp.cc (read_etc_group): Ditto.
2001-09-28 07:23:18 +00:00
Christopher Faylor 8b51edbfa6 * passwd.cc (read_etc_passwd): Don't bother with locking when
in cygwin initialization since there is only one thread.
* grp.cc (read_etc_group): Ditto.
2001-09-28 07:01:22 +00:00
Christopher Faylor 9c61aed684 * pipe.cc (fhandler_pipe::hit_eof): Return correct value when there is no EOF
event available.
2001-09-28 06:06:45 +00:00
Corinna Vinschen f4f30cf140 * mmap.cc (mmap): Move setting the access after evaluating fd.
Remove useless comment.  Explain copy-on-write problem of 9x
        more detailed.  Don't set access to FILE_MAP_COPY on 9x only
        when anonymous mapping is requested.
        (fhandler_disk_file::mmap): Remove useless device check.
        Add debug output.
2001-09-27 22:39:50 +00:00