about mount func.

T

tguclu

Hi there,

I hope this is the right place for my question if not please accept
my
apologies.

In my application I want to mount/umount file system. From GNU C
Library
Reference Manual, for Version 2.3.x.


I have found 'HOW TO MOUNT/UMOUNT'


Below is the code

#include <sys/mount.h>




mount(dev,dest , MS_MGC_VAL | MS_RDONLY | MS_NOSUID,"");

//dev = "/dev/scsi/host0/bus0/target0/lun0/part1"
//dest= "mnt/removable


But compiler gives this error;
To few arguments to function 'mount'


According to reference there are enough numbers of parameters , but
couldn't
find it gives this error.


Kernel Version is:
Linux ts7000 2.4.26-ts11 #1 Mon Dec 18 16:31:10 MST 2006 armv4l GNU/
Linux

And the GCC version is :
gcc (GCC) 3.3.5 (Debian 1:3.3.5-13)


Thanks..
 
J

Joachim Schmitz

tguclu said:
Hi there,

I hope this is the right place for my question if not please accept
my
apologies.
Apparently it is not, A Linux or Gnu group might be more appropriate

In my application I want to mount/umount file system. From GNU C
Library
Reference Manual, for Version 2.3.x.


I have found 'HOW TO MOUNT/UMOUNT'


Below is the code

#include <sys/mount.h>




mount(dev,dest , MS_MGC_VAL | MS_RDONLY | MS_NOSUID,"");

//dev = "/dev/scsi/host0/bus0/target0/lun0/part1"
//dest= "mnt/removable


But compiler gives this error;
To few arguments to function 'mount'


According to reference there are enough numbers of parameters , but
couldn't
find it gives this error.
Then your reference is wrong, according to mine mount() takes 5 arguments,
not 4:

int mount(const char *source, const char * target, const char
*filesystemtype, unsigned long mountflags, const void *data);

As you could have found out easily by simply reading
/usr/include/sys/mount.h (just as your compiler apparently did)

You ommitted the 3rd argument, the filesystem type.
Kernel Version is:
Linux ts7000 2.4.26-ts11 #1 Mon Dec 18 16:31:10 MST 2006 armv4l GNU/
Linux

And the GCC version is :
gcc (GCC) 3.3.5 (Debian 1:3.3.5-13)


Thanks..
Bye, Jojo
 
T

tguclu

Apparently it is not, A Linux or Gnu group might be more appropriate











Then your reference is wrong, according to mine mount() takes 5 arguments,
not 4:

int mount(const char *source, const char * target, const char
*filesystemtype, unsigned long mountflags, const void *data);

As you could have found out easily by simply reading
/usr/include/sys/mount.h (just as your compiler apparently did)

You ommitted the 3rd argument, the filesystem type.






Bye, Jojo

Thanks..i should check the reference doc. again ..it states only 4
params..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top