public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][RFC] global errno considered harmful
@ 2001-12-30 16:06 Lennert Buytenhek
  2001-12-30 19:56 ` Jeff Dike
  2001-12-31  0:01 ` ertzog
  0 siblings, 2 replies; 11+ messages in thread
From: Lennert Buytenhek @ 2001-12-30 16:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: jdike


Hi,

Is there any particular reason we need a global errno in the kernel
at all? (which, by the way, doesn't seem to be subject to any kind of
locking)  It makes life for User Mode Linux somewhat more complicated than
it could be, and it generally just seems a bad idea.  Half a dozen places
in the kernel call syscalls from kernel space (the asm/unistd.h
__KERNEL_SYSCALLS__ stubs), but it sounds way better to change that limited
number to check the syscall return code instead of errno.

It appears that only one syscall stub caller checks syscall return value
anyway (exec_usermodehelper in kernel/kmod.c), so removing errno is quite
painless.  Referenced patch deletes all mention of a global errno from the
kernel, and fixes up callers where necessary.  I had to change definition
of _syscallX in various asm/unistd.h's not to use errno which might break
some userland, but userland shouldn't be touching these anyway.

Only tested on i386.  Feedback appreciated, particularly experiences on
non-i386.

	http://www.math.leidenuniv.nl/~buytenh/errno_ectomy-1.diff   (33kb)


cheers,
Lennert

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2001-12-31 22:07 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-30 16:06 [PATCH][RFC] global errno considered harmful Lennert Buytenhek
2001-12-30 19:56 ` Jeff Dike
2001-12-30 21:00   ` Ralf Baechle
2001-12-30 22:10     ` Brian Gerst
2001-12-31  1:59       ` Ralf Baechle
2001-12-31 16:48         ` Andreas Schwab
2001-12-31 21:42           ` Ralf Baechle
2001-12-31  1:52     ` Lennert Buytenhek
2001-12-31  2:01       ` Ralf Baechle
2001-12-31 20:56         ` Erik Andersen
2001-12-31  0:01 ` ertzog

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox