Hi,<br><br>This C program might help you.<br><br>#include <stdio.h><br>#include <stdlib.h><br>#include <string.h><br>#include <errno.h><br>#include <sys/utsname.h><br><br>int main()<br>{<br> struct utsname *buf = NULL;<br>
<br><br><br> buf = malloc(sizeof(struct utsname));<br> if (buf == NULL) {<br> fprintf(stderr,"Memory Allocation Error: %s \n", strerror(errno));<br> exit(-1);<br> }<br><br> if (uname(buf) < 0) {<br>
fprintf(stderr,"UName Error: %s \n", strerror(errno));<br> exit(-1);<br> }<br><br> printf ("Processor arch =:>) %s \n", buf->machine);<br><br> return 0;<br>}<br><br><br><br>
<br><div class="gmail_quote">On Thu, Jan 27, 2011 at 4:45 PM, Henry Gebhardt <span dir="ltr"><<a href="mailto:hsggebhardt@googlemail.com">hsggebhardt@googlemail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Thu, Jan 27, 2011 at 03:23:28PM +0530, prabhu wrote:<br>
> Any C programming technique apart from using this /proc/cpuinfo detail?<br>
<br>
</div>What about using the machine field of uname(2):<br>
<br>
$ man 2 uname<br>
<br>
Quoting from that man page:<br>
<br>
[...] the operating system presumably knows its name, release<br>
and version. It also knows what hardware it runs on.<br>
<br>
Perhaps a downside, it returns the machine type as a string. Does that<br>
do what you want?<br>
<br>
I also find "man linux32" rather interesting:<br>
<br>
setarch - change reported architecture in new program environment<br>
and set personality flags<br>
<br>
Might be useful for testing.<br>
<br>
<br>
Greetings,<br>
<font color="#888888">Henry<br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><br><br>Thanks & Regards,<br>---------PraviN---------<br><br><br>