Commit Graph

9889 Commits

Author SHA1 Message Date
Christopher Faylor 19aef3fa1a update copyright 2013-01-02 18:48:21 +00:00
Christopher Faylor 36e97781ee * DevNotes: Add entry cgf-000020, relating to previous checkin. 2013-01-02 18:46:55 +00:00
Christopher Faylor ca77b848e7 * cygtls.h (_cygtls::signal_exit): Delete from class.
* exception.h (cygwin_exception): New class.
(cygwin_exception::dumpstack): Declare new function.
(cygwin_exception::context): Ditto.
(cygwin_exception::dump_exception): Ditto.
* exceptions.cc (cygwin_exception::dump_exception): Move into cygwin_exception
class.  Accommodate new variable names.
(cygwin_exception::dumpstack): Ditto stackdump -> dumpstack.
(exception::handle): Move andreas processing earlier.  Defer signal processing
decisions to the signal thread where they belong.  Pass exception information
to sig_send via new siginfo_t si_cyg field.
(ctrl_c_handler): Wait for SIGHUP signal to be processed since it could cause a
process exit and we don't want races with thread exit lock.
(signal_exit): Move back here from sigproc.cc.  Modify arguments and remove
from sigpacket class.  Decide when to dump core based on signal type.
(sigpacket::process): Handle exiting signals in context of threads rather than
in the signal thread.  Signal debugger on non-Windows signals.  Remove
setup_signal_exit call.
* sigproc.cc (no_signals_available): Remove argument.
(signal_exit_code): Delete.
(close_my_readsig): Ditto.
(_cygtls::signal_exit): Move to exceptions.cc.
(sigproc_terminate): Don't attempt to terminate signal thread.
(setup_signal_exit): Delete.
(exit_thread): Use new si_cyg entry in siginfo_t.
(sig_send): Just use empty initializer for si.  Accommodate change in
no_signals_available argument.
(wait_sig): Remove attempt to "go asynchronous" on process exit.  Delete
__SIGEXIT handling.  Don't ever exit.
* sigproc.h: Remove __SIGEXIT from signal enum.  Renumber.
* include/cygwin/signal.h (siginfo_t): Add si_cyg entry.
2013-01-02 18:34:06 +00:00
Christopher Faylor d6aec4e025 * sigproc.cc (wait_sig): Remove spurious extern. 2012-12-31 19:07:03 +00:00
Christopher Faylor f6187d46b1 * dtable.cc (dtable::dup3): Fix bounds checking for valid newfd.
* syscalls.cc (dup2): Ditto.
* winsup.h (events_terminate): Delete obsolete function declaration.
2012-12-31 18:31:49 +00:00
Christopher Faylor 871d0724fa * DevNotes: Add entry cgf-000019.
* dcrt0.cc (do_exit): Just set exit_state to ES_EVENTS_TERMINATE and nuke call
to events_terminate which just set a superfluous flag.
* sigproc.cc (signal_exit_code): New variable.
(setup_signal_exit): Define new function.
(_cygtls::signal_exit): Remove accommodations for closing the signal pipe
handle.
(exit_thread): Just sleep if we're exiting.
(wait_sig): If signal_exit_code is set, just handle bookkeeping signals and
exit ReadFile loop if there is nothing more to process.  Call signal_exit at
end if signal_exit_code is non-zero.
* sigproc.h (setup_signal_exit): Declare new function.
* exceptions.cc (sigpacket::process): Use setup_signal_exit to control exiting
due to a signal.
(exception::handle): Ditto.  Query exit_state rather than defunct exit_already
to determine if we are exiting.
* globals.cc (ES_SIGNAL_EXIT): New enum.
* sync.h (lock_process::release): New function for explicitly unlocking muto.
(lock_process::~lock_process): Use release method.
2012-12-28 18:06:17 +00:00
Christopher Faylor 81f1868336 * fork.cc (child_info::prefork): Fix error message formatting. 2012-12-27 17:25:17 +00:00
Christopher Faylor dbadcc4372 Fix tid comment. 2012-12-22 23:37:33 +00:00
Christopher Faylor 4a84997ae4 * select.h (select_stuff): Remove variable names from parameter declarations.
(select_info): Ditto.
(select_record::dump_select_record): Declare new debugging-only function.
(select_info): Zero all fields.
(select_pipe_info): Ditto.
(select_socket_info): Ditto.
(select_serial_info): Ditto.
(select_mailslot_info): Ditto.
* select.cc (select_record::dump_select_record): Define new debugging-only
function.
(select_stuff::test_and_set): Call dump_select_record when debugging.
* thread.cc (pthread_mutex::unlock): Revert setting of tid to NULL since, in
this context, it is a number, not a pointer.
(pthread_spinlock::unlock): Ditto.
2012-12-22 19:35:41 +00:00
Christopher Faylor e97256cf70 Back out prematurely checked-in change. 2012-12-22 03:16:43 +00:00
Christopher Faylor d3a03427bc * sigproc.cc (exit_thread): undef ExitThread or suffer recursion. Attempt to
lock process prior to calling sig_send.
2012-12-22 03:14:37 +00:00
Christopher Faylor c3a4634985 Revert the reversion and go with implementation described in cgf-000017, with
some modifications.
* init.cc (dll_entry): Revert previous change.
* miscfuncs.cc: Include sigproc.h for exit_thread declaration.
* winsup.h (ExitThread): Define as 'exit_thread' to ensure no accidental use.
* sigproc.cc (exit_thread): New function.
(wait_sig): Handle __SIGTHREADEXIT case.  Don't just block rather than
returning from this function.
* sigproc.h (__SIGTHREADEXIT): New enum.
(exit_thread): Declare.
* sync.cc (muto::release): Accept a tls command-line argument.
* sync.h (muto::release): Accept a tls command-line parameter.  Default to
&_my_tls.
* cygerrno.h (__set_errno): Define as extern so that no function code is ever
emitted.
* cygserver_ipc.h (cygserver_ipc.h): Ditto.
* miscfuncs.h (transform_chars): Ditto.
* path.h (has_attribute): Ditto.
* security.h (privilege_luid): Ditto.
* winsup.h (flush_file_buffers): Ditto.
2012-12-21 21:30:56 +00:00
Christopher Faylor 65068ebd7f * DevNotes: Add entry cgf-000018.
* init.cc (dll_entry): Grab process lock before exiting to ensure that thread
doesn't exit before parent if parent is exiting.
* _cygtls.cc (_cygtls::call2): Revert previous 2012-12-21 change.
* miscfuncs.cc (thread_wrapper): Ditto.
* thread.cc (pthread::exit): Ditto.
* sigproc.cc (exit_thread): Ditto.
(wait_sig): Ditto.
* sync.cc (muto::release): Ditto.
* sync.h (muto::release): Ditto.
* sigproc.h (__SIGTHREADEXIT): Delete enum.
(exit_thread): Delete declaration.
2012-12-21 19:32:43 +00:00
Christopher Faylor 614aff88a0 * DevNotes: Add entry cgf-000017.
* _cygtls.cc (_cygtls::call2): Use new exit_thread function in place of
ExitThread.
* miscfuncs.cc (thread_wrapper): Ditto.
* thread.cc (pthread::exit): Ditto.
(pthread_mutex::unlock): Set tid to NULL rather than 0.
(pthread_spinlock::unlock): Ditto.
* pinfo.cc (commune_process): Actually call lock_process constructor.
* sigproc.cc (exit_thread): New function.
(wait_sig): Handle __SIGTHREADEXIT case.  Don't just block rather than
returning from this function.
* sigproc.h (__SIGTHREADEXIT): New enum.
(exit_thread): Declare.
* sync.cc (muto::release): Accept a tls command-line argument.
* sync.h (muto::release): Accept a tls command-line parameter.  Default to
&_my_tls.
2012-12-21 18:52:00 +00:00
Corinna Vinschen 45b8e70594 * pathnames.sgml (pathnames-at): Drop confusing description on
"embedded double quotes".
2012-12-20 16:47:26 +00:00
Corinna Vinschen 45edfcd2ab * dcrt0.cc (build_argv): Allow quoted filenames in @ expression. 2012-12-20 13:39:34 +00:00
Christopher Faylor 081e9da6e8 Add missing file. 2012-12-19 22:07:14 +00:00
Christopher Faylor 6dadfa5644 * select.h (select_stuff::select_stuff): Make default constructor always zero
everything while constructor with int arg just zeroes next.
* select.cc (select_stuff::test_and_set): Revert to using default constructor.
2012-12-19 21:15:54 +00:00
Christopher Faylor 63d9f29311 * select.cc (select_stuff::wait): Add windows error number to error message. 2012-12-19 18:44:40 +00:00
Christopher Faylor 4effb32b81 * select.cc (select_stuff::test_and_set): Remove workaround and use proper
constructor.
2012-12-18 17:32:45 +00:00
Christopher Faylor 9574be60a7 * select.cc (select_stuff::test_and_set): Work around problem of new() not
returning zeroed memory.
2012-12-18 16:41:38 +00:00
Corinna Vinschen 783105ea4a * utils.sgml (mount): Document sparse mount option. 2012-12-14 11:11:17 +00:00
Corinna Vinschen 6b0dad0459 * new-features.sgml (ov-new1.7.18): Add sparse change.
* pathnames.sgml (mount-table): Document sparse mount option.
2012-12-14 11:10:29 +00:00
Corinna Vinschen 6d17453774 *** empty log message *** 2012-12-14 10:52:34 +00:00
Corinna Vinschen 05297cca5f * fhandler.cc (fhandler_base::write): Don't attempt to sparsify
an already sparse file.  Drop check for FILE_SUPPORTS_SPARSE_FILES
	flag.  Explicitely set FILE_ATTRIBUTE_SPARSE_FILE attribute in
	cached attributes.
	(fhandler_base::lseek): Only set did_lseek if sparseness is supported.
	* fhandler_disk_file.cc (fhandler_disk_file::ftruncate): Don't attempt
	to sparsify an already sparse file.  Explicitely set
	FILE_ATTRIBUTE_SPARSE_FILE attribute in cached attributes.
	* mount.cc (oopt): Add "sparse" flag.
	(fillout_mntent): Ditto.
	* path.h (enum path_types): Add PATH_SPARSE.
	(path_conv::support_sparse): New method.
	(path_conv::fs_flags): Constify.
	(path_conv::fs_name_len): Ditto.
	include/sys/mount.h: Replace unused MOUNT_MIXED flag with MOUNT_SPARSE.
2012-12-14 10:45:29 +00:00
Christopher Faylor 8cabc308a2 * sigproc.h (sig_send): Accept tid as argument #3. Default to NULL.
* sigproc.cc (sig_send): Ditto.  Pass tid to other sig_send.
(sigpending): Send current thread as arg #3.
2012-12-10 22:13:26 +00:00
Christopher Faylor ff8ba3cabe * exceptions.cc (sigpacket::process): Reorganize to avoid use of tls before
initialization.
* fhandler_fifo.cc (fhandler_fifo::arm): Avoid improper printing of integer as
a string in debug output.
2012-12-07 20:59:44 +00:00
Christopher Faylor 0d1a50b81a * sigproc.h (sigpacket): Remove parameter names from declarations.
(sigpacket::sigtls): Rename from 'tls'.
* exceptions.cc (sigpacket::process): Define local tls variable and assign that
to sigtls if appropriate.  Clarify debugging output.
* sigproc.cc (sig_send): Accommodate tls -> sigtls rename.
(pending_signals::add): Ditto.
(wait_sig): Ditto.
2012-12-07 17:37:33 +00:00
Christopher Faylor 9873ac53d7 * cygtls.h (_cygtls::get_signal_arrived): Add parameter to make lock/unlock
conditional.
* exceptions.cc (_cygtls::interrupt_setup): Don't get a lock when setting
signal_arrived since we already have one.
* gendef: Add some comments to make it easier to find functions.
2012-12-07 17:23:22 +00:00
Yaakov Selkowitz eac98364a3 * new-features.sgml (ov-new1.7.18): New section. Document cfsetspeed. 2012-12-06 08:38:43 +00:00
Yaakov Selkowitz 0ba7e5d36b * include/cygwin/wait.h (WAIT_ANY): Define.
(WAIT_MYPGRP): Define.
2012-12-06 08:32:58 +00:00
Corinna Vinschen 497826e97a * child_info.h (class child_info_spawn): Drop unused member lock.
(CURR_CHILD_INFO_MAGIC): Update.
	* sigproc.cc (child_info_spawn::child_info_spawn): Drop setting lock.
2012-12-05 10:37:17 +00:00
Christopher Faylor 3211ef434d * cygtls.h (_cygtls::will_wait_for_signal): Rename from 'signal_waiting' to
something more expressive.  Reflect rename throughout.
(_cygtls::get_signal_arrived): Rename from create_signal_arrived.  Move lock
here.
(_cygtls::set_signal_arrived): Use get_signal_arrived.
* exceptions.cc (_cygtls::interrupt_setup): Use get_signal_arrived.
* tlsoffsets.h: Regenerate.
2012-12-04 20:26:18 +00:00
Christopher Faylor d551cb9226 revert erroneous checkin 2012-11-30 07:14:36 +00:00
Christopher Faylor 1f8fe1aa0e * spawn.cc (child_info_spawn::worker): Make detection of '/c' case insensitive
when looking for cmd.exe command line.
2012-11-30 07:11:19 +00:00
Christopher Faylor 065b05f2df * Makefile.in: Remove old from CFLAGS and move C*FLAGS so that they can be
manipulated by Makefile.common.
2012-11-28 03:23:41 +00:00
Christopher Faylor 29413f0630 * Makefile.in: Move CFLAGS and CXXFLAGS so that they can be manipulated by
Makefile.common.  Add -static-libstdc++ to *LDFLAGS.  Add dependencies for
loadlib.h.
* loadlib.h: Update copyright.
(_load_sys_library): Properly define set_dll_library as WINAPI to avoid stack
corruption.
2012-11-28 03:22:36 +00:00
Christopher Faylor 66444a6b40 * Makefile.in (ZLIBS): Common define to force static load.
(MINGW_LDFLAGS): Use static libgcc.
2012-11-27 21:32:36 +00:00
Christopher Faylor 1f3843930e * Makefile.in: Make sure that libz is always loaded staticly. 2012-11-27 16:14:52 +00:00
Christopher Faylor 0d82dbb143 * Makefile.in (Makefile): Rely on 'configure' not 'configure.in'. 2012-11-26 20:02:05 +00:00
Christopher Faylor d4f4d1d0d6 ChangeLog:
2012-11-26  Christopher Faylor  <me.cygwin2012@cgf.cx>

	* configure.ac: Rename from configure.in.
	* configure.in: Delete.
	* configure: Regenerate.

cygserver/ChangeLog:
2012-11-26  Christopher Faylor  <me.cygwin2012@cgf.cx>

	* configure.ac: Rename from configure.in.
	* configure.in: Delete.
	* configure: Regenerate.

cygwin/ChangeLog:
2012-11-26  Christopher Faylor  <me.cygwin2012@cgf.cx>

	* configure.ac: Rename from configure.in.
	* configure.in: Delete.
	* configure: Regenerate.

doc/ChangeLog:
2012-11-26  Christopher Faylor  <me.cygwin2012@cgf.cx>

	* configure.ac: Rename from configure.in.
	* configure.in: Delete.
	* configure: Regenerate.

lsaauth/ChangeLog:
2012-11-26  Christopher Faylor  <me.cygwin2012@cgf.cx>

	* configure.ac: Rename from configure.in.
	* configure.in: Delete.
	* configure: Regenerate.

testsuite/ChangeLog:
2012-11-26  Christopher Faylor  <me.cygwin2012@cgf.cx>

	* configure.ac: Rename from configure.in.
	* configure.in: Delete.
	* configure: Regenerate.

utils/ChangeLog:
2012-11-26  Christopher Faylor  <me.cygwin2012@cgf.cx>

	* configure.ac: Rename from configure.in.
	* configure.in: Delete.
	* configure: Regenerate.
2012-11-26 19:50:45 +00:00
Christopher Faylor 96079146c4 * ccwrap: Don't drop mingw header file paths unless we've specified them with
--with-windows-headers.
2012-11-26 19:00:35 +00:00
Corinna Vinschen 5ab123f4aa * fhandler_registry.cc: Drop Mingw.org considerations.
* fhandler_serial.cc: Ditto.
	* fhandler_socket.cc: Ditto.
	* fhandler_tape.cc: Ditto.
	* fhandler_tty.cc: Ditto.
	* net.cc: Ditto.
	* ntdll.h: Ditto.
	* sched.cc: Ditto.
	* sec_helper.cc: Ditto.
2012-11-26 13:28:53 +00:00
Corinna Vinschen 3afc3efbab * bloda.cc: Drop Mingw.org considerations.
* dump_setup.cc: Ditto.
	* strace.cc: Ditto.
2012-11-26 13:13:25 +00:00
Corinna Vinschen 6f125cff2b * transport_pipes.cc (pipe_instance_lock_once): Remove.
(pipe_instance_lock): Remove.
	(pipe_instance): Remove.
	(initialise_pipe_instance_lock): Remove.
	(transport_layer_pipes::accept): Drop entire pipe_instance handling.
	(transport_layer_pipes::close): Ditto.
2012-11-26 12:33:07 +00:00
Corinna Vinschen 5ed0628cf0 * cygserver.cc (main): Call listen right after creating the
transport.
	* transport_pipes.cc (transport_layer_pipes::listen): Create
	first instance of the named pipe here.  Connect the client side
	to block it for further use by the system.
	(transport_layer_pipes::accept): Don't handle first pipe instance
	here.  Change debug output accordingly.
2012-11-23 15:19:41 +00:00
Christopher Faylor 916015a6af * configure.in: Remove unneeded ALLOC substitution.
* configure: Regenerate.
* aclocal.m4: Ditto.
2012-11-23 14:58:24 +00:00
Christopher Faylor 6a432cb180 * configure.in: Add previously-missed AC_NO_EXECUTABLES.
* configure: Regenerate.
* aclocal.m4: Ditto.
2012-11-23 14:55:44 +00:00
Christopher Faylor 2e488e9543 cygwin/ChangeLog:
2012-11-23  Christopher Faylor  <me.cygwin2012@cgf.cx>

	* Makefile.in: Use explicit path to mkdir.

lsaauth/ChangeLog:
2012-11-23  Christopher Faylor  <me.cygwin2012@cgf.cx>

	* Makefile.in: Use /bin/mkdir to make directories.

testsuite/ChangeLog:
2012-11-23  Christopher Faylor  <me.cygwin2012@cgf.cx>

	* Makefile.in: Remove old Makefile.common'isms.  Don't rely on
	in-build tools.
2012-11-23 14:52:07 +00:00
Corinna Vinschen 102bf65058 * sysv_sem.cc (semundo_clear): Move condition to break from
inner loop to the right spot.
2012-11-23 14:32:02 +00:00
Christopher Faylor 4c36016b57 ChangeLog:
2012-11-12  Christopher Faylor  <me.cygwin2012@cgf.cx>

	* Makefile.common: Revamp for new configury.  Add default compilation
	targets, include .E processing.  Add magic for allowing "CFLAGS" to
	control optimization options in "CXXFLAGS".
	* configure.cygwin: New include for Cygwin configure.in's.
	* acinclude.m4: Delete old definitions.  Implement AC_WINDOWS_HEADERS,
	AC_WINDOWS_LIBS, AC_CYGWIN_INCLUDES, target_builddir, winsup_srcdir.
	* aclocal.m4: Regenerate.
	* autogen.sh: New file.
	* ccwrap: New script.
	* c++wrap: New script.
	* config.guess: New script.
	* config.sub: New script.
	* configure: Regenerate.
	* configure.in: Eliminate LIB_AC_PROG_* calls in favor of standard.
	Delete ancient target test.
	* install-sh: New script.

cygserver/ChangeLog:
2012-11-12  Christopher Faylor  <me.cygwin2012@cgf.cx>

	* Makefile.in: Revamp for new configury.
	* configure.in: Revamp for new configury.
	* aclocal.m4: Regenerate.
	* configure: Ditto.
	* autogen.sh: New script.

cygwin/ChangeLog:
2012-11-22  Christopher Faylor  <me.cygwin2012@cgf.cx>

	* select.cc (select): Don't return -1 when we've timed out after
	looping.

2012-11-22  Christopher Faylor  <me.cygwin2012@cgf.cx>

	* Makefile.in: Revamp for new configury.
	(datarootdir): Add variable setting.
	(winver_stamp): Accommodate changes to mkvers.sh setting.
	(libc.a): Fix race when libm.a might not have been built yet.
	* configure.in: Revamp for new configury.
	* aclocal.m4: Regenerate.
	* configure: Ditto.
	* autogen.sh: New script.
	* mkvers.sh: Find include directives via CFLAGS and friends rather than
	assuming that w32api lives nearby.

utils/ChangeLog:
2012-11-12  Christopher Faylor  <me.cygwin2012@cgf.cx>

	* aclocal.m4: Regenerate.
	* configure: Ditto.
	* autogen.sh: New script.
	* configure.in: Revamp for new configury.
	* Makefile.in: Revamp for new configury.  Rename ALL_* to just *.
	Always use "VERBOSE" setting.
	(MINGW_CXX): Don't include CFLAGS in definition.
	(all): Define target first, before everything else so that it is the
	default.
	(ps.exe): Don't add useless -lcygwin.
	(ldh.exe): For consistency, add to existing MINGW_LDFLAGS rather than
	redefining them.
	(cygcheck.exe): Always include -lz for MINGW_LDFLAGS.  Don't try to
	figure out where to find it.
	(dumper.exe): Simplify check.  Assume libraries are installed rather
	than trying to retrieve from source tree.
	(install): Just use /bin/mkdir to create directories.
	(Makefile): Regenerate when standard dependencies change.
	* dump_setup.cc: Always include zlib.h.  Remove accommodations for it
	possibly not existing.
	* parse_pe.cc: Add define which allows building with installed
	binutils package.
	* dumper.cc: Ditto.
2012-11-23 13:22:47 +00:00
Yaakov Selkowitz beaf1df02c * termios.cc (cfsetspeed): New function.
* cygwin.din (cfsetspeed): Export.
* posix.sgml (std-bsd): Add cfsetspeed.
* include/sys/termios.h (cfsetspeed): Declare.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2012-11-21 20:13:07 +00:00
Corinna Vinschen bd249f0177 * include/mntent.h: Only include paths.h when building for Cygwin.
Add comment to explain why.
2012-11-16 17:35:14 +00:00
Corinna Vinschen 0d963613b0 * winbase.h: Semi-reinstantiate to workaround lack inline assembler
implementation of InterlockedCompareExchange for i686 in Mingw64
	headers.
	* pinfo.cc (pinfo::init): Remove unused variable mapaddr.
2012-11-11 10:56:01 +00:00
Corinna Vinschen 41783b90a2 * path.cc (vcygpath): Handle cygdrive prefix. 2012-11-09 08:53:01 +00:00
Corinna Vinschen 2af359986f * sigproc.cc (proc_subproc): Delete unused variable child. 2012-11-08 18:41:58 +00:00
Christopher Faylor aaa812cbd0 * fhandler_termios.cc (fhandler_termios::line_edit): Don't do special character
handling when stopped by CTRL-S.
* fhandler_tty.cc (bytes_available): Add arguments to debug_only_printf call.
* sigproc.cc (proc_subproc): Simplify some if logic.
2012-11-08 17:27:00 +00:00
Christopher Faylor 61746d6ae8 * mingw: Delete obsolete directory.
* w32api: Ditto.
2012-11-07 16:52:48 +00:00
Corinna Vinschen 2ca28ea2dc Add missing ChangeLog entry 2012-11-07 16:36:31 +00:00
Corinna Vinschen 5b31f27f6d winsup:
* Makefile.common (zlib_source): Remove.
	(zlib_build): Remove.
	(bz2lib_source): Remove.
	(bz2lib_build): Remove.
	(w32api_source): Remove.
	(w32api_build): Remove.
	(w32api_lib): Remove.
	(mingw_build): Remove.
	(mingw_source): Remove.
	($(w32api_lib)/%.a): Remove rule.
	* Makefile.in (ZLIB): Remove.
	($(SUBDIRS)): Drop mingw check.
	(mingw): Remove rule.
	(install_mingw): Ditto.
	* configure.in: Remove support for mingw as build target.
	* configure: Regenerate.

utils:

	* Makefile.in ($(MINGW_BINS)): Drop -B$(mingw_build)/ from build
	expression.
2012-11-07 16:32:08 +00:00
Corinna Vinschen 4d586ac09e * Makefile.in (MINGW_CXX): Attach $(CFLAGS) to allow providing
build option tweaks to mingw compiler as well.
2012-11-05 11:15:23 +00:00
Yaakov Selkowitz 650dc73fa5 * include/sys/termios.h (CBRK): Define as alias of CEOL.
(CREPRINT): Define as alias of CRPRNT.
	(CDISCARD): Define as alias of CFLUSH.
	(TTYDEF_*): Define.
2012-11-05 03:19:28 +00:00
Corinna Vinschen e9fe565052 Fix copyright 2012-10-31 16:49:25 +00:00
Corinna Vinschen f54898bac9 * include/sys/param.h: Include stddef.h to define NULL. 2012-10-31 16:48:50 +00:00
Corinna Vinschen 2345b582f2 * fhandler_disk_file.cc (fhandler_disk_file::rewinddir): Fix using
wrong value in condition.
2012-10-31 15:02:13 +00:00
Corinna Vinschen b120088ccd * include/sys/cygwin.h: Add missing defines for CW_ALLOC_DRIVE_MAP,
CW_MAP_DRIVE_MAP and CW_FREE_DRIVE_MAP.
2012-10-30 10:32:46 +00:00
Kai Tietz f71f133bda * dcrt0.cc (quoted): Renamed strechr to strchrnul.
* environ.cc (environ_init): Likewise.
        * sec_acl.cc (aclfromtext32): Likewise.
        * sec_auth.cc (extract_nt_dom_user): Likewise.
        * uinfo.cc (pwdgrp::next_str): Likewise.
        * string.h (strechr): Likewise.
2012-10-27 12:09:38 +00:00
Kai Tietz 0222a24fe3 * string.h (strechr): Replace assembler by
C code.
       (ascii_strcasematch): Likewise.
       (ascii_strncasematch): Likwise.
2012-10-26 20:00:12 +00:00
Corinna Vinschen 54b302310e * dir.cc (closedir): Fix syscall_printf. 2012-10-26 15:12:14 +00:00
Corinna Vinschen 422743b6ec * include/cygwin/signal.h (sigset_t): Define here. 2012-10-26 09:21:48 +00:00
Corinna Vinschen 0f93784fcc * bsd_helper.cc (adjust_identity_info): Fix typo in log message. 2012-10-25 08:08:39 +00:00
Corinna Vinschen ead8994a85 * configure.in: Add AC_NO_EXECUTABLES.
* configure: Regenerate.
2012-10-24 12:57:29 +00:00
Christopher Faylor ef275f980e Add missing ChangeLog entry. 2012-10-24 12:52:35 +00:00
Corinna Vinschen 18b785b899 * configure.in: Add AC_NO_EXECUTABLES,
* configure: Regenerate.
2012-10-24 12:45:09 +00:00
Yaakov Selkowitz 7c61aa7ece * configure.in: Add check for MINGW_CXX. Remove libiconv check.
* configure: Regenerate.
	* Makefile.in: Remove references to mingw and w32api directories.
	Use MINGW_CXX instead of mingw script to build MINGW_BINS.
	Check for libiconv with $CC --print-file-name.
	* cygcheck.cc: Use relative include paths for Cygwin headers.
	* path.cc: Ditto.
	* strace.cc: Ditto
	* mingw: Remove.
2012-10-24 10:15:27 +00:00
Yaakov Selkowitz 478bb995fb * Makefile.in (DLL_IMPORTS): Use system import libraries for
kernel32 and ntdll instead of from in-tree w32api.
	(cygwin0.dll): Remove rule dependency on DLL_IMPORTS, as they
	are no longer built in-tree.
2012-10-24 10:12:45 +00:00
Yaakov Selkowitz 68157644d1 2012-10-24 Kai Tietz <ktietz70@googlemail.com>
Yaakov Selkowitz  <yselkowitz@users.sourceforge.net>
	    Corinna Vinschen  <corinna@vinschen.de>

	* configure.in [cygwin*]: Always build cygserver, lsaauth,
	utils, and doc.  Do not build mingw or w32api.
	[mingw*]: Build w32api if present.
	* configure: Regenerate.
	* Makefile.common: Remove references to mingw and w32api
	directories.
	(MINGW_LDFLAGS): Redefine as -static to force static linking
	with libgcc and libstdc++.
	* Makefile.in: Remove references to mingw and w32api directories
	from Cygwin targets.
2012-10-24 10:11:15 +00:00
Corinna Vinschen 02fbb3bb59 * configure.in: Add AC_NO_EXECUTABLES.
* configure: Regenerate.
2012-10-24 09:43:46 +00:00
Yaakov Selkowitz efa82614a7 2012-10-24 Kai Tietz <ktietz70@googlemail.com>
Yaakov Selkowitz  <yselkowitz@users.sourceforge.net>

	* configure.in: Check for MINGW32_CC and MINGW64_CC.
	* configure: Regenerate.
	* Makefile.in: Use MINGW32_CC and MINGW64_CC to build 32-bit and
	64-bit DLLs.  Remove references to mingw and w32api directories.
	* cyglsa64.dll: Remove from version control.
	* make-64bit-version-with-mingw-w64.sh: Remove.
2012-10-24 09:35:38 +00:00
Corinna Vinschen a94555ec0f * thread.h (List_insert): Cast first parameter in
InterlockedCompareExchangePointer call to avoid compiler warnings.
	(List_remove): Ditto.
2012-10-23 10:17:29 +00:00
Corinna Vinschen b945ba6fc3 * winbase.h: Remove. 2012-10-22 17:26:45 +00:00
Corinna Vinschen b952c0c8d5 * child_info.h (CURR_CHILD_INFO_MAGIC): Update. 2012-10-22 12:45:46 +00:00
Corinna Vinschen 3f30575344 * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 18. 2012-10-21 10:20:53 +00:00
Corinna Vinschen 821d651917 * new-features.sgml (ov-new1.7.17): Add section. 2012-10-20 15:31:50 +00:00
Corinna Vinschen ae78ffd40a * Makefile.in (cygcheck.exe): Add temporary (1.7.17-only) hack to
allow cygcheck running on pre-Vista despite of the new w32api not
	matching the locally used w32api.
2012-10-19 11:58:48 +00:00
Corinna Vinschen 71c13b9633 *** empty log message *** 2012-10-16 12:02:42 +00:00
Corinna Vinschen 5f5820ec9a *** empty log message *** 2012-10-16 11:59:59 +00:00
Corinna Vinschen c74e68b7e2 * fhandler_floppy.cc (fhandler_dev_floppy::lseek): Remove lloffset.
Use offset directly.  Add shortcut for lseek(fd, 0, SEEK_CUR) case.
	(fhandler_dev_floppy::ioctl): Drop wrong RDSETBLK case.
	* fhandler_raw.cc (fhandler_dev_raw::ioctl): Revamp RDSETBLK code.
2012-10-16 09:52:26 +00:00
Christopher Faylor 2c9cefa586 * fhandler_tty.cc (fhandler_pty_slave::write): Fix potential exit from loop
with write mutex held.  Delete redundant mutex release.  Clear tty error once
we've grabbed it.
2012-10-15 17:12:17 +00:00
Corinna Vinschen b0b441fcef * fhandler_raw.cc (fhandler_dev_raw::fhandler_dev_raw): Drop gratuitous
initializing from previous patch.
2012-10-15 16:11:38 +00:00
Corinna Vinschen abadc07850 * fhandler_floppy.cc (fhandler_dev_floppy::open): Fix comment. 2012-10-15 14:58:39 +00:00
Christopher Faylor 744f194868 * fhandler_tty.cc (fhandler_pty_slave::write): DWORD -> BOOL. 2012-10-15 14:36:48 +00:00
Corinna Vinschen db8224e8be * fhandler.h (class fhandler_dev_raw): Add members devbufalloc and
devbufalign.
	(class fhandler_dev_floppy): Remove member bytes_per_sector;
	* fhandler_floppy.cc (bytes_per_sector): Define as devbufalign.
	(fhandler_dev_floppy::open): Set devbufalign to a multiple of the
	sector size and handle devbuf allocation and alignment in !O_DIRECT
	case here.  Change comment accordingly.
	Call FSCTL_ALLOW_EXTENDED_DASD_IO for partitions as well.
	(fhandler_dev_floppy::raw_write): Fix comment.  Rewrite and fix
	writing behaviour when application uses read and lseek.
	(fhandler_dev_floppy::lseek): Use rounddown macro.  Call
	SetFilePointerEx rather than the old SetFilePointer.
	(fhandler_dev_floppy::ioctl): Reformat switch.  Call
	IOCTL_DISK_UPDATE_PROPERTIES rather than IOCTL_DISK_UPDATE_DRIVE_SIZE
	in BLKRRPART case.  Support BLKIOMIN, BLKIOOPT, BLKPBSZGET and
	BLKALIGNOFF.
	* fhandler_raw.cc (fhandler_dev_raw::fhandler_dev_raw): Initialize
	all devbuf-related members.
	(fhandler_dev_raw::~fhandler_dev_raw): Delete devbufalloc rather than
	devbuf.
	(fhandler_dev_raw::open): Drop allocating devbuf.
	(fhandler_dev_raw::dup): Allocate devbufalloc and set devbuf to support
	new sector-aligned devbuf handling.
	(fhandler_dev_raw::fixup_after_exec): Ditto.
	* fhandler_tape.cc (fhandler_dev_tape::open): Ditto, set devbufalign
	to 1.
	* include/cygwin/fs.h (BLKIOMIN): Define.
	(BLKIOOPT): Define.
	(BLKALIGNOFF): Define.
	(BLKPBSZGET): Define.
2012-10-13 12:34:18 +00:00
Corinna Vinschen 93c9cdc1b0 * fhandler_raw.cc (fhandler_dev_raw::open): Allow O_EXCL flag, as on
Linux.
2012-10-12 13:59:45 +00:00
Christopher Faylor fe0cb31137 * fhandler_termios.cc (fhandler_termios::line_edit): Don't manipulate
output_mutex on CTRL-S/CTRL-Q to avoid a deadlock.
* fhandler_tty.cc (fhandler_pty_slave::write): Loop when output_stopped is
detected before acquiring output_mutex.  Acquire output_mutex in the loop for
each write.
* tty.h: Remove some obsolete defines.
(tty_min::output_stopped): Make 'bool'.
2012-10-12 01:19:04 +00:00
Corinna Vinschen 9b4d1964a7 * include/cygwin/in.h (struct in_addr): Guard with s_addr to avoid
potential collision with Win32 headers.
2012-10-10 08:36:33 +00:00
Christopher Faylor 64f6e90ef7 * child_info.h (child_info_spawn::has_execed): Remove unneeded synchronization. 2012-10-09 22:07:10 +00:00
Christopher Faylor 9536b817b1 * pinfo.cc: Remove unneeded assert.h. 2012-10-09 15:12:07 +00:00
Corinna Vinschen f085c12fd7 * cygcheck.cc (dump_sysinfo): Convert "if/else if" chain to a switch
statement.  Drop "not yet supported" and "Server" from Windows 2012
	output string.
2012-10-09 12:47:40 +00:00
Christopher Faylor ee705c1dcb * pinfo.cc (pinfo::init): Detect potential race where short block has been
retrieved but PID_EXECED flag is not set.
2012-09-17 20:07:49 +00:00
Christopher Faylor 25e5803d35 * cygthread.cc (cygthread::stub): Remove old, unnecessary, FIXMEd code.
* spawn.cc (child_info_spawn::worker): Avoid calling close_all_files() twice.
2012-09-14 03:32:52 +00:00
Christopher Faylor f594bcf771 * faq-what.xml: Fix typos, clarify responsibility slightly. 2012-09-04 00:19:00 +00:00
Corinna Vinschen 7dc5165954 * pseudo-reloc.cc (auto_protect_for): New function.
(__write_memory): Call auto_protect_for to handle page protection.
	(do_pseudo_reloc): Call auto_protect_for to restore old page protection.
2012-09-02 10:21:34 +00:00
Corinna Vinschen 199a8245e0 * cygcheck.cc (dump_sysinfo): Drop "not yet supported" text from
Windows 8.  Update products array.
2012-09-02 10:06:12 +00:00
Christopher Faylor 4acb2ffac7 * pinfo.cc (pinfo::init): Remove assertion. 2012-08-26 17:20:30 +00:00
Christopher Faylor 95a94931c8 * pinfo.cc (_pinfo::exists): Don't consider a process with no state to exist. 2012-08-23 14:45:52 +00:00
Christopher Faylor 0b1545eb3a * net.cc (get_adapters_addresses): Drop FIXME part of comment. 2012-08-21 14:41:57 +00:00
Christopher Faylor 39d0171500 * DevNotes: Add entry cgf-000016.
* cygtls.h (_cygtls::push): Inline.
(_cygtls::interrupt_now): Change signal number argument to siginfo_t argument.
(_cygtls::interrupt_setup): Ditto.
(_cygtls::set_siginfo): Delete declaration.
(_cygtls::reset_signal_arrived): Don't reset signal_arrived signal.  Just reset
flag.
* exceptions.cc (_cygtls::interrupt_now): Reflect argument changes.  Pass si to
interrupt_setup.
(_cygtls::interrupt_setup): Reflect argument changes.  Fill out tls infodata
here using passed-in si.  Use si.si_signo instead of sig.
(sigpacket::setup_handler): Move this function into sigpacket class.  Use si
field from the class as appropriate.
(sigpacket::process): Don't call tls->set_siginfo here since setup_handler
could fail.  Eliminate now-unneeded sig argument.
* sigproc.h (sigpacket::setup_handler): Move setup_handler to this class.
2012-08-17 17:29:21 +00:00
Christopher Faylor 23338be7f5 * exceptions.cc (sig_handle_tty_stop): Clear tls sig field.
(sigpacket::process): When continuing, set tls->sig before arming
signal_arrived.
2012-08-17 15:56:05 +00:00
Corinna Vinschen 74d1d0ee80 * fhandler_clipboard.cc (fhandler_dev_clipboard::read): Use
read-ahead buffer for reading Windows clipboard if caller's
	buffer is too small for complete characters.
	* include/limits.h: Remove outdated TODO comment.
2012-08-17 09:23:34 +00:00
Christopher Faylor 46f5dd5958 whitespace cleanup 2012-08-16 23:34:45 +00:00
Christopher Faylor 00caa48b91 * cygtls.cc (_cygtls::operator HANDLE): Reverse '?' test stupidity. 2012-08-16 19:24:19 +00:00
Christopher Faylor d01efdbe6e * cygheap.cc (init_cygheap::find_tls): Don't consider unitialized threads.
* cygtls.cc (_cygtls::operator HANDLE): Return NULL when tid is not set.
* exceptions.cc (setup_handler): Don't try to suspend a thread if it has no
handle.
2012-08-16 17:11:41 +00:00
Christopher Faylor 4e754267ed fix typo 2012-08-15 19:43:59 +00:00
Christopher Faylor 806e732c01 Rename cancelable_wait -> cygwait throughout.
* DevNotes: Add entry cgf-000015.
* cygwait.h (cygwait): Don't allow an optional PLARGE_INTERGER argument.
2012-08-15 19:07:42 +00:00
Christopher Faylor 879f3ad5ee * cygtls.h (_cygtls::create_signal_arrived): New function.
(_cygtls::set_signal_arrived): Lock creation of signal_arrived.
* cygwait.cc (cancelable_wait): Ignore signal_arrived event if _my_tls 'sig'
element does not exist.
* exceptions.cc (_cygtls::interrupt_setup): Create signal_arrived if recipient
thread has not created it.
2012-08-15 18:50:44 +00:00
Christopher Faylor 588b40e260 * gendef: Tighten up whitespace detection. 2012-08-15 17:29:58 +00:00
Christopher Faylor 0427598641 * gendef: Delete unneeded read from <IN> which ate an arbitrary line from
cygwin.din.
2012-08-15 17:07:47 +00:00
Christopher Faylor d57a4725b1 * exceptions.cc (sigdelayed): Move declaration to sigproc.h.
* sigproc.h (sigdelayed): Make symbol globally available.
* gendef (sigdelayed): Specifically zero incyg and stacklock.
* signal.cc (sigwaitinfo): Lock _my_tls and try harder to clean up signal
information.
2012-08-15 16:35:00 +00:00
Christopher Faylor 0123506d2d * pinfo.cc (_pinfo::exists): Don't consider an execed process to exist. 2012-08-15 14:11:35 +00:00
Corinna Vinschen 25a520c260 * gmon.c (_mcleanup): Fix scope bug when using gmon_out array. 2012-08-14 19:38:43 +00:00
Christopher Faylor 0587c5ef4f * errno.cc (errmap): Keep sorted. 2012-08-14 18:38:22 +00:00
Corinna Vinschen 04ea60440a * thread.cc (semaphore::_fixup_after_fork): Fix Win32 error output in
api_fatal call.
2012-08-14 15:05:13 +00:00
Christopher Faylor fee05a2380 * errno.cc (errmap): Keep sorted. 2012-08-14 14:56:19 +00:00
Corinna Vinschen 3cef8ecc61 * mount.cc (fs_names): Add missing ReFS entry. Change comment.
* mount.h (enum fs_info_type): Add comment.
2012-08-14 09:49:25 +00:00
Christopher Faylor 2134b7a5b0 * errno.cc (errmap): Map ERROR_SXS_CANT_GEN_ACTCTX to ELIBBAD. 2012-08-13 19:33:17 +00:00
Earnie Boyd 76c4e21b49 Even though MSDN documents these as __cdecl the kernel32.dll library
exports them as __stdcall.  Confirmed with gendef program.

	* lib/kernel32.def (InterlockedDecrement): Revert the 2012-08-08 change.
	(InterlockedIncrement): Ditto.
	(InterlockedExchange): Ditto.
	* include/winbase.h (InterlockedDecrement): Revert the 2012-08-01
	change.
	(InterlockedIncrement): Ditto.
	(InterlockedExchange): Ditto.
2012-08-10 13:58:49 +00:00
Christopher Faylor 52d2371da5 * DevNotes: Add entry cgf-000014.
* cygheap.cc (tls_sentry): Move here, rename from 'sentry' in cygtls.cc
(tls_sentry::lock): Ditto.
(nthreads): Move from cygtls.cc
(THREADLIST_CHUNK): Ditto.
(cygheap_init): Call init_tls_list().
(init_cygheap::init_tls_list): Define new function.
(init_cygheap::add_tls): Ditto.
(init_cygheap::remove_tls): Ditto.
(init_cygheap::find_tls): Ditto.  Semi-resurrect from _cygtls::find_tls.
* cygheap.h (init_cygheap::init_tls_list): Declare new function.
(init_cygheap::add_tls): Ditto.
(init_cygheap::remove_tls): Ditto.
(init_cygheap::find_tls): Ditto.
* cygtls.cc (sentry): Delete.
(sentry::lock): Ditto.
(nthreads): Ditto.
(THREADLIST_CHUNK): Ditto.
(_cygtls::init): Delete definition.
(_cygtls::init_thread): Call cygheap->add_tls() to add thread to global list.
(_cygtls::remove): cygheap->remove_tls() to remove thread from global list.
* cygtls.h (_cygtls::init): Delete declaration.
* dcrt0.cc (dll_crt0_0): Delete call to _cygtls::init().
* exceptions.cc (sigpacket::process): When no thread is specified, try to find
one via cygheap->find_tls.
2012-08-09 19:58:53 +00:00
Earnie Boyd cc02df1286 * lib/kernel32.def (InterlockedDecrement): Remove the @BYTE count since
we now declare it as __cdecl.
	(InterlockedIncrement): Ditto.
	(InterlockedExchange): Ditto.
2012-08-08 20:28:26 +00:00
Earnie Boyd b35bb085d8 2012-08-08 Kai Tietz <ktietz@redhat.com>
* mingwex/gdtoa/gd_qnan.h: Make Nan constants positive valued.
2012-08-08 20:27:11 +00:00
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
Christopher Faylor b8a84b73d7 * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 17. 2012-07-21 17:13:42 +00:00
Corinna Vinschen 1692ae3a30 * pathnames.sgml (pathnames-intro): Remove paragraph on UNC paths.
Try to be clearer on POSIX vs. Win32 paths.
	(unc-paths): New section.
	(cygdrive): Fix a few SGML qualifiers.
	* setup-net.sgml: Move ntsec section from here...
	* using.sgml: ..to here.
2012-07-20 09:23:44 +00:00
Corinna Vinschen 847a5f899b * woutsup.h: Just include winlean.h. 2012-07-19 17:56:46 +00:00
Corinna Vinschen 7cad0dc664 *** empty log message *** 2012-07-19 09:43:56 +00:00
Yaakov Selkowitz 90c352ad77 * mount.cc (getmntent_r): Remove unused but set variable. 2012-07-19 09:04:02 +00:00
Yaakov Selkowitz fe05ac4f14 * new-features.sgml (ov-new1.7.16): Document getmntent_r. 2012-07-18 11:23:11 +00:00
Corinna Vinschen 010f7350ba * cygwin.din (getmntent_r): Export.
* mount.cc (getmntent_r): New function.
	* posix.sgml (std-gnu): Add getmntent_r.
	* include/mntent.h (getmntent_r): Declare.
	* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2012-07-18 11:17:25 +00:00
Yaakov Selkowitz 03b7882aa0 * faq-programming.xml (faq.programming.unix-gui): Update to
reflect the availability of X11 toolkits on Cygwin.
2012-07-18 02:11:04 +00:00
Corinna Vinschen 6902b88b0b * winlean.h: Make sure certain Windows macros are undefined again.
Add comment to explain why.
	* winsup.h: Include winlean.h from C sources as well.
	* libc/minires-os-if.c: Drop including ntdef.h.

	Fix previous ChangeLog entry.
2012-07-12 11:27:28 +00:00
Corinna Vinschen 568e72f561 * pseudo-reloc.cc: Drop including wchar.h.
(__report_error): Define module as WCHAR.
	* advapi.cc: Drop including wchar.h.
	* kernel32.cc: Ditto.
2012-07-12 10:33:54 +00:00
Corinna Vinschen 6e1e3bb8e5 * Makefile.in (cygcheck.exe): Link against psapi.dll.
* bloda.cc: Change include section to work with Mingw64 headers.
	Include psapi.h.  Use SystemProcessInformation instead of
	SystemProcessesAndThreadsInformation throughout and add define for
	w32api headers.  Ditto for PSYSTEM_PROCESS_INFORMATION vs.
	PSYSTEM_PROCESSES.
	(system_module_list): New type to replace SYSTEM_MODULE_INFORMATION.
	Change usage throughout accordingly.
	(get_module_list): Fetch module list using PSAPI functions
	EnumDeviceDrivers and GetDeviceDriverBaseNameA.
	* cygcheck.cc (max): Define as __max if not defined already.
	(alloca): Only define if not defined already.
	(handle_unique_object_name): Use explicit sharing flags rather than
	FILE_SHARE_VALID_FLAGS which officially is only available in DDK
	headers.
	(PRODUCT_ULTIMATE_E): Only define if not defined already.
	* dump_setup.cc: Change include section to work with Mingw64 headers.
	(NtQueryAttributesFile): Drop NTOSAPI aka DECLSPEC_IMPORT.
	* strace.cc: Change include section to work with Mingw64 headers.
	(alloca): Only define if not defined already.
2012-07-11 16:41:51 +00:00
Corinna Vinschen 4a4f6f949c * cygtls.cc (well_known_dlls): Add ole32.dll and wbemprox.dll. 2012-07-11 09:21:36 +00:00
Corinna Vinschen 6930762ffa * cygwin.sc (.rdata): Revert patch from 2012-07-06. 2012-07-09 14:55:02 +00:00
Corinna Vinschen 7c4626ed08 * passwd.cc (getpass): Make check for closed stream more reliable.
Check if setting tty attributes worked and only revert to old state
	if so.
2012-07-09 12:57:03 +00:00
Corinna Vinschen c416f16d44 * Makefile.in, configure.in, mkvers.sh: Revert accidental checkin from
2012-07-06.
2012-07-09 09:00:56 +00:00
Christopher Faylor a9cd97c8e2 * Makefile.in: Change mingw_lib (temporarily?) back to w32api_lib. 2012-07-08 00:51:45 +00:00
Corinna Vinschen 9cfc9511cd * cygpath.cc: Change including headers to allow building against
Mingw64 headers. Include ntdef.h and ntdll.h rather than ddk headers.
	Define _WIN32_WINNT and WINVER as 0x0602.
	(RtlEqualUnicodePathPrefix): Drop definition.  Pulled in from ntdll.h
	now.
	(get_device_name): s/Zw/Nt.
	* dumper.cc: Include sys/param.h
	(dumper::dump_memory_region): Use MIN rather than min.
	* locale.cc: Include stdlib.h.  Define _WIN32_WINNT and WINVER as
	0x0602.
	* ps.cc: Include ntdef.h and ntdll.h rather than ddk headers.
	* regtool.cc (regDeleteKeyEx): Drop WINADVAPI qualifier.
2012-07-06 14:52:33 +00:00
Corinna Vinschen 3eedbf8611 * winlean.h (__STRALIGN_H_): Drop definition. 2012-07-06 14:44:13 +00:00
Corinna Vinschen 44fb3af98a * fhandler_procnet.cc: Fix copyright.
* syslog.cc: Ditto.
	* libc/minires-os-if.c: Ditto.
	* libc/minires.h: Ditto.
2012-07-06 13:56:37 +00:00
Corinna Vinschen acddda4bf9 Add files missing in previous checkin 2012-07-06 13:53:23 +00:00
Corinna Vinschen db80f635c1 In terms of network related functionality, rely on Winsock definitions
as much as possible:
	* dtable.cc: Drop including sys/socket.h.
	* fhandler_procnet.cc: Change includes accordingly.
	* fhandler_socket.cc: Ditto.
	(fhandler_socket::listen): Avoid gcc error message initializing sin6.
	(LPFN_WSARECVMSG): Only define when building against w32api headers.
	* net.cc: Change includes accordingly.  Define USE_SYS_TYPES_FD_SET
	and __WSA_ERR_MACROS_DEFINED.  Define _INC_NETIOAPI temporarily and
	explain why.
	(struct _IP_ADAPTER_UNICAST_ADDRESS_LH): Only define when building
	against w32api headers.
	(struct _IP_ADAPTER_ADDRESSES_LH): Ditto.
	(SIO_GET_INTERFACE_LIST): Ditto.
	(ws_freeaddrinfo): Rename from freeaddrinfo so as not to collide with
	Winsock declaration.  Change througout.
	(ws_getaddrinfo): Ditto.
	(ws_getnameinfo): Ditto.
	* select.cc: Include netdb.h after defining USE_SYS_TYPES_FD_SET.
	* syslog.cc: Drop including netinet/in.h.  Define USE_SYS_TYPES_FD_SET
	and include ws2tcpip.h.
	* include/netdb.h (struct addrinfo): Don't define when building Cygwin.
	* include/cygwin/if.h: Don't declare if_xxx functions when building
	Cygwin.
	* include/cygwin/in.h: Disable most definitions when building Cygwin.
	* include/cygwin/socket.h: Disable sockaddr and sockaddr_storage
	definitions when building Cygwin.  Same for MCAST_INCLUDE/MCAST_EXCLUDE.
	* libc/inet_addr.c: Don't define __INSIDE_CYGWIN__ nor
	__INSIDE_CYGWIN_NET__.
	* libc/inet_network.c: Ditto.
	* libc/minires.h: Drop redundant inclusion of netdb.h.  Define
	__INSIDE_CYGWIN_NET__ only before including netdb.h and resolver
	headers.
2012-07-06 13:52:19 +00:00
Corinna Vinschen dc45bfa0bf * include/winsock.h: Keep IP_OPTIONS and SO_xxx definitions when
building Cygwin.
	* include/winsock2.h: Keep sockaddr and sockaddr_storage definitions
	when building Cygwin.
2012-07-06 13:52:10 +00:00
Corinna Vinschen f3a43e7ef0 * winbase.h: Throughout use LONG rather than long type to prepare for
64 bit.
	(InterlockedCompareExchangePointer): Define.
2012-07-06 13:51:26 +00:00
Corinna Vinschen 6f94526c1c * fhandler_registry.cc (RegOpenUserClassesRoot): Only define when
building against w32api headers.
	(RegOpenCurrentUser): Ditto.
	* fhandler_tty.cc (GetNamedPipeClientProcessId): Ditto.
	* ntdll.h (enum _PROCESSINFOCLASS): Add ProcessImageFileName.
	(RtlInitAnsiString): Declare.
	(RtlUnicodeStringToAnsiSize): Declare.
	* sched.cc (GetForegroundWindow): Ditto.
	* sec_helper.cc (SECURITY_NT_NON_UNIQUE): Define as
	SECURITY_NT_NON_UNIQUE_RID when building against w32api headers.
	(cygsid::get_sid): Use SECURITY_NT_NON_UNIQUE rather than
	SECURITY_NT_NON_UNIQUE_RID.
	(__sec_user): Use PISECURITY_DESCRIPTOR rather than PSECURITY_DESCRIPTOR
	to allow valid pointer arithmetic.
	(_recycler_sd): Ditto.
	(_everyone_sd): Ditto.
2012-07-06 13:49:53 +00:00
Corinna Vinschen 261c701bf3 * advapi32.cc (_ADVAPI32_): Drop definition.
* kernel32.cc (_KERNEL32_): Ditto.
	* winlean.h: Add definitions required to use Mingw64 headers.
	(FILE_SHARE_VALID_FLAGS): Drop definition.
2012-07-06 13:43:05 +00:00
Corinna Vinschen a02924944e * winsup.h (_WIN32_WINNT): Define. Explain why. 2012-07-06 12:13:50 +00:00
Corinna Vinschen 862de2d0ae * libc/rcmd.cc: Don't undef __INSIDE_CYGWIN_NET__. 2012-07-06 12:05:19 +00:00
Corinna Vinschen da36286e64 * cygwin.sc (.rdata): Include all sections starting with .rdata.
(.debug_pubtypes): Make sure section is loaded at the end like all other
	debug sections.
2012-07-06 10:44:38 +00:00
Corinna Vinschen 0390476c47 * Makefile.common (ALL_CFLAGS): Change := to = to allow overriding in
dependent Makefiles.
2012-07-06 10:32:11 +00:00
Christopher Faylor ea51d3d425 * dcrt0.cc (build_argv): Guard against NULL pointer dereference found by Clang. 2012-07-04 17:30:55 +00:00
Christopher Faylor 85b2b14e7a * exceptions.cc (setup_handler): Remove unneeded assignment found by Clang. 2012-07-04 06:06:54 +00:00
Christopher Faylor 226133e80c * hookapi.cc (find_first_notloaded_dll): Remove unused assignment of
importRVASize found by Clang.
2012-07-04 06:04:16 +00:00
Christopher Faylor 0bdf68577d * fhandler_tty.cc (fhandler_pty_slave::read): Remove duplicate assignment to
bytes_in_pipe found by Clang.
2012-07-04 06:01:16 +00:00
Christopher Faylor aa01a03c10 fix typo 2012-07-04 02:26:52 +00:00
Christopher Faylor 51e4c3d44c * exceptions.cc (exception::handle): Use error_code in klog, as intended.
Found by Clang.
2012-07-03 05:31:11 +00:00
Corinna Vinschen 8fd8f9e72b * fhandler.h (class fhandler_dev_clipboard): Remove member eof.
* fhandler_clipboard.cc: Throughout remove handling of eof member.
	(fhandler_dev_clipboard::write): Handle EOF condition immediately,
	rather than pushing it erroneously to the next read call.  Rearrange
	code.  Fix bug in CF_UNICODETEXT case which potentially dropped single
	bytes at the end of the buffer.  Add comment.
	* strfuncs.cc (sys_cp_wcstombs): Allow returning non-NUL-terminated
	buffer if dst != NULL and len == (size_t) -1.  Extend leading comment
	to explain what's returned in more detail.
2012-07-02 20:17:27 +00:00
Christopher Faylor ceec584ad3 * fhandler_virtual.cc (fhandler_virtual::opendir): Eliminate duplicate
assignment found by Clang.
2012-07-02 20:01:19 +00:00
Christopher Faylor e82360f659 * fhandler_registry.cc (fhandler_registry::open): Handle missing EROFS error
condition pointed to by Clang.
2012-07-02 20:00:22 +00:00
Christopher Faylor e9d7f5b3a9 * pinfo.cc (_pinfo::commune_request): Eliminate unneeded assignment found by
Clang.
2012-07-02 19:55:51 +00:00
Christopher Faylor fb348d22af * external.cc (fillout_pinfo): Return NULL rather than 0.
(exit_process): Guard against NULL pointer dereference found by Clang.
2012-07-02 19:48:33 +00:00
Christopher Faylor e14a5a7efa * mount.cc (mount_info::conv_to_win32_path): Eliminate unneeded assignment
found by CLANG.
* path.cc (symlink_info::check): Remove unneeded/unused variable found by
CLANG.
2012-07-02 19:42:34 +00:00
Christopher Faylor fade1f2e21 * path.cc (symlink_info::check): Remove unneeded/unused variable. 2012-07-02 19:38:41 +00:00
Corinna Vinschen 26e603454f * dll_init.cc (dll_list::alloc): Take long UNC paths into account. 2012-07-02 14:14:01 +00:00
Christopher Faylor 1809b65e23 * Makefile.in: Add some more optimization flags for cygwait, malloc and path. Explain
why -fomit-frame-pointer doesn't work right for passwd.o and path.o.  Add
-static to link command line for cygwin0.dll.
* fhandler_disk_file.cc (fhandler_disk_file::facl): Reorganize slightly to
silence compiler warning when compiling with -fstack-check.
* net.cc (inet_ntop6): Initialize structure members to silence compiler warning
when compiling with -fstack-check.
* pseudo-reloc.cc (_pei386_runtime_relocator): Make this a C function.  Detect
NULL u.
* winsup.h (_pei386_runtime_relocator): Declare this as extern "C".
* lib/_cygwin_crt0_common.cc (_pei386_runtime_relocator): Call with NULL
argument.
* signal.cc (sigaction_worker): Eliminate last argument.  Let callers report
their own strace info.  Regparmize.
(sigaction): Reflect sigaction_worker changes.
(siginterrupt): Ditto.
* exceptions.cc: Update copyright.
2012-07-02 02:24:25 +00:00
Christopher Faylor c4441d46b6 * path.cc: Perform some whitespace fixups throughout. 2012-07-02 00:40:06 +00:00
Corinna Vinschen ca4d966d1b * kernel32.cc (_KERNEL32_): Define. Explain why.
(CreateFileMappingW): Drop undocumented flProtect flags.
2012-06-28 20:06:23 +00:00
Corinna Vinschen ca7f6a04b3 * fhandler_serial.cc: Fix includes for IOCTL codes to support Mingw64.
* fhandler_tape.cc: Ditto.
	* flock.cc (allow_others_to_sync): Use PISECURITY_DESCRIPTOR since
	PSECURITY_DESCRIPTOR is supposed to be the opaque type.
	* ntdll.h: Remove CreateDisposition flags again, now that they are
	defined in Mingw64's ntdef.h.  Ditto for Create/Open flags.
2012-06-28 19:25:22 +00:00
Corinna Vinschen 06e429fd6d * exceptions.cc (RtlUnwind): Align declaration with MSDN.
* ntdll.h: Define CreateDisposition Flags.  Add comments.
	* winlean.h: Define FILE_SHARE_VALID_FLAGS if using Mingw64 headers.
2012-06-28 14:06:06 +00:00
Christopher Faylor b052bf2671 * cygwait.h (cancelable_wait): Make extern to avoid always including.
* select.cc (allocfd_set): Try to make a little more efficient.
(cygwin_select): Break into two functions to avoid what seems to be a strange
compiler problem with alloca and sel constructor.
(select): New function.  Always honor return from call_signal_handler.
(select_stuff::wait): Always honor return from call_signal_handler.
* select.h (select_stuff::select_stuff): Use NULL to initialize pointers rather
than 0.
2012-06-27 21:42:11 +00:00
Corinna Vinschen c60437258a * exceptions.cc (exception::handle): Cast exception code to NTSTATUS
for comparison.
	* ntdll.h: Drop defining NT status codes in favor of including
	ntstatus.h.
2012-06-27 16:24:54 +00:00
Corinna Vinschen 165f575341 * miscfuncs.cc (WritePipeOverlapped): Define second parameter LPCVOID,
rather than PCVOID.
	* miscfuncs.h (WritePipeOverlapped): Ditto.
2012-06-27 13:35:48 +00:00
Corinna Vinschen 25f3ea84f8 * advapi32.cc (_ADVAPI32_): Define. Explain why.
(ImpersonateNamedPipeClient): Add missing WINAPI.
	* ntdll.h (STATUS_INVALID_PARAMETER): Only define if it isn't already.
	(STATUS_DLL_NOT_FOUND): Ditto.
	(STATUS_ENTRYPOINT_NOT_FOUND): Ditto.
	(enum _EVENT_TYPE): Guard against redefinition since it's already
	defined in Mingw64's ntdef.h.
	(enum _TIMER_TYPE): Ditto.
	(enum _SECTION_INHERIT): Define if using Mingw64 headers since it's
	missing in Mingw64's ntdef.h.
	* winlean.h (__STRALIGN_H_): Define before including windows.h.
2012-06-27 13:19:11 +00:00
Corinna Vinschen a90b8a20ed * winsup.h (GetLastError): Drop redundant definition. 2012-06-26 16:36:00 +00:00
Christopher Faylor 8bec43b39b fix typo 2012-06-26 05:23:10 +00:00
Christopher Faylor 6ec05d23b3 * cygwait.cc (cancelable_wait): Make sure that timer is cancelled before
cancelling thread.
2012-06-25 16:28:50 +00:00
Christopher Faylor d6953d3f7d * cygwait.h (cancelable_wait): Need to force time to negative to indicate
relative time.
2012-06-25 05:00:39 +00:00
Corinna Vinschen 970790c681 * path.cc (realpath): Fix comment. 2012-06-22 09:51:29 +00:00
Corinna Vinschen 797ff24dfb * path.cc (realpath): Call mount_info::conv_to_posix_path rather than
mount_info::cygdrive_posix_path to convert DOS paths to POSIX paths.
	Add comment to explain why that's necessary at all.
2012-06-21 09:33:19 +00:00
Christopher Faylor 978441cc0e * cygwait.h (LARGE_NULL): Define.
(cancelable_wait): Define variant which accepts DWORD time argument.
(cygwait): Use cancelable_wait with DWORD argument.
(cygwait): Use cancelable_wait with DWORD argument and cw_sig_eintr for
timeout-only case.
* exceptions.cc (handle_sigsuspend): Use LARGE_NULL as second argument to
distinguish between cancelable_wait variants.
* thread.cc (pthread_mutex::lock): Ditto.
(pthread::join): Ditto.
(semaphore::_timedwait): Ditto.
* thread.h (fast_mutex::lock): Ditto.
* wait.cc (wait4): Ditto.
2012-06-19 00:52:59 +00:00
Christopher Faylor 2addde8cb1 Revert errneous checkin.
Check in actual change associated with ChangeLog.
2012-06-19 00:38:02 +00:00
Christopher Faylor af5cd14583 * cygwait.cc (cancelable_wait): Mimic old cygwait behavior more closely wrt
handling of call_signal_handler.
* cygwait.h (WAIT_CANCELED): Move here and redefine.
(WAIT_SIGNALED): Ditto.
* thread.h (WAIT_CANCELED): Delete.
(WAIT_SIGNALED): Ditto.
2012-06-19 00:31:15 +00:00
Corinna Vinschen 099817c3db * cygheap.cc (init_cygheap::init_installation_root): Rearrange code
creating valid native NT installation_root path.  Only strip last
	backslash from path if the result is a valid NT path.  Explain why.
2012-06-18 20:17:15 +00:00
Christopher Faylor 4ae6378382 Add '#include "cygwait.h"' throughout, where appropriate.
* DevNotes: Add entry cgf-000012.
* Makefile.in (DLL_OFILES): Add cygwait.o.
* sigproc.h: Remove cygwait definitions.
* cygwait.h: New file.  Define/declare Cygwin waitfor functions.
* cygwait.cc: Ditto.
* exceptions.cc: Include cygwait.h.
(handle_sigsuspend): Accommodate change in cancelable_wait arguments.
(sigpacket::process): Display thread tls in debugging output.
* fhandler.cc (fhandler_base_overlapped::wait_overlapped): Use symbolic names
for signal and cancel return.
* fhandler_console.cc (fhandler_console::read): Ditto.
(fhandler_dev_dsp::Audio_out::waitforspace): Ditto.
fhandler_dev_dsp::Audio_in::waitfordata): Ditto.
* fhandler_fifo.cc (fhandler_fifo::wait): Ditto.
* fhandler_serial.cc (fhandler_serial::raw_read): Ditto.
* fhandler_tty.cc (fhandler_pty_slave::read): Ditto.
* select.cc (cygwin_select): Ditto.
* wait.cc (wait4): Ditto.
* thread.cc (cancelable_wait): Move definition to cygwait.h.
(pthread_cond::wait): Accommodate change in cancelable_wait arguments.
(pthread_mutex::lock): Ditto.
(pthread_spinlock::lock): Ditto.
(pthread::join): Ditto.
(pthread::thread_init_wrapper): Display tls in debugging output.
(semaphore::_timedwait): Ditto.
* thread.h (cw_sig_wait): Move to cygwait.h.
(cw_cancel_action): Delete.
(cancelable_wait): Move declaration to cygwait.h.
2012-06-17 20:50:24 +00:00
Yaakov Selkowitz 933ee0ecbf Fix last ChangeLog entry. 2012-06-12 18:34:38 +00:00
Yaakov Selkowitz 3e5a48af5e * regex/regcomp.c (p_ere): Allow vertical-line following
left-parenthesis in ERE, as in glibc.
2012-06-11 22:15:27 +00:00
Yaakov Selkowitz 53943a2e87 * include/sys/elf_common.h (R_386_16): Define.
(R_386_PC16): Define.
	(R_386_8): Define.
	(R_386_PC8): Define.
2012-06-10 18:28:16 +00:00
Christopher Faylor abf1b60039 * select.cc (cygwin_select): Remove select_timeout test.
(select_stuff::wait): Return select_set_zero on timeout.
(thread_socket): Report timeout when debugging.
2012-06-10 01:57:53 +00:00
Yaakov Selkowitz f513e3a206 * include/elf.h: Update from FreeBSD.
* include/machine/elf.h: New header, from FreeBSD.
	* include/sys/elf.h: Ditto.
	* include/sys/elf32.h: Update from FreeBSD.
	* include/sys/elf64.h: Ditto.
	* include/sys/elf_common.h: Ditto.
	(R_IA64_*): Define Linux-style names as aliases to R_IA_64_*.
	(R_SH_*): Define, based on sh-4 psABI.
	(R_390_*): Define, based on s390x psABI.
	* include/sys/elf_generic.h: Ditto.
2012-06-06 04:45:48 +00:00
Corinna Vinschen cd69beda67 * fhandler_disk_file.cc (fhandler_disk_file::link ): Translate
STATUS_NOT_SUPPORTED to EPERM as well.
2012-06-04 08:49:13 +00:00
Christopher Faylor b9c61a8d7b * dtable.cc (dtable::dup3): Only return with lock set when O_EXCL flag is
passed in.
* syscalls.cc (dup_finish): Pass O_EXCL in flags to dtable::dup3.
2012-06-04 01:26:05 +00:00