Commit Graph

8945 Commits

Author SHA1 Message Date
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