public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthias Schniedermeyer <ms@citd.de>
To: Brian McGrew <brian@visionpro.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: (un)mount ramfs from C code
Date: Tue, 22 Sep 2009 19:28:19 +0200	[thread overview]
Message-ID: <20090922172819.GA27978@citd.de> (raw)
In-Reply-To: <C6DE438F.127DA%brian@visionpro.com>

On 22.09.2009 09:04, 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++?

The "/bin/mountpoint"-util appears to stat the mountpoint and it's 
parent directory and compares if they have the same device-no (st_dev). 
If they are different, then something is mounted.






Bis denn

-- 
Real Programmers consider "what you see is what you get" to be just as 
bad a concept in Text Editors as it is in women. No, the Real Programmer
wants a "you asked for it, you got it" text editor -- complicated, 
cryptic, powerful, unforgiving, dangerous.


      parent reply	other threads:[~2009-09-22 17:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-22 16:04 (un)mount ramfs from C code Brian McGrew
2009-09-22 16:26 ` Luciano Rocha
2009-09-22 19:30   ` Brian McGrew
2009-09-22 19:53     ` Tim Walberg
2009-09-22 17:13 ` Nikos Chantziaras
2009-09-22 17:18   ` Nikos Chantziaras
2009-09-22 17:28 ` Matthias Schniedermeyer [this message]

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=20090922172819.GA27978@citd.de \
    --to=ms@citd.de \
    --cc=brian@visionpro.com \
    --cc=linux-kernel@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