View topic - spawn problems

spawn problems

Read-only archive of qnx.rtos (Writing resources managers, and general discussion around the QNX Neutrino RTOS) at inn.qnx.com

spawn problems

Postby NDT Technologies Inc. » Wed Jan 21, 2004 6:32 pm

Hi All,

I’m trying to figure out how I can spawn a process on a remote thread
without it being
linked to the parent’s file system in code. Using the “on –d –f
nodename” I can start the
remote process and it works correctly. Using the following C code
spawns the process
but it terminates on errors.

struct inheritance spawn_params;
memset(&spawn_params, 0, sizeof(struct inheritance));

spawn_params.flags = SPAWN_SETND | SPAWN_NOZOMBIE;
spawn_params.nd = netmgr_strtond(“thisnode”, NULL);

ResultPID = spawn(NetFileAndPath, 0, NULL, &spawn_params, args, NULL);

The problem is that the remote application uses “pci_attach” to locate
and map to a PCI
device. When it is spawned, it scans the parents PCI server instead of
the remote
computers. Anyone know a workaround to this?


Also, I’ve noticed that my network shares using fs-cifs suddenly become
inaccessible
after a while of non-activity (hours or minutes, it depends).
Afterwards any process
trying to list their folders will block. Is fs-cifs known to be
unreliable or am I
experiencing something out of the ordinary? I’m connecting to a windows
2000 SP4
share, and other then the unexpected timeouts it works great.

Thanks,
Lee
NDT Technologies Inc.
 

Re: spawn problems

Postby cdm » Wed Jan 21, 2004 6:32 pm

The problem is that the remote application uses ?pci_attach? to locate
and map to a PCI
device. When it is spawned, it scans the parents PCI server instead of
the remote
computers. Anyone know a workaround to this?


The child (or the parent) has to chroot() to the remote node's root path.

chroot("/net/machine/");


chris

--
Chris McKillop <cdm@qnx.com> "The faster I go, the behinder I get."
Software Engineer, QSSL -- Lewis Carroll --
http://qnx.wox.org/
cdm
QNX Master
 
Posts: 789
Joined: Fri Jul 05, 2002 9:38 am

Re: spawn problems

Postby NDT Technologies Inc. » Thu Jan 22, 2004 2:18 pm

That did the trick!

Thank you ^_^

---
Lee
NDT Technologies Inc.
 

Re: spawn problems

Postby Xiaodan Tang » Fri Jan 23, 2004 4:01 am

Chris McKillop <cdm@qnx.com> wrote in message
news:bumgkm$83s$1@inn.qnx.com...
The problem is that the remote application uses ?pci_attach? to locate
and map to a PCI
device. When it is spawned, it scans the parents PCI server instead of
the remote
computers. Anyone know a workaround to this?


The child (or the parent) has to chroot() to the remote node's root path.

chroot("/net/machine/");

Should have the parent do it, othereise, the child could endup loading .so
file
from the parent machine.

-xtang
Xiaodan Tang
 


Return to qnx.rtos

Who is online

Users browsing this forum: No registered users and 5 guests