File: testsizes.c

package info (click to toggle)
sablevm 1.13-1.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 10,084 kB
  • ctags: 9,231
  • sloc: ansic: 127,926; sh: 8,886; asm: 5,548; makefile: 693
file content (25 lines) | stat: -rw-r--r-- 610 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <unistd.h>

extern void __clear_cache (char *beg, char *end);

int
main (void)
{
  int i;

  printf ("Size of char is %i\n", sizeof (char));
  printf ("Size of short is %i\n", sizeof (unsigned short));
  printf ("Size of int is %i\n", sizeof (int));
  printf ("Size of long int is %i\n", sizeof (long int));
  printf ("Size of long long int is %i\n", sizeof (long long int));
  printf ("Size of float is %i\n", sizeof (float));
  printf ("Size of double is %i\n", sizeof (double));

  i = getpagesize ();
  printf ("Size of page is %i\n", i);

  __clear_cache (&i, (&i) + sizeof (i));


  return 0;
}