Commit Graph

9559 Commits

Author SHA1 Message Date
Corinna Vinschen 34a4d873ad * include/sys/wait.h (_wait): Define when building newlib. 2012-08-08 09:39:36 +00:00
Christopher Faylor f79b8c456f * signal.cc (sigwaitinfo): Change cw_sig to the correct cw_sig_eintr. 2012-08-07 04:25:05 +00:00
Earnie Boyd f29261e662 * include/winnt.h (MemoryBarrier): Define to __mingworg_MemoryBarrier()
which is in libmingwex.a.
	MODIFIED FROM: Use __sync_synchronize instead of
	creating a function due to multiple definition.
	NOTE: Not using __sync_synchronize to allow applications to mix-n-match
	C libraries from different vendors.
2012-08-06 18:12:53 +00:00
Earnie Boyd 525800e855 * mingwex/membarrier.c: New file.
* mingwex/Makefile.in (DISTFILES): Add membarrier.c.
	(REPLACE_OBJS): Add membarrier.o.
2012-08-06 18:05:53 +00:00
Earnie Boyd 705d9e463c * include/winnt.h (MemoryBarrier): Use __sync_synchronize instead of
creating a function due to multiple definition.
2012-08-06 15:49:39 +00:00
Corinna Vinschen b875960da7 *** empty log message *** 2012-08-06 09:09:18 +00:00
Christopher Faylor fedd27a0af Add 2012-08-06 03:42:07 +00:00
Earnie Boyd 189dc15b84 * include/winver.h (VerQueryValue[AW]): Correct declaration per MSDN. 2012-08-04 18:36:18 +00:00
Earnie Boyd 42377c9621 Add mingwex/tsearch.c to ChangeLog 2012-08-03 20:11:43 +00:00
Earnie Boyd a451d291c5 * include/_mingw.h (threadlocalinfostruct, threadmbinfostruct,
*pthreadlocinfo, *pthreadmbcinfo, _locale_tstruct, *_locale_t): Declare.
2012-08-03 20:06:27 +00:00
Earnie Boyd eb9dc9d068 * include/limits.h (PATH_MAX): Guard with #ifndef __STRICT_ANSI__.
* include/sys/param.h (MAXPATHLEN): Make sure PATH_MAX is defined.
2012-08-03 19:16:38 +00:00
Earnie Boyd d8dbfe9518 2012-08-02 Ivan Maidanski <ivmai@users.sourceforge.net>
* include/process.h (_wexec*, _wspawn*): Declare.
2012-08-03 18:58:26 +00:00
Earnie Boyd 0e44ac092d * include/stdio.h (_lock_file, _unlock_file): Declare. 2012-08-03 17:59:05 +00:00
Earnie Boyd e5ac3c1375 * include/stdio.h (_getws, _putws): Guard with #ifndef __STRICT_ANSI__.
(_wfdopen, _wfopen, _wfreopen, _wfsopen, _wtmpnam, _wtempnam): Ditto.
	(_wrename, _wremove, _wperror, _wpopen): Ditto.
2012-08-03 16:18:27 +00:00
Earnie Boyd a8d0071db2 * include/wchar.h (_wcstrtoi64): Declare.
(_wcstrtoi64_l): Ditto.
	(_wcstrtoui64): Ditto.
	(_wcstrtoui64_l): Ditto.
2012-08-03 16:06:45 +00:00
Earnie Boyd dc8a67cbc3 * include/stdlib.h (_strtoi64): Declare.
(_strtoi64_l): Ditto.
	(_strtoui64): Ditto.
	(_strtoui64_l): Ditto.
	(_wcstrtoi64): Ditto.
	(_wcstrtoi64_l): Ditto.
	(_wcstrtoui64): Ditto.
	(_wcstrtoui64_l): Ditto.
2012-08-03 15:51:29 +00:00
Christopher Faylor 45cb627406 * exceptions.cc (sigdelayed): Simplify declaration.
(_cygtls::call_signal_handler): Fix test for when to pop signal stack.  Only do
it exactly when what is on the stack is a no-op.
2012-08-03 15:38:59 +00:00
Christopher Faylor 4485a26eff * spawn.cc (child_info_spawn::worker): Put back a minor variation of Corinna's
test for detecting a background process when starting a non-cygwin process.
2012-08-03 14:48:59 +00:00
Corinna Vinschen 9da0bce9ef * faq-using.xml (faq.using.man): Make relevance to whatis explicit. 2012-08-03 10:39:45 +00:00
Earnie Boyd b766e1bfdf * lib/Makefile.in (amvideo.h): Dependencies are not met making this file
implementation incomplete.  Do not deliver it.
	(amaudio.h): Ditto.
2012-08-02 01:53:55 +00:00
Earnie Boyd a2e6f7e2ef * include/setupapi.h: Correct typos and truncations. 2012-08-02 01:17:04 +00:00
Earnie Boyd 47bc176b42 * include/winnt.h (MemoryBarrier): Add definition. 2012-08-01 19:17:37 +00:00
Corinna Vinschen 458e15e7d7 * include/cygwin/socket.h (MSG_BCAST): Define.
(MSG_MCAST): Define.
2012-08-01 18:56:45 +00:00
Earnie Boyd 8c582a2053 * include/winbase.h (InterlockedDecrement): Modify declaration from
LONG WINAPI to LONG __cdecl to match Microsoft documentation.
	(InterlockedIncrement): Ditto.
	(InterlockedExchange): Ditto.
2012-08-01 17:38:51 +00:00
Earnie Boyd 30ea43437c * include/wtsapi32.h (WTSVirtualChannelClose): Add declaration.
(WTSVirtualChannelOpen): Ditto.
	(WTSVirtualchannelOpenEx): Ditto.
	(WTSVirtualChannelPurgeInput): Ditto.
	(WTSVirtualChannelPurgeOutput): Ditto.
	(WTSVirtualChannelQuery): Ditto.
	(WTSVirtualChannelRead): Ditto.
	(WTSVirtualChannelWrite): Ditto.
	* lib/wtsapi32.def (WTSVirtualChannelOpenEx@12): Add import.
2012-08-01 17:25:34 +00:00
Earnie Boyd 15d7cca236 * include/excpt.h (__try1): Define based on _WIN64 definition.
(__except1): Ditto.
2012-08-01 16:46:01 +00:00
Earnie Boyd 764af9a4a5 * include/winuser.h (tagMENUITEMINFOA): Correct dwItemData definition.
(tagMENUITEMINFOW): Ditto.
2012-08-01 14:44:22 +00:00
Corinna Vinschen e665b0aab2 * fhandler.h (fhandler_socket::recv_internal): Add bool parameter.
Add regparm attribute.
	* fhandler_socket.cc (fhandler_socket::read): Call recv_internal with
	second parameter set to false.
	(fhandler_socket::readv): Ditto.
	(fhandler_socket::recvfrom): Ditto.
	(fhandler_socket::recv_internal): Convert use_recvmsg from local
	variable to parameter.  Use as request for using WSARecvMsg.  Only
	fail if WSARecvMsg can't be loaded and wsamsg->Control.len > 0,
	otherwise use WSARecv{From}.  Restrict dwFlags to MSG_PEEK when using
	WSARecvMsg.
	(fhandler_socket::recvmsg): Prefer using WSARecvMsg.  Change priority
	of tests for not using WSARecvMsg.  Call recv_internal with second
	parameter set accordingly.
2012-08-01 09:00:53 +00:00
Corinna Vinschen 01d9574ddd * Makefile.in: Semi-revert patch from 2012-07-01, assuming the previous
patch to etc::dir_changed fixes the underlying issue.
2012-08-01 08:46:49 +00:00
Corinna Vinschen 02a2590f08 * Makefile.in: Semi-revert patch from 2012-07-01, assuming the previous
patch to etc::dir_changed fixes the underlying issue.
2012-08-01 08:17:16 +00:00
Corinna Vinschen bc025aada5 * path.cc (etc::dir_changed): Revert muto changes since function is
called under lock condition anyway.
2012-07-31 19:56:32 +00:00
Corinna Vinschen 68e41cfcf4 * path.cc (etc::dir_changed): Change `io' to a static NO_COPY
variable.  Explain why.  Add a muto to guard overwriting the changed_h
	handle by multiple concurrent threads.
	* path.h (class etc): Drop unused changed_h member.
2012-07-31 19:36:16 +00:00
Earnie Boyd 67b37a26aa * include/_mingw.h: Add __MINGW_VERSION, __MINGW_MAJOR_VERSION,
__MINGW_MINOR_VERSION and __MINGW_PATCHLEVEL deprecating the __MINGW32_*
	versions of the macros.
	* configure.in: Use __MINGW_VERSION instead of __MINGW32_VERSION.
	* configure: Ditto.
2012-07-30 14:49:16 +00:00
Earnie Boyd 31938000a5 * include/inttypes.h: A few items like PRNdPTR and SCNdPTR need 64
bitness specified when _WIN64 is defined.
2012-07-30 14:31:16 +00:00
Earnie Boyd 6e5de03578 * include/stdint.h: Include _mingw.h for the definition of __int64 when _WIN64 is defined. 2012-07-30 14:22:28 +00:00
Christopher Faylor 7d8b0c8447 * Makefile.common (CFLAGS_COMMON): Add temporary define to work around w32api
problem.

* cygwin/winlean.h: Define constant which will be needed eventually.  Remove
hack in favor of another hack.
* cygwin/lib/crt0.h: Use "winlean.h".
2012-07-30 04:43:22 +00:00
Christopher Faylor 413ce08289 * winlean.h: Add temporary define.
* winsup.h: Remove ancient debugging defines.
2012-07-30 04:26:05 +00:00
Christopher Faylor d239805457 * cygwait.cc (cancelable_wait): Add some debugging-only output.
* exceptions.cc (sig_handle_tty_stop): Make sure that incyg is cleared when
exiting if we have no parent process.  Only wait for signal_arrived.
(sigpacket::process): Make continue_now a bool.  Delay sending signal_arrived
until the end.  Make code more defensive to avoid calling signal handler when
stopped.  Only set signal_arrived when stopped.
* sigproc.cc (sig_hold): Rename from sigCONT.  Make static.
(sig_send): Accommodate sigCONT -> sig_hold rename.
(wait_sig): Ditto.
* sigproc.h (sigCONT): Delete declaration.
* fhandler_console.cc (fhandler_console::write): Use new '%0c' facility to
print characters.  Change to paranoid to avoid excessive strace output.
* fhandler_tty.cc (fhandler_pty_master::accept_input): Make frequent strace
printf "paranoid" to help cut down on strace output size.
* signal.cc (sigsuspend): Add standard syscall strace output.
(sigpause): Ditto.
(pause): Ditto.
* cygtls.h (_cygtls::reset_signal_arrived): New function.
2012-07-30 03:44:40 +00:00
Earnie Boyd c1a11ccfca Add missing include/sdkddkver.h 2012-07-30 00:04:05 +00:00
Christopher Faylor a8344a0181 Doh. Check in missing file from previous submission. 2012-07-29 21:44:03 +00:00
Christopher Faylor dd06381996 * cygtls.cc (_cygtls::reset_signal_arrived): New function.
(set_signal_arrived::~set_signal_arrived): Use reset_signal_arrived to reset
state.
* exceptions.cc (sig_handle_tty_stop): Use WAIT_SIGNALED rather than assume we
know the return from cancelable_wait.
(_cygtls::interrupt_setup): Modify to allow calling when executing in
non-cygwin code via sigdelayed.  Always reset signal_arrived.
* gendef: Throughout use start_offset rather than the completely wrong
sizeof__cygtls.
(_sigdelayed): Rewrite to avoid duplication when calling the signal handler.
(sigreturn): Delete.
* gentls_offsets: Define start_offset rather than sizeof__cygtls.
* tlsoffsets.h: Regenerate.
2012-07-29 21:43:29 +00:00
Christopher Faylor ab6596266f Add missing file from last checkin. 2012-07-29 21:42:10 +00:00
Earnie Boyd c5b9032e48 * include/sdkddkver.h: New file.
* include/windows.h: Include sdkddkver.h.
2012-07-29 20:52:41 +00:00
Christopher Faylor 7ea2ecec23 * fhandler_termios.cc (fhandler_termios::line_edit): Use special case '%0c'
handling to print non-printable characters using hex notation.
* smallprint.cc (__small_vsprintf): Semi-reimplement printing of non-printable
characters in hex but only when padding is specified.
* dcrt0.cc (dll_crt0_0): Remove tty_list initialization.
* shared.cc (memory_init): Initialize tty_list here.
* path.cc (path_conv::check): Remove unneeded parentheses from if check.
2012-07-29 19:18:05 +00:00
Corinna Vinschen a2b7f56971 * include/inttypes.h: Add x86_64 target considerations throughout.
Define macros in C++ according to C99 requirements.
	* include/stdint.h: Ditto.
2012-07-28 14:21:34 +00:00
Christopher Faylor 8f748bdaca * signal.cc (clock_nanosleep): Force return on signal rather than letting
cancelable_wait loop on signal.
2012-07-25 22:21:17 +00:00
Corinna Vinschen a654829ade * syscalls.cc (enum bin_status): Add dir_not_empty.
(try_to_bin): Call NtQueryInformationFile(FileInternalInformation)
	with exact buffer size.  Explain why.
	Ditto for NtSetInformationFile(FileRenameInformation).
	Handle race-condition which might lead to renaming a non-empty
	directory.
	(unlink_nt): Rearrange and partially rephrase comments related to the
	STATUS_SHARING_VIOLATION case.  Fix condition under which a dir is
	tested for being non-empty.  Handle dir_not_empty return code from
	try_to_bin.  Gracefully handle disappearing directory in rm -r
	workaround.  Fix typo in comment.
2012-07-25 12:32:37 +00:00
Corinna Vinschen 67d71dbf10 * wincap.cc (wincapc::init): Drop memset call since it can result in
a race condition.  Drop all considerations for pre-Windows 2000 systems
	since Cygwin won't start on them anyway.
2012-07-24 13:56:14 +00:00
Christopher Faylor 44aa2292b7 Change "set_thread_waiting" to "set_signal_arrived" throughout. 2012-07-23 04:36:48 +00:00
Christopher Faylor 962f9a2ccc * DevNotes: Add entry cgf-000013.
* cygserver_ipc.h (ipc_set_proc_info): Use _cygtls::ipc_set_proc_info to set
per-thread signal arrived value.
* cygthread.cc (cygthread::detach): Use per-thread signal_arrived via
set_thread_waiting.
* fork.cc (_cygtls::fixup_after_fork): Clear signal_arrived.
(_cygtls::remove): Close any signal_arrived handle when thread exists.
(_cygtls::find_tls): Remove unneeded function.
* cygtls.h: Update copyright.
(class _cygtls): Reorganize to help avoid rebuilding newlib when structure
changes.
(_cygtls::event): Delete.
(_cygtls::threadkill): Ditto.
(_cygtls::signal_waiting): Declare new bool.
(_cygtls::find_tls): Delete declaration.
(_cygtls::set_threadkill): Ditto.
(_cygtls::reset_threadkill): Ditto.
(_cygtls::set_signal_arrived): Declare new function.
(class set_thread_waiting): Declare new class.
* cygwait.cc (cw_nowait_storage): Define.
(cygwait): Set per-thread signal_arrived via set_thread_waiting.  Don't
special-case _main_tls.
* cygwait.h (cw_nowait): Define.
(cw_infinite): Ditto.
(cygwait): Redefine pathological wait-only case.
* dcrt0.cc (dll_crt0_0): Remove call to now-defunct events_init().
(dll_crt0_1): Remove call to now-defunct create_signal_arrived().
* exceptions.cc: Reflect set_signal_mask() argument reordering throughout.
Remove signal mask synchronization throughout.
(events_init): Delete definition.
(mask_sync): Delete now-unneeded mask synchronization.
(set_signal_mask): Reverse order of arguments to "standard" to, from layout.
Rename "newmask" argument to "setmask".  Remove debugging.
(sig_handle_tty_stop): Use cancelable_wait rather than WFMO.
(_cygtls::interrupt_setup): Don't treat "threadkill" events specially.
Conditionally set signal_arrived depending on whether the thread has created it
or not.
(sigpacket::process): Reorganize to reflect thread-specific sending of signals
which is more in line with the way it was actually supposed to work.
* fhandler_socket.cc (get_inet_addr): Use cancelable_wait rather than
IsEventSignalled to avoid potential race.
(fhandler_socket::wait_for_events): Set signal_arrived event using
set_thread_waiting().
(fhandler_socket::close): Use cygwait for the case of just waiting 10 ms for a
signal.
* fhandler_tape.cc (fhandler_dev_tape::_lock): Use cancelable_wait rather than
WFMO.  Redo switch/case tests accordingly.
* fhandler_termios.cc (fhandler_termios::bg_check): Use cygwait for case of
just waiting 0 ms for a potential signal.
* fhandler_tty.cc (fhandler_pty_master::process_slave_output): Use
cancelable_wait rather than WFSO.
* fhandler_windows.cc (fhandler_windows::read): Set per-thread signal_arrived
via set_thread_waiting().
* flock.cc (lf_setlock): Ditto.
* select.cc (pselect): Ditto.  Set per-thread signal_arrived using
set_thread_waiting().
* gendef: Don't special case handling of _cygtls::sig for threads.
* gentls_offsets: Use #pragma once in tlsoffsets.h.
* ntdll.h: Use #pragma once.
* poll.cc: Reflect set_signal_mask() argument reordering.
* posix_ipc.cc (ipc_mutex_lock): Use cancelable_wait rather than WFMO.
(ipc_cond_timedwait): Set perl-thread signal arrived using
set_thread_waiting().
* security.h: Use #pragma once.
* signal.cc (abort): Reflect set_signal_mask() argument reordering.
(clock_nanosleep): Ditto.  Change call to cancelable_wait to properly specify
handling of cancel and interrupt.
(sigwaitinfo): Remove handling of per-thread event in favor of per-thread
signal_arrived.  Use cancelable_wait rather than WFSO.
* sigproc.cc (signal_arrived): Delete definition.
(create_signal_arrived): Ditto.
* sigproc.h (signal_arrived): Delete declaration.
(set_signal_mask): Avoid defining as a "C" function.  Don't conditionally
declare.
(create_signal_arrived): Delete declaration.
* syscalls.cc (rename): Use cygwait() rather than WFSO.
* thread.h (fast_mutex::lock): Use cw_infinite rather than LARGE_NULL.
* wait.cc (wait4): Ditto.
* thread.cc (pthread_mutex::lock): Ditto.
(pthread::join): Ditto.
(semaphore::_wait): Ditto.
(pthread_kill): Remove set_threadkill() accommodation.
* tlsoffsets.h: Regenerate.
2012-07-21 22:58:20 +00:00