>Приветствую.
>
>Как получить return code команды вызываемой через system(cmd) ? man 3 system:
...
int system(const char *string);
The value returned is -1 on error (e.g. fork failed), and the return status of the command otherwise. This latter
return status is in the format specified in wait(2). Thus, the exit code of the command will be WEXITSTATUS(sta-
tus).
...
man 2 wait:
...
WEXITSTATUS(status)
evaluates to the least significant eight bits of the return code of the child which terminated, which may
have been set as the argument to a call to exit() or _exit() or as the argument for a return statement in the
main program. This macro can only be evaluated if WIFEXITED returned true.
...