2 * --- T2-COPYRIGHT-NOTE-BEGIN ---
3 * T2 SDE: misc/archive/archtest.c
4 * Copyright (C) 2004 - 2022 The T2 SDE Project
6 * This Copyright note is generated by scripts/Create-CopyPatch,
7 * more information can be found in the files COPYING and README.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2.
11 * --- T2-COPYRIGHT-NOTE-END ---
17 char * isbigendian () {
18 /* Are we little or big endian? From Harbison&Steele. */
19 union { long l
; char c
[sizeof (long)]; } u
;
20 u
.l
=1; return (u
.c
[0] == 1)?"no":"yes";
24 printf("arch_sizeof_short=%d\n",sizeof(short));
25 printf("arch_sizeof_int=%d\n",sizeof(int));
26 printf("arch_sizeof_long=%d\n",sizeof(long));
27 printf("arch_sizeof_long_long=%d\n",sizeof(long long));
28 printf("arch_sizeof_char_p=%d\n",sizeof(char *));
29 printf("arch_bigendian=%s\n",isbigendian());
30 printf("arch_machine="); fflush(stdout
); system("uname -m");
31 system("echo arch_target=`uname -m -p | tr ' ' -`-linux");