[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4AB906EE.5080300@arcor.de>
Date: Tue, 22 Sep 2009 20:18:38 +0300
From: Nikos Chantziaras <realnc@...or.de>
To: unlisted-recipients:; (no To-header on input)
CC: Brian McGrew <brian@...ionpro.com>, linux-kernel@...r.kernel.org
Subject: Re: (un)mount ramfs from C code
On 09/22/2009 08:13 PM, Nikos Chantziaras wrote:
> On 09/22/2009 07:04 PM, Brian McGrew wrote:
>> Good morning all!
>>
>> So I'm using a ramfs for temporary files, thank you whoever designed
>> that,
>> it works great!
>>
>> I can mkdir, mount, chmoud, readand write and then umount the thing
>> from the
>> command line just fine.
>>
>> What I need now is some method from within my C/C++ code to determine
>> if the
>> ramfs is mounted, if not, then mount it so I can use it and unmount it
>> when
>> I'm done, without making a system call.
>>
>> Can this be done? Is there any access to mount/unmount from C/C++?
>
> I suppose looking at the source code of the 'mount' utility could prove
> very enlightening. You can find it at:
>
> http://www.kernel.org/pub/linux/utils/util-linux-ng
Also, "man 2 mount" will provide docs about the the mount() function in
<sys/mount.h>. If for some reason that man page isn't provided in your
system, you can find a copy at:
http://linux.die.net/man/2/mount
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists