lkml.org 
[lkml]   [2004]   [Jul]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: PROBLEM: using _syscall4 to call sys_futex with -fPIC won't compile
Andreas Schwab wrote:
> Benjamin Collar <benjamin.collar@siemens.com> writes:
>
> > Greetings
> >
> > [1.]
> > If I use _syscall4 in order to call sys_futex and compile with -fPIC, I
> > receive this compiler error:
> > "can't find a register in class `BREG' while reloading `asm'"
>
> Don't do that then.
>
> > [2.]
> > I'm using futexes in a project and I have to build a shared library;
> > thus I need to use -fPIC when compiling. When doing so, I get the error
> > mentioned in [1.].
>
> Don't use kernel headers in user space. Use syscall(3) instead.

The "_syscallx" macros are in the userspace versions of the kernel headers, and
as such should be fair game. 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.

syscall() doesn't work for all system calls. The man page explicitly warns that
it doesn't work for pipe(2). Interestingly, the glibc manual doesn't have that
warning. Wonder which is correct...

Chris
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:04    [W:0.031 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site