From owner-freebsd-sparc64@FreeBSD.ORG Tue Jan 13 09:41:40 2004 Return-Path: Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A431216A4CF for ; Tue, 13 Jan 2004 09:41:40 -0800 (PST) Received: from mail.gmx.net (pop.gmx.net [213.165.64.20]) by mx1.FreeBSD.org (Postfix) with SMTP id 92D9D43D4C for ; Tue, 13 Jan 2004 09:40:58 -0800 (PST) (envelope-from tmoestl@gmx.net) Received: (qmail 5805 invoked by uid 65534); 13 Jan 2004 17:40:57 -0000 Received: from p508E56EE.dip.t-dialin.net (EHLO timesink.dyndns.org) (80.142.86.238) by mail.gmx.net (mp014) with SMTP; 13 Jan 2004 18:40:57 +0100 X-Authenticated: #5374206 Received: by rota (Postfix, from userid 1001) id A09BECB; Tue, 13 Jan 2004 18:41:33 +0100 (CET) Date: Tue, 13 Jan 2004 18:41:33 +0100 From: Thomas Moestl To: "Jacques A. Vidrine" , freebsd-sparc64@FreeBSD.org Message-ID: <20040113174133.GA703@timesink.dyndns.org> References: <20040113144437.GB48140@madman.celabo.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040113144437.GB48140@madman.celabo.org> User-Agent: Mutt/1.5.5.1i Subject: Re: src/lib/libc/sparc64 X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2004 17:41:40 -0000 On Tue, 2004/01/13 at 08:44:37 -0600, Jacques A. Vidrine wrote: > While cleaning up libc warnings, I noticed the following while compiling > on sparc64: > > .../libc/sparc64/sys/__sparc_utrap.c:114: warning: implicit declaration of function `__sys_write' > .../libc/sparc64/sys/__sparc_utrap.c:124: warning: implicit declaration of function `__sys_kill' > .../libc/sparc64/sys/__sparc_utrap.c:124: warning: implicit declaration of function `__sys_getpid' > > I'm not sure of the best way to resolve these. It's not clear to me > where these are defined, nor whether or not they could be replaced by > calls to the usual stubs (_write, ...)--- I assume not. We can enter the user trap handlers from anywhere, so we want to use the syscalls directly. The single and double underscored versions are weak references, and could be overridden from another library. libc_r does this with _write() and __write(), for example, and using those versions could lead to a deadlock when the trap happened while a lock was already held by this thread. __utrap_write() is only used to write fatal (or mostly fatal) error messages, so failing to lock properly is preferable to not reporting an error at all. Likewise, it is important that can reliably send signals to the process to indicate errors, and there are no reasons why wrapper versions would need to be used. > So before I added function declarations for them to shut up the > compiler, I thought I'd ask. > > (With these `fixed', I believe libc will be WARNS=2 clean on all > platforms.) Thanks for cleaning this up! - Thomas -- Thomas Moestl http://www.tu-bs.de/~y0015675/ http://people.FreeBSD.org/~tmm/ PGP fingerprint: 1C97 A604 2BD0 E492 51D0 9C0F 1FE6 4F1D 419C 776C