From: Andreas Jaeger <aj@suse.de>
To: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
Cc: linux-mips@fnet.fr, linux-mips@oss.sgi.com,
Ralf Baechle <ralf@uni-koblenz.de>, Jun Sun <jsun@mvista.com>
Subject: Re: [patch] RFC: A sys__test_and_set() implementation, 2nd iteration
Date: 01 Jun 2001 15:48:36 +0200 [thread overview]
Message-ID: <hoelt4xqdn.fsf@gee.suse.de> (raw)
In-Reply-To: <Pine.GSO.3.96.1010601135550.26484B-100000@delta.ds2.pg.gda.pl> ("Maciej W. Rozycki"'s message of "Fri, 1 Jun 2001 14:18:04 +0200 (MET DST)")
"Maciej W. Rozycki" <macro@ds2.pg.gda.pl> writes:
> On 1 Jun 2001, Andreas Jaeger wrote:
>
>> #include "sys/tas.h"
>> +
>> +#ifdef __NR__test_and_set
>> +# ifdef __ASSUME__TEST_AND_SET
>> +# define __have_no__test_and_set 0
>>
>> Don't add this, compare how we do it in similar cases.
>
> Hmm, I looked at sysdeps/unix/sysv/linux/getcwd.c. It does it in a
> similar way. What's wrong with this approach? I'm just asking -- it
> looks I do not always guess glibc rules right and not everything is
> documented.
We normally do not define anything to 0 - unless there's no other
way. And looking briefly over your code there should be other
solutions. Sorry, I'm limited in time currently, otherwise I would
rewrite it myself.
Look at i386/lockf64.c for a cleaner example.
> Actually I tried to avoid macros if at all possible but gcc refuses to
> eliminate code even if that's something like:
>
> static const int var = 1;
> <...>
> if (var)
> <...>
>
> It still generates the code to check the value of var, sigh...
>
> Also I feel a bit uneasy about placing the "#ifdef
> __ASSUME__TEST_AND_SET" condition outside -- __NR__test_and_set might be
> undefined due to outdated kernel headers even if someone specified the
> --enable-kernel option. Is it considered justified within glibc to bail
> out at the compilation time in this case?
We check that for the kernel headers in configure.
>> extern int _test_and_set (int *p, int v) __THROW;
>> +extern int ___test_and_set (int *p, int v) __THROW;
>>
>> Why do you export this here?
>
> It's a syscall wrapper. We want to export syscall wrappers, don't
> we?
No, not everything - we already export _test_and_set and that should
be enough.
> And if we export a symbol, we should also declare it -- programs declaring
> library symbols themselves are broken and doomed to fail sooner or later
> -- have you seen what happens on glibc systems to old programs which
> declare <string.h> functions due to the lack of appropriate declarations
> in system headers at one time?
>
> If we don't want to export the wrapper, then fine -- I'll remove both the
> symbol and the declaration.
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj
next prev parent reply other threads:[~2001-06-01 13:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-30 17:58 [patch] RFC: A sys__test_and_set() implementation, 2nd iteration Maciej W. Rozycki
2001-05-31 6:52 ` Andreas Jaeger
2001-05-31 19:13 ` Jun Sun
2001-06-01 11:55 ` Maciej W. Rozycki
2001-06-01 11:32 ` Maciej W. Rozycki
2001-06-01 11:44 ` Andreas Jaeger
2001-06-01 12:18 ` Maciej W. Rozycki
2001-06-01 13:48 ` Andreas Jaeger [this message]
2001-06-01 14:21 ` Maciej W. Rozycki
2001-06-05 12:58 ` Maciej W. Rozycki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=hoelt4xqdn.fsf@gee.suse.de \
--to=aj@suse.de \
--cc=jsun@mvista.com \
--cc=linux-mips@fnet.fr \
--cc=linux-mips@oss.sgi.com \
--cc=macro@ds2.pg.gda.pl \
--cc=ralf@uni-koblenz.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox