Thread (2 messages) flat view 2 messages, 2 authors, 2000-04-05

Re: UART driver problem

From: Graham Stoney <hidden>
Date: 2000-04-05 05:34:43

Hi guys,

Pavel Roskin writes:
drivers/char/serial.c is not broken!
[ explaination of why the code looks correct deleted ]

Sorry to dredge up the past here, but I'm still confused about one thing:
why does write(2) to a tty return successfully when passed an invalid address?

Here's an example:

    #include <unistd.h>

    int main()
    {
	printf("bad write returned %d\n", write(1, 0, 1));
	perror("write");
	return 0;
    }

When run on Linux/PPC or Linux/i386, you get:
    bad write returned 1
    write: Success

I would have expected the SunOS result of:
    bad write returned -1
    write: Bad address

There was a discussion about this on the linux-kernel mailing list, under
the subject "bug in write(2) system call", but I can't see where to fix it.

Any clues?

Thanks,
Graham

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help