All of lore.kernel.org
 help / color / mirror / Atom feed
* Problems with close() system call
@ 2004-10-25 11:40 Arne Henrichsen
  2004-10-26 11:30 ` Jan Engelhardt
  0 siblings, 1 reply; 5+ messages in thread
From: Arne Henrichsen @ 2004-10-25 11:40 UTC (permalink / raw)
  To: linux-kernel

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-10-27  4:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-25 11:40 Problems with close() system call Arne Henrichsen
2004-10-26 11:30 ` Jan Engelhardt
2004-10-26 12:43   ` Arne Henrichsen
2004-10-26 15:43     ` Jan Engelhardt
2004-10-27  4:48       ` Raj

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.