Mount program
hi
i want to mount a hard disk programmaticallly, i wrote the code,it works well in linux 2.4 kernel, but when i run the same code in 2.6 it is not mounting . the code is given below #include <stdio.h> #include <sys/mount.h> int main() { int mounting; mounting = mount("/dev/hda1", "/mnt","vfat", MS_MGC_VAL," "); printf("%d", mounting); return 0; } is there anything i have to change in the code... plz help the value printed is -1.... viji |
Please tell us the error number:
Code:
#include <stdio.h> |
Never mind :p
|
hi
it gives the following error "Error:22 (Invalid Argument) |
helo
why no reply, u asked the error no plz help |
Can you mount the partition from shell using the same parameters?, e.g.:
# mount /dev/hda1 /mnt -t vfat |
yes i can mount at the terminal but using program it is not working...
|
Use 0 or NULL instead of " " for the last argument if you don't want to pass any data parameters to the filesystem.
|
All times are GMT -5. The time now is 11:59 AM. |