[Top] [All Lists]

Re: errno assignment in _syscall macros and glibc

To: Andreas Jaeger <>
Subject: Re: errno assignment in _syscall macros and glibc
From: Ralf Baechle <>
Date: Sun, 25 Jun 2000 20:43:34 +0200
Cc: Mike Klar <>,,,
In-reply-to: <>; from on Sun, Jun 25, 2000 at 11:26:33AM +0200
References: <> <>
On Sun, Jun 25, 2000 at 11:26:33AM +0200, Andreas Jaeger wrote:

> The question remains what we should do with glibc 2.2.  Currently
> <sys/syscalls.h> includes <asm/unistd.h> and this makes _syscall0 and
> friends available to userspace. 
> I couldn't find any reference to <sys/syscalls.h> in the ABI and
> consider dropping the include of <asm/unistd.h> since it's not needed
> at all.
> Any objections or better suggestions?

I will take his report as a real bug but for another reason.  The kernel
has a global variable errno which at least on i386 get the returned
error value.  Fixing this one will magically fix userland.

Still everybody should be aware that using your own syscall wrappers
can be _very_ dangerous.  I saw an attempt to use pread / pwrite which
was ok on Intel but might have corrupted data on MIPS due to different
calling conventions.  You have been warned.

Andreas - I think the syscall interface should finally officially be
declared a private interface between libc and the kernel, that is nobody
except these two should use it.  Many of the other attempts to use it
have been quite problematic - portabilitywise and worse.


<Prev in Thread] Current Thread [Next in Thread>