Shouqin Huo <huo@qm.com> wrote:
Thanks. This starts to make sense now.
Our problem is that we are using the name_attach/name_open mechanism to
establish links between processes. There does not seem to be a way to
specify the _NTO_SIDE_CHANNEL flag with name_attach.
The name_open() will automatically set the _NTO_SIDE_CHANNEL index
parameter for its ConnectAttach() call.
For example, if I print out the coid returned by a name_open(), I get:
1073741825, which is 0x40000001 – the side channel range.
If I proceed to spawn from this, it works fine.
My test programs:
#include <stdio.h>
#include <errno.h>
#include <sys/iofunc.h>
#include <sys/dispatch.h>
int main()
{
int ret;
name_attach_t *attach;
attach = name_attach( NULL, “myname”, 0 );
if( NULL == attach )
{
printf(“failed 1st, errno %d\n”, errno );
}
else
{
printf(“succeeded first\n”);
}
sleep(5000);
}
#include <stdio.h>
#include <errno.h>
#include <process.h>
#include <sys/iofunc.h>
#include <sys/dispatch.h>
int main()
{
int ret;
int coid;
coid = name_open( “myname”, 0 );
if( coid == -1 )
{
printf(“failed, errno %d\n”, errno );
exit(0);
}
printf(“coid is %d, %x\n”, coid, coid );
ret = spawnl( P_NOWAIT, “/bin/echo”, “echo”, “hello there”, NULL );
printf(“spawn returned %d, errno %d\n”, ret, errno );
sleep(50);
}
-David
QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.