Commit Graph

44 Commits

Author SHA1 Message Date
Corinna Vinschen 3dc89bbafe Cygwin: signal.h: improve exception flags definition
- add numbers for readability
- add a preprocessor macro for each flag

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-06-26 10:12:10 +02:00
Eric Blake 7b3d8b9485 headers: avoid bareword attributes
Always use the __-decorated form of an attribute name in public
headers, as the bareword form is in the user's namespace, and we
don't want compilation to break just because the user defines the
bareword to mean something else.

Signed-off-by: Eric Blake <eblake@redhat.com>
2017-08-17 07:10:03 -05:00
Corinna Vinschen a346a26790 cygwin/signal.h: Remove SI_QUEUE unimplemented comment
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-08-03 14:56:24 +02:00
Corinna Vinschen f41d402bd4 Revert "cygwin/signal.h: Remove SI_QUEUE unimplemented comment"
This reverts commit 54ed68a781.
2017-08-03 14:55:21 +02:00
Corinna Vinschen 54ed68a781 cygwin/signal.h: Remove SI_QUEUE unimplemented comment
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-08-03 14:54:02 +02:00
Yaakov Selkowitz 187066dcad Cygwin: fix guard on struct siginfo_t
Add line breaks to make it clearer that the struct packing applies to more
than one struct.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2017-07-10 07:53:26 -05:00
Yaakov Selkowitz 8a508f301c Cygwin: fix signal.h with _POSIX_C_SOURCE=1
struct sigaction is POSIX.1-1990 but siginfo_t, which is used by its
sa_sigaction member, is POSIX.1b-1993.  Therefore it needs to be guarded
as well, and as part of a union, the struct size is protected.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2017-07-04 19:22:23 -05:00
Yaakov Selkowitz 6a6c1c52e6 Feature test macros overhaul: Cygwin signal.h
This should match newlib's <sys/signal.h>.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2017-06-14 10:18:15 -05:00
Corinna Vinschen 6e623e9320 Switching the Cygwin DLL to LGPLv3+, dropping commercial buyout option
Bump GPLv2+ to GPLv3+ for some files, clarify BSD 2-clause.

Everything else stays under GPLv3+.

New Linking Exception exempts resulting executables from LGPLv3 section 4.

Add CONTRIBUTORS file to keep track of licensing.

Remove 'Copyright Red Hat Inc' comments.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-06-23 10:09:17 +02:00
Yaakov Selkowitz 7503575f1d cygwin: accept SIGIOT as alias of SIGABRT
winsup/cygwin/
	* include/cygwin/signal.h (SIGIOT): Define SIGIOT in terms of SIGABRT.
	* strsig.cc (struct sigdesc): Ditto.

	winsup/doc/
	* utils.xml (kill): Document SIGIOT.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-02-18 08:20:03 -06:00
Corinna Vinschen a10d969231 Return unique inode numbers when calling stat/fstat on pipes and IP sockets
* fhandler.h (class fhandler_base): Convert unique_id to int64_t.
        (fhandler_base::set_ino): New protected inline method.
        (fhandler_base::get_unique_id): Convert to int64_t.
        (fhandler_base::set_unique_id): New inline method taking int64_t.
        (fhandler_pipe::fstat): Declare.
        (fhandler_pipe::init): Take extra parameter.
        (fhandler_pipe::create): Ditto.
        * fhandler_socket.cc (fhandler_socket::init_events): Set inode number
        to serial number.
        (fhandler_socket::fstat): Set device to DEV_TCP_MAJOR.  Create st_ino
        from get_ino.
        * include/cygwin/signal.h (struct _sigcommune): Replace
        _si_pipe_fhandler with _si_pipe_unique_id.
        * pinfo.h (_pinfo::pipe_fhandler): Take unique id instead of HANDLE.
        * pinfo.cc (commune_process): Accommodate change to _si_pipe_unique_id.
        (_pinfo::commune_request): Ditto.
        (_pinfo::pipe_fhandler): Ditto.
        * pipe.cc (fhandler_pipe::init): Take unique id as argument and set
        inode number and unique_id from there.
        (fhandler_pipe::open): Rework to find any matching pipe from unique
        id in filename.
        (fhandler_pipe::get_proc_fd_name): Create filename using inode number.
        (fhandler_pipe::create): Generate and return unique id from process pid
        and pipe_unique_id.  In outer method, call init with additional unique
        id as parameter.
        (fhandler_pipe::fstat): New method.
        (pipe_worker): Accommodate using 64 bit inode number in filename.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-01-11 12:35:41 +01:00
Sebastian Huber 01885f533d FreeBSD compatibility for <sys/select.h>
* libc/include/sys/_sigset.h: New.
	* libc/include/sys/select.h: Do not include <sys/types.h> and
	<sys/time.h> to avoid cyclic header file dependencies.  Include
	specialized header files instead.
	(sigset_t): Conditionally define.
	* libc/include/sys/signal.h (sigset_t): Likewise.
	* libc/include/sys/time.h: Include <sys/select.h> if
	__BSD_VISIBLE.
	* libc/include/sys/types.h: Likewise.
2015-12-14 15:39:44 +01:00
Corinna Vinschen e437a7d826 Lower Cygwin's MINSIGSTKSZ and SIGSTKSZ
* include/cygwin/signal.h (MINSIGSTKSZ): Define as 8K, unconditionally.
        (SIGSTKSZ): Define as 32K, unconditionally.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-07-19 22:40:29 +02:00
Corinna Vinschen ba170254e6 Define larger MINSIGSTKSZ and SIGSTKSZ values for Cygwin
* include/cygwin/signal.h: Revert to define MINSIGSTKSZ and SIGSTKSZ
	here with bigger values to allow _cygtls to reside on signal stack,
	should it turn out to be required at one point.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-06-26 21:41:26 +02:00
Ken Brown d04fd9d5f7 Complement SIGEV_* enums with macros
* include/cygwin/signal.h (SIGEV_*): Add macros.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-06-23 10:39:06 +02:00
Corinna Vinschen 6442e914d9 Use MINSIGSTKSZ and SIGSTKSZ from newlib for Cygwin as well
* libc/include/sys/signal.h: Move altstack macros completely
	outside of rtems block.

	* include/cygwin/signal.h: Remove definitions of MINSIGSTKSZ
	and SIGSTKSZ here.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-06-20 19:05:51 +02:00
Corinna Vinschen 22465796ed Preliminary infrastructure to implement alternate stack
* libc/include/sys/signal.h: Define SS_ONSTACK and SS_DISABLE
	unconditionally.
	(sigaltstack): Enable prototype on Cygwin.

	* common.din (sigaltstack): Export.
	* cygtls.cc (_cygtls::init_thread): Initialize altstack.
	* cygtls.h (__tlsstack_t): Rename from __stack_t to distinguish
	more clearly from stack_t.  Accommodate throughout.
	(_cygtls): Add altstack member.
	* exceptions.cc (exception::handle): Set SIGSEGV handler to SIG_DFL
	if we encounter a stack overflow, and no alternate stack has been
	defined.
	* include/cygwin/signal.h (MINSIGSTKSZ): Define
	(SIGSTKSZ): Define.
	(SA_ONSTACK): Define.
	* signal.cc (sigaltstack): New function.
	* tlsoffset.h: Regenerate.
	* tlsoffset64.h: Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-06-19 16:12:45 +02:00
Jon TURNEY 383ff5fc47 Try to make sure struct _mcontext is 16-byte aligned
On x86_64, RtlCaptureContext() uses fxsave to save FPU/MMX/SSE state.

fxsave requires that the destination address is 16-byte aligned, or it will
fault.

CONTEXT is already annotated __attribute__ ((aligned (16))), do the same with
struct _mcontext.

Rearrange ucontext_t so that it's struct _mcontext element is also correctly
aligned.

	* include/cygwin/signal.h (struct __mcontext): 16-byte align.
	* include/sys/ucontext.h (ucontext_t): Ditto.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-04-23 21:57:11 +02:00
Jon TURNEY 9afde4dff4 Rename struct ucontext to struct __mcontext
* include/cygwin/signal.h : Rename struct ucontext to struct
	__mcontext.  Fix layout differences from the Win32 API CONTEXT
	type.  Remove unused member _internal.  Rename member which
	corresponds to ContextFlags.  Add cr2 member.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-04-23 21:57:10 +02:00
Corinna Vinschen 3fb21f9143 Prepare to rename/reuse struct ucontext.
* cygtls.h (struct _cygtls): Convert thread_context to type CONTEXT.
	* exceptions.cc (_cygtls::signal_debugger): Use sizeof (CONTEXT) for
	size of CONTEXT copied for GDB's digestion.
	* include/cygwin/signal.h: Add a preliminary comment.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-04-23 21:57:07 +02:00
Corinna Vinschen 61522196c7 * Merge in cygwin-64bit-branch. 2013-04-23 09:44:36 +00:00
Christopher Faylor 118e51be1d * DevNotes: Add entry cgf-000022.
* cygtls.h (_cygtls::func): Define as a sa_sigaction style function.
* exceptions.cc (sig_handle_tty_stop): Ditto.
(_cygtls::interrupt_setup): Fix coercion to accommodate 'func' change.
(ctrl_c_handler): Use tty kill_pgrp to send a signal.
(sigpacket::process): Don't process sigflush here.
(_cygtls::call_signal_handler): Reorganize to avoid a race.  Always call
sa_sigaction style function.
* fhandler_termios.cc (is_flush_sig): Define new function.
(tty_min::kill_pgrp): Handle tty flush when signal detected.
(fhandler_termios::bg_check): Be slightly more paranoid about checking for
valid tty.
(fhandler_termios::sigflush): Don't flush unless tty owner.
* fhandler_tty.cc (fhandler_pty_slave::ioctl): Use tty kill_pgrp to send
signal.
(fhandler_pty_master::ioctl): Ditto.
* signal.cc (killsys): Delete definition.
* sigproc.h (killsys): Delete declaration.
* include/cygwin/signal.h (siginfo_t): Simplify union/struct nesting slightly.
Implement mechanism to allow cygwin data passing.
2013-01-31 05:26:47 +00:00
Christopher Faylor bc837d22f3 Throughout, update copyrights to reflect dates which correspond to main-branch
checkins.  Regularize copyright format.
2013-01-21 04:38:31 +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
Corinna Vinschen 422743b6ec * include/cygwin/signal.h (sigset_t): Define here. 2012-10-26 09:21:48 +00:00
Yaakov Selkowitz 2f7a5c89cc * cygwin.din (psiginfo): Export.
(psignal): Export.
(sys_siglist): Export.
* posix.sgml (std-notimpl): Move psiginfo and psignal from here...
(std-susv4): ... to here.
(std-deprec): Add sys_siglist.
* strsig.cc (sys_siglist): New array.
(psiginfo): New function.
* include/cygwin/signal.h (sys_siglist): Declare.
(psiginfo): Declare.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2011-05-04 22:12:15 +00:00
Yaakov Selkowitz 0512608dbc * include/cygwin/signal.h: Define SIGPWR as synonym for SIGLOST.
* strsig.cc: Ditto.
	* include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR.
2010-02-26 05:43:50 +00:00
Christopher Faylor c4ca0e800a * cygwin.din (sys_sigabbrev): Add this here.
* dcrt0.cc (__argc,__argv,_check_for_executable): Remove dllexport decoration
since it is already handled in cygwin.din.
* errno.cc (_sys_errlist): Ditto.
* strsig.cc (sys_sigabbrev): Ditto.
* include/cygwin/signal.h: Protect use of dllimport when __INSIDE_CYGWIN__.
* libc/getopt.c: Revert previous changes.  Define __INSIDE_CYGWIN__.
2008-09-11 06:22:31 +00:00
Christopher Faylor 5c8891e962 * cygwin/strsig.cc (__signals): New macro.
(sys_sigabbrev): New array of signal strings, patterned after linux.
(siglist): Use __signals.
* cygwin/include/cygwin/signal.h (sys_sigabbrev): Define.
* cygwin/include/cygwin/version.h: Bump API minor version to 177.

* utils/Makefile.in (kill.exe): Remove reliance on libiberty.
* utils/kill.cc (strsigno): New function patterned after libiberty but using
newly exported cygwin array.
2007-07-10 00:12:54 +00:00
Christopher Faylor f64b151f59 * include/cygwin/signal.h: Add __extension__ to various anonymous unions and
structs.  (thanks to V.Haisman)
2006-11-27 16:43:34 +00:00
Christopher Faylor dccd2abec6 * sigproc.cc (sigalloc): Don't set SA_RESTART here.
* signal.cc (_SA_NORESTART): New flag.
(sigaction_worker): New function, derived from sigaction.  Don't set internal
flags unless called internally.
(sigaction): Use sigaction_worker.
(signal): Honor new _SA_NORESTART flag.
(siginterrupt): Set _SA_NORESTART flag appropriately.  Use sigaction_worker to
set flags.
* include/cygwin/signal.h: Define _SA_INTERNAL_MASK here.
2006-03-23 15:55:59 +00:00
Corinna Vinschen c6e48b1cd1 * cygwin.din: Export sigignore and sigset.
* exceptions.cc (sigset): New function.
	(sigignore): New function.
	* include/cygwin/signal.h (SIG_HOLD): Define.
	(sigignore): Declare.
	(sigset): Declare.
	* include/cygwin/version.h: Bump API minor number to 154.
2006-02-16 18:21:49 +00:00
Christopher Faylor 985d0e68c5 Always zero all elements of siginfo_t throughout.
* cygtls.h (_cygtls::thread_context): Declare new field.
(_cygtls::thread_id): Ditto.
(_cygtls::signal_exit): Move into this class.
(_cygtls::copy_context): Declare new function.
(_cygtls::signal_debugger): Ditto.
* cygtls.cc (_cygtls::init_thread): Fill out thread id field.
* exceptions.cc (exception): Change message when exception info is unknown.
Copy context to thread local storage.
(_cygtls::handle_exceptions): Avoid double test for fault_guarded.  Reflect
move of signal_exit to _cygtls class.
(sigpacket::process): Copy context to thread local storage.
(_cygtls::signal_exit): Move to _cygtls class.  Call signal_debugger to notify
debugger of exiting signal (WIP).  Call stackdump here (WIP).
(_cygtls::copy_context): Define new function.
(_cygtls::signal_debugger): Ditto.
* tlsoffsets.h: Regenerate.
* include/cygwin.h (_fpstate): New internal structure.
(ucontext): Declare new structure (WIP).
(__COPY_CONTEXT_SIZE): New define.
* exceptions.cc (_cygtls::interrupt_setup): Clear "threadkill" field when there
is no sigwaiting thread.
(setup_handler): Move event handling into interrupt_setup.
2006-02-06 18:24:11 +00:00
Corinna Vinschen d05c10aecd Bump copyright dates. 2006-01-02 13:01:42 +00:00
Christopher Faylor a14d65557a * exceptions.cc (_cygtls::interrupt_setup): Implement SA_RESETHAND.
* include/cygwin/signal.h: Define SA_ONESHOT and SA_NOMASK.
* dcrt0.cc (get_cygwin_startup_info): Remove commented out code.
2006-01-01 16:51:29 +00:00
Christopher Faylor f153e6b280 * cygtls.h (_cygtls::el): New field.
(_cygtls::handle_exceptions): New function declaration.
(_cygtls::handle_threadlist_exception): Ditto.
(_cygtls::init_exception_handler): Ditto.
(_cygtls::init_threadlist_exceptions): Remove arg from declaration.
* cygtls.cc (_cygtls::call2): Don't initialize exceptions here.
(_cygtls::init_thread): Do it here instead and use member function.
(_cygtls::handle_threadlist_exception): Move into _cygtls class.
(_cygtls::init_exception_handler): Ditto.  Rely on existence of 'el' memmber in
_cygtls.
(_cygtls::init_threadlist_exceptions): Ditto.
* dcrt0.cc (dll_crt0_1): Remove exception_list definition and setting since it
now commonly resides in the tls.
* exceptions.cc (init_exception_handler): Move to cygtls.cc.
(init_exceptions): Ditto.
(rtl_unwind): New, safe wrapper function for RtlUnwind.
(_cygtls::handle_exceptions): Move to _cygtls.  Call rtl_unwind to unwind
frames and eliminate copying of structures.  Put address of failing instruction
in si_addr, not the address on the stack.  Return 0 to indicate that we've
handled this exception.
* external.cc (cygwin_internal): Make CW_INIT_EXCEPTIONS a no-op.
* sigproc.cc (wait_sig): Accommodate argument change to
_cygtls::init_threadlist_exceptions.
* tlsoffsets.h: Regenerate.
* include/exceptions.h (exception_list): Add more stuff to the exception list.
Apparently windows needs this?
(init_exceptions): Remove bogus declaration.
* include/cygwin/signal.h (SI_USER): Redefine as zero as per SUSv3.
* thread.cc (pthread_kill): Set si_pid and si_uid.
* timer.cc (timer_thread): Set si_code to SI_TIMER.
2005-12-03 04:23:35 +00:00
Corinna Vinschen 03ea3f832e * include/cygwin/signal.h: Add missing sigrelse prototype. 2005-11-10 09:12:22 +00:00
Christopher Faylor 0730fa0763 Change name from commune_recv to commune_process throughout. Change name from
commune_send to commune_request throughout.
* pinfo.h (PICOM_EXTRASTR): New flag.
(PICOM_FIFO): Define with new flag.
(_pinfo::hello_pid): Delete.
(_pinfo::tothem): Delete.
(_pinfo::fromthem): Delete.
(_pinfo::commune_process): Rename from commune_recv.  Add a siginfo_t argument
to declaration.
(_pinfo::commune_request): Rename from commune_send.  Change DWORD to
__uint32_t in declaration.
* pinfo.cc (_pinfo::commune_process): Rename from commune_recv.  Add siginfo_t
argument.  Use information from argument rather than reading from another pipe.
Synchronize with other process's commune event.
(_pinfo::commune_request): Rename from commune_send.  Change DWORD to __uint32
in argument.  Fill out information in new siginfo_t element and rely on
extended operation of sig_send rather than trying to deal with synchronization
issues here.  Use process handle and read pipe information filled out by
sig_send to gather information from the other process.
* sigproc.cc (sig_send): Take special action if "communing" to ensure
synchronization with the other process and to return information about the
other process to the caller.
(talktome): Accept a siginfo_t and handle arguments.  Read additional
information from the signal pipe when _si_commune._si_code has the
PICOM_EXTRASTR flag set.
(wait_sig): Pass the transmitted siginfo_t struct and the pipe handle to
talktome.  Close pipe read handle as soon as possible after we detect that
we're exiting.
2005-09-28 22:56:47 +00:00
Christopher Faylor 298cac75d5 fix erroneous checkin 2004-10-04 14:06:02 +00:00
Christopher Faylor 34421ac3e5 * include/cygwin/signal.h: Add siginterrupt definition. 2004-10-04 14:04:31 +00:00
Christopher Faylor ca713cfab3 * exceptions.cc (setup_handler): Signal event for any sigwaitinfo if it exists
to force signal to be handled.  Zero event here to prevent races.
* signal.cc (sigwaitinfo): Use local handle value for everything since signal
thread could zero event element at any time.  Detect when awaking due to thread
not in mask and set return value and errno accordingly.  Don't set signal
number to zero unless we've recognized the signal.
* sigproc.cc (sigq): Rename from sigqueue throughout.
* thread.cc (pthread::join): Handle signals received while waiting for thread
to terminate.
* cygwin.din: Export sighold, sigqueue.
* exceptions.cc (sighold): Define new function.
* signal.cc (handle_sigprocmask): Set correct errno for invalid signal.
Simplify debugging output.
(sigqueue): Define new function.
* include/cygwin/signal.h (sighold): Declare new function.
(sigqueue): Ditto.
* include/cygwin/version.h: Bump API minor version number.
* include/limits.h (TIMER_MAX): Define.
(_POSIX_TIMER_MAX): Ditto.
2004-02-26 05:10:49 +00:00
Christopher Faylor c571716c64 * Makefile.in (DLL_OFILES): Add strsig.o.
* cygtls.h (_local_storage::signamebuf) New element.
* sysconf.cc (sysconf): Implement _SC_RTSIG_MAX.
* tlsoffset.h: Regenerate.
* include/limits.h (_POSIX_RTSIG_MAX): New define.
(RTSIG_MAX): Ditto.
* include/cygwin/signal.h (SIGRTMIN): New define.
(SIGRTMAX): Ditto.
(NSIG): Bump.
* strsig.cc: New file.
2004-02-03 21:59:27 +00:00
Christopher Faylor f6936c48f3 * cygwin/include/signal.h: Add copyright notice.
* cygwin.din: Make clock SIGFE.  Add clock_gettime, sigwaitinfo, timer_create,
timer_delete, timer_settime.
* include/cygwin/version.h: Reflect above additions.
* fork.cc (fork_child): Call fixup_timers_after_fork.
* signal.cc (sigwait): Remove unused variable.
* timer.cc: New file.
(clock_gettime): Define new function.
(timer_tracker): Define new struct used by timer functions.
(timer_tracker::timer_tracker): New function.
(to_us): New function.
(timer_thread): New function.
(timer_tracker::settime): New function.
(timer_create): New function.
(timer_settime): New function.
(timer_delete): New function.
(fixup_timers_after_fork): New function.
* cygthread.cc: Bump thread count.
* signal.cc (sigwaitinfo): Define new function.
(sigwait): Redefine based on sigwaitinfo.
* include/cygwin/signal.h (sigwaitinfo): Declare.
(sigwait): Ditto.
* dtable.cc (dtable::vfork_parent_restore): Avoid double close of ctty when
ctty == ctty_on_hold.
* cygtls.h (_threadinfo::threadkill): New element.
(_threadinfo::set_threadkill): Declare new function.
(_threadinfo::reset_threadkill): Declare new function.
* dcrt0.cc (dcrt0_1): Call here so that it will be possible to attach to
running process with #(*& Windows Me/9x.
(initial_env): Try to initialize strace if uninitialized.
* gendef: Don't zero signal if threadkill is set since that will happen in the
called function.
* signal.cc (sigwait): Ensure cleanup in error conditions.
* sigproc.cc (sig_send): Clear packet mask storage.
(wait_subproc): Fill in child exit code in siginfo_t structure.
* thread.cc (pthread_kill): Set threadkill flag.
* tlsoffsets.h: Regenerate.  Throughout, use siginfo_t to fill out all signal
information for "kernel" signals.
* cygtls.h (_threadinfo::set_siginfo): Declare new function.
* cygtls.cc (_threadinfo::set_siginfo): Define new function.
* dcrt0.cc (do_exit): Accommodate siginfo_t considerations.
* exceptions.cc (handle_exceptions): Ditto.
(sig_handle_tty_stop): Ditto.
(ctrl_c_handler): Use killsys() to send signal.
(sigpacket::process): Rename from sig_handle.  Use siginfo_t field from
sigpacket for everything.
(tty_min::kill_pgrp): Accommodate siginfo_t considerations.
(fhandler_termios::bg_check): Ditto.
* fhandler_tty.cc (fhandler_tty_slave::ioctl): Use killsys() to send signal.
* signal.cc (kill_worker): Rewrite to use siginfo_t second argument.
(kill_pgrp): Ditto.
(kill0): Define new function pulled from kill().
(kill): Rewrite as frontend to kill0.
(killsys): Define new function.
* sigproc.cc (sigelem): Eliminate.
(sigpacket): Move to sigproc.h.  Subsume sigelem.
(pending_signals): Use sigpacket rather than sigelem for everything.
(sig_clear): Ditto.
(wait_sig): Ditto.
(sig_send): Rewrite to use siginfo_t argument.
(sig_send): New function wratpper to sig_send with siginfo_t argument.
(wait_subproc): Accommodate siginfo_t considerations.
* thread.cc (pthread_kill): Ditto.
* sigproc.h (sigpacket): Move here.
(sigpacket::process): Declare "new" function.
(sig_handle): Eliminate declaration.
(sig_send): Declare with new paramaters.
(killsys): Declare new function.
(kill_pgrp): Declare.
* winsup.h: Move some signal-specific stuff to sigproc.h.
* include/cygwin/signal.h: Tweak some siginfo_t stuff.
2004-01-19 05:46:54 +00:00
Christopher Faylor abd2fa9994 * include/cygwin/signal.h: New file.
(also check in tlsoffsets.h, missed by previous checkin)
2003-11-28 21:01:09 +00:00