linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Remounting File Systems
@ 2003-11-20 16:41 Joseph D. Wagner
  2003-11-21  4:48 ` Glynn Clements
  2003-11-21 17:03 ` Jamie LeTual
  0 siblings, 2 replies; 5+ messages in thread
From: Joseph D. Wagner @ 2003-11-20 16:41 UTC (permalink / raw)
  To: linux-c-programming

I'm writing a program that has to remount a file system on the fly for the 
purpose of changing the mount flags.

Is there any system function that can tell me what the mount flags are for a 
currently mounted file system?

TIA.

Joseph D. Wagner


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Remounting File Systems
  2003-11-21  4:48 ` Glynn Clements
@ 2003-11-20 18:03   ` Joseph D. Wagner
  2003-11-21  7:59     ` Glynn Clements
  0 siblings, 1 reply; 5+ messages in thread
From: Joseph D. Wagner @ 2003-11-20 18:03 UTC (permalink / raw)
  To: Glynn Clements; +Cc: linux-c-programming

> > I'm writing a program that has to remount a file system on the fly for
> > the purpose of changing the mount flags.
> >
> > Is there any system function that can tell me what the mount flags are
> > for a currently mounted file system?
>
> setmntent/getmntent/endmntent, possibly in conjunction with hasmntopt.

Nice try, but there's still the unlikely chance that /etc/fstab or /etc/mtab 
have not been updated to reflect the CURRENTLY MOUNTED file system.

Joseph D. Wagner


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Remounting File Systems
  2003-11-20 16:41 Remounting File Systems Joseph D. Wagner
@ 2003-11-21  4:48 ` Glynn Clements
  2003-11-20 18:03   ` Joseph D. Wagner
  2003-11-21 17:03 ` Jamie LeTual
  1 sibling, 1 reply; 5+ messages in thread
From: Glynn Clements @ 2003-11-21  4:48 UTC (permalink / raw)
  To: Joseph D. Wagner; +Cc: linux-c-programming


Joseph D. Wagner wrote:

> I'm writing a program that has to remount a file system on the fly for the 
> purpose of changing the mount flags.
> 
> Is there any system function that can tell me what the mount flags are for a 
> currently mounted file system?

setmntent/getmntent/endmntent, possibly in conjunction with hasmntopt.

-- 
Glynn Clements <glynn.clements@virgin.net>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Remounting File Systems
  2003-11-20 18:03   ` Joseph D. Wagner
@ 2003-11-21  7:59     ` Glynn Clements
  0 siblings, 0 replies; 5+ messages in thread
From: Glynn Clements @ 2003-11-21  7:59 UTC (permalink / raw)
  To: Joseph D. Wagner; +Cc: linux-c-programming


Joseph D. Wagner wrote:

> > > I'm writing a program that has to remount a file system on the fly for
> > > the purpose of changing the mount flags.
> > >
> > > Is there any system function that can tell me what the mount flags are
> > > for a currently mounted file system?
> >
> > setmntent/getmntent/endmntent, possibly in conjunction with hasmntopt.
> 
> Nice try, but there's still the unlikely chance that /etc/fstab or /etc/mtab 
> have not been updated to reflect the CURRENTLY MOUNTED file system.

In which case, I think that you're stuffed; /proc/mounts doesn't list
the mount flags (apart from ro/rw), [f]statfs() doesn't provide this
information, and I can't see any plausible-looking ioctl()s.

-- 
Glynn Clements <glynn.clements@virgin.net>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Remounting File Systems
  2003-11-20 16:41 Remounting File Systems Joseph D. Wagner
  2003-11-21  4:48 ` Glynn Clements
@ 2003-11-21 17:03 ` Jamie LeTual
  1 sibling, 0 replies; 5+ messages in thread
From: Jamie LeTual @ 2003-11-21 17:03 UTC (permalink / raw)
  To: Joseph D. Wagner; +Cc: linux-c-programming

Use the Source, Luke!

I would look at the source code for mount(8)

Peace,
Jamie

Joseph D. Wagner wrote:

>I'm writing a program that has to remount a file system on the fly for the 
>purpose of changing the mount flags.
>
>Is there any system function that can tell me what the mount flags are for a 
>currently mounted file system?
>
>TIA.
>
>Joseph D. Wagner
>
>-
>To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>  
>




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-11-21 17:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-20 16:41 Remounting File Systems Joseph D. Wagner
2003-11-21  4:48 ` Glynn Clements
2003-11-20 18:03   ` Joseph D. Wagner
2003-11-21  7:59     ` Glynn Clements
2003-11-21 17:03 ` Jamie LeTual

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).