All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Jaeger <aj@suse.de>
To: Ralf Baechle <ralf@uni-koblenz.de>
Cc: Mike Klar <mfklar@ponymail.com>,
	linux-mips@oss.sgi.com, linux-mips@fnet.fr,
	linux-mips@vger.rutgers.edu
Subject: Re: errno assignment in _syscall macros and glibc
Date: 25 Jun 2000 20:53:30 +0200	[thread overview]
Message-ID: <u8zoo9mw2d.fsf@gromit.rhein-neckar.de> (raw)
In-Reply-To: Ralf Baechle's message of "Sun, 25 Jun 2000 20:43:34 +0200"

>>>>> Ralf Baechle writes:

Ralf> 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?

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

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

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

I'm considering to commit the appended patch.  I've compiled glibc
with it and didn't notice any problems.  If nobody objects, I'll apply
it tomorrow.

Ralf, are there any other places that needs to be changed?  What do
you think of adding 
#ifdef KERNEL
around _syscallX in <asm/unistd.h> ?

Andreas

2000-06-25  Andreas Jaeger  <aj@suse.de>

	* sysdeps/unix/sysv/linux/mips/sys/syscall.h: Don't include
	<asm/unistd.h> - we don't need any of these at all in glibc or
	user programs.

============================================================
Index: sysdeps/unix/sysv/linux/mips/sys/syscall.h
--- sysdeps/unix/sysv/linux/mips/sys/syscall.h	2000/06/23 07:55:36	1.4
+++ sysdeps/unix/sysv/linux/mips/sys/syscall.h	2000/06/25 18:51:00
@@ -19,11 +19,6 @@
 #ifndef	_SYSCALL_H
 #define	_SYSCALL_H	1
 
-/* This file should list the numbers of the system the system knows.
-   But instead of duplicating this we use the information available
-   from the kernel sources.  */
-#include <asm/unistd.h>
-
 /*
  * SVR4 syscalls are in the range from 1 to 999
  */


-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de

  reply	other threads:[~2000-06-25 18:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <NDBBIDGAOKMNJNDAHDDMCEODCKAA.mfklar@ponymail.com>
     [not found] ` <u8d7l6p0vq.fsf@gromit.rhein-neckar.de>
2000-06-25 18:43   ` errno assignment in _syscall macros and glibc Ralf Baechle
2000-06-25 18:53     ` Andreas Jaeger [this message]
2000-06-25 21:59       ` Ralf Baechle
2000-06-25 19:26     ` Alan Cox
2000-06-25 19:26       ` Alan Cox
2000-06-25 21:21       ` Ralf Baechle
2000-06-25 21:25         ` Alan Cox
2000-06-25 21:25           ` Alan Cox
2000-06-25 21:48           ` Ralf Baechle
2000-06-30 14:03           ` Jay Carlson
2000-06-30 14:03             ` Jay Carlson
2000-07-03 13:45             ` Alan Cox
2000-07-03 13:45               ` Alan Cox

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=u8zoo9mw2d.fsf@gromit.rhein-neckar.de \
    --to=aj@suse.de \
    --cc=linux-mips@fnet.fr \
    --cc=linux-mips@oss.sgi.com \
    --cc=linux-mips@vger.rutgers.edu \
    --cc=mfklar@ponymail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.