* updated suricata (7.0.6 -> 7.0.7)
[t2sde.git] / misc / archive / archtest.c
blob7c7766a395e916013ad096a2e635aa066b6242fd
1 /*
2 * --- T2-COPYRIGHT-NOTE-BEGIN ---
3 * T2 SDE: misc/archive/archtest.c
4 * Copyright (C) 2004 - 2022 The T2 SDE Project
5 *
6 * This Copyright note is generated by scripts/Create-CopyPatch,
7 * more information can be found in the files COPYING and README.
8 *
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 ---
14 #include <stdio.h>
15 #include <stdlib.h>
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";
23 int main() {
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");
32 return 0;