Commit Graph

4589 Commits

Author SHA1 Message Date
Bas van Gompel 3020ba83ce * fhandler.cc (fhandler_base::puts_readahead): Fix end-condition. 2004-12-12 02:15:34 +00:00
Corinna Vinschen aee05403d1 * errno.cc (errmap): Map ERROR_INVALID_ADDRESS to EINVAL instead of
EOVERFLOW.
2004-12-10 17:43:00 +00:00
Christopher Faylor 804cd111b4 * include/sys/strace.h: Don't output paranoid_printf by default. 2004-12-10 16:25:35 +00:00
Christopher Faylor fc2eba361c * lib/libcmain.c (main): Properly deal with quoted first argument. 2004-12-09 21:28:32 +00:00
Danny Smith 8bbdc64198 * include/sqlext.h (SQL_INTERVAL_*): Correct macros.
Reported by Eric Sharkey <sharkey at netrics dot com>
2004-12-09 02:33:20 +00:00
Danny Smith 91ce86e773 * include/winnt.h (TOKEN_INFORMATION_CLASS): Add
TokenGroupsAndPrivileges, TokenSessionReference,
	TokenSandBoxInert, TokenAuditPolicy, TokenOrigin.
	Reformat.
	(SID_NAME_USE): Add SidTypeComputer.  Reformat.
	Thanks to Gabriel Linder <mingwlinder@users.sourceforge.net>
2004-12-07 07:15:26 +00:00
Christopher Faylor a8dead4476 * pinfo.h (proc_pipe::*): Delete class.
* pinfo.cc (proc_pipe::*): Ditto.
2004-12-06 19:20:24 +00:00
Christopher Faylor 8c43a9f82e * fork.cc (fork_parent): Reinstate "childhProc" protection. Don't close
hProcess handle here since it is used to ensure that a new process isn't
created with the old pid after the old pid exits.
* spawn.cc (spawn_guts): Ditto.
* pinfo.cc (proc_waiter): Don't send any signals if we've execed since this
process doesn't officially exist.
* pinfo.h (pinfo::pid_handle): Eliminate.  Just use hProc.
* sigproc.cc (sig_send): Don't send any signals if our sendsig doesn't exist.
That's a sign that we are execing.
(remove_proc): Eliminate pid_handle close.
2004-12-06 00:29:41 +00:00
Christopher Faylor 013f043fff fix typo 2004-12-05 21:39:47 +00:00
Christopher Faylor f181da2707 * cygthread.cc (cygthread::terminate_thread): Make public.
* pinfo.h (pinfo::wait_thread): New element.
* pinfo.cc (pinfo::wait): Store "handle" to started thread in pinfo.
* sigproc.cc (proc_terminate): Kill any threads waiting for a process pipe.
2004-12-05 21:29:37 +00:00
Christopher Faylor 54dd79bb44 * sigproc.cc (mychild): Reimplement as list scan.
(proc_subproc): Don't mess with pinfo if it's myself.
* child_info.h (child_info_types): Label enum for _PROC constants.
(child_info::child_info): New constructor.
(child_info::~child_info): New destructor.
(child_info::sync): Declare new function.
(child_info_fork::child_info_fork): New constructor.
(child_info_spawn::child_info_spawn): Remove old constructor.
(child_info_spawn::child_info_spawn): New constructor.
* dcrt0.cc (dll_crt0_0): Use correct sizeof when doing sanity check on passed
in child_info.  Signal readiness to parent when not forking (and not spawning).
* fork.cc (sync_with_child): Delete.
(resume_child): Remove extra argument.
(sync_with_parent): Use child_info method to sync with parent.
(fork_child): Don't close fork_info->subproc_ready since that is now handled by
the destructor.
(fork_parent): Remove subproc_ready stuff.  Use child_info sync method for
waiting..  Set start time here for child.  Rename "forked" to "child".
(fork): Check ch.subproc_ready for validity here.
* pinfo.h (_pinfo::exec_sendsig): Temp storage for exec stub which may be
staying around to handle non-cygwin captive process.
(_pinfo::exec_dwProcessId): Ditto.
(_pinfo::_lock): Renamed from lock.
(_pinfo::lock): New method.
(_pinfo::unlock): Ditto.
(_pinfo::initialize_lock): Ditto.
* pinfo.cc (set_myself): Use initialize_lock method to initialize myself lock.
Set "exec" fields in _pinfo to zero to indicate that we've started
successfully.  Set start time here when appropriate.
(_pinfo::commune_send): Use pinfo lock/unlock methods.
(proc_waiter): Remove special case for non-cywin processes.  Reinstitute
handling for PID_NOCLDSTOP.
* sigproc.cc (proc_subproc): Set proper EAGAIN errno when process table is
filled.
(sig_send): Use exec_* fields from _pinfo for sending signals if the the _pinfo
sendsig never materializes.
(child_info::child_info): New constructor, renamed from init_child_info.
Zeroes child_info structure and sets appropriate fields in structure based on
chtype.
(child_info::~child_info): New destructor.  Closes subproc_ready if it exists.
(child_info_fork::child_info_fork): New constructor.
(child_info_spawn::child_info_spawn): New constructor.
(child_info::ready): New function.  Signals parent when child is ready.
(child_info::sync): New function.  Wait for child to signal us or process to
die.
(remove_proc): Remove closing of hProcess since this should now be handled
shortly after process creation.
* spawn.cc (spawn_guts): Use child_info_spawn constructor rather than
init_child_info.  Save exec_sendsig and exec_dwProcessId in execing _pinfo.
Rely on child_info constructor to properly set parent_wr_proc_pipe in ciresrv.
Revert to previous determination on whether to start a process in suspended
mode.  Remove reparenting stuff.  Just keep a stub around if starting a
non-cygwin process.
2004-12-05 19:41:26 +00:00
Bas van Gompel d54b79d351 * fhandler.cc (fhandler_base::read): Remove superfluous check in
__small_printf format for strace.
2004-12-05 07:28:27 +00:00
Christopher Faylor 3a72ce9d12 minor cleanup 2004-12-05 02:30:20 +00:00
Bas van Gompel 8b6d072355 * fhandler.cc (fhandler_base::read): Don't debug_printf garbage when
copied_chars is zero.
2004-12-05 01:53:47 +00:00
Christopher Faylor e9efc27020 * environ.cc (environ_init): Alloc space for TERM if it is not set, like all of
the other environment variables.
2004-12-03 23:49:06 +00:00
Joshua Daniel Franklin b96fedfb8b 2004-12-02 Joshua Daniel Franklin <joshuadfranklin@yahoo.com>
* cygserver.sgml: Cleanup minor markup problem.
        * how-resources.texinfo: Add man and info to documentation FAQ
        * how-using.texinfo: Add more detail to Unicode FAQ.
        * install.texinfo: Finally apply Pierre's patch from 2003-03-03.
        * relnotes.texinfo: Add note about hyperthreading reports.
2004-12-03 05:30:52 +00:00
Christopher Faylor 82b7b4fd4f * child_info.h (child_info_fork::parent_wr_proc_pipe): New element.
* fork.cc (fork_parent): Set parent_wr_proc.
* pinfo.cc (set_myself): Close child_proc_info->parent_wr_proc if it exists
rather than trying to get value from parent _pinfo.
* pinfo.h (enum parent_aleter): New enum.
(pinfo::alert_parent): Declare as returning a value.
(pinfo::parent_alive): New function.
* pinfo.cc (pinfo::alert_parent): Set wr_proc_pipe to invalid non-NULL value
when parent disappears.  Return success of operation.
(proc_waiter): Use __ALERT_* enum for control since these are not really
signals.  Implement __ALERT_ALIVE.
* sigproc.cc (my_parent_is_alive): Eliminate.
* sigproc.h (my_parent_is_alive): Ditto for declaration.
(__SIGREPARENT): Eliminate.
2004-12-03 04:46:00 +00:00
Christopher Faylor 3ef7d75861 * pinfo.cc (pinfo::wait): Use better name for cygthread. 2004-12-03 02:49:54 +00:00
Pierre Humblet 8151e674ba 2004-12-03 Pierre Humblet <pierre.humblet@ieee.org>
* registry.h (reg_key::reg_key): Change arguments.
	* shared_info.h (class mount_info): Remove had_to_create_mount_areas.
	* registry.cc (reg_key::reg_key): Change constructors to always handle
	HKLM and to avoid relying on HKCU.
	Do not set mount_table->had_to_create_mount_areas.
	* path.cc (mount_info::conv_to_win32_path): Improve update of
	sys_mount_table_counter.
	(mount_info::read_mounts): Use new reg_key constructor.
	(mount_info::add_reg_mount): Ditto.
	(mount_info::del_reg_mount): Ditto.
	(mount_info::read_cygdrive_info_from_registry): Ditto.
	(mount_info::write_cygdrive_info_to_registry): Ditto.
	Update cygwin_shared->sys_mount_table_counter after registry update.
	(mount_info::get_cygdrive_info): Ditto.
	* shared.cc (shared_info::heap_chunk_size): Use new reg_key constructor.
	* environ.cc (regopt): Ditto.
2004-12-03 02:00:37 +00:00
Danny Smith f77390bbdb * lib/comctl32.def (ImageList_Copy, ImageList_DrawIndirect,
ImageList_Duplicate): Add stubs.
2004-12-02 05:55:45 +00:00
Danny Smith a923c24660 * lib/directx/strmiids.c (MEDIASUBTYPE_YV12): Correct GUID.
Thanks to "Pete" <pross@xvid.org>
2004-12-02 05:36:22 +00:00
Christopher Faylor ce71e000f1 * include/features.h: Include sys/cdefs.h, like linux. 2004-12-01 17:07:03 +00:00
Christopher Faylor ea9af94bd3 Add missing changelog entry. 2004-12-01 15:07:20 +00:00
Christopher Faylor 576bfeeca8 * syscalls.cc (truncate64): Don't second-guess errno if open fails. 2004-12-01 15:00:40 +00:00
Christopher Faylor 6903729981 * environ.cc (putenv): Accommodate recent newlib change in argument to putenv. 2004-11-26 04:21:47 +00:00
Christopher Faylor 8cb359d947 * child_info.h (child_info_spawn::hexec_proc): Eliminate.
* dcrt0.cc (dll_crt0_0): Remove hexec_proc stuff.
* fork.cc (fork_child): Remove call to pinfo_fixup_after_fork.
* pinfo.cc (set_myself): Close and zero pid_handle if set.
(pinfo_fixup_after_fork): Delete.
(proc_waiter): Don't close vchild.hProcess here.  Do that when we are remove
the vchild from procs.  Save hProcess as pid_handle only on first reparent
operation.
(pinfo::wait): Don't set pid_handle here.
(pinfo::alert_parent): Always try to send signal.  If unsuccessful then close
and zero wr_proc_pipe.
* pinfo.h (pinfo::pinfo): Make sure that appropriate parts of the class are
zeroed on construction.
(pinfo::alert_parent): Take char argument.
(pinfo_fixup_after_fork): Delete declaration.
(hexec_proc): Ditto.
* sigproc.cc (remove_proc): Close pid_handle and hProcess if appropriate.
* spawn.cc (spawn_guts): Set cygheap->pid_handle on first exec.
* cygheap.h (init_cygheap::pid_handle): New element.
* pinfo.cc (set_myself): Clear previously existing cygheap->pid_handle when a
new process has been started.
(pinfo::wait): Make sure that a handle to the newly forked/spawned process is
kept around so that the pid will not be reused.
* pinfo.h (_pinfo::pid_handle): Move.
(pinfo::pid_handle): to here.
* spawn.cc (spawn_guts): Create a pid_handle in cygheap prior to spawning to
ensure that the pid does not get reused during the lifetime of the "cygwin
pid".
* pinfo.h (pinfo::alert_parent): New function.
* exceptions.cc (sig_handle_tty_stop): Use alert_parent to send "signals" to
parent.
* fork.cc (fork_parent): Don't close pi.hProcess.  Let the waiter thread do
that.
* pinfo.cc (proc_waiter): Detect case where process exits without setting the
exit code and use value from GetExitCodeProcess.  Reluctantly implement
__SIGREPARENT.
(pinfo::alert_parent): Define.
* sigproc.h (__SIGREPARENT): New enum.
* spawn.cc (spawn_guts): Send reparent signal to parent on exec.  Always create
process in suspended state to avoid races.  Remove cygthread.h in favor of
cygtls.h throughout since cygtls now includes cygthread.h.  Eliminate
ppid_handle usage throughout.
* child_info.h: Regenerate magic number
(child_info): Remove pppid_handle.
* cygthread.h (cygthread::release): New method.  Frees thread without waiting.
* cygthread.cc (cygthread::stub): Set _ctinfo in _mytls to point to information
for executing thread.  Don't call SetEvent if thread is no longer in use.
(cygthread::simplestub): Ditto.
* cygtls.h (_cygtls::_ctinfo): New element contains pointer to information
about executing cygthread, if any.
* dcrt0.cc: Remove last vestiges of per_thread stuff.
(dll_crt0_0): Ditto.  Remove accommodation for ppid_handle.
(do_exit): Remove obsolete reparenting test.
(_exit): Exit with a more SUSv3-like exit value.
* dtable.cc (dtable::stdio_init): Check for myself->cygstarted rather than
myself->ppid_handle to see if we were started by a cygwin process.
* exceptions.cc (open_stackdumpfile): Ditto.
(handle_exceptions): Ditto.
(ctrl_c_handler): Ditto.
(sig_handle_tty_stop): Ditto.  Let parent send signal to itself on STOP.
(sigpacket::process): Comment out vfork test.
(signal_exit): Use more SUSv3-like exit value on signal.
* external.cc (fillout_pinfo): Don't set hProcess.
* fork.cc: Remove VFORK cruft.
(per_thread::set): Delete.
(fork_child): Remove perthread stuff.
(fork_parent): Remove obsolete subproc_init.  Accommodate new method for
tracking subprocesses.
* pinfo.cc (set_myself): Accommodate new pinfo/_pinfo layout.  Set some things
here that used to be set in wait_sig.
(_pinfo::exit): Set exitcode here.  Close process pipe.
(_pinfo::commune_send): Accommodeate new pinfo/_pinfo layout.
(proc_waiter): New function.  Waits, in a thread for subprocess to go away.
(pinfo::wait): New function.  Initialization for proc_waiter.
* pinfo.h (_pinfo::exitcode): New element.
(_pinfo::cygstarted): Ditto.
(_pinfo::wr_proc_pipe): Ditto.
(_pinfo::ppid_handle): Delete.
(_pinfo::hProcess): Delete.
(_pinfo::lock): Delete.
(pinfo::hProcess): New element.
(pinfo::lock): Ditto.
(pinfo::wait): Declare new function.
(pinfo::preserve): Define new function.
* sigproc.cc: Remove old stuff from wait_subproc thread based method.
(zombies): Remove.
(procs): New.
(my_parent_is_alive): Just check that the parent pid exists.
(mychild): Just use pinfo methods to determine if child is mine.
(proc_subproc): Revamp PROC_ADDCHILD to use pinfo::wait.  Remove
PROC_CHILDTERMINATED logic.  Use different method to remove processes from list
when SIGCHLD == SIG_IGN.
(proc_terminate): Gut.
(subproc_init): Delete.
(init_child_info): Remove setting of pppid_handle.
(checkstate): Revamp to only scan procs array.
(remove_proc): Rename from remove_zombie.  Don't close hProcess or pid_handle.
Don't release memory if it's myself.
(stopped_or_terminated): Change logic to handle new consolidated proc/zombie
array.
(wait_subproc): Delete.
* sigproc.h: Remove obsolete EXIT_* defines.
(subproc_init): Remove declaration.
* spawn.cc (spawn_guts): Remove reparenting stuff.  Use standard wait logic to
wait for child if started from a non-cygwin process.
* tlsoffsets.h: Regenerate.
* tty.cc (tty_init): Check for myself->cygstarted rather than
myself->ppid_handle to see if we were started by a cygwin process.
* include/sys/signal.h (external_pinfo::exitcode): Replace hProcess.
* include/sys/wait.h (WCOREDUMP): Define.
* fhandler_tty.cc (fhandler_tty_slave::read): Add debugging output for timeout
case.
* signal.cc (abort): Flag that we are exiting with the ABORT signal.
2004-11-26 04:15:10 +00:00
Christopher Faylor c6fdc68916 * select.cc (select_stuff::test_and_set): Remove extraneous tests of
"window_handle".
2004-11-22 15:38:17 +00:00
Danny Smith 7e33b8b32f 2004-11-21 Benoit Blanchon <bblanchon@users.sourceforge.net>
* include/wingdi.h (AC_SRC_ALPHA, AC_SRC_NO_ALPHA,
	AC_DST_NO_ALPHA, ...): Add defines.
	* include/winuser.h (ULW_COLORKEY,ULW_ALPHA,
	ULW_OPAQUE): Add defines.


	Change email address in ChangleLog to sourceforge alias
2004-11-21 23:55:55 +00:00
Danny Smith d11206f65b * include/winnt.h (VerSetConditionMask): Correct typo in _WIN32_WINNT
guard.
	* lib/kernel32.def (VerSetConditionMask): Correct stdcall
	suffix.
	* lib/ddk/ntoskrnl.def (VerSetConditionMask): Likewise.
2004-11-21 19:45:25 +00:00
Pierre Humblet 2d2a068087 2004-11-20 Pierre Humblet <pierre.humblet@ieee.org>
* fhandler.cc (fhandler::write): Remove debug_printf.
	* pipe.cc (fhandler_pipe::create): Edit syscall_printf format.
2004-11-20 23:42:36 +00:00
Pierre Humblet e70bea195b 2004-11-20 Pierre Humblet <pierre.humblet@ieee.org>
* cygheap.h (cygheap_user::get_windows_id): New method.
	* registry.h (get_registry_hive_path): Change argument type.
	(load_registry_hive): Ditto.
	* registry.cc (get_registry_hive_path): Change argument type and take
	Win9x keys into account.
	(load_registry_hive): Ditto.
	* uinfo.cc (cygheap_user::env_userprofile): Use get_windows_id, even
	for SYSTEM.
	* shared.cc (user_shared_initialize): Use get_windows_id.
	* syscalls.cc (seteuid32): Load the registry hive and reload the user
	shared also on Win9x.
2004-11-20 19:09:19 +00:00
Danny Smith 225699ae46 * include/winbase.h (PPROCESS_INFORMATION): Add typedef.
(CreateProcessWithLogonW): Declare.
	(LOGON_WITH_PROFILE, LOGON_NETCREDENTIALS_ONLY): Add defines.
	Thanks to: "jkmaki" <jkmaki@users.sourceforge.net>

	Correct some ChangeLog typos.
2004-11-20 00:03:08 +00:00
Danny Smith 78f717651f * include/sspi.h (SecPkgContext_Sizes): Fix typo.
Thanks to: David Leonard  <leonard@users,sourceforge.net>
2004-11-19 10:15:00 +00:00
Danny Smith 7fd30f5b15 * include/sspi.h (SecPkgCredentials_Names[AW]): Correct name.
Thanks to: David Leonard  <leonard@users,sourceforge.net>
2004-11-19 10:08:25 +00:00
Danny Smith 8f287205e8 2004-11-19 Magnus Olsen <greatlord@sourceforge.users.net>
* include/winuser.h (MSLLHOOKSTRUCT): Add structure.
2004-11-19 09:42:46 +00:00
Danny Smith 1e7e1a9fd7 2004-11-19 Magnus Olsen <greatlord@sourceforge.users.net>
* include/winuser.h (LLKHF_EXTENDED, LLKHF_INJECTED, LLKHF_UP):
	Add defines.
	(LLKHF_ALTDOWN): Define based on KF_ALTDOWN,
2004-11-19 09:35:09 +00:00
Danny Smith b359f9adfe 2004-11-19 Benoit Blanchon <benoit.blanchon@free.fr>
* include/shellapi.h (NIF_GUID): Add define.


Correct my 2004-11-04 Changelog entry
2004-11-19 08:30:26 +00:00
Earnie Boyd 3ff5506593 * include/w32api.h (Windows95, etc. and IE3, etc.): Add definitions. 2004-11-18 15:04:10 +00:00
Earnie Boyd 24984fcb45 2004-11-18 Earnie Boyd <earnie@users.sf.net>
* include/wincon.h (AttachConsole): Correct the _WIN32_WINNT filter.
	Changed it twice due to inconsistent MSDN documentation.
2004-11-18 13:57:06 +00:00
Earnie Boyd 43b9a723cc 2004-11-18 Earnie Boyd <earnie@users.sf.net>
* include/wincon.h (AttachConsole): Correct the _WIN32_WINNT filter.
2004-11-18 13:53:20 +00:00
Bas van Gompel d26eb2a13b * cygcheck.cc (eprintf): New function. 2004-11-18 05:20:23 +00:00
Bas van Gompel cd1ab47e38 * cygcheck.cc (find_on_path): Clear show_error and/or print_failed
parameters to display_error.
(rva_to_offset): Ditto.
(dll_info): Ditto.
(track_down): Ditto.
2004-11-16 05:16:59 +00:00
Pierre Humblet 87b838398a 2004-11-13 Pierre Humblet <pierre.humblet@ieee.org>
* kill.cc (forcekill): Do not pass negative pids to
	cygwin_internal. Check if sig == 0. Improve error messages.
	(main): Make pid a long long and distinguish between pids, gpids
	(i.e. negative pids) and Win9x pids.
2004-11-13 16:30:19 +00:00
Danny Smith 95e3512d53 * include/shlobj.h (SHGFP_TYPE): Add enum. 2004-11-13 10:36:08 +00:00
Danny Smith 6f68e4938c 2004-11-12 Lo�c Guilloux (glx@users.sourceforge.net>
* include/winuser.h (WM_THEMECHANGED): Add define.
2004-11-13 03:42:40 +00:00
Danny Smith d7dbb7f8d8 * include/ddk/winddk.h (ExAllocateFromPagedLookasideList,
ExFreeToPagedLookasideList): Guard inline versions with
	(__USE_NTOSKRNL__) && (_WIN32_WINNT >= 0x0501). Declare as
	external functions for earlier _WIN32_WINNT.
2004-11-12 08:26:44 +00:00
Christopher Faylor e8248d0132 * include/cygwin/version.h: Bump DLL minor number to 13. 2004-11-11 16:26:13 +00:00
Christopher Faylor 213c7a7d94 * cygcheck.cc: Change "keyeprint" to "display_error" throughout. 2004-11-11 01:56:02 +00:00
Christopher Faylor 28fbe53af8 * cygcheck.cc (main): Allow a '-l' without an additional argument. 2004-11-11 01:52:33 +00:00
Bas van Gompel 5ccf388ed8 * cygcheck.cc (keyeprint): New optional parameters: show_error and
print_failed.
2004-11-11 01:17:29 +00:00