Re: Write USB Device Driver entry not called

From: Raj
Date: Wed Oct 13 2004 - 23:24:49 EST


On Thu, 21 Oct 2004 09:24:52 +0530, eshwar <eshwar@xxxxxxxxxxx> wrote:
> if I modify the code like this
>
> char abc;
> if(read(fd,&abc,1) < 0)
> perror("read to bar failed: ");
> close(fd);
>
> Which will be sucess... This intern states that my file descriptor is right
> .... but write returns EBADF... both are contradicting statements....

It's this simple. File was opened for Read-Only. So for vfs_read it is
a 'good' file
descriptor. And for vfs_write it is a 'BAD' file descriptor.

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