public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tim Walberg <twalberg@comcast.net>
To: Brian McGrew <brian@visionpro.com>
Cc: Luciano Rocha <luciano@eurotux.com>, linux-kernel@vger.kernel.org
Subject: Re: (un)mount ramfs from C code
Date: Tue, 22 Sep 2009 14:53:53 -0500	[thread overview]
Message-ID: <20090922195353.GB22458@comcast.net> (raw)
In-Reply-To: <C6DE73D6.12872%brian@visionpro.com>

mount(2) (i.e. the system-call/library function) does not update /etc/mtab, IIRC...
mount(8) (the command-line utility) does...

In either case, I would expect the mount to show up in /proc/mounts (assuming
/proc is mounted).



On 09/22/2009 12:30 -0700, Brian McGrew wrote:
>>	> You mean without using system(3), right? System call is how your program
>>	> interacts with the outside world.
>>	> 
>>	> The relevant system calls are:
>>	>   - mount(2): mount("none", "/mnt", "ramfs", 0, NULL);
>>	>   - umount(2): umount("/mnt");
>>	> 
>>	
>>	Thanks for the help!  I'm getting there.  Considering the following:
>>	
>>	If (mount("ramfs", rd_path, "ramfs", MS_NOEXEC | MS_NOSUID, "size=2000m") <
>>	0) {
>>	    strerror(errno);
>>	} else {
>>	    std::cout << "mounted";
>>	}
>>	
>>	Works great!  Thank you.  However, even though the filesystem is mounted and
>>	/bin/mountpoint confirms it's a mountpoint, I do not see the mountpoint
>>	listed in /etc/mtab.
>>	
>>	Also, according to what I've read about ramfs, the size is supposed to be
>>	limited to size=, however, I can cat /dev/zero until the box it out of
>>	memory (and swap).
>>	
>>	I think I'm just missing something and google's not helping a whole lot
>>	since ramfs isn't the most popular subject today.
>>	
>>	Thanks,
>>	
>>	-b
>>	
>>	--
>>	To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>>	the body of a message to majordomo@vger.kernel.org
>>	More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>	Please read the FAQ at  http://www.tux.org/lkml/
End of included message



-- 
twalberg@comcast.net

  reply	other threads:[~2009-09-22 19:59 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 [this message]
2009-09-22 17:13 ` Nikos Chantziaras
2009-09-22 17:18   ` Nikos Chantziaras
2009-09-22 17:28 ` Matthias Schniedermeyer

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=20090922195353.GB22458@comcast.net \
    --to=twalberg@comcast.net \
    --cc=brian@visionpro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luciano@eurotux.com \
    /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