linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "A. Murat Eren" <meren@comu.edu.tr>
To: Holger Kiehl <Holger.Kiehl@dwd.de>
Cc: linux-c-programming@vger.kernel.org
Subject: Re: [Fwd: Re: Implementing a file counter (like "ls | wc")]
Date: Thu, 8 Apr 2004 00:06:00 +0000 (UTC)
Date: Fri, 9 Apr 2004 02:00:36 +0000	[thread overview]
Message-ID: <200404090200.36787.meren@comu.edu.tr> (raw)
In-Reply-To: <Pine.LNX.4.58.0404072202460.31808@praktifix.dwd.de>


 Hi,

 I've read all of the mailing thread about this subject and i'd like to ask 
some questions..

> But most important always try to avoid system calls!

 I guess eveybody is accepting that the syscalls is slowing down the process 
when invoking them from the critical parts of the code (i hope i understand 
properly).. I'm trying to write a basic shell for me (just for fun, nothing 
serious), i'm setting up my user's shell in passwd file to my basic shell's 
compiled binary, and when i'm logging in from the console, normally i'm 
falling to a prompt which is written by me.

 I'm not using the well-known programs such as 'ls', 'cd' etc.. i have my own 
envoriment variables and my own basic programs those are invoking from my 
prompt with fork and execvp. If i do not want to use the syscalls such as 
readdir, opendir what i must do?

 With readdir, i can read everything from the every type of file system which 
supported by kernel *transparently*, for example when i'm working on a disk 
partition which is formatted with ext3 file system i don't have to try to 
read the superblocks and inode's adresses from disk because VFS takes care 
all of the low level operations via readdir (and kernel's modules for that 
file system) for me, isn't it? If i want to do all of them by my self (sure, 
this is not necessary but i just want to try and learn) which is the right 
way i have to go? I thought that it would be a very simple and absolute way 
looking into the glibc for implementations of the functions like readdir, but 
nearly i'm sure that it would be impossible to undrstand (and this is another 
problem, i can't understand the source code usually :( it would be great to 
hear your advices about how i improve my vision).


 Thanks for your time from now,
 Regards.
-- 


- -- -- -- -- -- -- -- -- -- -- -- -- -- -
 A. Murat Eren
 meren@comu.edu.tr, evreniz@core.gen.tr
 http://zion.comu.edu.tr/~evreniz/
- -- -- -- -- -- -- -- -- -- -- -- -- -- -

--
 free software is a matter of liberty,
 not price. to understand the concept,
 you should think of "free speech",
 not "free beer".
-

  reply	other threads:[~2004-04-08  0:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-07 16:50 [Fwd: Re: Implementing a file counter (like "ls | wc")] Luciano Moreira - igLnx
2004-04-07 16:54 ` John T. Williams
2004-04-07 22:29   ` Holger Kiehl
2004-04-08  0:06     ` A. Murat Eren [this message]
2004-04-08  1:01       ` John T. Williams
2004-04-08  4:39       ` Glynn Clements
2004-04-08  8:05         ` A. Murat Eren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200404090200.36787.meren@comu.edu.tr \
    --to=meren@comu.edu.tr \
    --cc=Holger.Kiehl@dwd.de \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).