Janani K
|
system("ls -l") hangs if used after calling ConnectAttach (0, 0, gi4QnxTmrChid, 0, 0)
|
Janani K
03/01/2010 1:22 AM
post48483
|
system("ls -l") hangs if used after calling ConnectAttach (0, 0, gi4QnxTmrChid, 0, 0)
Hi,
Iam giving the code snippet I used
printf("\nGoing for System above ConnectAttach\n");
if(-1 == system("ls -l"))
printf("\nsystem error\n");
printf("\nsystem is executed fine\n");
/* create a connection back to ourselves */
i4Coid = ConnectAttach (0, 0, gi4QnxTmrChid, 0, 0);
if (i4Coid == -1)
{
OSIX_PRNT ("-E QNX Timer channel couldn't ConnectAttach to self\n");
ChannelDestroy (gi4QnxTmrChid);
return (OSIX_FAILURE);
}
printf("\nGoing for System below ConnectAttach\n");
if(-1 == system("ls -l"))
printf("\nsystem error\n");
printf("\nsystem is executed fine\n");
When I tried with this the system() above ConnectAttach is executed fine.But the one below ConnectAttach is hanging
and its not returning even -1.
But when I change the 4th argument of ConnectAttach as _NTO_SIDE_CHANNEL
or 5th argument as _NTO_SIDE_CHANNEL both the system() above and below are executed fine.
By analysis what I found is system() is hanging because SIGCHLD is not coming to parent from the child that is
created by system().
Can anyone give reasons for this kind of behaviour?
|
|
|