On Wed, 07 Jun 2006 03:15:43 +0530, vamsi krishna said: > Hello, > > I found that the following code is closing all the open files by the > program, do you think its a bug in kernel code? > > ------------ > fp = tmpfile(); > fp->_chain = stderr; > fpclose(fp); > fp = NULL; strace that, and see how many times close() gets called. If it gets called once, it's a kernel bug. If it gets called once for each open file, it's a userspace bug. For bonus points, how did you verify that all the open files were closed? (Hint - what does that fp->_chain = stderr *really* do? ;)
Attachment:
pgpZzANJcGOas.pgp
Description: PGP signature
- Follow-Ups:
- Re: Quick close of all the open files.
- From: Måns Rullgård <[email protected]>
- Re: Quick close of all the open files.
- From: "vamsi krishna" <[email protected]>
- Re: Quick close of all the open files.
- References:
- Quick close of all the open files.
- From: "vamsi krishna" <[email protected]>
- Quick close of all the open files.
- Prev by Date: Driver model ISA bus
- Next by Date: Re: [PATCH 0/7] Detaching fbcon
- Previous by thread: Quick close of all the open files.
- Next by thread: Re: Quick close of all the open files.
- Index(es):