Re: Ok, making ready for pre-2.4 and code-freeze..

Rogier Wolff (R.E.Wolff@BitWizard.nl)
Tue, 21 Dec 1999 14:59:54 +0100 (MET)


Linus Torvalds wrote:
> The kernel way of returning errors has obviously shown itself to be the
> much nicer one - imagine how much easier threading UNIX would have been if
> we didn't have that one "errno" global - it's one of the few fundamental
> globals used in standard libraries. But I'm not going to re-make all
> existing programs and standards ;)

The return code for unix system calls should be defined as "negative"
for error, and not "-1". Programs I write already work fine with that
definition. The thing is, if we started documenting it like that 10
years ago, we might have been able to phase in the "new way" today (*).
(Just like select, which has been documented "correctly" the last 20
years, which Linux managed to "fix"...)

On the other hand, if we really want, we could now schedule the
switchover say for january 2005. On the other hand, the kernel isn't
involved in any of this.

Roger.

(*) e.g. by introducing an "old-syscalls" library that does the

rv = the_syscall (...);
if (rv < 0) {
errno = -rv;
return -1;
}
return rv;

while the new library simply returns the return value of the
syscall. Well-written programs will work just fine with both methods,
older not-reviewed programs can be linked against the old-syscalls
library.

-- 
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
 "I didn't say it was your fault. I said I was going to blame it on you."

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