diff options
author | Christopher Faylor <me@cgf.cx> | 2001-04-27 18:50:59 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-04-27 18:50:59 +0000 |
commit | cba63823f808a747ad762d3a8d5a4d8ef6890e54 (patch) | |
tree | 9f7136cef4a65dba47cb4e550daf300e8fbeda50 | |
parent | 9572ecf9798a493965d173398d9db923c154a4c3 (diff) | |
download | newlib-cba63823f808a747ad762d3a8d5a4d8ef6890e54.zip newlib-cba63823f808a747ad762d3a8d5a4d8ef6890e54.tar.gz newlib-cba63823f808a747ad762d3a8d5a4d8ef6890e54.tar.bz2 |
* thread.cc (thread_init_wrapper): Use _REENT_INIT to initialize the reent
structure of newlib.
* sigproc.h (sig_send): Add exception parameter to sig_send.
* sigproc.cc (sig_send): Ditto. Use it when setting frame info.
* exceptions.cc (handle_exceptions): Use exception flag when calling sig_send.
-rw-r--r-- | winsup/cygwin/ChangeLog | 12 | ||||
-rw-r--r-- | winsup/cygwin/exceptions.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/sigproc.cc | 4 | ||||
-rw-r--r-- | winsup/cygwin/sigproc.h | 3 | ||||
-rw-r--r-- | winsup/cygwin/thread.cc | 8 |
5 files changed, 18 insertions, 11 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 243d819..81ae2a8 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,15 @@ +2001-04-27 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * thread.cc (thread_init_wrapper): Use _REENT_INIT to initialize the + reent structure of newlib. + +Fri Apr 27 14:02:24 2001 Christopher Faylor <cgf@cygnus.com> + + * sigproc.h (sig_send): Add exception parameter to sig_send. + * sigproc.cc (sig_send): Ditto. Use it when setting frame info. + * exceptions.cc (handle_exceptions): Use exception flag when calling + sig_send. + 2001-04-27 Egor Duda <deo@logos-m.ru> * tty.cc (tty::make_pipes): Set to_slave pipe mode to nonblocking. diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 03e00ea..8cd60a8 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -532,7 +532,7 @@ handle_exceptions (EXCEPTION_RECORD *e, void *, CONTEXT *in, void *) signal_exit (0x80 | sig); // Flag signal + core dump } - sig_send (NULL, sig, (DWORD) ebp); // Signal myself + sig_send (NULL, sig, (DWORD) ebp, 1); // Signal myself return 0; } #endif /* __i386__ */ diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index b1140aa..c7b0a49 100644 --- a/winsup/cygwin/sigproc.cc +++ b/winsup/cygwin/sigproc.cc @@ -631,7 +631,7 @@ sigproc_terminate (void) * completed before returning. */ int __stdcall -sig_send (_pinfo *p, int sig, DWORD ebp) +sig_send (_pinfo *p, int sig, DWORD ebp, bool exception) { int rc = 1; DWORD tid = GetCurrentThreadId (); @@ -680,7 +680,7 @@ sig_send (_pinfo *p, int sig, DWORD ebp) { thiscatch = sigcatch_main; thiscomplete = sigcomplete_main; - thisframe.set (mainthread, ebp, 1); + thisframe.set (mainthread, ebp, exception); } } else if (!(thiscatch = getsem (p, "sigcatch", 0, 0))) diff --git a/winsup/cygwin/sigproc.h b/winsup/cygwin/sigproc.h index c239f5f..a346094 100644 --- a/winsup/cygwin/sigproc.h +++ b/winsup/cygwin/sigproc.h @@ -110,7 +110,8 @@ void __stdcall subproc_init (); void __stdcall sigproc_terminate (); BOOL __stdcall proc_exists (_pinfo *) __attribute__ ((regparm(1))); BOOL __stdcall pid_exists (pid_t) __attribute__ ((regparm(1))); -int __stdcall sig_send (_pinfo *, int, DWORD ebp = (DWORD) __builtin_frame_address (0)) __attribute__ ((regparm(3))); +int __stdcall sig_send (_pinfo *, int, DWORD ebp = (DWORD) __builtin_frame_address (0), + bool exception = 0) __attribute__ ((regparm(3))); void __stdcall signal_fixup_after_fork (); void __stdcall signal_fixup_after_exec (bool); diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc index 861dac3..deedcae 100644 --- a/winsup/cygwin/thread.cc +++ b/winsup/cygwin/thread.cc @@ -737,7 +737,7 @@ thread_init_wrapper (void *_arg) pthread *thread = (pthread *) _arg; struct __reent_t local_reent; struct _winsup_t local_winsup; - struct _reent local_clib; + struct _reent local_clib = _REENT_INIT(local_clib); struct sigaction _sigs[NSIG]; sigset_t _sig_mask; /* one set for everything to ignore. */ @@ -748,14 +748,8 @@ thread_init_wrapper (void *_arg) thread->sigmask = &_sig_mask; thread->sigtodo = _sigtodo; - memset (&local_clib, 0, sizeof (struct _reent)); memset (&local_winsup, 0, sizeof (struct _winsup_t)); - local_clib._errno = 0; - local_clib._stdin = &local_clib.__sf[0]; - local_clib._stdout = &local_clib.__sf[1]; - local_clib._stderr = &local_clib.__sf[2]; - local_reent._clib = &local_clib; local_reent._winsup = &local_winsup; |