confusion on fopen()/falloc()
From: Yan Yu (yanyu_at_CS.UCLA.EDU)
Date: 02/26/05
- Previous message: Yan Yu: "send file descriptor via ipc"
- In reply to: Yan Yu: "send file descriptor via ipc"
- Next in thread: Yan Yu: "Re: confusion on fopen()/falloc()"
- Reply: Yan Yu: "Re: confusion on fopen()/falloc()"
- Reply: John-Mark Gurney: "Re: confusion on fopen()/falloc()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 26 Feb 2005 01:10:46 -0800 (PST) To: freebsd-hackers@freebsd.org
Hello, all,
I have a user program as below:
FILE *fd;
while (1)
{
fd= fopen( "tmp", "r" );
if ( fd == NULL )
break;
}
from my understanding, since i open the same file to read, my process
should create a new file descriptor each time when fopen is called.
Therefore, inside the kernel, fdalloc() should be called, NOT falloc()
(since falloc() allocates a new FILE * struct in addition to a new file
descriptor),
BUT based on what i observed (i instrumented falloc() function), it seems
that falloc() is called each time when fopen() is called.
I am wondering where i missed?
Any hints is appreciated!
Best,
yan
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
- Previous message: Yan Yu: "send file descriptor via ipc"
- In reply to: Yan Yu: "send file descriptor via ipc"
- Next in thread: Yan Yu: "Re: confusion on fopen()/falloc()"
- Reply: Yan Yu: "Re: confusion on fopen()/falloc()"
- Reply: John-Mark Gurney: "Re: confusion on fopen()/falloc()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|