Re: Problems with close() system call
From: Raj (inguva_at_gmail.com)
Date: 10/27/04
- Previous message: Shawn Starr: "Please remove this from LKML - bouncing from user"
- In reply to: Jan Engelhardt: "Re: Problems with close() system call"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 27 Oct 2004 10:18:10 +0530 To: Jan Engelhardt <jengelh@linux01.gwdg.de>
On Tue, 26 Oct 2004 17:43:36 +0200 (MEST), Jan Engelhardt
<jengelh@linux01.gwdg.de> wrote:
> >> Best is to put a printk("i'm in ioctl()") in the ioctl() function and a
> >> printk("i'm in close()") in the close() one, to be really sure whether the
> >> close() function of your module is called.
> >
> >Yes, that is exactly what I am doing. I basically implement the
> >flush() call (for close) as the release() call was never called on
> >close. So my release call does nothing. What I see is that the flush
>
> Uh, then something's wrong. Your device fops should look like this:
> {
> .release = my_close, // which is called upon close(2)
> }
>
> Anything else is of course, never working.
iirc, once i faced this problem. I compiled a sample device driver
against kernel version
'X'. and tried to insmod the binary into kernel version 'Y' which had
it's fop's struct
modified. The structure offsets took a beating and all hell broke
loose. Calling open()
called something else etc.... Ever since, i started using the above notation to
initialize struct members. Hard learned lesson ;-)
-- ###### 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/
- Previous message: Shawn Starr: "Please remove this from LKML - bouncing from user"
- In reply to: Jan Engelhardt: "Re: Problems with close() system call"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|