On Thu, 2003-06-26 at 20:45, [EMAIL PROTECTED] wrote:
> tirumal b <[EMAIL PROTECTED]> said:
> 
> > hello,
> > 
> > i have tried to create files in /proc but i am not
> > able to do so. This is the code i have written and it
> > generates some errors.
> > 
> 
> /proc isn't a 'real' file system.  It's a virtual representation of your
> machine/os environment and kernel, and gives you some access to ongoing
> operations.  Under most conditions you cannot write to that directory.
> 
> best
>     rickf

Upon initial inspection, the code seems valid.  I'm guessing the problem
is that creating entries in /proc can only be done by kernel code.  This
is not kernel code, it's application code.

> > #include<stdio.h>
> > #include<sys/types.h>
> > #include<linux/proc_fs.h>
> > main()
> > {
> > const char* name="CPU";
> > mode_t mode=444;
> > struct proc_dir_entry *l;
> > l=create_proc_entry(name,mode,NULL);
> > }
> > 
> > gcc -c example.c
> > In file included from example.c:3:
> > /usr/include/linux/proc_fs.h:70: parse error before
> > "atomic_t"
> > /usr/include/linux/proc_fs.h:72: parse error before
> > "rdev"
> > /usr/include/linux/proc_fs.h:187: parse error before
> > "kdev_t"
> > /usr/include/linux/proc_fs.h:203: parse error before
> > "void"
> > 
> >  i have tried to include linux/kdev_t.h and
> > asm/atomic.h but the errors persist. could anyone tell
> > me what is the problem.
> > 
> > Thank you

-- 
David Hollister
Furthurnet - Free, legal P2P - share the tunes:  http://furthurnet.org


-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/redhat-list

Reply via email to