Parameters needed to "mount()" function

Hi all,

please can someone describe how to call the “mount()” function from a C
program to obtain the equivalent “mount -e /dev/hdx” command result?
The following code fails with error N.22 i.e. “invalid aurgument”:

mount("/dev/hd1",NULL,_MOUNT_ENUMERATE,NULL,NULL,0)

Regards,
Maurizio Rossi

Maurizio Rossi wrote:

please can someone describe how to call the “mount()” function from a C
program to obtain the equivalent “mount -e /dev/hdx” command result?
The following code fails with error N.22 i.e. “invalid aurgument”:

mount("/dev/hd1",NULL,_MOUNT_ENUMERATE,NULL,NULL,0)

This shuold do it:

mount("/dev/hd1", “/”, _MOUNT_ENUMERATE, “”, NULL, -1)

[I think the main difference is the NULL vs “/” part?]

Thank you John, it works.

Regards,
Maurizio Rossi


“John Garvey” <jgarvey@qnx.com> ha scritto nel messaggio
news:efr9b1$9mv$1@inn.qnx.com

Maurizio Rossi wrote:
please can someone describe how to call the “mount()” function from a C
program to obtain the equivalent “mount -e /dev/hdx” command result?
The following code fails with error N.22 i.e. “invalid aurgument”:

mount("/dev/hd1",NULL,_MOUNT_ENUMERATE,NULL,NULL,0)

This shuold do it:

mount("/dev/hd1", “/”, _MOUNT_ENUMERATE, “”, NULL, -1)

[I think the main difference is the NULL vs “/” part?]