I execute a system command from my application by resetting the errno value to 0.
EX:
errno = EOK;
system(“ls /nodir”);
printf(“error %d %s”, errno, strerror(errno));
I always get the output as 0, No errors even if the directory /nodir is not
present.
Any idea why this behaviour??? Iam using QNX6.3, SP2.
system will only set errno if it fails to run the command, not if the command itself fails. Look at system documentation to extract the return value of the command.