mount / umount

Alberto Narduzzi <[email protected]> Mon, 3 Nov 2003 15:52:24 +0100
Newsgroups gmane.comp.lang.delphi.kylix
Organization MEP SpA
Message-ID <[email protected]>
Dear sirs,

I'm using, well, trying to use, the following two functions from the Libc 
unit; defined as follows:

function mount(__special_file: PChar; __dir: PChar; __fstype: PChar; __rwflag: 
Cardinal; __data: Pointer): Integer; cdecl;

function umount(__special_file: PChar): Integer; cdecl;

I'm calling mount as follows:

res:=mount('/dev/sda1','/media/flash','auto',0,nil);

but I always get res=-1 (= error)

I did it in a console application (called xmount), run in a shell as root.
Provided the /dev/sda1 and /media/flash exists, if I call mount /dev/sda1 
/media/flash I get the device mounted, while if I call my program (xmount) I 
don't, 'cause of the -1 above.
Where am I wrong?

TIA

-- 
Alberto Narduzzi
MEP SpA - Software dept.


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/i7folB/TM
---------------------------------------------------------------------~->

-------------------------------------------------------
Forum / mailing list for Borland Kylix programmers
Our web page:  http://groups.yahoo.com/group/kylixgroup
To join the forum: [email protected]
To unsubscribe:  [email protected]
To post your messages:       [email protected]
To contact the moderator:  [email protected]
------------------------------------------------------- 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/