Commit Graph

5976 Commits

Author SHA1 Message Date
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
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
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 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
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
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
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 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
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
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
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 458e15e7d7 * include/cygwin/socket.h (MSG_BCAST): Define.
(MSG_MCAST): Define.
2012-08-01 18:56:45 +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