Commit Graph

6230 Commits

Author SHA1 Message Date
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 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 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
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 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 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
Corinna Vinschen 890d4161d8 Drop redundant entry 2013-08-15 09:49:51 +00:00
Corinna Vinschen ef23b0a6a4 * include/sys/cygwin.h (struct per_process): Add posix_memalign. Reduce
size of unused2 accordingly.
	* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
	* lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Initialize
	u->posix_memalign with address of posix_memalign.
	* malloc_wrapper.cc (posix_memalign): Call user-provided posix_memalign
	rather than just returning ENOSYS.
	* globals.cc (__cygwin_user_data): Initialize posix_memalign member.
2013-08-14 11:44:23 +00:00
Corinna Vinschen 2da426bee6 * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 24. 2013-08-09 09:12:55 +00:00
Corinna Vinschen d23db5c830 * fhandler_disk_file.cc (fhandler_base::open_fs): Fix indentation. 2013-08-07 09:04:39 +00:00
Christopher Faylor 5213ca6f1c * fhandler_tty.cc: Revert accidental checkin.
* update-copyright: Ditto.
2013-07-31 15:19:18 +00:00
Christopher Faylor 24557e9caa * cygheap.cc (cmalloc): Use size_t for size field.
(cmalloc_abort): Ditto.
(crealloc): Ditto.
(crealloc_abort): Ditto.
(ccalloc): Ditto.
(ccalloc_abort): Ditto.
* cygheap_malloc.h (HEAP_USER): Add.
(cmalloc): Use size_t for size field in declaration.
(cmalloc_abort): Ditto.
(crealloc): Ditto.
(crealloc_abort): Ditto.
(ccalloc): Ditto.
(ccalloc_abort): Ditto.
* path.cc (normalize_posix_path): Don't check existence of / or // dir in
parent dir check.
2013-07-31 14:43:05 +00:00
Corinna Vinschen fd5f6eb13e * path.cc (normalize_posix_path): Don't check existence of / or // dir
in parent dir check.
2013-07-31 10:26:51 +00:00
Christopher Faylor 033fe7d87f cygwin directory changes:
* environ.cc (tty_is_gone): Delete.
	(known): Delete tty, add wincmdln.
	* globals.cc: Reorganize list of environment bools, remove explicit =
	false for slight load time optimization.
	(wincmdln): New global.
	* spawn.cc (child_info_spawn::worker): Honor wincmdln.

doc directory changes:
	* new-features.sgml (ov-new1.7.23): Add new section.  Mention wincmdln.
	* cygwinenv.xml: Mention wincmdln.
2013-07-26 17:28:00 +00:00
Corinna Vinschen 16efa64721 * ntdll.h (struct _SEMAPHORE_BASIC_INFORMATION): Define.
(enum _SEMAPHORE_INFORMATION_CLASS): Define.
	(NtQuerySemaphore): Declare.
	* thread.h (class semaphore): Add member startvalue.
	(semaphore::fixup_before_fork): New inline method.
	(semaphore::_fixup_before_fork): Declare.
	* thread.cc (MTinterface::fixup_before_fork): Additionally call
	semaphore::fixup_before_fork.
	(semaphore::semaphore): Set currentvalue to -1.  Set startvalue to
	incoming initializer value.
	(semaphore::_getvalue): Just query semaphore using NtQuerySemaphore
	rather then using WFSO/Release.
	(semaphore::_post): Drop setting currentvalue.  It's not thread-safe.
	(semaphore::_trywait): Ditto.
	(semaphore::_timedwait): Ditto.
	(semaphore::_wait): Ditto.
	(semaphore::_fixup_before_fork): New method, setting currentvalue from
	actual windows semaphore right before fork.
	(semaphore::_fixup_after_fork): Drop kludge from 2013-07-10.  Drop
	FIXME comment.
2013-07-23 14:15:20 +00:00
Corinna Vinschen 6c1f4d7d64 * cygtls.cc (well_known_dlls): Add kernelbase.dll. 2013-07-23 12:46:02 +00:00
Corinna Vinschen 3fdddd7d77 * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 23. 2013-07-22 15:08:54 +00:00
Corinna Vinschen e6ff6a18d4 * regex/regcomp.c (wgetnext): Add a kludge to be more glibc compatible.
Add comment to explain.
2013-07-21 19:28:45 +00:00
Christopher Faylor d31805a14c * exceptions.cc (signal_exit): Remove comment. Use __builtin_frame_address. 2013-07-20 17:11:44 +00:00
Christopher Faylor 5ce53ae0ea * exceptions.cc (signal_exit): Nope. Nevermind. Dump core unconditionally. 2013-07-20 16:19:51 +00:00
Christopher Faylor fb6cf945f9 * exceptions.cc (signal_exit): Add a FIXME comment. 2013-07-19 23:13:58 +00:00
Christopher Faylor 3a4dab46c3 * exceptions.cc (signal_exit): Only dump core when it's a "kernel" signal.
Only use RtlCaptureContext on x86_64.  It doesn't seem to do what's expected on
x86.
2013-07-19 23:04:32 +00:00
Christopher Faylor bbdd6c47c9 * spawn.cc (child_info_spawn::worker): Reinstate using temp buffer for wide
character command-line storage.  Use wcs method to convert command line.
* winf.h (lb_wcs): Delete.
(linebuf::wcs): Implement new single-argument method.
2013-07-19 22:44:02 +00:00
Christopher Faylor 132e0f0182 * lib/libcmain.c (main): Don't point to last quoted character if the only thing
in the buffer is the program name.
2013-07-19 19:04:13 +00:00
Christopher Faylor f53c4d6921 . 2013-07-19 17:29:01 +00:00
Christopher Faylor 521953a83a * common.din: Export GetCommandLine{A,W}.
* kernel32.cc: Add includes needed for GetCommandLine functions.
(ucmd): New function.
(cygwin_GetCommandLineW): Ditto.
(cygwin_GetCommandLineA): Ditto.
* spawn.cc (child_info_spawn::worker): Rename one_line -> cmd.  Use lb_wcs
macro to generate a wide character version of the line buffer.  Remove
duplicate printing of command line.  Don't access members of linebuf directly.
* winf.h: Use pragma once.
(linebuf): Make storage private.
(linebuf::operator size_t): New operator.  Return size of buf.
(linebuf::operator wchar_t): New operator.
(linebuf::wcs): New function.
(lb_wcs): New macro.
* include/cygwin/version.h: Bump API minor number to 268.
* strfuncs.cc: Clarify descriptive file comment.
2013-07-19 17:28:34 +00:00
Corinna Vinschen 78cefca9fc * cygtls.cc (_cygtls::remove): Close cw_timer handle, thus avoiding
handle leak.
2013-07-19 11:54:51 +00:00