Example of using mount() function?

Joe Marcus Clarke marcus at marcuscom.com
Sun Nov 1 20:24:19 UTC 2009

On Sun, 2009-11-01 at 14:12 -0600, Peter Steele wrote:
> I want to call the mount() function to perform the same action as running the following mount command from the command line:
>                 mount -t ufs -o noatime /dev/adXXX /mnt
> The man page lists the signature of mount() as
>                 int mount(const char *type, const char *dir, int flags, void *data);
> The problem is that the last parameter, data, apparently has to be in a special structure based on the file system type and it does not describe what this structure is for ufs. It says "The format for these argument structures is described in the manual page for each file system", then it follows this up saying that there is no man page for ufs?
> I did some searches but could not find a single example of what needs to be plugged into this parameter. Can anyone fill in the missing info?

See /usr/src/sbin/mount/mount_ufs.c from RELENG_6.  Essentially, this
argument should be a ufs_args struct as defined
in /usr/include/ufs/ufs/ufsmount.h.


PGP Key : http://www.marcuscom.com/pgp.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: This is a digitally signed message part
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20091101/e7b35a74/attachment.pgp

More information about the freebsd-questions mailing list