Commit Graph

3917 Commits

Author SHA1 Message Date
Christopher Faylor 2d1d1eb1e4 * cygtls.h (_threadinfo::call): Remove regparm declaration to work around
compiler bug.
* autoload.cc (TryEnterCriticalSection): Remove.
* dcrt0.cc (dll_crt0_0): Delete inappropriate setting of _my_tls.stackptr to
NULL since it has really bad consequences.  Make 'si' an automatic variable.
* cygtls.cc (_threadinfo::init_thread): Correct thinko which caused thread list
to be allocated every time.
* cygtls.h (CYGTLS_PADSIZE): Define as const int.
* sync.h: Make multiple inclusion safe.
(muto::next): Eliminate.
(muto::exiting_thread): New variable.
(muto::set_exiting_thread): New function.
(new_muto): Change to use different section for mutos since c++ give
inexplicable warning in some cases otherwise.
(new_muto1): Ditto.
* dcrt0.cc (do_exit): Call muto::set_exiting_thread here.
* sync.cc (muto_start): Eliminate.
(muto::acquire): Always give exiting thread a lock.  Never give thread a lock
if exiting.
(muto::release): Ditto for releasing.
* dtable.cc (dtable::init_lock): Unline function and define here.
* dtable.h (lock_cs): Define as a muto since critical sections seem to work
oddly on Windows Me.
(lock): Accommodate switch to muto.
(unlock): Ditto.
* exceptions.cc (setup_handler): Don't worry about acquiring mutos since that
hasn't mattered for a long time.
(signal_exit): Ditto: muto stuff will be handled automatically on exit now.
* Makefile.in (DLL_IMPORTS): Link advapi32 to ensure proper DLL initialization.
* autoload.cc (RegCloseKey): Arbitrarily choose this function as a "seed" to
pull the advapi32 link library in.  So, comment out the autoloading.
* cygtls.cc (_threadinfo::init_thread): Just clear CYGTLS_PADSIZE.
(_threadinfo::remove): Add debugging.
(_threadinfo::find_tls): Ditto.
* cygtls.h (_threadinfo::padding): Make zero length (for now?).
* dcrt0.cc (dll_crt0_0): Move more initialization here from dll_crt0_1.
(dll_crt0_1): See above.
* dtable.h (dtable::lock): Remove commented out critical section locking.
* dtable.h (dtable::init_lock): Remove commented out critical section locking.
* dtable.h (dtable::unlock): Remove commented out critical section locking.
* exceptions.cc (interruptible): bool'ize.
* init.cc (threadfunc_fe): Revert to storing threadfunc at stack bottom.
(munge_threadfunc): Ditto.  Avoid adding overhead to calibration_thread.
(prime_threads): Don't initialize tls stuff.
(dll_entry): Make minor change to initialization order.
* tlsoffsets.h: Regenerate.
* sigproc.cc (wait_sig): Add sanity check for end of process thread exit.
* select.h: Make minor formatting change.
* Makefile.in: Add still more -fomit-frame-pointer functions.
* dtable.h (dtable::lock): New function.
(dtable::unlock): New function.
(dtable::init_lock): New function.
* cygheap.h (HEAP_TLS): Declare new enum value.
(init_cygheap::threadlist): Declare new array.
(init_cygheap::sthreads): Declare new variable.
(cygheap_fdmanip::~cygheap_fdmanip): Use new dtable lock/unlock functions.
(cygheap_fdnew::cygheap_fdnew): Ditto.
(cygheap_fdget::cygheap_fdget): Ditto.
* dtable.cc (dtable_init): Initialize fdtab critical section.
(dtable::fixup_after_fork): Ditto.
(dtable::fixup_after_exec): Ditto.
(dtable::dup2): Use lock/unlock calls to protect access to fdtab.
(dtable::find_fifo): Ditto.
(dtable::fixup_before_fork): Ditto.
(dtable::fixup_before_exec): Ditto.
(dtable::set_file_pointers_for_exec): Ditto.
(dtable::vfork_child_dup): Ditto.
(dtable::vfork_parent_restore): Ditto.
* syscalls.cc (close_all_files): Ditto.
* sync.h (muto::acquired): Declare new function.
(new_muto1): Declare new macro used to specify name of muto storage.
* sync.cc (muto::acquired): Define new function.
* cygthread.cc (cygthread::stub): Remove signal chain removal call since it is
handled during initialization now.
* cygthread.cc (cygthread::simplestub): Remove signal chain removal call since
it is handled during initialization now.
* cygtls.cc (sentry): New class used for locking.  Use throughout.
(_threadinfo::reset_exception): Don't pop stack.
(_threadinfo::find_tls): Move from exceptions.cc.
(_threadinfo::init_thread): Initialize array of threads rather than linked
list.  Take second argument indicating thread function for this thread.
(_threadinfo::remove): Search thread array rather than linked list.  Use sentry
to lock.  Only unlock if we got the lock.
(_threadinfo::find_tls): Ditto for first two.
(handle_threadlist_exception): Handle exceptions when manipulating the thread
list in case of premature thread termination.
(_threadinfo::init_threadlist_exceptions): Ditto.
* cygtls.h (TLS_STACK_SIZE): Decrease size.
(_threadinfo::padding): Add element to avoid overwriting lower part of stack.
(_threadinfo::remove): Add a "wait" argument to control how long we wait for a
lock before removing.
* exceptions.cc (init_exception_handler): Make global.  Take argument to
control exception handler being set.
(ctrl_c_handler): Wait forever when removing self from signal chain.
(_threadinfo::find_tls): Move to cygtls.cc.
(sig_handle): Reorganize detection for thread-specific signals.
* heap.cc (heap_init): Rework slightly.  Make fatal error more verbose.  Remove
malloc initialization since it can't happen during dll attach.
* init.cc (search_for): Move address to search for on stack here.
(threadfunc_ix): Ditto for stack offset.  Make shared so that stack walk
potentially only has to be done once when cygwin processes are running.
(threadfunc_fe): Use standard tls to store thread function (may change back
later).
(calibration_thread): New function.  Potentially called to find threadfunc_ix.
(munge_threadfunc): Search for "search_for" value on stack.  Output warning
when thread func not found on stack.  Use standard tls to store thread
function.
(prime_threads): New function.  Called to prime thread front end.
(dll_entry): Call dll_crt0_0 here when DLL_PROCESS_ATTACH.  Call prime_threads
here.  Try to remove thread from signal list here.
* sigproc.cc (wait_sig): Initialize threadlist exception stuff here.
* thread.cc (pthread::exit): Pass argument to signal list remove function.
* thread.h: Remove obsolete *ResourceLock defines.
* tlsoffsets.h: Regenerate.
* winsup.h (spf): Define temporary debug macro to be deleted later.
* dcrt0.cc (dll_crt0_0): New function, called during DLL initialization.
Mainly consists of code pulled from dll_crt0_1.
(dll_crt0_1): See above.
(_dll_crt0): Wait for initial calibration thread to complete, if appropriate.
Move some stuff to dll_crt0_0.
(initialize_main_tls): Accommodate argument change to
_thread_info::init_thread.
* fork.cc (fork_child): Ditto.
(sync_with_child): Fix debug message.
* external.cc (cygwin_internal): Remove special considerations for
uninitialized dll since initialization happens during dll attach now.
* dlfcn.cc (dlopen): Remove obsolete *ResourceLock calls.
(dlclose): Ditto.
* cygheap.h (init_cygheap::close_ctty): Declare new function.
* cygheap.cc (init_cygheap::close_ctty): Define new function.
* syscalls.cc (close_all_files): Use close_ctty.
(setsid): Ditto.
* cygthread.cc (cygthread::stub): Remove exception initialization.
* cygthread.cc (cygthread::stub): Remove exception initialization.
(cygthread::simplestub): Ditto.
* thread.cc (pthread::thread_init_wrapper): Ditto.
* cygtls.cc (_last_thread): Make static.
(_threadinfo::call2): Initialize exception handler here.
(_threadinfo::find_tls): Move here.
* exceptions.cc (_threadinfo::find_tls): Move.
* dcrt0.cc (__api_fatal): Add prefix info to message here rather than including
it in every call to function.
* winsup.h (api_fatal): Accommodate above change.
* debug.cc (add_handle): Don't do anything if cygheap not around.
(mark_closed): Ditto.
* dll_init.cc (dll_list::detach): Fix debug output.
* fork.cc (sync_with_child): Ditto.
(vfork): Improve debug output.
* heap.cc (heap_init): Ditto.
* exceptions.cc (try_to_debug): Clarify message when debugger attaches.
2004-01-14 15:45:37 +00:00
Danny Smith 461d06f79d 2004-01-14 Greg Chicares <chicares@users.sourceforge.net>
* include/tchar.h (_puttchar): Define.
2004-01-14 07:53:43 +00:00
Joshua Daniel Franklin bcc4e18d5f 2004-01-12 Joshua Daniel Franklin <joshuadfranklin@yahoo.com>
* dll_init.sgml: Update funcsynopsis for DocBook 4.2 SGML DTD.
        * dtable.sgml: Update funcsynopsis for DocBook 4.2 SGML DTD.
        * external.sgml: Update funcsynopsis for DocBook 4.2 SGML DTD.
        * path.sgml: Update funcsynopsis for DocBook 4.2 SGML DTD.
        * pinfo.cc: Update funcsynopsis for DocBook 4.2 SGML DTD.
        * shared.sgml: Update funcsynopsis for DocBook 4.2 SGML DTD.
        * stackdump.sgml: Update funcsynopsis for DocBook 4.2 SGML DTD.
2004-01-11 18:52:50 +00:00
Joshua Daniel Franklin ac51da4818 2004-01-11 Joshua Daniel Franklin <joshuadfranklin@yahoo.com>
* Makefile.in: Add new target for single-file User's Guide, use new
        cygwin.dsl for output.
        * cygwin.dsl: New file, DSSSL stylesheet for custom Cygwin output.
        * cygwin-api.in.sgml: Update to DocBook SGML 4.2 DTD.
        * cygwin-ug-net.in.sgml: Update to DocBook SGML 4.2 DTD.
        * cygwin-ug.in.sgml: Update to DocBook SGML 4.2 DTD.
        * cygwinenv.sgml: Correct some tags. Add description of default values
        to ntsec, export, and error_start items.
        * dll.sgml: Add explanation of cyg prefix for DLLs.
        * effectively.sgml: Use systemitem tag for names of Cygwin packages.
        * how-programming.texinfo: Add example to FAQ entry.
        * pathnames.sgml: Add discussion of /proc filesystem.
	* setup-net.sgml: Correct some typos and grammar.
2004-01-11 08:32:09 +00:00
Danny Smith edee465c9a 2004-01-05 Filip Navara <xnavara@volny.cz>
* include/prsht.h (LPCPROPSHEETPAGEW): Fix definition.
	* include/shlwapi.h (SHRegQueryInfoUSKey[AW]): Fix prototype.
	* include/cpl.h (CPL_STARTWPARMS[AW]): Correct.
	* include/shellapi.h (ABS_AUTOHIDE, ABS_ALWAYSONTOP,
	SEE_MASK_NO_CONSOLE, SEE_MASK_ASYNCOK, SEE_MASK_HMONITOR,
	FOF_NOCOPYSECURITYATTRIBS): Add defines.
	* include/shlobj.h (BFFM_SETOKTEXT, BFFM_SETEXPANDED,
	CSIDL_FLAG_DONT_VERIFY, CSIDL_FLAG_CREATE, CSIDL_FLAG_MASK,
	CFSTR_INETURL[AW], SHGDN_FOREDITING, SHGDN_FORADDRESSBAR,
	SSF_*): Add defines.
	(SHCNF_PATH[AW], SHCNF_PRINTER[AW], CFSTR_FILENAME[AW],
	CFSTR_FILENAMEMAP[AW], CFSTR_FILEDESCRIPTOR[AW], CFSTR_SHELLURL,
	CMDSTR_NEWFOLDER[AW], CMDSTR_VIEWLIST[AW], CMDSTR_VIEWDETAILS[AW]):
	Correct.
	(IEnumIDList): Add COBJMACROS.
	* include/winuser.h (MIM_*): Add define.
2004-01-04 21:35:32 +00:00
Danny Smith ae70c6f183 * include/mshtml.h (IHTMLDocument2): Correct write, writeln
declarations.
	Thanks to: Rene Nyffenegger <renenyffenegger@users.sf.net>.
2004-01-04 09:04:19 +00:00
Danny Smith ffdd3bba14 * include/mshtml.h (IHTMLDocument2): Correct write, writeln
declarations.
	Thanks to: Rene Nyffenegger <renenyffenegger@users.sf.net>.
2004-01-03 23:18:31 +00:00
Danny Smith b01201ec32 2004-01-03 Filip Navara <xnavara@volny.cz>
* include/cguid.h (CLSID_StdGlobalInterfaceTable): Declare IID.
	* include/oaidl.h (ITypeLib2, ITypeInfo2): Define interfaces,
	declare IID's.
	(IErrorInfo): Add COBJMACROS.
	* include/objbase.h (STGM_NOSNAPSHOT): Add define.
	(CoGetPSClsid): Add protototype,
	(CoRegisterPSClsid): Likewise.
	* include/objidl.h (IMarshal): Correct methods.
	(IMallocSpy): Likewise,
	(LPPSFACTORYBUFFER): Add typedef.
	(IGlobalInterfaceTable): Define interface and COBJMACROS. Declare
	IID.
	(IStorage_CreateStorage, IRpcStubBuffer_Invoke): Fix macros.
	* include/ocidl.h (PROPBAG2_TYPE): Define enum.
	(PROPBAG2, QACONTAINERFLAGS, QACONTAINER, QACONTROL): Define
	structures.
	(IPropertyBag2, IPersistPropertyBag2,IAdviseSinkEx, IPointerInactive,
	IOleUndoUnit, IOleParentUndoUnit, IEnumOleUndoUnits, IOleUndoManager,
	IQuickActivate): Define interfaces. Declare IID's.
	(IPersistPropertyBag2): Add COBJMACROS.
	(LPOLEUNDOMANAGER): Add typedef.
	(LPPROPERTYBAG2): Likewise.
	* include/oleidl.h (LPPARSEDISPLAYNAME): Fix definiton.
	(BINDSPEED): Add definition.
	(IParseDisplayName, IOleItemContainer, IOleObject, IDropSource,
	IDropTarget): Add COBJMACROS.
	* include/wtypes.h (MEMCTX, MSHCTX): Fix enums.
	* include/winerror.h (CO_S_NOTALLINTERFACES): Add define.
	* lib/uuid.c (IID_IGlobalInterfaceTable, IID_IOleUndoManager,
	IID_IPersistPropertyBag2, IID_IPropertyBag2, IID_IRpcProxyBuffer):
	Add definitions.
2004-01-03 22:12:35 +00:00
Christopher Faylor 0efff769fd * exceptions.cc (_threadinfo::interrupt_now): Avoid double call to sigdelayed.
* pinfo.cc (_pinfo::commune_send): Avoid inexplicable test which caused most
pids to be shown as "<defunct>" on Win9x.
2004-01-03 20:57:11 +00:00
Christopher Faylor c0bece84cd add missing entry 2004-01-03 19:06:21 +00:00
Christopher Faylor 05461d6322 2004 stuff. 2004-01-03 18:55:14 +00:00
Christopher Faylor 85dde362ca 2004 stuff 2004-01-03 18:53:49 +00:00
Christopher Faylor e80cbe3e52 * cygheap.h (init_cygheap): Play more vfork shell games and move ctty_on_hold
and open_fhs_on_hold (back) here.
* dcrt0.cc (_dll_crt0): Just set impure_ptr_ptr here and let later
initialization deal with tls.
* dtable.cc (dtable::vfork_child_fixup): Move ctty considerations here.
(dtable:vfork_parent_restore): And here.
* fork.cc (vfork): Reflect change to ctty handling.
* perthread.h (vfork_save::fhctty): Eliminate.
* cygwin.din: Make more exports NOSIGFE that will never be interrupted by a
signal.
* init.cc (dll_entry): Set stackptr to NULL to catch problems earlier.
2004-01-03 18:15:03 +00:00
Danny Smith 8b93d1c1ab 2004-01-02 Filip Navara <xnavara@volny.cz>
* include/ddk/winddk.h: Don't care about value of
	DBG define.

2004-01-02  Danny Smith  <dannysmith@users.sourceforge.net>
	    Filip Navara  <xnavara@volny.cz>

	* include/ddk/winddk.h (_DDK_DUMMYUNION_MEMBER,
	_DDK_DUMMYUNION_N_MEMBER): New macros.
	(ExAllocateFromPagedLookasideList,ExFreeToPagedLookasideList,
	ExAllocateFromNPagedLookasideList, ExFreeToNPagedLookasideList):
	Use them.
2004-01-02 03:19:52 +00:00
Danny Smith c8b0d378a7 2004-01-01 Filip Navara <xnavara@volny.cz>
* include/objbase.h:  Don't care about value of DBG define.
	* include/objidl.h: Add some COBJMACROS.
	* include/ocidl.h: Ditto.
	* include/oleidl.h: Ditto.
	* include/servprov.h: Ditto.
	* include/shlobj.h: Ditto.
	* include/shlobj.h (IContextMenu2): Correct parent in
	DECLARE_INTERFACE.
	* include/oleidl.h (IOleCache, IOleCache2, IOleCacheControl):
	Define interfaces.
	* include/setupapi.h (SetupGetLineTextA): Correct prototype.
	Add new constants for _SETUPAPI_VER >= 0x501.
2004-01-01 22:34:20 +00:00
Danny Smith 8e2d432524 2004-01-01 Filip Navara <xnavara@volny.cz>
* include/winnt.h (NtCurrentTeb): Add inline definition.
2004-01-01 11:21:48 +00:00
Danny Smith 855c33f8b7 2004-01-01 Martin Fuchs <martin-fuchs@gmx.net>
* include/shlobj.h (SHCoCreateInstance): Add prototype..
	* lib/shell32.def (SHCoCreateInstance): Add export stub.
2004-01-01 11:00:43 +00:00
Danny Smith 54407e0691 2004-01-01 Igor Pechtchanski <pechtcha@cs.nyu.edu>
* lib/setupapi.def (CM_Request_Device_Eject[AW]): Add export.
	(CM_Request_Device_Eject_Ex[AW]): Likwise.
	* include/ddk/cfg.h (DN_*): Add defines.
2004-01-01 10:31:41 +00:00
Danny Smith 9330626fd4 * lib/ddk/cfgmgr32.def: Remove duplicate symbol names. 2004-01-01 10:21:01 +00:00
Danny Smith 4f28a0f0fe 2004-01-01 Mattia Barbon <mbarbon@users.sourceforge.net>
* include/commctrl.h (TVN_GETINFOTIP): Add UNICODE mappings.
	(NMTVGETINFOTIP): Add structure.
2004-01-01 10:16:13 +00:00
Christopher Faylor a7d42fef9f * cygwin.din: Make crt0 functions NOSIGFE.
* include/cygwin/version.h: Gratuitous comment change.
* lib/_cygwin_crt0_common.cc: Remove unneeded declaration.
2003-12-31 06:30:48 +00:00
Christopher Faylor f7cb207b69 * cygtls.h (_threadinfo::stack): Increase stack size to accommodate nested
signal handlers.  Reorganize to cause potential SEGV on stack overflow.
* sigproc.cc (no_signals_available): Check sendsig value rather than relying on
obsolete sig_loop_wait.
(sigproc_terminate): Ditto.
(proc_can_be_signalled): Check sendsig value even for myself.
* tlsoffsets.h: Regenerate.
2003-12-30 03:59:45 +00:00
Christopher Faylor 8ed5c9b629 Move open_fhs from fhandler.h to cygheap.h for easier tracking. Accommodate
this change throughout.
* dtable.cc (dtable::add_archetype): Use correct count when iterating through
*active* archetypes.
* dtable.cc (dtable::fixup_after_exec): Close handle if close_on_exec and
archetype exists since archetype currently does not set windows close-on-exec
flag (FIXME).
* fhandler_tty.cc (fhandler_tty_slave::open): Change debugging output slightly.
(fhandler_tty_slave::close): Ditto.
(fhandler_tty_slave::fixup_after_fork): Just report on inherited use counts
since since archetype currently does not set windows close-on-exec flag
(FIXME).
* pinfo.cc (_pinfo::set_ctty): Change debugging output slightly.
* cygheap.cc (cygheap_init): Remove open_fhs accommodation and use count
reporting.
* perthread.h (vfork_save::fhctty): New element.
* perthread.h (vfork_save::open_fhs): New element.
* fork.cc (vfork): Muck around with ctty and open_fhs stuff, both of which are
now saved in the vfork_save structure.
2003-12-30 01:57:16 +00:00
Christopher Faylor e97377932b * fhandler.h (fhandler_tty_slave::archetype): Make public.
(report_tty_counts): New macro.  Use throughout for reporting tty use counts.
* dtable.cc (dtable::vfork_child_dup): Add debugging output for usecount
increment.  Increment open_fhs if appropriate.
(dtable::vfork_parent_restore): "Close" artificially bumped ctty.
(dtable::vfork_child_fixup): Close ctty since it was bumped prior to vfork.
Save open_fhs around close since the closing of these handles has no effect on
the console.
* fhandler_tty.cc (fhandler_tty_slave::open): Reorganize calls to allow for
easier tracking of usecount modification.
(fhandler_tty_slave::open): Ditto.
2003-12-27 17:41:17 +00:00
Christopher Faylor fe861ce934 * syscalls.cc (close_all_files): Simplify logic around closing ctty. 2003-12-27 02:41:07 +00:00
Christopher Faylor e35f197f34 * pinfo.cc (_pinfo::set_ctty): *Always* call close on opened ctty since it
counts as an opened handle.
2003-12-27 02:20:07 +00:00
Christopher Faylor 1df3fbe2db * fhandler.h (fhandler_tty_master::fixup_after_fork): Remove declaration.
(fhandler_tty_master::fixup_after_exec): Ditto.
* fhandler_tty.cc (fhandler_tty_master::init): Fix so that children do not
inherit master tty handles.
(fhandler_tty_master::fixup_after_fork): Remove, since it was never used.
(fhandler_tty_master::fixup_after_exec): Ditto.
* pinfo.cc (_pinfo::set_ctty): Increment open_fhs when ctty is set.
* cygheap.cc (cygheap_init): Ditto.
* syscalls.cc (setsid): *Always* call close on opened ctty since the archetype
is associated with the ctty and it counts as an opened handle.
* tty.cc (tty::common_init): Don't protect input/output mutex since it confuses
subsequent fork/execs when CYGWIN=tty.
2003-12-27 01:59:29 +00:00
Christopher Faylor 56b5feb639 * exceptions.cc (try_to_debug): Fix off-by-one problem when resetting
environment variable after error_start detected.
* fhandler_tty_slave.cc (fhandler_tty_slave::close): Clarify debug message.
* syscalls.cc (setsid): Don't increment usecount here, since it will be
automatically decremented on close.
2003-12-27 00:25:02 +00:00
Christopher Faylor 6dc18ca4d3 * exceptions.cc (setup_handler): Protect against a race. 2003-12-26 18:30:41 +00:00
Christopher Faylor 39add36fc3 * path.cc (mount_item::build_win32): Backslashify paths in non-managed case. 2003-12-26 18:26:17 +00:00
Christopher Faylor 91301b852f * Makefile.in (CFLAGS, CXXFLAGS): Remove unneeded include.
(CYGWIN_LIB): Delete.
(cygserver.exe target): Add -L$(cygwin_build) to the link line to force linker
to use build tree version of the library.  Remove specific inclusion of
libcygwin.a from the link line.
2003-12-26 05:37:54 +00:00
Christopher Faylor 76832a5b32 * dcrt0.cc (reent_data): Reluctantly resurrect.
(__cygwin_user_data::impure_ptr): Ditto.
(_dll_crt0): Reluctantly initialize _impure_ptr here.
(initialize_main_tls): Eliminate local_clib initialization since it now happens
in init_thread.
* init.cc (dll_entry): Reluctantly remove code which set _impure_ptr to the
main thread's local_clib.
* perthread.h (reent_data): Remove obsolete declaration.
* sigproc.cc (proc_subproc): Add more debugging output.
(get_proc_lock): Ditto.
*dcrt0.cc (dll_crt0_1): Allocate argv[0] via malloc since main thread could
exit.
2003-12-26 04:40:52 +00:00
Christopher Faylor 1f32b7b382 * winsup.api/pthread/rwlock7.c (main): Don't assume that result of rand
operation is non-zero.
2003-12-24 04:37:19 +00:00
Christopher Faylor 05b2a10ba4 * fork.cc (fork_child): After a pthread/fork, ensure that impure pointer stuff
which resides in parent is propagated to child thread.
2003-12-23 22:24:38 +00:00
Christopher Faylor 281e419402 add missing file 2003-12-23 16:43:45 +00:00
Christopher Faylor 29d52c8a27 * exceptions.cc (set_signal_mask): Redefine to not pass by address. Report
calculated mask in debugging output.
* sigproc.h (set_signal_mask): Reflect above change in declaration.
* path.cc (mount_item::build_win32): Take path apart before feeding it to
fnmunge.  Throughout, change use of _reent_winsup()-> to _my_tls.locals.
instead.  Throughout, remove obsolete MT_SAFE/_CYG_THREAD_FAILSAFE
considerations.  Througout, add cygtls.h include.
* Makefile.in (DLL_OFILES): Add cygtls.o.  Add some more objects to the
-fomit-frame-pointer list.
* acconfig.h: Remove obsolete settings.
* config.h.in: Ditto.
* bsdlib.cc: Add cygtls.h include.
* configure.in: Remove --enable-extra-threadsafe-checking.
* configure: Regenerate.
* cygtls.h (_local_storage): New struct renamed from _winsup_t (sic).
(_threadinfo:local_clib): Add new field.
(_threadinfo::locals): Ditto.
(_threadinfo::init_thread): Accept second _reent * argument.
(_threadinfo::call): Define as regparm.
(CYGTLS_PADSIZE): Remove unnecessary slop.
(_getreent): Define as a macro.
* thread.h: Remove _CYG_THREAD_FAILSAFE and MT_SAFE stuff.
(_winsup_t): Move to cygtls.h.
(ResourceLocks::ResourceLocks): Eliminate empty constructor.
(MTinterface::reents): Eliminate.
(MTinterface::thread_self_key): Eliminate.
(MTinterface::MTinterface): Eliminate.
* dcrt0.cc: Include stdio.h for _impure_ptr initialization.
(do_global_ctors): Remove run_ctors_p (sic) considerations.  Don't call atexit
here.
(__main): Initialize destructors for user here.
(dll_crt0_1): Accept a dummy argument.  Don't call init_thread here.  Don't set
_impure_ptr here.  Call do_global_ctors after more things have been
initialized.
(_dll_crt0): Define zeros buffer as max of needed size of CYGTLS_PADSIZE so
that it can be used for two purposes while minimizing stack usage.  Initialize
_impure_ptr specifically, for speed.  Call dll_crt0_1 with buffer argument.
(cygwin_dll_init): Call dll_crt0_1 with dummy argument.
* dtable.cc (dtable::find_unused_handle): Remove call to AssertResourceOwner.
* exceptions.cc: Move _threadinfo stuff to new file.
* cygtls.cc: New file.
* gentls_offsets: Accommodate increasing complexity of cygtls.h.
* hires.h (hires_base::~hires_base): Remove.
* init.cc (dll_entry): Remove setting of reents.
* thread.cc: Remove syslog.h include.
(__getreent): Simplify to use _my_tls.
(_reent_winsup): Delete.
(AssertResourceOwner): Delete.
(MTinterface::Init): Remove setting of _clib and _winsup, with all that
entails.
(MTinterface::fixup_after_fork): Ditto.
(pthread::thread_init_wrapper): Ditto.  Also remove call to
set_tls_self_pointer.
(pthread::set_tls_self_pointer): Eliminate.
(pthread::get_tls_self_pointer): Just return _my_tls.tid;
(__reent_t::init_clib): Eliminate.
* tlsoffsets.h: Regenerate.
2003-12-23 16:26:31 +00:00
Christopher Faylor 98f56d64c2 * sigproc.cc (proc_subproc): Simplify code to just remove all zombies if
SIGCHLD == SIG_IGN.
2003-12-18 04:42:31 +00:00
Christopher Faylor 1f8331ae8b * pinfo.h (pinfo::operator ==): Add a way to check for _pinfo types.
* sigproc.cc (proc_subproc): Ensure that zombie is removed when SIGCHLD ==
SIG_IGN but still allow wait()ing threads to wake up.
2003-12-17 22:47:32 +00:00
Christopher Faylor 1ed95be609 * exceptions.cc (set_signal_mask): Report on input argument rather than
getsigmask.
* fhandler.h (fhandler_base): Make friends with close_all_files.
* pinfo.cc (_pinfo::set_ctty): Add more debugging.
* sigproc.cc (proc_can_be_signalled): Detect state when signal handler thread
is gone in target process as an EPERM situation.  Set errno to ESRCH if process
doesn't exist.
(sigproc_terminate): Set sendsig to illegal value when closed.
(sig_send): Rely on proc_can_be_signalled setting the proper errno.
* syscalls.cc (close_all_files): Detect when all ttys are closed prior to
calling close_all_files.  The ctty needs to be closed explicitly in this case.
2003-12-16 23:28:03 +00:00
Corinna Vinschen 0c3966ac4e * include/cygwin/ipc.h: Include sys/types.h. 2003-12-16 10:15:28 +00:00
Corinna Vinschen 11377ba668 * bsd_helper.cc (tunable_params): Add entries for kern.ipc.msgmnb and
kern.ipc.msgtql.  Raise max value for kern.ipc.msgseg to 65535.
	* cygserver.conf: Add kern.ipc.msgmnb and kern.ipc.msgtql.
	* sysv_msg.cc (msginit): Add TUNABLE_INT_FETCH call for
	kern.ipc.msgmnb and kern.ipc.msgtql.
2003-12-16 10:13:34 +00:00
Christopher Faylor 5c07a5745f * thread.cc (pthread::init_main_thread): Make sure that the main thread has
valid handles.
(pthread::create_cancel_event): Fix error message.
2003-12-15 14:38:12 +00:00
Christopher Faylor 5e2a359c44 add out-of-date notice. 2003-12-15 04:44:30 +00:00
Christopher Faylor d627d17183 Add missing ChangeLog entry. 2003-12-15 04:17:27 +00:00
Christopher Faylor 9908d9977b * winsup.h (access_worker): Declare with added fhandler_base parameter.
* syscalls.cc (access_worker): Accommodate extra fhandler_base argument.  Use
it instead of stat_worker to determine stat information, when appropriate.
* fhandler.cc (fhandler_base::device_access_denied): Pass fhandler pointer to
access_worker so that it can use the proper method for determining stat
information.
* fhandler_disk_file.cc (fhandler_disk_file::opendir): Ditto.
2003-12-15 04:16:42 +00:00
Christopher Faylor 228f99a6c1 white space 2003-12-15 03:59:32 +00:00
Christopher Faylor f2f1af25ab Remove erroneous entry. 2003-12-15 03:10:38 +00:00
Christopher Faylor f6393387ef * exceptions.cc (ctrl_c_handler): Remove this thread from the signal handler
chain.
2003-12-14 16:55:24 +00:00
Christopher Faylor c350feda20 * cygthread.cc (cygthread::stub): Revert previous change and again subsume
cygthread::stub2.  Just return from function now since ExitThread is guaranteed
by automatic _threadinfo wrapper.  Define as per ThreadProc convention.
(cygthread::stub2): Remove.
(cygthread::simplestub): Perform similar operations to cygthread::stub.
(cygthread::simplestub2): Remove.
* cygthread.h (cygthread::stub): Declare as per ThreadProc convention.
(cygthread::stub2): Remove declaration.
(cygthread::simplestub): Declare as per ThreadProc convention.
(cygthread::simplestub2): Remove declaration.
* cygtls.h (_threadinfo::call): Define first argument as per ThreadProc
convention.
(_threadinfo::call2): Ditto.
(_tlsbase): Define as char * pointer.
(_tlstop): New definition.
(_main_tls): Define here.
* dcrt0.cc (alloc_stack): Revert previous change which called init_thread since
information would be overwritten by fork later anyway.
(dll_crt0_1): Use _tlsbase and _tlstop for setting stack bottom, top.
* exceptions.cc: Move _main_tls declaration to cygtls.h.
(_threadinfo::call): Define first argument as per ThreadProc convention.
(_threadinfo::call2): Call ExitThread with thread function return value.
(_threadinfo::init_thread): Don't initialize cygtls to zero if input arg is
NULL.
* fork.cc (fork_child): Reset _main_tls here.  Reinitialize parts of _my_tls
after copying data from parent.
* init.cc (threadfunc_fe): New function.  Front-end for all threads created in
cygwin processes.
(munge_threadfunc): New function.
(dll_entry): Call munge_threadfunc to force the call of a thread wrapper.
* thread.cc (pthread::thread_init_wrapper): Perform similar operations to
cygthread::stub.
(pthread::thread_init_wrapper2): Remove.
* thread.h (pthread::thread_init_wrapper): Declare as per ThreadProc
convention.
(pthread::thread_init_wrapper2): Remove declaration.
* window.cc (Winmain): Just return from function now since ExitThread is
guaranteed by automatic _threadinfo wrapper.
2003-12-14 07:09:22 +00:00
Danny Smith f082663050 * include/stdio.h:(_fileno): Define macro version after both
fileno and _fileno functions declared.

	* include/stdio.h (_rmtmp, rmtmp): Add prototypes.
	* moldnames.def.in (rmtmp) Add stub.
2003-12-13 21:22:34 +00:00