Thanks for the replies.
I got some help from another resource, including the solution here in case this helps anyone else in the future:
1) on 64 bit Linux, size of int is 4 bytes. we're playing with the stack here so we need a 64 bit integer: the long type.
2) according to this resource: http://blog.markloiseau.com/2012/06/...nux-shellcode/
"you can no more define the shell code as a char array, because the shellcode character array is stored in the explicitly non-executable .rodata section of the ELF file" causing a segfault.
you have to insert it directly into the body of the main function.
3) the opcodes for x64 are different from those for x86.
the exit syscall is called differently.
the assembly for your shellcode on x64 would be:
mov rdi, 20
mov rax, 60