* updated kpat (21.12.1 -> 21.12.2), untested
[t2-trunk.git] / misc / archive / archtest.c
blob6b5e40fa0219712364d771121020bf99a3e1b14b
1 #include <stdio.h>
3 char * isbigendian () {
4 /* Are we little or big endian? From Harbison&Steele. */
5 union { long l; char c[sizeof (long)]; } u;
6 u.l=1; return (u.c[0] == 1)?"no":"yes";
9 int main() {
10 printf("arch_sizeof_short=%d\n",sizeof(short));
11 printf("arch_sizeof_int=%d\n",sizeof(int));
12 printf("arch_sizeof_long=%d\n",sizeof(long));
13 printf("arch_sizeof_long_long=%d\n",sizeof(long long));
14 printf("arch_sizeof_char_p=%d\n",sizeof(char *));
15 printf("arch_bigendian=%s\n",isbigendian());
16 printf("arch_machine="); fflush(stdout); system("uname -m");
17 system("echo arch_target=`uname -m -p | tr ' ' -`-linux");
18 return 0;