Commit Graph

6698 Commits

Author SHA1 Message Date
Christopher Faylor 2a6d6db8e2 winsup/ChangeLog:
2013-11-06  Christopher Faylor  <me.cygwin2013@cgf.cx>

	* configure.ac: Detect windows headers/libs after we've figured out the
	C compiler.
	* configure: Regenerate.
	* aclocal.m4: Regenerate.
	* configure.cygwin: Default to '.' if can't find a winsup directory.

winsup/cygserver/ChangeLog:
2013-11-06  Christopher Faylor  <me.cygwin2013@cgf.cx>

	* configure.ac: Detect windows headers/libs after we've figured out the
	C compiler.
	* configure: Regenerate.
	* aclocal.m4: Regenerate.

winsup/cygwin/ChangeLog:
2013-11-06  Christopher Faylor  <me.cygwin2013@cgf.cx>

	* configure.ac: Detect windows headers/libs after we've figured out the
	C compiler.
	* configure: Regenerate.
	* aclocal.m4: Regenerate.

winsup/utils/ChangeLog:
2013-11-06  Christopher Faylor  <me.cygwin2013@cgf.cx>

	* configure.ac: Detect windows headers/libs after we've figured out the
	C compiler.
	* configure: Regenerate.
	* aclocal.m4: Regenerate.
2013-11-07 00:19:52 +00:00
Corinna Vinschen 5b312b4747 * devices.in (dev_cygdrive_storage): Revert mapping to \Device\Null.
(dev_storage): Ditto for /dev.
	* devices.cc: Regenerate.
	* fhandler.cc (fhandler_base::open_null): New method to open a fake
	\Device\Null handler.
	(fhandler_base::open): Fix formatting.  Change O_ACCMODE test to a
	switch statement.  Simplify a test which still tested for a now unused
	create_disposition.
	* fhandler.h (fhandler_base::open_null): Declare.
	(fhandler_netdrive::close): Declare.
	* fhandler_dev.cc (fhandler_dev::open): Open fake \Device\Null handle
	by just calling new open_null method.
	* fhandler_disk_file.cc (fhandler_cygdrive::open): Ditto.
	* fhandler_netdrive.cc (fhandler_netdrive::open): Call open_null
	rather than setting nohandle.
	(fhandler_netdrive::close): New method.
	* fhandler_registry.cc (fetch_hkey): Fix token in RegOpenUserClassesRoot
	call.  Create valid key for HKEY_CURRENT_CONFIG by mapping to real key
	HKEY_LOCAL_MACHINE\System\CurrentControlSet\Hardware Profiles\Current.
	(fhandler_registry::open): Set nohandle only when using pseudo registry
	handle.
	* fhandler_virtual.cc (fhandler_virtual::opendir): Call open rather
	than just setting nohandle here.
	* fhandler_virtual::fstatvfs): Set ST_RDONLY fs flag.
	* globals.cc (ro_u_null): New readonly UNICODE_STRING for \Device\Null.
	* path.h (path_conv::set_path): Revert previous change caring for
	wide_path.
2013-10-31 14:26:42 +00:00
Corinna Vinschen b8dc053d2b *** empty log message *** 2013-10-30 10:00:32 +00:00
Corinna Vinschen 751bbaf96a * devices.in (dev_cygdrive_storage): Map to \Device\Null.
(dev_storage): Map /dev and /dev/windows to \Device\Null.
	* devices.cc: Regenerate.
	* dir.cc (opendir): Create unique id.  Explain why.
	* fhandler.h (fhandler_dev::get_dev): Implement inline.
	(fhandler_cygdrive::close): Drop declaration.
	(fhandler_cygdrive::get_dev): Implement inline.
	(fhandler_windows::get_hwnd): Ditto.
	(fhandler_windows::set_close_on_exec): Drop declaration.
	(fhandler_windows::fixup_after_fork): Ditto.
	* fhandler_dev.cc (fhandler_dev::open): Call fhandler_disk_file::open
	without O_CREAT flag.  Explain why.  Create \Device\Null handle if
	/dev/ doesn't actually exist.
	(fhandler_dev::close): Drop nohandle case.
	(fhandler_dev::fstatvfs): Drop nohandle check.  Test for fs_got_fs
	instead.  Set ST_RDONLY fs flag for simulated /dev.
	(fhandler_dev::opendir): If /dev doesn't exist, call open() to create
	fake \Device\Null handle.  Don't set nohandle.  Set dir_exists
	correctly.
	(fhandler_dev::rewinddir): Call fhandler_disk_file::rewinddir only if
	/dev is a real directory.
	* fhandler_disk_file.cc (fhandler_disk_file::opendir): If called for
	the cygdrive dir, call open() to create fake \Device\Null handle.
	Only attach __DIR_mounts buffer to dir if not called for cygdrive dir.
	Don't set nohandle.
	(fhandler_cygdrive::open): Create \Device\Null handle.
	(fhandler_cygdrive::close): Remove.
	(fhandler_cygdrive::fstatvfs): Set ST_RDONLY fs flag.
	* fhandler_windows.cc (fhandler_windows::open): Create \Device\Null
	handle.
	(fhandler_windows::read): Don't add io_handle to WFMO handle array.
	Change subsequent test for return value accordingly.  Fix test for
	"message arrived".
	(fhandler_windows::set_close_on_exec): Remove.
	(fhandler_windows::fixup_after_fork): Remove.
	* path.h (path_conv::set_path): Make sure wide_path is NULL when
	setting a new path.
	* select.cc (peek_windows): Use correct hWnd value, not io_handle.
	(fhandler_windows::select_read): Don't use io_handle as wait object.
	(fhandler_windows::select_write): Ditto.
	(fhandler_windows::select_except): Ditto.
2013-10-30 09:44:47 +00:00
Corinna Vinschen 352d0b831e *** empty log message *** 2013-10-28 10:57:33 +00:00
Corinna Vinschen 14be153e9b * exception.h: Fold in content of include/exceptions.h.
* include/exceptions.h: Remove.
2013-10-27 09:42:17 +00:00
Corinna Vinschen c8ae71316f * devices.in (dev_storage): Map /dev/dsp to \Device\Null.
* devices.cc: Regenerate.
	* fhandler_dsp.cc (fhandler_dev_dsp::open): Call fhandler_base::open.
	(fhandler_dev_dsp::close): Call fhandler_base::close.
	(fhandler_dev_dsp::fixup_after_fork): Call
	fhandler_base::fixup_after_fork.

	* fhandler_raw.cc (fhandler_dev_raw::fixup_after_fork): Call
	fhandler_base::fixup_after_fork.
2013-10-26 13:23:54 +00:00
Corinna Vinschen 2e178c6909 * exception.h (_exception_list): Drop redefinition for x86_64.
* include/exceptions.h: Disable content for x86_64 since it's not
	using frame based exception handling anymore.
2013-10-26 09:37:34 +00:00
Corinna Vinschen 7a1dc2a940 * flock.cc (fhandler_base::lock): Only refuse to lock nohandle and
old-style console devices when called to perform BSD flock locking.
	Add a FIXME to comment and align description.

	* ntdll.h (THREADINFOCLASS): Following MSDN, rename throughout from
	THREAD_INFORMATION_CLASS.
2013-10-25 18:40:57 +00:00
Corinna Vinschen 2118eee1ce * devices.in (dev_storage): Map /dev/clipboard to \Device\Null.
* devices.cc: Regenerate.
	* fhandler.h (fhandler_dev_clipboard::open): Drop declaration.
	* fhandler_clipboard.cc (fhandler_dev_clipboard::dup): Drop call to
	open.  Set private members to 0 and call fhandler_base::dup.
	(fhandler_dev_clipboard::open): Remove so that default
	fhandler_base::open is used to open \Device\Null.
	(set_clipboard): Drop gratuitios call to RegisterClipboardFormatW.
	(fhandler_dev_clipboard::close): Call fhandler_base::close from here.
2013-10-25 16:16:50 +00:00
Corinna Vinschen 46943206dc * fhandler_disk_file.cc (fhandler_base::fstat_fs): Fix comment. 2013-10-25 15:33:51 +00:00
Corinna Vinschen f0b101007a * fhandler_clipboard.cc (fhandler_dev_clipboard::open): Drop gratuitios
handling of membuffer.  It's NULL anyway.
	(fhandler_dev_clipboard::lseek): Set membuffer to NULL after freeing
	it to avoid subsequent crashes when accessing invalid pointer.
2013-10-25 15:04:24 +00:00
Corinna Vinschen 494c626414 * devices.in (dev_storage): Map /dev/random and /dev/urandom to
\Device\Null.
	* devices.cc: Regenerate.
	* fhandler.h (fhandler_dev_random::open): Drop declaration.
	(fhandler_dev_random::close): Ditto.
	(fhandler_dev_random::crypt_gen_random): Convert to static method.
	* fhandler_random.cc (fhandler_dev_random::open): Remove so that default
	fhandler_base::open is used to open \Device\Null.
	(fhandler_dev_random::close): Ditto.
	* fhandler_socket.cc (entropy_source): Delete.
	(fhandler_socket::af_local_set_secret): Remove entropy_source code and
	call fhandler_dev_random::crypt_gen_random directly instead.
2013-10-25 12:21:59 +00:00
Corinna Vinschen 8ef76ab6f9 * fhandler.h (fhandler_dev_zero::lseek): Convert to inline method.
(class fhandler_dev_random): Drop dummy_offset.
	(fhandler_dev_random::lseek): Convert to inline method.
	(fhandler_dev_dsp::lseek): Ditto.
	* fhandler_dsp.cc (fhandler_dev_dsp::lseek): Drop here.
	* fhandler_random.cc (fhandler_dev_random::open): Drop setting
	dummy_offset.
	(fhandler_dev_random::lseek): Drop here.
	* fhandler_tape.cc (fhandler_dev_tape::lseek): Make no-op, but keep
	old code for reference.
	* fhandler_zero.cc (fhandler_dev_zero::lseek): Drop here.
2013-10-24 17:51:41 +00:00
Christopher Faylor 4ae84b2251 * external.cc (fillout_pinfo): If start_time is 0, wait a while before
returning the pinfo structure.
* fhandler.cc (fhandler_base::open_setup): Convert from inline.
* fhandler.h (fhandler_base::open_setup): Declare.
* fhandler_console.cc (fhandler_console::open_setup): Always call
fhandler_base::open_setup.
* fhandler_tty.cc (fhandler_pty_slave::open_setup): Ditto.
(fhandler_pty_master::open_setup): Ditto.
2013-10-24 15:26:21 +00:00
Corinna Vinschen 84e7adad1d Fix typo. 2013-10-24 11:27:21 +00:00
Corinna Vinschen 95ff6fc6da * devices.in (dev_storage): Map /dev/zero and /dev/full to \Device\Null.
* devices.cc: Regenerate.
	* dtable.h (struct dtable): Make fhandler_base friend, rather
	than fhandler_disk_file.
	* fhandler.cc (fhandler_base::open_with_arch): Create unique id.
	(fhandler_base::cleanup): Call del_my_locks.
	(fhandler_base::fcntl): Handle F_GETLK, F_SETLK and F_SETLKW.
	* fhandler.h (fhandler_base::get_dev): Return real device number.
	(fhandler_base::set_unique_id): New inline method.
	(fhandler_disk_file::lock): Drop declaration.
	(fhandler_disk_file::get_dev): New method, return pc.fs_serial_number.
	(fhandler_dev_zero::open): Drop declaration.
	* fhandler_disk_file.cc (fhandler_disk_file::close): Move
	del_my_locks call to fhandler_base::open_with_arch.
	(fhandler_disk_file::fcntl): Move handling of locking commands to
	fhandler_base::fcntl.
	(fhandler_base::open_fs): Drop call to NtAllocateLocallyUniqueId.
	* fhandler_zero.cc (fhandler_dev_zero::open): Remove so that default
	fhandler_base::open is used to open \Device\Null.
	* flock.cc (fixup_lockf_after_exec): Finding a single fhandler is
	enough here.
	(fhandler_base::lock): Replace fhandler_disk_file::lock.  Refuse to lock
	nohandle devices.  Handle read/write test using POSIX flags.  Explain
	why.  Never fail on SEEK_CUR or SEEK_END, rather assume position 0,
	just as Linux.
	* net.cc (fdsock): Create unique id.
2013-10-24 09:41:17 +00:00
Corinna Vinschen 158508011c * include /cygwin/config.h (_READ_WRITE_BUFSIZE_TYPE): Define. 2013-10-23 10:06:17 +00:00
Corinna Vinschen 27f8495dd5 * fhandler.cc (fhandler_base::fstat): Drop FH_FULL case to align
/dev/full permissions to Linux.
2013-10-23 09:58:12 +00:00
Christopher Faylor 015566ed00 * fhandler.h (fhandler_base::cleanup): Mark as extern rather than inline.
* fhandler_base.cc (fhandler_base::cleanup): Define.
* fhandler_tty.cc (fhandler_pty_slave::cleanup): Call fhandler_base::cleanup.
(fhandler_pty_master::cleanup): Ditto.
2013-10-22 20:41:09 +00:00
Christopher Faylor 41f4cb7311 . 2013-10-19 14:37:29 +00:00
Christopher Faylor bb0dc1c297 * fhandler_termios.cc (tty_min::kill_pgrp): Don't send a signal to myself if
this process is exiting.
2013-10-18 20:56:19 +00:00
Christopher Faylor 71ba0d76ba * tty.cc (tty_list::allocate): Set sid to 0 rather than -1 since -1 is an error
condition.
2013-10-18 20:07:35 +00:00
Corinna Vinschen 340854dda8 * fhandler_process.cc (format_process_ctty): Fix random content of
/proc/$PID/ctty if the process has no controlling tty.  Set to just
	"\n" instead.
2013-10-16 15:14:22 +00:00
Corinna Vinschen f51d15eaf6 *** empty log message *** 2013-10-15 16:53:46 +00:00
Corinna Vinschen 2cbd31fe26 * autoload.cc (CryptAcquireContextW): Remove.
(CryptGenRandom): Remove.
	(CryptReleaseContext): Remove.
	(SystemFunction036): Define.  Add comment to explain that this is
	actually the RtlGenRandom function.
	* fhandler.h (class fhandler_dev_random): Drop crypt_prov member.
	(fhandler_dev_random::fhandler_dev_random): Define inline.
	(fhandler_dev_random::dup): Drop declaration.
	* fhandler_random.cc (fhandler_dev_random::fhandler_dev_random): Remove
	here.
	(fhandler_dev_random::crypt_gen_random): Use RtlGenRandom to drop
	dependency to old Crypto API.
	(fhandler_dev_random::read): Implement an enhanced version of reading
	random bytes from RtlGenRandom for the sake of a better /dev/random
	emulation.
	(fhandler_dev_random::close): Just return 0 since crypt_prov doesn't
	exisyt anymore.
	(fhandler_dev_random::dup): Drop entirely for the same reason.
2013-10-15 14:00:37 +00:00
Corinna Vinschen 45ec2b422e * mmap.cc (mmap64): Convert pagesize from DWORD to size_t to avoid
a rounding error for allocations beyond 4 Gigs.
2013-10-15 08:13:42 +00:00
Christopher Faylor fc3f6ccafa * ntdll.h: Guard against new header files. 2013-10-05 14:34:41 +00:00
Christopher Faylor ade2acf274 * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 26. 2013-09-25 16:17:59 +00:00
Christopher Faylor 6aa3bb2f66 * sigproc.h (hold_everything::ischild): Declare as reference.
(hold_everything::hold_everything): Store address of caller's notion of
"ischild".
2013-09-25 15:58:45 +00:00
Christopher Faylor 1dc2c177f4 * thread.cc (semaphore::_getvalue): Set *sval as appropriate. Set errno and
return -1 on error.
2013-09-25 14:44:45 +00:00
Corinna Vinschen 3c654cd48a * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Belatedly bump
to 25.
2013-08-31 18:05:31 +00:00
Corinna Vinschen bffd6fb0e2 * heap.cc (RAISEHEAP_SIZE): New definition.
(user_heap_info::sbrk): Make failed commit an error condition again.
	Only reserve RAISEHEAP_SIZE sized chunk for further heap reservations
	by default.
2013-08-31 10:21:48 +00:00
Corinna Vinschen 348f503460 *** empty log message *** 2013-08-30 21:42:40 +00:00
Christopher Faylor 617b2bf99f . 2013-08-30 21:33:43 +00:00
Christopher Faylor 6fc77d3e75 * cygheap.h (user_heap_info::sbrk): Declare new function.
(user_heap_info::init): Ditto.
* heap.cc (user_heap_info::init): Rename from heap_init().  Avoid explictly
using cygheap->user_heap.
(sbrk): Use user_heap_info method via cygheap->user_heap.
(user_heap_info::sbrk): Renamed from sbrk().  Eliminate explicit use of
cygheap->user_heap.  Change some pointer arithmetic to use (char *) for
consistency.
* shared.cc (shared_info::initialize): Change heap_init call to
cygheap->user_heap.init.
2013-08-30 21:02:02 +00:00
Corinna Vinschen 9f0de58c22 *** empty log message *** 2013-08-30 20:01:22 +00:00
Corinna Vinschen b03bd1f41c * heap.cc (sbrk): Add a FIXME comment to VirtualFree call. Fix memory
reservation and commit strategy when more memory is requested than
	available on the heap.  Release newly reserved memory if commiting
	it fails.  Add more comments to explain what we do.
2013-08-30 20:01:10 +00:00
Corinna Vinschen a723366660 * fhandler_tape.cc (mtinfo_drive::open): Handle bus reset gracefully
after opening the device.
2013-08-30 17:39:11 +00:00
Christopher Faylor c5abf768f9 * sigproc.cc (pending_signals::add): Properly maintain linked list.
(wait_sig): Use already calculated 'next' element when signal is blocked.
2013-08-30 15:44:57 +00:00
Corinna Vinschen 6585330779 * mtinfo.h (class mtinfo_part): Change type of block numbers to int64_t.
(mtinfo_part::initialize): Ditto for nblock parameter in declaration.
	(class mtinfo_drive): Change type of block number to int64_t.  Change
	all parameters indicating a block number to int64_t in method
	declarations.
	* fhandler_tape.cc (mtinfo_part::initialize): Ditto in definition.
	(mtinfo_drive::get_pos): Ditto.  Replace low and high with a
	ULARGE_INTEGER and use it's components in call to GetTapePosition.
	Store full value in block.
	(mtinfo_drive::_set_pos): Change type of count parameter to int64_t.
	Change call to SetTapePosition accordingly.
	(mtinfo_drive::set_pos): Change type of count parameter to int64_t.
	Change local variables holding block numbers accordingly.
	(mtinfo_drive::get_status): Don't bail out early if fetching media
	parameters fails.
	(mtinfo_drive::ioctl): Add explicit cast matching receiving type in
	MTTELL and MTIOCPOS calls.
2013-08-26 16:14:40 +00:00
Corinna Vinschen 8451a289cc * flock.cc (lockf_t::from_obj_name): Fix test for valid pid. 2013-08-23 20:40:27 +00:00
Christopher Faylor 1560d3e281 cygwin changes:
* spawn.cc (child_info_spawn): Revert previous change.  Always set
	lpReserved2.
	* release/1.7.25: Change wording.
doc changes:
	* new-features.xml (ov-new1.7.25): Change wording.
2013-08-23 18:19:46 +00:00
Christopher Faylor 0d585a6e8c * child_info.h (PROC_MAGIC_GENERIC): Define differently for x86 vs. x86_64. 2013-08-23 14:32:28 +00:00
Corinna Vinschen bb1114d912 *** empty log message *** 2013-08-23 09:43:58 +00:00
Corinna Vinschen 10822894db * path.h (enum path_types): Drop definition of PATH_64BITEXEC.
(path_conv::iscygexec32): Drop unused inline function.
	(path_conv::iscygexec64): Ditto.
	(path_conv::set_cygexec): Remove unnecessary setting of PATH_64BITEXEC.
	* spawn.cc (child_info_spawn::worker): Disable setting of
	STARTUPINFOW::lpReserved2 and STARTUPINFOW::cbReserved2 for non-Cygwin
	child processes.  Explain why.
2013-08-23 09:29:25 +00:00
Corinna Vinschen 3ee82da30d * fhandler_tape.cc (mtinfo_drive::create_partitions): Allow partitioning
of drives supporting select partitions.
	(mtinfo_drive::get_status): Fill in current partition and number of
	partitions on tape into mt_resid.
	* include/cygwin/mtio.h (struct mtget): Align mt_resid comment to
	aforementioned change.
	* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2013-08-21 20:28:12 +00:00
Corinna Vinschen 30990eaa27 * fhandler_tape.cc (mtinfo_drive::create_partitions): Fix long-standing
bug disabling creation of two partitions on drives supporting initiator
	partitions.
	(mtinfo_drive::set_blocksize): Update media information after setting
	blocksize succeeded.
	(mtinfo_drive::get_status): Fetch fresh media information.
2013-08-20 20:17:14 +00:00
Corinna Vinschen 651133f28d * lc_msg.h: Regenerate.
* nlsfuncs.cc (__get_lcid_from_locale): Update list of Script-only
	locales to Windows 8.
	(__set_charset_from_locale): Take locales added with Windows 8 and 8.1
	into account.
2013-08-19 16:21:29 +00:00
Corinna Vinschen 48199c0d39 * fhandler_tape.cc (mtinfo_drive::set_pos): Remove unneeded linebreak.
(mtinfo_drive::get_status): Drop using get_ll when it's not required.
2013-08-19 10:24:37 +00:00