From: "John T. Williams" <jowillia@vt.edu>
To: jtwilliams@vt.edu
Cc: linux-c-programming@vger.kernel.org
Subject: Re: [Fwd: Re: Implementing a file counter (like "ls | wc")]
Date: 07 Apr 2004 21:01:47 -0400 [thread overview]
Message-ID: <1081386105.20924.1.camel@Marx.fesnel.no-ip.org> (raw)
In-Reply-To: <200404090200.36787.meren@comu.edu.tr>
[-- Attachment #1: Type: text/plain, Size: 2061 bytes --]
I just want to say after much testing, I've gone and proved myself
wrong.
Anyone interested in playing with the concept I've included the code.
On Thu, 2004-04-08 at 22:00, A. Murat Eren wrote:
> 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.
[-- Attachment #2: ls.tgz --]
[-- Type: application/x-gzip, Size: 908 bytes --]
next prev parent reply other threads:[~2004-04-08 1:01 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
2004-04-08 1:01 ` John T. Williams [this message]
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=1081386105.20924.1.camel@Marx.fesnel.no-ip.org \
--to=jowillia@vt.edu \
--cc=jtwilliams@vt.edu \
--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).