David Kuechenmeister <david.kuechenmeister@viasat.com> wrote:
Is this command allowed under QNX 6.1?
mount is kind of finicky.
Have you run fs-cifs already?
I note from the mount (utility doc) example it says:
Mount a CIFS filesystem (fs-cifs must be running first):
mount -t cifs -o abc,efg //node123:1.1.1.1:/C /ctest
char* server_data = “user user”;
From the mount util example, this may have to be “user,user” if used
in a mount command – not sure. (Or, mount may turn that into
“user user” – I don’t know.)
int datalen = strlen(server_data);
int mStat;
mStat = mount("//WINXP_SERVER:192.168.2.1:/shared_dir",
The problem may be here – that is a “null-terminated string that
describing a special device (e.g. /dev/hd0t77) that you want to
mount” – except that what you put in there isn’t a “special
device” in the QNX name space. Or, it may just be that you
aren’t running fs-cifs yet.
“/mnt/shared_dir”,
_MOUNT_ENUMERATE ,
“cifs”,
server_data,
datalen);
I ask because mount returns with a “function not implemented” error. Is
there another way to mount a shared cifs filesystem programmatically?
(warning I don’t know the details of how mount processing works, I’m
hypothesizing here based on general knowledge of how QNX generally does
things.)
If fs-cifs isn’t running, then type “cifs” probably hasn’t been registered,
so you are making a request for which support does not exist, and you get
back EOPNOTSUP (function not implemented).
I’ve
used fs-cifs in a shell script, but I was hoping for a different approach.
This was an attempt to copy the
fs-cifs //WINXP_SERVER:192.168.2.1:/shared_dir /mnt/shared_dir user user
syntax.
How about:
spawnl(P_NOWAIT, “fs-cifs”, “fs-cifs”,
“//WINXP_SERVER:192.168.2.1:/shared_dir”, “/mnt/shared_dir”,
“user”, “user”, NULL );
The docs for fs-cifs do say:
If you want to mount filesystems separately, start fs-cifs without
arguments, as a daemon, then create your mountpoints using mount
specifying cifs as the type. See below for an example.
Of course, this only gives command-line examples, rather than using the
mount() call.
But, I’d bet your main problem is that you didn’t run fs-cifs first.
-David
QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.