C Board  

Go Back   C Board > Platform Specific Boards > Linux Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 01-13-2003, 08:05 PM   #1
Registered User
 
Join Date: Dec 2001
Posts: 7
Question The mount function

Hello,

Can anyone help me with this?

This is the code:

ret = mount(DEVICE_FILE, MOUNT_DIR, "vfat", MS_MGC_VAL, NULL);

I have all of the values figured out except MS_MGC_VAL. It is an unsigned long int passed to the mount function and is used for a read/write flag.

This is the error:

hda: hda1
hda: hda1
[Error] Can not Open conftest
[Error] Testing all
Segmentation fault
[root@Linux /root]$mount
/dev/ram0 on / type ext2 (rw)
/proc on /proc type proc (rw)
none on /dev/pts type devpts (rw)
/dev/hda1 on /flash type vfat (rw)
[root@Linux /root]$

As you can see the drive does get mounted in the code. I can read and write to it after the program has exited. The drive was not mounted before executing the program.

I can't figure out what this value should be set at or if this is the problem.

Thanks for any help,

Matt
mattbrrtt is offline   Reply With Quote
Old 01-13-2003, 08:38 PM   #2
Registered User
 
Join Date: Nov 2002
Posts: 491
Did you try reading errno? It is there for a reason.
orbitz is offline   Reply With Quote
Old 01-13-2003, 08:39 PM   #3
+++ OK NO CARRIER
 
quzah's Avatar
 
Join Date: Oct 2001
Posts: 10,615
Just take a look at the man page for said function...

If the magic number is absent, then the last two arguments are not used

Quzah.
__________________
Hundreds of thousands of dipshits can't be wrong.


Are you up for the suck?
quzah is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Seg Fault in Compare Function tytelizgal C Programming 1 10-25-2008 03:06 PM
Another syntax error caldeira C Programming 31 09-05-2008 01:01 AM
In over my head Shelnutt2 C Programming 1 07-08-2008 06:54 PM
Including lib in a lib bibiteinfo C++ Programming 0 02-07-2006 02:28 PM
Dikumud maxorator C++ Programming 1 10-01-2005 06:39 AM


All times are GMT -6. The time now is 04:07 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22