[color=red]nicinfo : Display information about a network interface controller
Exit status:
0 Successful completion.
1 An error occurred.
follow is my code:
#include <stdlib.h> #include <stdio.h>
int main(int argc, char *argv[]) {
int status;
printf(“Welcome to the Momentics IDE\n”);
status=system(“nicinfo /dev/io-net/en1”);
printf(“status=%d\n”,status);
return EXIT_SUCCESS;
}
From the docu: Use the WEXITSTATUS() macro to determine the low-order 8 bits of the termination status of the process.
(Note in the docu: 255 is equal to -1 on most systems, -1 can also be the shell, the command should run in, could not be executed,
generally this means something went wrong, but does not imply it was the command failed^^)
Returns:
If command is NULL, system() returns zero if the shell isn’t present, or a nonzero value if the shell is present.
If command isn’t NULL, system() returns the result of invoking a copy of the shell. If the shell couldn’t be loaded, system() returns -1; otherwise, it returns the status of the specified command. Use the WEXITSTATUS() macro to determine the low-order 8 bits of the termination status of the process.
They say it returns the status of the specified command, i may misunderstood that, but thats what it reads