From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <51B948AE.6060708@siemens.com> Date: Thu, 13 Jun 2013 06:21:02 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <51B8120C.9080906@siemens.com> <51B8562E.6020800@xenomai.org> In-Reply-To: <51B8562E.6020800@xenomai.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai] [PATCH] posix: Skip auto-shadowing if current thread is already shadowed List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gilles Chanteperdrix Cc: Xenomai On 2013-06-12 13:06, Gilles Chanteperdrix wrote: > On 06/12/2013 08:15 AM, Jan Kiszka wrote: > >> While the user can also avoid double shadowing by providing the >> XENO_NOSHADOW environment variable, there is still no reason to attempt >> auto-shadowing in their absence if the current thread is already a >> Xenomai thread. This helps, e.g., in complex dlopen scenarios where >> the POSIX lib is pulled in belatedly, potentially after some other lib >> already shadowed the dlopen caller. > > > Well, last time I checked, calling __wrap_pthread_setschedparam for an > already shadowed threads was a nop. I'm getting an EBUSY from xnshadow_map as called by __pthread_shadow. And that, of course, lets the lib init code bail out. > It usefaults the thread stack > though, maybe we can move the faulting of the tread stack to the > "promoted" case. Isn't it reasonable to assume that an existing Xenomai thread also properly went through stack faulting? Jan -- Siemens AG, Corporate Technology, CT RTC ITP SES-DE Corporate Competence Center Embedded Linux