[patch 1/1] fix syscallN() macro errno value checking for i386

From: blaisorblade
Date: Fri Jan 28 2005 - 20:04:03 EST



From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@xxxxxxxx>
Cc: David Howells <dhowells@xxxxxxxxxx>

The errno values which are visible for userspace are actually in the range
-1 - -129, not until -128 (): this value was added:

#define EKEYREJECTED 129 /* Key was rejected by service */

And this would break ucLibc (for what I heard).

This is just a quick-fix, because putting a macro inside errno.h instead of
having it copied in two places would be probably nicer.

However, I've heard by D. Howells it wasn't accepted, so this is the solution for now.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@xxxxxxxx>
---

linux-2.6.11-paolo/include/asm-i386/unistd.h | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff -puN include/asm-i386/unistd.h~fix-syscall-macro include/asm-i386/unistd.h
--- linux-2.6.11/include/asm-i386/unistd.h~fix-syscall-macro 2005-01-29 00:42:48.000000000 +0100
+++ linux-2.6.11-paolo/include/asm-i386/unistd.h 2005-01-29 00:44:51.000000000 +0100
@@ -298,12 +298,12 @@
#define NR_syscalls 289

/*
- * user-visible error numbers are in the range -1 - -128: see
- * <asm-i386/errno.h>
+ * user-visible error numbers are in the range -1 - -129: see
+ * <asm-i386/errno.h> (currently it includes <asm-generic/errno.h>)
*/
#define __syscall_return(type, res) \
do { \
- if ((unsigned long)(res) >= (unsigned long)(-(128 + 1))) { \
+ if ((unsigned long)(res) >= (unsigned long)(-(129 + 1))) { \
errno = -(res); \
res = -1; \
} \
_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/