From owner-freebsd-hackers Thu Jun 7 10:18: 4 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from post.webmailer.de (natpost.webmailer.de [192.67.198.65]) by hub.freebsd.org (Postfix) with ESMTP id E5A4B37B406 for ; Thu, 7 Jun 2001 10:17:58 -0700 (PDT) (envelope-from Stefan.Hoffmeister@Econos.de) Received: from stefan-bt (pD95024D6.dip.t-dialin.net [217.80.36.214]) by post.webmailer.de (8.9.3/8.8.7) with SMTP id TAA24386; Thu, 7 Jun 2001 19:17:55 +0200 (MET DST) From: Stefan Hoffmeister To: Daniel Eischen Cc: Stefan Hoffmeister , freebsd-hackers@FreeBSD.ORG Subject: Re: libc_r, signal handler ucontext modification Date: Thu, 07 Jun 2001 19:16:57 +0200 Organization: Econos Message-ID: <4bdvhtgru1j77uvphko0dsg8ohpj8beloh@4ax.com> References: In-Reply-To: X-Mailer: Forte Agent 1.8/32.548 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG : On Thu, 7 Jun 2001 12:07:50 -0400 (EDT), Daniel Eischen wrote: >On Thu, 7 Jun 2001, Stefan Hoffmeister wrote: >> [copy context back into thread] >You can't do that. There is no requirement that the interrupted thread >is the one that handles the signal. If you copy the context back to >the current threads context storage, then you'll possibly end up with >2 threads running (or trying to run) on the same stack! Ouch :-) >You could also easily modify the context and do a >sigreturn(ucp) on it to achieve the same effect (being careful to make >sure you're not trying to jump to another threads context). This sounds very good, indeed. I do not want to make a context switch; essentially all I care about is that * the changed value of EIP is taken * ESP (from context) is retained * Changed values of EAX, EDX are taken AFA sigreturn is concerned: libc_r.so (!) does not export it; it only exports _thread_sys_sigreturn. Is there some kind of "__strong_reference" missing? In a slightly daring move, I am calling _thread_sys_sigreturn and, in my trivial test scenario, this seems to work - now I wonder whether it is supposed to work? IOW, is _thread_sys_sigreturn an alias for sigreturn in libc_r.so? Thanks very much, Stefan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message