Skip to content

Instantly share code, notes, and snippets.

@niklas
Created January 3, 2011 22:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niklas/764119 to your computer and use it in GitHub Desktop.
Save niklas/764119 to your computer and use it in GitHub Desktop.
trying to find out if ruby 1.9.2 does not implement syscall() on amd64 because of the different sizes if int and long
/*
please do me a favour: do the following on a amd64 ubuntu
$ gcc -o sizeof64 sizeof64.c
$ ./sizeof64
are they different? would this be OK? If not, what could cause this?
If it is OK, why is ruby 1.9 not able to implement syscall()
https://github.com/ruby/ruby/blob/ruby_1_9_2/io.c#L7529
It's long time since I coded C so please forgive my missing -wall
*/
#include <stdio.h>
main() {
static int an_int = 23;
static long a_long = 23;
printf("size of int: %i\n", (int) sizeof((an_int)) );
printf("size of long: %i\n", (int) sizeof((a_long)) );
}
@nitram2342
Copy link

martin@neolith:/tmp$ ./sizeof64
size of int: 4
size of long: 8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment