Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jan 2004 18:41:33 +0100
From:      Thomas Moestl <t.moestl@tu-bs.de>
To:        "Jacques A. Vidrine" <nectar@FreeBSD.org>, freebsd-sparc64@FreeBSD.org
Subject:   Re: src/lib/libc/sparc64
Message-ID:  <20040113174133.GA703@timesink.dyndns.org>
In-Reply-To: <20040113144437.GB48140@madman.celabo.org>
References:  <20040113144437.GB48140@madman.celabo.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <t.moestl@tu-bs.de>	http://www.tu-bs.de/~y0015675/
              <tmm@FreeBSD.org>		http://people.FreeBSD.org/~tmm/
PGP fingerprint: 1C97 A604 2BD0 E492 51D0  9C0F 1FE6 4F1D 419C 776C



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040113174133.GA703>