LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 08-09-2004, 09:16 AM   #1
appas
Member
 
Registered: Jul 2004
Posts: 72

Rep: Reputation: 15
difference between fget(fd) and current->files->fd[fd]


Can anyone please tell me the difference between
fget(filedesriptor) and current->files->fd[filedescriptor].
Does both return the same file pointer.
 
Old 08-09-2004, 09:46 AM   #2
itsme86
Senior Member
 
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246

Rep: Reputation: 58
I have no idea what fget() is, but it isn't a standard function. What's it supposed do (on your system)?
 
Old 08-09-2004, 09:54 AM   #3
appas
Member
 
Registered: Jul 2004
Posts: 72

Original Poster
Rep: Reputation: 15
Yes, it is not a part of libc function. fget is part of system function.
I am writing a kernel module and want to get information about a file reference count using the filedescriptor.I thought about getting the pointer to 'struct file' structure and there on i can get the other details about the file.
 
Old 08-09-2004, 11:46 AM   #4
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
well look at the code! fget() makes sure the fd is within the limit of max_open files, and if the process actually has that descriptor open. if it does, the reference count is incremented and the file structure is returned.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to extract difference between two files? Marshalle Linux - General 8 01-05-2011 01:45 PM
Difference between 10.1 and current distro? moffen Slackware 4 05-18-2005 10:58 PM
.rar files versus .iso files the difference? dolphans1 Mandriva 14 01-31-2005 10:33 AM
lost files in current kde 3.2.2 czar Slackware 1 04-24-2004 05:03 AM
list only files in current directory xscousr Programming 8 09-22-2003 08:35 AM


All times are GMT -5. The time now is 06:14 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration