Re: bug in write(2) system call.

Pavel Machek (pavel@bug.ucw.cz)
Sun, 18 Oct 1998 16:28:20 +0200


Hi!

> > As a continuation of the thread "bug in read(2) syscall" on
> > linux-smp I would like to confirm that the same bug exists in
> > write(2) as well, i.e. write(1, 0, 10) returns 10 instead of -1
> > with errno=EFAULT.
> >
> > This is only when the descriptor is a tty - on files and /dev/null
> > it's okay...
>
> Its also not actually a bug. What happens when you pass invalid pointers is
> undefined by posix. Obviously the Linux idea of undefined doesnt include
> crashes but returning an OK is fine

Alan, don't do that. Reports whould be reported. Even if it is not
violation of POSIX, you should report error. It is bad programming to
ignore errors.

Pavel

-- 
I'm really pavel@atrey.karlin.mff.cuni.cz. 	   Pavel
Look at http://atrey.karlin.mff.cuni.cz/~pavel/ ;-).

- 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/