LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-23-2013, 03:55 PM   #1
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,771
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
how to find "feature" in the source code


Can someone please steer me to the appropriate readings -- either in some doc files somewhere or into the appropriate code? (I hope that someone has written a detailed explanation that answers my question without the need to read and desk-execute pages of arcane 'C' or similar.)

My program uses fopen( "/myPath/myFile.dat" ) or one of the dozens of related calls that asks for access to a file on disk. In the case of a literal call to "fopen( )" it lives in the 'C' run-time-library.

Somewhere in that library, there are calls to more detailed services.
In no particular order:
  • which file system is involved
  • do we need other services, like auto-mount, to make the
    requested file system available
  • how does that file system handle file paths
  • how does that file system handle file names
  • how does that file system handle ownership
  • how does that file system handle permissions
  • are access control lists used in addition to "permissions"

The services perform a pachinko-machine-like set of decisions that either grant or deny my request to access the named file. If my request gets granted, then the services pass some sort of "file handle" or "file pointer" or "file object" back to my code.

Thanks in advance,
~~~ 8d;-/ Dan
 
Old 06-23-2013, 08:07 PM   #2
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
The C library ends up calling the open() system call in the kernel which is where most of what you describe takes place.
 
1 members found this post helpful.
Old 07-01-2013, 03:38 PM   #3
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,771

Original Poster
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
Quote:
Originally Posted by linosaurusroot View Post
The C library ends up calling the open() system call in the kernel which is where most of what you describe takes place.
Thanks for confirming what I suspected. How do I discover where to find this system call? Okay, grep -e "open\(*\)" *.c or similar...

Seriously, is there any kernel code reading support available as developer workbench or tools? Can someone get me close in terms of "components" or "sub-systems" or something?

Is there some sort of kernel code "road map" or "index" to system calls?

Thanks, again,
~~~ 0;-Dan
 
Old 07-01-2013, 07:38 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Relevant reading http://www.linuxtopia.org/online_boo...nel_index.html
 
  


Reply

Tags
access, code, file system, ownership, permissions



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
Red Hat 6 :Where can I find the source code of "useradd" redrat Linux - Software 3 09-08-2011 04:09 PM
Telling people to use "Google," to "RTFM," or "Use the search feature" Ausar General 77 03-21-2010 11:26 AM
"Click Here to Find Similar Threads" Greatest Feature Ever calid LQ Suggestions & Feedback 2 07-01-2009 11:58 AM
How to convert Assembly code to "C" source code ssg14j Programming 2 08-01-2005 12:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:29 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration