Commit Graph

9107 Commits

Author SHA1 Message Date
Christopher Faylor 1e5bcae135 * dtable.cc (fh_alloc): Don't parse /dev/tty if ctty is < 0. Reset major/minor
from the specific tty to those for /dev/tty.
2011-10-11 12:39:31 +00:00
Christopher Faylor be96a30c43 * syscalls.cc (open): Add temporary kludge to avoid assigning the controlling
tty on open unless the open is for stdin/stdout/stderr.
* tty.cc (tty_list::connect): Set ENXIO when can't find a tty.
2011-10-10 22:01:06 +00:00
Corinna Vinschen 4c34aaba55 * fhandler.h (fhandler_process::closedir): Declare.
* fhandler_process.cc (fhandler_process::closedir): New function to
	avoid a SEGV in fhandler_proc::closedir.
2011-10-10 18:59:56 +00:00
Corinna Vinschen 378eaba88b * cygserver.sgml: Change -v to -V, same as in sources. 2011-10-10 15:52:48 +00:00
Corinna Vinschen 9e9bc3a4e4 * cygserver.cc (print_usage): Align output to utilities in utils
directory.
	(print_version): Ditto.
2011-10-10 15:48:54 +00:00
Corinna Vinschen f213601cda * ldd.cc (VERSION): Remove. 2011-10-10 15:34:52 +00:00
Christopher Faylor c4fc42535c * ldd.cc: Update copyright. 2011-10-10 15:04:00 +00:00
Corinna Vinschen 92b499acff * Align usage output, version output, as well as usage and version
option handling to use the same style throughout all Cygwin utils.
	Throughout use program_invocation_short_name to refer to current
	process name in Cygwin executables.
	* utils.sgml: Align documentation to above change.  Add missing
	sections for getconf, ldd, and setmetamode.
	* strace.cc (proc_child): Avoid compiler warning.
2011-10-10 14:57:48 +00:00
Corinna Vinschen 9198ac4dc6 * locale.cc (usage): Restructure, rephrase, add new options. Drop
arguments, don't exit.
	(print_version): New function.
	(longopts): Add -f, -n, and -V options.  Reorder.
	(opts): Add -f, -n, and -V options.
	(main): Call GetSystemDefaultUILanguage for -s option.  Call
	GetUserDefaultUILanguage for -u option.  Add -f and -n options and
	call GetUserDefaultLCID and GetSystemDefaultLCID respectively.  Return
	0 after calling usage in -h case.  Add -V option and call print_version.
	Don't print full usage in default case, rather just a short help message
	similar to GNU tools.
	* utils.sgml (locale): Align to above changes.  Rephrase description.
2011-10-10 09:50:43 +00:00
Corinna Vinschen f818494c63 * cygcheck.cc (check_keys): Use UNICODE Win32 functions. 2011-10-10 09:42:00 +00:00
Christopher Faylor 336e8ee685 * fhandler_tty.cc (fhandler_pty_slave::open): Clarify debugging output.
(fhandler_pty_slave::open): Change ENOENT to ENXIO when can't open a tty.
2011-10-10 04:05:29 +00:00
Christopher Faylor 3d1dd0789e * fhandler.h (fhandler_console::tc_getpgid): New function.
* spawn.cc (spawn_guts): Add logic to put pure-windows processes "in the
background" when they are started that way.
2011-10-07 13:52:20 +00:00
Corinna Vinschen c53c656b1c * include/sys/cygwin.h (cygwin_getinfo_types): Define values
additionally as preprocessor symbols.
2011-10-07 13:49:17 +00:00
Corinna Vinschen 7bbfea993a Fix copyright. 2011-10-07 08:14:25 +00:00
Corinna Vinschen 852908e82d * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Send __SIGSETPGRP
pseudo signal to process group instead of just calling
	init_console_handler.
	* sigproc.cc (wait_sig): Call init_console_handler here on __SIGSETPGRP
	signal.
	* sigproc.h (__SIGSETPGRP): Define.
2011-10-06 19:47:45 +00:00
Christian Franke efe716bb8e 2011-10-06 Christian Franke <franke@computer.org>
* include/cygwin/wait.h: Use new __wait_status_to_int()
	macro to access status value in W*() status checks.
	Fix status description.
	* include/sys/wait.h: Allow `int' and `union wait' as
	wait status parameter.  Change __wait_status_to_int()
	macro and wait () prototypes accordingly.  Add inline
	functions for C++.  Remove extra `;'.
2011-10-06 16:02:37 +00:00
Corinna Vinschen 8dfce03bfa * external.cc (create_winenv): Rename from sync_winenv. Take
environment pointer as parameter and return pointer to corresponding
	win32 environment block if != NULL.  Otherwise just sync as before.
	(cygwin_internal): Add CW_CVT_ENV_TO_WINENV case.
	* include/cygwin/version.h: Bump API minor number.
	* include/sys/cygwin.h (cygwin_getinfo_types): Add CW_CVT_ENV_TO_WINENV.
2011-10-05 12:27:37 +00:00
Corinna Vinschen a06c3bf336 * net.cc (socketpair): Bind first socket to loopback only as well. 2011-10-05 06:18:16 +00:00
Keith Marshall 35ddfc9e28 Rationalise structure layout; add dirent.d_type field. 2011-10-01 20:18:10 +00:00
Christopher Faylor 36b6320736 * tty.cc (grantpt): Check for valid fd.
(unlockpt): Ditto.
2011-09-21 04:33:57 +00:00
Jon TURNEY 02a7f96ef7 * strace.cc (attach_process): Try to turn off DEBUG_ONLY_THIS_PROCESS
if Attaching to a process with the trace-children flag set.
	(handle_output_debug_string): Apparently we don't need to explicitly
	attach for debugging when a child process starts
	* Makefile.in (strace.exe): Link with ntdll
2011-09-15 16:49:51 +00:00
Corinna Vinschen 35e8bb2b7e * net.cc (cygwin_getsockopt): Drop erroneous double conversion of error
code returned by SOL_SOCKET/SO_ERROR.  Fix error handling.
2011-09-02 09:52:08 +00:00
Corinna Vinschen d94522a76a * lc_msg.h: Regenerate. 2011-09-01 19:19:29 +00:00
Corinna Vinschen e2d88014ac * dlfcn.cc (gfpod_helper): Helper function to search DLL using
a given DLL name.  Change default search path to allow /usr/bin.
	(get_full_path_of_dll): Find DLLs even if the caller used a ".so"
	suffix or a "lib" prefix for the DLL.
2011-09-01 08:17:07 +00:00
Corinna Vinschen 52a5f8cc1a * flock.cc (inode_t::unlock_and_remove_if_unused): Rename from
unlock_and_remove.
2011-08-31 16:35:19 +00:00
Corinna Vinschen 2e560a092c * flock.cc (LOCK_OBJ_NAME_LEN): Change to accommodate extra lf_ver
field.
	(class lockf_t): Add lf_ver field.
	(lockf_t::lockf_t): Initialize lf_ver to 0.
	(class inode_t): Change i_wait to i_cnt.  Change comment to explain
	change in usage.
	(inode_t:use): Rename from wait.  Make private.
	(inode_t::unuse): Rename from unwait.  Make private.
	(inode_t::inuse): Rename from waiting.  Make private.
	(inode_t::notused): New public method to set use count to 0.
	(inode_t::unlock_and_remove): New method to unlock node and to delete
	it if it's unused in current process.
	(fhandler_base::del_my_locks): Drop global list lock.  Drop variable
	no_locks_left.  Simpify unlocking and removing node by just calling
	unlock_and_remove.
	(fixup_lockf_after_exec): Call notused method for each node.
	(inode_t::get): Call use method.  Lock node only if outside of list
	lock.
	(inode_t::get_all_locks_list): Accommodate additional lf_ver field
	when creating lockf_t structure from object name.
	(lockf_t::create_lock_obj_attr): Accommodate additional lf_ver field
	when creating object name from lockf_t structure.  Handle
	STATUS_OBJECT_NAME_COLLISION gracefully in F_POSIX case as well.
	Change comment accordingly.  Increment lf_ver field rather than high
	byte of lf_wid field.  Simplify comment.
	(fhandler_disk_file::lock): Always call unlock_and_remove rather than
	just UNLOCK on node.
	(lf_setlock): Move ret definition where it's used.  Drop unneeded
	tests for obj being not NULL.  Only check for deadlock condition if the
	lock we're trying to establish is a POSIX lock.  Revamp object
	collecting and wait code to cover all cases.  Don't return with EDEADLK
	if blocking process can't be opened for synchronization in F_POSIX case,
	rather just wait like in F_FLOCK case.  Change system_printf to
	debug_printf in that case.  Only run WaitForMultipleObjects with high
	priority.  Close obj and process handles prior to locking node.
2011-08-29 13:50:25 +00:00
Keith Marshall 36ccb620ec Don't expose implementation detail for opaque DIRENT structures. 2011-08-27 20:16:47 +00:00
Corinna Vinschen f4ec874328 * fhandler.cc (fhandler_base::open): Fix typo in comment.
(fhandler_base::close): Move call to del_my_locks from here...
	* fhandler_disk_file.cc (fhandler_disk_file::open): ...to here.
	* flock.cc (struct lockfattr_t): New type.
	(lockf_t::close_lock_obj): New method, use throughout.
	(lockf_t::create_lock_obj_attr): New method.
	(lockf_t::create_lock_obj): Use create_lock_obj_attr method.  Handle
	STATUS_OBJECT_NAME_COLLISION in F_FLOCK case gracefully.  Add lengthy
	comments to explain why and how.
	(lockf_t::open_lock_obj): Use create_lock_obj_attr method.
	(lockf_t::del_lock_obj): Call NtSetEvent rather than SetEvent for
	symmetry.
	(fhandler_disk_file::lock): Define n only where it's used.  Call
	need_fork_fixup only if call was successful.  Handle EINTR and
	ECANCELED return values from lf_setlock.
	(lf_setlock): Drop WAIT_UNLOCKED and WAIT_PROC_EXITED.  Don't wait
	for event object handle count to become <= 1 in F_LOCK case.
	Simplify WFMO return value handling.  Don't handle signal and cancel
	events here; just return with appropriate error code instead.
	(lf_getblock): Ignore locks for which the handle can't be opened.
	Use IsEventSignalled.
	* ntdll.h (STATUS_INVALID_INFO_CLASS): Undef if defined elsewhere to
	make sure the definition is casted to NTSTATUS.
	(STATUS_INVALID_HANDLE): Define and ditto.
	(STATUS_OBJECT_NAME_COLLISION): Define.
	(NtSetEvent): Declare.
2011-08-27 20:01:29 +00:00
Christopher Faylor 2691168e98 * cygthread.cc (cygthread::simplestub): Notify that the thread has detached
also in freerange thread case.
2011-08-25 19:37:39 +00:00
Corinna Vinschen 603ef545bd * fhandler.cc (fhandler_base::open): Never open files with
FILE_OVERWITE/FILE_OVERWRITE_IF.  Set file size to 0 explicitely if
	regular, existing file has been opened for writing with O_TRUNC flag
	set.  Explain why.
2011-08-25 13:35:43 +00:00
Corinna Vinschen 929a140824 * thread.cc (pthread::pthread): Drop setting parent_tls. Call
sigprocmask to copy parent thread signal mask into new parent_sigmask
	member.
	(pthread::thread_init_wrapper): Copy _my_tls.sigmask from new
	parent_sigmask member.
	* thread.h (class pthread): Drop parent_tls.  Add parent_sigmask.
2011-08-24 15:18:17 +00:00
Christopher Faylor 8323a37d5d * thread.cc (pthread::exit): Create dummy tls structure to hold _main_tls
contents if we've asked _main_tls to exit.
2011-08-24 14:23:38 +00:00
Chris Sutcliffe b84aabf695 2011-08-23 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/_mingw.h: Increment version to 3.20.
2011-08-23 22:59:35 +00:00
Chris Sutcliffe 99724a3258 2011-08-23 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* tlsmthread.c: Update to reflect changes in tlssup.c.
        * tlssup.c: code clean-up.
2011-08-23 22:27:35 +00:00
Corinna Vinschen 58ef30a4e7 * poll.cc (poll): Don't return prematurely if invalid fds have been
encountered.  Enforce timeout set to 0 in case of invalid fds.  Take
	number of invalid fds into account when returning.
2011-08-23 14:05:04 +00:00
Corinna Vinschen 247caa48ea * fhandler_socket.cc (fhandler_socket::send_internal): Fix setting
nosignal flag.  Convert ECONNABORTED on connection-oriented socket
	to EPIPE, too.
2011-08-23 13:07:24 +00:00
Christopher Faylor 8f8977bb8b * Makefile.in: Check for header file existence when building dumper.exe too. 2011-08-21 19:36:52 +00:00
Christopher Faylor 059f809e4b * dtable.cc (conv_start_chars): Remove unneeded section attribute. 2011-08-21 18:45:07 +00:00
Yaakov Selkowitz 0cd08cee4b * include/paths.h (_PATH_MAILDIR): Define.
(_PATH_SHELLS): Define.
2011-08-21 03:22:30 +00:00
Corinna Vinschen f71c1cdb55 * fhandler_process.cc (format_process_maps): Define page protection
shortcuts RO, X, and WC.  Use in creating access flag string.  Don't
	set type flag to 's' for copy-on-write pages, as on Linux.
2011-08-20 18:55:45 +00:00
Chris Sutcliffe 8d5b10a681 2011-08-20 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/_mingw.h: Increment version to 3.19.
2011-08-20 05:00:12 +00:00
Chris Sutcliffe 0ed575b596 2011-08-19 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/float.h: Modify guard to accomodate CLang.

        Thanks to Ruben Van Boxem for the report.
2011-08-20 04:12:22 +00:00
Chris Sutcliffe ea2b1b2ff0 2011-08-19 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* tlssup.c: Remove mingwm10.dll fallback.
2011-08-20 04:11:28 +00:00
Chris Sutcliffe 74604ab159 2011-08-19 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/sys/types.h (ssize_t): Defined as int as opposed to long.

        Thanks to bvassche for the report.
2011-08-20 01:38:16 +00:00
Yaakov Selkowitz 1165d4442d * new-features.sgml (ov-new1.7.10): Document /proc/devices
and /proc/misc.
2011-08-19 20:06:28 +00:00
Yaakov Selkowitz 07797cc0d8 * devices.h (fh_devices): Define DEV_MISC_MAJOR, DEV_MEM_MAJOR,
DEV_SOUND_MAJOR.  Use throughout.
* fhandler_proc.cc (proc_tab): Add /proc/devices and /proc/misc
virtual files.
(format_proc_devices): New function.
(format_proc_misc): New function.
2011-08-19 20:05:15 +00:00
Christopher Faylor c8a66289e4 * dtable.cc: Mark some const variables as static.
* environ.cc (conv_start_chars): Move to shared cygwin region and initialize at
compile time.
(match_first_char): New generic function for querying conv_start_chars.
(posify_maybe): Rename from posify.
(environ_init): Remove conv_envvars initialization.  Don't check
conv_start_chars, just allow posify_maybe to make the decision.
* fhandler_console.cc (__vt100_conv): Fix formatting.  Mark as const.
2011-08-19 18:19:22 +00:00
Corinna Vinschen aeeaae457b * fhandler_console.cc (fhandler_console::read): Recognize backspace key
using the device independent key code, rather than the device dependent
	scan code.
2011-08-19 13:10:01 +00:00
Corinna Vinschen 17e1361aa3 * include/winuser.h: Ad missing MAPVK_xxx definitions. 2011-08-19 11:58:05 +00:00
Yaakov Selkowitz 28c2fbeed8 * sysv_shm.cc (ACCESSPERMS): Remove to fix redefined warning, as
this is now defined in <sys/stat.h>.
2011-08-19 01:41:49 +00:00
Christopher Faylor 6072b95eeb * dcrt0.cc (dll_crt0_0): Remove unneeded __stdcall decoration.
* init.cc: Reflect change to dll_crt0_0 in declaration.
2011-08-18 15:59:16 +00:00
Corinna Vinschen 8f19b4b64f * dtable.cc (dtable::get_debugger_info): Add missing braces.
(dtable::stdio_init): Fix incorrect negation of not_open(2) condition.
2011-08-18 09:16:50 +00:00
Pierre Humblet 927761a425 2011-08-16 Pierre Humblet <Pierre.Humblet@ieee.org>
* net.cc (gethostby_helper): Remove DEBUGGING code from and
        streamline the second pass.
2011-08-16 23:32:18 +00:00
Corinna Vinschen 833db5481f * dlfcn.cc (dlopen): Reimplement RTLD_NODELETE for Windows 2000 using
internal datastructures.  Explain the code.
	* ntdll.h (struct _LDR_DATA_TABLE_ENTRY): Define.
	(struct _PEB_LDR_DATA): Define.
	(struct _PEB): Change PVOID LoaderData to PPEB_LDR_DATA Ldr.

	* fhandler_process.cc (format_process_maps): Call NtQueryVirtualMemory
	with valid return length pointer.  Explain why.
2011-08-16 20:08:34 +00:00
Corinna Vinschen 9d3b795b47 * new-features.sgml (ov-new1.7.10): Document new RTLD flags. 2011-08-16 14:51:06 +00:00
Corinna Vinschen c429beb296 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. 2011-08-16 14:48:38 +00:00
Corinna Vinschen 6bc64eac26 * autoload.cc (GetModuleHandleExW): Define.
* dlfcn.cc: Throughout mark exported symbols as extern "C".
	(dlopen): Unignore flags argument.  Define ret to NULL.  Fix typo in
	comment.  Support Glibc flags RTLD_NOLOAD and RTLD_NODELETE.
	* include/dlfcn.h:  Clean up comments.
	(RTLD_NODELETE): Define.
	(RTLD_NOLOAD): Define.
	(RTLD_DEEPBIND): Define.
2011-08-16 14:44:26 +00:00
Corinna Vinschen 56c387b1b3 * pipe.cc (pipe): Just call _pipe with O_BINARY mode. Move code to
generate normalized pathnames from here...
	(_pipe): ...to here.
2011-08-15 16:05:13 +00:00
Corinna Vinschen f8b8b1be3c * miscfuncs.cc (CreatePipeOverlapped): New function.
(ReadPipeOverlapped): Ditto.
	(WritePipeOverlapped): Ditto.
	* miscfuncs.h: Declare new functions.
	* pinfo.cc (commune_process): Call WritePipeOverlapped instead of
	WriteFile.  Set timeout to 1 sec.
	(_pinfo::commune_request): Call ReadPipeOverlapped instead of ReadFile.
	Set timeout to 0.5 secs.
	* sigproc.cc (sig_send): Create pipe using CreatePipeOverlapped.
2011-08-13 10:28:15 +00:00
Christopher Faylor e1d5167d20 * miscfuncs.cc (create_pipe): Delete obsolete function.
* miscfuncs.h (create_pipe): Delete define.
* pipe.c (fhandler_pipe::create_selectable): Delete obsolete comment.
2011-08-12 16:55:35 +00:00
Corinna Vinschen 3de2809073 * new-features.sgml (ov-new1.7.10): Document large address awareness
of heap and new way to set the default heap size per executable.
	* setup2.sgml (setup-maxmem): Revamp to explain new method of
	allocating more heap on a per-executable basis.  Drop outdated stuff.
	Keep shortened description of heap_chunk_in_mb as note.
2011-08-12 13:51:21 +00:00
Corinna Vinschen ad39174691 * fhandler_proc.cc (fhandler_proc::closedir): Don't free, but delete
instead.

	Also fix previous ChangeLog entry.
2011-08-12 12:35:37 +00:00
Corinna Vinschen 1f08558f14 * fhandler.h (fhandler_proc::opendir): Declare.
(fhandler_proc::closedir): Declare.
	* fhandler_proc.cc (fhandler_proc::opendir): New method.  Fetch list
	of active processes here once to avoid potential duplicates.
	(fhandler_proc::closedir): New method.
2011-08-12 12:31:08 +00:00
Corinna Vinschen 6e2c582323 * fhandler_proc.cc (fhandler_proc::get_proc_fhandler): Don't allow to
access process info by using the Windows PID.
	* fhandler_process.cc (fhandler_process::fstat): Ditto.
	(fhandler_process::fill_filebuf): Ditto.
2011-08-11 16:43:26 +00:00
Corinna Vinschen 3b7cd74bfd * (winpids::add): Make sure to store always a Windows PID in
pidlist, even if pid is a Cygwin PID.
	(winpids::enum_processes): Fetch Cygwin processes from listing of
	shared cygwin object dir in the native NT namespace.  Only if winpid
	is true, fetch Windows processes using an additional call to
	NtQuerySystemInformation.
2011-08-11 07:28:42 +00:00
Corinna Vinschen 56a85b9cea * ps.cc (main): Don't overwrite process name, just attach <defunct>
to it for zombie processes.
2011-08-10 19:52:41 +00:00
Corinna Vinschen d10f0e106e * fhandler_process.cc (format_process_status): Always print process name
even for zombies.
	(get_mem_values): Fix loop fetching working set list to avoid out of
	memory conditions.  Return all mem values set to 0 for zombies.
	* ntdll.h (STATUS_PROCESS_IS_TERMINATING): Define.
2011-08-10 13:13:09 +00:00
Corinna Vinschen afe817741c * heap.cc (eval_initial_heap_size): New function fetching the heap
size from the LoaderFlags field in the PE/COFF header.
	(heap_init): Call eval_initial_heap_size rather than
	cygwin_shared->heap_chunk_size to fetch the initial heap size.
	* shared.cc (shared_info::heap_chunk_size): Remove.
	* shared_info.h (class shared_info): Drop heap_chunk member.
	(CURR_SHARED_MAGIC): Update.
2011-08-09 12:00:27 +00:00
Corinna Vinschen c29da54058 * ntdll.h (STATUS_NOT_FOUND): Define.
* ntea.cc (read_ea): Return correct ENOTSUP rather than EOPNOTSUPP.
	Handle STATUS_INVALID_DEVICE_REQUEST and STATUS_NOT_FOUND.  Explain
	why.  Convert conditional to switch statement.
	(write_ea): Return correct ENOTSUP rather than EOPNOTSUPP.  Handle
	STATUS_INVALID_DEVICE_REQUEST.  Convert conditional to switch statement.
2011-08-09 09:14:28 +00:00
Corinna Vinschen f0b7368c68 * resource.cc (getrlimit): Just return RLIM_INFINITY in a request for
RLIMIT_AS.
2011-08-07 19:49:08 +00:00
Corinna Vinschen 60b55c4c18 * fhandler_process.cc (format_process_maps): Actually print info about
the application heap of the printed process, not of the current process.
2011-08-07 11:04:32 +00:00
Corinna Vinschen e5366c218d * include/winnt.h (IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE,
IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY,
	IMAGE_DLLCHARACTERISTICS_NX_COMPAT): Fix typo in definitions.
	(IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE,
	IMAGE_DLL_CHARACTERISTICS_FORCE_INTEGRITY,
	IMAGE_DLL_CHARACTERISTICS_NX_COMPAT): Keep broken definitions for
	backward compatibility.
2011-08-05 07:02:26 +00:00
Corinna Vinschen 4593c596a8 * faq-using.xml (faq.using.bloda): Add NVIDIA. Change wording slightly. 2011-08-04 18:25:41 +00:00
Corinna Vinschen a5408d982c * net.cc (socketpair): Release sb0 if there's no space left for sb1. 2011-08-04 08:22:11 +00:00
Yaakov Selkowitz 2a5e0b2dee * new-features.sgml (ov-new1.7.10): Document new POSIX Clock Selection
option APIs.
2011-08-03 19:18:07 +00:00
Yaakov Selkowitz bfc071dbce * cygwin.din (clock_nanosleep): Export.
* posix.sgml (std-notimpl): Move clock_nanosleep from here...
(std-susv4): ... to here.
(std-notes): Note limitations of clock_nanosleep.
* signal.cc (clock_nanosleep): Renamed from nanosleep, adding clock_id
and flags arguments and changing return values throughout.
Improve checks for illegal rqtp values.  Add support for
CLOCK_MONOTONIC and TIMER_ABSTIME.
(nanosleep): Rewrite in terms of clock_nanosleep.
(sleep): Ditto.
(usleep): Ditto.
* thread.cc: Mark clock_nanosleep in list of cancellation points.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2011-08-03 19:17:02 +00:00
Christopher Faylor 2964913236 * dll_init.cc: Use fabort in favor of api_fatal and fork_info->abort where
appropriate throughout.
(fabort): Define.
(dll_list::topsort): Don't print sorting information.  Fix formatting.
(dll_list::topsort_visit): Fix formatting.
(dll_list::load_after_fork_impl): Perform comment fixups.
* sigproc.cc (child_info_fork::abort): (for now?) Always print cause of fork
failure.
* include/sys/strace.h (strace_vprintf): Remove _STRACE_NOTALL when printing.
We really do want to see this.
2011-08-03 17:58:59 +00:00
Yaakov Selkowitz f0968c1e7e * cygtls.h (struct _local_storage): Add cw_timer member.
* cygtls.cc (_cygtls::init_thread): Initialize locals.cw_timer.
(_cygtls::fixup_after_fork): Ditto.
* tlsoffsets.h: Regenerate.
* ntdll.h (enum _TIMER_INFORMATION_CLASS): Define.
(struct _TIMER_BASIC_INFORMATION): Define.
(NtQueryTimer): Declare function.
* thread.h (cancelable_wait): Change timeout argument to
PLARGE_INTEGER and provide NULL default.
(fast_mutex::lock): Adjust accordingly.
(pthread_cond::wait): Change timeout argument to PLARGE_INTEGER
and default to NULL.
* thread.cc (cancelable_wait): Change timeout argument to
PLARGE_INTEGER.  Initialize _cygtls.locals.cw_timer if needed.
Use NT waitable timers for handling timeout.  Return remaining time
to timeout argument if timeout was relative.
(pthread_cond::wait): Change timeout argument to PLARGE_INTEGER.
Adjust to change in cancelable_wait.
(pthread_mutex::lock): Adjust to change in cancelable_wait.
(pthread_spinlock::lock): Ditto.
(pthread::join): Ditto.
(__pthread_cond_dowait): Change waitlength argument to PLARGE_INTEGER.
Adjust to changes in cancelable_wait and pthread_cond::wait.
(pthread_cond_timedwait): Adjust to change in __pthread_cond_dowait.
(pthread_cond_wait): Ditto.
(semaphore::_timedwait): Adjust to change in cancelable_wait.
(semaphore::_wait): Ditto.
* exceptions.cc (handle_sigsuspend): Ditto.
* signal.cc (nanosleep): Ditto.
* wait.cc (wait4): Ditto. Fix copyright dates.
* times.cc (FACTOR, NSPERSEC): Move from here...
* hires.h (FACTOR, NSPERSEC): ...to here.
2011-08-03 16:40:48 +00:00
Corinna Vinschen d32e0bfc08 * syscalls.cc (faccessat): Fix parens in flag expression when calling
build_fh_name.

	* fhandler_disk_file.cc (fhandler_disk_file::mkdir): Fix typo in
	comment.
	* fhandler_socket.cc (fhandler_socket::bind): Ditto.
	* path.cc (symlink_worker): Ditto.
2011-08-01 17:01:38 +00:00
Christopher Faylor ab0887572f * dll_init.cc (dll_list::load_after_fork_impl): Add a hint to an error message. 2011-08-01 13:11:37 +00:00
Christopher Faylor dc3dc49831 * sigproc.cc (pending_signals::pending): Define new function.
(sig_dispatch_pending): Avoid calling sig_send if there are no pending signals.
2011-08-01 00:02:04 +00:00
Corinna Vinschen c114604529 * fhandler.h (class fhandler_dev_mem): Remove dup method declaration.
* fhandler_clipboard.cc (fhandler_dev_clipboard::dup): Accommodate the
	fact that the entire fhandler gets copied over to the child in
	operator =.
	* fhandler_floppy.cc (fhandler_dev_floppy::dup): Ditto.
	* fhandler_raw.cc (fhandler_dev_raw::dup): Ditto.
	* fhandler_serial.cc (fhandler_serial::dup): Ditto.
	* fhandler_socket.cc (fhandler_socket::dup): Ditto.
	* fhandler_virtual.cc (fhandler_virtual::dup): Ditto.
	* fhandler_mem.cc (fhandler_dev_mem::dup): Ditto.  Remove entirely.
2011-07-31 12:37:52 +00:00
Christopher Faylor 6c6fe41781 add missing entry 2011-07-30 21:09:20 +00:00
Christopher Faylor 53ad6f1394 * cygthread.cc (cygthread::async_create): Define new function.
* cygthread.h (cygthread::create): Use correct regparm.
(cygthread::standalone): Delete from class and from all constructors.
(cygthread::cygthread): Use three only arguments for detached threads, and
start the thread via QueueUserAPC/async_create.
* dcrt0.cc (dll_crt0_0): Remove handling for wincap.has_buggy_thread_startup.
(dll_crt0_1): Ditto.
* wincap.cc: Ditto throughout.
* wincap.h: Ditto.
2011-07-30 20:50:23 +00:00
Christopher Faylor f7e198a665 * fhandler.h (fhandler_base_overlapped::size): Declare/define size() function
for consistency.
(fhandler_termios::size): Ditto.
(fhandler_pty_common::size): Ditto.
2011-07-30 20:01:27 +00:00
Corinna Vinschen 9e242ba461 * fhandler_registry.cc (fhandler_registry::dup): Duplicate value_name. 2011-07-30 08:09:44 +00:00
Corinna Vinschen c487f2fef5 Throughout change "WinSock" to "Winsock" in comments.
* fhandler_socket.cc (fhandler_socket::sendmsg): Add missing call to
	get_inet_addr to convert AF_LOCAL to AF_INET sockets.
	* net.cc (cygwin_socket): Workaround UDP Winsock problem.  Add comment
	to explain why.
	* select.cc: Include winsock2.h rather than winsock.h.
2011-07-29 12:47:54 +00:00
Corinna Vinschen 108b037ea3 * include/winsock2.h (SIO_UDP_CONNRESET): Define. 2011-07-29 11:45:15 +00:00
Corinna Vinschen 303dc0230d * fhandler_disk_file.cc (__DIR_mounts::eval_ino): Create path_conv
with PC_KEEP_HANDLE flag.
	* path.h (path_conv::operator =): Duplicate UNICODE path as well.
	* security.cc (check_file_access): Use path_conv handle if available.
	* syscalls.cc (access): Create fhandler with PC_KEEP_HANDLE flag set.
	(euidaccess): Ditto.
	(faccessat): Ditto.
2011-07-26 13:30:41 +00:00
Corinna Vinschen f4529884e5 * ntdll.h: Fix typo in comment.
* path.cc: Ditto.
2011-07-26 09:54:11 +00:00
Corinna Vinschen f4fc0c59e3 * fhandler_console.cc (fhandler_console::ioctl): Fetch console events
using PeekConsoleInput and return only key down events in buf.
	* fhandler_tty.cc (fhandler_pty_slave::ioctl): Always return EINVAL
	if PeekNamedPipe fails.
	(fhandler_pty_master::ioctl): Ditto.
2011-07-25 15:19:35 +00:00
Corinna Vinschen cfb517f39a * fhandler_tty.cc (fhandler_pty_slave::ioctl): Drop FIONBIO case.
Handle FIONREAD.
	(fhandler_pty_master::ioctl): Ditto.  Call fhandler_base::ioctl to
	decode default condition.
	* fhandler_console.cc (fhandler_console::ioctl): Handle FIONREAD.
2011-07-22 18:50:42 +00:00
Christopher Faylor e9b5cc32f7 Corinna Vinschen <corinna@vinschen.de>
* fhandler.cc: Add #include for asm/socket.h for dealing with FIONREAD.
(fhandler_base::ioctl): Special-case errno for FIONREAD.
* fhandler_dsp.cc (fhandler_dev_dsp::ioctl): Rename parameter for consistency.
Call fhandler_base::ioctl to decode default condition.
* fhandler_serial.cc (fhandler_serial::ioctl): Ditto.
* fhandler_tty.cc (fhandler_pty_slave::ioctl): Call fhandler_base::ioctl to
decode default condition.
* fhandler_windows.cc (fhandler_windows::ioctl): Ditto.
2011-07-21 20:21:46 +00:00
Corinna Vinschen 37aeec7f72 * heap.cc (eval_start_address): Simplify test for large address
awareness of executable, which works for 32 and 64 bit systems.
	Change comment accordingly.
2011-07-21 17:52:05 +00:00
Corinna Vinschen 86719a10d0 * heap.cc (eval_start_address): New static function to evaluate the
best start address for the application heap.
	(heap_init): Call eval_start_address to fetch the start value for
	start_address.  Move preceeding comment to eval_start_address.
2011-07-21 15:23:24 +00:00
Yaakov Selkowitz 8a7b0a00df * cygwin.din (pthread_condattr_getclock): Export.
(pthread_condattr_setclock): Export.
* posix.sgml (std-notimpl): Move pthread_condattr_getclock and
pthread_condattr_setclock from here...
(std-susv4): ... to here.
* sysconf.cc (sca): Set _SC_CLOCK_SELECTION to _POSIX_CLOCK_SELECTION.
* thread.cc: (pthread_condattr::pthread_condattr): Initialize clock_id.
(pthread_cond::pthread_cond): Initialize clock_id.
(pthread_cond_timedwait): Use clock_gettime() instead of gettimeofday()
in order to support all allowed clocks.
(pthread_condattr_getclock): New function.
(pthread_condattr_setclock): New function.
* thread.h (class pthread_condattr): Add clock_id member.
(class pthread_cond): Ditto.
* include/pthread.h: Remove obsolete comment.
(pthread_condattr_getclock): Declare.
(pthread_condattr_setclock): Declare.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2011-07-21 09:39:22 +00:00
Andy Koppe 42f8872e61 * setup-net.sgml (setup-packages): Reflect removal of Prev button.
Also document Keep button and improve description of Exp button.
2011-07-20 19:31:05 +00:00
Yaakov Selkowitz 3989afabe7 * new-features.sgml (ov-new1.7.10): Document getconf(1). 2011-07-20 01:19:53 +00:00
Yaakov Selkowitz c769bdf5ac * Makefile.in (CYGWIN_BINS): Add getconf.
(getconf.c): New file.
2011-07-20 01:18:14 +00:00
Yaakov Selkowitz 7ec669539f * sysconf.cc (sca): Return -1 for _SC_THREAD_ROBUST_PRIO_INHERIT,
_SC_THREAD_ROBUST_PRIO_PROTECT, and _SC_XOPEN_UUCP.
(SC_MAX): Redefine accordingly.
(csa): Return strings for _CS_POSIX_V7_THREADS_CFLAGS,
_CS_POSIX_V7_THREADS_LDFLAGS, and _CS_V7_ENV.
(CS_MAX): Redefine accordingly.
* include/limits.h (LONG_BIT): Define.
(WORD_BIT): Define.
2011-07-18 23:08:09 +00:00
Corinna Vinschen b6c42976eb * heap.cc (heap_init): Change type of largest_found to PVOID. Start
querying memory at 0x20000000.  Use largest_found pointer when trying
	to allocate largest free memory area found.
2011-07-18 08:43:49 +00:00
Christopher Faylor ec5c578057 correct comment 2011-07-15 20:59:30 +00:00
Christopher Faylor b5b62e5445 * cygwinenv.sgml (using-cygwinenv): Clarify "glob" works. 2011-07-15 20:59:07 +00:00
Corinna Vinschen 8924483160 * fhandler_console.cc (fhandler_console::input_tcsetattr): Revert to
setting ENABLE_PROCESSED_INPUT depending on ISIG and IGNBRK.
	(fhandler_console::tcgetattr): Set ISIG depending on
	ENABLE_PROCESSED_INPUT as well.
2011-07-14 10:02:11 +00:00
Corinna Vinschen f55fc99c77 * fhandler_serial.cc (fhandler_serial::raw_read): Handle non-blocking
case more thoroughly.
2011-07-13 18:59:41 +00:00
Christopher Faylor b4efd5410c * setup_handler (setup_handler): Change break to goto out, missed in 2011-07-06
changes.
2011-07-13 17:53:21 +00:00
Christopher Faylor c57fc872f5 * fhandler_tty.cc (fhandler_pty_slave::ioctl): Remove erroneous support for
TIOCLINUX for pty.  Get rid of unneeded EINVAL handling in wake of tty removal.
Remove now-unneeded variable.
2011-07-11 00:03:55 +00:00
Corinna Vinschen 071bf81128 * include/netdb.h (gethostbyname2): Declare. 2011-07-10 13:22:48 +00:00
Eric Blake 14295a59d3 pthread_sigmask: fix return value to match POSIX
* signal.cc (handle_sigprocmask): Return error rather than setting
errno, for pthread_sigmask.
(sigprocmask): Adjust caller.
2011-07-10 00:01:33 +00:00
Corinna Vinschen 66965620fc * miscfuncs.cc (yield): Drop thread priority only once. 2011-07-07 06:21:24 +00:00
Christopher Faylor 57e64035f8 * exceptions.cc (_cygtls::interrupt_now): Back out previous change since it
could theoretically cause a non-CTRL-C-able program if a program has suffered
memory corruption.
(setup_handler): Ditto.
2011-07-06 18:44:06 +00:00
Corinna Vinschen 5e6a91549e * sched.c (sched_yield): Just call SwitchToThread because yield now
potentially switches CPU.
2011-07-06 18:35:44 +00:00
Christopher Faylor 51b5e9211d * exceptions.cc (_cygtls::interrupt_now): Don't check for spinning here.
(setup_handler): Check for spinning here, assuming that it is transitory and
should not affect the retry loop.
2011-07-06 18:14:22 +00:00
Christopher Faylor d1204b6378 * exceptions.cc (CALL_HANDLER_RETRY_INNER): Rename to reflect different
functionality.
(CALL_HANDLER_RETRY_OUTER): New define.
(setup_handler): Add outer loop to signal handler to try harder to deliver the
signal.
* miscfuncs.cc (yield): Drop priority and use SleepEx() to force thread
rescheduling rather than relying on SwitchToThread().
2011-07-06 16:33:30 +00:00
Corinna Vinschen fa0b926af9 * sigproc.cc (wait_sig): Fix debug output. 2011-07-06 12:39:36 +00:00
Corinna Vinschen 7616b79e0d * fhandler_console.cc (fhandler_console::input_tcsetattr): Make
ENABLE_PROCESSED_INPUT flag only depending on value of IGNBRK.
	(fhandler_console::tcgetattr): Don't set ISIG depending on
	ENABLE_PROCESSED_INPUT, set IGNBRK instead.
2011-07-05 18:01:13 +00:00
Corinna Vinschen 3fe31f2633 * security.cc (get_file_sd): Fix comment. 2011-07-05 15:42:43 +00:00
Corinna Vinschen 8c1f7cf707 * fhandler.cc (fhandler_base::open): Never create files with WRITE_DAC
access.  Explain why.
	* fhandler_disk_file.cc (fhandler_base::fstat_helper): Improve debug
	output.
2011-07-05 12:02:10 +00:00
Corinna Vinschen fcacca02dd * fhandler.cc (fhandler_base::open): Don't open file with WRITE_DAC
access on remote filesystem.  Explain why.
	* fhandler_disk_file.cc (fhandler_disk_file::mkdir): Ditto for
	directories.
	* fhandler_socket.cc (fhandler_socket::bind): Ditto for sockets.
	* path.cc (symlink_worker): Ditto for symlinks.
2011-07-05 09:59:34 +00:00
Christopher Faylor 3dce4ce653 * environ.cc (tty_is_gone): Wrap warning at 80 characters. 2011-07-04 18:14:31 +00:00
Corinna Vinschen fc3e7da6b0 Throughout, open console handles with sharing for reading and writing.
* dcrt0.cc (insert_file): Open file with full sharing allowed.
	* hookapi.cc (find_first_notloaded_dll): Ditto.
	* spawn.cc (av::fixup): Ditto.
2011-07-04 15:25:36 +00:00
Corinna Vinschen d3ed549d51 * dtable.cc (dtable::init_std_file_from_handle): Change test for console
device in call to fh->init to avoid conhost crash on W7.
2011-07-04 09:47:10 +00:00
Corinna Vinschen d51a9c25bd * environ.cc (environ_init): Reinstantiate on-the-fly CYGWIN variable
test and call to parse_options if found.
2011-07-04 09:39:20 +00:00
Christopher Faylor b9a0725042 * fhandler.cc (fhandler_base::open_with_arch): Call close_on_exec last to avoid
setting close_on_exec for archetype.
* fhandler_tty.cc (fhandler_pty_master::setup): Protect {from,to}_pty handles.
Use consistent naming in debug output.  Use inheritable handles and...
(fhandler_pty_master::fixup_after_fork): ...avoid duplicating handles here.
(fhandler_pty_slave::open): Don't set close_on_exec flag here.
2011-07-04 05:08:28 +00:00
Christopher Faylor c38da4ee1d * dtable.cc (cnew): Fix whitespace. 2011-07-01 22:04:20 +00:00
Corinna Vinschen 00994759b6 * include/sys/param.h (NGROUPS): Redefine as NGROUPS_MAX.
(MAXHOSTNAMELEN): Redefine with same value as MAX_HOSTNAME_LEN.  Change
	comment.
	(MAXPATHLEN): Improve comment.
	(MAXSYMLINKS): Define and add comment.
2011-07-01 12:45:25 +00:00
Corinna Vinschen 9780b0da3c * fhandler.cc (fhandler_base::open): Move NFS-specific code into the
code block handling FH_FS stuff.
2011-07-01 11:23:43 +00:00
Corinna Vinschen 3d938be6c5 * dtable.cc (fh_oom): Remove.
(fh_calloc): Remove.
	(cnew): Redefine to handle NULL returns from cmalloc.
	(build_fh_name): Accommodate new definition of cnew.  Remove unneeded
	test for fh_oom.
	(fh_alloc): Ditto.
2011-06-30 14:04:51 +00:00
Corinna Vinschen 4b626add7e * fhandler_console.cc (fhandler_console::read): Add comment.
(fhandler_console::input_tcsetattr): Don't set ENABLE_PROCESSED_INPUT
	if IGNBRK flag is set.
2011-06-30 13:55:57 +00:00
Corinna Vinschen 9e1fd6bcf7 * dtable.cc (fh_oom): New static fhandler storage.
(fh_calloc): New static function.  Add a comment to explain why this
	is needed.
	(cnew): Call fh_calloc as placement argument.
	(build_fh_name): Check return code from cnew against address of
	fh_oom to test for out of memory condition.
	(fh_alloc): Ditto.
	(build_fh_pc): Avoid a crash due to useing a NULL fhandler.
	* pipe.cc (fhandler_pipe::create): Check if build_fh_dev returned a
	valid pointer before using it.
2011-06-30 09:37:36 +00:00
Corinna Vinschen cb26eb6868 * fhandler_process.cc (heap_info::fill_if_match): Rename info to
note that this heap is a Windows heap.
	(format_process_maps): Print info about application heap.
2011-06-28 10:21:34 +00:00
Corinna Vinschen b9a5b2c45f * fhandler_console.cc (fhandler_console::read): Don't generate ^@ on
Ctrl+Alt+Space.
2011-06-24 08:25:19 +00:00
Corinna Vinschen c80de4f912 * fhandler_tty.cc (fhandler_pty_master::setup): Create pty pipes
non-inheritable.
2011-06-22 07:58:01 +00:00
Corinna Vinschen 49e6e30f7a * fhandler_tty.cc (fhandler_pty_master::setup): Fix crash in debug
output.
2011-06-22 07:37:49 +00:00
Corinna Vinschen 787908c173 * path.cc (normalize_win32_path): Skip all slashes after recognizing
a ".." path component.  Add comment.
2011-06-18 08:36:59 +00:00
Corinna Vinschen c36cd56c54 * fhandler.cc (fhandler_base::open): Drop local create_options variable.
Use options member instead.
	* fhandler.h (class fhandler_base): Change type of access member to
	ACCESS_MASK.  Change get_access and set_access methods accordingly.
	Add options member.  Add get_options and set_options methods.
	(class fhandler_disk_file): Add prw_handle.
	(fhandler_disk_file::prw_open): Declare.
	(fhandler_disk_file::close): Declare.
	(fhandler_disk_file::dup): Declare.
	(fhandler_disk_file::fixup_after_fork): Declare.
	* fhandler_disk_file.cc (fhandler_disk_file::fhandler_disk_file):
	Initialize prw_handle to NULL.
	(fhandler_disk_file::close): Close prw_handle.
	(fhandler_disk_file::dup): New method.
	(fhandler_disk_file::fixup_after_fork): Set prw_handle to NULL since
	prw_handle is not inherited.
	(fhandler_disk_file::prw_open): New method.  Add long comment to
	explain current behaviour.
	(fhandler_disk_file::pread): Revert previous change.  Change to use
	prw_handle if possible.
	(fhandler_disk_file::pwrite): Change to use prw_handle if possible.
2011-06-17 11:04:44 +00:00
Corinna Vinschen a716252619 * dcrt0.cc (dll_crt0_1): Call strace.dll_info after call to pinfo_init.
* strace.cc (strace::hello): Drop printing DLL information here since
	application info is not always available at this point.
	(strace::dll_info): New method to print DLL info.
	* include/sys/strace.h (strace::dll_info): Declare.
2011-06-17 08:30:27 +00:00
Corinna Vinschen 2ae8e0e482 * dtable.cc (handle_to_fn): Accommodate name change of pty named pipes,
otherwise ptys are not recognized.
2011-06-17 08:27:32 +00:00
Christopher Faylor 6f294f8601 * fhandler_console.cc (fhandler_console::set_unit): Set pc.file_attributes() to
reflect existence.
* fhandler.h (fhandler_pty_common::fhandler_pty_common): Ditto.
* pinfo.cc (_pinfo::set_ctty): Output device numbers in hex.
2011-06-16 23:00:00 +00:00
Christopher Faylor 4d046729d1 * errno.cc (EIO): Lowercase "o" representative string. 2011-06-15 17:36:10 +00:00
Corinna Vinschen b8b7eb058d * cygwinenv.sgml (using-cygwinenv): Move envcache, strip_title, title,
tty, and upcaseenv options to list of obsolete options.
	* effectively.sgml (using-console): Remove section.
	* new-features.sgml (ov-new1.7.10): Document removed CYGWIN options.
	Document removed tty mode.
2011-06-15 11:41:26 +00:00
Christopher Faylor c75b5b2d13 * cygheap.h (init_cygheap::ctty_on_hold): Remove conditionalized variable.
* dcrt0.cc (do_exit): Remove code which handled CYGWIN=tty style ttys.
* devices.in: Remove "/dev/ttym".
* dtable.cc: Rename tty to pty where appropriate throughout.
(dtable::stdio_init): Use new t->is_console rather than using now-deleted hwnd
element in tty structure.
(dtable::init_std_file_from_handle): Remove code which handled CYGWIN=tty style
ttys.
(fh_alloc): Ditto.
* fhandler.h: Rename tty to pty where appropriate.
(fhandler_pty_common): Delete output_done_event, ioctl_request_event,
ioctl_done_event.
(fhandler_pty_master::setup): Delete argument.
(fhandler_tty_master): Delete.
(fhandler_union): Delete __tty_master.
* fhandler_console.cc (use_tty): Delete.
(fhandler_console::get_tty_stuff): Set is_console to true rather than calling
sethwnd.
(fhandler_console::send_winch_maybe): Remove CYGWIN=tty considerations.
(fhandler_console::input_tcsetattr): Ditto.
* fhandler_termios.cc (fhandler_termios::tcsetpgrp): Use new t->is_console
rather than using now-deleted hwnd element in tty structure.
* fhandler_tty.cc: Rename tty to pty where appropriate throughout.
(tty_master): Delete.
(process_input): Ditto.
(process_output): Ditto.
(process_ioctl): Ditto.
(fhandler_tty_master::*): Ditto.
(fhandler_pty_master::process_slave_output): Remove CYGWIN=tty considerations.
(fhandler_pty_slave::open): Ditto for *_done_event.
(fhandler_pty_slave::write): Ditto.
(fhandler_pty_slave::ioctl): Ditto.
(fhandler_pty_slave::fch_open_handles): Ditto.
(fhandler_pty_slave::fch_set_sd): Ditto.
(fhandler_pty_slave::fch_close_handles): Ditto.
(fhandler_pty_common::close): Ditto.
(fhandler_pty_master::setup): Ditto.  Remove now-unneeded ispty parameter.
(fhandler_pty_master::open): Reflect argument removal for tty::allocate.
* select.cc: Rename tty to pty where appropriate throughout.
* sigproc.cc (proc_subproc): Remove CYGWIN=tty considerations.
* tty.cc (ttyslot): Accommodate CYGWIN=tty removal.
(tty_list::init_session): Ditto.
(tty_list::attach): Ditto.
(tty::create_master): Delete.
(tty_list::terminate): Ditto.
(tty_list::allocate): Delete "with_console" parameter.  Remove CYGWIN=tty
considerations.
(tty::init): Set is_console = false.  Use 'false' for was_opened since it is a
boolean.
* tty.h (*_{DONE,REQUEST}_EVENT): Delete.
(tty_min::is_console): Declare new field which replaces hwnd.
(tty_min::gethwnd): Delete.
(tty_min::sethwnd): Ditto.
(tty_list::allocate): Delete parameter.
(tty_list::terminate): Delete declaration.
* include/sys/cygwin.h (PID_USETTY): Redefine to PID_UNUSED1 and change comment
to reflect its availability.
2011-06-14 21:48:43 +00:00
Christopher Faylor d0009604ad * mingw: Force use of bash. 2011-06-14 15:04:04 +00:00
Christopher Faylor 0fdbb2d0cd * fhandler_tty_slave.cc (fhandler_tty_slave::fhandler_tty_slave): Revert
previous change since unit 0 is perfectly valid.
2011-06-13 23:49:00 +00:00
Christopher Faylor c3a9063f83 Rename FH_BAD to FH_NADA throughout.
* devices.h (FH_ERROR): New value.
(iscons_dev): Extend to detect all the console device types.
* devices.in: Set aside storage for FH_ERROR.
* dtable.cc (dtable::init_std_file_from_handle): Use iscons_dev to detect when
device is a console.
(fh_alloc): Pass device to console constructor.
(build_fh_pc): Short circuit when we detect that the constructor saw an error.
* fhandler.h (fhandler_console::fhandler_console): Accept fh_devices parameter.
(get_tty_stuff): Change to void.
* fhandler_console (fhandler_console::set_unit): Set device to FH_ERROR on
attempt to access anything other than the current console.
(fhandler_console::get_tty_stuff): Change to void return.
(fhandler_console::open): Return EPERM on FH_ERROR device type.
(fhandler_console::fhandler_console): Set the device type appropriately before
calling get_tty_stuff and rely on that function to reset it if necessary.
2011-06-12 20:15:26 +00:00
Christopher Faylor 1516a0b4d7 * environ.cc (create_upcaseenv): Delete.
(ucenv): Don't honor create_upcaseenv.
(environ_init): Remove early retrieval of CYGWIN environment variable.  Change
comment to reflect new behavior.
2011-06-10 15:06:13 +00:00
Christopher Faylor b6510ccdcd * child_info.h (CURR_CHILD_INFO_MAGIC): Reset.
(child_info::old_title): Delete.
(child_info::~child_info_spawn): Remove recording of old_title.
* dcrt0.cc (title_buf): Delete.
(child_info_spawn::handle_spawn): Remove recording of old_title.
(dll_crt0_1): Get rid of all title handling.
(do_exit): Ditto.
* environ.cc (known): Delete strip_title and title.
* fhandler_console.cc (fhandler_console::write): Remove recording of old_title.
* globals.cc (exit_states): Remove ES_TITLE.
(display_title): Delete.
(strip_title_path): Delete.
(old_title): Delete.
* spawn.cc (spawn_guts): Remove old_title accommodation.
2011-06-09 21:20:27 +00:00
Christopher Faylor e254790b66 * environ.cc (envcache): Delete.
(known): Remove envcache.
(getwinenv): Don't honor envcache setting.
2011-06-09 19:08:22 +00:00
Christopher Faylor b9cf88ddba * environ.c: Move code earlier to allow:
(_addenv): Call parse_options() when CYGWIN environment variable is being
changed.
(parse_options): Change parameter to 'const'.
2011-06-09 17:50:41 +00:00
Christopher Faylor bb37277ac2 * environ.cc (tty_is_gone): Add missing space to message. 2011-06-08 19:51:15 +00:00
Christopher Faylor 022e15dc60 * environ.cc (settings::set_process_state): Delete.
(tty_is_gone): New function.
(known): Change "tty" to call tty_is_gone().  Remove unneeded '&' from
beginning of function address.
(parse_options): Remove set_process_state handling.
* shared_info.h (CURR_USER_MAGIC): Reset.
(user_info::warned_notty): New member.
2011-06-08 19:27:48 +00:00
Christopher Faylor 0791c40b20 * fhandler_console.cc (fhandler_console::open_shared_console): Semi-revert to
using fixed location for console stuff.
* shared.cc (offsets): Ditto.  Comment.
* shared_info (shared_locations): Re-add SH_SHARED_CONSOLE.
2011-06-07 20:55:10 +00:00
Christopher Faylor b86f999af1 whitespace elimination 2011-06-06 05:02:13 +00:00
Christopher Faylor daf7238603 * fhandler_disk_file.cc (fhandler_disk_file::pread): Reset windows file
position pointer back to previous location after successful read.
2011-06-06 00:25:44 +00:00
Christopher Faylor d5cb221b85 * fhandler_console.cc (fhandler_console::open_shared_console): Don't zero
handle to open_shared since it is supposed to be an input.
(enum_windows): Set handle input to open_shared to NULL since it does not
represent any previously opened shared region.
* shared.cc (open_shared): Tweak debugging output.
2011-06-05 02:10:31 +00:00
Christopher Faylor 665f9a59a4 * ntdll.h (FILE_PIPE_*): Define constants.
* select.cc (pipe_data_available): Detect closing state.
2011-06-04 01:06:17 +00:00
Christopher Faylor cb353ff36f * pinfo.cc (_pinfo::set_ctty): Don't reset myself->{pgid,sid} if terminal has
no pgid or sid settings.
2011-06-04 00:29:19 +00:00
Christopher Faylor 32bf308231 * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Only raise SIGPIPE
when writing.
* fhandler.h: Include "tty.h".
(fhandler_termios::_tc): Rename from tc.
(fhandler_termios::tc): New method.
(fhandler_termios::tcinit): Remove an argument.
(fhandler_termios::get_ttyp): Use method to retrieve value.
(fhandler_console::console_state): Move here.
(fhandler_console::dev_state): Delete.
(fhandler_console::shared_console_info): Define.
(fhandler_console::open_shared_console): Move this function under
fhandler_console umbrella.
(fhandler_console::tc): Define.  Return static value.
(fhandler_console::focus_aware): Accommodate deletion of dev_state.
(fhandler_console): Add tty_list::get_cttyp as a friend.
* fhandler_console.cc (dev_state): Redefine as a pointer within
shared_console_info and change dev-> to dev.  throughout.
(fhandler_console::shared_console_info): Move into fhandler_console.
(fhandler_console::open_shared_console): Move into fhandler_console change
argument to simple bool.
(enum_windows): Accommodate changes to console_state and open_shared_console.
(console_unit::console_unit): Ditto.
(fhandler_console::get_tty_stuff): Accommodate change to dev_state.
(tty_list::get_cttyp): Accommodate change to
handler_console::shared_console_info.
(fhandler_console::read): Accommodate change from tc to tc ().
(fhandler_console::set_input_state): Ditto.
(fhandler_console::open): Accommodate tcinit argument change and change from tc
to tc().
(fhandler_console::input_tcsetattr): Accomodate change from tc to tc().
(fhandler_console::input_tcsetattr): Ditto.
(fhandler_console::write_normal): Ditto.
(fhandler_console::init): Ditto.
(fhandler_console::igncr_enabled): Ditto.
* fhandler_termios.cc (fhandler_termios::tcinit): Remove first argument.
Expect tc() to have been set up first.  Use tc() rather than tc.
(fhandler_termios::tcsetpgrp): Accomodate change from tc to tc().
(fhandler_termios::tcgetpgrp): Ditto.
(fhandler_termios::bg_check): Ditto.
(fhandler_termios::line_edit: Ditto.
(fhandler_tty_master::set_winsize): Ditto.
(fhandler_tty_slave::open): Ditto.
(fhandler_tty_slave::init): Ditto.
(fhandler_pty_master::write): Ditto.
(fhandler_pty_master::setup): Ditto.  Accommodate change in arguments to
tcinit.
(fhandler_tty_slave::fch_open_handles): Set _tc directly.
(tty_min::is_orphaned_process_group): Don't assume that parent pid exists.
* pinfo.cc (_pinfo::set_ctty): Reset myself->{pgid,sid} here if we were started
by a non-Cygwin process but the tty exists.
* shared_info.h (console_state): Delete from here.
* tty.h: Make multiple inclusion safe.
2011-06-04 00:12:29 +00:00
Christopher Faylor 83e4d35a89 * exceptions.cc (ctrl_c_handler): Simplify test for no parent tty.
* fhandler_console.cc (fhandler_console::get_tty_stuff): Return NULL if ctty is
not tty/console.  Improve test for slave tty/pty device.
2011-06-01 01:47:51 +00:00
Christopher Faylor be9b5aba26 * external.cc (fillout_pinfo): Don't truncate ctty if it's < 0.
* select.cc (pipe_data_available): Avoid printing debug info by default or
suffer very large strace files.
2011-06-01 01:20:28 +00:00
Christopher Faylor a7a1247770 * select.cc (pipe_data_available): New function - uses NtQueryInformationFile
to return information about pipes.
(peek_pipe): Rewrite to use pipe_data_available for both read and write tests.
2011-06-01 00:57:49 +00:00
Keith Marshall 2ec2d00e1b Correct checking for short option matches in getopt_long_only(). 2011-05-31 20:24:51 +00:00
Christopher Faylor 106e3acf59 * dtable.cc (dtable::select_write): Add missing argument to debug_printf.
* fhandler.cc (fhandler_base_overlapped::setup_overlapped): Explicitly set
io_pending to false.
(fhandler_base_overlapped::has_ongoing_io): Call GetOverlappedResult to force
completion of I/O.
(fhandler_base_overlapped::wait_overlapped): Rewrite to correctly deal with
nonblocking reads and to make more race proof.
(fhandler_base_overlapped::raw_write): Deal with new enum values.
(fhandler_base_overlapped::raw_read): Ditto.  Don't deal with ongoing I/O here
since it makes no sense in the read context.
* fhandler.h (enum wait_return): Add overlapped_unknown,
overlapped_nonblocking_no_data.
* pipe.cc (pipe): Add debugging output.
2011-05-31 00:26:37 +00:00
Christopher Faylor de3c57f06e * dll_init.cc (dll_list::append): Eliminate increment of unused tot variable.
* dll_init.h (dll_list::tot): Delete.
(dll_list::populate_all_deps): Delete undefined function.
* fhandler.cc (fhandler_base_overlapped::wait_overlapped): Move EPIPE handling
under error condition.
2011-05-30 17:16:24 +00:00
Christopher Faylor 6642f7daa3 * dll_init.cc (reserve_upto): Remove.
(release_upto): Ditto.
(dll_list::reserve_space): New function to reserve space needed by DLL_LOAD
dlls early in the fork process.
(dll_list::load_after_fork): Rewrite to use recursion to track reservations it
makes while trying to make dlls land where they belong.
(dll_list::load_after_fork_impl): New function used by load_after_fork.
(dll_list::alloc): Initialize image base field.
* dll_init.h (dll_list::prefered_base): New field.
(dll_list::reserve_space): Declare new function.
(dll_list::load_after_fork): Declare new function.
* fork.cc (frok::child): call dll_list::reserve_space early, so we can retry if
it fails.
2011-05-30 16:09:29 +00:00
Christopher Faylor 7123c8b1fd * fhandler_termios.cc (fhandler_termios::bg_check): Do not return EIO when a
process group has no leader as this is allowed and does not imply an orphaned
process group.  Add a test for orphaned process groups.
(tty_min::is_orphaned_process_group): Define new function.
* tty.h (tty_min::is_orphaned_process_group): Define new function.
2011-05-30 06:58:00 +00:00
Christopher Faylor 977ad5434c * dll_init.cc (dll_list::find_by_modname): New function to search the dll list
for a module name only (no path).
(dll_list::alloc): Initialize newly-added members of struct dll.
(dll_list::append): New function to factor out the append operation
(used by dll_list::topsort).
(dll_list::populate_deps): New function to identify dll dependencies.
(dll_list::topsort): New function to sort the dll list topologically by
dependencies.
(dll_list::topsort_visit): New helper function for the above.
* dll_init.h (dll::ndeps): New class member.
(dll::deps): Ditto.
(dll::modname): Ditto.
(dll_list::find_by_modname): New function related to topsort.
(dll_list::populate_all_deps): Ditto.
(dll_list::populate_deps): Ditto.
(dll_list::topsort): Ditto.
(dll_list::topsort_visit): Ditto.
(dll_list::append): Ditto.
(pefile): New struct allowing simple introspection of dll images.
* fork.cc (fork): Topologically sort the dll list before forking
* child_info.h (CURR_CHILD_INFO_MAGIC): Refresh.
(child_info::refresh_cygheap): New function.
* spawn.cc (spawn_guts): Call refresh_cygheap before creating a new process to
ensure that cygheap_max is up-to-date.
* fork.cc (frok::parent): Ditto.
2011-05-30 06:52:12 +00:00
Christopher Faylor 3a88e09e7f * cygheap.cc (cygheap_dummy): Rename from cygheap_at_start.
(cygheap): Accommodate name change to cygheap_dummy.
(cygheap_init): Ditto.
(cygheap_fixup_in_child): Simplify slightly.
* fork.cc (fork): Add an advisory comment.
2011-05-30 06:24:53 +00:00
Christopher Faylor 57b670586c * fhandler.cc (fhandler_overlapped::wait_overlapped): Make sure that I/O is
cancelled on signal.
2011-05-29 15:30:27 +00:00
Christopher Faylor a4fddeb9f6 * ps.cc (ttynam): Accommodate new console numbering.
(main): Ditto.
2011-05-29 15:20:10 +00:00
Christopher Faylor 6cd2e18523 * dll_init.cc (dll_list::alloc): Initialize dll::image_size.
(reserve_at): Don't reserve space needed by the target dll if the latter
overlaps the free region to be blocked.
(dll_list::load_after_fork): Use new version of reserve_at.
* dll_init.h (dll::image_size): New member.
(pefile): New struct.
2011-05-28 20:55:34 +00:00
Christopher Faylor 07f89f85db Revert previous checkins as they introduced a bug when running zsh. 2011-05-28 20:41:51 +00:00
Christopher Faylor 17a5c8c36e * dll_init.cc (reserve_upto): Remove.
(release_upto): Ditto.
(dll_list::reserve_space): New function to reserve space needed by DLL_LOAD
dlls early in the fork process.
(dll_list::load_after_fork): Rewrite to use recursion for tracking reservations
made while trying to make dlls land where they belong.
(dll_list::load_after_fork_impl): Ditto.
(dll_list::alloc): Initialize image base field.
* dll_init.h (struct dll_list): declare new functions.
(dll::image_size): New member.
2011-05-28 20:27:56 +00:00
Christopher Faylor a92339ab63 * dll_init.cc (dll_list::find_by_modname): New function to search the dll list
for a module name only (no path).
(dll_list::alloc): Initialize newly-added members of struct dll.
(dll_list::append): New function to factor out the append operation
(used by dll_list::topsort).
(dll_list::populate_deps): New function to identify dll dependencies.
(dll_list::topsort): New function to sort the dll list topologically by
dependencies.
(dll_list::topsort_visit): New helper function for the above.
* dll_init.h (dll::ndeps): New class member.
(dll::deps): Ditto.
(dll::modname): Ditto.
(dll_list::find_by_modname): New function related to topsort.
(dll_list::populate_all_deps): Ditto.
(dll_list::populate_deps): Ditto.
(dll_list::topsort): Ditto.
(dll_list::topsort_visit): Ditto.
(dll_list::append): Ditto.
(pefile): New struct allowing simple introspection of dll images.
* fork.cc (fork): Topologically sort the dll list before forking.
2011-05-28 20:17:09 +00:00
Christopher Faylor 8551087823 * dll_init.c (dll_list::load_after_fork): Don't clear in_forkee here.
* fork.cc (frok::errmsg): Rename from 'error'.
(frok::error): New function.  Handle conditional printing of error messages.
(frok::parent): Record hchild handle for use by error function.  Use
throughout.  Use error function rather than setting error pointer directly.
(fork): Clear is_forkee here.  Accommodate rename of 'error' to 'errmsg'.
* sigproc.cc (child_info::proc_retry): Detect EXITCODE_FORK_FAILED.
2011-05-28 20:09:04 +00:00
Christopher Faylor beaedec545 * fhandler.cc (handler_base_overlapped::wait_overlapped): Rework to attempt to
properly set errno and bytes read for non-blocking case.  Change to just rely
on res to indicate error conditions.
2011-05-28 18:49:13 +00:00
Christopher Faylor d1dded4d67 * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Don't set io_pending
unless ReadFile has returned an error.  (this is a partial fix, accidentally
checked in)
2011-05-28 18:22:59 +00:00
Christopher Faylor 44d2fc0a45 * autoload.cc: Call _api_fatal in asm.
* child_info.h: Redefine CURR_CHILD_INFO_MAGIC.
(child_info_fork::abort): Rename from handle_failure.  Change arguments.
* cygtls.h (_local_storage::ttybuf): New field.
* dcrt0.cc (vapi_fatal): Split api_fatal.  Add "in forked process" to message
when appropriate.
(api_fatal): Use vapi_fatal.
* devices.h: Make multiple inclusion safe.
(fh_devices): Add FH_CONS* stuff.  Reorder slightly.
(device): Eliminate anonymous union.  Add more ways to access minor/major.
(device::setunit): Accommodate no-longer-anonymous union.
(device::is_fs): Ditto.
(device::is_fs_special): Ditto.
(device::major): New function.
(device::minor): Ditto.
(device::is_device): New function.
(device::not_device): Ditto.
(device::operator int): New operator.
(device::operator fh_devices): Ditto.
(device::operator bool): Ditto.
(device::operator DWORD): Ditto.
(device::operator =): Ditto.
(isproc_dev): New function.
(isprocsys_dev): Ditto.
(iscons_dev): Ditto.
(istty_slave_dev): Ditto.
* devices.in: Add new "/dev/cons*" strings.  Accommodate no-longer-anonymous
union throughout.
(BRACK): Use more precise method for initialization.
* devices.cc: Regenerate.
* dtable.cc (dtable::stdio_init): Use get_cttyp instead of get_tty.
(dtable::find_archetype): Use new DWORD operator in device to test archetypes.
(dtable::init_std_file_from_handle): Use different method to initialize 'dev'.
Adapt to different ctty handling and accommodate /dev/cons*.
(fh_alloc): Accommodate no-longer-anonymous union.  Adapt to new /dev/cons*.
(build_fh_pc): Make debugging output more useful.
* exceptions.cc (ctrl_c_handler): Use get_cttyp instead of get_tty.
* external.cc (fillout_pinfo): Accommodate new cons* stuff.
* fhandler.cc (fhandler_base::read): Eliminate is_slow() test.
* fhandler.h (fhandler_base::*): Adapt to changes in device.h.
(fhandler_*::is_slow): Delete.
( fhandler_proc::get_proc_fhandler): Return fh_devices type.
* fhandler_console.cc (open_shared_console): New function.
(console_unit): New class.
(console_unit::console_unit): New constructor.
(enum_windows): New function.  Declare as friend to console_unit.
(fhandler_console::set_unit): New function.
(fhandler_console::get_tty_stuff): Call set_unit to set the unit number and
determine if initialization is needed.  Eliminate flags parameter.
(tty_list::get_cttyp): Rename (sorta) from get_tty.  Return pointer to correct
tty_min.
(fhandler_console::open): Adapt to elimination of argument to get_tty_stuff.
(fhandler_console::output_tcsetattr): Properly detect error condition.
(fhandler_console::fixup_after_fork_exec): Adapt to get_tty_stuff() setting tc
automatically.
* fhandler_proc.cc: Use FH_BAD rather than 0 throughout where using fh_devices
enum.
(fhandler_proc::get_proc_fhandler): Return fh_devices.  Adapt to devices.h
changes.
* fhandler_process.cc: Adapt to devices.h changes.  Use FH_BAD rather than 0
throughout where using fh_devices enum.
* fhandler_procnet.cc: Ditto.
* fhandler_procsys.cc: Ditto.
* fhandler_procsysvipc.cc: Ditto.
* fhandler_tape.cc (fhandler_dev_tape::fhandler_dev_tape): Ditto.
* fhandler_termios.cc (handler_termios::bg_check): Use tc->ttyname() rather
than assuming that we can construct a tty.
* fhandler_tty.cc (fhandler_tty_master::fhandler_tty_master): Just return
get_minor() of dev.
(fhandler_pty_master::process_slave_output): Add slightly more debugging info.
(fhandler_tty_slave::fhandler_tty_slave): Change name from ntty to unit.
(fhandler_pty_master::open): Ditto.
(fhandler_tty_slave::ioctl): Adapt to change which causes ctty to represent a
complete device.
(fhandler_tty_master::init_console): Add debugging for failure path.
(fhandler_pty_master::setup): Use get_unit() to retrieve unit number rather
than relying on raw ntty.
(fhandler_pty_master::setup): Ditto.
* fhandler_virtual.h (virt_tab_t): Redefine fhandler as fh_devices.
* fork.cc: Remove obsolete vfork stuff.
(frok::child): Don't assume that a ctty == 0 is valid.
* mount.cc (mount_info::conv_to_win32_path): Adapt to device struct changes.
(mount_info::conv_to_win32_path): Ditto.
* path.cc (path_conv::check): Retrive major/minor numbers via a method rather
than accessing them directly from device.  Rely on dev operators to
set/retrieve device information as required by device struct change.
* path.h (isproc_dev): Move to devices.h.
(isprocsys_dev): Ditto.
(isvirtual_dev): Ditto.
(path_conv:{isdevice,isfifo,isspecial,iscygdrive,issocket,get_devn,get_unitn}):
Use device methods to access/manipulate devices.
* pinfo.cc (pinfo::exit): Don't assume that ctty == 0 is valid.  Use iscons_dev
to determine if a device is a console.
(_pinfo::_ctty): Use device::parse to generate tty/cons name.
(_pinfo::set_ctty): Don't assume that ctty == 0 is valid.  Remove redundant
info from debugging.
* shared.cc (offsets): Remove console offset.
* shared_info.h (shared_locations): Ditto.
* syscalls.cc (umask): Use device methods to manipulate device information.
(ctermid): Use device::parse to generate term device name.
* tlsoffsets.h: Regenerate.
* tty.cc (ttyslot): Return minor number of ctty since ctty now represents a
full device.
(tty::create_master): Set ctty to a complete device.
(tty_list::attach): Rework to detect new /dev/cons* stuff.
(tty_list::terminate): Adapt to changes to ctty.
(tty_list::init): Adapt to change to setntty - pass in device major number.
(tty::exists): Use get_unit() to retrive tty unit number.
(tty::open_mutex): Ditto.
(tty::open_inuse): Ditto.
(tty::create_inuse): Ditto.
(tty::get_event): Ditto.
(tty_min::ttyname): Define new function.
* tty.h (tty_min::ntty): Redefine as fh_devices.
(tty::exists): Use get_unit() to retrive tty unit number.
(tty::open_mutex): Ditto.
(tty::open_inuse): Ditto.
(tty::create_inuse): Ditto.
(tty::get_event): Ditto.
(tty_min::ttyname): Declare new function.
(tty::getntty): Declare as const.
(tty_list::operator []): Assure that only minor part of argument is used.
* dll_init.cc (dll_list::alloc): Detect mismatch of data segments early issuing
an explicit error message if necessary.
* heap.cc (heap_init): Adapt to changes from fork->handle_failure to
fork->abort.
* pinfo.h (EXITCODE_FORK_FAILED): New enum.  (from Ryan Johnson)
* sigproc.cc (child_info_fork::abort): Rename from handle_failure.  Change
arguments to allow passing in a printf-like message.
* winsup.h (api_fatal): Delete macro definition.
(api_fatal): Redefine from __api_fatal.
(vapi_fatal): Declare new function.
* include/sys/strace.h (strace_vprintf): Define new macro.
* ntdll.h (_SYSTEM_INFORMATION_CLASS): Add SystemHandleInformation.
2011-05-28 18:17:09 +00:00
Corinna Vinschen bfce73c261 * shared.cc (offsets): Reorder so that console_state is lowest in
memory.  Explain why.
	(open_shared): Accommodate reordering of offsets array.
	* shared_info.h (shared_locations): Reorder SH_SHARED_CONSOLE after
	SH_MYSELF.
2011-05-27 06:11:05 +00:00
Corinna Vinschen 28667da372 * mount.h (MAX_MOUNTS): Raise to 64. 2011-05-26 19:30:00 +00:00
Eric Blake 4e989b35d1 * new-features.sgml (ov-new1.7.10): Document strerror changes. 2011-05-25 19:08:46 +00:00
Eric Blake 154fa4d7ef perror: fix POSIX compliance and work with recent newlib change
* cygtls.h (strerror_r_buf): New buffer.
* errno.cc (strerror): Move guts...
(_strerror_r): ...to new function demanded by newlib.
(strerror_r): Don't clobber strerror buffer.
(_user_strerror): Drop unused declaration.
* tlsoffsets.h: Regenerate.
2011-05-25 18:47:32 +00:00
Corinna Vinschen 6215837523 * init.cc (dll_entry): Reinstantiate wow64_test_stack_marker and
previous stack tests.
2011-05-25 11:33:29 +00:00
Corinna Vinschen 06f85bf553 * legal.sgml: Drop an old paragraph. Reactivate copyright note for
documentation.
2011-05-25 06:29:22 +00:00
Corinna Vinschen c57b66f6c3 * posix.sgml (std-notes): Add missing <para>. 2011-05-25 06:10:24 +00:00
Chris Sutcliffe 7750cea91f 2011-05-24 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/stdlib.h (strtod): Declare as extern to resolve compilation issues.

        Thanks to cgf for the report.
2011-05-24 22:43:29 +00:00
Corinna Vinschen d92e95d62c * mount.cc (mount_info::conv_to_win32_path): Remove unused code.
* mount.h (class mount_info): Remove sys_mount_table_counter member.
	* shared_info.h (class shared_info): Ditto.
	(CURR_SHARED_MAGIC): Update.
2011-05-24 15:09:08 +00:00
Corinna Vinschen 0864dd31db * pinfo.h (struct _pinfo): Reduce size of progname array slightly.
Explain why.
2011-05-24 10:03:34 +00:00
Eric Blake 66b729b284 * cygtls.h (strerror_buf): Resize to allow '-'. 2011-05-23 21:03:06 +00:00
Eric Blake 4d95630803 strerror: match recent glibc changes
* errno.cc (strerror): Print unknown errno as int.
(__xpg_strerror_r): Likewise, and don't clobber strerror buffer.
2011-05-23 20:43:06 +00:00
Chris Sutcliffe 38aa65b899 Fix typo in ChangeLog of previous commit 2011-05-23 20:10:41 +00:00
Chris Sutcliffe 3d1b423011 2011-05-23 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/time.h (daytime, timezone, tzname): Rework guards to expose when
        compiles with __STRICT_ANSI__.

        Thanks to Felipe Contreras for the report.
2011-05-23 20:04:12 +00:00
Corinna Vinschen 7d375b5a65 * fhandler_process.cc (thread_info::fill_if_match): Reformat.
(format_process_maps): Ditto.  Fetch pointer to procinfo structure
	from mapped process.  Print info about global shared Cygwin regions.
2011-05-23 08:53:25 +00:00
Chris Sutcliffe 6b58abe537 2011-05-22 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/stdlib.h (strtod): Remove possible static declaration to resolve
        issue with gcc.

        Thanks to Tobias Burnus for the report.
2011-05-23 03:43:30 +00:00
Chris Sutcliffe ec05c53dde 2011-05-22 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/stdlib.h (_rotl, _lrotl, _rotr, _lrotr): Resolve conflict with gcc
        by wrapping the functions in brackets.

        Thanks to Kai Tietz for the report.
2011-05-23 03:30:01 +00:00
Chris Sutcliffe 7944431097 2011-05-22 A.B., Khalid <abkhd@users.sourceforge.net>
* Makefile.in: Add support for msvcr100.dll.
        * msvcrt.def.in: Ditto.
2011-05-23 03:02:16 +00:00
Chris Sutcliffe 1e9f105575 2011-05-22 Antoine LECA <antoinel@users.sourceforge.net>
* mingwex/mingw-fseek.c: The anonymous union feature for LARGE_INTEGER is
        not always available, go the long way and use the explicit named union
        members, which are also declared in winnt.h.
2011-05-23 02:54:21 +00:00
Chris Sutcliffe 69080f58f0 2011-05-22 Antoine LECA <antoinel@users.sourceforge.net>
* mingwex/isblank.c:  Fix typo in declaration.
2011-05-23 02:38:49 +00:00
Chris Sutcliffe ecf22d8044 2011-05-22 Antoine LECA <antoinel@users.sourceforge.net>
* include/_mingw.h:  Define GCC system_header only if PCC is not defined.
        * include/stdlib.h:  Fix a long-standing typo which prevented correct use of
        the MB_CUR_MAX macro/variable when DECLSPEC is not supported and <stdlib.h>
        is included before <ctype.h>.
2011-05-23 01:01:18 +00:00
Chris Sutcliffe ec2b3046a1 2011-05-22 Chris Sutcliffe <ir0nh34d@users.sf.net>
* include/wingdi.h (GCP_RESULTSW):  Correct defintion.

        Thanks to Albrecht Schlosser for the report and the fix.
2011-05-23 00:13:45 +00:00