From: Andreas Schwab <schwab@suse.de>
To: Chris Friesen <cfriesen@nortelnetworks.com>
Cc: Benjamin Collar <benjamin.collar@siemens.com>,
linux-kernel@vger.kernel.org
Subject: Re: PROBLEM: using _syscall4 to call sys_futex with -fPIC won't compile
Date: Mon, 05 Jul 2004 19:57:03 +0200 [thread overview]
Message-ID: <jewu1igwwg.fsf@sykes.suse.de> (raw)
In-Reply-To: <40E97F14.2060706@nortelnetworks.com> (Chris Friesen's message of "Mon, 05 Jul 2004 12:17:24 -0400")
Chris Friesen <cfriesen@nortelnetworks.com> writes:
> The "_syscallx" macros are in the userspace versions of the kernel
> headers, and as such should be fair game.
They are known not to work with -fpic (on x86 anyway, other architectures
are less broken). Anyway, just because there is no #ifdef __KERNEL__
doesn't mean a kernel header is meant for user space use.
> Also, you need to get a list of syscall numbers somehow, and those
> numbers are generally defined in the same file that contains the
> "_syscallx" macros.
They are duplicated in <sys/syscall.h> (which is auto-generated from the
list in <asm/unistd.h>).
> syscall() doesn't work for all system calls. The man page explicitly
> warns that it doesn't work for pipe(2).
Only if pipe(2) uses the "two retvals" calling convention (Alpha and ia64,
but not x86 or m68k). But then, pipe is already available without
syscall(), and new syscalls normally use simple enough calling conventions
that are suitable for syscall().
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
prev parent reply other threads:[~2004-07-05 17:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-05 10:39 Benjamin Collar
2004-07-05 15:58 ` Andreas Schwab
2004-07-05 16:17 ` Chris Friesen
2004-07-05 17:57 ` Andreas Schwab [this message]
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=jewu1igwwg.fsf@sykes.suse.de \
--to=schwab@suse.de \
--cc=benjamin.collar@siemens.com \
--cc=cfriesen@nortelnetworks.com \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®