All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arne Henrichsen <ahenric@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: Problems with close() system call
Date: Mon, 25 Oct 2004 13:40:47 +0200	[thread overview]
Message-ID: <605a56ed04102504401e0f469f@mail.gmail.com> (raw)

Hi,

I have a question regarding the close() system call. I have written my
own character driver for a serial type card with 8 ports. Each port is
seen as a device by Linux. Everything works great, I can open, close,
write, read etc from/to the individual devices. But I also see some
strange things. When I for instance in my user application open and
configure each device (via ioctl) in a loop, somehow a close system
call has been initiated (not called by my user app). I can see this as
my drivers flush function get called. Who or why is this function
called without my user app even calling close()? Is it related to the
module count of each device? I print out the counter
(filp->f_count.counter), and I do not know how it gets
incremented/decremented. The release call is also supposed to get
called after the user is finished, but is never called which I guess
has something to do with the user count not being zero.

I will see in my driver:

open dev 0
ioctl dev 0
open dev 1
flush dev 0
ioctl dev 1
open dev 2
flush dev 1
etc

Could anybody shed some light on this issue please?

Thanks
Arne

             reply	other threads:[~2004-10-25 11:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-25 11:40 Arne Henrichsen [this message]
2004-10-26 11:30 ` Problems with close() system call Jan Engelhardt
2004-10-26 12:43   ` Arne Henrichsen
2004-10-26 15:43     ` Jan Engelhardt
2004-10-27  4:48       ` Raj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=605a56ed04102504401e0f469f@mail.gmail.com \
    --to=ahenric@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.