2001-04-03 09:23:55

by s.srinivas

[permalink] [raw]
Subject: how to create in proc

hi all,

i am new comer into the world of linux.i want to create a
subdirectory in /proc directory. Already i know have to create
a file in the /proc filesystem.

So kindly help me, what are the system calls/fuction calls to be used
for the creation of sub-directory in /proc directory.

thank u
srinivas


2001-04-03 09:35:46

by Ingo Molnar

[permalink] [raw]
Subject: Re: how to create in proc


On Tue, 3 Apr 2001, Srinivas Surabhi wrote:

> So kindly help me, what are the system calls/fuction calls to be
> used for the creation of sub-directory in /proc directory.

eg. to create a new "foo" directory in /proc/net:

new_dir = proc_mkdir("foo", proc_net);

then use the resulting dir entry to create files in this new directory:

entry = create_proc_entry("bar", 0700, new_dir);

and use remove_proc_entry() on the file entry and on the directory entry
to clean things up.

Ingo