From owner-freebsd-hackers Thu Dec 9 2: 1: 2 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from overcee.netplex.com.au (overcee.netplex.com.au [202.12.86.7]) by hub.freebsd.org (Postfix) with ESMTP id 6DD6E1525C for ; Thu, 9 Dec 1999 02:00:52 -0800 (PST) (envelope-from peter@netplex.com.au) Received: from netplex.com.au (localhost [127.0.0.1]) by overcee.netplex.com.au (Postfix) with ESMTP id C77CC1CA0; Thu, 9 Dec 1999 18:00:46 +0800 (WST) (envelope-from peter@netplex.com.au) X-Mailer: exmh version 2.1.1 10/15/1999 To: Jason Evans Cc: freebsd-hackers@freebsd.org Subject: Re: Possible libc changes to support LinuxThreads In-Reply-To: Message from Jason Evans of "Thu, 09 Dec 1999 00:35:17 PST." <19991209003517.E73529@sturm.canonware.com> Date: Thu, 09 Dec 1999 18:00:46 +0800 From: Peter Wemm Message-Id: <19991209100046.C77CC1CA0@overcee.netplex.com.au> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Jason Evans wrote: > I've got a port of the most recent LinuxThreads (glibc-linuxthreads-2.1.2) > running, but ran into a couple of minor problems integrating with our libc. > LinuxThreads redefines a number of functions in order to make them either > support thread cancellation or work correctly. > > The following functions need an alternative name, just as, for example, > write() is actually _write(): > > lseek() > pause() > system() > tcdrain() > wait() > waitpid() > recv() > send() > > This would allow implementing cancellation points for these functions. All > in all, I won't lose much sleep over this, but if it's easy to do and > doesn't violate some rule of symbol naming, it would be nice. You know about weak symbol redirection, right? It basically allows runtime resolution of symbols instead of link time. So, you could have a weak pointer from lseek to _lseek and provide a _lseek function in libc. When programs link against "lseek" (including within libc itself), they hold a pointer to the non-redirected name. If you *also* provide a "lseek" in libpthreads from linuxthreads, then at runtime everything (including libc) will use the lseek() in the thread library and not _lseek(). Look for __weak_reference() etc, there are some examples in libc/net/* (but those are for different problems). Cheers, -Peter -- Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message