Re: linux system calls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 16, 2002 at 08:50:09AM +0100, Chanura Rajakaruna wrote:
> how can i read derectory contents
>  using old_readdir  system call

It has a manpage. man 2 readdir
                     ^^^

>   *this is for kernel programming 

Why do you need to do a readdir in kernel?

In kernel, you have to do the kernel_ds thing to make copy_to_user work
to kernel.

> (to develop msdos like shell)

That surely can and should be done in userspace (may need playing with
things like LD_PRELOAD, but it's sure possible).

>   *i want to develop ls command in init/main.c
>    file

No, you don't.

>    please help me
>    plaese help me

Well, what do you really want to do?

>    i  want to develop this type of function
> 
>    char *x(char *dirname)
>    {
> 
>      ??
> 
>   }
> 
>    /* Directory contents */
> 
>    printk(x("/usr"));

What is such a function good for? You can't do about anything useful at
all with it's result.

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@ucw.cz>
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux