I take it that you don't want the i686 result to appear on the standard console, the way it is doing?
You want to pipe the output from uname into your program. Instead of using the system call, use popen.
man popen will get you going, but it looks like this:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main()
{
FILE *stream;
char sys[5],*sysptr;
sysptr = &sys[0];
sys[4] = 0x0;
stream=popen("/bin/uname -m","r");
fread(sysptr,1,4,stream);
pclose(stream);
printf("%s\n",sysptr);
}
You might want to clean that up a bit and generalize it.