Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S269964AbUJNEUP (ORCPT ); Thu, 14 Oct 2004 00:20:15 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S269966AbUJNEUP (ORCPT ); Thu, 14 Oct 2004 00:20:15 -0400 Received: from rproxy.gmail.com ([64.233.170.206]:22376 "EHLO mproxy.gmail.com") by vger.kernel.org with ESMTP id S269964AbUJNETR (ORCPT ); Thu, 14 Oct 2004 00:19:17 -0400 Message-ID: Date: Thu, 14 Oct 2004 09:49:16 +0530 From: Raj Reply-To: Raj To: eshwar Subject: Re: Write USB Device Driver entry not called Cc: Alan Cox , Linux Kernel Mailing List In-Reply-To: <011c01c4b721$b7fd96b0$41c8a8c0@Eshwar> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <005101c4b763$5e3cba60$41c8a8c0@Eshwar> <001401c4b796$abcddfb0$41c8a8c0@Eshwar> <1097663878.4440.0.camel@localhost.localdomain> <004f01c4b8a1$9ee2b6c0$41c8a8c0@Eshwar> <011c01c4b721$b7fd96b0$41c8a8c0@Eshwar> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 819 Lines: 24 On Thu, 21 Oct 2004 09:24:52 +0530, eshwar 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/